AmendHub

Download:

jcs

/

amend

/

amendments

/

18

util: Remove TECanAddLine and TEAppendFast no longer used


jcs made amendment 18 over 2 years ago
--- util.c Mon Oct 18 13:14:58 2021 +++ util.c Sat Oct 23 22:25:38 2021 @@ -547,49 +547,3 @@ TrackMouseDownInControl(ControlHandle control, short p TEScroll(0, -adj * lheight, track_control_te); SetCtlValue(control, val + adj); } - -short -TECanAddLine(TEHandle teh, size_t addition) -{ - TERec *te; - short ret = 1; - - HLock(teh); - te = *teh; - - if ((long)te->teLength + addition > 32767L) - ret = 0; - else if ((long)te->nLines * (long)te->lineHeight > 32767L) - ret = 0; - - HUnlock(teh); - return ret; -} - -void -TEAppendFast(char *str, size_t len, TEHandle te) -{ - unsigned long cur_size; - - HLock(te); - - cur_size = GetHandleSize((*te)->hText); - if ((*te)->teLength + len >= cur_size) { - SetHandleSize((*te)->hText, cur_size + len); - if (MemError()) - err(1, "Out of memory! Can't expand diff TE beyond %lu bytes.", - cur_size); - } - - HLock((*te)->hText); - memcpy(*((*te)->hText) + (*te)->teLength, str, len); - HUnlock((*te)->hText); - - if ((long)((*te)->teLength) + len < 32767L) - (*te)->teLength += len; - else - (*te)->teLength = 32767L; - - HUnlock(te); - /* be sure to call TECalText() when done appending */ -} --- util.h Mon Oct 18 13:09:59 2021 +++ util.h Sat Oct 23 22:25:54 2021 @@ -89,7 +89,5 @@ void DrawGrowIconOnly(WindowPtr win); void UpdateScrollbarForTE(ControlHandle scroller, TEHandle te, bool reset); void SetTrackControlTE(TEHandle te); pascal void TrackMouseDownInControl(ControlHandle control, short part); -short TECanAddLine(TEHandle teh, size_t addition); -void TEAppendFast(char *str, size_t len, TEHandle te); #endif