Comment: These are patches to produce the Andrew component of the X.V11R4 distribution, patch level 1 Andrew-Patch: 1 Date: Thu, 4 Jan 90 17:18:04 -0500 (EST) Date-span: 89/11/14 14:34:15 through 90/1/4 17:11:17 Bugs addressed: Count of patched files: 10 RCS logs: Source file: ams/delivery/queuem/queuem.c Current version: 1.60 revision 1.60 date: 89/12/21 16:22:27; author: cfe; state: Exp; lines added/del: 67/101 Don't assume that sprintf() returns a value. ---------------------------- revision 1.59 date: 89/12/14 14:33:08; author: cfe; state: Exp; lines added/del: 14/43 Eliminate old references to primary-cell stuff, long ago replaced with AMSHome cells. ---------------------------- revision 1.58 date: 89/11/16 16:11:19; author: cfe; state: Exp; lines added/del: 4/2 Fix a file-descriptor leak tickled by the Fax software. Source file: ams/delivery/trymail/trymail.c Current version: 1.39 revision 1.39 date: 89/12/21 16:05:45; author: cfe; state: Exp; lines added/del: 3/1 remove contentious sprintf() declaration. Source file: ams/demo/Imakefile Current version: 1.10 revision 1.10 date: 89/12/13 14:43:21; author: ghoti; state: Exp; lines added/del: 1/1 fix to MIT fix - needed a instead of 8 ---------------------------- revision 1.9 date: 89/12/12 14:57:15; author: ghoti; state: Exp; lines added/del: 1/4 sync with MIT tape Source file: atk/supportviews/lpair.c Current version: 2.14 revision 2.14 date: 90/01/03 18:40:56; author: ghoti; state: Exp; lines added/del: 458/431 ran through 'cb' to fix indentations and long lines so that ps_aix11 preprocesser can handle it Source file: atkams/messages/lib/stubs.c Current version: 1.28 revision 1.28 date: 89/12/21 15:46:36; author: cfe; state: Exp; lines added/del: 1/1 invert order of inclusions of rx/xdr.h and afsint.h Source file: config/ps_aix11/system.h Current version: 1.11 revision 1.11 date: 90/01/03 18:31:13; author: ghoti; state: Exp; lines added/del: 2/1 undefine ANDREW_MALLOC_ENV undefine DEBUG_MALLOC_ENV Source file: config/ps_aix11/system.mcr Current version: 1.7 revision 1.7 date: 90/01/03 18:30:20; author: ghoti; state: Exp; lines added/del: 0/1 remove overriding declaration of XUTILDIR - it is correct as specified in allsys.mcr Source file: overhead/class/pp/class.c Current version: 2.39 revision 2.39 date: 89/12/13 09:59:25; author: ghoti; state: Exp; lines added/del: 2/2 cannot declare errorhandler to be void - caused compilation to die on RT ---------------------------- revision 2.38 date: 89/12/12 15:08:25; author: ghoti; state: Exp; lines added/del: 2/2 sync with MIT tape ---------------------------- revision 2.37 date: 89/11/22 10:51:15; author: cfe; state: Exp; lines added/del: 2/2 tweak guiding heuristics for new environment. Source file: overhead/fonts/fonts/andy/linkfnts.csh Current version: 2.11 revision 2.11 date: 89/12/14 13:20:12; author: ghoti; state: Exp; lines added/del: 4/4 remove fullpath reference in link - not needed, and can be harmful Source file: overhead/snap2/guardian/cmd/Imakefile Current version: 2.33 revision 2.33 date: 89/12/13 10:29:14; author: cfe; state: Exp; lines added/del: 1/0 Add afs/libauth.a as well as afs/librauth.a. ---------------------------- revision 2.32 date: 89/11/14 17:38:00; author: cfe; state: Exp; lines added/del: 2/2 Pull librauth.a from AFSBASEDIR anyway. *** patchlevel.h Wed Nov 22 12:31:52 1989 --- patchlevel.h.NEW Thu Jan 4 17:11:27 1990 *************** *** 1 **** ! This is the Andrew component of the X.V11R4 distribution, patch level 0 --- 1 ---- ! This is the Andrew component of the X.V11R4 distribution, patch level 1 No differences encountered *** ams/delivery/queuem/queuem.c Wed Nov 22 11:41:31 1989 --- ams/delivery/queuem/queuem.c.NEW Wed Dec 27 14:45:36 1989 *************** *** 149,155 **** extern int errno; extern long time(); extern char *malloc(), *realloc(), *arpadate(); - extern char *sprintf(); extern char Qmail_ErrMsg[]; extern int tok_GetStr(); --- 149,154 ---- *************** *** 268,275 **** static int MailSourceFileSize = -1; static char *PrevailingCell = NULL; - static char MyPrimaryCell[2*MAXCELLCHARS+1] = { '\0' }; - static int GotMyPrimaryCell = FALSE; static char AMSHomeCell[2*MAXCELLCHARS+1] = { '\0' }; static int GotAMSHomeCell = FALSE; static char *homeCell = NULL; --- 267,272 ---- *************** *** 340,346 **** return; } } ! ErrorToPostmaster(sprintf(ErrM, "SetLocked(%s, %d): can't remember lock", name, where), NIL, FALSE); } static void ClearLocked(name, where) --- 337,344 ---- return; } } ! sprintf(ErrM, "SetLocked(%s, %d): can't remember lock", name, where); ! ErrorToPostmaster(ErrM, NIL, FALSE); } static void ClearLocked(name, where) *************** *** 356,362 **** inthere = 1; } } ! if (inthere == 0) ErrorToPostmaster(sprintf(ErrM, "unlock(%s, %d): file was never locked", name, where), NIL, FALSE); } static void CheckALock(name, where, whether) --- 354,363 ---- inthere = 1; } } ! if (inthere == 0) { ! sprintf(ErrM, "unlock(%s, %d): file was never locked", name, where); ! ErrorToPostmaster(ErrM, NIL, FALSE); ! } } static void CheckALock(name, where, whether) *************** *** 488,495 **** /*NOTREACHED*/ } ! static int InitPrimaryCell() ! {/* Sets up MyPrimaryCell if it can. Returns -1 if can't get it, 0 for unauth or no primary, 1 for got primary. */ int RC; struct CellAuth *ca; --- 489,496 ---- /*NOTREACHED*/ } ! static int InitAMSHomeCell() ! {/* Sets up AMSHomeCell if it can. Returns -1 if can't get it, 0 for unauth or no home, 1 for got home. */ int RC; struct CellAuth *ca; *************** *** 496,523 **** if (! GotAMSHomeCell) { RC = FindAMSHomeCell(&ca); if (RC == 2) {AMSHomeCell[0] = '\0'; GotAMSHomeCell = TRUE;} ! else if (ca != NULL) ! {strcpy(AMSHomeCell, ca->CellName); GotAMSHomeCell = TRUE;} ! } ! if (! GotMyPrimaryCell) { ! errno = 0; ! RC = GetCurrentUserPrimaryCell(MyPrimaryCell, sizeof(MyPrimaryCell)); ! if (RC == 0) { ! UserPrimaryCell = MyPrimaryCell; ! GotMyPrimaryCell = TRUE; } - } else { - RC = 0; } ! if (AMSHomeCell != NULL && *AMSHomeCell != '\0') { PrevailingCell = AMSHomeCell; } else { PrevailingCell = ThisDomain; } ! if (RC == 0) { ! if (MyPrimaryCell[0] == '\0') return 0; ! else return 1; ! } else {errno = RC; return -1;} } static int DebugToggle = 0; --- 497,513 ---- if (! GotAMSHomeCell) { RC = FindAMSHomeCell(&ca); if (RC == 2) {AMSHomeCell[0] = '\0'; GotAMSHomeCell = TRUE;} ! else if (ca != NULL) { ! strncpy(AMSHomeCell, ca->CellName, sizeof(AMSHomeCell)); ! GotAMSHomeCell = TRUE; } } ! if (GotAMSHomeCell && AMSHomeCell[0] != '\0') { PrevailingCell = AMSHomeCell; } else { PrevailingCell = ThisDomain; } ! return(GotAMSHomeCell ? ((AMSHomeCell[0] != '\0') ? 1 : 0) : -1); } static int DebugToggle = 0; *************** *** 695,704 **** RC = FindCell(homeCell, &ca); if (RC != 0 || ca == NULL) { if (RC == -2 || RepeatError(-1, RC)) FoldTent(EX_TEMPFAIL); ! FatalError(sprintf(ErrorText, ! "Can't find desired home cell %s: code %d", ! homeCell, RC), ! NIL, FALSE, EX_TEMPFAIL); } RC = SetAMSHomeCell(ca); if (RC != 0 && RC != -4) { --- 685,692 ---- RC = FindCell(homeCell, &ca); if (RC != 0 || ca == NULL) { if (RC == -2 || RepeatError(-1, RC)) FoldTent(EX_TEMPFAIL); ! sprintf(ErrorText, "Can't find desired home cell %s: code %d", homeCell, RC); ! FatalError(ErrorText, NIL, FALSE, EX_TEMPFAIL); } RC = SetAMSHomeCell(ca); if (RC != 0 && RC != -4) { *************** *** 731,743 **** strcpy(AMSHomeCell, ca->CellName); GotAMSHomeCell = TRUE; } - ca = NULL; - FindPrimaryCell(&ca); - if (ca != NULL) { - strcpy(MyPrimaryCell, ca->CellName); - UserPrimaryCell = MyPrimaryCell; - GotMyPrimaryCell = TRUE; - } if (WhoIAmBuf[0] == '\0') { /* Try authenticating via local /etc/passwd. */ struct passwd *PW; PW = getpwuid(MyUID); --- 719,724 ---- *************** *** 744,750 **** if (PW != NULL) strcpy(WhoIAmBuf, PW->pw_name); } WhoIAm = WhoIAmBuf; /* Not guaranteed to be non-null, but it will have an approx. */ ! InitPrimaryCell(); if (RPArg != NULL) { if (SetReturnPath(RPArg) == 0) { sprintf(ErrorText, "Bad return path: \"%s\"", RPArg); --- 725,731 ---- if (PW != NULL) strcpy(WhoIAmBuf, PW->pw_name); } WhoIAm = WhoIAmBuf; /* Not guaranteed to be non-null, but it will have an approx. */ ! InitAMSHomeCell(); if (RPArg != NULL) { if (SetReturnPath(RPArg) == 0) { sprintf(ErrorText, "Bad return path: \"%s\"", RPArg); *************** *** 811,819 **** #endif /* LPPlumb */ /* Make sure there are recipients */ if (CurrentRecipients->NextRecipient <= FIRSTRECIPIENT) { ! sprintf(ErrorText, ! "No recipients found in shadow file: \"%s\"", ! MailSourceFileShadow); ErrorToPostmaster(ErrorText, NIL, TRUE); unlock(LockFileName, LockFD, TRUE, 1); SentAction(16); --- 792,798 ---- #endif /* LPPlumb */ /* Make sure there are recipients */ if (CurrentRecipients->NextRecipient <= FIRSTRECIPIENT) { ! sprintf(ErrorText, "No recipients found in shadow file: \"%s\"", MailSourceFileShadow); ErrorToPostmaster(ErrorText, NIL, TRUE); unlock(LockFileName, LockFD, TRUE, 1); SentAction(16); *************** *** 939,945 **** #ifdef AFS_ENV static int InitSourceCell(srcDir) char *srcDir; ! {/* Set up more globals based on the source queue name. Returns -1 if it can't do it, 0 if it can. Return 1 if the source cell doesn't match my primary cell. */ int RC; if (SourceInVice >= 0) { --- 918,924 ---- #ifdef AFS_ENV static int InitSourceCell(srcDir) char *srcDir; ! {/* Set up more globals based on the source queue name. Returns -1 if it can't do it, 0 if it can. Return 1 if the source cell doesn't match my AMSHome cell. */ int RC; if (SourceInVice >= 0) { *************** *** 1087,1093 **** struct CellAuth *ca; char *Read; auto char StrCellName[MAXCELLCHARS+1]; ! int IsLocal, IsPrimary, Remaining, Expd, VID, RC; Read = tokens; Remaining = toklen; --- 1066,1072 ---- struct CellAuth *ca; char *Read; auto char StrCellName[MAXCELLCHARS+1]; ! int IsLocal, IsPrimary /* really means IsAMSHome */, Remaining, Expd, VID, RC; Read = tokens; Remaining = toklen; *************** *** 1125,1131 **** char newname[MAXPATHLEN+1]; unsigned char *tokens; int toklen, isNewFormat, NumTokenPairs; - char *oldUserPrimCell; int oldGotMyPrimCell; char oldRetPath[RETPATHSIZE]; #ifdef AFS_ENV struct ViceIoctl blob; --- 1104,1109 ---- *************** *** 1186,1193 **** } } - oldUserPrimCell = UserPrimaryCell; - oldGotMyPrimCell = GotMyPrimaryCell; #ifdef AFS_ENV oldGotAMSHome = GotAMSHomeCell; strcpy(oldAMSHome, AMSHomeCell); --- 1164,1169 ---- *************** *** 1234,1245 **** } } - GotMyPrimaryCell = FALSE; GotAMSHomeCell = FALSE; ! Res = InitPrimaryCell(); if (Res <= 0) { ! errprintf(Qname, ERR_WARNING, NULL, NULL, ! "No primary cell: %d/%d/%s", Res, errno, UnixError(errno)); /* Unset the pag */ blob.in_size = 0; blob.out_size = 0; --- 1210,1219 ---- } } GotAMSHomeCell = FALSE; ! Res = InitAMSHomeCell(); if (Res <= 0) { ! errprintf(Qname, ERR_WARNING, NULL, NULL, "No AMS home cell (result %d)", Res); /* Unset the pag */ blob.in_size = 0; blob.out_size = 0; *************** *** 1248,1258 **** if (setreuid(0, 0) < 0) errprintf(Qname, ERR_CRITICAL, NULL, NULL, "Setreuid (6) failed: %s", UnixError(errno)); - GotMyPrimaryCell = oldGotMyPrimCell; - UserPrimaryCell = oldUserPrimCell; GotAMSHomeCell = oldGotAMSHome; strcpy(AMSHomeCell, oldAMSHome); ! InitPrimaryCell(); return; } #endif /* AFS_ENV */ --- 1222,1230 ---- if (setreuid(0, 0) < 0) errprintf(Qname, ERR_CRITICAL, NULL, NULL, "Setreuid (6) failed: %s", UnixError(errno)); GotAMSHomeCell = oldGotAMSHome; strcpy(AMSHomeCell, oldAMSHome); ! InitAMSHomeCell(); return; } #endif /* AFS_ENV */ *************** *** 1279,1291 **** errprintf(Qname, ERR_CRITICAL, NULL, NULL, "Setreuid (4) failed: %s", UnixError(errno)); strncpy(ReturnPath, oldRetPath, RETPATHSIZE); - GotMyPrimaryCell = oldGotMyPrimCell; - UserPrimaryCell = oldUserPrimCell; #ifdef AFS_ENV GotAMSHomeCell = oldGotAMSHome; strcpy(AMSHomeCell, oldAMSHome); #endif /* AFS_ENV */ ! InitPrimaryCell(); } static void ProcessMailRequests() --- 1251,1261 ---- errprintf(Qname, ERR_CRITICAL, NULL, NULL, "Setreuid (4) failed: %s", UnixError(errno)); strncpy(ReturnPath, oldRetPath, RETPATHSIZE); #ifdef AFS_ENV GotAMSHomeCell = oldGotAMSHome; strcpy(AMSHomeCell, oldAMSHome); #endif /* AFS_ENV */ ! InitAMSHomeCell(); } static void ProcessMailRequests() *************** *** 1611,1618 **** continue; *err = errno; ! sprintf(ErrorText, "Can't stat \"%s\": %s", ! f, UnixError(*err)); if (*err != ENFILE && !vdown(*err) && !RepeatError(EACCES, *err)) ErrorToPostmaster(ErrorText, NIL, FALSE); closedir(dp); FreeFiles(files, &i); --- 1581,1587 ---- continue; *err = errno; ! sprintf(ErrorText, "Can't stat \"%s\": %s", f, UnixError(*err)); if (*err != ENFILE && !vdown(*err) && !RepeatError(EACCES, *err)) ErrorToPostmaster(ErrorText, NIL, FALSE); closedir(dp); FreeFiles(files, &i); *************** *** 1870,1877 **** /* Switch effective uid to real uid for Vice */ if (setreuid(MyUID, MyUID) < 0) { ! sprintf(ErrorText, ! "Setreuid (2) failed: %s; exiting", UnixError(errno)); errprintf(Qname, ERR_CRITICAL, NULL, NULL, ErrorText); ErrorToPostmaster(ErrorText, NIL, FALSE); FoldTent(CheckRepeatErrors ? EX_TEMPFAIL : EX_OSERR); --- 1839,1845 ---- /* Switch effective uid to real uid for Vice */ if (setreuid(MyUID, MyUID) < 0) { ! sprintf(ErrorText, "Setreuid (2) failed: %s; exiting", UnixError(errno)); errprintf(Qname, ERR_CRITICAL, NULL, NULL, ErrorText); ErrorToPostmaster(ErrorText, NIL, FALSE); FoldTent(CheckRepeatErrors ? EX_TEMPFAIL : EX_OSERR); *************** *** 2162,2172 **** case 't': OldMessageAge = atoi(argv[1]); if (OldMessageAge < 1 || OldMessageAge > 30) { ! if (! Debugging) ! FatalError(sprintf(ErrorText, ! "Bad timeout age: %d", ! OldMessageAge), ! NIL, FALSE, EX_USAGE); } if (OldMessageAge < 300) OldMessageAge *= DAY; ++argv; --- 2130,2139 ---- case 't': OldMessageAge = atoi(argv[1]); if (OldMessageAge < 1 || OldMessageAge > 30) { ! if (! Debugging) { ! sprintf(ErrorText, "Bad timeout age: %d", OldMessageAge); ! FatalError(ErrorText, NIL, FALSE, EX_USAGE); ! } } if (OldMessageAge < 300) OldMessageAge *= DAY; ++argv; *************** *** 2185,2194 **** case 'w': SleepPeriod = atoi(argv[1]); if (SleepPeriod < 1 || SleepPeriod > 1*DAY) { ! FatalError(sprintf(ErrorText, ! "Bad sleep period: %d seconds", ! SleepPeriod), ! NIL, FALSE, EX_USAGE); } ++argv; --argc; --- 2152,2159 ---- case 'w': SleepPeriod = atoi(argv[1]); if (SleepPeriod < 1 || SleepPeriod > 1*DAY) { ! sprintf(ErrorText, "Bad sleep period: %d seconds", SleepPeriod); ! FatalError(ErrorText, NIL, FALSE, EX_USAGE); } ++argv; --argc; *************** *** 2204,2212 **** BypassLocalDelivery = TRUE; break; default: ! FatalError(sprintf(ErrorText, ! "Unrecognized option: %s", argv[0]), ! NIL, FALSE, EX_USAGE); } } } --- 2169,2176 ---- BypassLocalDelivery = TRUE; break; default: ! sprintf(ErrorText, "Unrecognized option: %s", argv[0]); ! FatalError(ErrorText, NIL, FALSE, EX_USAGE); } } } *************** *** 2287,2294 **** #endif /* AFS_ENV */ if (stat(name, buf) < 0) { ! sprintf(ErrorText, ! "Can't stat file \"%s\": %s", name, UnixError(errno)); if (errno != ENFILE && !vdown(errno)) ErrorToPostmaster(ErrorText, NIL, FALSE); return No_Owner; } --- 2251,2257 ---- #endif /* AFS_ENV */ if (stat(name, buf) < 0) { ! sprintf(ErrorText, "Can't stat file \"%s\": %s", name, UnixError(errno)); if (errno != ENFILE && !vdown(errno)) ErrorToPostmaster(ErrorText, NIL, FALSE); return No_Owner; } *************** *** 2303,2311 **** /* Got all 3 uids */ if (owner1 != owner2 || owner2 != owner3) { ! sprintf(ErrorText, ! "Incompatible owners for \"%s\": %d, %d, %d", ! name, owner1, owner2, owner3); ErrorToPostmaster(ErrorText, NIL, FALSE); return No_Owner; } --- 2266,2272 ---- /* Got all 3 uids */ if (owner1 != owner2 || owner2 != owner3) { ! sprintf(ErrorText, "Incompatible owners for \"%s\": %d, %d, %d", name, owner1, owner2, owner3); ErrorToPostmaster(ErrorText, NIL, FALSE); return No_Owner; } *************** *** 2557,2564 **** ++index; continue; } else if (OwnerInCell == ANONYMOUSID) { ! sprintf(MailSourceAuth, "%d;%s;Anonymous", ! OwnerInCell, SourceQueueCell); } else { /* just tell 'em the owner VUID */ sprintf(MailSourceAuth, "%d;%s", OwnerInCell, SourceQueueCell); } --- 2518,2524 ---- ++index; continue; } else if (OwnerInCell == ANONYMOUSID) { ! sprintf(MailSourceAuth, "%d;%s;Anonymous", OwnerInCell, SourceQueueCell); } else { /* just tell 'em the owner VUID */ sprintf(MailSourceAuth, "%d;%s", OwnerInCell, SourceQueueCell); } *************** *** 2616,2623 **** } XRes = 1; if (EMsg != NULL) ! sprintf(ErrorText, "Old queued file %s (retouch failed in %s: %s)", ! MailSourceFile, EMsg, UnixError(errno)); if (fd >= 0 && EMsg != NULL) close(fd); if (EMsg != NULL) { debug(64, (NL, ErrorText)); --- 2576,2582 ---- } XRes = 1; if (EMsg != NULL) ! sprintf(ErrorText, "Old queued file %s (retouch failed in %s: %s)", MailSourceFile, EMsg, UnixError(errno)); if (fd >= 0 && EMsg != NULL) close(fd); if (EMsg != NULL) { debug(64, (NL, ErrorText)); *************** *** 2625,2634 **** XRes = -1; } else { debug(64, ("Retouch succeeded; postmaster will be told\n")); ! ErrorToPostmaster(sprintf(ErrorText, ! "Queue file %s is too old and has been retouched", ! MailSourceFile), ! NIL, TRUE); } debug(64, ("Postmaster warned\n")); } --- 2584,2591 ---- XRes = -1; } else { debug(64, ("Retouch succeeded; postmaster will be told\n")); ! sprintf(ErrorText, "Queue file %s is too old and has been retouched", MailSourceFile); ! ErrorToPostmaster(ErrorText, NIL, TRUE); } debug(64, ("Postmaster warned\n")); } *************** *** 2756,2761 **** --- 2713,2719 ---- return -1; default: sprintf(ErrorText, "Impossible value from qmail: %d", rc); + ErrorToPostmaster(ErrorText, NIL, FALSE); return -1; } } *************** *** 2822,2833 **** case Q_FILE_ERR: case Q_NO_PERM: case Q_DIR_ERR: ! sprintf(ErrorText, "Bad return (%d) from tryvicequeues: %s", ! rc, Qmail_ErrMsg); ErrorToPostmaster(ErrorText, NIL, FALSE); return 1; default: ! sprintf(ErrorText, "Impossible value from tryvicequeues: %d", rc); return 1; } } --- 2780,2791 ---- case Q_FILE_ERR: case Q_NO_PERM: case Q_DIR_ERR: ! sprintf(ErrorText, "Bad return (%d) from tryvicequeues: %s", rc, Qmail_ErrMsg); ErrorToPostmaster(ErrorText, NIL, FALSE); return 1; default: ! sprintf(ErrorText, "Impossible value from tryvicequeues: %d (%s)", rc, Qmail_ErrMsg); ! ErrorToPostmaster(ErrorText, NIL, FALSE); return 1; } } *************** *** 2868,2877 **** f = qopen(vicemail, argv, "w"); if (f == NULL) { debug(512, ("Horrible bailout: can't run vicemail\n")); ! bailout(sprintf(Text, ! "Can not run vicemail to give error to postmaster: %s", ! Msg), ! AuxMsg, SendBody); return -1; } Header(f, Msg); --- 2826,2833 ---- f = qopen(vicemail, argv, "w"); if (f == NULL) { debug(512, ("Horrible bailout: can't run vicemail\n")); ! sprintf(Text, "Can not run vicemail to give error to postmaster: %s", Msg); ! bailout(Text, AuxMsg, SendBody); return -1; } Header(f, Msg); *************** *** 3001,3008 **** #endif /* LogsYes */ if (fread(cbuf, sizeof(char), 3, f) == 0) { if (ferror(f) != 0) { ! sprintf(ErrorText, "Can't get code from %s: %d (%s)", ! pgmname, errno, UnixError(errno)); debug(32768, (NL, ErrorText)); if (!tfail(errno)) ErrorToPostmaster(ErrorText, NIL, FALSE); } else --- 2957,2963 ---- #endif /* LogsYes */ if (fread(cbuf, sizeof(char), 3, f) == 0) { if (ferror(f) != 0) { ! sprintf(ErrorText, "Can't get code from %s: %d (%s)", pgmname, errno, UnixError(errno)); debug(32768, (NL, ErrorText)); if (!tfail(errno)) ErrorToPostmaster(ErrorText, NIL, FALSE); } else *************** *** 3034,3041 **** } MoreText[Ix] = '\0'; for (Ix = 0; Ix < 3000; ++Ix) {Ch = fgetc(f); if (Ch == EOF) break;} ! sprintf(ErrorText, "Bad prefix from %s: ``%c%c%c%c'' (then ``%s'')", ! pgmname, cbuf[0], cbuf[1], cbuf[2], cont, MoreText); debug(32768, (NL, ErrorText)); ErrorToPostmaster(ErrorText, NIL, FALSE); return -1; --- 2989,2995 ---- } MoreText[Ix] = '\0'; for (Ix = 0; Ix < 3000; ++Ix) {Ch = fgetc(f); if (Ch == EOF) break;} ! sprintf(ErrorText, "Bad prefix from %s: ``%c%c%c%c'' (then ``%s'')", pgmname, cbuf[0], cbuf[1], cbuf[2], cont, MoreText); debug(32768, (NL, ErrorText)); ErrorToPostmaster(ErrorText, NIL, FALSE); return -1; *************** *** 3161,3171 **** /* Look at code & decide what to do with message */ if (GlobalFailure(code)) { if (GlobalPermFailure(code)) { ! if (code != tmgpf_DestinationSyntaxError) ! ErrorToPostmaster( ! sprintf(ErrorText, ! "Failure from %s: %d %s\n", pgmname, code, line), ! NIL, FALSE); } /* Just bail out after global error -- no more messages will come */ return 1; --- 3115,3124 ---- /* Look at code & decide what to do with message */ if (GlobalFailure(code)) { if (GlobalPermFailure(code)) { ! if (code != tmgpf_DestinationSyntaxError) { ! sprintf(ErrorText, "Failure from %s: %d %s\n", pgmname, code, line); ! ErrorToPostmaster(ErrorText, NIL, FALSE); ! } } /* Just bail out after global error -- no more messages will come */ return 1; *************** *** 3342,3351 **** if (status == -1 || timedout != 0) { /* It timed out */ killpg(pgrp, SIGKILL); ! ErrorToPostmaster(sprintf(ErrorText, ! "Had to kill %s. Timeout %d, file %s", ! argv[0], WillWait, MailSourceFile), ! NIL, FALSE); return -1; } --- 3295,3302 ---- if (status == -1 || timedout != 0) { /* It timed out */ killpg(pgrp, SIGKILL); ! sprintf(ErrorText, "Had to kill %s. Timeout %d, file %s", argv[0], WillWait, MailSourceFile); ! ErrorToPostmaster(ErrorText, NIL, FALSE); return -1; } *************** *** 3361,3368 **** debug(32768, ("Killed\n")); return -1; default: debug(32768, ("Problem: 0x%04x\n", status)); ! sprintf(ErrorText, "Bad termination from %s: 0x%04x\n", ! argv[0], status); if (result == 0) ErrorToPostmaster(ErrorText, NIL, FALSE); return -1; } --- 3312,3318 ---- debug(32768, ("Killed\n")); return -1; default: debug(32768, ("Problem: 0x%04x\n", status)); ! sprintf(ErrorText, "Bad termination from %s: 0x%04x\n", argv[0], status); if (result == 0) ErrorToPostmaster(ErrorText, NIL, FALSE); return -1; } *************** *** 3445,3453 **** for (;;) { switch (c) { case EOF: debug(8, ("Unexpected EOF in GetNextToken")); ! sprintf(ErrorText, ! "EOF in bracketed token in shadow file \"%s\"", ! MailSourceFileShadow); ErrorToPostmaster(ErrorText, NIL, TRUE); return NULL; case '|': c = getc(fp); --- 3395,3401 ---- for (;;) { switch (c) { case EOF: debug(8, ("Unexpected EOF in GetNextToken")); ! sprintf(ErrorText, "EOF in bracketed token in shadow file \"%s\"", MailSourceFileShadow); ErrorToPostmaster(ErrorText, NIL, TRUE); return NULL; case '|': c = getc(fp); *************** *** 3502,3512 **** if ((f=fopen(MailSourceFileShadow, "r")) == NULL) { int err = errno; debug(1024, ("But I can't open it\n")); ! if (err != ENOENT && err != ENFILE && !vdown(err) && !RepeatError(EACCES, err)) ! ErrorToPostmaster(sprintf(ErrorText, ! "Can not open shadow file %s: %s", ! MailSourceFileShadow, UnixError(err)), ! NIL, FALSE); errno = err; return -1; } --- 3450,3459 ---- if ((f=fopen(MailSourceFileShadow, "r")) == NULL) { int err = errno; debug(1024, ("But I can't open it\n")); ! if (err != ENOENT && err != ENFILE && !vdown(err) && !RepeatError(EACCES, err)) { ! sprintf(ErrorText, "Can not open shadow file %s: %s", MailSourceFileShadow, UnixError(err)); ! ErrorToPostmaster(ErrorText, NIL, FALSE); ! } errno = err; return -1; } *************** *** 3533,3540 **** else if (strncmp(s, "#X", 2) == 0) /* Field name start with ``X''? */ WhichField = IGNORE_FIELD; /* for future compatibility */ else { ! sprintf(ErrorText, "Shadow %s contains unknown field %s", ! MailSourceFileShadow, s); debug(1024, (NL, ErrorText)); ErrorToPostmaster(ErrorText, NIL, FALSE); WhichField = UNKNOWN_FIELD; --- 3480,3486 ---- else if (strncmp(s, "#X", 2) == 0) /* Field name start with ``X''? */ WhichField = IGNORE_FIELD; /* for future compatibility */ else { ! sprintf(ErrorText, "Shadow %s contains unknown field %s", MailSourceFileShadow, s); debug(1024, (NL, ErrorText)); ErrorToPostmaster(ErrorText, NIL, FALSE); WhichField = UNKNOWN_FIELD; *************** *** 3627,3634 **** if (MyUID == 0) return; cellWho = CheckAMSPMName(PrevailingCell); if (cellWho != NULL && strcmp(WhoIAm, cellWho) == 0) return; ! sprintf(ErrorText, "User (\"%s\"/%d/%s) not authorized to %s", ! WhoIAm, MyUID, PrevailingCell, mesg); FatalError(ErrorText, NIL, FALSE, EX_USAGE); } --- 3573,3579 ---- if (MyUID == 0) return; cellWho = CheckAMSPMName(PrevailingCell); if (cellWho != NULL && strcmp(WhoIAm, cellWho) == 0) return; ! sprintf(ErrorText, "User (\"%s\"/%d/%s) not authorized to %s", WhoIAm, MyUID, PrevailingCell, mesg); FatalError(ErrorText, NIL, FALSE, EX_USAGE); } *************** *** 3658,3668 **** /* Unknown problem, this is serious */ err = errno; debug(8192, ("open failed: unknown, %s\n", UnixError(err))); ! if (!RepeatError(EACCES, err)) ! ErrorToPostmaster(sprintf(ErrorText, ! "Can't open lock file: %s, %s", ! lockfile, UnixError(err)), ! NIL, FALSE); return -1; } } else { --- 3603,3612 ---- /* Unknown problem, this is serious */ err = errno; debug(8192, ("open failed: unknown, %s\n", UnixError(err))); ! if (!RepeatError(EACCES, err)) { ! sprintf(ErrorText, "Can't open lock file: %s, %s", lockfile, UnixError(err)); ! ErrorToPostmaster(ErrorText, NIL, FALSE); ! } return -1; } } else { *************** *** 3687,3697 **** /* Some other reason -- trouble */ err = errno; debug(8192, ("lock failed: unknown, %d\n", err)); ! if (!RepeatError(EACCES, err)) ! ErrorToPostmaster(sprintf(ErrorText, ! "Flock failed on %s: %s", ! lockfile, UnixError(err)), ! NIL, FALSE); } close(fd); return -1; --- 3631,3640 ---- /* Some other reason -- trouble */ err = errno; debug(8192, ("lock failed: unknown, %d\n", err)); ! if (!RepeatError(EACCES, err)) { ! sprintf(ErrorText, "Flock failed on %s: %s", lockfile, UnixError(err)); ! ErrorToPostmaster(ErrorText, NIL, FALSE); ! } } close(fd); return -1; *************** *** 3724,3734 **** err = errno; sync(); debug(8192, ("unlink failed: %d\n", err)); ! if (!tfail(err) && !RepeatError(EACCES, err)) ! ErrorToPostmaster(sprintf(ErrorText, ! "Can't unlink lockfile %s: %s", ! lockfile, UnixError(err)), ! NIL, FALSE); close(fd); return -1; } else { --- 3667,3676 ---- err = errno; sync(); debug(8192, ("unlink failed: %d\n", err)); ! if (!tfail(err) && !RepeatError(EACCES, err)) { ! sprintf(ErrorText, "Can't unlink lockfile %s: %s", lockfile, UnixError(err)); ! ErrorToPostmaster(ErrorText, NIL, FALSE); ! } close(fd); return -1; } else { *************** *** 3760,3770 **** int err; err = errno; debug(8192, ("unlock failed: %d\n", err)); ! if (!tfail(err) && !RepeatError(EACCES, err)) ! ErrorToPostmaster(sprintf(ErrorText, ! "Can't unlock lockfile %s: %s", ! lockfile, UnixError(err)), ! NIL, FALSE); #ifdef AFS_ENV } #endif /* AFS_ENV */ --- 3702,3711 ---- int err; err = errno; debug(8192, ("unlock failed: %d\n", err)); ! if (!tfail(err) && !RepeatError(EACCES, err)) { ! sprintf(ErrorText, "Can't unlock lockfile %s: %s", lockfile, UnixError(err)); ! ErrorToPostmaster(ErrorText, NIL, FALSE); ! } #ifdef AFS_ENV } #endif /* AFS_ENV */ *************** *** 3851,3858 **** } if (i >= MAXTEMPTRIES) { ! sprintf(ErrorText, "Can't create temporary message file \"%s\": %s", ! MailSourceFile, UnixError(errn)); debug(128, (NL, ErrorText)); if (RepeatError(ENOSPC, errn)) { FoldTent(EX_TEMPFAIL); --- 3792,3798 ---- } if (i >= MAXTEMPTRIES) { ! sprintf(ErrorText, "Can't create temporary message file \"%s\": %s", MailSourceFile, UnixError(errn)); debug(128, (NL, ErrorText)); if (RepeatError(ENOSPC, errn)) { FoldTent(EX_TEMPFAIL); *************** *** 3903,3912 **** olderrno = errno; debug(128, ("Can't open it: %s\n", UnixError(olderrno))); if (tfail(olderrno)) FoldTent(EX_TEMPFAIL); ! FatalError(sprintf(ErrorText, ! "Can't open source file \"%s\": %s", ! MailSourceFile, UnixError(olderrno)), ! NIL, FALSE, CheckRepeatErrors ? EX_TEMPFAIL : MapErrno(olderrno, EX_DATAERR)); } debug(128, ("Opened it: %d\n", MailSourceFD)); if (fstat(MailSourceFD, &MailSourceStat) != 0) { --- 3843,3850 ---- olderrno = errno; debug(128, ("Can't open it: %s\n", UnixError(olderrno))); if (tfail(olderrno)) FoldTent(EX_TEMPFAIL); ! sprintf(ErrorText, "Can't open source file \"%s\": %s", MailSourceFile, UnixError(olderrno)); ! FatalError(ErrorText, NIL, FALSE, CheckRepeatErrors ? EX_TEMPFAIL : MapErrno(olderrno, EX_DATAERR)); } debug(128, ("Opened it: %d\n", MailSourceFD)); if (fstat(MailSourceFD, &MailSourceStat) != 0) { *************** *** 3968,3975 **** debug(128, ("Message is %d bytes, min is %d bytes\n", size, MIN_MESSAGE_SIZE)); if (size < MIN_MESSAGE_SIZE) { CleanupMessageText(); ! sprintf(ErrorText, "Message on standard input is too small: %d (min is %d)", ! size, MIN_MESSAGE_SIZE); FatalError(ErrorText, NIL, FALSE, CheckRepeatErrors ? EX_TEMPFAIL : EX_DATAERR); } --- 3906,3912 ---- debug(128, ("Message is %d bytes, min is %d bytes\n", size, MIN_MESSAGE_SIZE)); if (size < MIN_MESSAGE_SIZE) { CleanupMessageText(); ! sprintf(ErrorText, "Message on standard input is too small: %d (min is %d)", size, MIN_MESSAGE_SIZE); FatalError(ErrorText, NIL, FALSE, CheckRepeatErrors ? EX_TEMPFAIL : EX_DATAERR); } *** ams/delivery/trymail/trymail.c Wed Nov 22 11:41:11 1989 --- ams/delivery/trymail/trymail.c.NEW Wed Dec 27 14:45:18 1989 *************** *** 8,14 **** to client workstations for possible short-circuit evaluation. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/delivery/trymail/RCS/trymail.c,v 1.38 89/10/09 17:12:58 cfe Exp $"; #include /*VARARGS1*/ --- 8,14 ---- to client workstations for possible short-circuit evaluation. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/ams/delivery/trymail/RCS/trymail.c,v 1.39 89/12/21 16:05:45 cfe Exp $"; #include /*VARARGS1*/ *************** *** 15,22 **** --- 15,24 ---- extern int printf(); /*VARARGS2*/ extern int fprintf(); + #if 0 /*VARARGS2*/ extern char *sprintf(); + #endif /* 0 */ #include #include #include /* sys/types.h strings.h sys/time.h sys/file.h */ *** ams/demo/Imakefile Wed Nov 29 13:31:51 1989 --- ams/demo/Imakefile.NEW Thu Dec 14 16:02:21 1989 *************** *** 35,41 **** install.time:: -${DESTDIR}/bin/cui rebuild ${DESTDIR}/.MESSAGES \; exit ! -${CSHELL} gendemo -force -DESTDIR ${DESTDIR} ${DESTDIR}/.MESSAGES/demo InstallDocs(gendemo.help, ${DESTDIR}/help) --- 35,41 ---- install.time:: -${DESTDIR}/bin/cui rebuild ${DESTDIR}/.MESSAGES \; exit ! -${CSHELL} gendemo -force -DESTDIR ${DESTDIR} ${DESTDIR}/.MESSAGES/demo InstallDocs(gendemo.help, ${DESTDIR}/help) *** atk/supportviews/lpair.c Wed Nov 22 12:30:14 1989 --- atk/supportviews/lpair.c.NEW Wed Jan 3 18:41:34 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/lpair.c,v 2.13 89/10/30 10:11:48 zs01 Exp $ */ /* $ACIS:lpair.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/lpair.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/lpair.c,v 2.13 89/10/30 10:11:48 zs01 Exp $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/atk/supportviews/RCS/lpair.c,v 2.14 90/01/03 18:40:56 ghoti Exp $ */ /* $ACIS:lpair.c 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/atk/supportviews/RCS/lpair.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/atk/supportviews/RCS/lpair.c,v 2.14 90/01/03 18:40:56 ghoti Exp $"; #endif /* lint */ *************** *** 47,672 **** /* Basically, the only reason this routine exists is because the FullUpdate signature does not use rectangles. This routine expects its redrawRectangle argument to be valid know matter what the type argument is. The type arg is just passed through to the children that need to be redrawn. All in all, this, Update, and FullUpdate can probably be simplified. -Z- */ static void DoFullUpdate(self, type, redrawRectangle) ! struct lpair *self; ! enum view_UpdateType type; ! struct rectangle *redrawRectangle; { ! /* All this code needs changed */ ! register int x,y; ! int offset; /* Used to get the bar line in the right place. */ ! register struct view * leftTopObject = self->obj[0]; ! register struct view * rightBottomObject = self->obj[1]; ! struct rectangle childRectangle; ! self->needsfull = 0; ! lpair_ComputeSizes(self); ! lpair_ResetDimensions(self); /* reset the child lpair sizes */ ! x = 0; y = 0; ! if (self->typex == lpair_VERTICAL) ! x += self->objcvt[0]; ! else ! y += self->objcvt[0]; ! lpair_SetTransferMode(self, graphic_BLACK); ! offset = (self->movable) ? BARWIDTH : 0; /* If not movable, don't put extra space around bar. */ ! if (self->typex == lpair_VERTICAL) { ! lpair_MoveTo(self,x+offset,0); ! lpair_DrawLineTo(self,x+offset,lpair_GetLogicalHeight(self)/*-1*/); ! } ! else { ! lpair_MoveTo(self,0,y+offset); ! lpair_DrawLineTo(self,lpair_GetLogicalWidth(self)/*-1*/,y+offset); ! } ! if (leftTopObject != NULL) { ! view_GetEnclosedBounds(leftTopObject, &childRectangle); ! rectangle_IntersectRect(&childRectangle, &childRectangle, redrawRectangle); ! if (!rectangle_IsEmptyRect(&childRectangle)) { ! lpair_RetractViewCursors(self,leftTopObject); ! view_FullUpdate(leftTopObject,type, view_EnclosedXToLocalX(leftTopObject, ! rectangle_Left(&childRectangle)), view_EnclosedYToLocalY(leftTopObject, ! rectangle_Top(&childRectangle)), rectangle_Width(&childRectangle), rectangle_Height(&childRectangle)); ! } ! } ! if (rightBottomObject != NULL) { ! view_GetEnclosedBounds(rightBottomObject, &childRectangle); ! rectangle_IntersectRect(&childRectangle, &childRectangle, redrawRectangle); ! if (!rectangle_IsEmptyRect(&childRectangle)) { ! lpair_RetractViewCursors(self,rightBottomObject); ! view_FullUpdate(rightBottomObject,type, view_EnclosedXToLocalX(rightBottomObject, ! rectangle_Left(&childRectangle)), view_EnclosedYToLocalY(rightBottomObject, ! rectangle_Top(&childRectangle)), rectangle_Width(&childRectangle), rectangle_Height(&childRectangle)); ! } ! } ! if(self->movable){ ! struct rectangle cursorRegion; ! if(self->typex==lpair_VERTICAL) ! rectangle_SetRectSize(&cursorRegion, ! x-GRAVITY, ! 0, ! 2*(BARWIDTH+GRAVITY)+1, ! lpair_GetLogicalHeight(self)); ! else ! rectangle_SetRectSize(&cursorRegion, ! 0, ! y-GRAVITY, ! lpair_GetLogicalWidth(self), ! 2*(BARWIDTH+GRAVITY)+1); ! lpair_PostCursor(self,&cursorRegion,self->cursor); ! } } void lpair__Update(self) ! struct lpair *self; { ! if (self->needsfull) { ! struct rectangle redrawRectangle; ! struct graphic *pat; ! lpair_SetTransferMode(self, graphic_COPY); ! lpair_GetLogicalBounds(self, &redrawRectangle); ! if (!(self->needsfull & 1)) { ! if (self->typex == lpair_HORIZONTAL) ! rectangle_SetTop(&redrawRectangle, self->objcvt[0] + BARWIDTH); ! else ! rectangle_SetLeft(&redrawRectangle, self->objcvt[0] + BARWIDTH); ! } ! if (!(self->needsfull & 2)) { ! if (self->typex == lpair_HORIZONTAL) ! rectangle_SetBottom(&redrawRectangle, self->objcvt[0] - BARWIDTH); ! else ! rectangle_SetRight(&redrawRectangle, self->objcvt[0] - BARWIDTH); ! } ! pat = lpair_WhitePattern(self); ! lpair_FillRect(self, &redrawRectangle, pat); ! /* I intentionally pass in view_FullRedraw here knowing that the DoFullUpdate * will still take the rectangle into account. */ ! DoFullUpdate(self, view_FullRedraw, &redrawRectangle); ! } } void lpair__FullUpdate(self, type, left, top, width, height) ! struct lpair *self; ! enum view_UpdateType type; ! long left; ! long top; ! long width; ! long height; { ! struct rectangle redrawRectangle; ! /* This really shouldn't be neccesary since the other redraw types should be required to fill in an appropriate recangle. However there are a few places (drawtxtv.c) where view_FullRedraw and view_Remove types get sent with 0 by 0 rectangles. */ ! switch (type) { ! case view_PartialRedraw: ! case view_LastPartialRedraw: ! rectangle_SetRectSize(&redrawRectangle, left, top, width, height); ! break; ! case view_MoveNoRedraw: ! /* Need to reinsert views so they get correct coordinate system. */ ! lpair_ResetDimensions(self); ! /* Intentional fall through. */ ! case view_Remove: ! if (self->obj[0] != NULL) ! view_FullUpdate(self->obj[0], type, 0, 0, 0, 0); ! if (self->obj[1] != NULL) ! view_FullUpdate(self->obj[1], type, 0, 0, 0, 0); ! return; ! break; ! default: ! lpair_GetVisualBounds(self, &redrawRectangle); ! break; ! } ! DoFullUpdate(self, type, &redrawRectangle); } #define ABS(x) ((x) > 0 ? (x) : -(x)) struct view *lpair__Hit(self, action, x, y, numberOfClicks) struct lpair *self; enum view_MouseAction action; ! long x, y; ! long numberOfClicks; { ! register long dim; ! if (self->typex == lpair_VERTICAL) { ! dim = x; ! } ! else { ! dim = y; ! } ! if (self->movable && ! (action == view_RightDown || action == view_LeftDown) && ! (ABS(dim - self->objcvt[0] - BARWIDTH) <= BARWIDTH + GRAVITY)) { ! self->lasthit = dim; ! im_SetWindowCursor(view_GetIM((struct view *) self), self->cursor); ! self->ismoving = TRUE; ! return((struct view *) self); /* Our hit, return us. */ ! } ! if (self->ismoving) { ! if ((action == view_RightUp || action == view_LeftUp)) { ! if (!self->maybeZero) ! if (self->typex == lpair_VERTICAL) { ! x = max(x, BARWIDTH + GRAVITY); ! x = min(x, ! lpair_GetLogicalWidth(self) - BARWIDTH - GRAVITY); ! } else { ! y = max(y, BARWIDTH + GRAVITY); ! y = min(y, ! lpair_GetLogicalHeight(self) - BARWIDTH - GRAVITY); ! } ! if ((abs(self->lasthit - dim) > BARWIDTH + GRAVITY)) { ! if (self->typex == lpair_VERTICAL) ! if (self->sizeform == lpair_PERCENTAGE) ! self->objsize[1] = 100 - ! ((100*x) / lpair_GetLogicalWidth(self)); ! else if (self->sizeform == lpair_BOTTOMFIXED) ! self->objsize[1] = lpair_GetLogicalWidth(self) - x; ! else ! self->objsize[0] = x; ! else ! if (self->sizeform == lpair_PERCENTAGE) ! self->objsize[1] = 100 - ! ((100 * y) / lpair_GetLogicalHeight(self)); ! else if (self->sizeform == lpair_BOTTOMFIXED) ! self->objsize[1] = lpair_GetLogicalHeight(self)- y; ! else ! self->objsize[0] = y; ! if (self->sizeform == lpair_PERCENTAGE) ! if (self->objsize[1] > 100) ! self->objsize[1] = 100; ! else if (self->objsize[1] < 0) ! self->objsize[1] = 0; ! self->needsfull = 3; ! lpair_WantUpdate(self, self); ! } ! im_SetWindowCursor(lpair_GetIM(self), NULL); ! self->ismoving = FALSE; } ! return((struct view *) self); ! } ! if (self->typex == lpair_VERTICAL) ! if (x < self->objcvt[0]) { ! if (self->obj[0] != NULL) ! return view_Hit(self->obj[0], action, view_EnclosedXToLocalX(self->obj[0], x), ! view_EnclosedYToLocalY(self->obj[0], y), numberOfClicks); ! } ! else { ! if (self->obj[1] != NULL) ! return view_Hit(self->obj[1], action, view_EnclosedXToLocalX(self->obj[1], x), ! view_EnclosedYToLocalY(self->obj[1], y), numberOfClicks); ! } ! else ! if (y < self->objcvt[0]) { ! if (self->obj[0] != NULL) ! return view_Hit(self->obj[0], action, view_EnclosedXToLocalX(self->obj[0], x), ! view_EnclosedYToLocalY(self->obj[0], y), numberOfClicks); ! } ! else { ! if (self->obj[1] != NULL) ! return view_Hit(self->obj[1], action, view_EnclosedXToLocalX(self->obj[1], x), ! view_EnclosedYToLocalY(self->obj[1], y), numberOfClicks); ! } ! return NULL; /* Catches the case where one of the lpair's views is NULL. */ } /* This routineis special to prevent children from getting updates before a * FullUpdate. ! */ void lpair__WantUpdate(self, requestor) ! struct lpair *self; ! struct view *requestor; { ! /* If we are about to FullUpdate the view requesting an update, throw away the * request. This prevents views from getting updates before FullUpdates. */ ! if (self->header.view.parent != NULL && ! !((self->needsfull & 1) && self->obj[0] != NULL && ! view_IsAncestor(requestor, self->obj[0]) || ! (self->needsfull & 2) && self->obj[1] != NULL && ! view_IsAncestor(requestor, self->obj[1])) && ! self->header.view.parent != NULL) ! view_WantUpdate(self->header.view.parent, requestor); } #define STARTHEIGHT 256 enum view_DSattributes lpair__DesiredSize(self, width, height, pass, desiredwidth, desiredheight) struct lpair *self; ! long width, height; enum view_DSpass pass; ! long *desiredwidth, *desiredheight; { ! long d0,d1,c0,c1; ! c0 = self->objcvt[0]; ! c1 = self->objcvt[1]; ! if(self->obj[0] && self->obj[1]){ ! if(self->typex == lpair_VERTICAL){ ! if(pass != view_HeightSet) { ! lpair_ComputeSizesFromTotal (self,width); ! view_DesiredSize(self->obj[0],self->objcvt[0], height,view_WidthSet,desiredwidth,&d0); ! view_DesiredSize(self->obj[1],self->objcvt[1], height,view_WidthSet,desiredwidth,&d1); ! *desiredwidth = width; ! self->objcvt[0] = c0; ! self->objcvt[1] = c1; ! if(d1 > 2048) { ! if(d0 > 2048){ ! *desiredheight = STARTHEIGHT; ! return(view_Fixed); ! } ! *desiredheight = d0; ! return(view_Fixed); } - if(d0 > 2048) { - *desiredheight = d1; - return(view_Fixed); - } - *desiredheight = max(d0,d1); - return(view_Fixed); - } } ! else { ! if(pass != view_WidthSet) { ! lpair_ComputeSizesFromTotal (self,height); ! view_DesiredSize(self->obj[0], width,self->objcvt[0], view_HeightSet,&d0,desiredheight); ! view_DesiredSize(self->obj[1], width,self->objcvt[1], view_HeightSet,&d1,desiredheight); ! self->objcvt[0] = c0; ! self->objcvt[1] = c1; ! *desiredheight = (height > 2048) ? STARTHEIGHT :height; ! *desiredwidth = max(d0,d1); ! return(view_Fixed); ! } ! } ! } ! *desiredwidth = width; ! *desiredheight = (height > 2048) ? STARTHEIGHT :height; ! return(view_Fixed); } ! static void lpair_ComputeSizesFromTotal (l,totalsize) register struct lpair *l; ! int totalsize; { ! int i = 0; ! if (l->movable) ! totalsize -= 2 * BARWIDTH + 1; /* If movable allocate an area for move mouse hits. */ ! else ! totalsize -= 1; /* Make room for the bar in the middle. */ ! switch(l->sizeform) { /* Allocate space for the 'hard' allocated view. */ ! case lpair_PERCENTAGE: ! i = 1; ! l->objcvt[i] = (l->objsize[i] * totalsize) / 100; ! break; ! case lpair_BOTTOMFIXED: ! i = 1; ! l->objcvt[i] = min(totalsize, l->objsize[i]); ! break; ! case lpair_TOPFIXED: ! i = 0; ! l->objcvt[i] = min(totalsize, l->objsize[i]); ! break; ! } ! /* Give the rest to the other view. */ ! l->objcvt[1-i] = totalsize - l->objcvt[i]; } static void lpair_ComputeSizes (l) register struct lpair *l; { ! int totalsize; ! /* Find out how much space the two must share. */ ! if (l->typex == lpair_VERTICAL) ! totalsize = lpair_GetLogicalWidth(l); ! else ! totalsize = lpair_GetLogicalHeight(l); ! /* See if we don't have any space -- actually we should be testing to see if children can fit at all, but for, now a simple test for zero */ ! if (totalsize == 0) { ! l->objcvt[0] = l->objcvt[1] = 0; ! return; ! } ! lpair_ComputeSizesFromTotal (l,totalsize); } static void lpair_ResetDimensions(self) register struct lpair *self; { ! register int i, x, y; ! register struct view *child; ! struct rectangle enclosingRect; ! x = 0; y = 0; ! for (i = 0; i < 2; i++) { /* Loop over the two halves of the lpair. */ ! child = (struct view *) self->obj[i]; ! if (child != NULL) ! if (self->typex == lpair_VERTICAL) { ! rectangle_SetRectSize(&enclosingRect, x, y, self->objcvt[i], lpair_GetLogicalHeight(self)); ! view_InsertView(child, self, &enclosingRect); ! x += self->objcvt[i] + 2 * BARWIDTH + 1; ! } ! else { ! rectangle_SetRectSize(&enclosingRect, x, y, lpair_GetLogicalWidth(self), self->objcvt[i]); ! view_InsertView(child, self, &enclosingRect); ! y += self->objcvt[i] + 2 * BARWIDTH + 1; ! } ! } } boolean lpair__InitializeObject (classID, self) ! struct classheader *classID; ! register struct lpair *self; { ! self->obj[0] = NULL; ! self->obj[1] = NULL; ! self->typex = lpair_HORIZONTAL; ! self->ismoving = FALSE; ! self->lasthit = 0; ! self->cursor = cursor_Create(self); ! cursor_SetStandard(self->cursor,Cursor_HorizontalBars); ! self->needsfull = 0; ! self->maybeZero = FALSE; ! return TRUE; } void lpair__FinalizeObject(classID, self) ! struct classheader *classID; ! struct lpair *self; { ! if (self->obj[0] != NULL) ! view_UnlinkTree(self->obj[0]); ! if (self->obj[1] != NULL) ! view_UnlinkTree(self->obj[1]); ! cursor_Destroy(self->cursor); } struct lpair *lpair__Create (classID, l1, l2, x) ! struct classheader *classID; ! struct view *l1, *l2; ! long x; { ! struct lpair *newl; ! newl = lpair_New(); ! lpair_Init(newl, l1, l2, x); ! return newl; } void lpair__Init(newl, l1, l2, x) struct lpair *newl; struct view *l1, *l2; ! long x; { ! if (x<0) ! lpair_VSplit(newl, l1, l2, -x, 1); ! else ! lpair_VFixed(newl, l1, l2, x, 1); ! newl->needsfull = 3; } struct lpair *lpair__SetUp(self, l1, l2, bsize, porf, vorh, moveable) struct lpair *self; /* The lpair view to modify. */ struct view *l1, *l2; /* This lpairs prospective children. */ ! int bsize, porf, vorh; /* Size of bottom (right) view area, size is percent or pixels, vertical or horizontal. */ { ! lpair_SetNth(self, 0, l1); ! lpair_SetNth(self, 1, l2); ! if (porf == lpair_TOPFIXED) { ! self->objsize[0] = bsize; ! self->objsize[1] = 0; ! } else { ! self->objsize[0] = 0; ! self->objsize[1] = bsize; ! } ! self->sizeform = porf; ! if (self->typex != vorh) { ! if ((self->typex = vorh) == lpair_VERTICAL) ! cursor_SetStandard(self->cursor,Cursor_VerticalBars); ! else ! cursor_SetStandard(self->cursor,Cursor_HorizontalBars); ! } ! self->movable = moveable; ! lpair_ComputeSizes(self); ! if (self->objcvt[0] == 0 || self->objcvt[1] == 0) ! self->maybeZero = TRUE; ! return self; } ! struct lpair *lpair__VFixed (tl, l1, l2, bsize,moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! ! lpair_SetUp(tl, l1, l2, bsize, lpair_BOTTOMFIXED, lpair_HORIZONTAL,moveable); ! return tl; } ! struct lpair *lpair__VTFixed (tl, l1, l2, bsize,moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! ! lpair_SetUp(tl, l1, l2, bsize, lpair_TOPFIXED, lpair_HORIZONTAL,moveable); ! return tl; } ! struct lpair *lpair__VSplit(tl, l1, l2, pct,moveable) struct view *l1, *l2; ! int pct; register struct lpair *tl; { ! lpair_SetUp(tl, l1, l2, pct, lpair_PERCENTAGE, lpair_HORIZONTAL,moveable); ! return tl; } ! struct lpair *lpair__HFixed (tl, l1, l2, bsize,moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! lpair_SetUp(tl, l1, l2, bsize, lpair_BOTTOMFIXED, lpair_VERTICAL,moveable); ! return tl; } ! struct lpair *lpair__HTFixed (tl, l1, l2, bsize,moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! lpair_SetUp(tl, l1, l2, bsize, lpair_TOPFIXED, lpair_VERTICAL,moveable); ! return tl; } ! struct lpair *lpair__HSplit(tl, l1, l2, pct,moveable) struct view *l1, *l2; ! int pct; register struct lpair *tl; { ! lpair_SetUp(tl, l1, l2, pct, lpair_PERCENTAGE, lpair_VERTICAL,moveable); ! return tl; } void lpair__SetLPState(tl, porf, vorh, movable) struct lpair *tl; /* Pointer to the lpair we wish to modify. */ ! int porf, vorh, movable; /* Percent or fixed, Vertical or Horizontal, movable bar. * */ { ! if (porf == lpair_PERCENTAGE || porf == lpair_BOTTOMFIXED || porf == lpair_TOPFIXED) ! tl->sizeform = porf; ! if (vorh == lpair_VERTICAL || vorh == lpair_HORIZONTAL) ! if (tl->typex != vorh) { ! if ((tl->typex = vorh) == lpair_VERTICAL) ! cursor_SetStandard(tl->cursor,Cursor_VerticalBars); ! else ! cursor_SetStandard(tl->cursor,Cursor_HorizontalBars); ! } ! if (movable != lpair_NOCHANGE) ! tl->movable = movable; ! tl->needsfull = 3; ! lpair_WantUpdate(tl, tl); } void lpair__GetLPState(tl, porf, vorh, movable) struct lpair *tl; ! int *porf, *vorh, *movable; { ! *porf = tl->sizeform; ! *vorh = tl->typex; ! *movable = tl->movable; } void lpair__SetMovable(lp, i) struct lpair *lp; ! int i; { ! lp->movable = i; } struct view *lpair__GetNth(l, ai) register struct lpair *l; ! int ai; { ! return l->obj[ai]; } void lpair__SetNth(self, ai, x) register struct lpair *self; register struct view *x; ! int ai; { ! if (ai >= 0 && ai <= 1 && self->obj[ai] != x) { ! int other = 1 - ai; ! if (self->obj[other] == x) { ! lpair_SetNth(self, other, NULL); ! } ! if (self->obj[ai] != NULL) ! view_UnlinkTree(self->obj[ai]); ! if ((self->obj[ai] = x) != NULL) ! view_LinkTree(self->obj[ai], self); ! self->needsfull |= (1 << ai); ! lpair_WantUpdate(self, self); ! } } void lpair__LinkTree(self, parent) struct lpair *self; struct view *parent; { ! super_LinkTree(self, parent); ! if (self->obj[0] != NULL) ! view_LinkTree(self->obj[0], self); ! if (self->obj[1] != NULL) ! view_LinkTree(self->obj[1], self); } void lpair__InitChildren(self) struct lpair *self; { ! if (self->obj[0] != NULL) ! view_InitChildren(self->obj[0]); ! if (self->obj[1] != NULL) ! view_InitChildren(self->obj[1]); } --- 47,699 ---- /* Basically, the only reason this routine exists is because the FullUpdate signature does not use rectangles. This routine expects its redrawRectangle argument to be valid know matter what the type argument is. The type arg is just passed through to the children that need to be redrawn. All in all, this, Update, and FullUpdate can probably be simplified. -Z- */ static void DoFullUpdate(self, type, redrawRectangle) ! struct lpair *self; ! enum view_UpdateType type; ! struct rectangle *redrawRectangle; { ! /* All this code needs changed */ ! register int x, y; ! int offset; /* Used to get the bar line in the right place. */ ! register struct view *leftTopObject = self->obj[0]; ! register struct view *rightBottomObject = self->obj[1]; ! struct rectangle childRectangle; ! self->needsfull = 0; ! lpair_ComputeSizes(self); ! lpair_ResetDimensions(self); /* reset the child lpair sizes */ ! x = 0; ! y = 0; ! if (self->typex == lpair_VERTICAL) ! x += self->objcvt[0]; ! else ! y += self->objcvt[0]; ! lpair_SetTransferMode(self, graphic_BLACK); ! offset = (self->movable) ? BARWIDTH : 0; /* If not movable, don't put extra space around bar. */ ! if (self->typex == lpair_VERTICAL) { ! lpair_MoveTo(self, x + offset, 0); ! lpair_DrawLineTo(self, x + offset, lpair_GetLogicalHeight(self)/*-1*/); ! } else { ! lpair_MoveTo(self, 0, y + offset); ! lpair_DrawLineTo(self, lpair_GetLogicalWidth(self)/*-1*/, y + offset); ! } ! if (leftTopObject != NULL) { ! view_GetEnclosedBounds(leftTopObject, &childRectangle); ! rectangle_IntersectRect(&childRectangle, &childRectangle, redrawRectangle); ! if (!rectangle_IsEmptyRect(&childRectangle)) { ! lpair_RetractViewCursors(self, leftTopObject); ! view_FullUpdate(leftTopObject, type, view_EnclosedXToLocalX(leftTopObject, ! rectangle_Left(&childRectangle)), view_EnclosedYToLocalY(leftTopObject, ! rectangle_Top(&childRectangle)), rectangle_Width(&childRectangle), rectangle_Height(&childRectangle)); ! } ! } ! if (rightBottomObject != NULL) { ! view_GetEnclosedBounds(rightBottomObject, &childRectangle); ! rectangle_IntersectRect(&childRectangle, &childRectangle, redrawRectangle); ! if (!rectangle_IsEmptyRect(&childRectangle)) { ! lpair_RetractViewCursors(self, rightBottomObject); ! view_FullUpdate(rightBottomObject, type, view_EnclosedXToLocalX(rightBottomObject, ! rectangle_Left(&childRectangle)), view_EnclosedYToLocalY(rightBottomObject, ! rectangle_Top(&childRectangle)), rectangle_Width(&childRectangle), rectangle_Height(&childRectangle)); ! } ! } ! if (self->movable) { ! struct rectangle cursorRegion; ! if (self->typex == lpair_VERTICAL) ! rectangle_SetRectSize(&cursorRegion, ! x - GRAVITY, ! 0, ! 2 * (BARWIDTH + GRAVITY) + 1, ! lpair_GetLogicalHeight(self)); ! else ! rectangle_SetRectSize(&cursorRegion, ! 0, ! y - GRAVITY, ! lpair_GetLogicalWidth(self), ! 2 * (BARWIDTH + GRAVITY) + 1); ! lpair_PostCursor(self, &cursorRegion, self->cursor); ! } } + void lpair__Update(self) ! struct lpair *self; { ! if (self->needsfull) { ! struct rectangle redrawRectangle; ! struct graphic *pat; ! lpair_SetTransferMode(self, graphic_COPY); ! lpair_GetLogicalBounds(self, &redrawRectangle); ! if (!(self->needsfull & 1)) { ! if (self->typex == lpair_HORIZONTAL) ! rectangle_SetTop(&redrawRectangle, self->objcvt[0] + BARWIDTH); ! else ! rectangle_SetLeft(&redrawRectangle, self->objcvt[0] + BARWIDTH); ! } ! if (!(self->needsfull & 2)) { ! if (self->typex == lpair_HORIZONTAL) ! rectangle_SetBottom(&redrawRectangle, self->objcvt[0] - BARWIDTH); ! else ! rectangle_SetRight(&redrawRectangle, self->objcvt[0] - BARWIDTH); ! } ! pat = lpair_WhitePattern(self); ! lpair_FillRect(self, &redrawRectangle, pat); ! /* I intentionally pass in view_FullRedraw here knowing that the DoFullUpdate * will still take the rectangle into account. */ ! DoFullUpdate(self, view_FullRedraw, &redrawRectangle); ! } } + void lpair__FullUpdate(self, type, left, top, width, height) ! struct lpair *self; ! enum view_UpdateType type; ! long left; ! long top; ! long width; ! long height; { ! struct rectangle redrawRectangle; ! /* This really shouldn't be neccesary since the other redraw types should be required to fill in an appropriate recangle. However there are a few places (drawtxtv.c) where view_FullRedraw and view_Remove types get sent with 0 by 0 rectangles. */ ! switch (type) { ! case view_PartialRedraw: ! case view_LastPartialRedraw: ! rectangle_SetRectSize(&redrawRectangle, left, top, width, height); ! break; ! case view_MoveNoRedraw: ! /* Need to reinsert views so they get correct coordinate system. */ ! lpair_ResetDimensions(self); ! /* Intentional fall through. */ ! case view_Remove: ! if (self->obj[0] != NULL) ! view_FullUpdate(self->obj[0], type, 0, 0, 0, 0); ! if (self->obj[1] != NULL) ! view_FullUpdate(self->obj[1], type, 0, 0, 0, 0); ! return; ! break; ! default: ! lpair_GetVisualBounds(self, &redrawRectangle); ! break; ! } ! DoFullUpdate(self, type, &redrawRectangle); } + #define ABS(x) ((x) > 0 ? (x) : -(x)) struct view *lpair__Hit(self, action, x, y, numberOfClicks) struct lpair *self; enum view_MouseAction action; ! long x, y; ! long numberOfClicks; { ! register long dim; ! if (self->typex == lpair_VERTICAL) { ! dim = x; ! } else { ! dim = y; ! } ! if (self->movable && ! (action == view_RightDown || action == view_LeftDown) && ! (ABS(dim - self->objcvt[0] - BARWIDTH) <= BARWIDTH + GRAVITY)) { ! self->lasthit = dim; ! im_SetWindowCursor(view_GetIM((struct view *) self), self->cursor); ! self->ismoving = TRUE; ! return((struct view *) self); /* Our hit, return us. */ ! } ! if (self->ismoving) { ! if ((action == view_RightUp || action == view_LeftUp)) { ! if (!self->maybeZero) ! if (self->typex == lpair_VERTICAL) { ! x = max(x, BARWIDTH + GRAVITY); ! x = min(x, ! lpair_GetLogicalWidth(self) - BARWIDTH - GRAVITY); ! } ! else { ! y = max(y, BARWIDTH + GRAVITY); ! y = min(y, ! lpair_GetLogicalHeight(self) - BARWIDTH - GRAVITY); ! } ! if ((abs(self->lasthit - dim) > BARWIDTH + GRAVITY)) { ! if (self->typex == lpair_VERTICAL) ! if (self->sizeform == lpair_PERCENTAGE) ! self->objsize[1] = 100 - ! ((100 * x) / lpair_GetLogicalWidth(self)); ! else if (self->sizeform == lpair_BOTTOMFIXED) ! self->objsize[1] = lpair_GetLogicalWidth(self) - x; ! else ! self->objsize[0] = x; ! else if (self->sizeform == lpair_PERCENTAGE) ! self->objsize[1] = 100 - ! ((100 * y) / lpair_GetLogicalHeight(self)); ! else if (self->sizeform == lpair_BOTTOMFIXED) ! self->objsize[1] = lpair_GetLogicalHeight(self) - y; ! else ! self->objsize[0] = y; ! if (self->sizeform == lpair_PERCENTAGE) ! if (self->objsize[1] > 100) ! self->objsize[1] = 100; ! else if (self->objsize[1] < 0) ! self->objsize[1] = 0; ! self->needsfull = 3; ! lpair_WantUpdate(self, self); ! } ! im_SetWindowCursor(lpair_GetIM(self), NULL); ! self->ismoving = FALSE; ! } ! return((struct view *) self); } ! if (self->typex == lpair_VERTICAL) ! if (x < self->objcvt[0]) { ! if (self->obj[0] != NULL) ! return view_Hit(self->obj[0], action, view_EnclosedXToLocalX(self->obj[0], x), ! view_EnclosedYToLocalY(self->obj[0], y), numberOfClicks); ! } ! else { ! if (self->obj[1] != NULL) ! return view_Hit(self->obj[1], action, view_EnclosedXToLocalX(self->obj[1], x), ! view_EnclosedYToLocalY(self->obj[1], y), numberOfClicks); ! } ! else if (y < self->objcvt[0]) { ! if (self->obj[0] != NULL) ! return view_Hit(self->obj[0], action, view_EnclosedXToLocalX(self->obj[0], x), ! view_EnclosedYToLocalY(self->obj[0], y), numberOfClicks); ! } else { ! if (self->obj[1] != NULL) ! return view_Hit(self->obj[1], action, view_EnclosedXToLocalX(self->obj[1], x), ! view_EnclosedYToLocalY(self->obj[1], y), numberOfClicks); ! } ! return NULL; /* Catches the case where one of the lpair's views is NULL. */ } + /* This routineis special to prevent children from getting updates before a * FullUpdate. ! */ void lpair__WantUpdate(self, requestor) ! struct lpair *self; ! struct view *requestor; { ! /* If we are about to FullUpdate the view requesting an update, throw away the * request. This prevents views from getting updates before FullUpdates. */ ! if (self->header.view.parent != NULL && ! !((self->needsfull & 1) && self->obj[0] != NULL && ! view_IsAncestor(requestor, self->obj[0]) || ! (self->needsfull & 2) && self->obj[1] != NULL && ! view_IsAncestor(requestor, self->obj[1])) && ! self->header.view.parent != NULL) ! view_WantUpdate(self->header.view.parent, requestor); } + + #define STARTHEIGHT 256 enum view_DSattributes lpair__DesiredSize(self, width, height, pass, desiredwidth, desiredheight) struct lpair *self; ! long width, height; enum view_DSpass pass; ! long *desiredwidth, *desiredheight; { ! long d0, d1, c0, c1; ! c0 = self->objcvt[0]; ! c1 = self->objcvt[1]; ! if (self->obj[0] && self->obj[1]) { ! if (self->typex == lpair_VERTICAL) { ! if (pass != view_HeightSet) { ! lpair_ComputeSizesFromTotal (self, width); ! view_DesiredSize(self->obj[0], self->objcvt[0], height, view_WidthSet, desiredwidth, &d0); ! view_DesiredSize(self->obj[1], self->objcvt[1], height, view_WidthSet, desiredwidth, &d1); ! *desiredwidth = width; ! self->objcvt[0] = c0; ! self->objcvt[1] = c1; ! if (d1 > 2048) { ! if (d0 > 2048) { ! *desiredheight = STARTHEIGHT; ! return(view_Fixed); ! } ! *desiredheight = d0; ! return(view_Fixed); ! } ! if (d0 > 2048) { ! *desiredheight = d1; ! return(view_Fixed); ! } ! *desiredheight = max(d0, d1); ! return(view_Fixed); ! } ! } else { ! if (pass != view_WidthSet) { ! lpair_ComputeSizesFromTotal (self, height); ! view_DesiredSize(self->obj[0], width, self->objcvt[0], view_HeightSet, &d0, desiredheight); ! view_DesiredSize(self->obj[1], width, self->objcvt[1], view_HeightSet, &d1, desiredheight); ! self->objcvt[0] = c0; ! self->objcvt[1] = c1; ! *desiredheight = (height > 2048) ? STARTHEIGHT : height; ! *desiredwidth = max(d0, d1); ! return(view_Fixed); ! } } } ! *desiredwidth = width; ! *desiredheight = (height > 2048) ? STARTHEIGHT : height; ! return(view_Fixed); } ! ! static void lpair_ComputeSizesFromTotal (l, totalsize) register struct lpair *l; ! int totalsize; { ! int i = 0; ! if (l->movable) ! totalsize -= 2 * BARWIDTH + 1; /* If movable allocate an area for move mouse hits. */ ! else ! totalsize -= 1; /* Make room for the bar in the middle. */ ! switch (l->sizeform) { /* Allocate space for the 'hard' allocated view. */ ! case lpair_PERCENTAGE: ! i = 1; ! l->objcvt[i] = (l->objsize[i] * totalsize) / 100; ! break; ! case lpair_BOTTOMFIXED: ! i = 1; ! l->objcvt[i] = min(totalsize, l->objsize[i]); ! break; ! case lpair_TOPFIXED: ! i = 0; ! l->objcvt[i] = min(totalsize, l->objsize[i]); ! break; ! } ! /* Give the rest to the other view. */ ! l->objcvt[1-i] = totalsize - l->objcvt[i]; } + + static void lpair_ComputeSizes (l) register struct lpair *l; { ! int totalsize; ! /* Find out how much space the two must share. */ ! if (l->typex == lpair_VERTICAL) ! totalsize = lpair_GetLogicalWidth(l); ! else ! totalsize = lpair_GetLogicalHeight(l); ! /* See if we don't have any space -- actually we should be testing to see if children can fit at all, but for, now a simple test for zero */ ! if (totalsize == 0) { ! l->objcvt[0] = l->objcvt[1] = 0; ! return; ! } ! lpair_ComputeSizesFromTotal (l, totalsize); } + static void lpair_ResetDimensions(self) register struct lpair *self; { ! register int i, x, y; ! register struct view *child; ! struct rectangle enclosingRect; ! x = 0; ! y = 0; ! for (i = 0; i < 2; i++) { /* Loop over the two halves of the lpair. */ ! child = (struct view *) self->obj[i]; ! if (child != NULL) ! if (self->typex == lpair_VERTICAL) { ! rectangle_SetRectSize(&enclosingRect, x, y, self->objcvt[i], lpair_GetLogicalHeight(self)); ! view_InsertView(child, self, &enclosingRect); ! x += self->objcvt[i] + 2 * BARWIDTH + 1; ! } ! else { ! rectangle_SetRectSize(&enclosingRect, x, y, lpair_GetLogicalWidth(self), self->objcvt[i]); ! view_InsertView(child, self, &enclosingRect); ! y += self->objcvt[i] + 2 * BARWIDTH + 1; ! } ! } } + boolean lpair__InitializeObject (classID, self) ! struct classheader *classID; ! register struct lpair *self; { ! self->obj[0] = NULL; ! self->obj[1] = NULL; ! self->typex = lpair_HORIZONTAL; ! self->ismoving = FALSE; ! self->lasthit = 0; ! self->cursor = cursor_Create(self); ! cursor_SetStandard(self->cursor, Cursor_HorizontalBars); ! self->needsfull = 0; ! self->maybeZero = FALSE; ! return TRUE; } + void lpair__FinalizeObject(classID, self) ! struct classheader *classID; ! struct lpair *self; { ! if (self->obj[0] != NULL) ! view_UnlinkTree(self->obj[0]); ! if (self->obj[1] != NULL) ! view_UnlinkTree(self->obj[1]); ! cursor_Destroy(self->cursor); } + struct lpair *lpair__Create (classID, l1, l2, x) ! struct classheader *classID; ! struct view *l1, *l2; ! long x; { ! struct lpair *newl; ! newl = lpair_New(); ! lpair_Init(newl, l1, l2, x); ! return newl; } + void lpair__Init(newl, l1, l2, x) struct lpair *newl; struct view *l1, *l2; ! long x; { ! if (x < 0) ! lpair_VSplit(newl, l1, l2, -x, 1); ! else ! lpair_VFixed(newl, l1, l2, x, 1); ! newl->needsfull = 3; } + struct lpair *lpair__SetUp(self, l1, l2, bsize, porf, vorh, moveable) struct lpair *self; /* The lpair view to modify. */ struct view *l1, *l2; /* This lpairs prospective children. */ ! int bsize, porf, vorh; /* Size of bottom (right) view area, size is percent or pixels, vertical or horizontal. */ { ! lpair_SetNth(self, 0, l1); ! lpair_SetNth(self, 1, l2); ! if (porf == lpair_TOPFIXED) { ! self->objsize[0] = bsize; ! self->objsize[1] = 0; ! } else { ! self->objsize[0] = 0; ! self->objsize[1] = bsize; ! } ! self->sizeform = porf; ! if (self->typex != vorh) { ! if ((self->typex = vorh) == lpair_VERTICAL) ! cursor_SetStandard(self->cursor, Cursor_VerticalBars); ! else ! cursor_SetStandard(self->cursor, Cursor_HorizontalBars); ! } ! self->movable = moveable; ! lpair_ComputeSizes(self); ! if (self->objcvt[0] == 0 || self->objcvt[1] == 0) ! self->maybeZero = TRUE; ! return self; } ! ! struct lpair *lpair__VFixed (tl, l1, l2, bsize, moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! ! lpair_SetUp(tl, l1, l2, bsize, lpair_BOTTOMFIXED, lpair_HORIZONTAL, moveable); ! return tl; } ! ! struct lpair *lpair__VTFixed (tl, l1, l2, bsize, moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! ! lpair_SetUp(tl, l1, l2, bsize, lpair_TOPFIXED, lpair_HORIZONTAL, moveable); ! return tl; } ! ! struct lpair *lpair__VSplit(tl, l1, l2, pct, moveable) struct view *l1, *l2; ! int pct; register struct lpair *tl; { ! lpair_SetUp(tl, l1, l2, pct, lpair_PERCENTAGE, lpair_HORIZONTAL, moveable); ! return tl; } ! ! struct lpair *lpair__HFixed (tl, l1, l2, bsize, moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! lpair_SetUp(tl, l1, l2, bsize, lpair_BOTTOMFIXED, lpair_VERTICAL, moveable); ! return tl; } ! ! struct lpair *lpair__HTFixed (tl, l1, l2, bsize, moveable) struct view *l1, *l2; struct lpair *tl; ! int bsize; { ! lpair_SetUp(tl, l1, l2, bsize, lpair_TOPFIXED, lpair_VERTICAL, moveable); ! return tl; } ! ! struct lpair *lpair__HSplit(tl, l1, l2, pct, moveable) struct view *l1, *l2; ! int pct; register struct lpair *tl; { ! lpair_SetUp(tl, l1, l2, pct, lpair_PERCENTAGE, lpair_VERTICAL, moveable); ! return tl; } + void lpair__SetLPState(tl, porf, vorh, movable) struct lpair *tl; /* Pointer to the lpair we wish to modify. */ ! int porf, vorh, movable; /* Percent or fixed, Vertical or Horizontal, movable bar. * */ { ! if (porf == lpair_PERCENTAGE || porf == lpair_BOTTOMFIXED || porf == lpair_TOPFIXED) ! tl->sizeform = porf; ! if (vorh == lpair_VERTICAL || vorh == lpair_HORIZONTAL) ! if (tl->typex != vorh) { ! if ((tl->typex = vorh) == lpair_VERTICAL) ! cursor_SetStandard(tl->cursor, Cursor_VerticalBars); ! else ! cursor_SetStandard(tl->cursor, Cursor_HorizontalBars); ! } ! if (movable != lpair_NOCHANGE) ! tl->movable = movable; ! tl->needsfull = 3; ! lpair_WantUpdate(tl, tl); } + void lpair__GetLPState(tl, porf, vorh, movable) struct lpair *tl; ! int *porf, *vorh, *movable; { ! *porf = tl->sizeform; ! *vorh = tl->typex; ! *movable = tl->movable; } + void lpair__SetMovable(lp, i) struct lpair *lp; ! int i; { ! lp->movable = i; } + struct view *lpair__GetNth(l, ai) register struct lpair *l; ! int ai; { ! return l->obj[ai]; } + void lpair__SetNth(self, ai, x) register struct lpair *self; register struct view *x; ! int ai; { ! if (ai >= 0 && ai <= 1 && self->obj[ai] != x) { ! int other = 1 -ai; ! if (self->obj[other] == x) { ! lpair_SetNth(self, other, NULL); ! } ! if (self->obj[ai] != NULL) ! view_UnlinkTree(self->obj[ai]); ! if ((self->obj[ai] = x) != NULL) ! view_LinkTree(self->obj[ai], self); ! self->needsfull |= (1 << ai); ! lpair_WantUpdate(self, self); ! } } + void lpair__LinkTree(self, parent) struct lpair *self; struct view *parent; { ! super_LinkTree(self, parent); ! if (self->obj[0] != NULL) ! view_LinkTree(self->obj[0], self); ! if (self->obj[1] != NULL) ! view_LinkTree(self->obj[1], self); } + void lpair__InitChildren(self) struct lpair *self; { ! if (self->obj[0] != NULL) ! view_InitChildren(self->obj[0]); ! if (self->obj[1] != NULL) ! view_InitChildren(self->obj[1]); } + + *** atkams/messages/lib/stubs.c Wed Nov 22 12:44:33 1989 --- atkams/messages/lib/stubs.c.NEW Fri Dec 22 16:44:15 1989 *************** *** 11,22 **** #include #ifdef AFS_ENV #include #include #include #include #include #include - #include #endif /* AFS_ENV */ #include #ifdef WHITEPAGES_ENV --- 11,22 ---- #include #ifdef AFS_ENV #include + #include #include #include #include #include #include #endif /* AFS_ENV */ #include #ifdef WHITEPAGES_ENV *** config/ps_aix11/system.h Wed Nov 22 11:29:16 1989 --- config/ps_aix11/system.h.NEW Wed Jan 3 18:31:35 1990 *************** *** 21,27 **** #define SY_AIX11 1 /* This system is most like AIX 1.1 */ #undef RESOLVER_ENV ! #undef LEVEL_ENV #define LEVEL_ENV 1 --- 21,28 ---- #define SY_AIX11 1 /* This system is most like AIX 1.1 */ #undef RESOLVER_ENV ! #undef ANDREW_MALLOC_ENV ! #undef DEBUG_MALLOC_ENV #undef LEVEL_ENV #define LEVEL_ENV 1 *** config/ps_aix11/system.mcr Wed Nov 22 11:29:15 1989 --- config/ps_aix11/system.mcr.NEW Wed Jan 3 18:31:11 1990 *************** *** 17,23 **** /* Now for the system-dependent information. */ XSRCDIR = / - XUTILDIR = /usr/amos/bin/X11 INCLUDES = -I${BASEDIR}/include/atk -I${BASEDIR}/include -I${XBASEDIR}/usr/include CC = cc -DBSD_INCLUDES -DBSD_REMAP_SIGNAL_TO_SIGVEC --- 17,22 ---- *** overhead/class/pp/class.c Thu Dec 7 10:35:35 1989 --- overhead/class/pp/class.c.NEW Mon Dec 18 15:48:51 1989 *************** *** 2,8 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: class.c,v 1.2 89/12/07 10:35:03 xguest Exp $ */ #include #include --- 2,8 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/class/pp/RCS/class.c,v 2.39 89/12/13 09:59:25 ghoti Exp $ */ #include #include *************** *** 289,295 **** ** Error handler for caught signals ** Left of unspecified type on purpose **/ ! static void errorhandler(sig, code, scp) int sig; int code; struct sigcontext *scp; --- 289,295 ---- ** Error handler for caught signals ** Left of unspecified type on purpose **/ ! static errorhandler(sig, code, scp) int sig; int code; struct sigcontext *scp; *** overhead/fonts/fonts/andy/linkfnts.csh Wed Nov 22 13:46:02 1989 --- overhead/fonts/fonts/andy/linkfnts.csh.NEW Mon Dec 18 15:50:06 1989 *************** *** 37,47 **** set NAMELIST=$REAL* foreach NAME ($NAMELIST) set LNAME=`echo $NAME | sed -e s+$REAL+$LINK1+g` ! rm -f ${FONTDIR}/${LNAME} ! (set echo;${LN} ${NAME} ${FONTDIR}/${LNAME}) set LNAME=`echo $NAME | sed -e s+$REAL+$LINK2+g` ! rm -f ${FONTDIR}/${LNAME} ! (set echo;${LN} $NAME ${FONTDIR}/${LNAME}) end end popd --- 37,47 ---- set NAMELIST=$REAL* foreach NAME ($NAMELIST) set LNAME=`echo $NAME | sed -e s+$REAL+$LINK1+g` ! rm -f ${LNAME} ! (set echo;${LN} ${NAME} ${LNAME}) set LNAME=`echo $NAME | sed -e s+$REAL+$LINK2+g` ! rm -f ${LNAME} ! (set echo;${LN} $NAME ${LNAME}) end end popd *** overhead/snap2/guardian/cmd/Imakefile Wed Nov 22 13:57:33 1989 --- overhead/snap2/guardian/cmd/Imakefile.NEW Wed Dec 13 10:29:54 1989 *************** *** 11,16 **** --- 11,17 ---- ${BASEDIR}/lib/libutil.a \ ${BASEDIR}/lib/liberrors.a \ ${AFSBASEDIR}/lib/afs/librauth.a \ + ${AFSBASEDIR}/lib/afs/libauth.a \ ${AFSBASEDIR}/lib/afs/libacl.a \ ${AFSBASEDIR}/lib/libr.a \ ${AFSBASEDIR}/lib/libscrypt.a \ END OF ANDREW PATCH 1