*** atkams/messages/lib/captions.c Fri Dec 21 15:00:37 1990 --- atkams/messages/lib/captions.c.NEW Sat Apr 27 02:06:31 1991 *************** *** 2,65 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v 2.32 90/10/15 15:05:56 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v 2.32 90/10/15 15:05:56 gk5g Exp $ "; #endif /* lint */ #include #include #include #include - #include /* sys/file.h */ #include /* for htonl, etc. */ #include #include #include #include ! #include ! #include #include - #include #include - /*#include */ #include - #include #include ! /*#include */ #include #include #include #include #include #include #include #include ! AbsentProcedure(self) ! struct view *self; ! { ! message_DisplayString(NULL, 75, "Absent procedure - did not find a normal BE2 command in the proctable!"); ! } ! ! int (*textview_PreviousLineCmd)() = AbsentProcedure, ! (*textview_ReverseSearchCmd)() = AbsentProcedure, ! (*textview_ScrollScreenFwdCmd)() = AbsentProcedure, ! (*textview_ScrollScreenBackCmd)() = AbsentProcedure, ! (*textview_BeginningOfTextCmd)() = AbsentProcedure, ! (*textview_BeginningOfLineCmd)() = AbsentProcedure, ! (*textview_EndOfLineCmd)() = AbsentProcedure, ! (*textview_GlitchDownCmd)() = AbsentProcedure; ! extern char *index(), *rindex(); #ifndef _IBMR2 extern char *malloc(); #endif /* _IBMR2 */ void captions__ShowHelp(self) struct captions *self; { --- 2,83 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v 2.38 1991/04/27 06:00:22 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v 2.38 1991/04/27 06:00:22 gk5g Exp $ "; #endif /* lint */ + #include /* sys/file.h */ #include #include #include #include #include /* for htonl, etc. */ #include #include #include #include ! #include ! #include #include #include #include ! #include ! #include #include #include #include + #include #include #include #include #include + #include + #include + #include + #include + #include #include ! static int AbsentProcedure(); ! extern void SimulateLeftClick(); ! extern void SimulateRightClick(); ! extern void CaptionsCompound(); ! extern void CaptionsTextviewCommand(); ! extern void CaptionsFoldersCommand(); ! extern void CaptionsBodiesCommand(); ! extern void DownFocus(), UpFocus(); ! extern void CapBeginText(), CapScrollBack(); ! extern void PreviousCaptionLine(); ! extern void CapGlitchDown(); ! ! int (*textv_PreviousLineCmd)() = AbsentProcedure, ! (*textv_ReverseSearchCmd)() = AbsentProcedure, ! (*textv_ScrollScreenFwdCmd)() = AbsentProcedure, ! (*textv_ScrollScreenBackCmd)() = AbsentProcedure, ! (*textv_BeginningOfTextCmd)() = AbsentProcedure, ! (*textv_BeginningOfLineCmd)() = AbsentProcedure, ! (*textv_EndOfLineCmd)() = AbsentProcedure, ! (*textv_GlitchDownCmd)() = AbsentProcedure; ! static struct keymap *captions_privkeymap; ! static struct menulist *captions_privmenulist; #ifndef _IBMR2 extern char *malloc(); #endif /* _IBMR2 */ + static int AbsentProcedure(self) + struct view *self; + { + message_DisplayString(NULL, 75, "Absent procedure - did not find a normal BE2 command in the proctable!"); + return(0); + } + void captions__ShowHelp(self) struct captions *self; { *************** *** 189,197 **** struct text *bod; ams_WaitCursor(TRUE); ! textview_BeginningOfLineCmd(tv); dot = captions_GetDotPosition(captions); ! textview_EndOfLineCmd(tv); tmpdot = captions_GetDotPosition(captions); len = tmpdot - dot; if (len > 0) { --- 207,215 ---- struct text *bod; ams_WaitCursor(TRUE); ! textv_BeginningOfLineCmd(tv); dot = captions_GetDotPosition(captions); ! textv_EndOfLineCmd(tv); tmpdot = captions_GetDotPosition(captions); len = tmpdot - dot; if (len > 0) { *************** *** 233,368 **** } - int captions__DisplayNewBody(captions, thisCUID, linestart, linelen, env) - struct captions *captions; - int thisCUID, linestart, linelen; - struct environment *env; - { - char *id, *dir; - int WasDeleted, IsDeleted, checkvis; - - if (captions->captioncachecount <= 0) return; - ams_WaitCursor(TRUE); - /* Want to increase the likelihood the next line is visible unless this is the last line, in which case we simply want to ensure this line is visible. */ - if ((linestart + linelen + 1) < text_GetLength(captions->CaptText)) { - checkvis = linestart+linelen+1; - } else { - checkvis = linestart; - } - if (!captions_Visible(captions, checkvis)) { - captions_SetTopPosition(captions, linestart); - } - if (captions->HighlightLen) { - RemoveHighlighting(captions); - } - captions->HighlightStartPos = linestart; - captions->HighlightLen = linelen; - captions->HighlightEnv = env; - if (captions->HighlightEnv->data.style == captions->ActiveDeletedStyle - || captions->HighlightEnv->data.style == captions->DeletedStyle) { - text_SetEnvironmentStyle(captions->CaptText, captions->HighlightEnv, captions->ActiveDeletedStyle); - WasDeleted = 1; - } else { - text_SetEnvironmentStyle(captions->CaptText, captions->HighlightEnv, captions->ActiveCaptionStyle); - WasDeleted = 0; - } - t822view_WantUpdate(captions_GetBodView(captions), captions_GetBodView(captions)); - captions_WantUpdate(captions, captions); - im_ForceUpdate(); - if (thisCUID == captions->VisibleCUID) { - SetSouthernmostPoint(captions, linestart); - ams_WaitCursor(FALSE); - return(0); - } - captions->VisibleCUID = thisCUID; - if (captions_GetBodyFromCUID(captions, thisCUID, MODE822_NORMAL, NULL)) { - /* error was reported */ - ams_WaitCursor(FALSE); - ResetCaptionNotBody(captions); - return(-1); - } - IsDeleted = AMS_GET_ATTRIBUTE(captions->VisibleSnapshot, AMS_ATT_DELETED) ? 1 : 0; - if (IsDeleted != WasDeleted) { - /* Someone else just deleted or undeleted it! */ - if (IsDeleted) { - message_DisplayString(NULL, 25, "Someone has just deleted this message, but not yet purged it."); - text_SetEnvironmentStyle(captions->CaptText, captions->HighlightEnv, captions->ActiveDeletedStyle); - } else { - text_SetEnvironmentStyle(captions->CaptText, captions->HighlightEnv, captions->ActiveCaptionStyle); - message_DisplayString(NULL, 25, "Someone has just undeleted this message."); - } - captions_AlterDeletedIcon(captions, captions->HighlightStartPos, IsDeleted); - captions_WantUpdate(captions, captions); - } - SetSouthernmostPoint(captions, linestart); - im_ForceUpdate(); - if (!ams_CUI_GetAMSID(ams_GetAMS(), thisCUID, &id, &dir)) { - ams_MS_PrefetchMessage(ams_GetAMS(), dir, id, 1); - } - ams_WaitCursor(FALSE); - return(0); - } - - int captions__GetBodyFromCUID(ci, cuid, Mode, ContentTypeOverride) - struct captions *ci; - int cuid, Mode; - char *ContentTypeOverride; - { - struct text *d; - struct t822view *bv; - char FileName[1+MAXPATHLEN], ErrorText[500]; - int ShouldDelete, IgnorePos, len; - FILE *fp; - struct im *im; - d = captions_GetBodDoc(ci); - bv = captions_GetBodView(ci); - text_ClearCompletely(d); - text822_ResetGlobalStyle(d); - im = t822view_GetIM(bv); - if (im && im_GetInputFocus(im) == NULL) t822view_WantInputFocus(bv, bv); - if (ams_CUI_ReallyGetBodyToLocalFile(ams_GetAMS(), cuid, FileName, &ShouldDelete, !ams_CUI_SnapIsRunning(ams_GetAMS())) - || ams_CUI_GetSnapshotFromCUID(ams_GetAMS(), cuid, ci->VisibleSnapshot)) { - return(-1); /* Error message already reported */ - } - fp = fopen(FileName, "r"); - if (!fp) { - ams_ReportError(ams_GetAMS(), "Cannot read message body file", ERR_WARNING, FALSE, 0); - return(-1); - } - if (!text822_ReadIntoText(d, fp, Mode, ContentTypeOverride, &len, TRUE, &ci->StartOfRealBody, &IgnorePos, NULL)) { - ams_ReportError(ams_GetAMS(), "Cannot read text822 object", ERR_WARNING, FALSE, 0); - fclose(fp); - return(-1); - } - fclose(fp); - ci->CurrentFormatting = Mode; - if (ShouldDelete) { - if (unlink(FileName)) { - sprintf(ErrorText, "Cannot unlink local file %s (%d)", FileName, errno); - ams_ReportError(ams_GetAMS(), ErrorText, ERR_WARNING, FALSE, 0); - } - } - t822view_SetTopPosition(bv, IgnorePos+1); - t822view_SetDotPosition(bv, IgnorePos+1); - t822view_SetDotLength(bv, 0); - - text_SetReadOnly(d, TRUE); - MarkVisibleMessageSeen(ci); - t822view_WantUpdate(bv, bv); - captions_WantUpdate(ci, ci); - im = t822view_GetIM(bv); - #ifdef NOWAYJOSE - if (im) { - im_ExposeWindow(im); - } - #endif /* NOWAYJOSE */ - im_ForceUpdate(); - ams_SubtleDialogs(ams_GetAMS(), TRUE); - ams_CUI_ProcessMessageAttributes(ams_GetAMS(), cuid, ci->VisibleSnapshot); - ams_SubtleDialogs(ams_GetAMS(), FALSE); - return (0); - } void GetInfo(ci, total, seen, dot) --- 251,257 ---- *************** *** 376,383 **** if (ci->captioncachecount <= 0) return; gap = ci->FolderSize - ci->FetchedFromEnd - ci->FetchedFromStart; total->beg = 0; ! total->end = ci->FolderSize; ! pos = seen->beg; captions_FindCUIDByDocLocation(ci, &pos, &mylen, &envptr, &whichcaption); if (pos < 0) { total->beg = total->end = 0; --- 265,272 ---- if (ci->captioncachecount <= 0) return; gap = ci->FolderSize - ci->FetchedFromEnd - ci->FetchedFromStart; total->beg = 0; ! total->end = captions_EncodePosition(ci, ci->FolderSize); ! pos = captions_DecodePosition(ci, seen->beg); captions_FindCUIDByDocLocation(ci, &pos, &mylen, &envptr, &whichcaption); if (pos < 0) { total->beg = total->end = 0; *************** *** 386,398 **** return; } mystart = (whichcaption >= ci->FetchedFromStart) ? (whichcaption + gap) : whichcaption; ! pos = seen->end - 1; captions_FindCUIDByDocLocation(ci, &pos, &mylen, &envptr, &whichcaption); ! seen->beg = mystart; seen->end = ((whichcaption >= ci->FetchedFromStart) ? (whichcaption + gap) : whichcaption) + 1; pos = ci->HighlightStartPos; captions_FindCUIDByDocLocation(ci, &pos, &mylen, &envptr, &whichcaption); dot->beg = (whichcaption >= ci->FetchedFromStart) ? (whichcaption + gap) : whichcaption; dot->end = dot->beg; } --- 275,289 ---- return; } mystart = (whichcaption >= ci->FetchedFromStart) ? (whichcaption + gap) : whichcaption; ! pos = captions_DecodePosition(ci, seen->end) - 1; captions_FindCUIDByDocLocation(ci, &pos, &mylen, &envptr, &whichcaption); ! seen->beg = captions_EncodePosition(ci, mystart); seen->end = ((whichcaption >= ci->FetchedFromStart) ? (whichcaption + gap) : whichcaption) + 1; + seen->end = captions_EncodePosition(ci, seen->end); pos = ci->HighlightStartPos; captions_FindCUIDByDocLocation(ci, &pos, &mylen, &envptr, &whichcaption); dot->beg = (whichcaption >= ci->FetchedFromStart) ? (whichcaption + gap) : whichcaption; + dot->beg = captions_EncodePosition(ci, dot->beg); dot->end = dot->beg; } *************** *** 400,428 **** struct captions *ci; long p, n, d; { ! int min, max, w; if (ci->captioncachecount <= 0) { ci->textscrollinterface->SetFrame(ci, p, n, d); return; } w = (n * captions_GetLogicalHeight(ci)) / d; /* The following conservatively assume a 6 pt font, 4 pts spacing */ ! min = p - (w / 10); ! max = p + ((captions_GetLogicalHeight(ci) - w) / 10); if (min < 0) min = 0; if (max > ci->FolderSize) max = ci->FolderSize; if (captions_GuaranteeFetchedRange(ci, min, max)) return; /* error reported */ ! if (p >= ci->FolderSize) p = ci->FolderSize - 1; ! if (p >= ci->FetchedFromStart) { ! p -= ci->FolderSize - ci->FetchedFromEnd - ci->FetchedFromStart; } ! if (p >= 0) { ! ci->textscrollinterface->SetFrame(ci, ci->capcache[p].offset, n, d); } else { ! ci->textscrollinterface->SetFrame(ci, 0, n, d); } } static long WhatIsAt(ci, n, d) --- 291,321 ---- struct captions *ci; long p, n, d; { ! int min, max, w, myp, outp; if (ci->captioncachecount <= 0) { ci->textscrollinterface->SetFrame(ci, p, n, d); return; } + myp = captions_DecodePosition(ci, p); w = (n * captions_GetLogicalHeight(ci)) / d; /* The following conservatively assume a 6 pt font, 4 pts spacing */ ! min = myp - (w / 10); ! max = myp + ((captions_GetLogicalHeight(ci) - w) / 10); if (min < 0) min = 0; if (max > ci->FolderSize) max = ci->FolderSize; if (captions_GuaranteeFetchedRange(ci, min, max)) return; /* error reported */ ! if (myp >= ci->FolderSize) myp = ci->FolderSize - 1; ! if (myp >= ci->FetchedFromStart) { ! myp -= ci->FolderSize - ci->FetchedFromEnd - ci->FetchedFromStart; } ! if (myp >= 0) { ! outp = captions_EncodePosition(ci, ci->capcache[myp].offset); } else { ! outp = captions_EncodePosition(ci, 0); } + ci->textscrollinterface->SetFrame(ci, outp, n, d); } static long WhatIsAt(ci, n, d) *************** *** 434,441 **** pos = ci->textscrollinterface->WhatIsAt(ci, n, d); if (ci->captioncachecount > 0) { captions_FindCUIDByDocLocation(ci, &pos, &len, &envptr, &whichcaption); ! pos = (whichcaption >= ci->FetchedFromStart) ? (whichcaption + ci->FolderSize - ci->FetchedFromEnd - ci->FetchedFromStart) : whichcaption; } return(pos); } --- 327,336 ---- pos = ci->textscrollinterface->WhatIsAt(ci, n, d); if (ci->captioncachecount > 0) { + pos = captions_DecodePosition(ci, pos); captions_FindCUIDByDocLocation(ci, &pos, &len, &envptr, &whichcaption); ! pos = (whichcaption >= ci->FetchedFromStart) ? (whichcaption + ci->FolderSize - ci->FetchedFromEnd - ci->FetchedFromStart) : whichcaption; ! pos = captions_EncodePosition(ci, pos); } return(pos); } *************** *** 451,470 **** return NULL; } - void captions__ResetVisibleCaption(h) - struct captions *h; - { - struct t822view *bv = captions_GetBodView(h); - - ResetCaptionNotBody(h); - text_ClearCompletely(captions_GetBodDoc(h)); - text822_ResetGlobalStyle(captions_GetBodDoc(h)); - if (t822view_GetIM(bv) && im_GetInputFocus(t822view_GetIM(bv)) == NULL) t822view_WantInputFocus(bv, bv); - t822view_SetDotPosition(bv, 0); - t822view_SetDotLength(bv, 0); - t822view_FrameDot(bv, 0); - t822view_WantUpdate(bv, bv); - } ResetCaptionNotBody(ci) struct captions *ci; --- 346,351 ---- *************** *** 815,1132 **** } - int captions__InsertUpdatesInDocument(ci, shortname, dname, ShowFirst) - struct captions *ci; - char *shortname, *dname; - Boolean ShowFirst; - { - int code, substatus; - long errcode; - char DumBuf[1+MAXPATHLEN]; - boolean HadFullName = TRUE; - - ams_WaitCursor(TRUE); - captions_ClearAndUpdate(ci, FALSE, TRUE); - if (!dname || !*dname) { - HadFullName = FALSE; - errcode = ams_CUI_DisambiguateDir(ams_GetAMS(), shortname, &dname); - if (errcode) { - if (ams_vdown(ams_GetAMS(), ams_AMS_ERRNO(ams_GetAMS()))) { - sprintf(DumBuf, "%s: temporarily unavailable (net/server problem)", shortname); - } else if (ams_AMS_ERRNO(ams_GetAMS()) == EACCES) { - sprintf(DumBuf, "'%s' is private; you don't have read-access or are unauthenticated.", shortname); - } else { - sprintf(DumBuf, "The folder %s is not readable.", shortname); - } - message_DisplayString(NULL, 75, DumBuf); - return(-1); - } - } - errcode = ams_MS_GetSubscriptionEntry(ams_GetAMS(), dname, DumBuf, &substatus); - if (errcode) { - ams_WaitCursor(FALSE); - ams_ReportError(ams_GetAMS(), "Could not get subscription entry", ERR_WARNING, TRUE, errcode); - return(-1); - } - if (!HadFullName && ci->myfold) { - folders_AlterSubscriptionStatus(ci->myfold, dname, substatus, shortname); - } - if (substatus == AMS_PRINTSUBSCRIBED) { - ams_CUI_PrintUpdates(ams_GetAMS(), dname, shortname); - } - ci->CommentText = NULL; - ci->firstcuid = -1; - ci->FullName = malloc(1+strlen(dname)); - if (ci->FullName) strcpy(ci->FullName, dname); - ci->ShortName = malloc(1+strlen(shortname)); - if (ci->ShortName) strcpy(ci->ShortName, shortname); - ci->substatus = substatus; - captions_SetLabel(ci, shortname); - code = captions_InsertCaptions(ci, shortname, dname, NULL, substatus == AMS_SHOWALLSUBSCRIBED ? TRUE : FALSE); - if (ci->CommentText) { - folders_HighlightFolder(captions_GetFolders(ci), dname, ci->CommentText); - free(ci->CommentText); - ci->CommentText = NULL; - } - - im_ForceUpdate(); - if (ShowFirst) { - if (substatus == AMS_SHOWALLSUBSCRIBED) { - int len, pos; - - pos = ci->capcache[0].offset; - if (ci->captioncachecount > 1) { - len = ci->capcache[1].offset - pos; - } else if (ci->captioncachecount > 0) { - len = text_GetLength(ci->CaptText) - pos; - } else { - len = 0; - } - if (len) captions_DisplayNewBody(ci, ci->capcache[0].cuid, pos, len, ci->capcache[0].env); - } else { - captions_ShowMore(ci, FALSE, FALSE, FALSE); - } - } else { - /* Pre-fetch the first message */ - if (ci->captioncachecount > 1) { - ams_CUI_PrefetchMessage(ams_GetAMS(), ci->capcache[1].cuid, 0); - } else if (ci->captioncachecount > 0) { - ams_CUI_PrefetchMessage(ams_GetAMS(), ci->capcache[0].cuid, 0); - } - } - captions_WantInputFocus(ci, ci); - ams_WaitCursor(FALSE); - return(code); - } - - captions_InsertCaptions(ci, shortname, dname, StartTime, ShowAll) - struct captions *ci; - char *shortname, *dname, *StartTime; - Boolean ShowAll; - { - int totalbytes, numbytes, cuid, status, addlen, highstart, highlen, envstart, inspos, insertct = 0, IsDup, myfirstcuid = 0; - char date64[AMS_DATESIZE+1], olddate64[AMS_DATESIZE+1], newdate[AMS_DATESIZE+1], firstdate[AMS_DATESIZE+1], captionbuf[100*AMS_SNAPSHOTSIZE], ErrorText[256], *DirName, *ThisCaption, *s; - Boolean UseHighDensity, MayModify, IsRead; - struct environment *et, *et2; - int PositionDot = 1, NewCt, TotalCt, ProtCode; - long errcode; - struct CaptionCache *tempcache = NULL; - int tempcachesize, tempcachecount; - - if ((errcode = ams_CUI_DisambiguateDir(ams_GetAMS(), dname, &DirName)) != 0) { - if (*dname == '/' && ams_AMS_ERRNO(ams_GetAMS()) == ENOENT) { - ams_CUI_HandleMissingFolder(ams_GetAMS(), dname); - return(-1); - } else if (ams_vdown(ams_GetAMS(), ams_AMS_ERRNO(ams_GetAMS()))) { - sprintf(ErrorText, "%s: temporarily unavailable (net/server problem)", shortname); - } else if (ams_AMS_ERRNO(ams_GetAMS()) == EACCES) { - sprintf(ErrorText, "'%s' is private; you don't have read-access or are unauthenticated.", shortname); - } else { - sprintf(ErrorText, "The folder %s is not readable.", shortname); - } - message_DisplayString(NULL, 75, ErrorText); - return(-1); - } - UseHighDensity = ! (amsutil_GetOptBit(EXP_WHITESPACE)); - if (!StartTime) { - long mytime; - - im_ForceUpdate(); - errcode = ams_MS_GetDirInfo(ams_GetAMS(), DirName, &ProtCode, &TotalCt); - if (errcode) { - if (ams_AMS_ERRNO(ams_GetAMS()) == ENOENT) { - ams_CUI_HandleMissingFolder(ams_GetAMS(), dname); - return(-1); - } - sprintf(ErrorText, "Cannot look up information about %s", DirName); - ams_ReportError(ams_GetAMS(), ErrorText, ERR_WARNING, TRUE, errcode); - return(-1); - } - ci->IsFullMail = (ProtCode == AMS_DIRPROT_FULLMAIL) ? TRUE : FALSE; - ci->FolderSize = TotalCt; - if (errcode = ams_MS_GetNewMessageCount(ams_GetAMS(), DirName, &NewCt, &TotalCt, olddate64, TRUE)) { - sprintf(ErrorText, "Couldn't get date information for %s", DirName); - ams_ReportError(ams_GetAMS(), ErrorText, ERR_CRITICAL, TRUE, errcode); - return(-1); - } - if (NewCt == TotalCt) ShowAll = TRUE; - if (ShowAll) { - date64[0] = '\0'; - NewCt = TotalCt; - } else { - mytime = amsutil_conv64tolong(olddate64); - if (mytime>0) { - strcpy(date64, amsutil_convlongto64(mytime-1, 0)); - } - } - inspos = insertct; - } else { - strcpy(date64, StartTime); - } - insertct = 0; - inspos = 0; - newdate[0] = '\0'; - totalbytes = 0; - s = NULL; - if (StartTime) { - tempcache = (struct CaptionCache *) malloc(25 * sizeof(struct CaptionCache)); - tempcachesize = 25; - tempcachecount = 0; - } - do { - if ((errcode = ams_CUI_GetHeaders(ams_GetAMS(), DirName, date64, captionbuf, sizeof(captionbuf), totalbytes, &numbytes, &status, FALSE)) != 0) { - captions_WantUpdate(ci, ci); - if (ams_vdown(ams_GetAMS(), ams_AMS_ERRNO(ams_GetAMS()))) { - sprintf(ErrorText, "%s: temporarily unavailable (net/server problem)", DirName); - ams_ReportSuccess(ams_GetAMS(), ErrorText); - } else { - sprintf(ErrorText, "Could not get captions for %s", dname); - ams_ReportError(ams_GetAMS(), ErrorText, ERR_WARNING, FALSE, 0); - } - if (tempcache) free(tempcache); - return(-1); - } - if (numbytes <= 0) break; - totalbytes += numbytes; - for (s=captionbuf; s-captionbuf < numbytes; s+= AMS_SNAPSHOTSIZE) { - cuid = ams_CUI_GetCuid(ams_GetAMS(), AMS_ID(s), DirName, &IsDup); - if (ci->firstcuid == cuid) { - /* All done -- we are back to where we started */ - status = 0; - break; - } - MayModify = AMS_GET_ATTRIBUTE(s, AMS_ATT_MAYMODIFY) ? 1 : 0; - if (MayModify) { - IsRead = AMS_GET_ATTRIBUTE(s, AMS_ATT_UNSEEN) ? FALSE : TRUE; - } else { - IsRead = (!StartTime && (myfirstcuid || ShowAll)) ? FALSE : TRUE; - } - if (!myfirstcuid) { - myfirstcuid = cuid; - strcpy(firstdate, AMS_DATE(s)); - } - MakeCaptionLine(&ThisCaption, cuid, s, amsutil_GetOptBit(EXP_FIXCAPTIONS), &highstart, &highlen, ci->IsFullMail, IsDup, IsRead); - if (!UseHighDensity) { - strcat(ThisCaption, "\n"); - } - addlen = strlen(ThisCaption); - text_AlwaysInsertCharacters(ci->CaptText, inspos, ThisCaption, addlen); - if (!StartTime && PositionDot) { - captions_SetDotPosition(ci, inspos+addlen-1); - captions_FrameDot(ci, inspos); - PositionDot = 0; - } - insertct += addlen; - et2 = environment_InsertStyle(ci->CaptText->rootEnvironment, inspos, ci->IconicStyle, 1); - environment_SetLength(et2, 3); - envstart = inspos + 2; - et = environment_InsertStyle(ci->CaptText->rootEnvironment, envstart, AMS_GET_ATTRIBUTE(s, AMS_ATT_DELETED) ? ci->DeletedStyle : ci->NormalCaptionStyle, 1); - environment_SetLength(et, addlen -3); - if (StartTime) { - AddCaptionToCacheEntry(&tempcache, &tempcachecount, &tempcachesize, cuid, inspos, et, et2, MayModify, s, IsDup); - } else { - AddCaptionToCacheEntry(&ci->capcache, &ci->captioncachecount, &ci->captioncachesize, cuid, inspos, et, et2, MayModify, s, IsDup); - } - ++ci->FetchedFromEnd; /* sometimes from start? */ - if (ci->IsFullMail) { - et = environment_InsertStyle(et, 0, ci->MailStyle, 1); - environment_SetLength(et, addlen - 3); - } - if (highlen) { - et = environment_InsertStyle(et, inspos+highstart - envstart, ci->HighlightStyle, 1); - environment_SetLength(et, highlen); - } - inspos += addlen; - } - } while (status > 0); - if (myfirstcuid) ci->firstcuid = myfirstcuid; - if (GetSouthernmostPoint(ci) == 0) { /* No southernmost point yet */ - int newsouth; - - if ((ci->substatus == AMS_SHOWALLSUBSCRIBED) - || ShowAll - || (ci->captioncachecount <= 0) - || (!StartTime && myfirstcuid && (strcmp(firstdate, olddate64)< 0))) { - newsouth = -1; - captions_SetDotPosition(ci, 0); - } else { - newsouth = ci->capcache[0].offset; - } - SetSouthernmostPoint(ci, newsouth); - } - if (status < 0) { - sprintf(ErrorText, "Couldn't read all of the captions successfully"); - ams_ReportError(ams_GetAMS(), ErrorText, ERR_CRITICAL, TRUE, errcode); - if (tempcache) free(tempcache); - return(-1); - } - if (ci->firstcuid) { - if (s && !StartTime) { - strcpy(newdate, AMS_DATE(s - AMS_SNAPSHOTSIZE)); - } - } - captions_WantUpdate(ci, ci); - if (StartTime) { - if (tempcache) { - MergeTwoCacheEntries(ci, tempcache, tempcachecount, tempcachesize, inspos); - free(tempcache); - } - } else { - char CommText[500]; - - if (ci->substatus == AMS_SHOWALLSUBSCRIBED) { - sprintf(CommText, " (%s; All %d shown) ", ams_DescribeProt(ams_GetAMS(), ProtCode), TotalCt); - } else { - sprintf(CommText, " (%s; %d new of %d) ", ams_DescribeProt(ams_GetAMS(), ProtCode), NewCt, TotalCt); - } - ci->CommentText = malloc(1+strlen(CommText)); - if (ci->CommentText) { - strcpy(ci->CommentText, CommText); - } - } - return(0); - } - - - void captions__ClearAndUpdate(ci, ConsiderPurging, SaveState) - struct captions *ci; - int ConsiderPurging, SaveState; - { - struct text *d; - - d = ci->CaptText; - if (SaveState) captions_MakeCachedUpdates(ci); - if (ConsiderPurging - && ams_CUI_DoesDirNeedPurging(ams_GetAMS(), ci->FullName) - && (amsutil_GetOptBit(EXP_PURGEONQUIT) - || ams_GetBooleanFromUser(ams_GetAMS(), "Do you want to purge the deleted messages", FALSE))) { - captions_PurgeDeletions(ci); - } - ResetCaptionNotBody(ci); - if (ci->MarkCount > 0) { - /* We clear the marks this way so that they can be restored later if so desired. */ - captions_ClearMarks(ci); - ci->MarkCount = 0; - } - if (ci->FullName) { - free(ci->FullName); - ci->FullName = NULL; - } - if (ci->ShortName) { - free(ci->ShortName); - ci->ShortName = NULL; - } - ci->captioncachecount = 0; - ci->FetchedFromStart = ci->FetchedFromEnd = ci->FolderSize = 0; - SetSouthernmostPoint(ci, -1); - text_ClearCompletely(d); - text_SetGlobalStyle(d, ci->GlobalCapStyle); - captions_SetDotPosition(ci, 0); - captions_SetDotLength(ci, 0); - captions_PostMenus(ci, NULL); - captions_WantUpdate(ci, ci); - im_ForceUpdate(); - } void captions__MakeCachedUpdates(ci) struct captions *ci; --- 696,701 ---- *************** *** 1171,1187 **** } } - captions_PurgeDeletions(ci) - struct captions *ci; - { - message_DisplayString(NULL, 10, "Purging deletions; please wait..."); - im_ForceUpdate(); - ams_WaitCursor(TRUE); - if (ams_CUI_PurgeDeletions(ams_GetAMS(), ci->FullName) == 0) { - message_DisplayString(NULL, 10, "Purging complete."); - } - ams_WaitCursor(FALSE); - } GetCUIDFromPosition(ci, pos) struct captions *ci; --- 740,745 ---- *************** *** 1355,1360 **** --- 913,928 ---- } } + CreateCaptionsCursor(self) + struct captions *self; + { + struct fontdesc *fd; + + fd = fontdesc_Create("icon", 0, 12); + self->mycursor = cursor_Create(self); + cursor_SetGlyph(self->mycursor, fd, 'R'); + } + void captions__FullUpdate(self, type, left, top, width, height) struct captions *self; enum view_UpdateType type; *************** *** 1384,1470 **** message_DisplayString(NULL, 10, ErrorText); } - void CapGlitchDown(self) - struct captions *self; - { - int backupto = self->FolderSize - self->FetchedFromEnd -2; - struct im *im = captions_GetIM(self); - - if (im && im_ArgProvided(im)) { - backupto -= im_Argument(im); - } - if (captions_GuaranteeFetchedRange(self, backupto, self->FolderSize)) return; - im_ForceUpdate(); - textview_GlitchDownCmd((struct textview *) self); - } - - void PreviousCaptionLine(self) - struct captions *self; - { - int backupto = self->FolderSize - self->FetchedFromEnd -2; - struct im *im = captions_GetIM(self); - - if (im && im_ArgProvided(im)) { - backupto -= im_Argument(im); - } - if (captions_GetDotPosition(self) < 150) { /* poor heuristic */ - if (captions_GuaranteeFetchedRange(self, backupto, self->FolderSize)) return; /* error reported */ - } - textview_PreviousLineCmd((struct textview *) self); - } - - void captions__CapReverseSearch(self) - struct captions *self; - { - captions_GuaranteeFetchedRange(self, 0, self->FolderSize); - im_ForceUpdate(); - textview_ReverseSearchCmd((struct textview *) self); - captions_WantInputFocus(self, self); - } - - void CapScrollBack(self) - struct captions *self; - { - int min, pos, mylen, whichcaption; - struct range total, seen, dot; - struct environment *envptr; - - self->textscrollinterface->GetInfo(self, &total, &seen, &dot); - pos = seen.beg; - /* The following conservatively assume a 6 pt font, 4 pts spacing, maximum of one screen of scrolling */ - captions_FindCUIDByDocLocation(self, &pos, &mylen, &envptr, &whichcaption); - min = self->FolderSize - self->FetchedFromEnd - (captions_GetLogicalHeight(self)/10) + whichcaption - 1; - if (min < 0) min = 0; - captions_GuaranteeFetchedRange(self, min, self->FolderSize); - im_ForceUpdate(); - textview_ScrollScreenBackCmd((struct textview *) self); - } - - void CapBeginText(self) - struct captions *self; - { - captions_GuaranteeFetchedRange(self, 0, self->FolderSize); - im_ForceUpdate(); - textview_BeginningOfTextCmd((struct textview *) self); - } - - boolean captions__InitializeClass(classID) - struct classheader *classID; - { - class_Load("textview"); /* make sure the textview is loaded first */ - OneTimeInitKeyMenus(&captions_classinfo); - return(TRUE); - } - NextTextviewScreen(tv) struct textview *tv; { ! textview_ScrollScreenFwdCmd(tv); } RSearchTextview(tv) struct textview *tv; { ! textview_ReverseSearchCmd(tv); } /* This is the same as bcopy, but copies from the back to be safe when you're --- 952,967 ---- message_DisplayString(NULL, 10, ErrorText); } NextTextviewScreen(tv) struct textview *tv; { ! textv_ScrollScreenFwdCmd(tv); } + RSearchTextview(tv) struct textview *tv; { ! textv_ReverseSearchCmd(tv); } /* This is the same as bcopy, but copies from the back to be safe when you're *************** *** 1600,1655 **** captions_WantInputFocus(ci, ci); } - void captions__ThisIsFlorida(self) - struct captions *self; - { - int pos, len, whichcaption; - struct environment *env; - - im_ForceUpdate(); - /* The following line makes things work better if this caption is the first one fetched into the caption cache but not the first in the folder */ - captions_GuaranteeFetchedRange(self, self->FolderSize - self->FetchedFromEnd - 1, self->FolderSize); - pos = self->HighlightStartPos; - (void) captions_FindCUIDByDocLocation(self, &pos, &len, &env, &whichcaption); - SetSouthernmostPoint(self, -1); /* Always needed */ - if (--whichcaption >= 0) { - pos = self->capcache[whichcaption].offset; - (void) captions_FindCUIDByDocLocation(self, &pos, &len, &env, &whichcaption); - SetSouthernmostPoint(self, pos); - } - im_ForceUpdate(); - } - - void captions__PuntCurrent(self, GoToNext) - struct captions *self; - Boolean GoToNext; - { - int loops = 1; - struct im *im = captions_GetIM(self); - char Scratch[100+MAXPATHLEN]; - - if (im && im_ArgProvided(im)) { - loops = im_Argument(im); - if (loops < 0) { - loops = 1; - } else if (loops > 1) { - sprintf(Scratch, "Do you really want to punt the next %d folders", loops); - if (!ams_GetBooleanFromUser(ams_GetAMS(), Scratch, FALSE)) { - return; - } - } - } - while (loops--) { - if (self->captioncachecount > 0) { - SetSouthernmostPoint(self, self->capcache[self->captioncachecount-1].offset); - } - if (GoToNext) { - folders_NextFolder(captions_GetFolders(self), FALSE); - } - if (loops>0) im_ForceUpdate(); - } - } - void captions__FindRelatedMessages(self) struct captions *self; { --- 1097,1102 ---- *************** *** 1869,1898 **** message_DisplayString(NULL, 10, ErrorText); } - void captions__PrintVisibleMessage(self) - struct captions *self; - { - int flags = 0; - - if (self->VisibleCUID <1) { - message_DisplayString(NULL, 10, "There is nothing to print."); - return; - } - ams_WaitCursor(TRUE); - if (self->CurrentFormatting & MODE822_ROT13) { - flags |= AMS_PRINT_ROT13; - } - if (self->CurrentFormatting & MODE822_FIXEDWIDTH) { - flags |= AMS_PRINT_FIXED; - } - message_DisplayString(NULL, 10, "Printing message; please wait..."); - im_ForceUpdate(); - if (ams_CUI_PrintBodyFromCUIDWithFlags(ams_GetAMS(), self->VisibleCUID, flags, NULL) == 0) { - message_DisplayString(NULL, 10, "Message queued for printing."); - } - ams_WaitCursor(FALSE); - } - void captions__Redisplay(self, Mode, contenttype) struct captions *self; int Mode; --- 1316,1321 ---- *************** *** 2003,2017 **** self->myfold = f; } - void captions__SetLabel(self, label) - struct captions *self; - char *label; - { - if (self->myframe) { - frame_SetTitle(self->myframe, label); - } - } - struct t822view * captions__NewBodiesInNewWindow(self) struct captions *self; --- 1426,1431 ---- *************** *** 2055,2058 **** --- 1469,1941 ---- captions_NewBodiesInNewWindow(self); } return(self->BodView); + } + + static struct bind_Description privbindings [] = { + {"captions-previous-caption", "\020", NULL, NULL, 0, NULL, PreviousCaptionLine, "Go to previous caption"}, + {"captions-scroll-back", "\033v", NULL, NULL, NULL, 0, CapScrollBack, "Scroll back captions"}, + {"captions-glitch-down", "\033z", NULL, NULL, NULL, 0, CapGlitchDown, "Glitch down captions"}, + {"captions-glitch-down", "\021", NULL, NULL, NULL, 0, CapGlitchDown, "Glitch down captions"}, + {"captions-beginning-of-text", "\033<", NULL, NULL, NULL, 0, CapBeginText, "Move to top of captions"}, + {"captions-left-click-here", "!", TRUE, NULL, NULL, 0, SimulateLeftClick, "Display what I am pointing at"}, + {"captions-right-click-here", "@", FALSE, NULL, NULL, 0, SimulateRightClick, "Simulate right click on what I am pointing at"}, + {"captions-compound-operation", NULL, NULL, NULL, NULL, 0, CaptionsCompound, "Execute a compound captions operation"}, + {"captions-textview-compound", NULL, NULL, NULL, NULL, 0, CaptionsTextviewCommand, "Execute a compound 'textview' operation on the captions"}, + {"captions-folders-compound", NULL, NULL, NULL, NULL, 0, CaptionsFoldersCommand, "Execute a compound 'folders' operation."}, + {"captions-bodies-compound", NULL, NULL, NULL, NULL, 0, CaptionsBodiesCommand, "Execute a compound 't822view' operation."}, + {"captions-down-focus", "\030n", NULL, NULL, NULL, 0, DownFocus, "Move input focus to bodies"}, + {"captions-up-focus", "\030p", NULL, NULL, NULL, 0, UpFocus, "Move input focus to folders"}, + {"captions-down-focus", "\030\016", NULL, NULL, NULL, 0, DownFocus, "Move input focus to bodies"}, + {"captions-up-focus", "\030\020", NULL, NULL, NULL, 0, UpFocus, "Move input focus to folders"}, + {NULL, "\033~", NULL, NULL, NULL, 0, NULL, NULL, NULL}, /* Preserve read onliness */ + {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} + }; + + InitKeysMenus(captions) + struct captions *captions; + { + captions->privkeys = keystate_Create(captions, captions_privkeymap); + captions->privmenus = menulist_DuplicateML(captions_privmenulist, captions); + } + + OneTimeInitKeyMenus() + { + struct proctable_Entry *tempProc; + + if ((tempProc = proctable_Lookup("textview-previous-line")) != NULL) { + textv_PreviousLineCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-reverse-search")) != NULL) { + textv_ReverseSearchCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-next-screen")) != NULL) { + textv_ScrollScreenFwdCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-prev-screen")) != NULL) { + textv_ScrollScreenBackCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-beginning-of-text")) != NULL) { + textv_BeginningOfTextCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-beginning-of-line")) != NULL) { + textv_BeginningOfLineCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-end-of-line")) != NULL) { + textv_EndOfLineCmd = proctable_GetFunction(tempProc); + } + if ((tempProc = proctable_Lookup("textview-glitch-down")) != NULL) { + textv_GlitchDownCmd = proctable_GetFunction(tempProc); + } + + captions_privkeymap = keymap_New(); + captions_privmenulist = menulist_New(); + + bind_BindList(privbindings, captions_privkeymap, captions_privmenulist, &captions_classinfo ); + } + + boolean captions__InitializeClass(classID) + struct classheader *classID; + { + class_Load("textview"); /* make sure the textview is loaded first */ + OneTimeInitKeyMenus(); + return(TRUE); + } + + boolean captions__InitializeObject(c, captions) + struct classheader *c; + struct captions *captions; + { + char *fontname; + int fontsize, mailfontbloat = (amsutil_GetOptBit(EXP_WHITESPACE)) ? 2 : 0; + + captions_SetWhatIAm(captions, WHATIAM_CAPTIONS); + InitKeysMenus(captions); + captions->CommentText = NULL; + captions->myframe = NULL; + captions->MenusExpanded = FALSE; + captions->mycursor = NULL; + captions->MarkCount = 0; + captions->FolderSize = captions->FetchedFromStart = captions->FetchedFromEnd = 0; + + captions->CaptText = text_New(); + captions_SetDataObject(captions, captions->CaptText); + captions->textscrollinterface = (struct scrollfns *) super_GetInterface(captions, "scroll,vertical"); + + captions->ActiveCaptionStyle = style_New(); + captions->ActiveDeletedStyle = style_New(); + captions->DeletedStyle = style_New(); + captions->FixedStyle = style_New(); + captions->GlobalCapStyle = style_New(); + captions->HighlightStyle = style_New(); + captions->IconicStyle = style_New(); + captions->UnderlinedIconicStyle = style_New(); + captions->MailStyle = style_New(); + captions->NormalCaptionStyle = style_New(); + + style_AddNewFontFace(captions->FixedStyle, (long) fontdesc_Fixed); + style_AddNewFontFace(captions->HighlightStyle, (long) fontdesc_Italic); + style_SetFontFamily(captions->FixedStyle, "andytype"); + style_SetFontFamily(captions->IconicStyle, "msgs"); + style_SetFontFamily(captions->UnderlinedIconicStyle, "msgs"); + style_SetFontSize(captions->IconicStyle, style_ConstantFontSize, 10); + style_SetFontSize(captions->UnderlinedIconicStyle, style_ConstantFontSize, 10); + style_SetFontSize(captions->MailStyle, style_PreviousFontSize, mailfontbloat); + style_SetJustification(captions->GlobalCapStyle, style_LeftJustified); + style_SetJustification(captions->HighlightStyle, style_LeftJustified); + style_SetName(captions->FixedStyle, "Typewriter"); + style_SetNewIndentation(captions->ActiveCaptionStyle, style_ConstantMargin, -10, style_RawDots); + style_SetNewIndentation(captions->ActiveDeletedStyle, style_ConstantMargin, -10, style_RawDots); + style_SetNewIndentation(captions->GlobalCapStyle, style_ConstantMargin, -10, style_RawDots); + style_SetNewLeftMargin(captions->ActiveCaptionStyle, style_ConstantMargin, 20, style_RawDots); + style_SetNewLeftMargin(captions->ActiveDeletedStyle, style_ConstantMargin, 20, style_RawDots); + style_SetNewLeftMargin(captions->GlobalCapStyle, style_ConstantMargin, 20, style_RawDots); + style_AddFlag(captions->UnderlinedIconicStyle, style_Underline); + if (amsutil_GetOptBit(EXP_FIXCAPTIONS)) { + style_AddNewFontFace(captions->ActiveCaptionStyle, (long) fontdesc_Bold | fontdesc_Fixed); + style_AddNewFontFace(captions->ActiveDeletedStyle, (long) fontdesc_Bold | fontdesc_Fixed); + style_AddNewFontFace(captions->DeletedStyle, (long) fontdesc_Fixed); + style_AddNewFontFace(captions->GlobalCapStyle, (long) fontdesc_Fixed); + style_AddNewFontFace(captions->HighlightStyle, (long) fontdesc_Fixed); + style_AddNewFontFace(captions->MailStyle, (long) fontdesc_Fixed); + style_AddNewFontFace(captions->NormalCaptionStyle, (long) fontdesc_Fixed); + } else { + style_AddNewFontFace(captions->ActiveCaptionStyle, (long) fontdesc_Bold); + style_AddNewFontFace(captions->ActiveDeletedStyle, (long) fontdesc_Bold); + } + text_SetGlobalStyle(captions->CaptText, captions->GlobalCapStyle); + + captions->SouthPoint = NULL; + + captions->VisibleCUID = -1; + bzero(captions->VisibleSnapshot, AMS_SNAPSHOTSIZE); + captions->HighlightStartPos = 0; + captions->HighlightLen = 0; + captions->HighlightEnv = NULL; + captions->OldMarkCount = 0; + captions->OldMarks = NULL; + captions->capcache = (struct CaptionCache *) malloc(25 *sizeof(struct CaptionCache)); + captions->captioncachesize = 25; + captions->captioncachecount = 0; + captions->FullName = NULL; + captions->ShortName = NULL; + captions->firstcuid = -1; + ams_AddCheckpointCaption(captions); + + captions->myfold = NULL; + + fontsize = environ_GetProfileInt("messages.fontsize", 12); + style_SetFontSize(captions->DeletedStyle, style_ConstantFontSize, fontsize - 4); + style_SetFontSize(captions->ActiveDeletedStyle, style_ConstantFontSize, fontsize - 4); + style_SetFontSize(captions->GlobalCapStyle, style_ConstantFontSize, fontsize); + + fontname = amsutil_GetDefaultFontName(); + if (amsutil_GetOptBit(EXP_FIXCAPTIONS)) fontname = "andytype"; + style_SetFontFamily(captions->ActiveCaptionStyle, fontname); + style_SetFontFamily(captions->ActiveDeletedStyle, fontname); + style_SetFontFamily(captions->DeletedStyle, fontname); + style_SetFontFamily(captions->GlobalCapStyle, fontname); + style_SetFontFamily(captions->HighlightStyle, fontname); + style_SetFontFamily(captions->MailStyle, fontname); + style_SetFontFamily(captions->NormalCaptionStyle, fontname); + + captions->BodView = NULL; + + captions_ShowHelp(captions); + text_SetReadOnly(captions->CaptText, TRUE); + return(TRUE); + } + + FinalizeProcStuff(self) + struct captions *self; + { + keystate_Destroy(self->privkeys); + menulist_Destroy(self->privmenus); + cursor_Destroy(self->mycursor); + } + + void captions__FinalizeObject(c, self) + struct classheader *c; + struct captions *self; + { + ams_RemoveCheckpointCaption(self); + text_Destroy(self->CaptText); + if (self->CommentText) { + free(self->CommentText); + self->CommentText = NULL; + } + if (self->myfold) { + folders_SetCaptions(self->myfold, NULL); + } + if (self->BodView) { + t822view_SetCaptions(self->BodView, NULL); + } + style_Destroy(self->ActiveCaptionStyle); + style_Destroy(self->NormalCaptionStyle); + style_Destroy(self->HighlightStyle); + style_Destroy(self->GlobalCapStyle); + style_Destroy(self->DeletedStyle); + style_Destroy(self->ActiveDeletedStyle); + style_Destroy(self->IconicStyle); + style_Destroy(self->UnderlinedIconicStyle); + style_Destroy(self->MailStyle); + style_Destroy(self->FixedStyle); + FinalizeProcStuff(self); + if (self->OldMarks) { + free(self->OldMarks); + self->OldMarks = NULL; + } + if (self->capcache) { + free(self->capcache); + self->capcache = NULL; + } + if (self->FullName) { + free(self->FullName); + self->FullName = NULL; + } + if (self->ShortName) { + free(self->ShortName); + self->ShortName = NULL; + } + } + + + void captions__PostMenus(self, ml) + struct captions *self; + struct menulist *ml; + { + menulist_ClearChain(self->privmenus); + if (ml) menulist_ChainAfterML(self->privmenus, ml, ml); + super_PostMenus(self, self->privmenus); + } + + void captions__PostKeyState(self, ks) + struct captions *self; + struct keystate *ks; + { + self->privkeys->next = NULL; + if (amsutil_GetOptBit(EXP_KEYSTROKES)) { + if (ks) keystate_AddAfter(ks, self->privkeys); + super_PostKeyState(self, self->privkeys); + } else { + super_PostKeyState(self, ks); + } + } + + void + captions__ActOnMarkedMessages(ci, Code, GivenName) + struct captions *ci; + int Code; + char *GivenName; /* Not always supplied */ + { + char ErrorText[256]; + struct CaptionCache *hc; + int j, k, resultcode, OpCode, goodct = 0, len; + Boolean IsActiveCaption, HadDisaster, errct; + char HeaderBuf[2000]; + char *HeadAccum = NULL; + struct sendmessage *sm = NULL; + + if ((ci->MarkCount <= 0) && (Code != MARKACTION_RESTORE)) { + message_DisplayString(NULL, 10, "There are no marked messages"); + return; + } + ams_WaitCursor(TRUE); + HadDisaster = FALSE; + errct = 0; + for (j = 0; j < ci->captioncachecount && !HadDisaster; ++j) { + hc = &ci->capcache[j]; + if (hc->IsMarked || (Code == MARKACTION_RESTORE)) { + if (hc->env->data.style == ci->ActiveDeletedStyle || hc->env->data.style == ci->ActiveCaptionStyle) { + IsActiveCaption = TRUE; + } else { + IsActiveCaption = FALSE; + } + switch(Code) { + case MARKACTION_APPENDTOFILE: + if (captions_AppendOneMessageToFile(ci, hc->cuid, GivenName)) { + errct++; + HadDisaster = TRUE; + } else ++goodct; + break; + case MARKACTION_CLASSIFYBYNAME: + case MARKACTION_APPENDBYNAME: + case MARKACTION_COPYBYNAME: + if (Code == MARKACTION_APPENDBYNAME) { + OpCode = hc->MayModify ? MS_CLONE_APPENDDEL : MS_CLONE_APPEND; + } else if (Code == MARKACTION_COPYBYNAME) { + OpCode = MS_CLONE_COPY; + } else { + OpCode = hc->MayModify ? MS_CLONE_COPYDEL : MS_CLONE_COPY; + } + resultcode = ams_CUI_CloneMessage(ams_GetAMS(), hc->cuid, GivenName, OpCode); + if (resultcode) { + errct++; + HadDisaster = TRUE; + break; + } + if (OpCode == MS_CLONE_APPEND || OpCode == MS_CLONE_COPY) { + ++goodct; + break; + } + /* FALL THROUGH to delete */ + case MARKACTION_DELETE: + if (ams_CUI_DeleteMessage(ams_GetAMS(), hc->cuid) == 0) { + text_SetEnvironmentStyle(ci->CaptText, hc->env, IsActiveCaption ? ci->ActiveDeletedStyle : ci->DeletedStyle); + if (IsActiveCaption) { + AMS_SET_ATTRIBUTE(ci->VisibleSnapshot, AMS_ATT_DELETED); + } + captions_AlterDeletedIcon(ci, hc->offset, TRUE); + ++goodct; + } else { + ++errct; + HadDisaster = TRUE; + /* Errors were reported by cui routine */ + } + break; + case MARKACTION_UNDELETE: + if (ams_CUI_UndeleteMessage(ams_GetAMS(), hc->cuid) == 0) { + text_SetEnvironmentStyle(ci->CaptText, hc->env, IsActiveCaption ? ci->ActiveCaptionStyle : ci->NormalCaptionStyle); + if (IsActiveCaption) { + AMS_UNSET_ATTRIBUTE(ci->VisibleSnapshot, AMS_ATT_DELETED); + } + captions_AlterDeletedIcon(ci, hc->offset, FALSE); + ++goodct; + } else { + ++errct; + HadDisaster = TRUE; + /* Errors were reported by cui routine */ + } + break; + case MARKACTION_PRINT: + if (ams_CUI_PrintBodyFromCUIDWithFlags(ams_GetAMS(), hc->cuid, 0, NULL)) { + HadDisaster = TRUE; + ++errct; + } else { + ++goodct; + } + /* Errors were reported by cui routine */ + break; + case MARKACTION_RESTORE: + for (k=0; kOldMarkCount; ++k) { + if (hc->cuid == ci->OldMarks[k] && (!hc->IsMarked)) { + captions_ToggleMark(ci, hc, hc->offset); + ++goodct; + break; + } + } + break; + case MARKACTION_EXCERPT: + if (!sm) { + sm = folders_ExposeSend(captions_GetFolders(ci)); + if (!sm) return; + } + if (j == (ci->captioncachecount - 1)) { + len = text_GetLength(ci->CaptText) - hc->offset; + } else { + len = ci->capcache[j+1].offset - hc->offset; + } + captions_DisplayNewBody(ci, hc->cuid, hc->offset, len, hc->env); + textview_SetDotPosition(sm->BodyTextview, text_GetLength((struct text *) textview_GetDataObject(sm->BodyTextview))); + sendmessage_QuoteBody(sm); + ++goodct; + break; + case MARKACTION_REPLYALL: + case MARKACTION_REPLYSENDERS: + HeaderBuf[0] = '\0'; + ams_CUI_GetHeaderContents(ams_GetAMS(), hc->cuid, NULL, (Code == MARKACTION_REPLYSENDERS) ? HP_REPLY_TO : HP_ALLREPLY, HeaderBuf, sizeof(HeaderBuf) - 2); + if (HeadAccum) { + HeadAccum = realloc(HeadAccum, strlen(HeadAccum) + strlen(HeaderBuf) + 5); + strcat(HeadAccum, ",\n\t"); + strcat(HeadAccum, HeaderBuf); + } else { + HeadAccum = malloc(1+strlen(HeaderBuf)); + strcpy(HeadAccum, HeaderBuf); + } + ++goodct; + break; + case MARKACTION_RESEND: + if (ams_CUI_ResendMessage(ams_GetAMS(), hc->cuid, GivenName)) { + HadDisaster = TRUE; + } else { + ++goodct; + } + break; + } + if (HadDisaster) { + if (ams_GetBooleanFromUser(ams_GetAMS(), "Do you want to continue with the other marked messages", FALSE)) { + HadDisaster = FALSE; + } + } + } + } + if (HeadAccum) { + if (!sm) { + sm = folders_ExposeSend(captions_GetFolders(ci)); + if (!sm) return; + } + sendmessage_AddToToHeader(sm, HeadAccum); + free(HeadAccum); + HeadAccum = NULL; + } + if (errct) { + char Foobar[100]; + sprintf(ErrorText, "Errors were encountered on %s ", amsutil_cvEng(errct, 0, 1000)); + sprintf(Foobar, "of the %s marked messages.", amsutil_cvEng(ci->MarkCount, 0, 1000)); + strcat(ErrorText, Foobar); + message_DisplayString(NULL, 50, ErrorText); + } else { + switch (Code) { + case MARKACTION_RESTORE: + sprintf(ErrorText, "Restored %s old marks.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_RESEND: + sprintf(ErrorText, "Resent %s messages to %s.", amsutil_cvEng(goodct, 0, 1000), GivenName); + break; + case MARKACTION_DELETE: + sprintf(ErrorText, "Deleted %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_UNDELETE: + sprintf(ErrorText, "Undeleted %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_CLASSIFYBYNAME: + sprintf(ErrorText, "Classified %s messages into %s.", amsutil_cvEng(goodct, 0, 1000), GivenName); + break; + case MARKACTION_PRINT: + sprintf(ErrorText, "Printed %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_APPENDBYNAME: + sprintf(ErrorText, "Appended %s messages to folder %s.", amsutil_cvEng(goodct, 0, 1000), GivenName); + break; + case MARKACTION_EXCERPT: + sprintf(ErrorText, "Excerpted %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_REPLYSENDERS: + sprintf(ErrorText, "Replying to senders of %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_REPLYALL: + sprintf(ErrorText, "Replying widely to %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + case MARKACTION_COPYBYNAME: + sprintf(ErrorText, "Copied %s messages into folder %s.", amsutil_cvEng(goodct, 0, 1000), GivenName); + break; + case MARKACTION_APPENDTOFILE: + sprintf(ErrorText, "Appended %s messages to file %s.", amsutil_cvEng(goodct, 0, 1000), GivenName); + break; + default: + sprintf(ErrorText, "Did something to %s messages.", amsutil_cvEng(goodct, 0, 1000)); + break; + } + message_DisplayString(NULL, 10, ErrorText); + captions_PostMenus(ci, NULL); + if (Code == MARKACTION_CLASSIFYBYNAME + || Code == MARKACTION_APPENDBYNAME + || Code == MARKACTION_COPYBYNAME) { + char Nick[1+MAXPATHLEN]; + ams_CUI_BuildNickName(ams_GetAMS(), GivenName, Nick); + SetLastClassification(ci, Nick); + } + } + captions_WantUpdate(ci, ci); + ams_WaitCursor(FALSE); + return; } *** atkams/messages/lib/foldaux.c Wed Nov 22 12:44:16 1989 --- atkams/messages/lib/foldaux.c.NEW Sat Apr 27 02:06:33 1991 *************** *** 2,21 **** * 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/atkams/messages/lib/RCS/foldaux.c,v 1.10 89/10/04 18:10:19 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/foldaux.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/foldaux.c,v 1.10 89/10/04 18:10:19 cfe Exp $ "; #endif /* lint */ - #include #include #include #include #include - #include #include #include #include --- 2,20 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/foldaux.c,v 1.13 1991/04/14 17:24:38 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/foldaux.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/foldaux.c,v 1.13 1991/04/14 17:24:38 gk5g Exp $ "; #endif /* lint */ #include + #include #include #include #include #include #include #include *************** *** 22,27 **** --- 21,27 ---- #include #include #include + #include #include #include #include *************** *** 42,50 **** #include #undef AUXMODULE - extern void folders__SimulateClick(); - extern char *rindex(); - void TextviewCompound(tv, cmds) struct textview *tv; char *cmds; --- 42,47 ---- *************** *** 89,101 **** ams_GenericCompoundAction(ams_GetAMS(), folders_GetCaptions(self), "captions", cmds); } ! static void DownFocus(self) struct folders *self; { ams_Focus(folders_GetCaptions(self)); } ! static void UpFocus(self) struct folders *self; { if (self->sm) { --- 86,98 ---- ams_GenericCompoundAction(ams_GetAMS(), folders_GetCaptions(self), "captions", cmds); } ! void DownFocus(self) struct folders *self; { ams_Focus(folders_GetCaptions(self)); } ! void UpFocus(self) struct folders *self; { if (self->sm) { *************** *** 105,204 **** } } ! static void SimulateLeftClick(self) struct folders *self; { DoClick(self, TRUE, TRUE); } - static struct keymap *folders_standardkeymap; - static struct menulist *folders_standardmenulist; - - static struct bind_Description folders_standardbindings [] = { - /* procname, keysequence, key rock, menu string, menu rock, proc, docstring, dynamic autoload */ - {"folders-left-click-here", "!", TRUE, NULL, NULL, 0, SimulateLeftClick, "Display what I am pointing at"}, - {"folders-right-click-here", "@", FALSE, NULL, NULL, 0, folders__SimulateClick, "Simulate right click on what I am pointing at"}, - {"folder-down-focus", "\030n", NULL, NULL, NULL, 0, DownFocus, "Move input focus to captions"}, - {"folders-up-focus", "\030p", NULL, NULL, NULL, 0, UpFocus, "Move input focus to bodies or sendmessage"}, - {"folder-down-focus", "\030\016", NULL, NULL, NULL, 0, DownFocus, "Move input focus to captions"}, - {"folders-up-focus", "\030\020", NULL, NULL, NULL, 0, UpFocus, "Move input focus to bodies or sendmessage"}, - {"textview-compound", NULL, NULL, NULL, NULL, NULL, TextviewCompound, "Execute a compound textview operation"}, - {"folders-compound-operation", NULL, NULL, NULL, NULL, 0, FoldersCompound, "Execute a compound folders operation"}, - {"folders-textview-compound", NULL, NULL, NULL, NULL, 0, FoldersTextviewCommand, "Execute a compound 'textview' operation on the folders"}, - {"folders-sendmessage-compound", NULL, NULL, NULL, NULL, 0, FoldersSendmessageCommand, "Execute a compound 'sendmessage' operation."}, - {"folders-captions-compound", NULL, NULL, NULL, NULL, 0, FoldersCaptionsCommand, "Execute a compound 'captions' operation."}, - {NULL, "\033~", NULL, NULL, NULL, 0, NULL, NULL, NULL}, /* Preserve read onliness */ - {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} - }; - - InitKeyMenusStyles(folders) - struct folders *folders; - { - char *fontname; - int fontsize; - - folders->mykeys = keystate_Create(folders, folders_standardkeymap); - folders->mymenulist = menulist_DuplicateML(folders_standardmenulist, folders); - - folders->BigCenterStyle = style_New(); - style_SetFontSize(folders->BigCenterStyle, style_ConstantFontSize, 20); - style_SetJustification(folders->BigCenterStyle, style_Centered); - - folders->CenterStyle = style_New(); - style_SetJustification(folders->CenterStyle, style_Centered); - style_AddNewFontFace(folders->CenterStyle, (long) fontdesc_Italic); - - folders->SmallCenterStyle = style_New(); - style_SetJustification(folders->SmallCenterStyle, style_Centered); - style_SetFontSize(folders->SmallCenterStyle, style_ConstantFontSize, 6); - - folders->BoldStyle = style_New(); - style_SetName(folders->BoldStyle, "Bold"); - style_AddNewFontFace(folders->BoldStyle, (long) fontdesc_Bold); - - folders->ItalicStyle = style_New(); - style_SetFontSize(folders->ItalicStyle, style_PreviousFontSize, 2); - style_AddNewFontFace(folders->ItalicStyle, (long) fontdesc_Italic); - - folders->IconicStyle = style_New(); - style_SetFontFamily(folders->IconicStyle, "msgs"); - style_SetFontSize(folders->IconicStyle, style_ConstantFontSize, 10); - - folders->Activefolderstyle = style_New(); - if (amsutil_GetOptBit(EXP_FIXCAPTIONS)) { - style_AddNewFontFace(folders->Activefolderstyle, (long) fontdesc_Bold | fontdesc_Fixed); - } else { - style_AddNewFontFace(folders->Activefolderstyle, (long) fontdesc_Bold); - } - style_SetNewLeftMargin(folders->Activefolderstyle, style_ConstantMargin, 20, style_RawDots); - style_SetNewIndentation(folders->Activefolderstyle, style_ConstantMargin, -10, style_RawDots); - - folders->Normalfolderstyle = style_New(); - - folders->GlobalCapStyle = style_New(); - style_SetJustification(folders->GlobalCapStyle, style_LeftJustified); - style_SetNewInterlineSpacing(folders->GlobalCapStyle, style_ConstantSpacing,10, style_RawDots); - style_SetNewLeftMargin(folders->GlobalCapStyle, style_ConstantMargin, 20, style_RawDots); - style_SetNewIndentation(folders->GlobalCapStyle, style_ConstantMargin, -10, style_RawDots); - - fontsize = environ_GetProfileInt("messages.fontsize", 12); - fontname = amsutil_GetDefaultFontName(); - style_SetFontSize(folders->GlobalCapStyle, style_ConstantFontSize, fontsize); - style_SetFontFamily(folders->Activefolderstyle, fontname); - style_SetFontFamily(folders->Normalfolderstyle, fontname); - style_SetFontFamily(folders->GlobalCapStyle, fontname); - style_SetFontFamily(folders->BoldStyle, fontname); - style_SetFontFamily(folders->ItalicStyle, fontname); - } - - OneTimeInitKeyMenus(c) - struct classheader *c; - { - folders_standardkeymap = keymap_New(); - folders_standardmenulist = menulist_New(); - bind_BindList(folders_standardbindings, folders_standardkeymap, folders_standardmenulist, c); - } - void folders__PostKeyState(self, ks) struct folders *self; struct keystate *ks; --- 102,113 ---- } } ! void SimulateLeftClick(self) struct folders *self; { DoClick(self, TRUE, TRUE); } void folders__PostKeyState(self, ks) struct folders *self; struct keystate *ks; *************** *** 518,520 **** --- 427,483 ---- } return(fclose(fp)); } + + ConsiderResettingDescription(ci, code, FirstTime) + struct folders *ci; + int code; + Boolean FirstTime; + { + char Label[256], MessageText[256]; + char *PluralString; + + PluralString = (ci->MainDirCacheCount == 1) ? "" : "s"; + switch(code) { + case LIST_ALL_FOLDERS: + sprintf(MessageText, "Exposed a list of all %s folders on your search path.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000)); + sprintf(Label, "All %d Folders", ci->MainDirCacheCount); + break; + case LIST_SUBSCRIBED: + sprintf(MessageText, "Exposed a list of the %s folder%s you subscribe to.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); + sprintf(Label, "%d Subscribed Folder%s", ci->MainDirCacheCount, PluralString); + break; + case LIST_MAIL_FOLDERS: + sprintf(MessageText, "Exposed a list of %s personal mail folder%s.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); + sprintf(Label, "%d Mail Folder%s", ci->MainDirCacheCount, PluralString); + break; + case LIST_AS_REQUESTED: + sprintf(MessageText, "Exposed a list of the %s folder%s you requested.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); + sprintf(Label, "%d Requested Folder%s", ci->MainDirCacheCount, PluralString); + break; + case LIST_NEWONLY: + if (FirstTime) { + /* printed a more detailed message elsewhere */ + MessageText[0] = '\0'; + } else { + if (ci->ShowingAsRequested) { + sprintf(MessageText, "Exposed a list of %s folder%s.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); + } else { + sprintf(MessageText, "Exposed a list of your %s subscription%s with new messages.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); + } + } + if (ci->ShowingAsRequested) { + sprintf(Label, "%d Requested Folder%s", ci->MainDirCacheCount, PluralString); + } else { + sprintf(Label, "%d Changed Folder%s", ci->MainDirCacheCount, PluralString); + } + break; + default: + MessageText[0] = '\0'; + Label[0] = '\0'; + } + if (ci->myframe) frame_SetTitle(ci->myframe, Label); + if (MessageText[0]) { + message_DisplayString(NULL, 10, MessageText); + } + } + *** atkams/messages/lib/folders.c Wed Sep 26 16:10:49 1990 --- atkams/messages/lib/folders.c.NEW Sat Apr 27 02:06:35 1991 *************** *** 2,35 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v 1.29 90/08/21 16:56:49 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v 1.29 90/08/21 16:56:49 gk5g Exp $ "; #endif /* lint */ #include #include #include #include #include - #include /* sys/file.h */ #include /* for htonl, etc. */ #include #include #include ! #include #include #include #include #include #include #include - #include #include #include #include #include --- 2,40 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v 1.31 1991/04/14 17:24:45 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v 1.31 1991/04/14 17:24:45 gk5g Exp $ "; #endif /* lint */ + #include /* sys/file.h */ #include #include #include #include #include #include /* for htonl, etc. */ #include #include #include ! #include #include #include #include + #include + #include #include #include #include #include + #include + #include + #include + #include #include #include *************** *** 46,52 **** #define Logstat(x,y,z) #endif /* DOTIMING */ ! extern char *index(), *rindex(); #ifndef _IBMR2 extern char *malloc(); --- 51,58 ---- #define Logstat(x,y,z) #endif /* DOTIMING */ ! static struct keymap *folders_standardkeymap; ! static struct menulist *folders_standardmenulist; #ifndef _IBMR2 extern char *malloc(); *************** *** 54,59 **** --- 60,74 ---- static char *ForgetItString = "Forget it -- do nothing."; + extern void SimulateLeftClick(); + extern void UpFocus(), DownFocus(); + extern void TextviewCompound(); + extern void FoldersCompound(); + extern void FoldersTextviewCommand(); + extern void FoldersSendmessageCommand(); + extern void FoldersCaptionsCommand(); + extern int ConsiderResettingDescription(); + void folders__HandleAsyncPrefetch(ci) struct folders *ci; { *************** *** 104,147 **** return(whichicon); } - boolean folders__InitializeObject(c, folders) - struct classheader *c; - struct folders *folders; - { - struct text *mytext; - - folders_SetWhatIAm(folders, WHATIAM_FOLDERS); - InitKeyMenusStyles(folders); - folders->NeedsToPrefetch = FALSE; - folders->myframe = NULL; - folders->puntlp = NULL; - folders->puntbutt = NULL; - folders->myscroll = NULL; - folders->sm = NULL; - folders->mycursor = NULL; - folders->HasSetUp = 0; - folders->CurrentConfiguration = LIST_NEWONLY; - folders->MailOnlyMode = 0; - folders->VeryNarrow = 0; - /* Initialize the BEDirCache */ - folders->MainDirCache = (struct BEDirCache *) malloc(25*sizeof(struct BEDirCache)); - bzero(folders->MainDirCache, 25 * sizeof(struct BEDirCache)); - folders->MainDirCacheSize = 25; - folders->MainDirCacheCount = 0; - - mytext = text_New(); - text_SetGlobalStyle(mytext, folders->GlobalCapStyle); - text_SetReadOnly(mytext, TRUE); - folders_SetDataObject(folders, mytext); - - folders->HighlightEnv = NULL; - ams_AddCheckpointFolder(folders); - folders->mycaps = NULL; - - folders_ShowHelp(folders); - return(TRUE); - } - void folders__ShowHelp(self) struct folders *self; { --- 119,124 ---- *************** *** 184,214 **** folders_WantUpdate(self, self); } - void folders__FinalizeObject(c, self) - struct classheader *c; - struct folders *self; - { - ams_RemoveCheckpointFolder(self); - if (self->MainDirCache) { - free(self->MainDirCache); - self->MainDirCache = NULL; - } - if (self->sm) { - sendmessage_SetFoldersView(self->sm, NULL); - } - if (self->mycaps) { - captions_SetFolders(self->mycaps, NULL); - } - FinalizeProcStyleStuff(self); - if (self->puntlp) lpair_Destroy(self->puntlp); - if (self->buttslp) lpair_Destroy(self->buttslp); - if (self->puntbutt) butter_Destroy(self->puntbutt); - if (self->commitbutt) butter_Destroy(self->commitbutt); - if (self->cbv) butterview_Destroy(self->cbv); - if (self->pbv) butterview_Destroy(self->pbv); - super_DeleteApplicationLayer(self, self->myscroll); - } - struct view * folders__Hit(folders, action, x, y, nclicks) struct folders *folders; --- 161,166 ---- *************** *** 553,611 **** InsertFolderNameInText(ci, bdcent, comm); } - ConsiderResettingDescription(ci, code, FirstTime) - struct folders *ci; - int code; - Boolean FirstTime; - { - char Label[256], MessageText[256]; - char *PluralString; - - PluralString = (ci->MainDirCacheCount == 1) ? "" : "s"; - switch(code) { - case LIST_ALL_FOLDERS: - sprintf(MessageText, "Exposed a list of all %s folders on your search path.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000)); - sprintf(Label, "All %d Folders", ci->MainDirCacheCount); - break; - case LIST_SUBSCRIBED: - sprintf(MessageText, "Exposed a list of the %s folder%s you subscribe to.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); - sprintf(Label, "%d Subscribed Folder%s", ci->MainDirCacheCount, PluralString); - break; - case LIST_MAIL_FOLDERS: - sprintf(MessageText, "Exposed a list of %s personal mail folder%s.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); - sprintf(Label, "%d Mail Folder%s", ci->MainDirCacheCount, PluralString); - break; - case LIST_AS_REQUESTED: - sprintf(MessageText, "Exposed a list of the %s folder%s you requested.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); - sprintf(Label, "%d Requested Folder%s", ci->MainDirCacheCount, PluralString); - break; - case LIST_NEWONLY: - if (FirstTime) { - /* printed a more detailed message elsewhere */ - MessageText[0] = '\0'; - } else { - if (ci->ShowingAsRequested) { - sprintf(MessageText, "Exposed a list of %s folder%s.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); - } else { - sprintf(MessageText, "Exposed a list of your %s subscription%s with new messages.", amsutil_cvEng(ci->MainDirCacheCount, 0, 1000), PluralString); - } - } - if (ci->ShowingAsRequested) { - sprintf(Label, "%d Requested Folder%s", ci->MainDirCacheCount, PluralString); - } else { - sprintf(Label, "%d Changed Folder%s", ci->MainDirCacheCount, PluralString); - } - break; - default: - MessageText[0] = '\0'; - Label[0] = '\0'; - } - if (ci->myframe) frame_SetTitle(ci->myframe, Label); - if (MessageText[0]) { - message_DisplayString(NULL, 10, MessageText); - } - } - ClearFolders(ci) struct folders *ci; { --- 505,510 ---- *************** *** 970,982 **** } } - boolean folders__InitializeClass(classID) - struct classheader *classID; - { - OneTimeInitKeyMenus(&folders_classinfo); - return(TRUE); - } - InsertFolderNameInText(f, bdcent, comm) struct folders *f; struct BEDirCache *bdcent; --- 869,874 ---- *************** *** 1326,1329 **** --- 1218,1374 ---- im_ExposeWindow(myim); } #endif /* NOWAYJOSE */ + } + + static struct bind_Description folders_standardbindings [] = { + /* procname, keysequence, key rock, menu string, menu rock, proc, docstring, dynamic autoload */ + {"folders-left-click-here", "!", TRUE, NULL, NULL, 0, SimulateLeftClick, "Display what I am pointing at"}, + {"folders-right-click-here", "@", FALSE, NULL, NULL, 0, folders__SimulateClick, "Simulate right click on what I am pointing at"}, + {"folder-down-focus", "\030n", NULL, NULL, NULL, 0, DownFocus, "Move input focus to captions"}, + {"folders-up-focus", "\030p", NULL, NULL, NULL, 0, UpFocus, "Move input focus to bodies or sendmessage"}, + {"folder-down-focus", "\030\016", NULL, NULL, NULL, 0, DownFocus, "Move input focus to captions"}, + {"folders-up-focus", "\030\020", NULL, NULL, NULL, 0, UpFocus, "Move input focus to bodies or sendmessage"}, + {"textview-compound", NULL, NULL, NULL, NULL, NULL, TextviewCompound, "Execute a compound textview operation"}, + {"folders-compound-operation", NULL, NULL, NULL, NULL, 0, FoldersCompound, "Execute a compound folders operation"}, + {"folders-textview-compound", NULL, NULL, NULL, NULL, 0, FoldersTextviewCommand, "Execute a compound 'textview' operation on the folders"}, + {"folders-sendmessage-compound", NULL, NULL, NULL, NULL, 0, FoldersSendmessageCommand, "Execute a compound 'sendmessage' operation."}, + {"folders-captions-compound", NULL, NULL, NULL, NULL, 0, FoldersCaptionsCommand, "Execute a compound 'captions' operation."}, + {NULL, "\033~", NULL, NULL, NULL, 0, NULL, NULL, NULL}, /* Preserve read onliness */ + {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} + }; + + InitKeyMenusStyles(folders) + struct folders *folders; + { + char *fontname; + int fontsize; + + folders->mykeys = keystate_Create(folders, folders_standardkeymap); + folders->mymenulist = menulist_DuplicateML(folders_standardmenulist, folders); + + folders->BigCenterStyle = style_New(); + style_SetFontSize(folders->BigCenterStyle, style_ConstantFontSize, 20); + style_SetJustification(folders->BigCenterStyle, style_Centered); + + folders->CenterStyle = style_New(); + style_SetJustification(folders->CenterStyle, style_Centered); + style_AddNewFontFace(folders->CenterStyle, (long) fontdesc_Italic); + + folders->SmallCenterStyle = style_New(); + style_SetJustification(folders->SmallCenterStyle, style_Centered); + style_SetFontSize(folders->SmallCenterStyle, style_ConstantFontSize, 6); + + folders->BoldStyle = style_New(); + style_SetName(folders->BoldStyle, "Bold"); + style_AddNewFontFace(folders->BoldStyle, (long) fontdesc_Bold); + + folders->ItalicStyle = style_New(); + style_SetFontSize(folders->ItalicStyle, style_PreviousFontSize, 2); + style_AddNewFontFace(folders->ItalicStyle, (long) fontdesc_Italic); + + folders->IconicStyle = style_New(); + style_SetFontFamily(folders->IconicStyle, "msgs"); + style_SetFontSize(folders->IconicStyle, style_ConstantFontSize, 10); + + folders->Activefolderstyle = style_New(); + if (amsutil_GetOptBit(EXP_FIXCAPTIONS)) { + style_AddNewFontFace(folders->Activefolderstyle, (long) fontdesc_Bold | fontdesc_Fixed); + } else { + style_AddNewFontFace(folders->Activefolderstyle, (long) fontdesc_Bold); + } + style_SetNewLeftMargin(folders->Activefolderstyle, style_ConstantMargin, 20, style_RawDots); + style_SetNewIndentation(folders->Activefolderstyle, style_ConstantMargin, -10, style_RawDots); + + folders->Normalfolderstyle = style_New(); + + folders->GlobalCapStyle = style_New(); + style_SetJustification(folders->GlobalCapStyle, style_LeftJustified); + style_SetNewLeftMargin(folders->GlobalCapStyle, style_ConstantMargin, 20, style_RawDots); + style_SetNewIndentation(folders->GlobalCapStyle, style_ConstantMargin, -10, style_RawDots); + + fontsize = environ_GetProfileInt("messages.fontsize", 12); + fontname = amsutil_GetDefaultFontName(); + style_SetFontSize(folders->GlobalCapStyle, style_ConstantFontSize, fontsize); + style_SetFontFamily(folders->Activefolderstyle, fontname); + style_SetFontFamily(folders->Normalfolderstyle, fontname); + style_SetFontFamily(folders->GlobalCapStyle, fontname); + style_SetFontFamily(folders->BoldStyle, fontname); + style_SetFontFamily(folders->ItalicStyle, fontname); + } + + OneTimeInitKeyMenus() + { + folders_standardkeymap = keymap_New(); + folders_standardmenulist = menulist_New(); + bind_BindList(folders_standardbindings, folders_standardkeymap, folders_standardmenulist, &folders_classinfo); + } + + boolean folders__InitializeClass(classID) + struct classheader *classID; + { + OneTimeInitKeyMenus(); + return(TRUE); + } + + boolean folders__InitializeObject(c, folders) + struct classheader *c; + struct folders *folders; + { + struct text *mytext; + + folders_SetWhatIAm(folders, WHATIAM_FOLDERS); + InitKeyMenusStyles(folders); + folders->NeedsToPrefetch = FALSE; + folders->myframe = NULL; + folders->puntlp = NULL; + folders->puntbutt = NULL; + folders->myscroll = NULL; + folders->sm = NULL; + folders->mycursor = NULL; + folders->HasSetUp = 0; + folders->CurrentConfiguration = LIST_NEWONLY; + folders->MailOnlyMode = 0; + folders->VeryNarrow = 0; + /* Initialize the BEDirCache */ + folders->MainDirCache = (struct BEDirCache *) malloc(25*sizeof(struct BEDirCache)); + bzero(folders->MainDirCache, 25 * sizeof(struct BEDirCache)); + folders->MainDirCacheSize = 25; + folders->MainDirCacheCount = 0; + + mytext = text_New(); + text_SetGlobalStyle(mytext, folders->GlobalCapStyle); + text_SetReadOnly(mytext, TRUE); + folders_SetDataObject(folders, mytext); + + folders->HighlightEnv = NULL; + ams_AddCheckpointFolder(folders); + folders->mycaps = NULL; + + folders_ShowHelp(folders); + return(TRUE); + } + + void folders__FinalizeObject(c, self) + struct classheader *c; + struct folders *self; + { + ams_RemoveCheckpointFolder(self); + if (self->MainDirCache) { + free(self->MainDirCache); + self->MainDirCache = NULL; + } + if (self->sm) { + sendmessage_SetFoldersView(self->sm, NULL); + } + if (self->mycaps) { + captions_SetFolders(self->mycaps, NULL); + } + FinalizeProcStyleStuff(self); + if (self->puntlp) lpair_Destroy(self->puntlp); + if (self->buttslp) lpair_Destroy(self->buttslp); + if (self->puntbutt) butter_Destroy(self->puntbutt); + if (self->commitbutt) butter_Destroy(self->commitbutt); + if (self->cbv) butterview_Destroy(self->cbv); + if (self->pbv) butterview_Destroy(self->pbv); + super_DeleteApplicationLayer(self, self->myscroll); } *** atkams/messages/lib/messages.c Fri Dec 21 15:00:40 1990 --- atkams/messages/lib/messages.c.NEW Sat Apr 27 02:06:40 1991 *************** *** 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/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.36 90/10/15 15:08:52 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.36 90/10/15 15:08:52 gk5g Exp $ "; #endif /* lint */ #include --- 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/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.40 1991/04/27 06:00:22 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.40 1991/04/27 06:00:22 gk5g Exp $ "; #endif /* lint */ #include *************** *** 27,40 **** --- 27,43 ---- #include #include #include + #include #include #include + #include #include #include #include #include + #ifndef NOTREESPLEASE #include #include *************** *** 41,170 **** #include #endif ! extern void AlterSubByName(); ! extern void AppendMarked(); ! extern void AppendMarkedToFile(); ! extern AppendMessageToFile(); ! extern void BS_AppendDelPlease(); ! extern void BS_AppendOnto(); ! extern void BS_AppendPlease(); extern void BS_CheckNewPlease(); ! extern void BS_ClassifyPlease(); ! extern void BS_CopyPlease(); ! extern void BS_CreatePlease(); ! extern void BS_DeleteFolder(); ! extern void BS_DeletePlease(); ! extern void BS_DifferentContentType(); ! extern void BS_DummyQuit(); ! extern void BS_FileInto(); ! extern void BS_MarkCurrent(); ! extern void BS_ModifiableBody(); ! extern void BS_MorePlease(); ! extern void BS_NextPlease(); ! extern void BS_ReSendPlease(); extern void BS_ReadMailPlease(); ! extern void BS_RedisplayFixedWidth(); ! extern void BS_RedisplayFormat(); ! extern void BS_RedisplayNormal(); ! extern void BS_RedisplayRot13(); ! extern void BS_RefreshDisplayedFolder(); ! extern void BS_RenamePlease(); ! extern void BS_ReplyToAll(); ! extern void BS_ReplyToBoth(); ! extern void BS_ReplyToReaders(); ! extern void BS_ReplyToSender(); ! extern void BS_RestoreAsDraft(); ! extern void BS_ScrollBackBody(); ! extern void BS_ScrollForwardBody(); ! extern void BS_SelectBody(); ! extern void BS_SendForward(); ! extern void BS_SendFresh(); ! extern void BS_SetPrinter(); extern void BS_ShowAllPlease(); extern void BS_ShowHelp(); extern void BS_ShowNewPlease(); extern void BS_ShowPersonalPlease(); extern void BS_ShowSubscribedPlease(); ! extern void BS_ShowTreePlease(); ! extern void BS_UndeletePlease(); ! extern void BSearchFPlease(); ! extern void BSearchRPlease(); ! extern void BackUp(); ! extern void CSearchFPlease(); ! extern void CSearchRPlease(); extern CheckMenuMasks(); ! extern void ClassifyMarked(); ! extern void ClearMarks(); extern boolean ClearSM(); ! extern void CopyMarked(); ! extern void CountMarks(); ! extern void DeleteMarked(); ! extern void DeleteWindow(); ! extern DirectlyClassify(); extern void DuplicateWindow(); ! extern void ExcerptMarked(); ! extern void ExpandFileIntoMenus(); extern void FSearchFPlease(); extern void FSearchRPlease(); ! extern void FileByName(); ! extern void FileIntoByName(); ! extern void FileOntoByName(); ! extern void FindAllCaptions(); ! extern void FindRelatedMessages(); ! extern void GSearchFPlease(); ! extern void GSearchRPlease(); ! extern GenNodeName(); extern struct t822view *GetBodies(); extern struct captions *GetCaptions(); extern struct captions *GetCaptionsNoCreate(); ! extern GetFolderName(); ! extern char *GetLastResendName(); ! extern void MarkRange(); ! extern void MarkVisibleMessageUnseen(); ! extern void MessagesBodiesCommand(); ! extern void MessagesCaptionsCommand(); ! extern void MessagesCompound(); ! extern void MessagesFocusBodies(); ! extern void MessagesFocusCaptions(); extern void MessagesFocusFolders(); extern void MessagesFoldersCommand(); extern void MessagesSendmessageCommand(); ! extern void MessagesTextviewCommand(); ! extern void NextMarked(); ! extern NoOp(); ! extern OrgHit(); extern PrepareAppendFileName(); ! extern void PrevMarked(); ! extern void PrintMarked(); ! extern void PrintVisibleMessage(); ! extern void PuntCurrent(); ! extern void PurgeAllDeletions(); ! extern void QuitMessages(); ! extern ReadByName(); ! extern ReadNamedFolder(); ! extern void ReplyAllMarked(); ! extern void ReplySendersMarked(); ! extern void ResendMarked(); ! extern void RestoreOldMarks(); ! extern void SetMessagesOptions(); ! extern SetSubStatus(); ! extern void ShrinkFileIntoMenus(); ! extern void SubscribeByName(); ! extern void TextviewCompound(); ! extern void ThisIsFlorida(); ! extern void UnSubscribeByName(); ! extern void UndeleteMarked(); ! extern countdots(); ! extern int messages__AppendOneMessageToFile(); ! extern void messages__FinalizeObject(); ! extern boolean messages__InitializeClass(); extern boolean messages__InitializeObject(); ! extern void messages__PostMenus(); ! extern void messages__ResetFileIntoMenus(); ! extern void messages__SetWhatIAm(); - extern char *index(), *rindex(); - static struct keymap *messages_standardkeymap; static struct menulist *messages_standardmenulist; --- 44,173 ---- #include #endif ! extern void AlterSubByName(); ! extern void AppendMarked(); ! extern void AppendMarkedToFile(); ! extern AppendMessageToFile(); ! extern void BS_AppendDelPlease(); ! extern void BS_AppendOnto(); ! extern void BS_AppendPlease(); extern void BS_CheckNewPlease(); ! extern void BS_ClassifyPlease(); ! extern void BS_CopyPlease(); ! extern void BS_CreatePlease(); ! extern void BS_DeleteFolder(); ! extern void BS_DeletePlease(); ! extern void BS_DifferentContentType(); ! extern void BS_DummyQuit(); ! extern void BS_FileInto(); ! extern void BS_MarkCurrent(); ! extern void BS_ModifiableBody(); ! extern void BS_MorePlease(); ! extern void BS_NextPlease(); ! extern void BS_ReSendPlease(); extern void BS_ReadMailPlease(); ! extern void BS_RedisplayFixedWidth(); ! extern void BS_RedisplayFormat(); ! extern void BS_RedisplayNormal(); ! extern void BS_RedisplayRot13(); ! extern void BS_RefreshDisplayedFolder(); ! extern void BS_CleanupBody(); ! extern void BS_NextDigest(); ! extern void BS_PrevDigest(); ! extern void BS_RenamePlease(); ! extern void BS_ReplyToAll(); ! extern void BS_ReplyToBoth(); ! extern void BS_ReplyToReaders(); ! extern void BS_ReplyToSender(); ! extern void BS_RestoreAsDraft(); ! extern void BS_ScrollBackBody(); ! extern void BS_ScrollForwardBody(); ! extern void BS_SelectBody(); ! extern void BS_SendForward(); ! extern void BS_SendFresh(); ! extern void BS_SetPrinter(); extern void BS_ShowAllPlease(); extern void BS_ShowHelp(); extern void BS_ShowNewPlease(); extern void BS_ShowPersonalPlease(); extern void BS_ShowSubscribedPlease(); ! extern void BS_ShowTreePlease(); ! extern void BS_UndeletePlease(); ! extern void BSearchFPlease(); ! extern void BSearchRPlease(); ! extern void BackUp(); ! extern void CSearchFPlease(); ! extern void CSearchRPlease(); extern CheckMenuMasks(); ! extern void ClassifyMarked(); ! extern void ClearMarks(); extern boolean ClearSM(); ! extern void CopyMarked(); ! extern void CountMarks(); ! extern void DeleteMarked(); ! extern void DeleteWindow(); ! extern DirectlyClassify(); extern void DuplicateWindow(); ! extern void ExcerptMarked(); ! extern void ExpandFileIntoMenus(); extern void FSearchFPlease(); extern void FSearchRPlease(); ! extern void FileByName(); ! extern void FileIntoByName(); ! extern void FileOntoByName(); ! extern void FindAllCaptions(); ! extern void FindRelatedMessages(); ! extern void GSearchFPlease(); ! extern void GSearchRPlease(); ! extern GenNodeName(); extern struct t822view *GetBodies(); extern struct captions *GetCaptions(); extern struct captions *GetCaptionsNoCreate(); ! extern GetFolderName(); ! extern char *GetLastResendName(); ! extern void MarkRange(); ! extern void MarkVisibleMessageUnseen(); ! extern void MessagesBodiesCommand(); ! extern void MessagesCaptionsCommand(); ! extern void MessagesCompound(); ! extern void MessagesFocusBodies(); ! extern void MessagesFocusCaptions(); extern void MessagesFocusFolders(); extern void MessagesFoldersCommand(); extern void MessagesSendmessageCommand(); ! extern void MessagesTextviewCommand(); ! extern void NextMarked(); ! extern NoOp(); ! extern OrgHit(); extern PrepareAppendFileName(); ! extern void PrevMarked(); ! extern void PrintMarked(); ! extern void PrintVisibleMessage(); ! extern void PuntCurrent(); ! extern void PurgeAllDeletions(); ! extern void QuitMessages(); ! extern ReadByName(); ! extern ReadNamedFolder(); ! extern void ReplyAllMarked(); ! extern void ReplySendersMarked(); ! extern void ResendMarked(); ! extern void RestoreOldMarks(); ! extern void SetMessagesOptions(); ! extern SetSubStatus(); ! extern void ShrinkFileIntoMenus(); ! extern void SubscribeByName(); ! extern void TextviewCompound(); ! extern void ThisIsFlorida(); ! extern void UnSubscribeByName(); ! extern void UndeleteMarked(); ! extern countdots(); ! extern void text_CleanUpGlitches(); ! extern int messages__AppendOneMessageToFile(); ! extern boolean messages__InitializeClass(); extern boolean messages__InitializeObject(); ! extern void messages__ResetFileIntoMenus(); ! extern void messages__SetWhatIAm(); static struct keymap *messages_standardkeymap; static struct menulist *messages_standardmenulist; *************** *** 293,298 **** --- 296,304 ---- {"messages-redisplay-fixed", NULL, NULL, "This Message~30,Fixed Width~32", NULL, MENUMASK_MSGSHOWING | MENUMASK_FORMATMENUS, BS_RedisplayFixedWidth, "Show in fixed-width font"}, {"messages-redisplay-rot13", NULL, NULL, "This Message~30,Descramble~31", NULL, MENUMASK_MSGSHOWING | MENUMASK_FORMATMENUS, BS_RedisplayRot13, "Run rot-13 descrambling algorithm"}, {"messages-select-body", NULL, NULL, NULL, NULL, 0, BS_SelectBody, "Select the body of the message"}, + {"messages-cleanup-body", NULL, NULL, "This Message~30,Clean Up Body~32", NULL, MENUMASK_MSGSHOWING, BS_CleanupBody, "Clean up transport glitches in message body"}, + {"messages-next-digest", "\033n", NULL, NULL, NULL, NULL, BS_NextDigest, "Find the next encapsulated message in the message body"}, + {"messages-previous-digest", "\033p", NULL, NULL, NULL, NULL, BS_PrevDigest, "Find the previous encapsulated message in the message body"}, {"messages-modifiable-body", NULL, NULL, NULL, NULL, 0, BS_ModifiableBody, "Make the body of the message not be read-only"}, {"messages-different-content-type", NULL, NULL, NULL, NULL, 0, BS_DifferentContentType, "Display the body of a message using a different content-type header"}, {"messages-punt", ">", 1, "Other~60,Punt~94", 1, MENUMASK_PUNTMENU, (void (*)()) PuntCurrent, "Punt current folder and go to the next one"}, *************** *** 317,327 **** message_DisplayString(NULL, 10, "This command does nothing."); } ! int ! (*textview_ReverseSearchCmd)() = NoOp, ! (*textview_ScrollScreenBackCmd)() = NoOp, ! (*textview_ScrollScreenForwardCmd)() = NoOp, ! (*textview_ForwardSearchCmd)() = NoOp; boolean messages__InitializeClass(c) struct classheader *c; --- 323,332 ---- message_DisplayString(NULL, 10, "This command does nothing."); } ! int (*textv_ReverseSearchCmd)() = NoOp, ! (*textv_ScrollScreenBackCmd)() = NoOp, ! (*textv_ScrollScreenForwardCmd)() = NoOp, ! (*textv_ForwardSearchCmd)() = NoOp; boolean messages__InitializeClass(c) struct classheader *c; *************** *** 330,345 **** class_Load("textview"); if ((tempProc = proctable_Lookup("textview-search")) != NULL) { ! textview_ForwardSearchCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-reverse-search")) != NULL) { ! textview_ReverseSearchCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-prev-screen")) != NULL) { ! textview_ScrollScreenBackCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-next-screen")) != NULL) { ! textview_ScrollScreenForwardCmd = proctable_GetFunction(tempProc); } messages_standardmenulist = menulist_New(); messages_standardkeymap = keymap_New(); --- 335,350 ---- class_Load("textview"); if ((tempProc = proctable_Lookup("textview-search")) != NULL) { ! textv_ForwardSearchCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-reverse-search")) != NULL) { ! textv_ReverseSearchCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-prev-screen")) != NULL) { ! textv_ScrollScreenBackCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-next-screen")) != NULL) { ! textv_ScrollScreenForwardCmd = proctable_GetFunction(tempProc); } messages_standardmenulist = menulist_New(); messages_standardkeymap = keymap_New(); *************** *** 347,359 **** return(TRUE); } ! #define BIGMENUCARD 25 /* Most menu items to construct on a single file into card */ void messages__ResetFileIntoMenus(self) struct messages *self; { static struct proctable_Entry *directlyclassifyproc = NULL; ! int i, max, smallmax; char MenuString[25+MAXPATHLEN]; ams_InitializeClassList(); --- 352,364 ---- return(TRUE); } ! #define BIGMENUCARD 25 /* Most menu items to construct on a single file into card */ void messages__ResetFileIntoMenus(self) struct messages *self; { static struct proctable_Entry *directlyclassifyproc = NULL; ! int i, max, smallmax, biggermax; char MenuString[25+MAXPATHLEN]; ams_InitializeClassList(); *************** *** 362,381 **** } else { self->fileintomenulist = menulist_Create(self); } if (ams_GetLastMenuClass() < 0) return; max = ams_GetClassListCount(); smallmax = environ_GetProfileInt("messages.maxclassmenu", 8); if (smallmax > max) smallmax = max; if (!directlyclassifyproc) { directlyclassifyproc = proctable_DefineProc("messages-directly-classify", DirectlyClassify, &messages_classinfo, NULL, ""); } for(i=max - 1; i>=0; --i) { ! if (i < BIGMENUCARD) { sprintf(MenuString, "File Into...~40,%s", ams_GetClassListEntry(i)); } else { ! sprintf(MenuString, "File Into (%d)~%d,%s", i/BIGMENUCARD, 40+i/BIGMENUCARD, ams_GetClassListEntry(i)); } ! menulist_AddToML(self->fileintomenulist, MenuString, directlyclassifyproc, i, ((i>= smallmax) ? MENUMASK_EXPANDEDMENUS : 0) | MENUMASK_MSGSHOWING | MENUMASK_FILEINTOMENU); } } --- 367,394 ---- } else { self->fileintomenulist = menulist_Create(self); } + + if(self->expandedmenuslist) menulist_ClearML(self->expandedmenuslist); + else self->expandedmenuslist=menulist_Create(self); + if (ams_GetLastMenuClass() < 0) return; max = ams_GetClassListCount(); smallmax = environ_GetProfileInt("messages.maxclassmenu", 8); + biggermax = environ_GetProfileInt("messages.maxtotalclassmenu", BIGMENUCARD); + if(biggermax>BIGMENUCARD) biggermax=BIGMENUCARD; + if (smallmax > max) smallmax = max; if (!directlyclassifyproc) { directlyclassifyproc = proctable_DefineProc("messages-directly-classify", DirectlyClassify, &messages_classinfo, NULL, ""); } for(i=max - 1; i>=0; --i) { ! if (i < biggermax) { sprintf(MenuString, "File Into...~40,%s", ams_GetClassListEntry(i)); } else { ! sprintf(MenuString, "File Into (%d)~%d,%s", i/biggermax, 40+i/biggermax, ams_GetClassListEntry(i)); } ! if(ifileintomenulist, MenuString, directlyclassifyproc, i, MENUMASK_MSGSHOWING | MENUMASK_FILEINTOMENU); ! else menulist_AddToML(self->expandedmenuslist, MenuString, directlyclassifyproc, i, MENUMASK_MSGSHOWING | MENUMASK_FILEINTOMENU); } } *************** *** 479,485 **** void BSearchFPlease(self) struct messages *self; { ! textview_ForwardSearchCmd((struct textview *) GetBodies(self)); messages_WantInputFocus(self, self); } --- 492,498 ---- void BSearchFPlease(self) struct messages *self; { ! textv_ForwardSearchCmd((struct textview *) GetBodies(self)); messages_WantInputFocus(self, self); } *************** *** 486,492 **** void BSearchRPlease(self) struct messages *self; { ! textview_ReverseSearchCmd((struct textview *) GetBodies(self)); messages_WantInputFocus(self, self); } --- 499,505 ---- void BSearchRPlease(self) struct messages *self; { ! textv_ReverseSearchCmd((struct textview *) GetBodies(self)); messages_WantInputFocus(self, self); } *************** *** 493,499 **** void CSearchFPlease(self) struct messages *self; { ! textview_ForwardSearchCmd((struct textview *) GetCaptions(self)); messages_WantInputFocus(self, self); } --- 506,512 ---- void CSearchFPlease(self) struct messages *self; { ! textv_ForwardSearchCmd((struct textview *) GetCaptions(self)); messages_WantInputFocus(self, self); } *************** *** 1218,1230 **** void BS_ScrollBackBody(self) struct messages *self; { ! textview_ScrollScreenBackCmd(GetBodies(self)); } void BS_ScrollForwardBody(self) struct messages *self; { ! textview_ScrollScreenForwardCmd(GetBodies(self)); } ReadByName(self) --- 1231,1243 ---- void BS_ScrollBackBody(self) struct messages *self; { ! textv_ScrollScreenBackCmd(GetBodies(self)); } void BS_ScrollForwardBody(self) struct messages *self; { ! textv_ScrollScreenForwardCmd(GetBodies(self)); } ReadByName(self) *************** *** 1630,1635 **** --- 1643,1649 ---- mess->fileintomenulist = NULL; mess->mykeys = keystate_Create(mess, messages_standardkeymap); mess->mymenulist = menulist_DuplicateML(messages_standardmenulist, mess); + mess->expandedmenuslist = NULL; mess->WhatIAm = WHATIAM_UNDEFINED; mess->folderTree = NULL; mess->folderFrame = NULL; *************** *** 1655,1661 **** | (amsutil_GetOptBit(EXP_PUNTMENU) ? MENUMASK_PUNTMENU : 0)); c = GetCaptionsNoCreate(self); if (c) { - mymask |= (c->MenusExpanded ? MENUMASK_EXPANDEDMENUS : 0); if (c->VisibleCUID > 0) { mymask |= MENUMASK_MSGSHOWING; if (AMS_GET_ATTRIBUTE(c->VisibleSnapshot, AMS_ATT_MAYMODIFY)) { --- 1669,1674 ---- *************** *** 1669,1676 **** --- 1682,1746 ---- } if (c->MarkCount > 0) mymask |= MENUMASK_HASMARKS; if (!self->fileintomenulist) messages_ResetFileIntoMenus(self); + if(self->fileintomenulist) menulist_ClearChain(self->fileintomenulist); + if(self->expandedmenuslist) { + if (c->MenusExpanded) { + menulist_ClearChain(self->expandedmenuslist); + menulist_ChainBeforeML(self->fileintomenulist, self->expandedmenuslist, self->expandedmenuslist); + menulist_SetMask(self->expandedmenuslist, mymask); + } + } menulist_SetMask(self->fileintomenulist, mymask); } menulist_SetMask(self->mymenulist, mymask); } + void BS_CleanupBody(self) + struct messages *self; + { + struct text *t = (struct text *) t822view_GetDataObject(GetBodies(self)); + + ams_WaitCursor(TRUE); + text_CleanUpGlitches(t); + ams_WaitCursor(FALSE); + } + + void BS_NextDigest(self) + struct messages *self; + { + struct t822view *tv = (struct t822view *) GetBodies(self); + struct text *t = (struct text *) t822view_GetDataObject(tv); + struct SearchPattern *Pattern = NULL; + char *tp = search_CompilePattern("\012--", &Pattern); + int tmploc; + + if (tp) { + message_DisplayString(NULL, 10, tp); + } else { + tmploc = search_MatchPattern(t, t822view_GetDotPosition(tv), Pattern); + if (tmploc >= 0) { + t822view_SetDotPosition(tv, ++tmploc); + t822view_SetTopPosition(tv, tmploc); + } + } + } + + void BS_PrevDigest(self) + struct messages *self; + { + struct t822view *tv = (struct t822view *) GetBodies(self); + struct text *t = (struct text *) t822view_GetDataObject(tv); + struct SearchPattern *Pattern = NULL; + char *tp = search_CompilePattern("\012--", &Pattern); + int tmploc; + + if (tp) { + message_DisplayString(NULL, 10, tp); + } else { + tmploc = search_MatchPatternReverse(t, t822view_GetDotPosition(tv) - 2, Pattern); + if (tmploc >= 0) { + t822view_SetDotPosition(tv, ++tmploc); + t822view_SetTopPosition(tv, tmploc); + } + } + } *** atkams/messages/lib/messages.ch Wed Sep 26 16:10:55 1990 --- atkams/messages/lib/messages.ch.NEW Mon Apr 22 13:47:05 1991 *************** *** 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/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.9 90/07/27 15:17:38 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v $ */ #ifndef lint ! static char *rcsid_messages_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.9 90/07/27 15:17:38 gk5g Exp $ "; #endif /* lint */ #define WHATIAM_UNDEFINED -1 --- 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/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.10 1991/04/18 22:16:51 rr2b Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v $ */ #ifndef lint ! static char *rcsid_messages_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.10 1991/04/18 22:16:51 rr2b Exp $ "; #endif /* lint */ #define WHATIAM_UNDEFINED -1 *************** *** 29,35 **** ResetFileIntoMenus(); AppendOneMessageToFile(int cuid, char *fname) returns int; data: ! struct menulist *mymenulist, *fileintomenulist; struct keystate *mykeys; int WhatIAm; struct foldertreev *folderTree; --- 29,35 ---- ResetFileIntoMenus(); AppendOneMessageToFile(int cuid, char *fname) returns int; data: ! struct menulist *mymenulist, *fileintomenulist, *expandedmenuslist; struct keystate *mykeys; int WhatIAm; struct foldertreev *folderTree; *** atkams/messages/lib/messaux.c Wed Sep 26 16:10:57 1990 --- atkams/messages/lib/messaux.c.NEW Sat Apr 27 02:06:41 1991 *************** *** 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/projects/andrew/atkams/messages/lib/RCS/messaux.c,v 1.3 89/10/09 22:04:30 wjh Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messaux.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messaux.c,v 1.3 89/10/09 22:04:30 wjh Exp $ "; #endif /* lint */ #include --- 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/projects/andrew/atkams/messages/lib/RCS/messaux.c,v 1.6 1991/04/27 06:00:22 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messaux.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messaux.c,v 1.6 1991/04/27 06:00:22 gk5g Exp $ "; #endif /* lint */ #include *************** *** 23,29 **** #include #include #include ! #include #include #include --- 23,33 ---- #include #include #include ! #include ! #include ! #include ! #include ! #include #include #include #include *************** *** 35,159 **** #include #undef AUXMODULE - extern char *index(), *rindex(); - - extern void AlterSubByName(); - extern void AppendMarked(); - extern void AppendMarkedToFile(); - extern AppendMessageToFile(); - extern void BS_AppendDelPlease(); - extern void BS_AppendOnto(); - extern void BS_AppendPlease(); extern void BS_CheckNewPlease(); - extern void BS_ClassifyPlease(); - extern void BS_CopyPlease(); - extern void BS_CreatePlease(); - extern void BS_DeleteFolder(); - extern void BS_DeletePlease(); - extern void BS_DifferentContentType(); - extern void BS_DummyQuit(); - extern void BS_FileInto(); - extern void BS_MarkCurrent(); - extern void BS_ModifiableBody(); - extern void BS_MorePlease(); - extern void BS_NextPlease(); - extern void BS_ReSendPlease(); extern void BS_ReadMailPlease(); - extern void BS_RedisplayFixedWidth(); - extern void BS_RedisplayFormat(); - extern void BS_RedisplayNormal(); - extern void BS_RedisplayRot13(); - extern void BS_RefreshDisplayedFolder(); - extern void BS_RenamePlease(); - extern void BS_ReplyToAll(); - extern void BS_ReplyToBoth(); - extern void BS_ReplyToReaders(); - extern void BS_ReplyToSender(); - extern void BS_RestoreAsDraft(); - extern void BS_ScrollBackBody(); - extern void BS_ScrollForwardBody(); - extern void BS_SelectBody(); - extern void BS_SendForward(); - extern void BS_SendFresh(); - extern void BS_SetPrinter(); extern void BS_ShowAllPlease(); extern void BS_ShowHelp(); extern void BS_ShowNewPlease(); extern void BS_ShowPersonalPlease(); extern void BS_ShowSubscribedPlease(); - extern void BS_ShowTreePlease(); - extern void BS_UndeletePlease(); - extern void BSearchFPlease(); - extern void BSearchRPlease(); - extern void BackUp(); - extern void CSearchFPlease(); - extern void CSearchRPlease(); - extern void ClassifyMarked(); - extern void ClearMarks(); extern boolean ClearSM(); - extern void CopyMarked(); - extern void CountMarks(); - extern void DeleteMarked(); - extern void DeleteWindow(); - extern DirectlyClassify(); extern void DuplicateWindow(); - extern void ExcerptMarked(); - extern void ExpandFileIntoMenus(); extern void FSearchFPlease(); extern void FSearchRPlease(); - extern void FileByName(); - extern void FileIntoByName(); - extern void FileOntoByName(); - extern void FindAllCaptions(); - extern void FindRelatedMessages(); - extern void GSearchFPlease(); - extern void GSearchRPlease(); - extern GenNodeName(); extern struct t822view *GetBodies(); extern struct captions *GetCaptions(); extern struct captions *GetCaptionsNoCreate(); - extern GetFolderName(); extern struct folders *GetFolders(); - extern char *GetLastResendName(); - extern void MarkRange(); - extern void MarkVisibleMessageUnseen(); - extern void MessagesBodiesCommand(); - extern void MessagesCaptionsCommand(); - extern void MessagesCompound(); - extern void MessagesFocusBodies(); - extern void MessagesFocusCaptions(); extern void MessagesFocusFolders(); extern void MessagesFoldersCommand(); extern void MessagesSendmessageCommand(); - extern void MessagesTextviewCommand(); - extern void NextMarked(); - extern NoOp(); - extern OrgHit(); - extern void PrevMarked(); - extern void PrintMarked(); - extern void PrintVisibleMessage(); - extern void PuntCurrent(); - extern void PurgeAllDeletions(); - extern void QuitMessages(); - extern ReadByName(); - extern ReadNamedFolder(); - extern void ReplyAllMarked(); - extern void ReplySendersMarked(); - extern void ResendMarked(); - extern void RestoreOldMarks(); - extern void SetMessagesOptions(); - extern SetSubStatus(); - extern void ShrinkFileIntoMenus(); - extern void SubscribeByName(); - extern void TextviewCompound(); - extern void ThisIsFlorida(); - extern void UnSubscribeByName(); - extern void UndeleteMarked(); - extern countdots(); - extern int messages__AppendOneMessageToFile(); - extern void messages__SetWhatIAm(); ! extern int (*textview_ForwardSearchCmd)(), (*textview_ReverseSearchCmd)(), (*textview_ScrollScreenBackCmd)(), (*textview_ScrollScreenForwardCmd)(); void messages__PostKeyState(self, ks) --- 39,64 ---- #include #undef AUXMODULE extern void BS_CheckNewPlease(); extern void BS_ReadMailPlease(); extern void BS_ShowAllPlease(); extern void BS_ShowHelp(); extern void BS_ShowNewPlease(); extern void BS_ShowPersonalPlease(); extern void BS_ShowSubscribedPlease(); extern boolean ClearSM(); extern void DuplicateWindow(); extern void FSearchFPlease(); extern void FSearchRPlease(); extern struct t822view *GetBodies(); extern struct captions *GetCaptions(); extern struct captions *GetCaptionsNoCreate(); extern struct folders *GetFolders(); extern void MessagesFocusFolders(); extern void MessagesFoldersCommand(); extern void MessagesSendmessageCommand(); ! extern int (*textv_ForwardSearchCmd)(), (*textv_ReverseSearchCmd)(); void messages__PostKeyState(self, ks) *************** *** 190,196 **** menulist_ClearChain(mess->mymenulist); if (ml) menulist_ChainAfterML(mess->mymenulist, ml, ml); if (mess->fileintomenulist) { - menulist_ClearChain(mess->fileintomenulist); menulist_ChainAfterML(mess->mymenulist, mess->fileintomenulist, mess->fileintomenulist); } super_PostMenus(mess, mess->mymenulist); --- 95,100 ---- *************** *** 381,387 **** void FSearchFPlease(self) struct messages *self; { ! textview_ForwardSearchCmd((struct textview *) GetFolders(self)); messages_WantInputFocus(self, self); } --- 285,291 ---- void FSearchFPlease(self) struct messages *self; { ! textv_ForwardSearchCmd((struct textview *) GetFolders(self)); messages_WantInputFocus(self, self); } *************** *** 388,394 **** void FSearchRPlease(self) struct messages *self; { ! textview_ReverseSearchCmd((struct textview *) GetFolders(self)); messages_WantInputFocus(self, self); } --- 292,414 ---- void FSearchRPlease(self) struct messages *self; { ! textv_ReverseSearchCmd((struct textview *) GetFolders(self)); messages_WantInputFocus(self, self); + } + + /* The following routine tries to make a text object "prettier" by transforming x_\010 into and underlined x, and by extracting literal ATK data streams (e.g. from rejected mail) */ + + void text_CleanUpGlitches(self) + struct text *self; + { + struct style *uss; + struct SearchPattern *Pattern = NULL; + int loc = 0, tmploc=0; + char *tp, c1, c2; + + /* CLEANUP PART ONE: DEAL WITH _\010 -type underlining */ + uss = stylesheet_Find(self->styleSheet, "underline"); + tp = search_CompilePattern("[_\010]", &Pattern); + if (tp) { + message_DisplayString(NULL, 10, tp); + } else while (tmploc >= 0) { + tmploc = search_MatchPattern(self, loc, Pattern); + if (tmploc >= 0) { + c1 = text_GetChar(self, tmploc); + c2 = text_GetChar(self, tmploc+1); + if (c1 == '_') { + if (c2 == '\010') { + /* highlight next char */ + environment_WrapStyle(self->rootEnvironment, tmploc+2, 1, uss); + text_AlwaysDeleteCharacters(self, tmploc, 2); + } else { + /* Handle multiple _ here */ + int underscores = 1, erases = 0, pos = tmploc+1; + while(text_GetChar(self, pos) == '_') { + ++underscores; + ++pos; + } + while (text_GetChar(self, pos) == '\010') { + ++erases; + ++pos; + } + if (underscores == erases) { + text_AlwaysDeleteCharacters(self, tmploc, erases+underscores); + environment_WrapStyle(self-> rootEnvironment, tmploc, erases, uss); + } + } + } else if (c1 == '\010') { + if (c2 == '_') { + /* highlight previous char */ + environment_WrapStyle(self->rootEnvironment, tmploc-1, 1, uss); + text_AlwaysDeleteCharacters(self, tmploc, 2); + } else { + /* Handle multiple \010 here */ + int underscores = 0, erases = 1, pos = tmploc+1; + while (text_GetChar(self, pos) == '\010') { + ++erases; + ++pos; + } + while(text_GetChar(self, pos) == '_') { + ++underscores; + ++pos; + } + if (underscores == erases) { + text_AlwaysDeleteCharacters(self, tmploc, erases+underscores); + environment_WrapStyle(self->rootEnvironment, tmploc-erases, erases, uss); + } + } + } + } + loc = tmploc + 1; + } + /* CLEANUP PART TWO: DEAL WITH EMBEDDED ATK DATASTREAM, E.G. IN MAIL REJECTIONS */ + loc = tmploc = 0; + tp = search_CompilePattern("\\begindata", &Pattern); + if (tp) { + message_DisplayString(NULL, 10, tp); + } else do { + tmploc = search_MatchPattern(self, loc, Pattern); + if (tmploc >= 0) { + char Buf[200]; + int i, endloc; + FILE *fp; + + --tmploc; /* I'm not sure why, maybe a bogosity with the way CompilePattern handles the backslash! */ + strcpy(Buf, "\\end"); + i=4; + while (TRUE) { + Buf[i] = text_GetChar(self, tmploc+2+i); + if (Buf[i] == '\n') break; + ++i; + } + Buf[i] = NULL; + tp = search_CompilePattern(Buf, &Pattern); + if (tp) { + message_DisplayString(NULL, 10, tp); + } else { + endloc = search_MatchPattern(self, tmploc, Pattern); + if (endloc > tmploc) { + /* Found it! Now we need to turn it into ATK! */ + endloc += strlen(Buf); + sprintf(Buf, "/tmp/clean.%d", getpid()); + fp = fopen(Buf, "w"); + if (fp) { + /* This next loop is dumb -- is there a way to get to simpletext_Write from here? */ + for (i=tmploc; i= 0); + /* FINALLY, MAKE SURE OUR CHANGES GET NOTICED */ + text_NotifyObservers(self, 0); } *** atkams/messages/lib/messwind.c Wed Nov 22 12:44:25 1989 --- atkams/messages/lib/messwind.c.NEW Wed Apr 3 21:24:03 1991 *************** *** 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/atkams/messages/lib/RCS/messwind.c,v 1.10 89/11/01 15:01:33 bobg Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/messwind.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/messwind.c,v 1.10 89/11/01 15:01:33 bobg Exp $ "; #endif /* lint */ #include --- 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/projects/andrew/atkams/messages/lib/RCS/messwind.c,v 1.10 89/11/01 15:01:33 bobg Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messwind.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messwind.c,v 1.10 89/11/01 15:01:33 bobg Exp $ "; #endif /* lint */ #include *** atkams/messages/lib/msgsa.c Wed Nov 22 12:43:42 1989 --- atkams/messages/lib/msgsa.c.NEW Wed Apr 3 21:24:05 1991 *************** *** 2,15 **** * 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/atkams/messages/lib/RCS/msgsa.c,v 2.13 89/07/20 13:42:56 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/msgsa.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/msgsa.c,v 2.13 89/07/20 13:42:56 cfe Exp $ "; #endif /* lint */ #include #include #include --- 2,16 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/msgsa.c,v 2.14 91/04/03 16:50:03 susan Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/msgsa.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/msgsa.c,v 2.14 91/04/03 16:50:03 susan Exp $ "; #endif /* lint */ + #include #include #include #include *** atkams/messages/lib/msgsvers.h Wed Nov 22 12:43:06 1989 --- atkams/messages/lib/msgsvers.h.NEW Mon Feb 18 18:03:48 1991 *************** *** 2,17 **** * 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/atkams/messages/lib/RCS/msgsvers.h,v 2.22 89/11/01 14:58:57 bobg Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/msgsvers.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/msgsvers.h,v 2.22 89/11/01 14:58:57 bobg Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* Version number for messages view */ #define MESSAGES_MAJOR_VERSION (7) ! #define MESSAGES_MINOR_VERSION (14) --- 2,17 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/msgsvers.h,v 2.23 91/02/15 16:09:06 wjh Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/msgsvers.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/msgsvers.h,v 2.23 91/02/15 16:09:06 wjh Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* Version number for messages view */ #define MESSAGES_MAJOR_VERSION (7) ! #define MESSAGES_MINOR_VERSION (15) *** atkams/messages/lib/options.c Wed Nov 22 12:44:05 1989 --- atkams/messages/lib/options.c.NEW Fri Feb 1 15:28:13 1991 *************** *** 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/atkams/messages/lib/RCS/options.c,v 2.23 89/11/02 14:11:54 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/options.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/options.c,v 2.23 89/11/02 14:11:54 cfe Exp $ "; #endif /* lint */ #include --- 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/projects/andrew/atkams/messages/lib/RCS/options.c,v 2.24 91/01/31 14:47:37 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/options.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/options.c,v 2.24 91/01/31 14:47:37 gk5g Exp $ "; #endif /* lint */ #include *************** *** 20,26 **** #include #include #include - #include #include #include #include --- 20,25 ---- *************** *** 258,266 **** static char *Intro1 = "Setting Messages Options"; static char *Intro2 = "\nThe Messages program has a large number of options that you can alter to tailor the program's behavior to suit your needs. A list of the options appears in the caption area, above. Clicking on an option in the list above will scroll in this area to show you that option.\n\nTo set an option, you need to either left click a switch On or Off, change a slider value by dragging the slider or by clicking on the slider with the left button to increase the value or the right to decrease the value, or click on the Alter button which will prompt you to change the option's value.\n"; int i, tpos = 0, len, def, cappos = 0, scaledown; struct value *v; static struct style *MajorHeadingStyle = NULL, *CapStyle = NULL; - struct environment *et; char *pref; struct textview *tv = (struct textview *) bv; struct text *t = (struct text *) t822view_GetDataObject(bv); --- 257,265 ---- static char *Intro1 = "Setting Messages Options"; static char *Intro2 = "\nThe Messages program has a large number of options that you can alter to tailor the program's behavior to suit your needs. A list of the options appears in the caption area, above. Clicking on an option in the list above will scroll in this area to show you that option.\n\nTo set an option, you need to either left click a switch On or Off, change a slider value by dragging the slider or by clicking on the slider with the left button to increase the value or the right to decrease the value, or click on the Alter button which will prompt you to change the option's value.\n"; int i, tpos = 0, len, def, cappos = 0, scaledown; + int envPos, envLen; struct value *v; static struct style *MajorHeadingStyle = NULL, *CapStyle = NULL; char *pref; struct textview *tv = (struct textview *) bv; struct text *t = (struct text *) t822view_GetDataObject(bv); *************** *** 316,331 **** ams_WaitCursor(TRUE); len = strlen(Intro1); text_AlwaysInsertCharacters(captext, cappos, Intro1, len); ! et = environment_InsertStyle(captext->rootEnvironment, cappos, CapStyle, 1); cappos += len; text_AlwaysInsertCharacters(captext, cappos, "\n", 1); ! environment_SetLength(et, len); ++cappos; text_AlwaysInsertCharacters(t, tpos, Intro1, len); ! et = environment_InsertStyle(t->rootEnvironment, tpos, MajorHeadingStyle, 1); tpos += len; text_AlwaysInsertCharacters(t, tpos, "\n", 1); ! environment_SetLength(et, len); ++tpos; len = strlen(Intro2); text_AlwaysInsertCharacters(t, tpos, Intro2, len); --- 315,331 ---- ams_WaitCursor(TRUE); len = strlen(Intro1); text_AlwaysInsertCharacters(captext, cappos, Intro1, len); ! envPos = cappos; ! envLen = len; cappos += len; text_AlwaysInsertCharacters(captext, cappos, "\n", 1); ! text_AlwaysAddStyle(captext, envPos, envLen, CapStyle); ++cappos; text_AlwaysInsertCharacters(t, tpos, Intro1, len); ! envPos = tpos; tpos += len; text_AlwaysInsertCharacters(t, tpos, "\n", 1); ! text_AlwaysAddStyle(t, envPos, envLen, MajorHeadingStyle); ++tpos; len = strlen(Intro2); text_AlwaysInsertCharacters(t, tpos, Intro2, len); *************** *** 335,357 **** for (i=0; Options[i].OptionName; ++i) { len = strlen(Options[i].OptionName); text_AlwaysInsertCharacters(captext, cappos, Options[i].OptionName, len); ! et = environment_InsertStyle(captext->rootEnvironment, cappos, CapStyle, 1); cappos += len; text_AlwaysInsertCharacters(captext, cappos, "\n", 1); ! environment_SetLength(et, len); ++cappos; text_AlwaysInsertCharacters(t, tpos, Options[i].OptionName, len); ! et = environment_InsertStyle(t->rootEnvironment, tpos, MajorHeadingStyle, 1); tpos += len; ! text_AlwaysInsertCharacters(t, tpos, "\n\377\n\n", 4); ! environment_SetLength(et, len + 3); v = value_New(); if (Options[i].OptType == OT_EXPLEVEL) { value_SetValue(v, amsutil_GetPermOptBit(Options[i].OptParm) ? 1 : 0); value_AddCallBackObserver(v, t, ExpLevelHit, i); ! text_AlwaysAddView(t, tpos + 1, "onoffV", v); ! } else if (Options[i].OptType == OT_INTEGER) { ! text_AlwaysAddView(t, tpos + 1, "sliderV", v); def = IntegerDefaults[Options[i].OptParm]; scaledown = 1; switch(Options[i].OptParm) { --- 335,361 ---- for (i=0; Options[i].OptionName; ++i) { len = strlen(Options[i].OptionName); text_AlwaysInsertCharacters(captext, cappos, Options[i].OptionName, len); ! envPos = cappos; ! envLen = len; cappos += len; text_AlwaysInsertCharacters(captext, cappos, "\n", 1); ! text_AlwaysAddStyle(captext, envPos, envLen, CapStyle); ++cappos; + + /* Insert OptionName[i] and save position of first character for InsertStyle */ text_AlwaysInsertCharacters(t, tpos, Options[i].OptionName, len); ! envPos = tpos; ! tpos += len; ! text_AlwaysInsertCharacters(t, tpos++, "\n", 1); v = value_New(); if (Options[i].OptType == OT_EXPLEVEL) { value_SetValue(v, amsutil_GetPermOptBit(Options[i].OptParm) ? 1 : 0); value_AddCallBackObserver(v, t, ExpLevelHit, i); ! text_AlwaysAddView(t, tpos++, "onoffV", v); ! } ! else if (Options[i].OptType == OT_INTEGER) { ! text_AlwaysAddView(t, tpos++, "sliderV", v); def = IntegerDefaults[Options[i].OptParm]; scaledown = 1; switch(Options[i].OptParm) { *************** *** 380,390 **** } value_SetValue(v, environ_GetProfileInt(pref, def*scaledown)/scaledown); value_AddCallBackObserver(v, t, IntegerHit, i); ! } else { value_AddCallBackObserver(v, t, ButtonHit, i); ! text_AlwaysAddView(t, tpos + 1, "buttonV", v); } ! tpos += 4; len = strlen(Options[i].HelpText); text_AlwaysInsertCharacters(t, tpos, Options[i].HelpText, len); tpos += len; --- 384,401 ---- } value_SetValue(v, environ_GetProfileInt(pref, def*scaledown)/scaledown); value_AddCallBackObserver(v, t, IntegerHit, i); ! } ! else { value_AddCallBackObserver(v, t, ButtonHit, i); ! text_AlwaysAddView(t, tpos++, "buttonV", v); } ! ! /* Set MajorHeadingStyle around OptionName[i] and value view that follows */ ! envLen = tpos - envPos; ! text_AlwaysInsertCharacters(t, tpos, "\n\n", 2); ! tpos += 2; ! text_AlwaysAddStyle(t, envPos, envLen, MajorHeadingStyle); ! len = strlen(Options[i].HelpText); text_AlwaysInsertCharacters(t, tpos, Options[i].HelpText, len); tpos += len; *** atkams/messages/lib/sendaux.c Fri Dec 21 15:00:44 1990 --- atkams/messages/lib/sendaux.c.NEW Sat Apr 27 02:06:43 1991 *************** *** 19,36 **** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendaux.c,v 1.24 90/10/29 13:43:52 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendaux.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendaux.c,v 1.24 90/10/29 13:43:52 gk5g Exp $ "; #endif /* lint */ #include #include - #include /* sys/file.h */ #include #include #include --- 19,36 ---- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendaux.c,v 1.28 1991/04/27 06:00:22 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendaux.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendaux.c,v 1.28 1991/04/27 06:00:22 gk5g Exp $ "; #endif /* lint */ + #include /* sys/file.h */ #include #include #include #include #include *************** *** 66,72 **** static struct keymap *smkm, *smhkm; static struct menulist *sm_menulist, *sm_hmenulist; ! extern char *malloc(), *index(); /* values for sendmessage menu mask */ #define SMMASK_FEWSTYLES 1 --- 66,76 ---- static struct keymap *smkm, *smhkm; static struct menulist *sm_menulist, *sm_hmenulist; ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ ! ! extern char *index(); /* values for sendmessage menu mask */ #define SMMASK_FEWSTYLES 1 *************** *** 82,97 **** message_DisplayString(self, 75, "Absent procedure - did not find a normal BE2 command in the proctable!"); } ! static int (*textview_EndOfLineCmd) () = AbsentProcedure, ! (*textview_OpenLineCmd) () = AbsentProcedure, ! (*textview_InsertNewlineCmd) () = AbsentProcedure, ! (*textview_PreviousLineCmd) () = AbsentProcedure, ! (*textview_InsertFileCmd) () = AbsentProcedure, ! (*textview_BeginningOfLineCmd) () = AbsentProcedure, ! (*textview_PlainestCmd) () = AbsentProcedure, ! (*textview_NextLineCmd) () = AbsentProcedure; ! extern void ForceSending(), ForceStripping(), sendmessage__CheckRecipients(), UserWantsAHeader(), FileIntoFolder(), sendmessage__QuoteBody(), RestoreFromPS(), sendmessage__AppendBugInfoToBody(), BS_FakeBug(), BS_DownFocus(), BS_UpFocus(), BS_Preview(), ComposeBugReport(), sendmessage__Reset(), sendmessage_DoDelivery(), sendmessage_SaveDraft(), sendmessage_RestoreDraft(), sendmessage_InsertFile(), BeginLine(), NextLine(), PreviousLine(), BS_SendmessageFoldersCompound(), BS_SendmessageMessagesCompound(), BS_SendmessageCompound(), SetNotModified(), SBS_DoHeadersCommand(), SBS_DoBodiesCommand(), SBS_TextviewCompound(), DuplicateWindow(); AddSpecialHeaders(sm) struct sendmessage *sm; --- 86,101 ---- message_DisplayString(self, 75, "Absent procedure - did not find a normal BE2 command in the proctable!"); } ! static int (*textv_EndOfLineCmd) () = AbsentProcedure, ! (*textv_OpenLineCmd) () = AbsentProcedure, ! (*textv_InsertNewlineCmd) () = AbsentProcedure, ! (*textv_PreviousLineCmd) () = AbsentProcedure, ! (*textv_InsertFileCmd) () = AbsentProcedure, ! (*textv_BeginningOfLineCmd) () = AbsentProcedure, ! (*textv_PlainestCmd) () = AbsentProcedure, ! (*textv_NextLineCmd) () = AbsentProcedure; ! extern void ForceSending(), ForceStripping(), sendmessage__CheckRecipients(), UserWantsAHeader(), FileIntoFolder(), sendmessage__QuoteBody(), RestoreFromPS(), sendmessage__AppendBugInfoToBody(), BS_FakeBug(), BS_DownFocus(), BS_UpFocus(), BS_HeadersFocus(), BS_BodyFocus(), BS_Preview(), ComposeBugReport(), sendmessage__Reset(), sendmessage_DoDelivery(), sendmessage_SaveDraft(), sendmessage_RestoreDraft(), sendmessage_InsertFile(), BeginLine(), NextLine(), PreviousLine(), BS_SendmessageFoldersCompound(), BS_SendmessageMessagesCompound(), BS_SendmessageCompound(), SetNotModified(), SBS_DoHeadersCommand(), SBS_DoBodiesCommand(), SBS_TextviewCompound(), DuplicateWindow(); AddSpecialHeaders(sm) struct sendmessage *sm; *************** *** 249,260 **** text_InsertCharacters(sm->BodyText, pos, EnclosureBuf, strlen(EnclosureBuf)); pos = text_GetLength(sm->BodyText); textview_SetDotPosition(tv, pos); ! textview_InsertFileCmd(tv); pos = text_GetLength(sm->BodyText); text_InsertCharacters(sm->BodyText, pos, EnclosureBuf, strlen(EnclosureBuf)); textview_SetDotPosition(tv, pos); textview_SetDotLength(tv, strlen(EnclosureBuf)); ! textview_PlainestCmd(tv); textview_SetDotPosition(tv, oldpos); textview_SetDotLength(tv, oldlen); break; --- 253,264 ---- text_InsertCharacters(sm->BodyText, pos, EnclosureBuf, strlen(EnclosureBuf)); pos = text_GetLength(sm->BodyText); textview_SetDotPosition(tv, pos); ! textv_InsertFileCmd(tv); pos = text_GetLength(sm->BodyText); text_InsertCharacters(sm->BodyText, pos, EnclosureBuf, strlen(EnclosureBuf)); textview_SetDotPosition(tv, pos); textview_SetDotLength(tv, strlen(EnclosureBuf)); ! textv_PlainestCmd(tv); textview_SetDotPosition(tv, oldpos); textview_SetDotLength(tv, oldlen); break; *************** *** 521,526 **** --- 525,532 ---- {"sendmessage-up-input-focus", "\030p", NULL, NULL, NULL, 0, BS_UpFocus, "Move input focus up"}, {"sendmessage-down-input-focus", "\030\016", NULL, NULL, NULL, 0, BS_DownFocus, "Move input focus down"}, {"sendmessage-up-input-focus", "\030\020", NULL, NULL, NULL, 0, BS_UpFocus, "Move input focus up"}, + {"sendmessage-focus-on-headers", NULL, NULL, NULL, NULL, 0, BS_HeadersFocus, "Input focus on headers"}, + {"sendmessage-focus-on-body", NULL, NULL, NULL, NULL, 0, BS_BodyFocus, "Input focus on body of outgoing message"}, {"sendmessage-send-bug-report", NULL, 0, "Other~42,Compose Bug Report~99", NULL, NULL, (void (*) ()) ComposeBugReport, "Begin composing a messages/sendmessage bug report"}, {"sendmessage-preview", NULL, 0, "Other~42,Preview Non-Andrew~77", NULL, NULL, BS_Preview, "Preview how a message will look to non-Andrew users"}, {"sendmessage-special-headers", NULL, 0, "Other~42,Add Special Headers~98", NULL, NULL, (void (*) ()) AddSpecialHeaders, "Add special headers to the message"}, *************** *** 568,595 **** class_Load("textview"); /* make sure the textview is loaded * first */ if ((tempProc = proctable_Lookup("textview-insert-file")) != NULL) { ! textview_InsertFileCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-end-of-line")) != NULL) { ! textview_EndOfLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-open-line")) != NULL) { ! textview_OpenLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-insert-newline")) != NULL) { ! textview_InsertNewlineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-beginning-of-line")) != NULL) { ! textview_BeginningOfLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-next-line")) != NULL) { ! textview_NextLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-plainest")) != NULL) { ! textview_PlainestCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-previous-line")) != NULL) { ! textview_PreviousLineCmd = proctable_GetFunction(tempProc); } smkm = keymap_New(); sm_menulist = menulist_New(); --- 574,601 ---- class_Load("textview"); /* make sure the textview is loaded * first */ if ((tempProc = proctable_Lookup("textview-insert-file")) != NULL) { ! textv_InsertFileCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-end-of-line")) != NULL) { ! textv_EndOfLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-open-line")) != NULL) { ! textv_OpenLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-insert-newline")) != NULL) { ! textv_InsertNewlineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-beginning-of-line")) != NULL) { ! textv_BeginningOfLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-next-line")) != NULL) { ! textv_NextLineCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-plainest")) != NULL) { ! textv_PlainestCmd = proctable_GetFunction(tempProc); } if ((tempProc = proctable_Lookup("textview-previous-line")) != NULL) { ! textv_PreviousLineCmd = proctable_GetFunction(tempProc); } smkm = keymap_New(); sm_menulist = menulist_New(); *************** *** 839,845 **** message_DisplayString(hv, 10, "Done."); } else { ! textview_OpenLineCmd(self->BodyTextview); } } --- 845,851 ---- message_DisplayString(hv, 10, "Done."); } else { ! textv_OpenLineCmd(self->BodyTextview); } } *************** *** 853,859 **** v = sm->HeadTextview; if (myim && (im_GetInputFocus(myim) == (struct view *) v)) { ! textview_BeginningOfLineCmd(sm->HeadTextview); len = text_GetLength(sm->HeadText); dot = textview_GetDotPosition(v); c = text_GetChar(sm->HeadText, dot); --- 859,865 ---- v = sm->HeadTextview; if (myim && (im_GetInputFocus(myim) == (struct view *) v)) { ! textv_BeginningOfLineCmd(sm->HeadTextview); len = text_GetLength(sm->HeadText); dot = textview_GetDotPosition(v); c = text_GetChar(sm->HeadText, dot); *************** *** 873,879 **** textview_WantUpdate(v, v); } else { ! textview_BeginningOfLineCmd(sm->BodyTextview); } } --- 879,885 ---- textview_WantUpdate(v, v); } else { ! textv_BeginningOfLineCmd(sm->BodyTextview); } } *************** *** 888,895 **** v = sm->HeadTextview; if (myim && (im_GetInputFocus(myim) == (struct view *) v)) { dot = textview_GetDotPosition(v); ! textview_NextLineCmd(v); ! textview_EndOfLineCmd(v); if (dot == textview_GetDotPosition(v)) { textview_WantInputFocus(sm->BodyTextview, sm->BodyTextview); } --- 894,901 ---- v = sm->HeadTextview; if (myim && (im_GetInputFocus(myim) == (struct view *) v)) { dot = textview_GetDotPosition(v); ! textv_NextLineCmd(v); ! textv_EndOfLineCmd(v); if (dot == textview_GetDotPosition(v)) { textview_WantInputFocus(sm->BodyTextview, sm->BodyTextview); } *************** *** 899,908 **** } else { if (IsNewline) { ! textview_InsertNewlineCmd(sm->BodyTextview); } else { ! textview_NextLineCmd(sm->BodyTextview); } } } --- 905,914 ---- } else { if (IsNewline) { ! textv_InsertNewlineCmd(sm->BodyTextview); } else { ! textv_NextLineCmd(sm->BodyTextview); } } } *************** *** 916,929 **** v = sm->HeadTextview; if (myim && (im_GetInputFocus(myim) == (struct view *) v)) { ! textview_PreviousLineCmd(v); ! textview_EndOfLineCmd(v); textview_WantUpdate(v, v); } else { v = sm->BodyTextview; dot = textview_GetDotPosition(v); ! textview_PreviousLineCmd(v); if (dot == textview_GetDotPosition(v)) { textview_SetDotPosition(sm->HeadTextview, text_GetLength(sm->HeadText)); textview_WantInputFocus(sm->HeadTextview, sm->HeadTextview); --- 922,935 ---- v = sm->HeadTextview; if (myim && (im_GetInputFocus(myim) == (struct view *) v)) { ! textv_PreviousLineCmd(v); ! textv_EndOfLineCmd(v); textview_WantUpdate(v, v); } else { v = sm->BodyTextview; dot = textview_GetDotPosition(v); ! textv_PreviousLineCmd(v); if (dot == textview_GetDotPosition(v)) { textview_SetDotPosition(sm->HeadTextview, text_GetLength(sm->HeadText)); textview_WantInputFocus(sm->HeadTextview, sm->HeadTextview); *************** *** 957,963 **** DirectlyInsertFile(tv, t, fname, pos); } else { ! textview_InsertFileCmd(tv); } } --- 963,969 ---- DirectlyInsertFile(tv, t, fname, pos); } else { ! textv_InsertFileCmd(tv); } } *************** *** 977,983 **** } textview_SetDotPosition(tv, len - 1); textview_SetDotLength(tv, 1); ! textview_PlainestCmd(tv); textview_SetDotPosition(tv, dotpos); textview_SetDotLength(tv, dotlen); } --- 983,989 ---- } textview_SetDotPosition(tv, len - 1); textview_SetDotLength(tv, 1); ! textv_PlainestCmd(tv); textview_SetDotPosition(tv, dotpos); textview_SetDotLength(tv, dotlen); } *** atkams/messages/lib/sendmsg.c Fri Dec 21 15:00:47 1990 --- atkams/messages/lib/sendmsg.c.NEW Sun May 5 18:55:30 1991 *************** *** 2,18 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.33 90/09/19 18:03:45 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.33 90/09/19 18:03:45 gk5g Exp $ "; #endif /* lint */ #include #include - #include /* sys/file.h */ #include #include #include --- 2,18 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.40 1991/05/05 22:38:34 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.40 1991/05/05 22:38:34 gk5g Exp $ "; #endif /* lint */ + #include /* sys/file.h */ #include #include #include #include #include *************** *** 92,97 **** --- 92,109 ---- MakeOneHeaderFieldBold(self, 0); } + void BS_HeadersFocus(sm) + struct sendmessage *sm; + { + textview_WantInputFocus(sm->HeadTextview, sm->HeadTextview); + } + + void BS_BodyFocus(sm) + struct sendmessage *sm; + { + textview_WantInputFocus(sm->BodyTextview, sm->BodyTextview); + } + void BS_DownFocus(sm) struct sendmessage *sm; { *************** *** 556,566 **** } if (amsutil_GetOptBit(EXP_SIGNMAIL) && !sendmessage->HasSigned) { FILE *fp; ! char fname[1+MAXPATHLEN]; ! ams_TildeResolve(ams_GetAMS(), "~/.signature", fname); fp = fopen(fname, "r"); if (!fp) { static char *NoSignatureQVec[] = { "The file '~/.signature' could not be read", "Send unsigned", --- 568,585 ---- } if (amsutil_GetOptBit(EXP_SIGNMAIL) && !sendmessage->HasSigned) { FILE *fp; ! char fname[1+MAXPATHLEN], *fnamepattern; ! nkids = environment_NumberOfChildren(sendmessage->BodyText->rootEnvironment); ! /* Note that we will recalculate this value after inserting the signature file */ ! fnamepattern = (nkids > 0) ? "~/.sig.fmt" : "~/.sig"; ! ams_TildeResolve(ams_GetAMS(), fnamepattern, fname); fp = fopen(fname, "r"); if (!fp) { + ams_TildeResolve(ams_GetAMS(), "~/.signature", fname); + fp = fopen(fname, "r"); + } + if (!fp) { static char *NoSignatureQVec[] = { "The file '~/.signature' could not be read", "Send unsigned", *************** *** 894,900 **** --- 913,923 ---- message_DisplayString(sendmessage, 10, ErrorText); return(-1); } + #ifdef M_UNIX + chmod(LocalName, 0600); + #else fchmod(fileno(fp), 0600); + #endif if (Version >= 10) { int kids; *************** *** 922,928 **** --- 945,955 ---- text_Write(d, fp, im_GetWriteID(), 1); fputs("\n", fp); /* Mail should end with a newline, I think */ + #ifdef M_UNIX + chmod(LocalName,0600); + #else fchmod(fileno(fp), 0600); + #endif if (ferror(fp)) { sprintf(ErrorText, "Error in writing file %s", LocalName); message_DisplayString(sendmessage, 10, ErrorText); *************** *** 1384,1392 **** FILE *fin, *fout; int ct, ucode; struct ScribeState ScribeState; ams_CUI_GenLocalTmpFileName(ams_GetAMS(), TmpFileName); ! fin = fopen(FileName, "r"); if (!fin) return(-1); fout = fopen(TmpFileName, "w"); if (!fout) { --- 1411,1428 ---- FILE *fin, *fout; int ct, ucode; struct ScribeState ScribeState; + char MyName[1+MAXPATHLEN]; + int sameHost = ams_CUI_OnSameHost(ams_GetAMS()); ams_CUI_GenLocalTmpFileName(ams_GetAMS(), TmpFileName); ! if (!sameHost) { ! ams_CUI_GenTmpFileName(ams_GetAMS(), MyName); ! if (ams_CUI_GetFileFromVice(ams_GetAMS(), MyName, FileName)) { ! return(-1); ! } ! } ! else strcpy(MyName, FileName); ! fin = fopen(MyName, "r"); if (!fin) return(-1); fout = fopen(TmpFileName, "w"); if (!fout) { *************** *** 1401,1406 **** --- 1437,1444 ---- while ((ct = fread(LineBuf, sizeof(char), sizeof(LineBuf), fin)) > 0) { if (ams_UnScribe(ams_GetAMS(), ucode, &ScribeState, LineBuf, ct, fout) < 0) { fclose(fin); + if (!sameHost) + unlink(MyName); fclose(fout); unlink(TmpFileName); return(-3); *************** *** 1408,1413 **** --- 1446,1453 ---- } if (ams_UnScribeFlush(ams_GetAMS(), ucode, &ScribeState, fout)) { fclose(fin); + if (!sameHost) + unlink(MyName); fclose(fout); unlink(TmpFileName); return(-4); *************** *** 1417,1423 **** unlink(TmpFileName); return(-5); } ! rename(TmpFileName, FileName); return(0); } --- 1457,1471 ---- unlink(TmpFileName); return(-5); } ! if (!sameHost) { ! /* should do some more error checking here */ ! ams_MS_UnlinkFile(ams_GetAMS(),FileName); ! ams_CUI_StoreFileToVice(ams_GetAMS(),TmpFileName,FileName); ! unlink(MyName); ! unlink(TmpFileName); ! } else { ! rename(TmpFileName, FileName); ! } return(0); } *** atkams/messages/lib/stubs.c Fri Jan 12 13:40:58 1990 --- atkams/messages/lib/stubs.c.NEW Wed Apr 3 21:24:17 1991 *************** *** 421,426 **** --- 421,427 ---- } return; } + #ifdef S_IFLNK if ((stbuf.st_mode & S_IFMT) == S_IFLNK) { int len; fputs(" is a symbolic link ", fp); *************** *** 431,437 **** Buffer[len] = '\0'; /* I can't believe the lstat implementors didn't do this... */ fprintf(fp, "to the file %s.\n", Buffer); } ! } else { if ((stbuf.st_mode & S_IFMT) == S_IFDIR) { fputs(" is not a symbolic link.\n", fp); } else { --- 432,440 ---- Buffer[len] = '\0'; /* I can't believe the lstat implementors didn't do this... */ fprintf(fp, "to the file %s.\n", Buffer); } ! } else ! #endif /* S_IFLNK */ ! { if ((stbuf.st_mode & S_IFMT) == S_IFDIR) { fputs(" is not a symbolic link.\n", fp); } else { *************** *** 1001,1012 **** char *prompt, *buf; int len, IsPassword; { ! /* BOGUS -- There should be some way to inhibit echoing if IsPassword */ ! if (message_AskForString(im_GetLastUsed(), 50, prompt, NULL, buf, len) < 0) { ! *buf = '\0'; ! return(-1); } ! return(0); } char *BalancedQuote(qstring) --- 1004,1027 ---- char *prompt, *buf; int len, IsPassword; { ! char *new_prompt = malloc(strlen(prompt) + 3); ! int retval = 0; ! ! strcpy(new_prompt,prompt); ! strcat(new_prompt," ? "); ! if (IsPassword) { ! if (message_AskForPasswd(im_GetLastUsed(), 50, new_prompt, NULL, buf, len) < 0) { ! *buf = '\0'; ! retval = -1; ! } ! } else { ! if (message_AskForString(im_GetLastUsed(), 50, new_prompt, NULL, buf, len) < 0) { ! *buf = '\0'; ! retval = -1; ! } } ! free(new_prompt); ! return(retval); } char *BalancedQuote(qstring) *** atkams/messages/lib/text822v.c Wed Nov 22 12:44:32 1989 --- atkams/messages/lib/text822v.c.NEW Sat Apr 27 02:06:50 1991 *************** *** 2,7 **** --- 2,8 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + #include #include #include #include *** atkams/messages/lib/fldtreev.c Fri Dec 21 15:00:50 1990 --- atkams/messages/lib/fldtreev.c.NEW Wed Apr 3 21:24:19 1991 *************** *** 1,5 **** - #include #include #include #include #include --- 1,5 ---- #include + #include #include #include #include *************** *** 34,40 **** static struct bind_Description foldertreev_standardbindings [] = { {"foldertreev-delete-window", "\030\004", NULL, "Delete Window~89", NULL, 0, QuitFolderTree, "exit folder tree"}, {"foldertreev-quit", "\030\003", NULL, "Quit~99", NULL, 0, QuitMessagesProc, "exit messages process"}, ! NULL }; boolean --- 34,40 ---- static struct bind_Description foldertreev_standardbindings [] = { {"foldertreev-delete-window", "\030\004", NULL, "Delete Window~89", NULL, 0, QuitFolderTree, "exit folder tree"}, {"foldertreev-quit", "\030\003", NULL, "Quit~99", NULL, 0, QuitMessagesProc, "exit messages process"}, ! {NULL,NULL,0,NULL,0,0,NULL,NULL,NULL} }; boolean *** atkams/messages/scripts/Imakefile Wed Nov 29 15:29:47 1989 --- atkams/messages/scripts/Imakefile.NEW Thu Apr 4 17:44:16 1991 *************** *** 10,25 **** LINKS = messages sendmessage ! InstallFileToFile(msgsn.csh,${INSTPROGFLAGS},${DESTDIR}/bin/messagesn) ! InstallFileToFile(sendmsgn.csh,${INSTPROGFLAGS},${DESTDIR}/bin/sendmessagen) ! InstallFileToFile(sendmsg.csh,${INSTPROGFLAGS},${DESTDIR}/bin/sendmessage) #ifdef SNAP_ENV ! InstallFileToFile(msgss.csh,${INSTPROGFLAGS},${DESTDIR}/bin/messagess) ! InstallFileToFile(sendmsgs.csh,${INSTPROGFLAGS},${DESTDIR}/bin/sendmessages) #endif /* SNAP_ENV */ ! InstallFileToFile(readmail.csh,${INSTPROGFLAGS},${DESTDIR}/bin/readmail) ! InstallFileToFile(sendmail.sh,${INSTPROGFLAGS},${DESTDIR}/bin/sendmail) ! InstallFileToFile(sendnews.sh,${INSTPROGFLAGS},${DESTDIR}/bin/sendnews) InstallLink(runapp, ${DESTDIR}/bin/messages) --- 10,26 ---- LINKS = messages sendmessage ! ! InstallShScript(msgsn.csh, ${DESTDIR}/bin/messagesn) ! InstallShScript(sendmsgn.csh, ${DESTDIR}/bin/sendmessagen) ! InstallShScript(sendmsg.csh, ${DESTDIR}/bin/sendmessage) #ifdef SNAP_ENV ! InstallShScript(msgss.csh, ${DESTDIR}/bin/messagess) ! InstallShScript(sendmsgs.csh, ${DESTDIR}/bin/sendmessages) #endif /* SNAP_ENV */ ! InstallShScript(readmail.csh,${DESTDIR}/bin/readmail) ! InstallShScript(sendmail.sh,${DESTDIR}/bin/sendmail) ! InstallShScript(sendnews.sh,${DESTDIR}/bin/sendnews) InstallLink(runapp, ${DESTDIR}/bin/messages) *** contrib/Imakefile Fri Dec 21 15:00:52 1990 --- contrib/Imakefile.NEW Mon Apr 15 15:33:05 1991 *************** *** 4,8 **** EATMAIL = eatmail #endif /* AMS_ENV */ ! SUBDIRS = compress hyplink wpedit ltext m3text \ ! mtext ptext rctext rmtext tm time $(EATMAIL) --- 4,9 ---- EATMAIL = eatmail #endif /* AMS_ENV */ ! SUBDIRS = compress demos wpedit ltext m3text \ ! mtext ptext rctext rmtext tm time $(EATMAIL) \ ! mit *** contrib/demos/Imakefile Fri Feb 22 12:41:51 1991 --- contrib/demos/Imakefile.NEW Thu May 16 16:15:10 1991 *************** *** 0 **** --- 1,4 ---- + #define IHaveSubdirs + + SUBDIRS = circlepi + *** contrib/demos/circlepi/Imakefile Fri Feb 22 12:42:19 1991 --- contrib/demos/circlepi/Imakefile Tue Dec 4 15:44:46 1990 *************** *** 0 **** --- 1,18 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DOBJS = circpiv.do \ + circpi.do + + IHFILES = circpiv.ih \ + circpi.ih + + INCDIR = $(DESTDIR)/include/atk + + NormalObjectRule() + NormalATKRule() + DependTarget() + + InstallDocs(circpi.help, $(DESTDIR)/help) + InstallClassFiles($(DOBJS), $(IHFILES)) *** contrib/demos/circlepi/circpi.c Fri Feb 22 12:42:19 1991 --- contrib/demos/circlepi/circpi.c Tue Dec 4 15:44:47 1990 *************** *** 0 **** --- 1,66 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + + /* External declarations */ + + /* Forward Declarations */ + + /* Global variables */ + + + boolean + circlepi__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + return(TRUE); + } + + + boolean + circlepi__InitializeObject(c, self) + struct classheader *c; + struct circlepi *self; + { + /* + Inititialize the object instance data. + */ + self->depth_limit = 4; + return(TRUE); + } + + + void + circlepi__FinalizeObject(c, self) + struct classheader *c; + struct circlepi *self; + { + /* + Finalize the object instance data. + */ + return; + } + + + void + circlepi__SetDepth(self, limit) + struct circlepi *self; + int limit; + { + if (self->depth_limit != limit) { + self->depth_limit = limit; + circlepi_NotifyObservers(self, observable_OBJECTCHANGED); + } + } *** contrib/demos/circlepi/circpi.ch Fri Feb 22 12:42:19 1991 --- contrib/demos/circlepi/circpi.ch Tue Dec 4 15:44:48 1990 *************** *** 0 **** --- 1,18 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + class circlepi[circpi]: dataobject[dataobj] { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct circlepi *self) returns boolean; + FinalizeObject(struct circlepi *self); + methods: + SetDepth(int limit); + macromethods: + GetDepth() (self->depth_limit) + data: + int depth_limit; + }; + *** contrib/demos/circlepi/circpi.help Fri Feb 22 12:42:19 1991 --- contrib/demos/circlepi/circpi.help Tue Dec 4 15:44:49 1990 *************** *** 0 **** --- 1,97 ---- + \begindata{text,268730800} + \textdsversion{12} + \template{help} + \chapter{Circle pi: an ATK inset for estimating pi + + } + \section{What circlepi is + + }\leftindent{ + Circle pi is an ATK inset which graphically displays the recursive progress of + an algorithm for estimating the value of pi. It runs in color on color + displays. + + } + \section{Starting circlepi + + }\leftindent{ + You can start a Circle pi by inserting into an ATK document, like any other + inset. Specifically, in a text document, type \bold{ }, and answer + the prompt at the bottom of the screen for the name of the inset with + "\typewriter{circlepi}". A Circle pi inset will appear at the insertion point + of your document, and estimate the value of pi. + + } + \section{Warnings + + }\leftindent{ + You can set the recursion level of Circle pi through the Depth Limit menu. + Since ATK is not multi-threaded, asking Circle pi to deeply recurse means + that you will tie up the process which holds Circle pi until it Circle pi + finishes redrawing itself. Each level requires three times the computation of + the previous level, so jumping four levels takes 81 times as long to compute! + + } + \section{Pop-up menu meanings + + }\leftindent{ + The Depth Limit menu allows you to choose how deep Circle pi will recurse in + its computation. Levels > 7 can take a long time to compute, but will yield + more accurate results. + + } + \section{How circlepi works + + }\leftindent{ + Circle pi attempts to measure the area inside and outside of a circle + recursively. It starts with the center point of a unit square, and tests that + point: + + \center{\ + \begindata{eq,268763152} + { lpile d_eqstyle { root { x sup { 2 } + y sup { 2 } } < r sup { 2 } , thick r = 1 } } \enddata{eq,268763152} + \view{eqview,268763152,0,170,0} + }to determine whether it lies within or outside of the perimeter of the + circle. If it is inside, the northwest quadrant's area is added to the inside + sum, and the algorithm recurses on the southeast quadrant. If it is outside, + the southeast quadrant's area is added to the outside sum, and the algorithm + recurses on the northwest quadrant. Recursion on the northeast and + southwestern quadrants are also performed. + + + Since we now have two estimates of the area of the circle (one from the + inside, and one from the outside), we can estimate pi as follows: + + \center{\ + \begindata{eq,268812852} + { lpile d_eqstyle { pi = 4 * { cpile { A } over { r sup { 2 } } } , } } \enddata{eq,268812852} + \view{eqview,268812852,1,102,0} + }where \italic{A} is the inside or outside area we've measured, and \italic{r} + is the radius of the circle (or one in our case). We multiply by four since + we're only measuring a quarter circle. + + + What this algorithm also gives us is a measurement of how much we don't know, + and this value can be used to determine the error in our estimate. + + } + \section{Program Author} + + \leftindent{ + }\leftindent{Michael McInerny, + + Information Technology Center + + } + \section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{insets + + eq + + }\enddata{text,268730800} *** contrib/demos/circlepi/circpiv.c Fri Feb 22 12:42:19 1991 --- contrib/demos/circlepi/circpiv.c Tue Dec 4 15:44:50 1990 *************** *** 0 **** --- 1,281 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + + /* External Declarations */ + + /* Forward Declarations */ + static void LimitProc(); + + /* Global Variables */ + static struct menulist *menulist = NULL; + + + boolean + circlepiview__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + struct proctable_Entry *proc = NULL; + char menubuf[80]; + int i; + + if ((menulist = menulist_New()) == NULL) return(FALSE); + + if ((proc = proctable_DefineProc("circpi-set-depth-limit", LimitProc, &circlepiview_classinfo, NULL, "Takes the integer rock and uses it to set the depth limit on recursion.")) == NULL) return(FALSE); + for (i = 1; i <= 10; ++i) { + sprintf(menubuf, "Depth Limit~10,%d~%d", i, i); + menulist_AddToML(menulist, menubuf, proc, (long)i, 0); + } + + return(TRUE); + } + + + boolean + circlepiview__InitializeObject(c, self) + struct classheader *c; + struct circlepiview *self; + { + /* + Set up the data for each instance of the object. + */ + if (!(self->cursor = cursor_Create(self))) return(FALSE); + cursor_SetStandard(self->cursor, Cursor_Gunsight); + self->color = 0; /* assume monochrome, for now */ + self->ml = menulist_DuplicateML(menulist, self); + + return(TRUE); + } + + + void + circlepiview__FinalizeObject(c, self) + struct classheader *c; + struct circlepiview *self; + { + if (self->cursor) cursor_Destroy(self->cursor); + self->cursor = NULL; + return; + } + + + void + circlepiview__ObservedChanged(self, b, v) + struct circlepiview *self; + struct circlepi *b; + long v; + { + super_ObservedChanged(self, b, v); + if (v == observable_OBJECTCHANGED) { + self->need_full_update = TRUE; + circlepiview_WantUpdate(self, self); + } + } + + + void + circlepiview__PostMenus(self, ml) + struct circlepiview *self; + struct menulist *ml; + { + /* + Enable the menus for this object. + */ + + menulist_ClearChain(self->ml); + if (ml) menulist_ChainAfterML(self->ml, ml, ml); + super_PostMenus(self, self->ml); + } + + + void + circlepiview__LinkTree(self, parent) + struct circlepiview *self; + struct view *parent; + { + super_LinkTree(self, parent); + + if (circlepiview_GetIM(self) != NULL) { + if (circlepiview_DisplayClass(self) & graphic_Color) { + self->color = 1; + } else { + self->color = 0; + } + } + } + + + void + circlepiview__FullUpdate(self, type, left, top, width, height) + struct circlepiview *self; + enum view_UpdateType type; + long left, top, width, height; + { + /* + Do an update. + */ + + if ((type == view_FullRedraw) || (type == view_LastPartialRedraw)) { + self->need_full_update = TRUE; + circlepiview_WantUpdate(self, self); + } + } + + int inside_circle(x,y) + double x,y; + { + return((x*x + y*y) <= 1.0); + } + + + + static void step(self, x, y, side, inside, outside, depth, depth_limit) + struct circlepiview *self; + double x, y, side; + double *inside, *outside; + int depth, depth_limit; + { + struct rectangle vbounds, fill; + struct graphic *tile; + + circlepiview_GetVisualBounds(self, &vbounds); + if (depth < depth_limit) { + if (inside_circle(x, y)) { + *inside += (side*side)/(double)(4.0); + if (self->color) { + circlepiview_SetFGColor(self, 0.0, 0.0, 1.0); + circlepiview_SetTransferMode(self, graphic_COPY); + tile = NULL; + } else { + tile = circlepiview_GrayPattern(self, 2, 2); + } + + fill.left = vbounds.left + (long)((x-side/(double)(2.0))*(double)(vbounds.width) + (double)(0.5)); + fill.top = vbounds.top + (long)((y-side/(double)(2.0))*(double)(vbounds.height) + (double)(0.5)); + fill.width = (long)((double)(vbounds.width) * side/(double)(2.0) + (double)(0.5)); + fill.height = (long)((double)(vbounds.height) * side/(double)(2.0)+ (double)(0.5)); + circlepiview_FillRect(self, &fill, tile); + + /* recurse on NE quadrant */ + step(self, x+side/(double)(4.0), y+side/(double)(4.0), side/(double)(2.0), inside, outside, depth+1, depth_limit); + } else { + *outside += (side*side)/(double)(4.0); + if (self->color) { + circlepiview_SetFGColor(self, 1.0, 0.0, 0.0); + circlepiview_SetTransferMode(self, graphic_COPY); + tile = NULL; + } else { + tile = circlepiview_GrayPattern(self, 0, 2); + } + fill.left = vbounds.left + (long)(x*(double)(vbounds.width) + (double)(0.5)); + fill.top = vbounds.top + (long)(y*(double)(vbounds.height) + (double)(0.5)); + fill.width = (long)((double)(vbounds.width) * side/(double)(2.0) + (double)(0.5)); + fill.height = (long)((double)(vbounds.height) * side/(double)(2.0)+ (double)(0.5)); + circlepiview_FillRect(self, &fill, tile); + + /* recurse on SW quadrant */ + step(self, x-side/(double)(4.0), y-side/(double)(4.0), side/(double)(2.0), inside, outside, depth+1, depth_limit); + } + step(self, x-side/(double)(4.0), y+side/(double)(4.0), side/(double)(2.0), inside, outside, depth+1, depth_limit); + step(self, x+side/(double)(4.0), y-side/(double)(4.0), side/(double)(2.0), inside, outside, depth+1, depth_limit); + + } /* if (depth < depth_limit) */ + + return; + } + + + void + circlepiview__Update(self) + struct circlepiview *self; + { + /* + Redisplay this object. + */ + struct circlepi *b = (struct circlepi *) circlepiview_GetDataObject(self); + struct graphic *tile; + struct rectangle vbounds; + double inside = 0.0, outside = 0.0; + char msg[80]; + + if (self->need_full_update) { + circlepiview_EraseVisualRect(self); + if (self->color) { + circlepiview_SetFGColor(self, 0.0, 1.0, 0.0); + circlepiview_SetTransferMode(self, graphic_COPY); + tile = NULL; + } else { + tile = circlepiview_GrayPattern(self, 1, 2); + } + circlepiview_GetVisualBounds(self, &vbounds); + circlepiview_FillRect(self, &vbounds, tile); + + step(self, 0.5, 0.5, 1.0, &inside, &outside, 0, circlepi_GetDepth(b)); + + sprintf(msg, "pi, inside: %f; outside: %f; unknown: %3f%%.", + inside * 4.0, + (1.0 - outside) * 4.0, + (1.0 - (inside + outside))/1.0*100.0); + message_DisplayString(self, 1, msg); + + self->need_full_update = FALSE; + } else { + /* compute delta */ + } + } + + + + struct view * + circlepiview__Hit(self, action, x, y, numclicks) + struct circlepiview *self; + long x, y; + enum view_MouseAction action; + long numclicks; + { + /* + Handle the button event. Currently, semantics are: + left up -- receive input focus (to post menus) + */ + struct circlepi *b = (struct circlepi *) circlepiview_GetDataObject(self); + + switch (action) { + case view_LeftUp: + circlepiview_WantInputFocus(self,self); + break; + default: + break; + } + return((struct view *)self); + } + + + static void + LimitProc(self, param) + struct circlepiview *self; + long param; + { + struct circlepi *c = (struct circlepi *)circlepiview_GetDataObject(self); + + circlepi_SetDepth(c, param); + } *** contrib/demos/circlepi/circpiv.ch Fri Feb 22 12:42:20 1991 --- contrib/demos/circlepi/circpiv.ch Tue Dec 4 15:44:51 1990 *************** *** 0 **** --- 1,24 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + class circlepiview[circpiv]: view { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct circlepiview *self) returns boolean; + FinalizeObject(struct circlepiview *self); + overrides: + ObservedChanged (struct observable *changed, long value); + LinkTree(struct view *parent); + FullUpdate(enum view_UpdateType type, long left, long top, long width, long height); + Update(); + Hit (enum view_MouseAction action, long x, long y, long numberOfClicks) returns struct view *; + PostMenus(struct menulist *ml); + data: + int need_full_update; + struct cursor *cursor; + int color; + struct menulist *ml; + }; + *** contrib/ltext/ltext.c Wed Nov 22 12:45:58 1989 --- contrib/ltext/ltext.c.NEW Sun May 5 18:55:41 1991 *************** *** 4,11 **** \* ********************************************************************** */ /* LText, a ``Lisp'' mode for BE2. */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/ltext/RCS/ltext.c,v 2.9 89/08/21 13:09:40 zs01 Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/ltext/RCS/ltext.c,v $ */ #include #include /* strings.h */ --- 4,11 ---- \* ********************************************************************** */ /* LText, a ``Lisp'' mode for BE2. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/ltext/RCS/ltext.c,v 2.10 1991/05/05 22:45:19 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/ltext/RCS/ltext.c,v $ */ #include #include /* strings.h */ *************** *** 12,17 **** --- 12,18 ---- #include #include + #include #include #include #include *************** *** 765,779 **** boolean ltext__InitializeClass(classID) struct classheader *classID; { ! addindent("defun", 2); ! addindent("defmacro", 2); ! addindent("defconstant", 1); ! addindent("defstruct", 1); ! addindent("let", 1); ! addindent("let*", 1); ! addindent("do", 2); ! addindent("if", 1); proctable_DefineProc("ltext-add-indent", addindent, NULL, "ltext", "Sets the number of args to indent normally."); return TRUE; --- 766,782 ---- boolean ltext__InitializeClass(classID) struct classheader *classID; { ! int indent; ! char *t, *t2, *s = environ_GetProfile("ltextindents"); + if (!s) s = "defun:2,defmacro:2,defconstant:1,defstruct:1,let:1,let*:1,do:2,if:1"; + while (isspace(*s)) ++s; + while (t = s) { + if (s = index(t, ',')) *s++ = NULL; + if (t2=index(t, ':')) *t2++=NULL; + addindent(t, t2 ? atoi(t2) : 1); + } + proctable_DefineProc("ltext-add-indent", addindent, NULL, "ltext", "Sets the number of args to indent normally."); return TRUE; *** contrib/m3text/m3textv.c Fri Dec 21 15:01:23 1990 --- contrib/m3text/m3textv.c.NEW Tue Dec 4 09:04:13 1990 *************** *** 3,16 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3textv.c,v 1.6 90/09/12 14:35:16 gk5g Exp $ */ /* M3textView, a ``Modula-3'' mode for BE2. */ #include - #include "class.h" #include #include "im.ih" #include "message.ih" --- 3,16 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3textv.c,v 1.7 90/11/28 14:58:40 susan Exp $ */ /* M3textView, a ``Modula-3'' mode for BE2. */ #include #include + #include "class.h" #include "im.ih" #include "message.ih" *************** *** 33,39 **** #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3textv.c,v 1.6 90/09/12 14:35:16 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; --- 33,39 ---- #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3textv.c,v 1.7 90/11/28 14:58:40 susan Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; *** contrib/rmtext/rmtextv.c Fri Dec 21 15:01:25 1990 --- contrib/rmtext/rmtextv.c.NEW Tue Dec 4 09:04:28 1990 *************** *** 2,16 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.6 90/09/12 14:42:56 gk5g Exp $ */ /* $ACIS:rmtextview.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v $ */ /* RMtextView, a ``Modula-2'' mode for BE2. (R-> Rochester contribution) */ #include #include "class.h" - #include #include "im.ih" #include "message.ih" --- 2,17 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.7 90/11/28 14:59:25 susan Exp $ */ /* $ACIS:rmtextview.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v $ */ /* RMtextView, a ``Modula-2'' mode for BE2. (R-> Rochester contribution) */ + + #include #include #include "class.h" #include "im.ih" #include "message.ih" *************** *** 33,39 **** #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.6 90/09/12 14:42:56 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; --- 34,40 ---- #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.7 90/11/28 14:59:25 susan Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; *** contrib/time/timeodayv.c Mon Aug 6 11:12:45 1990 --- contrib/time/timeodayv.c.NEW Wed Jan 30 17:08:36 1991 *************** *** 182,193 **** void timeodayview__Print(self, file, processor, finalFormat, topLevel) ! struct timeodayview *self; ! FILE *file; ! char *processor, *finalFormat; ! boolean topLevel; { ! fprintf(file, "%s\n", timeoday_GetTod((struct timeoday *) timeodayview_GetDataObject(self))); } --- 182,203 ---- void timeodayview__Print(self, file, processor, finalFormat, topLevel) ! struct timeodayview *self; ! FILE *file; ! char *processor, *finalFormat; ! boolean topLevel; { ! char *time_str; ! struct timeoday *time_do = (struct timeoday *) timeodayview_GetDataObject(self); ! ! time_str = timeoday_GetTod(time_do); ! ! if (time_str == NULL) { ! fprintf(stderr, "?timeodayview_Print: there doesn't appear to be any formatted time string.\n"); ! fprintf(file, "\n"); ! } else { ! fprintf(file, "%s\n", time_str); ! } } *** contrib/tm/tm.c Fri Dec 21 15:01:28 1990 --- contrib/tm/tm.c.NEW Mon Jun 10 14:05:40 1991 *************** *** 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/projects/andrew/contrib/tm/RCS/tm.c,v 2.23 90/12/07 13:43:24 gk5g Exp $ */ /* $ACIS:tm.c 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.23 90/12/07 13:43:24 gk5g Exp $"; #endif /* lint */ #include --- 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/projects/andrew/contrib/tm/RCS/tm.c,v 2.25 1991/06/10 17:28:35 gk5g Exp $ */ /* $ACIS:tm.c 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.25 1991/06/10 17:28:35 gk5g Exp $"; #endif /* lint */ #include *************** *** 41,46 **** --- 41,56 ---- #define CBREAK 0 #endif /* hpux */ + #ifdef M_UNIX + #include + #include + #include + #include + #define CRMOD O_CRMOD + #define RAW O_RAW + #define CBREAK O_CBREAK + #endif + extern int errno; extern char *sys_errlst[]; *************** *** 745,750 **** --- 755,769 ---- self->height=mh; } + #ifdef M_UNIX + { + char buf[80]; + sprintf(buf,"LINES=%d",mh); + putenv(buf); + sprintf(buf,"COLS=%d",mw); + putenv(buf); + } + #else if(self->ptyFile!=NULL){ struct winsize ws; ws.ws_row=height; *************** *** 752,757 **** --- 771,777 ---- if(ioctl(fileno(self->ptyFile),TIOCSWINSZ,&ws)<0) SYSERROR("SetDispSize(ioctl)"); } + #endif self->dispWidth=width; self->dispHeight=height; *************** *** 955,960 **** --- 975,981 ---- (/*fprintf(stderr,"Out of TIOCREMOTE mode.\n"),*/self->remote--,TRUE))) #endif /* INCORRECTSIGNALS */ #else /* !defined(hpux) && !defined(_IBMR2) */ + #if !defined(M_UNIX) #define ENTER_TIOCREMOTE(self) \ (self->remote || \ ((ioctl(fileno(self->ptyFile),_IOW(t,TIOCREMOTE&0xff,int),&ON)!=-1 || \ *************** *** 969,976 **** ioctl(fileno(self->ptyFile),_IO(t,TIOCREMOTE&0xff),OFF)!=-1) && \ (/*fprintf(stderr,"Out of TIOCREMOTE mode.\n"),*/self->remote--,TRUE))) #endif /* INCORRECTSIGNALS */ ! #endif /* defined(hpux) || defined(_IBMR2)*/ int termulator__StartProcess(self,args) struct termulator *self; char **args; --- 990,1004 ---- ioctl(fileno(self->ptyFile),_IO(t,TIOCREMOTE&0xff),OFF)!=-1) && \ (/*fprintf(stderr,"Out of TIOCREMOTE mode.\n"),*/self->remote--,TRUE))) #endif /* INCORRECTSIGNALS */ ! #else /* defined(hpux) || defined(_IBMR2)*/ ! #define ENTER_TIOCREMOTE(self) + #ifndef INCORRECTSIGNALS + static int OFF=0; + #define LEAVE_TIOCREMOTE(self) + #endif /* INCORRECTSIGNALS */ + #endif /*M_UNIX */ + #endif /* defined(hpux) || defined(_IBMR2) */ int termulator__StartProcess(self,args) struct termulator *self; char **args; *************** *** 982,987 **** --- 1010,1016 ---- #ifdef TIOCSWINSZ struct winsize ws; #endif /* TIOCSWINSZ */ + char ptyname[64]; if(args==NULL) return -1; *************** *** 990,996 **** fprintf(stderr,"pid: %d, pgrp: %d\n",getpid(),getpgrp(0)); } */ ! #ifndef hpux { int fd=open("/dev/tty", 2); if(fd>=0){ --- 1019,1025 ---- fprintf(stderr,"pid: %d, pgrp: %d\n",getpid(),getpgrp(0)); } */ ! #if !(defined(POSIX_ENV) || defined(hpux)) { int fd=open("/dev/tty", 2); if(fd>=0){ *************** *** 1001,1007 **** } #endif /* hpux */ ! if (! GetPty(&pty, &slave)) { ERROR("Could not open any pty's"); return -1; } --- 1030,1036 ---- } #endif /* hpux */ ! if(!GetPtyandName(&pty, &slave, ptyname, sizeof(ptyname))) { ERROR("Could not open any pty's"); return -1; } *************** *** 1032,1040 **** --- 1061,1087 ---- if(pid == 0){ int pid; + #ifdef POSIX_ENV + int ptyChannel; + + /* Become a session leader. */ + if(setsid() < 0) + perror("setsid"); + /* Re-open the pty so that it becomes the controlling terminal. + * NOTE: GetPtyandName must open the pty with the O_NOCTTY flag, + * otherwise the parent (typescript) process will have the controlling + * terminal and we (the shell) won't be able to get it. + */ + if((ptyChannel = open(ptyname, O_RDWR)) < 0) { + fprintf(stderr, "Could not open %s.\n", ptyname); + exit(1); + } + close(ptyChannel); + #else #ifdef hpux setpgrp(); #endif /* hpux */ + #endif /* !POSIX_ENV */ pid=getpid(); close(pty); close(0); *************** *** 1042,1051 **** --- 1089,1104 ---- close(2); dup2(slave, 0); close(slave); + #ifdef POSIX_ENV + /* Set current terminal process group. */ + if(tcsetpgrp(0, pid) < 0) + perror("tcsetpgrp failed"); + #else #ifndef hpux ioctl(0,TIOCSPGRP,&pid); setpgrp(0,pid); #endif /* hpux */ + #endif /* POSIX_ENV */ dup(0); dup(0); environ_Put("TERM",termulator_GetTerm(self)); *************** *** 1462,1467 **** --- 1515,1547 ---- { int pgrp; + #ifdef POSIX_ENV + /* + * NOTE: we assume here that if you have a POSIX system, you also + * have an "ioctl" that lets you send a signal to the process + * group of the slave side of the pty. That is true for SunOS 4.1[.x] + * (TIOCSIGNAL), System V Release 4 (TIOCSIGNAL, although it takes + * the value of the signal, rather than a pointer to that value, + * as an argument), 4.3-reno and presumably 4.4BSD (TIOCSIG), and, + * I think, later versions of HP-UX. + */ + #ifdef TIOCSIGNAL + #if defined(sys_sun3_41) || defined(sys_sun4_41) + /* SunOS 4.1[.x] */ + if(ioctl(fileno(self->ptyFile),TIOCSIGNAL,&signo)<0) + SYSERROR("Signal(ioctl)"); + #else /* defined(sys_sun3_41) || defined(sys_sun4_41) */ + /* SVR4 */ + if(ioctl(fileno(self->ptyFile),TIOCSIGNAL,signo)<0) + SYSERROR("Signal(ioctl)"); + #endif /* defined(sys_sun3_41) || defined(sys_sun4_41) */ + #else /* TIOCSIGNAL */ + #ifdef TIOCSIG + if(ioctl(fileno(self->ptyFile),TIOCSIG,&signo)<0) + SYSERROR("Signal(ioctl)"); + #endif /* TIOCSIG */ + #endif /* TIOCSIGNAL */ + #else /* POSIX_ENV */ #ifdef hpux if (0) {} #else /* hpux */ *************** *** 1470,1475 **** --- 1550,1556 ---- #endif /* hpux */ else if(killpg(pgrp,signo)==-1) SYSERROR("Signal(kill)"); + #endif /* POSIX_ENV */ } char *termulator__GetTerm(self) *** contrib/tm/tm.ch Fri Dec 21 15:01:29 1990 --- contrib/tm/tm.ch.NEW Wed Jan 30 17:09:07 1991 *************** *** 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/projects/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp Locker: gk5g $ */ /* $ACIS:tm.ch 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtermulator_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp Locker: gk5g $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* --- 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/projects/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp $ */ /* $ACIS:tm.ch 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtermulator_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *** contrib/tm/tm19.c Wed Nov 22 12:47:59 1989 --- contrib/tm/tm19.c.NEW Wed Jan 30 17:09:13 1991 *************** *** 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/contrib/tm/RCS/tm19.c,v 2.5 89/02/17 17:36:58 ghoti Exp $ */ /* $ACIS:tm19.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tm19.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tm19.c,v 2.5 89/02/17 17:36:58 ghoti 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/projects/andrew/contrib/tm/RCS/tm19.c,v 2.5 89/02/17 17:36:58 ghoti Exp $ */ /* $ACIS:tm19.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm19.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm19.c,v 2.5 89/02/17 17:36:58 ghoti Exp $"; #endif /* lint */ /* *** contrib/tm/tma.c Fri Dec 21 15:01:31 1990 --- contrib/tm/tma.c.NEW Wed Jan 30 17:09:16 1991 *************** *** 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/projects/andrew/contrib/tm/RCS/tma.c,v 2.6 90/09/12 14:53:50 gk5g Exp $ */ /* $ACIS:tma.c 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tma.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tma.c,v 2.6 90/09/12 14:53:50 gk5g Exp $"; #endif /* lint */ #include --- 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/projects/andrew/contrib/tm/RCS/tma.c,v 2.6 90/09/12 14:53:50 gk5g Exp $ */ /* $ACIS:tma.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tma.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tma.c,v 2.6 90/09/12 14:53:50 gk5g Exp $"; #endif /* lint */ #include *** contrib/tm/tma.ch Wed Nov 22 12:47:55 1989 --- contrib/tm/tma.ch.NEW Wed Jan 30 17:09:20 1991 *************** *** 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/contrib/tm/RCS/tma.ch,v 2.6 89/02/20 13:04:42 ghoti Exp $ */ /* $ACIS:tma.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tma.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtmapp_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tma.ch,v 2.6 89/02/20 13:04:42 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ class tmapp[tma] : application[app] { --- 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/projects/andrew/contrib/tm/RCS/tma.ch,v 2.6 89/02/20 13:04:42 ghoti Exp $ */ /* $ACIS:tma.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tma.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtmapp_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tma.ch,v 2.6 89/02/20 13:04:42 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ class tmapp[tma] : application[app] { *** contrib/tm/tmv.c Wed Nov 22 12:48:02 1989 --- contrib/tm/tmv.c.NEW Tue Apr 2 19:38:16 1991 *************** *** 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/contrib/tm/RCS/tmv.c,v 2.7 89/02/24 09:36:12 ghoti Exp $ */ /* $ACIS:tmv.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tmv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tmv.c,v 2.7 89/02/24 09:36:12 ghoti Exp $"; #endif /* lint */ #include --- 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/projects/andrew/contrib/tm/RCS/tmv.c,v 2.8 91/04/02 17:14:02 susan Exp $ */ /* $ACIS:tmv.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tmv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tmv.c,v 2.8 91/04/02 17:14:02 susan Exp $"; #endif /* lint */ #include *************** *** 36,42 **** #include #include ! #ifdef hpux #define CBREAK 0 #endif /* hpux */ --- 36,42 ---- #include #include ! #if defined(hpux) || defined(M_UNIX) #define CBREAK 0 #endif /* hpux */ *** contrib/wpedit/Imakefile Fri Dec 21 15:01:32 1990 --- contrib/wpedit/Imakefile.NEW Fri Dec 21 17:35:10 1990 *************** *** 5,15 **** #ifdef AMS_DELIVERY_ENV #ifdef WHITEPAGES_ENV - #ifdef RESOLVER_ENV - RESOLVER_LIB = $(RESOLVLIB) - #else - RESOLVER_LIB = - #endif /* RESOLVER_ENV */ IHFILES = wpedita.ih --- 5,10 ---- *************** *** 16,25 **** DOBJS = wpedita.do LIBS = ${BASEDIR}/lib/libwpi.a \ ! ${BASEDIR}/lib/libmail.a \ ! ${UTILLIB} \ ! ${PRSLIB} \ ! ${RESOLVER_LIB} DOCS = wpedit.help --- 11,19 ---- DOBJS = wpedita.do LIBS = ${BASEDIR}/lib/libwpi.a \ ! ${BASEDIR}/lib/libmail.a \ ! ${UTILLIB} \ ! ${PRSLIB} DOCS = wpedit.help *** contrib/eatmail/Imakefile Wed Sep 26 16:11:16 1990 --- contrib/eatmail/Imakefile.NEW Tue Apr 2 19:38:21 1991 *************** *** 9,15 **** NormalObjectRule() ! ProgramTarget(eatmail, ${OBJS}, ${LIBS} , ) DependTarget() --- 9,15 ---- NormalObjectRule() ! ProgramTarget(eatmail, ${OBJS}, ${LIBS} , ${NETLIBS}) DependTarget() *** contrib/eatmail/eatmail.c Wed Sep 26 16:11:21 1990 --- contrib/eatmail/eatmail.c.NEW Tue Apr 2 19:38:23 1991 *************** *** 333,338 **** --- 333,339 ---- if ((buffer[0] == AMS_SeparatingCharacter) && (AnyWrittenToThisOne != 0)) { ReadyToStartAgain = 1; } else { + if (!AMS_DeleteLinesWithSeparator || buffer[0] != AMS_SeparatingCharacter) { if (writeall(wfd, buffer, strlen(buffer)) != strlen(buffer)) { errsave = errno; close(wfd); *************** *** 341,346 **** --- 342,348 ---- } AnyWrittenToThisOne = 1; ReadyToStartAgain = 0; + } } } else if (!AnyWrittenToThisOne && strncmp(buffer, "From ", 5) == 0) { /* UNIX From lines make sendmail barf on re-send, so we pre-empt by rewriting them here with a patch from Lennart Lovstrand. The format of a "From " line is: "From [remote from ]" There is a chance sender will contain spaces (enclosed in quotes or escaped by backslash), so we can't just index on a space. */ *** contrib/mit/Imakefile Tue May 21 14:38:18 1991 --- contrib/mit/Imakefile.NEW Thu May 30 18:43:03 1991 *************** *** 0 **** --- 1,3 ---- + #define IHaveSubdirs + + SUBDIRS = annot util *** contrib/mit/util/Imakefile Thu May 30 20:29:20 1991 --- contrib/mit/util/Imakefile.NEW Thu May 30 18:43:14 1991 *************** *** 0 **** --- 1,24 ---- + DOBJS = compat.do vutils.do popts.do headrtv.do header.do strinput.do + + IHFILES = compat.ih vutils.ih popts.ih headrtv.ih header.ih strinput.ih + + NormalObjectRule() + NormalATKRule() + NormalHelpRule() + + DynamicObject(vutils, ${UTILLIB},) + + ProgramTarget(ez2ascii, ez2ascii.o, ${BASEDIR}/lib/libmail.a ${UTILLIB},) + + InstallClassFiles($(DOBJS), ${IHFILES}) + + /* DynamicObject(popts.do, ${BASEDIR}/lib/libapt.a, ) */ + InstallFile(ez2ps, $(INSTPROGFLAGS), $(DESTDIR)/bin) + InstallProgram(ez2ascii, ${DESTDIR}/bin/) + + InstallDocs(ez2ascii.help ez2ps.help headertxt.help, $(DESTDIR)/help) + + InstallHelpAlias(ez2ps, ez-postscript ez-ps) + InstallHelpAlias(headertxt, header footer headers footers) + + DependTarget() *** contrib/mit/util/compat.c Thu May 30 20:29:31 1991 --- contrib/mit/util/compat.c.NEW Thu May 30 18:43:21 1991 *************** *** 0 **** --- 1,794 ---- + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/compat.c,v 1.1 91/04/02 19:33:33 gk5g Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/compat.c,v $ */ + /* $Author: gk5g $ */ + + #ifndef lint + static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/compat.c,v 1.1 91/04/02 19:33:33 gk5g Exp $"; + #endif /* lint */ + + /************************************************* + * GNU Emacs Compatiblity package. + *************************************************/ + + /************************************************* + * Copyright (C) 1990 by the Massachusetts Institute of Technology + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby + * granted without fee, provided that the above copyright notice + * appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, + * and that the name of M.I.T. not be used in advertising or + * publicity pertaining to distribution of the software without + * specific, written prior permission. M.I.T. makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + *************************************************/ + + /* Contains the following functions to make ez compatible with */ + /* GNU Emacs: */ + + /* Fill Paragraph: Removes hard newlines within a paragraph */ + + #include + + #include + + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + + #define DIALOG 100 + #define MESSAGE 0 + + /* Routines appear in this file in "bottom-up" order. */ + /* This is so I don't have to deal with declaring forward */ + /* references. */ + + /* Added friendly read-only behavior from txtvcmds.c */ + + static boolean ConfirmReadOnly(self, txt) + struct textview *self; + struct text *txt; + { + if (text_GetReadOnly(txt)) { + message_DisplayString(self, 0, + "Document is read only."); + return TRUE; + } else + return FALSE; + } + + + /* Travel backward until we get a bonafide paragraph break. */ + /* Return buffer position of first character of this paragraph */ + /* First character is defined as first non-whitespace char */ + /* unless we are at the end of the buffer, in which case */ + /* we point at the end of the buffer even though it be whitespace */ + + int back_to_start (txt, pos) + struct text *txt; + int pos; + { + int cur; + + while (pos >=0 ) { + cur = text_GetChar(txt, pos); + if (cur == '\n') { + if (pos == 0) break; + else if (text_GetChar(txt, pos - 1) == '\n') + break; + else if (pos == text_GetLength (txt)) + break; + else if ((cur = text_GetChar(txt, pos + 1)) == '\t') + return (pos + 1); + else if (cur == ' ') return (pos + 1); + } + pos--; + } + /* Skip over newline if we're on it. */ + if (pos == text_GetLength (txt)) return ((pos>0) ? pos-1 : 0); + else if (text_GetChar(txt, pos) == '\n') return (pos + 1); + else return pos; + } + + /* Fill a paragraph.*/ + + /* This algorithm is careful to not damage an already filled */ + /* paragraph. */ + + /* Here is the paragraphing algorithm: */ + /* Backslash-newline is converted to a space */ + /* Lines that begin with whitespace are preceded by a newline. */ + /* Lines that contain tab or triple space after a non-white */ + /* character are preceded and followed by newlines. */ + /* An empty line is given a real newline before and after. */ + /* Sentence enders are : ; ? . ! If they occur at end of line,*/ + /* they will be followed by at least two blanks. */ + /* (Same if followed by quote or right parenthesis.) */ + + static void gcparafill (self, key) + struct textview *self; + long key; + { + struct text *txt = (struct text *)self->header.view.dataobject; + int pos, len, cur, npos, count, nextc, end; + int one_only = 0, modified = 0, found_table; + + if (ConfirmReadOnly(self, txt)) + return; + + pos = textview_GetDotPosition(self); + len = textview_GetDotLength(self); + + end = pos + len; + + if (len == 0) { + /* No region, fill current paragraph. */ + pos = back_to_start (txt, pos); + end = text_GetLength (txt); + len = end - pos; + one_only = 1; + } + + while (pos < end) { + /* for each newline */ + cur = text_GetChar(txt, pos); + if (cur == '\n') { + /* If this is the last char in the region */ + /* we're done */ + if (pos + 1 == end) + break; + /* keep newline preceded by newline */ + nextc = text_GetChar(txt, pos + 1); + if ((pos > 0) && (text_GetChar(txt, pos-1) == '\n')) { + pos++; + if (one_only) break; + } + /* or followed by tab (save char in cur for next else) */ + else if (nextc == '\t') { + pos++; + if (one_only) break; + } + /* or followed by space */ + else if (nextc == ' ') { + pos++; + if (one_only) break; + } + /* or followed by a newline */ + else if (nextc == '\n') { + pos++; + if (one_only) break; + } + /* replace backslash newline pair with a space */ + else if ((pos > 0) && + (text_GetChar(txt, pos-1) == '\\')) { + text_ReplaceCharacters(txt, pos-1, 2, " ", 1); + len--; + end--; + modified = 1; + } + else { + npos = pos + 1; + found_table = 0; + while ((npos <= end) && + ((cur = text_GetChar(txt, npos)) != '\n')){ + if ((cur == '\t') || + ((cur == ' ') && + (text_GetChar(txt, npos+1 ) == ' ') && + (text_GetChar(txt, npos+2 ) == ' '))) { + found_table = 1; + } + npos++; + } + if ((cur == '\n') && (found_table == 1)) { + /* we're in a table keep newline at pos */ + /* and process the one at npos */ + pos = npos; + if (one_only) break; + } + else { + /* At last! Our purpose for existance! */ + /* compress whitespace */ + count = 0; + while ((pos > 0) && + ((cur = text_GetChar(txt, pos-1) == ' '))) { + pos--; + count++; + } + if (count>0) { + text_DeleteCharacters(txt, pos, count); + modified = 1; + len -= count; + end -= count; + } + /* find out how many spaces to replace */ + /* newline with: punctuation followed by these: */ + switch (cur) { + case '\'': + case '\\': + case '"': + case '}': + case ']': + case ')': + cur = text_GetChar(txt, pos-2); + break; + } + /* consistinge of these: */ + switch (cur) { + case '.': + case ':': + case ';': + case '?': + case '!': + /* get two spaces. */ + text_ReplaceCharacters(txt, pos, 1, " ", 2); + len++; + end++; + modified = 1; + break; + default: + /* otherwise one space */ + text_ReplaceCharacters(txt, pos, 1, " ", 1); + modified = 1; + } + pos = npos; + } + } + } + else pos++; + } + if (modified) { + text_NotifyObservers(txt, 0); + if (!one_only) textview_SetDotLength (self, len); + } + } + + /* + * Is what we're pointing at an item tag? + * + * It will return the count of characters scan'ed. + * If this is not an item tag, the count is returned as zero. + * A tag is currently defined as "7 ". + * We could also test for the symbola environment, but users + * might have done plainest before discovering de-itemize. + */ + + static int is_itemp (txt, start, end) + struct text *txt; + int start, end; + { + long c; + + if ((text_GetChar(txt, start) == '7') && + (start < end) && + ((c = text_GetChar(txt, start + 1)) == ' ' || c == '\t')) return 2; + else return 0; + } + + + /* + * itemize + * + * Put a bullet in front of every paragraph in the given region. + * (Unless one is already there.) + * If no region is given, put one at the begining of the current + * paragraph + */ + + static void insertBullets (self, key) + struct textview *self; + long key; + { + struct text *txt = (struct text *)self->header.view.dataobject; + struct style *style; + + int dot, pos, len, end; + long cur, indent, left; + int one_only = 0, modified = 0; + struct text_statevector sv; + + if (ConfirmReadOnly(self, txt)) + return; + + style = stylesheet_Find(txt->styleSheet, "symbola"); + if (style == NULL) { + style = style_New(); + style_SetFontFamily (style, "AndySymbola"); + style_SetName(style, "symbola"); + stylesheet_Add(txt->styleSheet, style); + } + + dot = pos = textview_GetDotPosition(self); + len = textview_GetDotLength(self); + + end = pos + len; + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + indent = sv.CurIndentation; + left = sv.CurLeftMargin; + + /* if len is zero, do current paragraph */ + if (len == 0) { + /* back up to begining of paragraph */ + if (pos > 0) pos--; + while (pos > 0 && (text_GetChar(txt, pos - 1)) != '\n') pos--; + end = text_GetLength (txt); + len = end - pos; + one_only = 1; + } + + while (pos < end) { + cur = text_GetChar(txt, pos); + if (cur == ' ' || cur == '\n' || cur == '\t') { + pos++; + continue; /* go to first non-whitespace character */ + } + else { + /* Only itemize lines at the same level */ + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + if (sv.CurLeftMargin == left && sv.CurIndentation == indent) + if (is_itemp(txt, pos, end) == 0) { + /* Not already itemized */ + unsigned char c = (unsigned char) cur; + + text_AlwaysInsertCharacters(txt, pos+1, &c, 1); + text_AlwaysInsertCharacters(txt, pos+1, "7\t", 2); + text_AlwaysDeleteCharacters(txt, pos, 1); + environment_WrapStyle(txt->rootEnvironment, pos, 1, style); + modified = 1; + len += 2; + end += 2; + } + } + if (one_only) break; + /* go to end of paragraph */ + while (pos < end) { + pos++; /* always move at least one character */ + if (text_GetChar(txt, pos) == '\n') break; + } + pos++; + } + if (modified) { + text_NotifyObservers(txt, 0); + if (!one_only) { + textview_SetDotPosition (self, dot); + textview_SetDotLength (self, len); + } + } + } + + static void removeBullets (self, key) + struct textview *self; + long key; + { + struct text *txt = (struct text *)self->header.view.dataobject; + struct text_statevector sv; + int pos, count, len, end; + long cur, indent, left; + int one_only = 0, modified = 0; + + if (ConfirmReadOnly(self, txt)) + return; + + pos = textview_GetDotPosition(self); + len = textview_GetDotLength(self); + + end = pos + len; + + /* if len is zero, do current paragraph */ + if (len == 0) { + /* back up to begining of paragraph */ + if (pos > 0) pos--; + while (pos > 0 && (text_GetChar(txt, pos - 1)) != '\n') pos--; + end = text_GetLength (txt); + len = end - pos; + one_only = 1; + } + + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + indent = sv.CurIndentation; + left = sv.CurLeftMargin; + + while (pos < end) { + cur = text_GetChar(txt, pos); + if (cur == ' ' || cur == '\n' || cur == '\t') { + pos++; + continue; /* go to first non-whitespace character */ + } + else { + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + if (sv.CurLeftMargin == left && sv.CurIndentation == indent) + if ((count = is_itemp (txt, pos, end)) > 0) { + text_DeleteCharacters(txt, pos, count); + end -= count; + len -= count; + modified = 1; + } + } + if (one_only) break; + /* go to end of paragraph */ + while (pos < end) { + pos++; /* always move at least one character */ + if (text_GetChar(txt, pos) == '\n') break; + } + pos++; + } + if (modified) { + text_NotifyObservers(txt, 0); + if (!one_only) textview_SetDotLength (self, len); + } + } + /* + * Parse a number out of a text object. + * + * Call this with start pointing at the first digit. + * It will store the number parsed in numret. + * It will return the count of characters scan'ed. + * If the number is not immediately followed by a + * period and then a space or tab, the count is + * returned as zero + * signifying that this number is to be ignored. + */ + + static int parse_num (txt, start, end, numret) + struct text *txt; + int start, end, *numret; + { + int cur_num = 0, count = 0; + long cur; + + while (start < end && isdigit (cur = text_GetChar(txt, start))) { + cur_num = 10 * cur_num + (cur - '0'); + start++; + count++; + } + if (count == 0) return 0; + /* skip over trailing period and whitespace if present */ + if (start < end && (cur = text_GetChar(txt, start)) != '.') return 0; /* wrong format */ + if (start < end && ((cur = text_GetChar(txt, start+1)) + != ' ' && cur != '\t')) + return 0; /* wrong format */ + count += 2; + *numret = cur_num; + return count; + } + + /* + * enumerate + * + * Put a number in front of every paragraph in the given region. + * + * The tricky part is deciding how to sequence the numbers. + */ + + static void enumerate (self, key) + struct textview *self; + long key; + { + struct text *txt = (struct text *)self->header.view.dataobject; + struct text_statevector sv; + int dot, pos, npos, count, tlen, len, end; + long cur, indent, left; + int one_only = 0, modified = 0; + int cur_num, the_number = 0; + int found_the_number = 0; + char numstring[20]; + + if (ConfirmReadOnly(self, txt)) + return; + + removeBullets(self, 0L); /* Enumeration overrides bullets */ + + dot = pos = textview_GetDotPosition(self); + len = textview_GetDotLength(self); + + end = pos + len; + + /* if len is zero, do current paragraph */ + if (len == 0) { + /* back up to begining of paragraph */ + if (pos > 0) pos--; + while (pos > 0 && (text_GetChar(txt, pos - 1)) != '\n') pos--; + end = text_GetLength (txt); + len = end - pos; + one_only = 1; + + /* See if the previous paragraph begins with a number. If so, set the_number */ + npos = pos; + if (npos > 0) npos--; /* back up over newline we just saw */ + + /* back up over additional whitespace between paragraphs */ + while (npos > 0) { + cur = text_GetChar(txt, npos); + if (!(cur == ' ' || cur == '\n' || cur == '\t')) + break; + npos--; + continue; + } + + /* Now go to begining of the paragraph */ + while (npos > 0 && (text_GetChar(txt, npos - 1)) != '\n') npos--; + if (parse_num (txt, npos, pos, &cur_num) > 0) { + found_the_number = 1; + the_number = cur_num + 1; + } + } + + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + indent = sv.CurIndentation; + left = sv.CurLeftMargin; + + while (pos < end) { + cur = text_GetChar(txt, pos); + if (cur == ' ' || cur == '\n' || cur == '\t') { + pos++; + continue; /* go to first non-whitespace character */ + } + else { + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + if (sv.CurLeftMargin == left && sv.CurIndentation == indent) + if ((count = parse_num (txt, pos, end, &cur_num)) > 0) { + if (found_the_number) { + if (the_number != cur_num) { + sprintf (numstring, "%d.\t", the_number); + tlen = strlen(numstring); + text_ReplaceCharacters(txt, pos, count, numstring, tlen); + count = tlen - count; + end += count; + len += count; + pos += tlen; + modified = 1; + } + the_number++; + } else { + the_number = cur_num + 1; + found_the_number = 1; + pos += count; + } + } else { + unsigned char c = (unsigned char) cur; + + if (!found_the_number) { + /* There was no digit seen Set the_number */ + the_number = 1; + found_the_number = 1; + } + /* this paragraph has no number, add it */ + sprintf (numstring, "%d.\t", the_number); + tlen = strlen(numstring); + text_AlwaysInsertCharacters(txt, pos+1, &c, 1); + text_AlwaysInsertCharacters(txt, pos+1, numstring, tlen); + text_AlwaysDeleteCharacters(txt, pos, 1); + pos += tlen; + len += tlen; + end += tlen; + modified = 1; + the_number++; + } + } + if (one_only) break; + /* go to end of paragraph */ + while (pos < end) { + pos++; /* always move at least one character */ + if (text_GetChar(txt, pos) == '\n') break; + } + pos++; + } + if (modified) { + text_NotifyObservers(txt, 0); + if (!one_only) { + textview_SetDotPosition (self, dot); + textview_SetDotLength (self, len); + } + } + } + + static void denumerate (self, key) + struct textview *self; + long key; + { + struct text *txt = (struct text *)self->header.view.dataobject; + struct text_statevector sv; + int pos, count, len, end; + long cur, indent, left; + int one_only = 0, modified = 0; + int cur_num; + + if (ConfirmReadOnly(self, txt)) + return; + + pos = textview_GetDotPosition(self); + len = textview_GetDotLength(self); + + end = pos + len; + + /* if len is zero, do current paragraph */ + if (len == 0) { + /* back up to begining of paragraph */ + if (pos > 0) pos--; + while (pos > 0 && (text_GetChar(txt, pos - 1)) != '\n') pos--; + end = text_GetLength (txt); + len = end - pos; + one_only = 1; + } + + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + indent = sv.CurIndentation; + left = sv.CurLeftMargin; + + while (pos < end) { + cur = text_GetChar(txt, pos); + if (cur == ' ' || cur == '\n' || cur == '\t') { + pos++; + continue; /* go to first non-whitespace character */ + } + else { + (void) textview_GetStyleInformation(self, &sv, pos, NULL); + if (sv.CurLeftMargin == left && sv.CurIndentation == indent) + if ((count = parse_num (txt, pos, end, &cur_num)) > 0) { + text_DeleteCharacters(txt, pos, count); + end -= count; + len -= count; + modified = 1; + } + } + if (one_only) break; + /* go to end of paragraph */ + while (pos < end) { + pos++; /* always move at least one character */ + if (text_GetChar(txt, pos) == '\n') break; + } + pos++; + } + if (modified) { + text_NotifyObservers(txt, 0); + if (!one_only) textview_SetDotLength (self, len); + } + } + + /* + * Explicit object insertion code. + * + * This is so we can make menu items to insert objects + * by name rather than prompting and asking for them. + * for example: + addmenu gnucompat-insert-inset "Special~4,Insert equation~41" textview gnucompat inherit "eq" + addmenu gnucompat-insert-inset "My Cart, Insert Eq" textview gnucompat inherit "eq" + * The flag is true if we should make sure there are newlines around the inset. + */ + + static void + do_insert(self,typename, nl_flag) + struct textview *self; + char *typename; + boolean nl_flag; + { + struct text *txt; + char buf[80]; + int result; + long pos; + + if ((txt = (struct text *) textview_GetDataObject(self)) == NULL) return; + + if (ConfirmReadOnly(self, txt)) + return; + + if(text_GetObjectInsertionFlag(txt) == FALSE){ + message_DisplayString(self, 0, "Object Insertion Not Allowed!"); + return; + } + /* Check to see if we are interactive or not... njw*/ + if (!typename || (int) typename < 256 /* Sigh */) { + /* This is a bit of overkill, using completedString... + * But at some point, it might be nice to have either + * completion or help... + */ + result = message_AskForStringCompleted(self, + 0, + "Object to insert: " , + NULL, /* no default */ + buf, + sizeof(buf), + NULL, /* no special keymap */ + NULL,/* no completion */ + NULL, /* no help */ + 0L, + message_NoInitialString); + if (result<0) { + message_DisplayString(self, 0, "Object insertion cancelled."); + return; + } + typename = buf; + } + + pos = textview_GetDotPosition(self) + textview_GetDotLength(self); + /* for user convenience, if we don'txt have newlines before and after, we insert them. */ + if (nl_flag) { + if (text_GetChar(txt, pos) != '\n') { + text_InsertCharacters(txt, pos, "\n", 1); + } + if (text_GetChar(txt, pos - 1) != '\n'){ + text_InsertCharacters(txt, pos, "\n", 1); + pos++; + } + } + self->currentViewreference = text_InsertObject(txt, pos, typename, NULL); + text_NotifyObservers(txt, 0); + } + + static void + insert(self,typename) + struct textview *self; + char *typename; + { + do_insert (self, typename, TRUE); + } + + static void + insert_no_nl(self,typename) + struct textview *self; + char *typename; + { + do_insert (self, typename, FALSE); + } + + static void + AddDefaultTpl(self, l) + struct textview *self; + long l; + { + struct text *txt; + + if ((txt = (struct text *) textview_GetDataObject(self)) == NULL) return; + + if (ConfirmReadOnly(self, txt)) + return; + + if (text_ReadTemplate(txt, "default", text_GetLength(txt) == 0) < 0) + message_DisplayString(self, 100, "Could not read template file."); + else { + text_RegionModified(txt, 0, text_GetLength(txt)); + text_NotifyObservers(txt, 0); + message_DisplayString(self, 0, "Enabled Basic Styles."); + } + } + + + + boolean gnucompat__InitializeClass(classID) + struct classheader *classID; + { + static struct bind_Description compat_fns[] = { + {"gnucompat-fill-para", NULL, 0, NULL, 0, 0, gcparafill, "Fill Paragraph.", "gnucompat"}, + {"gnucompat-insert-bullets", NULL, 0, NULL, 0, 0, insertBullets, "Put a bullet at the begining of each paragraph in the region", "gnucompat"}, + {"gnucompat-remove-bullets", NULL, 0, NULL, 0, 0, removeBullets, "Remove bullets from the begining of each paragraph in the region", "gnucompat"}, + {"gnucompat-enumerate", NULL, 0, NULL, 0, 0, enumerate, "Put number in sequence at the begining of each paragraph in the region", "gnucompat"}, + {"gnucompat-denumerate", NULL, 0, NULL, 0, 0, denumerate, "Delete number from the begining of each paragraph in the region", "gnucompat"}, + /* Added by njw so that you can keybind all this junk: */ + {"gnucompat-insert-inset", NULL, 0, NULL, 0, 0, insert, "Insert a named inset here", "gnucompat"}, + {"gnucompat-insert-inset-no-nl", NULL, 0, NULL, 0, 0, insert_no_nl, "Insert a named inset without newlines around it", "gnucompat"}, + {"gnucompat-add-default-tpl", NULL, 0, NULL, 0, 0, AddDefaultTpl, "Enable basic styles by adding the template named default", "gnucompat"}, + + {NULL}, + }; + struct classinfo *textviewClassinfo; + + textviewClassinfo = class_Load("textview"); + if (textviewClassinfo != NULL) { + bind_BindList(compat_fns, NULL, NULL, textviewClassinfo); + return TRUE; + } + else + return FALSE; + } *** contrib/mit/util/compat.ch Thu May 30 20:29:42 1991 --- contrib/mit/util/compat.ch.NEW Thu May 30 18:43:23 1991 *************** *** 0 **** --- 1,26 ---- + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/compat.ch,v 1.1 91/04/02 19:33:41 gk5g Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/compat.ch,v $ */ + + #ifndef lint + static char *rcsidcompat = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/compat.ch,v 1.1 91/04/02 19:33:41 gk5g Exp $"; + #endif /* lint */ + + /************************************************* + * Copyright (C) 1990 by the Massachusetts Institute of Technology + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby + * granted without fee, provided that the above copyright notice + * appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, + * and that the name of M.I.T. not be used in advertising or + * publicity pertaining to distribution of the software without + * specific, written prior permission. M.I.T. makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + *************************************************/ + + package gnucompat[compat] { + classprocedures: + InitializeClass() returns boolean; + }; *** contrib/mit/util/ez2ascii.c Thu May 30 20:29:52 1991 --- contrib/mit/util/ez2ascii.c.NEW Thu May 30 18:43:25 1991 *************** *** 0 **** --- 1,74 ---- + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/ez2ascii.c,v 1.1 91/04/02 19:33:45 gk5g Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/ez2ascii.c,v $ */ + /* $Author: gk5g $ */ + /* + * Program to convert ATK datastream to plain ascii. + * + * Relies on overhead/mail/lib/unscribe code. + * Uses same algorithm that sendmessages uses to strip + * formatting and to break lines. + * + * Usage: ez2ascii [infile [outfile]] + * + * Outfile gets the stripped version of the file. + * If outfile is not specified, output goes to stdout. + * If no file is specified, stdin is read and output goes to stdout. + */ + + #include + #include + + #include + + #include + + static int ez2a_doit (infile, outfile) + FILE *infile, *outfile; + { + struct ScribeState *ussp; + int version, err; + char buf[1027]; + + version = UnScribeInit(" 12", &ussp); + + while (fgets(buf,sizeof(buf)-1,infile)) { + err = UnScribe(version, &ussp, buf, strlen(buf), outfile); + if (err < 0) { + fprintf(stderr, "UnScribe error == %d.\n", err); + return -1; + } + } + UnScribeFlush(version, &ussp, outfile); + return 0; + } + + main(argc, argv) + int argc; + char *argv[]; + { + FILE *inptr, *outptr; + int status = -1; + + if (argc > 3) { + fprintf(stderr, "Too many arguments. First arg is input file; second is output file.\n"); + } else if (argc == 1) { + status = ez2a_doit (stdin, stdout); + } else if(argc == 3) { + if ((outptr = fopen(argv[2], "w")) == NULL) { + fprintf(stderr, "Could not open output file '%s'.\n", argv[2]); + exit(-1); + } + if ((inptr = fopen((argv[1]), "r")) == NULL) { + fprintf(stderr, "Could not open input file '%s'.\n", argv[1]); + exit (-1); + } + status = ez2a_doit (inptr, outptr); + } else { + if ((inptr = fopen((argv[1]), "r")) == NULL) { + fprintf(stderr, "Could not open input file '%s'.\n", argv[1]); + exit (-1); + } + status = ez2a_doit (inptr, stdout); + } + exit (status); + } *** contrib/mit/util/ez2ascii.help Thu May 30 20:30:03 1991 --- contrib/mit/util/ez2ascii.help.NEW Thu May 30 18:43:26 1991 *************** *** 0 **** --- 1,92 ---- + \begindata{text,269067380} + \textdsversion{12} + \template{help} + \chapter{ez2ascii: Converting a formatted file made in ez to Plain ascii + + } + \section{What ez2ascii is + + }\leftindent{ + This program strips out formatting put in by ez, and creates a plain ascii + file for display on a character terminal like a DEC vt100. The input file is + written to a output file in plain ascii format. + + + }\section{Starting ez2ascii + + }\leftindent{ + Type + + + \programexample{ez2ascii \italic{infile outfile} + + } + If no outfile is not specified, output goes to the standard output. + + If neither infile nor outfile is specified, input comes from the standard + input and output goes to the standard output. + + + }\section{Warnings + + }\leftindent{ + }\leftindent{Embedded objects are not converted but are replaced with an error + message that looks like this: + + + \programexample{An embedded object [foo] was here but could not be printed. + + } + Any line longer than 80 characters gets an extra newline after the word ending + that comes closest without going over 80 columns. This is fine for converting + files formatted with ez, but often causes trouble if you try to use ez2ascii + to convert a file you put ez formatting into by mistake. + + } + + \section{Using ez2ascii as a filter + + }\leftindent{ + You can use ez2ascii as a filter. + + + For example, typing: + + + \programexample{datacat mine1.ez mine2.ez | ez2ascii | page + + } + will display what mine1.ez and mine2.ez look like in plain text. + + } + \section{Quick reference + + }\leftindent{ + \programexample{ez2ascii [\italic{infile} [\italic{outfile}]] + + }} + \section{Program Author} + + \leftindent{ + }\leftindent{Wiliam D. Cattey, MIT Project Athena + + } + \section{\section{Recent changes to ez2ascii + + }\leftindent{ + }}\leftindent{Version 2: This version takes one input file and allows the user + to specify the output file, or to easily pipe output. The previous version + would create an output file name from the input file name making it + inconvenient to pipe output to other programs. + + + }\section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \italic{\leftindent{ez2ps}} + + \enddata{text,269067380} *** contrib/mit/util/ez2ps Thu May 30 20:30:21 1991 --- contrib/mit/util/ez2ps.NEW Thu May 30 18:43:28 1991 *************** *** 0 **** --- 1,91 ---- + #! /bin/csh -f + # + # Based on printscribe which is a Copyright IBM utility. + # For full copyright information see 'andrew/config/COPYRITE' + # $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/ez2ps,v 1.1 91/04/02 20:14:44 gk5g Exp $ + # $Author: gk5g $ + # $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/ez2ps,v $ + + # use clever csh bits to discover if we should act like a filter, or emit + # files. Output filenames are the input filename with .PS appended + # GROSSNESS: We need to assemble a list of args to pass through to + # ezprint. This means we need to know what they all are, so we can + # preserve more than just flags. (like -o filename). + # So if new args come along that we want to forward to ezprint, we + # have to add them here. + # We also delete certain args like -S which don't make any sense. + # + # Any args we don't understand are passed thru as booleans. + # Any arg not begining with a dash that isn't parsed out of a command + # arg is assumed to be a file. + # If we go through all the args and never print a file, we assume we're a + # pipe. + # + # For my next trick, I will invent infinite improbability drive -wdc. + + set PASSTHRU="" + + while ($#argv > 0) + switch($1) + case -e: + case -c: + case -C: + case -N: + case -T: + case -n: + case -o: + case -O: + case -a: + case -m: + case -l: + case -v: + set PASSTHRU="$PASSTHRU $1" + shift + if ($#argv == 0) then + echo ez2ps: Missing argument -- try again. + exit (-1) + endif + set PASSTHRU="$PASSTHRU $1" + breaksw + case -S: + shift + if ($#argv == 0) then + echo ez2ps: Missing argument -- try again. + exit (-1) + endif + breaksw + case -S*: + case -s*: + breaksw + case -q*: + case -i*: + case -I*: + case -E*: + case -C*: + case -p*: + case -t*: + case -h*: + case -n*: + case -V*: + case -z*: + case -FE*: + case -Fe*: + case -*: + set PASSTHRU="$PASSTHRU $1" + breaksw + default: + if ($#argv > 2) then + echo ez2ps: Last two args should be files. + exit (-1) + else if ($#argv == 2) then + exec ezprint -q -t $PASSTHRU $1 | eqn | troff -Tpsc -t | psdit > ${2} + exit (0) + else if ($#argv == 1) then + exec ezprint -q -t $PASSTHRU $1 | eqn | troff -Tpsc -t | psdit + exit (0) + endif + endsw + shift + end + + exec ezprint -q -s -t $PASSTHRU | eqn | troff -Tpsc -t | psdit *** contrib/mit/util/ez2ps.help Thu May 30 20:30:33 1991 --- contrib/mit/util/ez2ps.help.NEW Thu May 30 18:43:29 1991 *************** *** 0 **** --- 1,110 ---- + \begindata{text,268727980} + \textdsversion{12} + \template{help} + \chapter{ez2ps: Converting a formatted file made in ez to Postscript + + } + \section{What ez2ps is + + }\leftindent{ + Ez2ps is a shell script that converts a file created in Andrew EZ to + PostScript formatting for printing or previewing with related tools. Ez2ps + uses \italic{ezprint} to convert the file; all the ezprint options except for + those relating to printer setting and filename setting work with ez2ps (see + the \italic{ezprint} Andrew help document for more details on the options). + + } + \section{Starting ez2ps + + }\leftindent{ + The simplest way to use ez2ps is with two file names. The first one is the + input file name. The second one is the output file name: + + + \example{ez2ps infile outfile + + } + Or you can use ez2ps with arguments that get sent on to ezprint. In that + case, the filenames are the last two arguments. For example: + + + \example{ez2ps -cn infile outfile + + } + This line creates a postscript file named outfile from the ez file infile but + does not put in a table of contents. + + + The ez2ps program need not be used with both filename arguments. It can take + just an input filename and send its output to the standard output: + + + \example{ez2ps infile + + } + This would display the postscript representation of infile on your console. + + } + \section{Using ez2ps as a filter + + }\leftindent{ + You can use ez2ps without any file names and use it to filter output. + + + For example, typing: + + + \programexample{datacat mine1.ez mine2.ez | ez2ps | page + + } + will display what mine1.ez and mine2.ez look like in postscript. + + + or typing: + + + \programexample{datacat chapter* | ez2ps > book.PS + + } + will create the PostScript file book.PS which contains all the chapters + included by the \italic{datacat} command (see the Andrew Help document for + more on datacat). + + } + \section{Quick reference + + } + \programexample{ez2ps [ezprint options] [infile [outfile]]\leftindent{ + + }} + \section{Program Author} + + \leftindent{ + William D. Cattey, MI}T Project Athena. + + + \section{Recent changes to ez2ps + + }\leftindent{ + Version 3: This version takes one input file and allows the user to specify + the output file, or to easily pipe output. The previous version would create + an output file name from the input file name making it inconvenient to pipe + output to other programs. + + + Version 2: This version replaces a previous version that did not pass + arguments to ezprint and could not be used as a filter. + + + }\section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \italic{\leftindent{ezprint + + datacat}} + + \enddata{text,268727980} *** contrib/mit/util/header.c Thu Jun 6 17:51:34 1991 --- contrib/mit/util/header.c.NEW Thu Jun 6 17:50:30 1991 *************** *** 0 **** --- 1,285 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #ifdef hpux + #include + #endif /* hpux */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include "header.eh" + + static char *header_prompts[] = { + " Left\t\t: ", + " Center\t: ", + " Right\t: " + }; + + static struct style *header_promptStyle; + + boolean header__InitializeClass(classID) + struct classheader classID; + { + if (!(header_promptStyle = style_New())) + return FALSE; + + style_AddNewFontFace(header_promptStyle, fontdesc_Bold); + return TRUE; + } + + + + void header__ObservedChanged(self,t,value) + struct header *self; + struct text *t; + long value; + { + if(value==0) header_SetModified(self); + } + + char *header__ViewName(self) + struct header *self; + { + return "headrtv"; + } + + void header_SetPrompt(textobj, string) + struct text *textobj; + char *string; + { + int x, l; + struct environment *newenv; + + l = strlen(string); + + /* Now to change the view */ + x = text_GetFence(textobj); + text_ClearFence(textobj); + text_ReplaceCharacters(textobj, 0, x, string, l); + text_SetFence(textobj, l); + + newenv = environment_InsertStyle(textobj->rootEnvironment, 0, header_promptStyle, TRUE); + environment_SetLength(newenv, l - 1); + } + + /* header_Read: the basic philosophy of this routine is to be completely forward compatible. + Restrictions: + In future versions the first line in the data must always be type:[header|footer] or this routine will leave the object empty. + Also the texts must always occur in order from left to right. + */ + long header__Read(self, file, id) + struct header *self; + FILE *file; + long id; + { + + /* this is take mostly from the template in dataobj.c */ + + long endcount = 1; + boolean begindata; + char *s; + long c; + long status; + char objectname[200]; + char buf[256]; + long objectid; + int texts=header_ltext,i; + struct dataobject *newobject; + + header_SetID(self,header_UniqueID(self));/* change id to unique number */ + if(!fgets(buf,sizeof(buf),file)) return dataobject_PREMATUREEOF; + s=rindex(buf,':'); + if(s) *s++='\0'; + else return dataobject_PREMATUREEOF; + if(strcmp(buf,"where")) return dataobject_NOREADERROR; + else { + if(!strcmp(s,"header\n")) self->where=header_HEADER; + else if(!strcmp(s,"footer\n")) self->where=header_FOOTER; + } + if(!fgets(buf,sizeof(buf),file)) return dataobject_PREMATUREEOF; + s=rindex(buf,':'); + if(s) *s++='\0'; + else return dataobject_PREMATUREEOF; + if(!strcmp(buf,"active")) { + for(i=header_ltext;*s && iactive[i] = TRUE; + #else /* ALWAYS_ACTIVE_MODE */ + self->active[i]=(*s)-'0'; + #endif /* ALWAYS_ACTIVE_MODE */ + } + } + while (endcount != 0) { + while ((c = getc(file)) != EOF && c != '\\') { + if(endcount == 1){ + return dataobject_NOREADERROR; + } + } + if (c == EOF) return dataobject_NOREADERROR; + if ((c = getc(file)) == EOF) + return dataobject_PREMATUREEOF; + if (c == 'b') { + begindata = TRUE; + s = "egindata"; + } + else if (c == 'e') { + begindata = FALSE; + s = "nddata"; + } + else { + if(endcount == 1){ + /* Place handling of \x characters here */ + } + continue; + } + while ((c = getc(file)) != EOF && c == *s) s++; + if (c == '{' && *s == '\0') { + if (begindata) { + s = objectname; + while ((c = getc(file)) != EOF && c != ',') + *s++ = c; + if (c == EOF) return dataobject_PREMATUREEOF; + *s = '\0'; + objectid = 0; + while ((c = getc(file)) != EOF && c != '}') + if(c >= '0' && c <= '9')objectid = objectid * 10 + c - '0'; + if (c == EOF) return dataobject_PREMATUREEOF; + if((c = getc(file))!= '\n') ungetc(c,file); + /* Call the New routine for the object */ + if(!strcmp(objectname,"text")) { + if(texts>=header_TEXTS) continue; + status = text_Read(self->texts[texts], file, objectid); + if (status != dataobject_NOREADERROR) return status; + dictionary_Insert(NULL,(char *)objectid, (char *)self->texts[texts]); + header_SetPrompt(self->texts[texts], header_prompts[texts]); + text_SetObjectInsertionFlag(self->texts[texts], FALSE); + texts++; + } else { + if ((newobject = (struct dataobject *) class_NewObject(objectname))) { + /* Call the read routine for the object */ + status = dataobject_Read(newobject, file, objectid); + if (status != dataobject_NOREADERROR) return status; + /* We don't know this object so ignore it */ + dataobject_Destroy(newobject); + + } + else { + endcount += 1; + /* return dataobject_OBJECTCREATIONFAILED; */ + } + } + + } + else { + endcount -= 1; + while ((c = getc(file)) != EOF && c != '}'); + if((c = getc(file))!= '\n') ungetc(c,file); + } + } + else if(endcount == 1){ + + /* Place Handling of characters following \ + */ } + } + return dataobject_NOREADERROR; + } + + static long header_FencedWrite(textobj, file, writeID, level) + struct text *textobj; + FILE *file; + long writeID; + int level; + { + int len, pos; + + if (textobj->header.dataobject.writeID != writeID) { + textobj->header.dataobject.writeID = writeID; + fprintf(file, "\\begindata{%s,%ld}\n", + (textobj->WriteAsText)?"text": class_GetTypeName(textobj), + dataobject_UniqueID(&textobj->header.dataobject)); + fprintf(file, "\\textdsversion{%d}\n", 12); + if (textobj->styleSheet->templateName) + fprintf(file, "\\template{%s}\n", textobj->styleSheet->templateName); + stylesheet_Write(textobj->styleSheet, file); + len = text_GetLength(textobj); + pos = text_GetFence(textobj); + len = len - pos; + text_WriteSubString(textobj, pos, len, file, 1); + fprintf(file, "\\enddata{%s,%d}\n", + (textobj->WriteAsText)?"text": class_GetTypeName(textobj), + textobj->header.dataobject.id); + fflush(file); + } + return textobj->header.dataobject.id; + } + + + #define printbool(x) ((x)?"1":"0") + long header__Write(self, file, writeID, level) + struct header *self; + FILE *file; + long writeID; + int level; + { + if (header_GetWriteID(self) != writeID) { + header_SetWriteID(self,writeID); + fprintf(file, "\\begindata{%s,%ld}\n", class_GetTypeName(self),header_GetID(self)); + fprintf(file,"where:"); + switch(self->where) { + case header_FOOTER: + fprintf(file,"footer\n"); + break; + default: + case header_HEADER: + fprintf(file,"header\n"); + } + fprintf(file,"active:%s%s%s\n", printbool(self->active[header_ltext]), printbool(self->active[header_ctext]), printbool(self->active[header_rtext])); + header_FencedWrite(self->texts[header_ltext], file,header_GetWriteID(self),1); + header_FencedWrite(self->texts[header_ctext], file,header_GetWriteID(self),1); + header_FencedWrite(self->texts[header_rtext], file,header_GetWriteID(self),1); + fprintf(file, "\\enddata{%s,%ld}\n", class_GetTypeName(self),header_GetID(self)); + } + + return header_GetID(self); + } + + #define HEADERTXTHELPSTRING "Click on 'Left', 'Center', or 'Right' Above" + + boolean header__InitializeObject(classID,self) + struct classheader *classID; + struct header *self; + { + int i; + for(i=header_ltext;itexts[i]=text_New(); + if(!self->texts[i]) { + for(i--;i>=header_ltext;i--) text_Destroy(self->texts[i]); + return FALSE; + } + header_SetPrompt(self->texts[i], header_prompts[i]); + text_SetObjectInsertionFlag(self->texts[i], FALSE); + text_AddObserver(self->texts[i],self); + self->active[i]=TRUE; + } + self->where=header_HEADER; + return TRUE; + } + + void header__FinalizeObject(classID,self) + struct classheader *classID; + struct header *self; + { + long i; + for(i=header_ltext;itexts[i]) text_Destroy(self->texts[i]); + } *** contrib/mit/util/header.ch Thu May 30 20:30:53 1991 --- contrib/mit/util/header.ch.NEW Thu May 30 18:43:33 1991 *************** *** 0 **** --- 1,32 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #define header_HEADER 0 + #define header_FOOTER 1 + + #define header_ltext 0 + #define header_ctext 1 + #define header_rtext 2 + #define header_TEXTS 3 + + #define ALWAYS_ACTIVE_MODE + + class header: dataobject[dataobj] { + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + FinalizeObject(struct thisobject *self); + InitializeClass() returns boolean; + overrides: + + ObservedChanged(struct observable *t,long value); + Read (FILE *file, long id) returns long; + Write (FILE *file, long writeid, int level) returns long; + ViewName() returns char *; + methods: + data: + long where; + struct text *texts[header_TEXTS]; + boolean active[header_TEXTS]; + }; *** contrib/mit/util/headertxt.help Thu May 30 20:31:04 1991 --- contrib/mit/util/headertxt.help.NEW Thu May 30 18:43:34 1991 *************** *** 0 **** --- 1,528 ---- + \begindata{text,268938832} + \textdsversion{12} + \template{help} + \chapter{HeaderText: How to use headers and footers in EZ + + } + \section{What HeaderText is + + }\leftindent{ + HeaderText is an object which can be inserted into your documents to allow you + to set the page headers and footers. Without this object, you would get the + default header of a page number in the center, and no footer. + + + HeaderText objects may appear anywhere in your document, and each will affect + headers or footers from that point onwards. The most common place to put a + HeaderText object is at the very beginning of your document before any other + text. + + + A new header takes effect on the \bold{next} page after it is defined. A + new footer takes effect at the bottom of the \bold{same} page on which it is + defined. This means that no headers are printed on page 1 (but footers are). + + } + \section{Starting HeaderText + + }\leftindent{ + To insert a HeaderText, choose "Insert header/footer" from the "Special" menu + card. A box will be inserted in your document which looks something like: + + \begindata{raster,269109916} + 2 0 136226 136226 0 0 267 110 + bits 269109916 267 110 + ZSe0 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 8204h04h40y08 0708i20 | + 8204h04h40y08 18c8i20 | + 8204h04h40y08 1048i20 | + 8204!787478b0 40y082008"f020 | + 8204#ccc040y08 200999099820 | + 83fc8404!8480 40y0820!090108 20 | + 8204fc7c84fc80 40y08200908f1 f820 | + 820480c484!80 40y0820090819 g20 | + 820480!84!8040 y0810490809g20 | + 8204#cc8040y08 18c999099820 | + 82047876747880 40y080708"f020 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 801eg07zo20 | + 800cg0d20zn20 | + 800cg0c60zn20 | + 800c039ef0l60 zg20 | + 800c04cc60l60 zg20 | + 80!0ccc60zn20 | + 800c2fcc60zn20 | + 800c2c0c68zn20 | + 800c6e4c70l60 zg20 | + 801fe79e30l60 zg20 | + 80q10z20 | + 80q38z20 | + 80q7cz20 | + 80qfez20 | + 80qeez20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80g03d0zo20 | + 80g0630g02zm20 | + 80g0c10g06zm20 | + 80g0c11cecf1c dci60zg20 | + 80g0c02676626 6ci60zg20 | + 80g0c06"6660zk 20 | + 80g0c07e6667e 60zk20 | + 80g0c160666e0 60zk20 | + 80g0637266772 60i60zg20 | + 80g03e3ce733c f0i60zg20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80j0fe18070zj 20 | + 80j0671803010 zi20 | + 80j0630g!30zi 20 | + 80j06339fb678 g60zg20 | + 80j0661b33b30 g60zg20 | + 80j07c1b33330 zi20 | + 80j06e1b33330 zi20 | + 80j06719e3334 zi20 | + 80j0639903338 g60zg20 | + 80j0f1fdf7398 g60zg20 | + 80l3f80zj20 | + 80l2080zj20 | + 80l1fzk20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + \enddata{raster, 269109916} + \view{rasterview,269109916,1,0,0} + + }\section{Changing between Header and Footer modes + + }\leftindent{ + By clicking in the box at the upper left, you toggle between using the + HeaderText object as a header or a footer. You cannot set both the header and + footer in a single HeaderText object. If you want both a in your document, + you insert two HeaderText objects and set one to be a header and the other to + be a footer. + + + Clicking in the box at the upper right will collapse the HeaderText to a + single line with the word "Header" or "Footer" at the very left indicating + what kind of object it is. Clicking on the word "Open" at the far right of + the collapsed HeaderText object will re-expand the box and show the contents + of the currently selected component. + + + \begindata{raster,269065300} + 2 0 136226 136226 0 0 267 22 + bits 269065300 267 22 + ZSe0 | + 80l40y02k20 | + 80l40y02k20 | + 80l40y02k20 | + 80l40y02k20 | + 80l40y02k20 | + 8204h04h40y02 01c0i20 | + 8204h04h40y02 0630i20 | + 8204h04h40y02 0410i20 | + 8204!787478b0 40y02080970f1 7020 | + 8204#ccc040y02 0809!999820 | + 83fc8404!8480 40y0208"090820 | + 8204fc7c84fc80 40y0208!09f908 20 | + 820480c484!80 40y0208!090108 20 | + 820480!84!8040 y020411090108 20 | + 8204#cc8040y02 0631!990820 | + 82047876747880 40y0201c170f1 0820 | + 80l40y02g01i20 | + 80l40y02g01i20 | + 80l40y02g01i20 | + 80l40y02k20 | + ZSe0 | + \enddata{raster, 269065300} + \view{rasterview,269065300,2,0,0} + + }\section{Multiple Headers and Footers + + } + \leftindent{As mentioned above, to have a header and a footer, you must insert + two HeaderText objects and set one to act as a footer. You can change headers + and footers in the middle of your document by inserting Headertext objects + into the document where you want to make the changes. + + + IMPORTANT: A new header takes effect on the \bold{next} page after it is + defined. A new footer takes effect at the bottom of the \bold{same} page on + which it is defined. This means that no headers are printed on page 1 (but + footers are). + + + + }\section{Setting the contents of a component + + }\leftindent{ + Headers and footers have three parts, a \italic{left} part , a \italic{right} + part, and a \italic{center} part. You can set any, all, or none of these by + typing into the line with the corresponding label (Left, Center, or Right). + Although the HeaderText object will not stop you from putting formatted text + into the headers or footers, the formatting will not print correctly. + + + If you don't type anything for a particular component, you inherit whatever + was in effect before the current HeaderText was inserted: the previously set + components of the previous HeaderText objects, or the document default if + there are no previous HeaderText objects. The document default is a header + with the page number in the center, and no footer. + + + The current HeaderText will \bold{not} show what you are inheriting. + + + }\leftindent{Since an empty component won't override a previous header or + footer, use the HeaderText $blank variable to blank out a component. + + + \begindata{raster,269087212} + 2 0 136226 136226 0 0 267 110 + bits 269087212 267 110 + ZSe0 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 8204h04h40y08 0708i20 | + 8204h04h40y08 18c8i20 | + 8204h04h40y08 1048i20 | + 8204!787478b0 40y082008"f020 | + 8204#ccc040y08 200999099820 | + 83fc8404!8480 40y0820!090108 20 | + 8204fc7c84fc80 40y08200908f1 f820 | + 820480c484!80 40y0820090819 g20 | + 820480!84!8040 y0810490809g20 | + 8204#cc8040y08 18c999099820 | + 82047876747880 40y080708"f020 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + 80l40y08k20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 801eg07zo20 | + 800cg0d20zn20 | + 800cg0c60zn20 | + 800c039ef0l60 zg20 | + 800c04cc60l60 zg20 | + 80!0ccc60zn20 | + 800c2fcc60zn20 | + 800c2c0c68zn20 | + 800c6e4c70l60 zg20 | + 801fe79e30l60 zg20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80q02z20 | + 80g03d0n07b060 g30v20 | + 80g0630g02l0a 9020g10v20 | + 80g0c10g06l0a 1020g10v20 | + 80g0c11cecf1c dci600a16239b 13v20 | + 80g0c02676626 6ci60071b264d 92v20 | + 80g0c06"6660j 029120c89cv20 | + 80g0c07e6667e 60j0291234894 v20 | + 80g0c160666e0 60j0291244892 v20 | + 80g0637266772 60i600a932648 93v20 | + 80g03e3ce733c f0i600f1e73bd f980u20 | + 80q02j40u20 | + 80ve0u20 | + 80u01f0u20 | + 80u03f8u20 | + 80u03b8u20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80j0fe18070zj 20 | + 80j0671803010 zi20 | + 80j0630g!30zi 20 | + 80j06339fb678 g60zg20 | + 80j0661b33b30 g60zg20 | + 80j07c1b33330 zi20 | + 80j06e1b33330 zi20 | + 80j06719e3334 zi20 | + 80j0639903338 g60zg20 | + 80j0f1fdf7398 g60zg20 | + 80l3f80zj20 | + 80l2080zj20 | + 80l1fzk20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + \enddata{raster, 269087212} + \view{rasterview,269087212,3,0,0} + + }\section{Headertext Variables + + }\leftindent{ + There are a number of variables you can reference within a header/footer. For + example, the following would put today's date at the bottom right of every + page: + + + \begindata{raster,269065144} + 2 0 136226 136226 0 0 267 110 + bits 269065144 267 110 + ZSe0 | + 80k08z08k20 | + 80k08z08k20 | + 80k08z08k20 | + 80k08z08k20 | + 80k08z08k20 | + 83f8j08z080708 i20 | + 82h01h08z0818 c8i20 | + 82h01h08z0810 48i20 | + 82gf0f3cf1608 z082008"f020 | + 8201!99199808 z082009990998 20 | + 83f1!09109008 z0820!09010820 | + 8201!091f9008 z08200908f1f8 20 | + 8201!09!1008z 0820090819g20 | + 8201!09!1008z 0810490809g20 | + 8201!99199008 z0818c9990998 20 | + 82g!f0cf1008z 080708"f020 | + 80k08z08k20 | + 80k08z08k20 | + 80k08z08k20 | + 80k08z08k20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 801eg07zo20 | + 800cg0d20zn20 | + 800cg0c60zn20 | + 800c039ef0l60 zg20 | + 800c04cc60l60 zg20 | + 80!0ccc60zn20 | + 800c2fcc60zn20 | + 800c2c0c68zn20 | + 800c6e4c70l60 zg20 | + 801fe79e30l60 zg20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80g03d0zo20 | + 80g0630g02zm20 | + 80g0c10g06zm20 | + 80g0c11cecf1c dci60zg20 | + 80g0c02676626 6ci60zg20 | + 80g0c06"6660zk 20 | + 80g0c07e6667e 60zk20 | + 80g0c160666e0 60zk20 | + 80g0637266772 60i60zg20 | + 80g03e3ce733c f0i60zg20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80q02z20 | + 80j0fe18070i07 83y20 | + 80j0671803010 h0a81g40w20 | + 80j0630g!30h0a 01g40w20 | + 80j06339fb678 g600a0f1cf380 v20 | + 80j0661b33b30 g600719324440 v20 | + 80j07c1b33330 h02910647c0v20 | + 80j06e1b33330 h02911a44w20 | + 80j06719e3334 h02912244w20 | + 80j0639903338 g600a9b324620 v20 | + 80j0f1fdf7398 g600f0e9d33c0 v20 | + 80l3f80i02i10 v20 | + 80l2080m38v20 | + 80l1fn7cv20 | + 80ufev20 | + 80ueev20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + 80zr20 | + ZSe0 | + \enddata{raster, 269065144} + \view{rasterview,269065144,4,0,0} + + Variable names begin with a dollar sign. If you wish to use a $ in a header + or footer you can do so by placing two $ in a row where you want one. + + + Here is a list of all the variables available to the Headertext object: + + + $24hourtime prints the time in 24 hour format + + $blank blanks out inherited header/footer component + + $date prints the date in Month day, Year format + + $Edate prints the date in Day Month Year format + + $day prints the day of the week + + $month prints the current month + + $page prints the current page number + + $shortyear prints the last two digits of the year + + $time prints the date and time in Unix style + + $timeofday prints the time in AM/PM format + + $year prints the full year + + $$ prints a dollar sign + + + + } + + \section{Program Authors} + + \leftindent{ + Rob Ryan (rr2b@andrew.cmu.edu) + + Bill Cattey (wdc@athena.mit.edu) } + + + + \section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{insets + + troff + + }\enddata{text,268938832} *** contrib/mit/util/headrtv.c Thu Jun 6 17:53:16 1991 --- contrib/mit/util/headrtv.c.NEW Thu Jun 6 17:50:32 1991 *************** *** 0 **** --- 1,633 ---- + /* ********************************************************************** */ + /* Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + + #include + + #define Data(self) ((struct header *)headrtv_GetDataObject(self)) + #define View(self) ((struct view *)self) + #define Text(self,x) (Data(self)->texts[x]) + #define Textv(self,x) ((self)->textvs[x]) + + #define BASEYEAR 1900 + + static struct keymap *newKeymap; + static char **hvars=NULL; + static int hvarcount=0; + + typedef char *strings[3]; + static strings strs[]={ + {"LT","CT","RT"}, + {"LB","CB","RB"} + }; + static char *keywords[]={ + "24hourtime", + "blank", + "date", + "Edate", + "day", + "month", + "page", + "shortyear", + "time", + "timeofday", + "year" + }; + + static char *months[]={ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + }; + + static char *day[]={ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + }; + + struct tm *GetCurrentTime() { + long t=time(0); + return localtime(&t); + } + + void TwentyFourHourTime(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fprintf(file,"%d:%s%d",lt->tm_hour, (lt->tm_min>9)?"":"0",lt->tm_min); + } + + void Blank(file) + FILE *file; + { + fprintf(file, ""); + } + + void Date(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fprintf(file,"%s %d, %d", months[lt->tm_mon], lt->tm_mday,BASEYEAR+lt->tm_year); + } + + void Date2(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fprintf(file," %d %s %d",lt->tm_mday, months[lt->tm_mon], BASEYEAR+lt->tm_year); + } + + void Day(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fputs(day[lt->tm_wday],file); + } + + void Month(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fputs(months[lt->tm_mon],file); + } + + void Page(file) + FILE *file; + { + fprintf(file,"\\\\n%%"); + } + + void ShortYear(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fprintf(file,"%d",lt->tm_year); + } + + void TimeofDay(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + boolean am=TRUE; + if(lt->tm_hour>12) { + am=FALSE; + lt->tm_hour-=12; + } + else if (lt->tm_hour == 12) am = FALSE; + + fprintf(file,"%d:%s%d %s",lt->tm_hour, (lt->tm_min>9)?"":"0",lt->tm_min,am?"AM":"PM"); + } + + void Time(file) + FILE *file; + { + long t=time(0); + char *ct=ctime(&t),*i; + i=index(ct,'\n'); + if(i) *i='\0'; + fputs(ct,file); + } + + void Year(file) + FILE *file; + { + struct tm *lt=GetCurrentTime(); + fprintf(file,"%d",BASEYEAR+lt->tm_year); + } + + static procedure procs[]={ + (procedure)TwentyFourHourTime, + (procedure)Blank, + (procedure)Date, + (procedure)Date2, + (procedure)Day, + (procedure)Month, + (procedure)Page, + (procedure)ShortYear, + (procedure)Time, + (procedure)TimeofDay, + (procedure)Year + }; + + + #define NKEYWORDS (sizeof(keywords)/sizeof(char *)) + + #if 0 + static int findincommalist(list,sn) + char *list,*sn; + { + int i,count=0; + char buf[256],*p; + for(i=0;i9) { + fprintf(stderr,"Warning too many header variables maximum allowable is 10.\n"); + return; + } + + p=(char *)malloc(strlen(headervars)+1); + if(!p) return; + strcpy(p,headervars); + } else { + p = malloc(1); + if (!p) return; + p[0] = '\0'; + } + hvars=(char **)malloc(sizeof(char *)*(DEFAULTHEADERVARS+count)); + if(!hvars) return; + hvars[0]="chapter"; + hvars[1]="section"; + for(i=0;i=0;index--) { + ptr = string + pos; + if(*keywords[index]==c && !strncmp(ptr,keywords[index], strlen(keywords[index]))) { + if(procs[index]) procs[index](fp); + pos+=strlen(keywords[index])-1; + break; + } + } + if(index<0) { + for(index=hvarcount-1;index>=0;index--) { + ptr = string + pos; + if(*hvars[index]==c && !strncmp(ptr,hvars[index], strlen(hvars[index]))) { + fprintf(fp,"\\*(H%d\n",index); + pos+=strlen(hvars[index])-1; + break; + } + } + + } + } + } else { + switch(c) { + case '\n': + break; + case '\\': + if(!pass) fprintf(fp,"\\\\\\\\"); + else fputc(c,fp); + break; + case '$': + keyword=TRUE; + break; + default: + fputc(c,fp); + } + } + } + } + + static char *headrtv_GetInput(textobj) + struct text *textobj; + { + int len,pos; + char *string; + + len = text_GetLength(textobj); + pos = text_GetFence(textobj); + len = len - pos; + string = (char *) malloc(len + 1); + + text_CopySubString(textobj, pos, len, string, TRUE); + + return string; + } + + void headrtv__Print(self,file,processor,finalFormat, topLevel) + struct headrtv *self; + FILE *file; + char *processor; + char *finalFormat; + boolean topLevel; + { + char *string; + int i; + + if(!strcmp(processor,"troff")) { + for(i=header_ltext;iwhere][i]); + PrintLine(file, string); + fputs("\n",file); + } + if (string) free(string); + } + } + } + + enum view_DSattributes headrtv__DesiredSize(self, width, height, pass, desiredwidth, desiredheight) + struct headrtv *self; + long width, height; + enum view_DSpass pass; + long *desiredwidth, *desiredheight; + { + enum view_DSattributes result; + result=lpair_DesiredSize(self->sections,width, height, pass, desiredwidth, desiredheight); + *desiredwidth = width; + if(self->open) *desiredheight+=self->top*4; + else *desiredheight=self->top; + if(*desiredheight>self->top*5) { + *desiredheight=self->top*5; + } + return result; + } + + static char *hdrtv_where[]={"Header","Footer"}; + static char *hdrtv_close="Close"; + static char *hdrtv_open="Open"; + + #define ALIGNMENT (graphic_ATLEFT|graphic_ATBASELINE) + static void DrawBorder(self,vb) + struct headrtv *self; + struct rectangle *vb; + { + int width,junk,left; + char *type; + + type=hdrtv_where[Data(self)->where]; + headrtv_SetTransferMode(self,graphic_COPY); + headrtv_FillRectSize(self, vb->left+1, vb->top+1, vb->width-2, self->top-1,headrtv_WhitePattern(self)); + headrtv_SetTransferMode(self,graphic_BLACK); + headrtv_DrawRectSize(self,vb->left, vb->top, vb->width-1, vb->height-1); + headrtv_MoveTo(self,0,self->top-1); + headrtv_DrawLineTo(self, vb->width-1,self->top-1); + headrtv_SetFont(self,self->font); + headrtv_MoveTo(self,5,self->top-5); + headrtv_DrawString(self,type,ALIGNMENT); + fontdesc_TextSize(self->font,headrtv_GetDrawable(self), type, strlen(type),&width,&junk); + left=15+width; + headrtv_MoveTo(self, width + 10, 0); + headrtv_DrawLineTo(self, width + 10, self->top-1); + self->wherebox = left; + + type=(self->open)?hdrtv_close:hdrtv_open; + fontdesc_StringSize(self->font,headrtv_GetDrawable(self),type, &width, &junk); + self->closebox=vb->width-width-5; + headrtv_MoveTo(self,self->closebox,self->top-5); + headrtv_SetFont(self,self->font); + headrtv_DrawString(self,type,ALIGNMENT); + headrtv_MoveTo(self, self->closebox - 5, 0); + headrtv_DrawLineTo(self, self->closebox - 5, self->top-1); + } + + static struct textview *GetTextView(self) + struct view *self; + { + while(self) { + if(!strcmp(class_GetTypeName(self),"textview")) return (struct textview *)self; + self=self->parent; + } + return (struct textview *)self; + } + + static void headrtv_MoveOn(self, rock) + struct headrtv *self; + long rock; + /* This is the routine bound to the Return key - it moves the focus from + self->name to self->number, or, if self->number already has the focus, + then it calls turnin_TurninGo + */ + { + if (self->my_focus >= header_rtext) self->my_focus = header_ltext; + else self->my_focus++; + + headrtv_WantInputFocus(self, Textv(self, self->my_focus)); + } + + struct view *headrtv__Hit(self, action, x, y, numberOfClicks) + struct headrtv *self; + enum view_MouseAction action; + long x; + long y; + long numberOfClicks; + { + if(y>self->top) { + int i; + long testy = self->top; + struct view *tmpv; + struct rectangle r; + + headrtv_WantInputFocus(self,self); + tmpv = (struct view *)lpair_Hit(self->sections, action, x, y-self->top, numberOfClicks); + for(i=header_ltext;imy_focus = i; + break; + } + } + return tmpv; + + } + switch(action) { + case view_LeftUp: + case view_RightUp: + if(x>self->closebox||!self->open) { + if(self->open) { + struct rectangle mvb; + struct textview *tv=GetTextView(View(self)); + rectangle_SetRectSize(&mvb,0,0,0,0); + self->open=FALSE; + headrtv_WantNewSize(self,self); + lpair_InsertView(self->sections,self,&mvb); + textview_WantInputFocus(tv,tv); + } else headrtv_WantInputFocus(self,self); + return View(self); + } + if(xwherebox) { + if(Data(self)->where==header_HEADER) + Data(self)->where=header_FOOTER; + else Data(self)->where=header_HEADER; + } + header_NotifyObservers(Data(self),0); + break; + } + return View(self); + } + + void headrtv__FullUpdate(self, type, left, top, width, height) + struct headrtv *self; + enum view_UpdateType type; + long left,top,width,height; + { + struct rectangle mvb; + + switch(type) { + case view_PartialRedraw: + case view_LastPartialRedraw: + case view_FullRedraw: + headrtv_GetVisualBounds(self,&mvb); + + DrawBorder(self,&mvb); + if(self->open) { + mvb.top+=self->top; + mvb.left++; + mvb.width-=2; + mvb.height-=self->top+1; + lpair_InsertView(self->sections,self,&mvb); + lpair_FullUpdate(self->sections, type, left,top, width, height); + } + } + } + + void headrtv__Update(self) + struct headrtv *self; + { + struct rectangle mvb; + super_Update(self); + headrtv_GetVisualBounds(self,&mvb); + DrawBorder(self,&mvb); + } + + void headrtv__WantInputFocus(self,requestor) + struct headrtv *self; + struct view *requestor; + { + if(View(self)!=requestor || !self->open) super_WantInputFocus(self,requestor); + } + + void headrtv__LoseInputFocus(self) + struct headrtv *self; + { + if(self->sections) lpair_LoseInputFocus(self->sections); + } + + void headrtv__PostKeyState(self, keystate) + struct headrtv *self; + struct keystate *keystate; + { + struct keystate *k; + k=keystate_AddBefore(self->keystate,keystate); + super_PostKeyState(self,k); + } + + void headrtv__ReceiveInputFocus(self) + struct headrtv *self; + { + + if(!self->open) { + self->open=TRUE; + headrtv_WantNewSize(self,self); + if (Textv(self, header_ltext)) { + self->my_focus = header_ltext; + headrtv_WantInputFocus(self, Textv(self, header_ltext)); + } + } else + if(self->sections) { + lpair_ReceiveInputFocus(self->sections); + } + } + + boolean headrtv__CanView(self,name) + struct headrtv *self; + char *name; + { + if(!strcmp(name,"header")) return TRUE; + return FALSE; + } + + void headrtv__LinkTree(self,parent) + struct headrtv *self; + struct view *parent; + { + super_LinkTree(self,parent); + if(self->sections) lpair_LinkTree(self->sections,self); + } + + void headrtv__SetDataObject(self,object) + struct headrtv *self; + struct header *object; + { + int i, pos; + super_SetDataObject(self,object); + + for(i=header_ltext;iopen=FALSE; + self->bfont=fontdesc_Create("andysans",fontdesc_Bold,12); + self->font=fontdesc_Create("andysans",fontdesc_Plain,12); + self->bifont=fontdesc_Create("andysans",fontdesc_Bold | fontdesc_Italic,12); + self->ifont=fontdesc_Create("andysans",fontdesc_Italic,12); + if(!self->ifont || !self->font || !self->bfont || !self->bifont) return FALSE; + if ((fontSummary = fontdesc_FontSummary(self->font, headrtv_GetDrawable(self))) == NULL) + return FALSE; + self->top=fontSummary->maxHeight+5; + + self->my_focus = header_ltext; + for(i=header_ltext;i=header_ltext;i--) textview_Destroy(Textv(self, i)); + return FALSE; + } + } + + bottom = lpair_New(); + self->sections = lpair_New(); + lpair_VSplit (self->sections, Textv(self, header_ltext), bottom, 66, FALSE); + lpair_VSplit (bottom, Textv(self, header_ctext), Textv(self, header_rtext), 50, FALSE); + + self->keystate = keystate_Create(self,newKeymap); + if(!self->keystate) return FALSE; + + lpair_LinkTree(self->sections, self); + + return TRUE; + } + + #if 0 + static void newline(tv,rock) + struct headrtv *tv; + long rock; + { + message_DisplayString(tv,0,"Headers and footers can be only one line long."); + } + #endif + + boolean headrtv__InitializeClass(classID) + struct classheader *classID; + { + struct proctable_Entry *tempProc; + struct classinfo *textvClassInfo=class_Load("textview"); + if(!textvClassInfo) return FALSE; + newKeymap = keymap_New(); + if(!newKeymap) return FALSE; + tempProc = proctable_DefineProc("headrtv-newline", headrtv_MoveOn ,&headrtv_classinfo,NULL, "Goes to next section of the header/footer."); + keymap_BindToKey(newKeymap,"\n",tempProc,0); + keymap_BindToKey(newKeymap,"\r",tempProc,0); + InstallHeaderVariables(); + return TRUE; + } *** contrib/mit/util/headrtv.ch Thu May 30 20:31:26 1991 --- contrib/mit/util/headrtv.ch.NEW Thu May 30 18:43:38 1991 *************** *** 0 **** --- 1,33 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + class headrtv: view { + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + + overrides: + PostKeyState(struct keystate *); + Print(FILE *file,char *processor, char *finalFormat, boolean topLevel); + WantInputFocus(struct view *requestor); + LinkTree(struct view *parent); + Hit (enum view_MouseAction action, long x, long y, long numberOfClicks) returns struct view *; + SetDataObject(struct header *object); + Update(); + ReceiveInputFocus(); + LoseInputFocus(); + FullUpdate(enum view_UpdateType type, long left, long top, long width, long right); + DesiredSize(long width, long height, enum view_DSpass pass, long *dWidth, long *dheight) returns enum view_DSattributes; + methods: + data: + struct fontdesc *font,*bfont,*bifont,*ifont; + struct keystate *keystate; + boolean open; + long top; + long closebox, wherebox; + int my_focus; + struct lpair *sections; + struct textview *textvs[header_TEXTS]; + }; *** contrib/mit/util/popts.c Thu May 30 20:31:36 1991 --- contrib/mit/util/popts.c.NEW Thu May 30 18:43:39 1991 *************** *** 0 **** --- 1,786 ---- + #include + /* sys/types.h in AIX PS2 defines "struct label", causing a type name clash. + Avoid this by temporarily redefining "label" to be something else in the preprocessor. */ + #define label gezornenplatz + #include /* strings.h */ + #undef label + #include + #include + #include + #include + + #include /* For all the strings we pass to the value */ + #include /* ditto */ + #include /* Binding menus */ + #include /* lpairs without lines in between */ + #include /* For when we create the window */ + #include /* Checklist widget */ + #include /* General observer type things */ + #include /* For changing print options */ + #include /* Drawing boxes and stuff */ + #include /* for face codes */ + #include /* For creating the new window in */ + #include /* For the new window */ + #include /* For im_SetInteractionEvent() to DestroyWindow */ + #include /* Shortcuts for the menus */ + #include /* Needed, since we are playing with keymaps */ + #include /* Titles, etc */ + #include /* ditto */ + #include /* General layout */ + #include /* Menus */ + #include /* General messages */ + #include /* For text input - printername */ + + #ifdef POPTS_USE_SUITE + #include /* For the buttons */ + #else /* POPTS_USE_SUITE */ + #include + #include + #endif /* POPTS_USE_SUITE */ + + #include /* General text */ + #include /* To help out with checklists */ + #include /* Our parent */ + + #include + + static boolean debug = FALSE; + #define DEBUG(s) {if (debug) {printf s ; fflush(stdout);}} + #define ENTER(r) DEBUG(("Enter %s(0x%lx)\n", "r", self)) + #define LEAVE(r) DEBUG(("Leave %s(0x%lx)\n", "r", self)) + + /* Keep the following in sync with the values + defined in txttroff.c (we should consolidate + them into a .h file) */ + + #define ENDNOTESONLY FALSE + #define CONTENTSBYDEFAULT FALSE + #define AUTOENUMERATEDEFAULT FALSE + #define DUPLEXBYDEFAULT FALSE + + #define DIMENSION_X 350 + #define DIMENSION_Y 110 + #define INSET_X 1 + #define INSET_Y 1 + + static int CheckType = 0L; + static int NumberOfChecks; + static struct menulist *Menus; + static struct keymap *Keys; + static struct Option options[] = { + #ifdef LANDSCAPE + { "Print in Landscape mode", "doc-landscape", + "Portrait", PROFILETYPESWITCH, "no", "yes", NULL, 0 }, + #endif + + { "Print table of contents with documents", "doc-contents", + "PrintContents", PROFILETYPESWITCH, "yes", "no", NULL, CONTENTSBYDEFAULT }, + + { "Enumerate contents automatically", "doc-enumerate", + "AutoEnumerate", PROFILETYPESWITCH, NULL, NULL, NULL, AUTOENUMERATEDEFAULT }, + + #ifdef POPTSINDEX + { "Print index with documents", "doc-index", + "PrintIndex", PROFILETYPESWITCH, "yes", "no", NULL, 0 }, + + #endif POPTSINDEX + { "Print footnotes at end of documents", "doc-footnotes", + "Endnotes", PROFILETYPEEXISTS, "yes", NULL, NULL, ENDNOTESONLY }, + + { "Swap right and left headers on even pages", "doc-duplex", "Duplex", PROFILETYPESWITCH, "yes", "no", NULL, DUPLEXBYDEFAULT }, + + { NULL, NULL, NULL, PROFILETYPENONE, 0, 0, NULL, 0 } + }; + + int doValueChange(); + void CreateWindow(); + void DestroyWindow(); + struct view *Control(); + void ApplyValues(); + void ResetValues(); + void MenuDone(); + void MenuCancel(); + void PrinterSet(); + void printopts_Nop(); + + static struct bind_Description MenuOptions[] = { + {"printopts-post-window", NULL, 0, "Set Print Options", 0, 0, CreateWindow, "Set options for printing of document", NULL}, + NULL + }; + static struct bind_Description PrivateOptions[] = { + {"printopts-nop", "\012", 0, NULL, 0, 0, printopts_Nop, NULL}, + {"printopts-nop", "\015", 0, NULL, 0, 0, printopts_Nop, NULL}, + {"printopts-apply", NULL, 0, "Apply Values", 0, 0, ApplyValues, NULL}, + {"printopts-done", NULL, 0, "Done", 0, 0, MenuDone, NULL}, + {"printopts-cancel", NULL, 0, "Cancel", 0, 0, MenuCancel, NULL}, + NULL + }; + + /* To communicate resources to valueviews, the strings should be formed + * into atomlists. This is done once for the major strings, to save cycles + */ + static struct atomlist *AL_label; + static struct atomlist *AL_font; + static struct atomlist *AL_checktype; + static struct atomlist *AL_borderwidth; + static struct atom *A_long; + static struct atom *A_string; + #define InternAtoms ( \ + AL_label = atomlist_StringToAtomlist("label") ,\ + AL_font = atomlist_StringToAtomlist("bodyfont") ,\ + AL_checktype = atomlist_StringToAtomlist("checktype") ,\ + AL_borderwidth = atomlist_StringToAtomlist("border-width"), \ + A_long = atom_Intern("long") ,\ + A_string = atom_Intern("string") ) + + + #ifdef POPTS_USE_SUITE + /* THis is not nice, unfortunately there are not many nice ways of doing this */ + #define ApplyCode 1 + #define DoneCode 2 + #define CancelCode 3 + static suite_Specification apply[] = { + suite_ItemCaption("Apply"), + suite_ItemDatum(ApplyCode), + NULL + }; + static suite_Specification done[] = { + suite_ItemCaption("Done"), + suite_ItemDatum(DoneCode), + NULL + }; + static suite_Specification cancel[] = { + suite_ItemCaption("Cancel"), + suite_ItemDatum(CancelCode), + NULL + }; + + suite_Specification control_spec[] = { + #if 0 + suite_Item(apply), + #endif + suite_Item(done), + suite_Item(cancel), + suite_ItemCaptionFontName( "AndySans10b" ), + suite_GutterSize( 5 ), + suite_BorderSize( 0 ), + suite_ItemOrder( suite_ColumnMajor ), + suite_Arrangement( suite_Matrix ), + suite_SelectionMode( suite_Exclusive ), + suite_HitHandler(Control), + NULL + }; + + #else /* POPTS_USE_SUITE */ + /* Structure is linked list of buttons */ + + static char *printopts_bNames[] = + { "Done", "Cancel", NULL }; + + static void (*printopts_bFuncs[])()= + { MenuDone, MenuCancel, NULL }; + + static struct buttonList *printopts_MakeButton(blist, text, function, object) + struct buttonList *blist; + char *text; + void (*function)(); + struct view *object; + /* Creates a new button and with given attributes + returns [newbutton::blist] + */ + { + struct buttonList *button = (struct buttonList *) malloc(sizeof(struct buttonList)); + + button->butt = pushbutton_New(); + button->buttv = pushbuttonview_New(); + pushbutton_SetStyle(button->butt, 1); + pushbutton_SetText(button->butt, text); + pushbuttonview_SetDataObject(button->buttv, button->butt); + pushbuttonview_AddRecipient(button->buttv, atom_Intern("buttonpushed"), object, function, 0L); + + button->next = blist; + return button; + } + + static struct lplist *printopts_MakeLpair(lpl) + struct lplist *lpl; + /* Creates a new lpair and returns [newlpair::lplist] + */ + { + struct lplist *lpair = (struct lplist *) malloc(sizeof(struct lplist)); + + lpair->lp = lpair_New(); + lpair->next = lpl; + return lpair; + } + + + #endif /* POPTS_USE_SUITE */ + + boolean + printopts__InitializeClass(classID) + struct classheader *classID; + { + struct classinfo *viewClassinfo; + + for (NumberOfChecks = 0; options[NumberOfChecks].name != NULL; NumberOfChecks++); + + InternAtoms; + + /* We want one or two of our own local functions */ + Menus = menulist_New(); + Keys = keymap_New(); + bind_BindList(PrivateOptions, Keys, Menus, &printopts_classinfo); + + /* We want our function bound to view, not to self */ + viewClassinfo = class_Load("view"); + if (viewClassinfo != NULL) { + bind_BindList(MenuOptions, NULL, NULL, viewClassinfo); + return TRUE; + } + return FALSE; + } + + #define CheckHeight 20 + + boolean + printopts__InitializeObject(classID, self) + struct classheader *classID; + register struct printopts *self; + { + long i; + struct view *dummy; + struct view *oldchecklist; + #ifndef POPTS_USE_SUITE + struct lplist *lplist = NULL; + struct buttonList *blist = NULL; + #endif /* POPTS_USE_SUITE */ + struct lpair *lp; + char *t; + + ENTER(printopts__InitializeObject); + + self->embedded = TRUE; + self->OnScreen = FALSE; + self->ResourcesPosted = FALSE; + self->keys = keystate_Create(self, Keys); + self->menus = menulist_DuplicateML(Menus, self); + + self->values = (int *)calloc (NumberOfChecks, sizeof(int)); + + /* copyin the options from static storage */ + /* Don't free the strings, they're static */ + for (i = 0; i < NumberOfChecks; i++) + self->values[i] = options[i].value; + + CheckType = environ_GetProfileInt("CheckType", 1); + + self->printername = strinput_New(); + strinput_SetPrompt(self->printername, "Name of printer: "); + t = environ_Get("PRINTER"); + if (t) + strncpy(self->pnamevalue, t, 80); + else + strcpy(self->pnamevalue, ""); + strinput_SetInput(self->printername, self->pnamevalue); + + #ifdef POPTS_USE_SUITE + self->suite = suite_Create(control_spec, self); + #endif /* POPTS_USE_SUITE */ + + dummy = view_New(); + + /* Construct the checklist */ + self->checklist = (struct bpair *) dummy; + for (i = 0; i < NumberOfChecks; i++) { + self->check[i].obj = value_New(); + self->check[i].view = checkv_New(); + /* The rest of the setting up of the options takes place in FullUpdate */ + oldchecklist = (struct view *)self->checklist; + self->checklist = bpair_New(); /* it accumulates */ + bpair_VFixed(self->checklist, oldchecklist, + self->check[i].view, CheckHeight, 0); + } + + lp = lpair_New(); + lpair_VFixed(lp, self->printername, self->checklist, NumberOfChecks*CheckHeight + 2, FALSE); + self->image = lpair_New(); + + #ifdef POPTS_USE_SUITE + self->image = lpair_HSplit(self->image, lp, self->suite, 20, FALSE); + #else /* POPTS_USE_SUITE */ + + /* Yucky code follows! Make the sets of buttons */ + self->blist = NULL; + self->lplist = NULL; + for ( i=0 ; printopts_bNames[i] != NULL ; i++ ) { + self->blist = printopts_MakeButton(self->blist, printopts_bNames[i], printopts_bFuncs[i], (struct view *) self); + if (printopts_bNames[i+1] != NULL) + self->lplist = printopts_MakeLpair(self->lplist); + } /* for - initializing buttons */ + + /* + * The below lines glue the buttons into their lpairs, using the + * linked lists blist and lplist + * The lpairs are split so as each button is the same size + * Making all buttons the same size is done by the code in the while loop, making + * the n'th button be 1/n fraction of the size of the panel. + * i.e. The lpair_HSplit splits it 1/(n+1) to button and n/(n+1) to the previous lpair. + * The entire panel is finally placed into self->buttons + */ + + blist = self->blist; + lplist = self->lplist; + + lpair_VSplit(lplist->lp, blist->next->buttv, blist->buttv, 50, FALSE); + blist = blist->next->next; + i = 2; + while (blist != NULL) { + lpair_VSplit(lplist->next->lp, blist->buttv, lplist->lp, (long int) 100*i/(i+1), FALSE); + lplist = lplist->next; + blist = blist->next; + i++; + } + + self->image = lpair_HSplit(self->image, lp, lplist->lp, 20, FALSE); + + #endif /* POPTS_USE_SUITE */ + + LEAVE(printopts__InitializeObject); + return TRUE; + } + + void + printopts__FinalizeObject(ClassID, self) + struct classhdr *ClassID; + register struct printopts *self; + { + struct bpair *checklist, *nextlist; + struct lpair *leftSide = (struct lpair*) lpair_GetNth(self->image,0); + register int j; + #ifndef POPTS_USE_SUITE + struct buttonList *blist, *next_blist; + struct lplist *lplist, *next_lplist; + #endif /* POPTS_USE_SUITE */ + register struct checkv *v; + register struct value *o; + + ENTER(printopts__FinalizeObject); + if(self->keys) keystate_Destroy(self->keys); + if(self->menus) menulist_Destroy(self->menus); + if(self->values) free(self->values); + + lpair_UnlinkTree(self->image); + lpair_Destroy(self->image); + lpair_Destroy(leftSide); /* Contains strinput and skewed bpair of checkv's. */ + /* + lpair_Destroy(rightSide); /* Contains lplist->lp; We deal with that below. + */ + + strinput_Destroy(self->printername); + + checklist = self->checklist; + for (j = NumberOfChecks - 1; j >= 0; j--) { + o = self->check[j].obj; + v = self->check[j].view; + if(j > 0) { + nextlist = (struct bpair*) bpair_GetNth(checklist, 0); + bpair_Destroy(checklist); + checklist = nextlist; + } + else { + struct view *dummy = bpair_GetNth(checklist, 0); + bpair_Destroy(checklist); + view_Destroy(dummy); + } + checkv_Destroy(v); + /* Disable any callback that may be generated when the value object is destroyed. */ + value_RemoveCallBack(o, self, doValueChange); + if (options[j].func) + value_RemoveCallBack(o, self, options[j].func); + value_RemoveCallBackObserver(o, self); + value_Destroy(o); + } + + #ifdef POPTS_USE_SUITE + suite_Destroy(self->suite); + #else + lplist = self->lplist; + blist = self->blist; + while(lplist) { + next_lplist = lplist->next; + /* We have to set these because we're walking the skewed tree from the bottom. */ + lplist->lp->obj[0] = NULL; + lplist->lp->obj[1] = NULL; + lpair_Destroy(lplist->lp); + free(lplist); + lplist = next_lplist; + } + while(blist) { + next_blist = blist->next; + pushbuttonview_Destroy(blist->buttv); + pushbutton_Destroy(blist->butt); + free(blist); + blist = next_blist; + } + #endif /* POPTS_USE_SUITE */ + LEAVE(printopts__FinalizeObject); + } + + struct frame * + printopts__GetApplicationLayer(self) + struct printopts *self; + { + struct frame *frame; + + self->embedded = FALSE; + frame = frame_New(); + frame_SetView(frame, self); + frame_PostDefaultHandler(frame, "message", frame_WantHandler(frame, "message")); + + return frame; + } + + void + printopts__PostMenus(self, ml) + struct printopts *self; + struct menulist *ml; + { + super_PostMenus(self, self->menus); + } + + void printopts__PostKeyState(self, ks) + struct printopts *self; + struct keystate *ks; + /* Want to add our own keybindings into the chain that gets passed to us */ + { + self->keys->next = NULL; + keystate_AddBefore(self->keys, ks); + super_PostKeyState(self, self->keys); + } + + void + printopts__FullUpdate(self, type, left, top, width, height) + register struct printopts *self; + register enum view_UpdateType type; + register long left, top, width, height; + { + struct rectangle r; + self->OnScreen = (type != view_Remove); + printopts_GetLogicalBounds(self, &r); + DEBUG(("FullUpdate type %d redraw (%d,%d,%d,%d) within (%d,%d,%d,%d)\n", + type, left, top, width, height, r.left, r.top, r.width, r.height)); + + /* Now that we are updating, the views exist, so we can set up those views */ + if (!self->ResourcesPosted) { + register int i; + register struct checkv *v; + register struct value *o; + + /* Checklist */ + ResetValues(self); + for (i = 0; i < NumberOfChecks; i++) { + v = self->check[i].view; + o = self->check[i].obj; + checkv_SetName(v, atomlist_StringToAtomlist(options[i].name)); + checkv_PostResource(v, AL_checktype, A_long, CheckType); + checkv_PostResource(v, AL_borderwidth, A_long, 0L); + checkv_PostResource(v, AL_label, A_string, options[i].label); + checkv_PostResource(v, AL_font, A_string, "andy12"); + value_AddCallBackObserver(o, self, doValueChange, i); + if (options[i].func) + value_AddCallBackObserver(o, self, options[i].func, i); + value_SetValue(o, self->values[i]); + checkv_SetDataObject(v, o); + } + } + self->ResourcesPosted = TRUE; + + if (type == view_FullRedraw && self->embedded && self->OnScreen) { + printopts_SetTransferMode(self, graphic_COPY); + printopts_MoveTo(self, 0, 0); + printopts_DrawLineTo(self, r.width-INSET_X, 0); + printopts_DrawLineTo(self, r.width-INSET_X, r.height-INSET_Y); + printopts_DrawLineTo(self, 0, r.height-INSET_Y); + printopts_DrawLineTo(self, 0, 0); + + r.top+=INSET_Y, r.left+=INSET_X, r.height-=(2*INSET_Y), r.width-=(2*INSET_X); + } + + DEBUG((" Drawable at 0x%lx\n", printopts_GetDrawable(self))); + + if (type != view_PartialRedraw + && type != view_LastPartialRedraw) { + lpair_LinkTree(self->image, self); + lpair_InsertView(self->image, self, &r); + } + lpair_FullUpdate(self->image, type, 0, 0, r.width, r.height); + LEAVE(printopts__FullUpdate); + } + + + void + printopts__Update( self ) + register struct printopts *self; + { + ENTER(printopts__Update); + lpair_Update(self->image); + LEAVE(printopts__Update); + } + + + struct view * + printopts__Hit(self, action, x, y, num_clicks) + register struct printopts *self; + register enum view_MouseAction action; + register long x, y, num_clicks; + { + lpair_Hit(self->image, action, x-INSET_X, y-INSET_Y, num_clicks); + printopts_WantInputFocus(self, self->printername); + return (struct view*) self; + } + + enum view_DSattributes + printopts__DesiredSize( self, width, height, pass, + desiredWidth, desiredHeight ) + register struct printopts *self; + long width; + long height; + enum view_DSpass pass; + long *desiredWidth; + long *desiredHeight; + { + *desiredWidth = 550, *desiredHeight = 322; + DEBUG(("Desired Size %d x %d\n", *desiredWidth, *desiredHeight)); + return view_Fixed; + } + + void + printopts__Print( self, file, processor, format, level ) + register struct printopts *self; + register FILE file; + register char *processor; + register char *format; + register boolean level; + { + /* never print anything */ + } + + + int + doValueChange(self, observed, rock, rock2) + register struct printopts *self; + register struct value *observed; + register long rock; + register long rock2; + { + self->values[rock] = value_GetValue(observed); + } + + void + PrinterSet(self, rock) + register struct printopts *self; + register long rock; + { + strcpy(self->pnamevalue, strinput_GetInput(self->printername, 80)); + } + + /* We use this to override newline self-insert. */ + void + printopts_Nop(self, rock) + register struct printopts *self; + register long rock; + { + } + + void + ResetValues(self) + register struct printopts *self; + { + int i; + char *t; + + for (i = 0; i < NumberOfChecks; i++) { + if (options[i].func == NULL && options[i].env) { + if ((t = environ_Get(options[i].env)) == NULL) { + switch (options[i].profiletype) { + case PROFILETYPENONE: + break; + case PROFILETYPEEXISTS: + if(environ_GetProfile (options[i].env) != NULL) + self->values[i] = 1; + else + self->values[i] = 0; + break; + case PROFILETYPESWITCH: + self->values[i] = environ_GetProfileSwitch (options[i].env, options[i].value); + break; + } + } else { + if (options[i].envOn && strcmp(t, options[i].envOn) == 0) + self->values[i] = 1; + else + self->values[i] = 0; + } + } + } + t = environ_Get("PRINTER"); + if (t) + strncpy(self->pnamevalue, t, 80); + else + strcpy(self->pnamevalue, ""); + strinput_SetInput(self->printername, self->pnamevalue); + } + + #ifdef POPTS_USE_SUITE + struct view * + Control(self, suite, item, object, action, x, y, clicks) + register struct printopts *self; + register struct suite *suite; + register long object; + enum view_MouseAction action; + long x, y, clicks; + { + if ((action == view_LeftUp) || (action == view_RightUp)) { + if(item && (object == suite_ItemObject)) { + switch(suite_ItemAttribute(suite, item, suite_ItemData(0))) { + case ApplyCode: + ApplyValues(self, 0); + break; + case DoneCode: + MenuDone(self, 0); + break; + case CancelCode: + MenuCancel(self, 0); + break; + } + } + } + suite_Reset(suite, suite_Normalize); + return NULL; + } + #endif /* POPTS_USE_SUITE */ + + void + MenuDone(self, rock) + register struct printopts *self; + register long rock; + { + ApplyValues(self, 0); + + /* Avoid destroying window while within pushbuttonv_PullTrigger(). */ + im_ForceUpdate(); + im_EnqueueEvent(DestroyWindow, self, 0); + } + + void + MenuCancel(self, rock) + register struct printopts *self; + register long rock; + { + int i; + + ResetValues(self); + for (i = 0; i < NumberOfChecks; i++) { + value_SetValue(self->check[i].obj, self->values[i]); + } + + /* Avoid destroying window while within pushbuttonv_PullTrigger(). */ + im_ForceUpdate(); + im_EnqueueEvent(DestroyWindow, self, 0); + } + + + void + ApplyValues(self, rock) + register struct printopts *self; + register long rock; + { + int i; + for (i = 0; i < NumberOfChecks; i++) { + if (options[i].func == NULL && options[i].env) { + if (self->values[i]){ + if (options[i].envOn) + environ_Put(options[i].env, options[i].envOn); + else + environ_Delete(options[i].env); + } else { + if (options[i].envOff) + environ_Put(options[i].env, options[i].envOff); + else + environ_Delete(options[i].env); + } + } + } + strcpy(self->pnamevalue, strinput_GetInput(self->printername, 80)); + if (*self->pnamevalue) + environ_Put("PRINTER", self->pnamevalue); + } + + void + CreateWindow(vp, rock) + struct view *vp; + long rock; + { + long left, top, width, height; + struct printopts *self; + struct im *vp_IM, *im; + + message_DisplayString(vp, 0, "Creating Dialog Box. Please Wait."); + im_ForceUpdate(); + + self = printopts_New(); + if (!self) { + message_DisplayString(vp, 100, "Could not create the options.\nPerhaps we're out of memory?"); + return; + } + + im_GetPreferedDimensions(&left, &top, &width, &height); + + #define USEOVERRIDE + + #ifdef USEOVERRIDE + if ((vp_IM = view_GetIM(vp)) == NULL) { + printf ("Attempt to create dialogue box for nonexistant view!\n Creating top level window."); + im_SetPreferedDimensions(left, top, DIMENSION_X, DIMENSION_Y); + im = im_Create(NULL); + } else { + im_SetPreferedDimensions(0, 0,DIMENSION_X, DIMENSION_Y); + im = im_CreateOverride(vp_IM); + } + #else /* USEOVERRIDE */ + im_SetPreferedDimensions(left, top, DIMENSION_X, DIMENSION_Y); + im = im_Create(NULL); + #endif /* USEOVERRIDE */ + if (im) { + im_SetTitle(im, "Print Options"); + im_SetView(im, self); + } else { + message_DisplayString(vp, 100, "Could not create a new window\nPerhaps there isn't enough memory?"); + printopts_Destroy(self); + return; + } + + im_SetPreferedDimensions(left, top, width, height); + message_DisplayString(vp, 0, "Done."); + + printopts_WantInputFocus(self, self->printername); + } + + void + DestroyWindow( self ) + register struct printopts *self; + { + im_Destroy(printopts_GetIM(self)); + printopts_Destroy(self); + } + + void + printopts__LinkTree( self, parent ) + register struct printopts *self; + register struct view *parent; + { + super_LinkTree(self, parent); + if(self->image) + lpair_LinkTree(self->image, self); + } *** contrib/mit/util/popts.ch Thu May 30 20:31:47 1991 --- contrib/mit/util/popts.ch.NEW Thu May 30 18:43:41 1991 *************** *** 0 **** --- 1,75 ---- + #define PROFILETYPENONE 0 + #define PROFILETYPEEXISTS 1 + #define PROFILETYPESWITCH 2 + + struct Option { + char *label; /* The view's prompt */ + char *name; /* Unique name to identify property */ + char *env; /* If it has an environment variable, this is its name */ + int profiletype; /* what kind of value is stored in the profile */ + char *envOn; /* What 'value' the environment variable must + have to make value an 'on'. */ + char *envOff; + procedure func; /* The callback function for value_DATACHANGED */ + int value; /* Set by dataobject for the view and maintained by callbacks */ + }; + + struct Check { + struct value *obj; + struct checkv *view; + }; + + struct buttonList { + struct buttonList *next; + struct pushbutton *butt; + struct pushbuttonview *buttv; + }; + + struct lplist { + struct lplist *next; + struct lpair *lp; + }; + + #define MAXCHECKS 10 + + class printopts [popts] : view { + overrides: + + FullUpdate(enum view_UpdateType type, + long left, long top, long width, long height); + Update(); + Hit(enum view_MouseAction action, long x, long y, long n) + returns struct view *; + DesiredSize(long width, long height, enum view_DSpass pass, + long *desiredWidth, long *desiredHeight) + returns enum view_DSattributes; + Print(FILE *file, char *processor, char *finalFormat, boolean topLevel); + GetApplicationLayer() returns struct frame *; + PostKeyState(struct keystate *ks); + PostMenus(struct menulist *ml); + LinkTree(struct view *parent); + + classprocedures: + + InitializeClass() returns boolean; + InitializeObject(struct thisobject *self) returns boolean; + FinalizeObject(struct thisobject *self); + + data: + + boolean embedded; + boolean ResourcesPosted; + struct lpair *image; + struct Check check[MAXCHECKS]; + struct bpair *checklist; + int *values; + struct strinput *printername; + char pnamevalue[81]; + + struct suite *suite; + struct menulist *menus; + struct keystate *keys; + boolean OnScreen; + struct lplist *lplist; + struct buttonList *blist; + }; *** contrib/mit/util/vutils.c Thu May 30 20:31:58 1991 --- contrib/mit/util/vutils.c.NEW Thu May 30 18:43:43 1991 *************** *** 0 **** --- 1,115 ---- + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/vutils.c,v 1.2 91/05/05 21:06:55 gk5g Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/vutils.c,v $ */ + /* $Author: gk5g $ */ + + #ifndef lint + static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/vutils.c,v 1.2 91/05/05 21:06:55 gk5g Exp $"; + #endif /* lint */ + + /************************************************* + * View utility package + * Contains stuff useful to all views. + *************************************************/ + + /************************************************* + * Copyright (C) 1990 by the Massachusetts Institute of Technology + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby + * granted without fee, provided that the above copyright notice + * appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, + * and that the name of M.I.T. not be used in advertising or + * publicity pertaining to distribution of the software without + * specific, written prior permission. M.I.T. makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + *************************************************/ + + + #include + + #include + + #include + + #include + #include + #include + #include + #include + #include + + #include + + #define DIALOG 100 + #define MESSAGE 0 + + /* Routines appear in this file in "bottom-up" order. */ + /* This is so I don't have to deal with declaring forward */ + /* references. */ + + /* Added friendly read-only behavior from txtvcmds.c */ + + #define H_D_STRING "Help Could not start. It was " + + static void helpDeath (pid, self, status) + int pid; + struct view *self; + union wait *status; + { + char buf[128],*em,*statustostr(); + + strcpy(buf, H_D_STRING); + em=statustostr(status, buf+strlen(H_D_STRING, 128 - strlen(H_D_STRING))); + if (em == NULL) { + /* successful completion */ + message_DisplayString(self, MESSAGE, "If you don't see a help window now, something is wrong."); + } else { + message_DisplayString(self, MESSAGE, buf); + } + } + + static void forkhelpproc (self, key) + struct view *self; + long key; + { + char *helpname = environ_AndrewDir("/bin/help"); + int pid, fd; + + switch (pid = osi_vfork()) { + case 0: + for (fd = getdtablesize(); fd > 2; --fd) close(fd); + execl(helpname, helpname, im_GetProgramName(), 0); + printf ("Exec of %s failed.\n", helpname); + fflush (stdout); + _exit(-1); + case -1: + message_DisplayString(self, DIALOG, "Could not start the help!"); + break; + default: + message_DisplayString(self, MESSAGE, "A Help window should appear shortly."); + im_AddZombieHandler(pid, helpDeath, (long)self); + break; + } + return; + } + + boolean vutils__InitializeClass(classID) + struct classheader *classID; + { + static struct bind_Description compat_fns[] = { + {"vutils-fork-help", NULL, 0, NULL, 0, 0, forkhelpproc, "Call Andrew help in a new process.", "vutils"}, + + {NULL}, + }; + struct classinfo *viewClassinfo; + + viewClassinfo = class_Load("view"); + if (viewClassinfo != NULL) { + bind_BindList(compat_fns, NULL, NULL, viewClassinfo); + return TRUE; + } + else + return FALSE; + } *** contrib/mit/util/vutils.ch Thu May 30 20:32:09 1991 --- contrib/mit/util/vutils.ch.NEW Thu May 30 18:43:45 1991 *************** *** 0 **** --- 1,26 ---- + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/vutils.ch,v 1.1 91/04/02 19:34:56 gk5g Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/vutils.ch,v $ */ + + #ifndef lint + static char *rcsidvutils = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/util/RCS/vutils.ch,v 1.1 91/04/02 19:34:56 gk5g Exp $"; + #endif /* lint */ + + /************************************************* + * Copyright (C) 1990 by the Massachusetts Institute of Technology + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby + * granted without fee, provided that the above copyright notice + * appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, + * and that the name of M.I.T. not be used in advertising or + * publicity pertaining to distribution of the software without + * specific, written prior permission. M.I.T. makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + *************************************************/ + + package vutils { + classprocedures: + InitializeClass() returns boolean; + }; *** contrib/mit/annot/Imakefile Thu May 30 20:32:19 1991 --- contrib/mit/annot/Imakefile.NEW Thu May 30 18:43:55 1991 *************** *** 0 **** --- 1,13 ---- + DOBJS = note.do icon.do ps.do noteview.do iconview.do psview.do + IHFILES = note.ih icon.ih ps.ih noteview.ih iconview.ih psview.ih + + NormalObjectRule() + NormalATKRule() + + InstallClassFiles($(DOBJS), ${IHFILES}) + + DependTarget() + + NormalHelpRule() + InstallDocs(psinset.help, ${DESTDIR}/help) + InstallHelpAlias(psinset, ps-inset postscript postscript-inset) *** contrib/mit/annot/icon.ch Thu May 30 20:32:29 1991 --- contrib/mit/annot/icon.ch.NEW Thu May 30 18:43:56 1991 *************** *** 0 **** --- 1,19 ---- + class icon : dataobject[dataobj] { + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + overrides: + Read (FILE *file, long id) returns long; + Write (FILE *file, long writeid, int level) returns long; + methods: + SetSize(long w,long h); + GetSize(long * w, long * h); + SetChild(struct dataobject * child); + GetChild() returns struct dataobject *; + SetTitle(char * title); + GetTitle() returns char *; + data: + struct dataobject * child; + long width, height; + char * title; + }; *** contrib/mit/annot/note.c Thu May 30 20:32:40 1991 --- contrib/mit/annot/note.c.NEW Thu May 30 18:43:58 1991 *************** *** 0 **** --- 1,55 ---- + #include "class.h" + #include "text.ih" + #include "note.eh" + #include + #include + + + /****************************************************************/ + /* private functions */ + /****************************************************************/ + + + + /****************************************************************/ + /* class procedures */ + /****************************************************************/ + boolean + note__InitializeClass(classID) + struct classheader * classID; + { + return TRUE; + } + + boolean + note__InitializeObject(classID,self) + struct classheader * classID; + struct note * self; + { + struct text * to; + uid_t uid; + struct passwd *userentry; + + uid = getuid(); + userentry = getpwuid(uid); + note_SetTitle(self,userentry->pw_name); + + to = text_New(); + text_SetReadOnly(to,0); + note_SetChild(self,to); + return TRUE; + } + + /****************************************************************/ + /* instance methods */ + /****************************************************************/ + + void + note__SetChild(self,child) + struct note * self; + struct dataobject * child; + { + super_SetChild(self,child); + if (child != (struct dataobject *)0) + text_SetReadOnly((struct text *)child, 0); + } *** contrib/mit/annot/noteview.ch Thu May 30 20:32:50 1991 --- contrib/mit/annot/noteview.ch.NEW Thu May 30 18:43:59 1991 *************** *** 0 **** --- 1,12 ---- + class noteview : iconview + { + overrides: + Print(FILE *file, char *processor, char *finalFormat, boolean topLevel); + PostMenus(struct menulist *menulist); + methods: + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + data: + struct menulist *menus; + }; *** contrib/mit/annot/psinset.help Thu May 30 20:33:00 1991 --- contrib/mit/annot/psinset.help.NEW Thu May 30 18:44:01 1991 *************** *** 0 **** --- 1,219 ---- + \begindata{text,271521636} + \textdsversion{12} + \template{help} + \define{footnote + } + \define{title + } + \chapter{PSinset: PostScript inclusion in EZ + + } + \section{What psinsets are + + }\leftindent{ + A psinset is an\italic{ inset} which allows you to include a piece of + PostScript text -- a chart, picture, specially formatted text, another + document, or anyting else in the PostScript language. + + + Following is a psinset: + + 270 244 1 432 324 \title{PostScript} + + Click once on the funny character to open it. Click once on its title bar to + close it. + + + The psinset is a text object with a scrollbar whose purpose is to hold + postscript commands and to print them correctly in the document. + + } + \section{Overivew + + } + \leftindent{This help file will introduce you to the use of ez PostScript + insets. It assumes that you are reasonably familiar with some of the general + options discussed in the introductory \italic{ez } help file. This document + has the following sections: + + + \leftindent{Making a psinset + + Resizing a psinset + + Deleting a psinset + + Printing and Previewing with psinsets + + Popup Menu meanings + + Warnings + + Advice + + Related Tools. + + }} + \section{Making a psinset + + + }\leftindent{To insert a psinset into a working document, position the text + caret where you want the psinset to appear, and select \bold{Insert PostScript + }from the \bold{Special} menu card or type ps (the escape key + followed by the tab key, then "ps" when prompted for the name of the object.). + EZ places a PostScript inset at that point to indicate the presence of a + PostScript program.. You may then all the usual EZ commands to put PostScript + commands into this box. + + } + + \section{Resizing a psinset} + + + \leftindent{The size of the "PostScript" inset on the screen and the size of + the area which will be reserved blank for its contents to fit themselves into + when the ez file is previewed or printed are totally unrelated. + + + \subsection{Resizing the box on the screen} + + + Position the cursor precisely over either the right or bottom border of the + PostScript box, until the cursor changes to a double arrow. Click and hold + the left or right mouse button, and drag the border out to its new position, + then release the mouse button. + + + \subsection{Resizing the printing space of the inset} + + + Select from the \italic{PostScript} menu card either \bold{Set Inch Size} to + specify the size in inches, or \bold{Set Pixel Size} to specify the size in + pixels. You will be prompted for first the width and then the height of the + area to be reserved blank when the document is previewed or printed so that + your PostScript may be printed there (see\bold{ Warnings} and\bold{ Advice} + below). + + } + \section{Deleting a psinset} + + \leftindent{ + To delete a PostScript entry, position the text caret to the right of the + PostScript inset and type either the delete or backspace key. The message, + + + \leftindent{Really delete inset(s)?} + + + is printed in a dialogue box. Click in the appropriate box: either \bold{yes} + to confirm or \bold{no} to abort the deletion. When properly deleted, the + entire PostScript entry vanishes leaving only the text caret in its place.} + + + + \section{Printing and Previewing with psinsets}\leftindent{ + + } + \leftindent{To see how the document will appear in the final printout, choose + the \bold{Preview} option from the \italic{File} menu. EZ opens a separate + Preview window that displays a picture of the final document as it will appear + when printed. For more information, see the \italic{preview }help document. + + + A space which can be set with the Set Pixel Size and Set Inch Size commands + will be reserved blank at th elocation of the psinset in the document. The + PostScript code will not be translated and will not appear in the window -- + you will only see the position and size of the spave left for it. To see what + the translated PostScript will look like, you must use the \bold{Print} option + from the\italic{ File} menu. See \bold{Warnings }and\bold{ Advice }below. + + } + \section{Pop-up menu meanings + + }\leftindent{ + \subsection{Set Inch Size} + + Prompts first for width and then for height of the area to be reserved in the + previewed or printer document for the PostScript program, in inches. + + + \subsection{Set Pixel Size} + + Prompts first for width and then for height of the area to be reserved in the + previewed or printer document for the PostScript program, in pixels. There + are 72 pixels per inch. + + + See \bold{Warnings }and \bold{Advice}. + + } + \section{Warnings + + }\leftindent{ + You are entirely responsible for the validity and visibility of your + PostScript code included in the inset. No interpretation or checking of the + PostScript is done at this time. + + + The size of the open PostScript inset on the screen and the size of the blank + area reserved for the code in the previewed or printer document are totally + unrelated. + + + Use the \bold{Set Pixel Size} and \bold{Set Inch Size} commands to ensure a + proper area on the page, and then test and check your PostScript code to see + that it fits where the space is reserved for it. The PostScript inset will + clip the figure to the size you gave unless your PostScript code issues its + own \typewriter{clip} command. + + + }\section{Advice + + + }\leftindent{It is easy and nearly default to create a valid PostScript + inclusion which obligingly places itself several inches off the page where you + told it to go, so that it is completely invisible when printed. + + + Check for boundingbox, scale, and rotation commands, and include them as early + in the PostScript text if possible. Future versions of psinset will try to + make sure that the included PostScript and the area allocated for it on the + page are compatible, but at this point keeping an image to the lower left of + the page when creating it, and scaling it down with, for example, ".3 .3 + scale" when first attempting to proofread the document will help keep it from + being printed over the text above it on the page or, worse yet, somewhere off + the page where it can't be seen. + + + Rotating a PostScript page rotates it about its upper left corner, effectively + placing it off the page unless an appropriate offset is also used. + + } + \section{Related tools} + + + \leftindent{Select (highlight) one of the italicized names and choose "Show + Help on Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{\italic{ez + + ez-contents + + ez-index + + ezprint + + insets + + preview + + + }}}\leftindent{ + }\section{Program Author} + + + Paul Boutin, MIT Project Athena, paul@athena.mit.edu + + + \enddata{text,271521636} *** contrib/mit/annot/iconview.c Thu May 30 20:33:10 1991 --- contrib/mit/annot/iconview.c.NEW Thu May 30 18:44:03 1991 *************** *** 0 **** --- 1,565 ---- + #include + #include "rect.h" + #include "class.h" + #include "text.ih" + #include "textv.ih" + #include "view.ih" + #include "graphic.ih" + #include "fontdesc.ih" + #include "icon.ih" + #include "dataobj.ih" + #include "iconview.eh" + #include "bind.ih" + #include "menulist.ih" + #include "keymap.ih" + #include "buffer.ih" + #include + + + + + static struct iconview *First; + + /* Global determines if new icon views will draw open or closed. */ + static int iconopen = TRUE; /* default initial closed */ + + /* default values for closed icon character */ + #define ICONFONT "icon" + #define ICONSTYLE fontdesc_Plain + #define ICONPTS 12 + #define ICONCHAR '4' + #define TITLEFONT "andysans" + #define TITLESTYLE fontdesc_Plain + #define TITLEPTS 12 + #define WIDTH 200 + #define HEIGHT 100 + #define HANDLE 17 + + /****************************************************************/ + /* private functions */ + /****************************************************************/ + + /* Draw the iconview in the case when its open (subview visable) */ + static void + DrawOpen(self, type, ax, ay, aw, ah) + struct iconview * self; + enum view_UpdateType type; + long ax,ay,aw,ah; /* area "A"ffected by this fullupdate */ + { + long x,y,w,h; /* my coordinate space */ + long cx, cy, cw, ch; /* my "C"hilds coordinate space */ + long handle_height; + long tx, ty, tw, th; /* "T"itle coordinate space */ + struct FontSummary * titlesummary; + short * titlefontwidths; + char * title = malloc(1024); + + if (self->neednewsize) { + self->neednewsize = 0; + iconview_WantNewSize(self,self); + return; + } + + + + /* Get my size. Are width and height returning bogosity? */ + x = iconview_GetLogicalLeft(self); + y = iconview_GetLogicalTop(self); + w = iconview_GetLogicalWidth(self) - 1; + h = iconview_GetLogicalHeight(self) - 1; + + /* Draw a frame */ + iconview_SetTransferMode(self, graphic_COPY); + iconview_DrawRectSize(self, x, y, w, h); + + /* With a gray stripe on top. */ + handle_height = MIN(HANDLE,h); + iconview_FillRectSize(self, x+1, y+1, w-1, handle_height-1, iconview_GrayPattern(self,4,16)); + + if (self->titlefont == (struct fontdesc *)0) + self->titlefont = fontdesc_Create(TITLEFONT, TITLESTYLE, TITLEPTS); + titlesummary = fontdesc_FontSummary(self->titlefont, self->header.view.drawable); + titlefontwidths = fontdesc_WidthTable(self->titlefont, self->header.view.drawable); + + /* get the title and calculate its width */ + title = icon_GetTitle((struct icon *) self->header.view.dataobject); + tw = MIN((string_width(title, self->titlefont, self->header.view.drawable) + + (*title ? titlesummary->maxSpacing : 0)), + w - 2); /* add one-character-width padding if title is non-null */ + th = MIN(titlesummary->maxHeight, handle_height - 2); + tx = x + (w - tw) / 2; + ty = y + (handle_height - th) / 2; + + /* draw the title */ + iconview_SetTransferMode(self, graphic_WHITE); + iconview_FillRectSize(self, tx, ty, tw, th, graphic_WHITE); + iconview_SetTransferMode(self, graphic_BLACK); + iconview_SetFont(self, self->titlefont); + iconview_MoveTo(self, x + w / 2, y + handle_height / 2); + iconview_DrawString(self, title, (graphic_BETWEENLEFTANDRIGHT | graphic_BETWEENTOPANDBOTTOM)); + + /* cacluate place for children */ + cx = x + 1; /* one pixel frame */ + cy = y + handle_height; + cw = w - 2; /* two one pixel sides */ + ch = h - handle_height - 1; /* handle and frame at bottom */ + + if (self->child != (struct view *)0) { + /* is this the right place to do this? (inside my fullupdate)*/ + view_InsertViewSize(self->child, self, cx, cy, cw, ch); + + /* calculate the fullupdate coordinates in childs space */ + ax = ax - cx; + ay = ay - cy; + if (ax + aw > cx + cw) + aw = cx + cw - ax; + if (ay + ah > cx + ch) + ah = cy + ch - ay; + + view_FullUpdate(self->child, type, ax, ay, aw, ah); + } + + /* record childs extents */ + self->cx = cx; + self->cy = cy; + self->cw = cw; + self->ch = ch; + + /* remember our size so we can rerequest it if necessary */ + iconview_RecommendSize(self, w+1, h+1); + + } + + + + /* Draw the iconview when it is closed (subview invisible) */ + static void + DrawClosed(self, type, ax, ay, aw, ah) + struct iconview * self; + enum view_UpdateType type; + long ax,ay,aw,ah; /* area "A"ffected by this fullupdate */ + { + long x,y; + struct fontdesc_charInfo iconinfo; + short iconx, icony; + + if (self->neednewsize) { + self->neednewsize = 0; + iconview_WantNewSize(self,self); + return; + } + /* Get my icon font. Is this sure not to return NULL? */ + if (self->iconfont == (struct fontdesc *)0) + self->iconfont = fontdesc_Create(ICONFONT, ICONSTYLE, ICONPTS); + fontdesc_CharSummary(self->iconfont, self->header.view.drawable, + self->iconchar, &iconinfo); + iconx = iconinfo.xOriginOffset; + icony = iconinfo.yOriginOffset; + + /* Get my size. Are width and height returning bogosity? */ + x = iconview_GetLogicalLeft(self); + y = iconview_GetLogicalTop(self); + + iconview_SetFont(self, self->iconfont); + iconview_SetTransferMode(self, graphic_BLACK); + iconview_MoveTo(self, x + iconx, y + icony); + iconview_DrawText(self, &(self->iconchar), 1, graphic_NOMOVEMENT); + } + + + static + SlayChild(self) + struct iconview * self; + { + int twoviews; + if (self->child != (struct view *)0) { + if (self->isopen) + view_UnlinkTree(self->child); + twoviews = self->child != self->bottomview; + view_Destroy(self->child); + if (twoviews) + view_Destroy(self->bottomview); + self->child = (struct view *)0; + self->bottomview = (struct view *)0; + } + } + + + static + AdoptNewChild(self,dobj) + struct iconview * self; + struct icon * dobj; + { + long x,y; + char * viewclass; + struct dataobject * d; + + SlayChild(self); + + d = icon_GetChild((struct icon *)dobj); + + if (d != (struct dataobject *)0) { + viewclass = dataobject_ViewName(d); + self->child = (struct view *)0; + self->bottomview = (struct view *)class_NewObject(viewclass); + if (self->bottomview != (struct view *)0) { + view_SetDataObject(self->bottomview,d); + self->child = view_GetApplicationLayer(self->bottomview); + if (self->isopen) { + view_LinkTree(self->child,self); + iconview_WantUpdate(self,self); + } + } + } + icon_GetSize((struct icon *)dobj, &x, &y); + iconview_RecommendSize(self,x,y); + self->neednewsize = 1; + } + + + + + + string_width(string, font, graphic) + char * string; + struct fontdesc * font; + struct graphic * graphic; + { + short * widthtable, totalwidth = 0; + widthtable = fontdesc_WidthTable(font, graphic); + while (*string) + totalwidth = totalwidth + widthtable[*string++]; + return(totalwidth); + } + + + /****************************************************************/ + /* class procedures */ + /****************************************************************/ + + boolean + iconview__InitializeClass(classID) + struct classheader * classID; + { + First = NULL; + return TRUE; + } + + + void iconview__GetOrigin(self, width, height, originX, originY) + struct view *self; + long width; + long height; + long *originX; + long *originY; + { + *originX = 0; + *originY = 14; + } + + boolean + iconview__InitializeObject(classID, self) + struct classheader * classID; + struct iconview * self; + { + self->isopen = iconopen; + self->dw = WIDTH; + self->dh = HEIGHT; + self->child = (struct view *)0; + self->bottomview = (struct view *)0; + self->neednewsize = 0; + self->next = First; + self->iconchar = ICONCHAR; + self->iconfont = fontdesc_Create(ICONFONT, ICONSTYLE, ICONPTS); + self->titlefont = fontdesc_Create(TITLEFONT, TITLESTYLE, TITLEPTS); + First = self; + return TRUE; + } + + + void + iconview__FinalizeObject(classID, self) + struct classheader * classID; + struct iconview * self; + { + struct iconview *p; + if(self == First){ + First = self->next; + } + else { + for(p=First; p != NULL ; p = p->next){ + if(p->next == self){ + p->next = self->next; + break; + } + } + } + SlayChild(self); + } + + void + iconview__CloseRelated(classID, v) + struct classheader * classID; + struct view *v; + { + struct iconview *p; + struct im *im; + + iconopen = FALSE; /* All new notes draw closed. */ + + im = view_GetIM(v); + if(im == NULL) return; + for(p=First; p != NULL ; p = p->next){ + if(p->isopen == TRUE && im == iconview_GetIM(p)) iconview_Close(p); + } + } + + void + iconview__OpenRelated(classID, v) + struct classheader * classID; + struct view *v; + { + struct iconview *p; + struct im *im; + + iconopen = TRUE; /* All new notes draw open. */ + + im = view_GetIM(v); + if(im == NULL) return; + for(p=First; p != NULL ; p = p->next){ + if(p->isopen == FALSE && im == iconview_GetIM(p)) iconview_Open(p); + } + } + /****************************************************************/ + /* instance methods */ + /****************************************************************/ + + void + iconview__FullUpdate(self, type, x, y, w, h) + struct iconview * self; + enum view_UpdateType type; + long x,y,w,h; + { + + if (type == view_FullRedraw + || type == view_PartialRedraw + || type == view_LastPartialRedraw) { + if (self->isopen) { + DrawOpen(self, type, x, y, w, h); + } else { + DrawClosed(self, type, x, y, w, h); + } + } + } + + + enum view_DSattributes + iconview__DesiredSize(self, w, h, pass, dw, dh) + struct iconview * self; + long w, h; + enum view_DSpass pass; + long *dw, *dh; + { + struct fontdesc_charInfo iconinfo; + if (!self->isopen) { + fontdesc_CharSummary(self->iconfont, self->header.view.drawable, + self->iconchar, &iconinfo); + *dw = iconinfo.width; + *dh = iconinfo.height; + return (view_Fixed); + } else { + *dw = self->dw; + *dh = self->dh; + iconview_DecidedSize(self, self->dw, self->dh); + return (view_WidthFlexible | view_HeightFlexible); + } + + } + + + struct view * + iconview__Hit(self, action, x, y, clicks) + struct iconview * self; + enum view_MouseAction action; + long x,y; + long clicks; + { + if (self->isopen) { + if (self->child != (struct view *)0 && + x >= self->cx && + y >= self->cy && + x < self->cx + self->cw && + y < self->cy + self->ch) { + x -= self->cx; + y -= self->cy; + return view_Hit(self->child, action, x, y, clicks); + } else { + if (y < self->cy + && action == view_LeftUp + || action == view_RightUp) { + struct view *v; + iconview_Close(self); + v = (struct view *) self; + v = v->parent; + if(v != NULL && strcmp(class_GetTypeName(v),"matte") == 0) + v = v->parent; + if(v) + view_WantInputFocus(v,v); + } + return (struct view *)self; + } + } else { + if (action == view_LeftUp || action == view_RightUp) { + iconview_Open(self); + if (self->child != (struct view *)0) { + view_WantInputFocus(self->bottomview, + self->bottomview); + } else { + iconview_WantInputFocus(self, self); + } + + } else + return (struct view *)self; + } + return (struct view *)self; + } + + void + iconview__ReceiveInputFocus(self) + struct iconview *self; + { + if (self->isopen && self->child != (struct view *)0) { + view_WantInputFocus(self->bottomview, + self->bottomview); + } else { + struct view *parent = ((struct view *)self)->parent; + while (parent && !class_IsTypeByName (class_GetTypeName(parent), "textview")) + parent = parent->parent; + if (parent) view_WantInputFocus(parent, parent); + } + } + + + void + iconview__Close(self) + struct iconview *self; + { + if(self->isopen == TRUE){ + self->isopen = FALSE; + if (self->child != (struct view *)0) + view_UnlinkTree(self->child); + iconview_WantNewSize(self,self); + } + } + void + iconview__Open(self) + struct iconview *self; + { + if(self->isopen == FALSE){ + self->isopen = TRUE; + iconview_WantNewSize(self,self); + if (self->child != (struct view *)0) { + view_LinkTree(self->child, self); + } + } + } + + void + iconview__RecommendSize(self, w, h) + struct iconview * self; + long w; + long h; + { + if (w > 0 && h > 0) { + self->dw = w; + self->dh = h; + } + } + + + + void + iconview__DecidedSize(self, w, h) + struct iconview * self; + long w; + long h; + { + icon_SetSize((struct icon *)self->header.view.dataobject,w,h); + } + + + + void + iconview__SetDataObject(self,dobj) + struct iconview * self; + struct dataobject * dobj; + { + super_SetDataObject(self,dobj); + AdoptNewChild(self,(struct icon *)dobj); + } + + + void + iconview__ObservedChanged(self, data, value) + struct iconview * self; + struct thisobject * data; + long value; + { + if (value != observable_OBJECTDESTROYED) { + AdoptNewChild(self,(struct icon *)data); + } else { + SlayChild(self); + } + } + + void + iconview__UnlinkTree(self) + struct iconview * self; + { + super_UnlinkTree(self); + if (self->child != (struct view *)0) + view_UnlinkTree(self->child); + } + + void + iconview__SetIconFont(self,iconfont,iconstyle,iconpts) + struct iconview * self; + char * iconfont; + int iconstyle; + int iconpts; + { + + self->iconfont = fontdesc_Create(iconfont, iconstyle, iconpts); + } + + #if 0 + void + iconview__SetIconFontname (self,name) + struct iconview * self; + char *name; + { + self->iconfont = (struct fontdesc *)0; /* force replacement */ + if (self->iconfontname) free (self->iconfontname); + self->iconfontname = malloc(strlen(name) +1); + bcopy (name, self->iconfontname, strlen(name)); + } + #endif + + void + iconview__SetIconChar(self,iconchar) + struct iconview * self; + char iconchar; + { + self->iconchar = iconchar; + } + + void + iconview__SetTitleFont(self,titlefont,titlestyle,titlepts) + struct iconview * self; + char * titlefont; + int titlestyle; + int titlepts; + { + + self->titlefont = fontdesc_Create(titlefont, titlestyle, titlepts); + } *** contrib/mit/annot/note.ch Thu May 30 20:33:20 1991 --- contrib/mit/annot/note.ch.NEW Thu May 30 18:44:05 1991 *************** *** 0 **** --- 1,10 ---- + class note : icon { + overrides: + SetChild(struct dataobject * child); + methods: + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + data: + }; + *** contrib/mit/annot/ps.c Thu May 30 20:33:31 1991 --- contrib/mit/annot/ps.c.NEW Thu May 30 18:44:07 1991 *************** *** 0 **** --- 1,233 ---- + #include "class.h" + #include "dataobj.ih" + #include "dict.ih" + #include "ps.eh" + #include "text.ih" + #define WIDTH 438 + #define HEIGHT 244 + + /* image dimensions in 72 dot/inch pixels */ + #define HALF_PAGE_WIDTH 432 + #define HALF_PAGE_HEIGHT 324 + + + /****************************************************************/ + /* private functions */ + /****************************************************************/ + + static check_for_title(self, file) + struct ps * self; + FILE * file; + { + char * match = "title{"; + char title[1024]; + char c; + int x; + + while (*match != '\0') { + c = fgetc(file); + if (c == EOF) + return dataobject_PREMATUREEOF; + if (c != *match){ + ungetc(c,file); + ps_SetTitle(self,""); + return dataobject_NOREADERROR; + } + ++match; + } + + if((c = fgetc(file))!= '\n') + ungetc(c,file); + x = 0; + while ((c = fgetc(file)) != '}') { + if (c == EOF) + return dataobject_PREMATUREEOF; + if (c == '\\') + if ((c = fgetc(file)) != EOF) + title[x] = c; + else return dataobject_PREMATUREEOF; + else + title[x] = c; + if (++x == 1024) + return dataobject_BADFORMAT; + } + title[x] = '\0'; + ps_SetTitle(self,title); + + while ((c = fgetc(file)) != '\\') + if (c == EOF) + return dataobject_PREMATUREEOF; + return dataobject_NOREADERROR; + } + + + + /****************************************************************/ + /* class procedures */ + /****************************************************************/ + boolean + ps__InitializeClass(classID) + struct classheader * classID; + { + return TRUE; + } + + boolean + ps__InitializeObject(classID,self) + struct classheader * classID; + struct ps * self; + { + struct text * to; + + to = text_New(); + text_SetReadOnly(to,0); + ps_SetChild(self,to); + ps_SetTitle(self,"PostScript"); + ps_SetSize(self, WIDTH, HEIGHT); + ps_SetPixelWidth(self, HALF_PAGE_WIDTH); + ps_SetPixelHeight(self, HALF_PAGE_HEIGHT); + return TRUE; + } + + /****************************************************************/ + /* instance methods */ + /****************************************************************/ + + void + ps__SetChild(self,child) + struct ps * self; + struct dataobject * child; + { + super_SetChild(self,child); + if (child != (struct dataobject *) 0) + text_SetReadOnly((struct text *) child, 0); + } + + long + ps__Write(self, file, writeID, level) + struct ps *self; + FILE *file; + long writeID; + int level; + { + int haschild = 0; + long w, h, pw, ph; + char * title = ps_GetTitle(self); + struct dataobject *childob = ps_GetChild(self); + + if (ps_GetWriteID(self) != writeID) { + ps_SetWriteID(self,writeID); + if (childob != (struct dataobject *)0) + haschild = 1; + ps_GetSize(self, &w, &h); + pw = ps_GetPixelWidth(self); + ph = ps_GetPixelHeight(self); + fprintf(file, "\\begindata{%s,%ld}\n", class_GetTypeName(self),ps_GetID(self)); + fprintf(file, "%ld %ld %d %ld %ld \n", w, h, haschild, pw, ph); + + fprintf(file,"\\title{"); + while (*title != '\0') { + if (*title == '\\') + fputs("\\\\", file); + else if (*title == '}') + fputs("\\}", file); + else + fputc(*title, file); + title++; + } + fputs("}\n",file); + + if (haschild) + dataobject_Write(childob,file, + self->header.dataobject.writeID, + 2); + fprintf(file, "\\enddata{%s,%ld}\n", class_GetTypeName(self),ps_GetID(self)); + } + + return ps_GetID(self); + } + + long + ps__Read(self,file,id) + struct ps * self; + FILE * file; + long id; + { + long x, y, haschild, width, height; + long objectid; + int c; + char *match; + char datatype[1024]; + struct dataobject * newobject; + long status; + + newobject = ps_GetChild(self); + + if (newobject != (struct dataobject *)0) + /* has the effect of destroying the child */ + ps_SetChild(self, (struct dataobject *)0); + + ps_SetID(self,ps_UniqueID(self)); + + fscanf(file,"%ld %ld %d %ld %ld", &x, &y, &haschild, &width, &height); + ps_SetSize(self, x, y); + ps_SetPixelWidth(self, width); + ps_SetPixelHeight(self, height); + + while ((c = fgetc(file)) != '\\') + if (c == EOF) + return dataobject_PREMATUREEOF; + + if (check_for_title(self, file) != dataobject_NOREADERROR) + return dataobject_BADFORMAT; + + newobject = (struct dataobject *)0; + if (haschild) { + match = "begindata{"; + while (*match != '\0') { + c = fgetc(file); + if (c == EOF) + return dataobject_PREMATUREEOF; + if (c != *match) + return dataobject_BADFORMAT; + ++match; + } + if((c = fgetc(file))!= '\n') + ungetc(c,file); + x = 0; + while ((c = fgetc(file)) != ',') { + if (c == EOF) + return dataobject_PREMATUREEOF; + datatype[x] = c; + if (++x == 1024) + return dataobject_BADFORMAT; + } + datatype[x] = '\0'; + objectid = 0; + while ((c = fgetc(file)) != '}') { + if (c == EOF) + return dataobject_PREMATUREEOF; + if(c >= '0' && c <= '9') + objectid = objectid * 10 + c - '0'; + } + + if((c = getc(file))!= '\n') + ungetc(c,file); + + newobject = (struct dataobject *)class_NewObject(datatype); + if (newobject == (struct dataobject *)0) + return dataobject_OBJECTCREATIONFAILED; + dictionary_Insert(NULL,(char *)objectid, (char *)newobject); + status = dataobject_Read(newobject, file, objectid); + if (status != dataobject_NOREADERROR) + return status; + } + /* adapt a cavalier attitude towards enddata */ + while ((c = fgetc(file)) != '\n') + if (c == EOF) + break; + + ps_SetChild(self,newobject); /* might be null */ + + return dataobject_NOREADERROR; + } *** contrib/mit/annot/psview.c Thu May 30 20:33:40 1991 --- contrib/mit/annot/psview.c.NEW Thu May 30 18:44:08 1991 *************** *** 0 **** --- 1,284 ---- + #include "class.h" + #include "view.ih" + #include "textv.ih" + #include "note.ih" + #include "iconview.ih" + #include "ps.ih" + #include "psview.eh" + #include "bind.ih" + #include "menulist.ih" + #include "keymap.ih" + #include "text.ih" + #include "proctbl.ih" + #include "fontdesc.ih" + #include "style.ih" + #include "txttroff.ih" + #include + + #define ICONFONT "icon" + #define ICONSTYLE fontdesc_Plain + #define ICONPTS 12 + #define ICONCHAR '\151' + #define TITLEFONT "andysans" + #define TITLESTYLE fontdesc_Plain + #define TITLEPTS 12 + struct menulist *psviewMenus; + static struct keymap *psviewKeyMap; + + #define DisplayAndReturn(self, String) {message_DisplayString(self, 0, String); return;} + + #define AskOrCancel(self, string, buf) \ + {if (message_AskForString(self, 0, string, "", buf, sizeof buf - 1) < 0) \ + {message_DisplayString(self, 0, "Cancelled."); \ + return;}} + + /****************************************************************/ + /* private functions */ + /****************************************************************/ + + static void + close(v,l) + struct psview *v; + long l; + { + psview_Close(v); + } + static void + open(v,l) + struct psview *v; + long l; + { + psview_Open(v); + } + static void + closeall(v,l) + struct view *v; + long l; + { + iconview_CloseRelated(v); + } + static void + openall(v,l) + struct view *v; + long l; + { + iconview_OpenRelated(v); + } + + static void + insert(tv,l) + struct textview *tv; + long l; + { + struct text *t; + long pos; + t = (struct text *) textview_GetDataObject(tv); + pos = textview_GetDotPosition(tv) + textview_GetDotLength(tv); + tv->currentViewreference = text_InsertObject(t, pos,"ps", NULL); + text_NotifyObservers(t,0); + } + + static void inchsize(self) + struct psview *self; + { + struct ps *psobj = (struct ps *)psview_GetDataObject(self); + long w = ps_GetPixelWidth(psobj); + long h = ps_GetPixelHeight(psobj); + + double newdw = 0.0, newdh = 0.0; + char newxsize[75], newysize[75], request[150]; + + /* ask for height */ + sprintf(request, "Print height %0.2f width %0.2f in. New height: ", h / 72.0, w / 72.0); + AskOrCancel(self, request, newysize); + if (*newysize) { + /* height specified. parse it and set width request */ + if (sscanf(newysize, "%lf", &newdh) != 1) + DisplayAndReturn(self, + "Value must be digits with at most one decimal point."); } + h = (long) (newdh * 72.0); + sprintf(request, "Print height %0.2f in. New width [%0.2f] ", h / 72.0, w / 72.0); + + /* request new width */ + AskOrCancel(self, request, newxsize); + if (*newxsize && sscanf(newxsize, "%lf", &newdw) != 1) + DisplayAndReturn(self, "Value must be digits with at most one decimal point."); + w = (long) (newdw * 72.0); + + /* display the new size */ + sprintf(request, "Print size is now height %0.2f width %0.2f in. ", h / 72.0, w / 72.0 ); + message_DisplayString(self, 0, request); + ps_SetPixelWidth(psobj, w); + ps_SetPixelHeight(psobj, h); + } + + static void pixelsize(self) + struct psview *self; + { + struct ps *psobj = (struct ps *)psview_GetDataObject(self); + long w = ps_GetPixelWidth(psobj); + long h = ps_GetPixelHeight(psobj); + + long newdw = 0.0, newdh = 0.0; + char newxsize[75], newysize[75], request[150]; + + /* ask for height */ + sprintf(request, "Print height %ld width %ld pixels. New height: ", h, w); + AskOrCancel(self, request, newysize); + if (*newysize) { + /* height specified. parse it and set width request */ + if (sscanf(newysize, "%ld", &newdh) != 1) + DisplayAndReturn(self, + "Value must be digits with no decimal point."); } + h = newdh; + sprintf(request, "Print height %ld pixels. New width [%ld] ", h, w); + + /* request new width */ + AskOrCancel(self, request, newxsize); + if (*newxsize && sscanf(newxsize, "%ld", &newdw) != 1) + DisplayAndReturn(self, "Value must be digits with no decimal point."); + w = newdw; + + /* display the new size */ + sprintf(request, "Print size is now height %ld width %ld pixels. ", h, w); + message_DisplayString(self, 0, request); + ps_SetPixelWidth(psobj, w); + ps_SetPixelHeight(psobj, h); + } + + static struct bind_Description psviewBindings[]={ + {"psview-set-inch-size", NULL, 0, "PostScript,Set Inch Size~0", 0, 0, inchsize, "Set print size in inches"}, + {"psview-set-pixel-size", NULL, 0, "PostScript,Set Pixel Size~1", 0, 0, pixelsize, "Set print size in pixeles"}, + NULL + }; + void psview__PostMenus(self, menulist) + struct psview *self; + struct menulist *menulist; + { + menulist_ClearChain(self->menus); + menulist_ChainBeforeML(self->menus, menulist, menulist); + super_PostMenus(self, self->menus); + } + + + /****************************************************************/ + /* class procedures */ + /****************************************************************/ + + boolean + psview__InitializeClass(classID) + struct classheader * classID; + { + struct classinfo *textviewtype = class_Load("textview"); + struct classinfo *viewtype = class_Load("view"); + + psviewMenus = menulist_New(); + psviewKeyMap = keymap_New(); + + bind_BindList(psviewBindings, psviewKeyMap , psviewMenus, &psview_classinfo); + proctable_DefineProc("psview-insertps", insert,textviewtype, NULL, "Insert PS Object"); + proctable_DefineProc("psview-openallps", openall, viewtype, NULL, "open PS Views"); + proctable_DefineProc("psview-closeallps", closeall, viewtype, NULL, "close PS Views"); + proctable_DefineProc("psview-set-inch-size", inchsize, viewtype, NULL, "Set print size in inches"); + proctable_DefineProc("psview-set-pixel-size", pixelsize, viewtype, NULL,"Set print size in pixels"); + return TRUE; + } + + + boolean + psview__InitializeObject(classID,self) + struct classheader * classID; + struct psview * self; + { + + self->menus = menulist_DuplicateML(psviewMenus, self); + psview_SetIconFont(self,ICONFONT,ICONSTYLE,ICONPTS); + psview_SetIconChar(self,ICONCHAR); + psview_SetTitleFont(self,TITLEFONT,TITLESTYLE,TITLEPTS); + return TRUE; + } + + /****************************************************************/ + /* instance methods */ + /****************************************************************/ + + void + psview__Print(self, file, processor, format, toplevel) + register struct psview *self; + register FILE *file; + register char *processor; + register char *format; + register boolean toplevel; + { + + static char *PSheader[] = { + "%s /width %d def /height %d def /xScale %0.4f def /yScale %0.4f def\n", + "%s xScale yScale scale\n", + "%s /showpage {} def\n", + NULL }; + struct ps *psobj; + struct text *textobject; + register char *text; + char **psx; + char *line = malloc(BUFSIZ); + long c, pos = 0, textlength = 0; + char *prefix; + double xdscale = 1.0, ydscale = 1.0; + long height, width; + + psobj = (struct ps *) psview_GetDataObject(self); + width = ps_GetPixelWidth(psobj); + height = ps_GetPixelHeight(psobj); + + textobject = (struct text *) ps_GetChild(psobj); + textlength = text_GetLength(textobject); + if (strcmp(processor, "troff") == 0) { + if (toplevel) + texttroff_BeginDoc(file); + /* Put macro to interface to postscript */ + texttroff_BeginPS(file, width, height); + if ((width != 0) && (height != 0)) { + fprintf(file,"\\! newpath 0 0 moveto %d 0 lineto ", width); + fprintf(file,"%d %d lineto 0 %d lineto closepath clip\n\n", + width,height,height); + } + + prefix = "\\! "; + } + else if (strcmp(format, "troff") == 0) + prefix = "\\! "; + else prefix = ""; + + for (psx = PSheader; *psx; psx++) /*see PSheader def above. */ + fprintf(file, *psx, prefix, width, height, xdscale, ydscale); + + /*print out the file with prefix in front of each line */ + while ((c = text_GetChar(textobject, pos)) != EOF && + pos < textlength){ + if (pos++ == 0) fprintf(file, "%s", prefix); + if (c == '\n') fprintf(file,"%c%s",c, prefix); + else fputc(c, file); + } + + if (strcmp(processor, "troff") == 0) { + texttroff_EndPS(file, width, height); + if (toplevel) + texttroff_EndDoc(file); } + + + } + + + void + psview__SetDataObject(self,dobj) + struct psview * self; + struct dataobject * dobj; + { + struct style * ds; + super_SetDataObject(self,dobj); + + ds = textview_GetDefaultStyle((struct textview *) + self->header.iconview.bottomview); + style_SetFontFamily(ds, "AndyType"); + style_SetFontSize(ds, style_ConstantFontSize, 10); + } *** contrib/mit/annot/icon.c Thu May 30 20:33:50 1991 --- contrib/mit/annot/icon.c.NEW Thu May 30 18:44:10 1991 *************** *** 0 **** --- 1,249 ---- + #include "dataobj.ih" + #include "dict.ih" + #include "icon.eh" + + boolean + icon__InitializeClass(classID) + struct classinfo * classID; + { + return TRUE; + } + + + boolean + icon__InitializeObject(classID,self) + struct classinfo * classID; + struct icon * self; + { + self->child = (struct dataobject *)0; + self->width = 200; + self->height = 100; + self->title = malloc(1); + strcpy(self->title,""); + return TRUE; + } + + + + + void + icon__SetSize(self,x,y) + struct icon * self; + long x; + long y; + { + self->width = x; + self->height = y; + } + + + void + icon__GetSize(self,x,y) + struct icon * self; + long * x; + long * y; + { + *x = self->width; + *y = self->height; + } + + + void + icon__SetChild(self, dobj) + struct icon * self; + struct dataobject * dobj; + { + if (self->child != (struct dataobject *)0) + dataobject_Destroy(self->child); + self->child = dobj; + icon_NotifyObservers(self,0); + } + + struct dataobject * + icon__GetChild(self) + struct icon * self; + { + return self->child; + } + + void + icon__SetTitle(self, title) + struct icon * self; + char * title; + { + if ((self->title = malloc(strlen(title) + 1)) != 0) + strcpy(self->title, title); + } + + char * + icon__GetTitle(self) + struct icon * self; + { + return self->title; + } + + + long + icon__Write(self, file, writeID, level) + struct icon *self; + FILE *file; + long writeID; + int level; + { + int haschild = 0; + char * title = self->title; + if (icon_GetWriteID(self) != writeID) { + icon_SetWriteID(self,writeID); + if (self->child != (struct dataobject *)0) + haschild = 1; + fprintf(file, "\\begindata{%s,%ld}\n", class_GetTypeName(self),icon_GetID(self)); + fprintf(file, "%ld %ld %d \n",self->width,self->height, haschild); + + fprintf(file,"\\title{"); + while (*title != '\0') { + if (*title == '\\') + fputs("\\\\", file); + else if (*title == '}') + fputs("\\}", file); + else + fputc(*title, file); + title++; + } + fputs("}\n",file); + + if (haschild) + dataobject_Write(self->child,file, + self->header.dataobject.writeID, + 2); + fprintf(file, "\\enddata{%s,%ld}\n", class_GetTypeName(self),icon_GetID(self)); + } + + return icon_GetID(self); + } + + static check_for_title(self, file) + struct icon * self; + FILE * file; + { + char * match = "title{"; + char title[1024]; + char c; + int x; + + while (*match != '\0') { + c = fgetc(file); + if (c == EOF) + return dataobject_PREMATUREEOF; + if (c != *match){ + ungetc(c,file); + icon_SetTitle(self,""); + return dataobject_NOREADERROR; + } + ++match; + } + + if((c = fgetc(file))!= '\n') + ungetc(c,file); + x = 0; + while ((c = fgetc(file)) != '}') { + if (c == EOF) + return dataobject_PREMATUREEOF; + if (c == '\\') + if ((c = fgetc(file)) != EOF) + title[x] = c; + else return dataobject_PREMATUREEOF; + else + title[x] = c; + if (++x == 1024) + return dataobject_BADFORMAT; + } + title[x] = '\0'; + icon_SetTitle(self,title); + + while ((c = fgetc(file)) != '\\') + if (c == EOF) + return dataobject_PREMATUREEOF; + return dataobject_NOREADERROR; + } + + long + icon__Read(self,file,id) + struct icon * self; + FILE * file; + long id; + { + long x,y,haschild; + long objectid; + int c; + char * match; + char datatype[1024]; + struct dataobject * newobject; + long status; + + if (self->child != (struct dataobject *)0) + dataobject_Destroy(self->child); + self->child = (struct dataobject *)0; + icon_SetID(self,icon_UniqueID(self)); + + fscanf(file,"%ld %ld %d", &x, &y, &haschild); + self->width = x; + self->height = y; + + while ((c = fgetc(file)) != '\\') + if (c == EOF) + return dataobject_PREMATUREEOF; + + if (check_for_title(self, file) != dataobject_NOREADERROR) + return dataobject_BADFORMAT; + + newobject = (struct dataobject *)0; + if (haschild) { + match = "begindata{"; + while (*match != '\0') { + c = fgetc(file); + if (c == EOF) + return dataobject_PREMATUREEOF; + if (c != *match) + return dataobject_BADFORMAT; + ++match; + } + if((c = fgetc(file))!= '\n') + ungetc(c,file); + x = 0; + while ((c = fgetc(file)) != ',') { + if (c == EOF) + return dataobject_PREMATUREEOF; + datatype[x] = c; + if (++x == 1024) + return dataobject_BADFORMAT; + } + datatype[x] = '\0'; + objectid = 0; + while ((c = fgetc(file)) != '}') { + if (c == EOF) + return dataobject_PREMATUREEOF; + if(c >= '0' && c <= '9') + objectid = objectid * 10 + c - '0'; + } + + if((c = getc(file))!= '\n') + ungetc(c,file); + + newobject = (struct dataobject *)class_NewObject(datatype); + if (newobject == (struct dataobject *)0) + return dataobject_OBJECTCREATIONFAILED; + dictionary_Insert(NULL,(char *)objectid, (char *)newobject); + status = dataobject_Read(newobject, file, objectid); + if (status != dataobject_NOREADERROR) + return status; + } + /* adapt a cavalier attitude towards enddata */ + while ((c = fgetc(file)) != '\n') + if (c == EOF) + break; + + icon_SetChild(self,newobject); /* might be null */ + + return dataobject_NOREADERROR; + } + *** contrib/mit/annot/iconview.ch Thu May 30 20:34:02 1991 --- contrib/mit/annot/iconview.ch.NEW Thu May 30 18:44:12 1991 *************** *** 0 **** --- 1,40 ---- + class iconview : view + { + overrides: + GetOrigin(long width, long height, long *originX, long *originY); + Hit (enum view_MouseAction action, long x, long y, long numberOfClicks) returns struct view *; + ReceiveInputFocus(); + FullUpdate(enum view_UpdateType type, long left, long top, + long width, long right); + DesiredSize(long width, long height, enum view_DSpass pass, + long *dWidth, long *dheight) + returns enum view_DSattributes; + SetDataObject(struct dataobject * do); + ObservedChanged(struct thisobject * data, long value); + UnlinkTree(); + methods: + DecidedSize(w,h); + RecommendSize(w,h); + Open(); + Close(); + SetIconFont(char *iconfont, int iconstyle, int iconpts); + SetIconChar(int iconchar); + SetTitleFont(char *titlefont, int titlestyle, int titlepts); + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + FinalizeObject(struct view *self); + CloseRelated(struct view *v); + OpenRelated(struct view *v); + data: + struct fontdesc * titlefont; + char iconchar; + struct fontdesc * iconfont; + struct view * child; + struct view * bottomview; + int isopen; + long cx, cy, cw, ch; /* childs extents in my logical space */ + long dw, dh; /* desired hight and width */ + short neednewsize; + struct iconview *next; + }; *** contrib/mit/annot/noteview.c Thu May 30 20:34:12 1991 --- contrib/mit/annot/noteview.c.NEW Thu May 30 18:44:13 1991 *************** *** 0 **** --- 1,151 ---- + #include "class.h" + #include "view.ih" + #include "textv.ih" + #include "note.ih" + #include "iconview.ih" + #include "noteview.eh" + #include "bind.ih" + #include "menulist.ih" + #include "keymap.ih" + #include "text.ih" + #include "proctbl.ih" + + #define ICONFONT "icon" + #define ICONSTYLE "fontdesc_Plain" + #define ICONPTS 12 + #define ICONCHAR '4' + #define TITLEFONT "andysans" + #define TITLESTYLE "fontdesc_Plain" + #define TITLEPTS 12 + + struct menulist *noteviewMenus; + static struct keymap *noteviewKeyMap; + + + /****************************************************************/ + /* private functions */ + /****************************************************************/ + + static void + close(v,l) + struct noteview *v; + long l; + { + noteview_Close(v); + } + static void + open(v,l) + struct noteview *v; + long l; + { + noteview_Open(v); + } + static void + closeall(v,l) + struct view *v; + long l; + { + iconview_CloseRelated(v); + } + static void + openall(v,l) + struct view *v; + long l; + { + iconview_OpenRelated(v); + } + + static void + insert(tv,l) + struct textview *tv; + long l; + { + struct text *t; + long pos; + t = (struct text *) textview_GetDataObject(tv); + pos = textview_GetDotPosition(tv) + textview_GetDotLength(tv); + tv->currentViewreference = text_InsertObject(t, pos,"note", NULL); + text_NotifyObservers(t,0); + } + + static struct bind_Description noteviewBindings[]={ + {"noteview-close",NULL,0,"notes,close~2", 0,0,close,"close the note"}, + {"noteview-closeall",NULL,0,"notes,close all~12", 0,0,closeall,"close all the notes"}, + {"noteview-openall",NULL,0,"notes,open all~11", 0,0,openall,"open all the notes"}, + NULL + }; + void noteview__PostMenus(self, menulist) + struct noteview *self; + struct menulist *menulist; + { + menulist_ClearChain(self->menus); + menulist_ChainBeforeML(self->menus, menulist, menulist); + super_PostMenus(self, self->menus); + } + + + /****************************************************************/ + /* class procedures */ + /****************************************************************/ + + boolean + noteview__InitializeClass(classID) + struct classheader * classID; + { + struct classinfo *textviewtype = class_Load("textview"); + struct classinfo *viewtype = class_Load("view"); + + noteviewMenus = menulist_New(); + noteviewKeyMap = keymap_New(); + bind_BindList(noteviewBindings, noteviewKeyMap , noteviewMenus, ¬eview_classinfo); + proctable_DefineProc("noteview-insertnote",insert,textviewtype,NULL,"Insert Note Object"); + proctable_DefineProc("noteview-openallnotes",openall,viewtype,NULL,"open Note Views"); + proctable_DefineProc("noteview-closeallnotes",closeall,viewtype,NULL,"close Note Views"); + return TRUE; + } + + + boolean + noteview__InitializeObject(classID,self) + struct classheader * classID; + struct noteview * self; + { + + self->menus = menulist_DuplicateML(noteviewMenus, self); + noteview_SetIconFont(self,ICONFONT,ICONSTYLE,ICONPTS); + noteview_SetIconChar(self,ICONCHAR); + noteview_SetTitleFont(self,TITLEFONT,TITLESTYLE,TITLEPTS); + + + return TRUE; + } + + /****************************************************************/ + /* instance methods */ + /****************************************************************/ + + void + noteview__Print(self, file, processor, finalformat, toplevel) + struct noteview * self; + FILE * file; + char * processor; + char * finalformat; + boolean toplevel; + { + short doit; + if (self->header.iconview.child == (struct view *)0) + return; + + doit = 0; + + if (!toplevel + && strcmp(processor,"troff") == 0) { + fputs("\\**\n.FS\n",file); + doit = 1; + } + view_Print(self->header.iconview.bottomview,file, + processor,finalformat,toplevel); + if (doit) + fputs(".FE\n",file); + } + *** contrib/mit/annot/ps.ch Thu May 30 20:34:23 1991 --- contrib/mit/annot/ps.ch.NEW Thu May 30 18:44:15 1991 *************** *** 0 **** --- 1,19 ---- + class ps: icon { + overrides: + SetChild(struct dataobject * child); + Read (FILE *file, long id) returns long; + Write (FILE *file, long writeid, int level) returns long; + methods: + macromethods: + GetPixelWidth() ((self)->pwidth) + GetPixelHeight() ((self)->pheight) + SetPixelWidth(value) ((self)->pwidth=(value)) + SetPixelHeight(value) ((self)->pheight=(value)) + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + data: + long pwidth; + long pheight; + }; + *** contrib/mit/annot/psview.ch Thu May 30 20:34:34 1991 --- contrib/mit/annot/psview.ch.NEW Thu May 30 18:44:16 1991 *************** *** 0 **** --- 1,13 ---- + class psview : iconview + { + overrides: + Print(FILE *file, char *processor, char *finalFormat, boolean topLevel); + PostMenus(struct menulist *menulist); + SetDataObject(struct dataobject * dobj); + methods: + classprocedures: + InitializeObject(struct thisobject *self) returns boolean; + InitializeClass() returns boolean; + data: + struct menulist *menus; + }; *** ossupport/Imakefile Mon Jun 17 15:56:32 1991 --- ossupport/Imakefile.NEW Mon Jun 17 15:55:22 1991 *************** *** 0 **** --- 1,18 ---- + /* Don't use install -- it hasn't been built yet */ + + #ifdef hp9000s800 + OSOBJS = strncpy.o scandir.o + #endif /* hp9000s800 */ + + #ifdef hp9000s800 + DependTarget() + + NormalObjectRule() + + LibraryTarget(libossup.a, $(OSOBJS)) + + MkdirTarget($(DESTDIR) $(DESTDIR)/lib) + + install.time:: libossup.a + cp libossup.a $(DESTDIR)/lib/libossup.a + #endif /* hp9000s800 */ *** ossupport/scandir.c Thu May 30 19:17:18 1991 --- ossupport/scandir.c.NEW Tue Apr 23 15:54:03 1991 *************** *** 0 **** --- 1,118 ---- + /* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted provided + * that: (1) source distributions retain this entire copyright notice and + * comment, and (2) distributions including binaries display the following + * acknowledgement: ``This product includes software developed by the + * University of California, Berkeley and its contributors'' in the + * documentation or other materials provided with the distribution and in + * all advertising materials mentioning features or use of this software. + * Neither the name of the University nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + + #if defined(LIBC_SCCS) && !defined(lint) + static char sccsid[] = "@(#)scandir.c 5.9 (Berkeley) 6/24/90"; + #endif /* LIBC_SCCS and not lint */ + + /* + * Scan the directory dirname calling select to make a list of selected + * directory entries then sort using qsort and compare routine dcomp. + * Returns the number of entries and a pointer to a list of pointers to + * struct dirent (through namelist). Returns -1 if there were any errors. + */ + + #include + #include + #include + + /* + * The DIRSIZ macro gives the minimum record length which will hold + * the directory entry. This requires the amount of space in struct dirent + * without the d_name field, plus enough space for the name with a terminating + * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. + */ + #undef DIRSIZ + #define DIRSIZ(dp) \ + ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) + + #ifdef hpux + #define bcopy(src, dst, length) memmove(dst, src, length) + #endif /* hpux */ + + scandir(dirname, namelist, select, dcomp) + char *dirname; + struct dirent ***namelist; + int (*select)(), (*dcomp)(); + { + register struct dirent *d, *p, **names; + register int nitems; + struct stat stb; + long arraysz; + DIR *dirp; + + if ((dirp = opendir(dirname)) == NULL) + return(-1); + if (fstat(dirp->dd_fd, &stb) < 0) + return(-1); + + /* + * estimate the array size by taking the size of the directory file + * and dividing it by a multiple of the minimum size entry. + */ + arraysz = (stb.st_size / 24); + names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *)); + if (names == NULL) + return(-1); + + nitems = 0; + while ((d = readdir(dirp)) != NULL) { + if (select != NULL && !(*select)(d)) + continue; /* just selected names */ + /* + * Make a minimum size copy of the data + */ + p = (struct dirent *)malloc(DIRSIZ(d)); + if (p == NULL) + return(-1); + p->d_ino = d->d_ino; + p->d_reclen = d->d_reclen; + p->d_namlen = d->d_namlen; + bcopy(d->d_name, p->d_name, p->d_namlen + 1); + /* + * Check to make sure the array has space left and + * realloc the maximum size. + */ + if (++nitems >= arraysz) { + if (fstat(dirp->dd_fd, &stb) < 0) + return(-1); /* just might have grown */ + arraysz = stb.st_size / 12; + names = (struct dirent **)realloc((char *)names, + arraysz * sizeof(struct dirent *)); + if (names == NULL) + return(-1); + } + names[nitems-1] = p; + } + closedir(dirp); + if (nitems && dcomp != NULL) + qsort(names, nitems, sizeof(struct dirent *), dcomp); + *namelist = names; + return(nitems); + } + + /* + * Alphabetic order comparison routine for those who want it. + */ + alphasort(d1, d2) + void *d1, *d2; + { + return(strcmp((*(struct dirent **)d1)->d_name, + (*(struct dirent **)d2)->d_name)); + } *** ossupport/strncpy.c Thu May 30 19:17:31 1991 --- ossupport/strncpy.c.NEW Tue Apr 23 15:54:04 1991 *************** *** 0 **** --- 1,21 ---- + /* + * Copyright BellSouth 1991 - All Rights Reserved + * For full copyright information see:'andrew/config/COPYRITE.bls'. + */ + + /* this exists because of a bug in hp's strncpy + * (in that one, bad things can happen when s and t overlap) + */ + + char *strncpy(s, t, n) + char *s, *t; + int n; + { + char *v = s; + + while (n--) { + *s++ = *t; + if (*t++ == '\0') return v; + } + return v; + } *** oda/src/tkerr1.c Wed Nov 22 13:10:08 1989 --- oda/src/tkerr1.c.NEW Thu Apr 25 16:20:06 1991 *************** *** 1,7 **** /* ! $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/oda/src/RCS/tkerr1.c,v 1.2 89/09/29 11:41:44 mss Exp Locker: jr $ ! $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/oda/src/RCS/tkerr1.c,v $ (c) Copyright 1988 Carnegie Mellon University --- 1,7 ---- /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/oda/src/RCS/tkerr1.c,v 1.2 1989/09/29 11:41:44 mss Exp $ ! $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/oda/src/RCS/tkerr1.c,v $ (c) Copyright 1988 Carnegie Mellon University *************** *** 8,17 **** See "The CMU ODA Tool Kit" (available as CMU/ITC tech report CMU-ITC-071) for full text & permitted uses. ! $Log: tkerr1.c,v $ ! * Revision 1.2 89/09/29 11:41:44 mss * Changed site.h to lcsite.h for compatibility with Andrew site files ! * * Revision 1.1 89/09/21 06:41:06 mss * Initial revision * --- 8,17 ---- See "The CMU ODA Tool Kit" (available as CMU/ITC tech report CMU-ITC-071) for full text & permitted uses. ! $Log: tkerr1.c,v $ ! * Revision 1.2 1989/09/29 11:41:44 mss * Changed site.h to lcsite.h for compatibility with Andrew site files ! * * Revision 1.1 89/09/21 06:41:06 mss * Initial revision * *************** *** 76,82 **** */ #ifndef LINT ! static char RCSID[] = "$Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/oda/src/RCS/tkerr1.c,v $"; #endif #define TK_IMPL_INIT --- 76,82 ---- */ #ifndef LINT ! static char RCSID[] = "$Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/oda/src/RCS/tkerr1.c,v $"; #endif #define TK_IMPL_INIT *** oda/src/wasn14.c Wed Nov 22 13:10:41 1989 --- oda/src/wasn14.c.NEW Thu Apr 25 16:20:08 1991 *************** *** 1,7 **** /* ! $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/oda/src/RCS/wasn14.c,v 1.1 89/09/21 06:43:00 mss Exp Locker: jr $ ! $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/oda/src/RCS/wasn14.c,v $ (c) Copyright 1988 Carnegie Mellon University --- 1,7 ---- /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/oda/src/RCS/wasn14.c,v 1.1 1989/09/21 06:43:00 mss Exp $ ! $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/oda/src/RCS/wasn14.c,v $ (c) Copyright 1988 Carnegie Mellon University *************** *** 8,17 **** See "The CMU ODA Tool Kit" (available as CMU/ITC tech report CMU-ITC-071) for full text & permitted uses. ! $Log: wasn14.c,v $ ! * Revision 1.1 89/09/21 06:43:00 mss * Initial revision ! * * Revision 1.12 89/09/06 11:21:06 annm * fixing problems with names * --- 8,17 ---- See "The CMU ODA Tool Kit" (available as CMU/ITC tech report CMU-ITC-071) for full text & permitted uses. ! $Log: wasn14.c,v $ ! * Revision 1.1 1989/09/21 06:43:00 mss * Initial revision ! * * Revision 1.12 89/09/06 11:21:06 annm * fixing problems with names * *************** *** 51,57 **** */ #ifndef LINT ! static char RCSID[] = "$Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/oda/src/RCS/wasn14.c,v $"; #endif #define TK_IMPL_WASN1 --- 51,57 ---- */ #ifndef LINT ! static char RCSID[] = "$Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/oda/src/RCS/wasn14.c,v $"; #endif #define TK_IMPL_WASN1 *** overhead/Imakefile Fri Dec 21 15:01:37 1990 --- overhead/Imakefile.NEW Thu May 30 18:49:55 1991 *************** *** 8,18 **** CMENU = cmenu #endif /* X11_ENV */ - #ifdef WM_ENV - WM = wm - #endif /* WM_ENV */ - - /* conv contains a script to convert Release3 ATK programs to Release4 ATK programs */ CONV = conv --- 8,13 ---- *************** *** 20,26 **** SNAP2 = snap2 #endif /* SNAP_ENV */ - #ifdef AMS_ENV AMS = mail ${SNAP2} #endif /* AMS_ENV */ --- 15,20 ---- *************** *** 35,52 **** #ifndef NO_FONTS_ENV FONTS = fonts - #else - FONTS = #endif /* NO_FONTS_ENV */ #ifdef X11_ENV ! ICONS=xicons #endif /* X11_ENV */ SUBDIRS = genmake \ sys \ - addalias \ util \ errors \ index \ malloc \ --- 29,44 ---- #ifndef NO_FONTS_ENV FONTS = fonts #endif /* NO_FONTS_ENV */ #ifdef X11_ENV ! ICONS = xicons #endif /* X11_ENV */ SUBDIRS = genmake \ sys \ util \ + addalias \ errors \ index \ malloc \ *** overhead/addalias/Imakefile Wed Nov 22 13:20:37 1989 --- overhead/addalias/Imakefile.NEW Thu Jun 6 13:26:54 1991 *************** *** 5,10 **** NormalObjectRule() ! ProgramTarget(addalias,addalias.o,,) InstallProgram(addalias,$(DESTDIR)/etc) DependTarget() --- 5,12 ---- NormalObjectRule() ! ProgramTarget(addalias,addalias.o,,${SUPLIBS}) InstallProgram(addalias,$(DESTDIR)/etc) + MkdirTarget($(DESTDIR)/help) + InstallFile(help.aliases, $(INSTLIBFLAGS), $(DESTDIR)/help) DependTarget() *** overhead/addalias/help.aliases Thu Jun 6 13:27:36 1991 --- overhead/addalias/help.aliases.NEW Thu Jun 6 13:29:24 1991 *************** *** 0 **** --- 1,468 ---- + + # Previous line intentionally left blank. + ######################################## + ## This is aliases.andy. + ######################################## + + msplus + .ams-alias msalses + .ams-alias msalses + .ams-aliases msalses + .ams_alias msalses + .ams_aliases msalses + .atkinit initfls + .be2init initfls + .ezinit initfls + .outgoing ams + Local-Tool-Kit localtk + ODA oda + ODA-Tool-Kit odatk + Office-Document-Architecture oda + Raster-Tool-Kit rstrtk + abe toez + ado adew + alias aliases + ams-alias msalses + ams-aliases msalses + ams-mailinglists dlists + ams-preferences prefs + ams-subsorder subordr + ams_alias msalses + ams_aliases msalses + andrew-toolkit be2 + andrew.setup setup + andrewmessagesystem ams + andrewsetup setup + andrewtoolkit atk + animate fad + animation fad + animations fad + arb adew + arbcon adew + atk-init initfls + atkinit initfls + baseeditor atk + be atk + be1 atk + be2 atk + be2-init initfls + be2init initfls + bea toez + borderstyle prefs + buffers buffer + bushproc bshproc + bushprocs bshproc + calcproc calproc + calcprocs calproc + calculator calc + champ-calendars calndrs + champ-events-file evnts + champfile evnts chartproc chtproc chartprocs chtproc + chomp champ + classpath clsspth + cmenus cmenu + colors color + compileproc comproc + compileprocs comproc conclass cnclass consoles console contentproc cntproc contentprocs cntproc + contents content + controllers adew + controllersproc ctrproc controllersprocs ctrproc convertraster convras + convertrasters convras + createcon adew + createinset cres8et + createinsets cres8et creatinset cres8et + crossreferences crossrf + crossrefs crossrf + ctextproc ctxproc + ctextprocs ctxproc cui-classification cuiclss cui-customization cuicust cui-edit cuiedit cui-expert cuixprt cui-filter cuifltr + cui-filtering cuifltr cui-novice cui cui-preferences cuipref cui-quickref cuiqr cui-wizard cuiwiz cutbuff cutbuf cutbuffer cutbuf + d-list dlists + d-lists dlists + default prefs + delivery ams + deskey desproc deskeyproc desproc deskeyprocs desproc diredproc drdproc diredprocs drdproc + distribution dlists + distribution-lists dlists + dlist dlists + dlists dlists + dofix class + doublespacing eztroff + dropoff ams + dsearch dsrproc + dsearchproc dsrproc + dsearchprocs dsrproc + duplex eztroff + endnote fnote + endnotes fnote + equation eq + equations eq + errmonf ermproc + errmonfproc ermproc + extension ezext + extensions ezext + ez-bindings ezkeys + ez-content content + ez-cross crossrf + ez-crossreferences crossrf + ez-diffproc ezdproc + ez-extension ezext + ez-init initfls + ez-keystrokes ezkeys + ez-postscript ezps + ez-print ezprint + ez-proc ezproc + ez-procs ezproc + ez-ref crossrf + ez-templates ezext + ez.index tindex + ezcommand ezcomm + ezcontents content + ez-diff ezdiff + ezdiffproc ezdproc + ezdiffprocs ezdproc + ezinit initfls + ezkeys ezkeys + ez-keys ezkeys + ezprocs ezproc + eztroff eztroff + fadprocs fadproc + footnote fnote + footnotes fnote + forwarding forward + frameproc frmproc + frameprocs frmproc + gobprocs gobproc + hash msplus + hashmark msplus + improcs improc + index tindex + indices tindex + initfile initfls + initproc intproc + initprocs intproc + inputproc inpproc + inset insets + isearch isrproc + isearchproc isrproc + isearchprocs isrproc + keybinding ezkeys + keybindings ezkeys + logview lgvproc + logvproc lgvproc + lookzproc lkzproc + lookzprocs lkzproc + lset adew + lsetproc lstproc + lsetprocs lstproc + mail-forwarding forward + mailinglist dlists + mailinglists dlists + makedo class + matteproc mttproc + matteprocs mttproc + menu menus + menus-tutorial menus + messages-keybindings msgskys + messages-preferences prefs + messages-send sendmsg + messages.dlists dlists + messageserver ams + messageskeys msgskys + messagess ams + month champ + months champ + ms-forwarding forward + ms-mailinglist dlists + ms-preferences prefs + musicproc musproc + musicprocs musproc + nessrun ness + orgprocs orgproc + panelproc pnlproc + panelprocs pnlproc + pictures rasters + playproc musproc + playprocs musproc + plus msplus + pop-up menus + posting sendmsg + pound msplus + poundsign msplus + preference prefs + previewproc prvproc + previewprocs prvproc + prez ezprint + rasterproc rstproc + rasterprocs rstproc + readmail msgs + readnews msgs + scan ezscan + scrollbar scroll + scrollbar-tutorial scroll + scrolling scroll + searching search + selecting select + selection select + selection-tutorial select + sendmessages sendmsg + sendnews sendmsg + shmenu tscript + signature sendmsg + spread table + spreadsheet table + style ezstyle + styles ezstyle + subscribe msgs + subscribing msgs + subscriptionorder subordr + subscriptions msgs + subsorder subordr + suite steproc + suiteproc steproc + suiteprocs steproc + sytlesheetproc stlproc + tableproc tblproc + termulator-keys tmkeys + textproc txtproc + texts text + tm-keys tmkeys + toolkit atk + tscriptproc typproc + tscriptprocs typproc + tx tscript + typescriptproc typproc + typescriptprocs typproc + valueproc valproc + valueprocs valproc + vui.tutorial vui + vui-tutorial vui + whichdo class + white-pages wp + white_pages wp + whitepages wp + zipprocs zipproc + + ################################# + ## This is aliases.local. + ################################# + ~ unix-symbols + .cshrc cshrc + .login commandfiles + .logout commandfiles + .plan plan + /dev/hd0a processes + /dev/hd0g processes + /etc processes + /tmp processes + /user processes + /usr/user processes + access.arpanet networks-access + advise advisor + aguide andrewguide + andrew tour + andrewcachemanager acm + andrewtour tour + arpanet arpa + authuser protection + autobutler butler + backups backup + bb bboards + bb-purging bbpurge + bboard bboards + bboards.dow-jones dow-jones + block allocation + board bboards + bulletin bboards + bulletinboards bboards + bulletin-board bboards + bulletin-boards bboards + bulletin_board bboards + bulletin_boards bboards + c-prolog cprolog + cache acm + cachemanager acm + change cd + checkspell spellcheck + checkspelling spellcheck + cluster clusters + cmututor ct + computer-store-prices prices + csnet networks + dosdel dosread + dosdir dosread + doswrite dosread + dowjones dow-jones + editing writing + enlarge headermenu + etc processes + externalbb networks-access + externalposting networks-access + ez-spellcheck spellcheck + ezspellcheck spellcheck + fetch processes + filetransfer machines + font fonts + gripe advisor + guide andrewguide + gripes advisor + hd0a processes + hd0g processes + hdoa processes + hdog processes + ibuki kcl + internet arpa + isql informix + kcl ibcl + lis library + list ls + managing_files_and_directories directories + modula tmc + modula2 tmc + modula-2 tmc + mouse-tutorial mouse + network-access networks-access + networks_access networks-access + oldsendmail sendmail + overhead transparencies + overheads transparencies + partition allocation + pascal pc + path searchpath + pcmessages vui + pcmsgs vui + permission protection + permissions protection + pfkeys commandfiles + phone phones + printdir printing + print.duplex printing + printer printing + printraster printsnap + printq print + print-q print + private protection + privatebulletinboard privatebb + privatebulletinboards privatebb + privatesubdir protection + privatesubdirectory protection + prolog cprolog + prologue cprolog + prompt cshrc + protections protection + public protection + publicsubdir protection + publicsubdirectory protection + queue printing + quota allocation + readdir directory + reclaim butler + redisplay headermenu + remarks advise + remove rm + rewinddir directory + rmexts commandfiles + scanner ezscan + scanners ezscan + schedules schedule + screendump snapshot + scribe5 scribe + scribe6 scribe + scribe7 scribe + scylla informix_rpc + seekdir directory + server servers + slides transparencies + space allocation + spelling spellcheck + spool printing + spooldir printing + spoolpath printing + telldir directory + template templates + titlebar headermenu + tmp processes + transfer machines + unix-servers servers + userguide andrewguide + userguides andrewguide + using_other_computers machines + utm utms + vdoc afs + vdocs afs + venus acm + vice afs + volume allocation + volumes allocation + vui-tutorial vui.tutorial + walksubtree ws + window-tutorial window + windows window + workstation_processes processes + x11 x + xtoolkit x + xwindow x + xwindows x + xwindowsystem x + zap headermenu + windowmanager wm + window-manager wm + window_manager wm + wm_programmers_guide wm + arpahosts #ez /afs/andrew.cmu.edu/common/etc/hosts.arpa + bitnetnodes #ez /afs/andrew.cmu.edu/common/etc/hosts.bitnet + ####################################### + ## This is aliases.itc. + ####################################### + aix aix-port + iwash.aux genmake + iwashaux genmake + rcslink rcs + rcsls rcs + rcsupdate rcs + sysv aix-port + sysv-port aix-port + sysv_port aix-port + sys5 aix-port + wash iwash + ################################# + ## aliases for man pages. + ################################# + a.out a + a.out.5 a + break sh + cfree malloc + dirs csh + dysize ctime + errno perror + eval sh + exec sh + exece excel + export sh + gcd mp + inh byteorder + isnan isinf + itom mp + madd mp + makefile make + mdiv mp + min mp + mout mp + mstats malloc + msub mp + mult mp + newgrp sh + optarg getopt + optind getopt + password passwd + readonly sh + rpow mp + set sh + setmallocchecklevel malloc + setpwnam getpwent + shift sh + setenv csh + shell csh + tell lseek + trap sh + type cat + uncompact compact + wtmp utmp *** overhead/addalias/addalias.c Wed Nov 22 13:20:38 1989 --- overhead/addalias/addalias.c.NEW Wed Apr 3 21:26:11 1991 *************** *** 161,167 **** --- 161,171 ---- oldFp=fdopen(fd,"r"); strcpy(newFile,intoFile); + #ifdef USESHORTFILENAMES + strcat(newFile,"+"); + #else strcat(newFile,".NEW"); + #endif newFp=fopen(newFile,"w"); if(newFp==NULL) syserr("%s: Couldn't open %s for writing",prog,newFile,0); *** overhead/class/cmd/Imakefile Thu Jan 10 14:56:49 1991 --- overhead/class/cmd/Imakefile.NEW Wed Apr 10 15:30:48 1991 *************** *** 5,30 **** LOCALINCLUDES = -I../machdep/machine -I../lib #ifdef RESOLVER_ENV ! RESOLVER_LIB = $(RESOLVLIB) ! #else RESOLVER_LIB = ! #endif DependTarget() NormalObjectRule() ! #ifndef _IBMR2 ! ProgramTarget(dofix,../machdep/machine/dofix.o,../lib/libclass.a $(RESOLVER_LIB),) ! ProgramTarget(dotest,dotest.o,../lib/libclass.a $(RESOLVER_LIB),) #endif /* _IBMR2 */ ! ProgramTarget(doindex,doindex.o,../lib/libclass.a $(RESOLVER_LIB),) ! ProgramTarget(whichdo,whichdo.o,$(UTILLIB),) ! #ifndef _IBMR2 InstallProgram(dofix,$(DESTDIR)/bin) InstallProgram(dotest,$(DESTDIR)/bin) ! #endif /* _IBMR2 */ InstallProgram(doindex,$(DESTDIR)/bin) InstallProgram(whichdo,$(DESTDIR)/bin) --- 5,53 ---- LOCALINCLUDES = -I../machdep/machine -I../lib #ifdef RESOLVER_ENV ! #ifdef LIBDL_ENV ! RESOLVER_LIB = ! SYSLIBS = -L${DESTDIR}/lib -lresolv ! #else /* LIBDL_ENV */ ! RESOLVER_LIB = ${RESOLVLIB} ! SYSLIBS = ! #endif /* LIBDL_ENV */ ! #else /* RESOLVER_EMV */ RESOLVER_LIB = ! SYSLIBS = ! #endif /* RESOLVER_ENV */ + + #if defined(_IBMR2) + CLASSLIBS = -L${DESTDIR}/lib -lclass + #else /* _IBMR2 */ + CLASSLIBS = + #endif /* _IBMR2 */ + DependTarget() NormalObjectRule() ! #if !defined(_IBMR2) && !defined(LIBDL_ENV) && !defined(hp9000s800) ! ProgramTarget(dofix,../machdep/machine/dofix.o,../lib/libclass.a $(RESOLVER_LIB),${SUPLIBS}) ! ProgramTarget(dotest,dotest.o,../lib/libclass.a $(RESOLVER_LIB),${SUPLIBS}) ! #endif /* !_IBMR2 && !LIBDL_ENV && !hp9000s800 */ ! ! #ifdef LIBDL_ENV ! ProgramTarget(doindex,doindex.o,${BASEDIR}/lib/libclass.a $(RESOLVER_LIB),${SYSLIBS} ${SUPLIBS}) ! #else /* LIBDL_ENV */ ! #ifdef _IBMR2 ! ProgramTarget(doindex,doindex.o,$(RESOLVER_LIB),${SYSLIBS} ${SUPLIBS} ${CLASSLIBS}) ! #else /* _IBMR2 */ ! ProgramTarget(doindex,doindex.o,../lib/libclass.a $(RESOLVER_LIB),${SYSLIBS} ${CLASSLIBS} ${SUPLIBS}) #endif /* _IBMR2 */ + #endif /* LIBDL_ENV */ ! ProgramTarget(whichdo,whichdo.o,$(UTILLIB),${NETLIBS}) ! #if !defined(_IBMR2) && !defined(LIBDL_ENV) && !defined(hp9000s800) InstallProgram(dofix,$(DESTDIR)/bin) InstallProgram(dotest,$(DESTDIR)/bin) ! #endif /* !_IBMR2 && !LIBDL_ENV && !hp9000s800 */ InstallProgram(doindex,$(DESTDIR)/bin) InstallProgram(whichdo,$(DESTDIR)/bin) *** overhead/class/cmd/doindex.c Fri Dec 21 15:01:40 1990 --- overhead/class/cmd/doindex.c.NEW Thu Jun 6 17:58:07 1991 *************** *** 227,233 **** register struct EntryStruct * TempEntry, *last; int fid,loopcount; ! #if defined (sys_ps_aix12) || defined (sys_ps_aix11) int lockfid; /* BAAAAAD things happen on ps/2 aix if you try to lock an NFS file. Use the "grab a well-known file" --- 227,233 ---- register struct EntryStruct * TempEntry, *last; int fid,loopcount; ! #if sys_ps_aix12 || sys_ps_aix11 int lockfid; /* BAAAAAD things happen on ps/2 aix if you try to lock an NFS file. Use the "grab a well-known file" *************** *** 243,254 **** loopcount++; } } while (lockfd < 0); /* keep going till we get a valid file descriptor */ ! #endif /* defined (sys_ps_aix12) || defined (sys_ps_aix11) */ RETRY: fid = open(INDEXNEWFILE,O_WRONLY | O_CREAT , 0644); /* Create output file */ if(fid > 0) { ! #if !defined (sys_ps_aix12) && !defined (sys_ps_aix11) if(osi_ExclusiveLockNoBlock(fid) != 0){ if(errno == EWOULDBLOCK){ fprintf(stdout, "%s: Waiting for locked index file...\n", ProgramName); --- 243,254 ---- loopcount++; } } while (lockfd < 0); /* keep going till we get a valid file descriptor */ ! #endif /* sys_ps_aix12 || sys_ps_aix11 */ RETRY: fid = open(INDEXNEWFILE,O_WRONLY | O_CREAT , 0644); /* Create output file */ if(fid > 0) { ! #if !sys_ps_aix12 && !sys_ps_aix11 if(osi_ExclusiveLockNoBlock(fid) != 0){ if(errno == EWOULDBLOCK){ fprintf(stdout, "%s: Waiting for locked index file...\n", ProgramName); *************** *** 271,277 **** fprintf(stdout, "%s: Warning : file lock call failed, ignoring '%s' error.\n", ProgramName,sys_errlist[errno]); } } ! #endif /* !defined (sys_ps_aix12) && !defined (sys_ps_aix11) */ outfd = fdopen(fid, "w"); } else { --- 271,277 ---- fprintf(stdout, "%s: Warning : file lock call failed, ignoring '%s' error.\n", ProgramName,sys_errlist[errno]); } } ! #endif /* !sys_ps_aix12 && !sys_ps_aix11 */ outfd = fdopen(fid, "w"); } else { *************** *** 310,319 **** Error("Error creating new index file", ""); } ! #if defined (sys_ps_aix12) || defined (sys_ps_aix11) (void) close(lockfd); /* done with this so close it */ (void) unlink(INDEXLOCKFILE); /* and delete it */ ! #endif /* if defined (sys_ps_aix12) || defined (sys_ps_aix11) */ fprintf(stdout, "Done\n"); fflush(stdout); --- 310,319 ---- Error("Error creating new index file", ""); } ! #if sys_ps_aix12 || sys_ps_aix11 (void) close(lockfd); /* done with this so close it */ (void) unlink(INDEXLOCKFILE); /* and delete it */ ! #endif /* if sys_ps_aix12 || sys_ps_aix11 */ fprintf(stdout, "Done\n"); fflush(stdout); *************** *** 399,404 **** --- 399,418 ---- { struct EntryStruct * TempEntry; + + #if sys_sun3_41 || sys_sun4_41 + int fd; + + /* + * XXX - force "/dev/zero" to be open as a file descriptor one + * greater than the first available one, as a workaround for a + * 4.1 bug (also present in 4.1.1) in the run-time loader. + * (Fixed in System V Release 4, allegedly.) + */ + fd = open("/dev/zero", O_RDWR); + dup(fd); /* one greater */ + close(fd); + #endif ParseArgs(argc, argv); /* this may chdir() */ *** overhead/class/machdep/Imakefile Wed Nov 22 13:21:16 1989 --- overhead/class/machdep/Imakefile.NEW Wed Apr 3 21:26:20 1991 *************** *** 2,9 **** --- 2,12 ---- SUBDIRS = $(SYS_OS_ARCH) + #ifndef SCOunix + all:: init init: rm -f machine $(LN) $(SYS_OS_ARCH) machine + #endif *** overhead/class/machdep/aix_i386/Imakefile Thu Jan 10 14:56:53 1991 --- overhead/class/machdep/aix_i386/Imakefile.NEW Wed Feb 13 16:58:37 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else /* !RESOLVER_ENV */ ! RESOLVER_LIB = ! RESOLVER_CMD = #endif /* RESOLVER_ENV */ all:: globals.o entry.o doload.o dofix.o dolist.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif /* RESOLVER_ENV */ all:: globals.o entry.o doload.o dofix.o dolist.o *************** *** 24,33 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /usr/lib/librts.a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -ex $(RESOLVER_LIB) /usr/lib/librts.a /lib/libc.a /tmp/libhack.a | \ $(TR) "|" " " | \ $(AWK) -f getlist.awk | \ grep -v "%_" > ,libc.eplist --- 24,33 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /usr/lib/librts.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -e $(RESOLVER_LIB) /usr/lib/librts.a /lib/libc.a ${GNULIB} /tmp/libhack.a | \ $(TR) "|" " " | \ $(AWK) -f getlist.awk | \ grep -v "%_" > ,libc.eplist *************** *** 37,42 **** --- 37,46 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 43,60 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /usr/lib/librts.a /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! ar x /lib/libc.a ; \ $(CP) /usr/lib/librts.a ,libcx.a ; \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` rm -rf new clean:: --- 47,65 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /usr/lib/librts.a /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! ar x /lib/libc.a ; $(ARCHIVE_COM) \ $(CP) /usr/lib/librts.a ,libcx.a ; \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) rm -rf new clean:: *** overhead/class/machdep/aix_i386/getlist.awk Thu Jan 10 14:56:54 1991 --- overhead/class/machdep/aix_i386/getlist.awk.NEW Wed Feb 13 16:58:38 1991 *************** *** 26,32 **** ($3 == "extern") { ! if ($4 == ".text" || $4 == ".data" || $4 == ".bss") { if (definer[$1] == "") { definer[ep[epcount++] = $1] = ObjName; library[$1] = LibName; --- 26,32 ---- ($3 == "extern") { ! if ($4 == ".text" || $4 == ".data" || $4 == ".bss" || ($2 + 0) != 0) { if (definer[$1] == "") { definer[ep[epcount++] = $1] = ObjName; library[$1] = LibName; *************** *** 139,148 **** want[library["_res_resultcodes"] "." definer["_res_resultcodes"]] = "Y"; want[library["_res"] "." definer["_res"]] = "Y"; want[library["h_errno"] "." definer["h_errno"]] = "Y"; # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 139,152 ---- want[library["_res_resultcodes"] "." definer["_res_resultcodes"]] = "Y"; want[library["_res"] "." definer["_res"]] = "Y"; want[library["h_errno"] "." definer["h_errno"]] = "Y"; + want[library["timezone"] "." definer["timezone"]] = "Y"; + want[library["daylight"] "." definer["daylight"]] = "Y"; + want[library["tzname"] "." definer["tzname"]] = "Y"; # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/aix_rt/Imakefile Thu Jan 10 14:56:58 1991 --- overhead/class/machdep/aix_rt/Imakefile.NEW Fri Feb 1 15:13:45 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 38,47 **** $(RM) ,entry.c ,entry.s #endif ! libc.eplist: /lib/libc.a /lib/librts.a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) libhack.a $(AR) libhack.a /lib/crt0.o ! $(NM) -ex $(RESOLVER_LIB) /lib/librts.a /lib/libc.a libhack.a | \ $(AWK) -f nmfix.awk | \ $(TR) ":" " " | \ $(AWK) -f getlist.awk | \ --- 38,47 ---- $(RM) ,entry.c ,entry.s #endif ! libc.eplist: /lib/libc.a /lib/librts.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) libhack.a $(AR) libhack.a /lib/crt0.o ! $(NM) -ex $(RESOLVER_LIB) /lib/librts.a /lib/libc.a ${GNULIB} libhack.a | \ $(AWK) -f nmfix.awk | \ $(TR) ":" " " | \ $(AWK) -f getlist.awk | \ *************** *** 52,57 **** --- 52,61 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 58,75 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/librts.a /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! ar x /lib/libc.a ; \ cp /lib/librts.a ,libcx.a ; \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` rm -rf new clean:: --- 62,80 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/librts.a /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! ar x /lib/libc.a ; $(ARCHIVE_COM) \ cp /lib/librts.a ,libcx.a ; \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) rm -rf new clean:: *** overhead/class/machdep/aix_rt/getlist.awk Thu Jan 10 14:57:00 1991 --- overhead/class/machdep/aix_rt/getlist.awk.NEW Fri Feb 1 14:23:31 1991 *************** *** 144,150 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 144,151 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/aos_rt/Imakefile Thu Jan 10 14:57:02 1991 --- overhead/class/machdep/aos_rt/Imakefile.NEW Fri Feb 1 14:50:45 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 24,33 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 24,33 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a ${GNULIB} /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 35,40 **** --- 35,44 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 41,57 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new ! cd new; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a; \ ! $(CHMODW) ,libcx.a; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 45,62 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new ! cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; $(ARCHIVE_COM) \ ! $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/aos_rt/getlist.awk Thu Jan 10 14:57:01 1991 --- overhead/class/machdep/aos_rt/getlist.awk.NEW Fri Feb 1 14:23:49 1991 *************** *** 144,150 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 144,151 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/dec_mips/getlist.awk Thu Jan 10 14:57:11 1991 --- overhead/class/machdep/dec_mips/getlist.awk.NEW Thu May 30 18:51:00 1991 *************** *** 48,53 **** --- 48,54 ---- want[library["class_PrependClassPath"] "." definer["class_PrependClassPath"]] = "Y"; want[library["class_GetEText"] "." definer["class_GetEText"]] = "Y"; want[library["environ"] "." definer["environ"]] = "Y"; + want[library["__start"] "." definer["__start"]] = "Y"; want[library["_exit"] "." definer["_exit"]] = "Y"; want[library["abort"] "." definer["abort"]] = "Y"; want[library["alloca"] "." definer["alloca"]] = "Y"; *************** *** 144,150 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 145,152 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/dec_mips/Imakefile Thu Jan 10 14:57:08 1991 --- overhead/class/machdep/dec_mips/Imakefile.NEW Thu May 30 18:51:02 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 27,36 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: $(MIPSLIBC_G0).a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) $(MIPSLIBC_G0).a /tmp/libhack.a | \ $(TR) ":" " " | $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 27,36 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: $(MIPSLIBC_G0).a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) $(MIPSLIBC_G0).a ${GNULIB} /tmp/libhack.a | \ $(TR) ":" " " | $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 38,43 **** --- 38,47 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 44,59 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: $(MIPSLIBC_G0).a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new cd new;\ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! ar x $(MIPSLIBC_G0).a ; \ ar cq ,libcx.a *.o $(MV) new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 48,65 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: $(MIPSLIBC_G0).a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new cd new;\ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CHMODW) * ; \ ! ar x $(MIPSLIBC_G0).a ; $(ARCHIVE_COM) \ ar cq ,libcx.a *.o $(MV) new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/dec_mips/doload.c Thu Jan 10 14:57:09 1991 --- overhead/class/machdep/dec_mips/doload.c.NEW Thu May 30 18:51:06 1991 *************** *** 15,20 **** --- 15,21 ---- #include #include + #define ROUNDUP8(x) (((x+7)>>3)<<3) char *malloc(); char *realloc(); long lseek(); *************** *** 91,97 **** _BSS, 0 }; ! /* This routine rolls down the symbol table and computes how much space is needed of common variables */ unsigned long compute_commonspace(e) register struct doload_environment *e; --- 92,98 ---- _BSS, 0 }; ! /* This routine rolls down the symbol table and computes how much space is needed for common variables */ unsigned long compute_commonspace(e) register struct doload_environment *e; *************** *** 109,115 **** thisGlobal < globals + globalcount && strcmp(thisGlobal->entryname, np) != 0; thisGlobal++ ) ; if (thisGlobal >= globals + globalcount) { ! space+=sp->asym.value; } } } --- 110,116 ---- thisGlobal < globals + globalcount && strcmp(thisGlobal->entryname, np) != 0; thisGlobal++ ) ; if (thisGlobal >= globals + globalcount) { ! space+=ROUNDUP8(sp->asym.value); } } } *************** *** 347,353 **** sp->asym.value = thisGlobal->entrypoint; else if (sp->asym.sc == scCommon && sp->asym.value > 0) { ! unsigned long length = sp->asym.value; sp->asym.value = (unsigned long)commonptr; commonptr+=length; --- 348,354 ---- sp->asym.value = thisGlobal->entrypoint; else if (sp->asym.sc == scCommon && sp->asym.value > 0) { ! unsigned long length = ROUNDUP8(sp->asym.value); sp->asym.value = (unsigned long)commonptr; commonptr+=length; *** overhead/class/machdep/dec_vax/Imakefile Thu Jan 10 14:57:12 1991 --- overhead/class/machdep/dec_vax/Imakefile.NEW Thu May 23 12:42:23 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 24,34 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a /tmp/libhack.a | $(TR) ":" " " | \ ! $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 24,34 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a ${GNULIB} /tmp/libhack.a | \ ! $(TR) ":" " " | $(TR) "(" " " | $(TR) ")" " " | $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 35,40 **** --- 35,44 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 41,57 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new ! cd new; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a; \ ! $(CHMODW) ,libcx.a; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 45,62 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new ! cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; $(ARCHIVE_COM) \ ! $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/dec_vax/getlist.awk Thu Jan 10 14:57:13 1991 --- overhead/class/machdep/dec_vax/getlist.awk.NEW Fri Feb 1 14:24:36 1991 *************** *** 144,150 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 144,151 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/hp_68k/Imakefile Thu Jan 10 14:57:15 1991 --- overhead/class/machdep/hp_68k/Imakefile.NEW Fri Feb 1 15:13:59 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 24,33 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 24,33 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a ${GNULIB} /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 35,40 **** --- 35,44 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 41,57 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 45,62 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; $(ARCHIVE_COM) \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/hp_68k/getlist.awk Thu Jan 10 14:57:18 1991 --- overhead/class/machdep/hp_68k/getlist.awk.NEW Fri Feb 1 14:24:52 1991 *************** *** 167,172 **** --- 167,173 ---- # now take transitive closure of wanted modules for (needmore = "Y"; needmore == "Y"; needmore = "N") { + needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/hp_pa_risc/Imakefile Thu May 30 20:37:50 1991 --- overhead/class/machdep/hp_pa_risc/Imakefile.NEW Tue Apr 23 15:52:09 1991 *************** *** 0 **** --- 1,29 ---- + /* + * Copyright BellSouth 1991 - All Rights Reserved + * For full copyright information see:'andrew/config/COPYRITE.bls'. + */ + + DependTarget() + + NormalObjectRule() + + all:: dynld.o entry.o doload.o milli.o symbols.o dump_all.o + + entry.o: entry.spp + rm -f entry.o ,entry.s ,entry.c + cp entry.spp ,entry.c + cc -E -I. ,entry.c > ,entry.s + as -o entry.o ,entry.s + rm -f ,entry.s ,entry.c + + dynld.o: dynld.shar + sh dynld.shar + + milli.o: milli.shar + sh milli.shar + + dump_all.o: dump.shar + sh dump.shar + + InstallLibrary(milli.o, $(DESTDIR)/lib) + InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) *** overhead/class/machdep/hp_pa_risc/doload.c Thu May 30 20:38:02 1991 --- overhead/class/machdep/hp_pa_risc/doload.c.NEW Tue Apr 23 15:52:10 1991 *************** *** 0 **** --- 1,183 ---- + /* + * Copyright BellSouth 1991 - All Rights Reserved + * For full copyright information see:'andrew/config/COPYRITE.bls'. + */ + + /* + * doload.c - dynamic loader for class system + * for HP 9000/800's running HPUX 7.0 + * Written by David Anderson + * Thu 7 March 1991 + * + * Loosely based on Zalman's RS6000 version. + */ + + #include + #include + /* #include */ + #include /* For MAXPATHLEN */ + #include /* For NULL and the like. */ + #include + #include + + #define TRUE 1 + #define FALSE 0 + + /* This should be removed, but the machine independent code declares + * doload_Extension external expecting it to be defined in the machdep + * code. I suppose one might want to set this to something other than ".do" + * but for now we will do it the way it has always been done. + */ + char doload_extension[] = ".do"; + + int doload_trace=0; /* nonzero if debugging */ + + /* doload: Load a dynamic object. + * + * Basically this just uses HP's dynamic loader and relies on it + * to do the right thing. + */ + + char *doload(inFD, name, bp, lenP, path) /* return pointer to entry point, */ + /* or NULL if error */ + /* UNUSED */ int inFD; /* open fd for package */ + char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + { + static int firstTime = TRUE; + int status; + long i; + char *entry; + char *dummy; + char entryname[256]; + char libpath[MAXPATHLEN]; + + /* In theory, one might be able to provide the correct values for bp and len, + * but doindex is going to free the memory associated with a dynamic object + * before loading another dynamic object to prevent memory bloat. + * + * Therefore this routine fakes something for doindex to free. Of course + * the correct way to do this is to add a routine to the doload interface to + * unload a dynamic object. (See the commented out doload_unload below.) + * If doindex and all the doload files for other machines are ever fixed, + * this code can be eliminated. + * + * Note that the loss of correct bp and len info is not to big a deal since + * it is mostly just used for debugging. + */ + dummy = (char *) malloc(1); + if (dummy == NULL) + return NULL; + *bp = dummy; + *lenP = 1; + + if (firstTime) { + firstTime = FALSE; + status = _init_loader(); + if (status != 0) { + fprintf(stderr, "doload: can't init loader\n"); + return NULL; + } + + if (define_symbols() != 0) { + fprintf(stderr, "doload: error defining globals\n"); + return NULL; + } + + /* Load millicode */ + sprintf(libpath, "%s/lib/milli.o", QUOTED_DEFAULT_ANDREWDIR_ENV); + status = _load_file(libpath); + if (status != 0) { + fprintf(stderr, "doload: error loading %s\n", libpath); + return NULL; + } + + /* Load classproc */ + sprintf(libpath, "%s/lib/classproc.a", QUOTED_DEFAULT_ANDREWDIR_ENV); + _declare_undefined_symbol("class_RoutineStruct"); + _declare_undefined_symbol("ClassEntry0"); + status = _load_file(libpath); + if (status != 0) { + fprintf(stderr, "doload: error loading %s\n", libpath); + return NULL; + } + + #ifdef ANDREW_MALLOC_ENV + /* Load malloc */ + _declare_undefined_symbol("malloc"); + sprintf(libpath, "%s/lib/libmalloc.a", QUOTED_DEFAULT_ANDREWDIR_ENV); + status = _load_file(libpath); + if (status != 0) { + fprintf(stderr, "doload: error loading from %s\n", libpath); + } + #endif /* ANDREW_MALLOC_ENV */ + } + + status = _load_file(path); + if (status != 0) { + fprintf(stderr, "doload: error loading %s from %s\n", name, path); + return NULL; + } + + for (i=0; name[i] != '\0' && name[i] != '.'; i++) { + entryname[i] = name[i]; + } + entryname[i] = '\0'; + strcat(entryname, "__GetClassInfo"); + entry = (char *) _get_symbol_value(entryname); + if (entry == NULL) { + fprintf(stderr, "doload: %s is undefined\n", entryname); + return NULL; + } + + if (doload_trace > 0) { + fprintf(stderr, "doload: loaded %s from %s, entry: %lx\n", + name, path, entry); + } + + if (doload_trace > 0 && _get_unsats(NULL) != NULL) { + char **symbol = NULL; + + while ((symbol = _get_unsats(symbol)) != NULL) { + fprintf(stderr, "doload: %s will be loaded from libc\n", *symbol); + } + } + + if (_get_unsats(NULL) != NULL) { + status = _search_library("/lib/libc.a"); + if (status != 0) { + fprintf(stderr, "doload: error loading from /lib/libc.a\n"); + } + } + + if (doload_trace > 1) dump_all(doload_trace - 1); + + if (_get_unsats(NULL) != NULL) { + char **symbol = NULL; + + while ((symbol = _get_unsats(symbol)) != NULL) { + fprintf(stderr, "doload: the symbol %s is unsatisfied\n", *symbol); + } + } + + #if 0 + { + char *name, *module; + long rem; + + name = _get_symbol_name(0x40384d98, &module, &rem); + if (name != NULL) { + fprintf(stderr, "doload: dying 0x%x after %s in %s\n", + rem, name, module); + } + name = _get_symbol_name(0x40308dd0, &module, &rem); + if (name != NULL) { + fprintf(stderr, "doload: called from 0x%x after %s in %s\n", + rem, name, module); + } + } + #endif + return entry; + } *** overhead/class/machdep/hp_pa_risc/doload.h Thu May 30 20:38:12 1991 --- overhead/class/machdep/hp_pa_risc/doload.h.NEW Tue Apr 23 15:52:11 1991 *************** *** 0 **** --- 1,28 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + doload.h - environment for dynamic loader + + Author: John H Howard - April 9, 1987 + */ + + + + /* here is the state during a load */ + + #define nlist nlist_ + + typedef enum doload_mode_enum { + Load, /* .. loading .do file */ + List, /* .. listing .do or .o file */ + Fix /* .. converting .o to .do file */ + } doload_mode; + + extern int doload_trace; + + #define doload_extension ".do" + + extern void *(*doload() )(); + *** overhead/class/machdep/hp_pa_risc/dump.shar Thu May 30 20:38:22 1991 --- overhead/class/machdep/hp_pa_risc/dump.shar.NEW Tue Apr 23 15:52:13 1991 *************** *** 0 **** --- 1,154 ---- + # This is a shell archive. Remove anything before this line, + # then unpack it by saving it in a file and typing "sh file". + # + # Wrapped by Cary Coutant on Fri Mar 8 17:11:55 1991 + # + # This archive contains: + # dump_all.o + # + # Files are compressed using compress(1). + + LANG=""; export LANG + PATH=/bin:/usr/bin:$PATH; export PATH + + + rm -f /tmp/uud$$ + (echo "begin 777 /tmp/uud$$\n \nend" | uudecode) >/dev/null 2>&1 + if [ -f /tmp/uud$$ ] + then + rm -f /tmp/uud$$ + unpacker=uudecode + else + echo Compiling unpacker for non-ascii files + pwd=`pwd`; cd /tmp + cat >unpack$$.c <<-'EOF' + #include + #define DEC(c) (((c) - ' ') & 077) + main() + { + int n; + char dest[128], a,b,c,d; + + scanf("begin %o ", &n); + gets(dest); + + if (freopen(dest, "w", stdout) == NULL) { + perror(dest); + exit(1); + } + + while ((n=getchar()) != EOF && (n=DEC(n))!=0) { + while (n>0) { + a = DEC(getchar()); + b = DEC(getchar()); + c = DEC(getchar()); + d = DEC(getchar()); + if (n-- > 0) putchar(a << 2 | b >> 4); + if (n-- > 0) putchar(b << 4 | c >> 2); + if (n-- > 0) putchar(c << 6 | d); + } + n=getchar(); + } + exit(0); + } + EOF + cc -o unpack$$ unpack$$.c + rm unpack$$.c + cd $pwd + unpacker=/tmp/unpack$$ + fi + + echo x - dump_all.o '[compressed]' + $unpacker <<'@eof' + begin 600 dump_all.o + M'YV0 A8$,% @Q@1F !(J7,BP(0 (,!I2X >$80,L"@4D; !*(8.$#P U#*D0 + MED.%$!4&2!@!FT(*"2%021B 4,():&A2BCE3X1$=!(JM$?8CVYMA AT"!@ + MR HP"8F$2 CMQP=X-"8LD#!H'@@9*W("H*$# )"G"=%5')LC[5H:&@ (> H" + M !$: A(JW35D*NO81.2-;N"C5O!;<&H%1Q7P&( ".2>#9,0B0W(:ZS]R+0D + MV&9"($ (6:)M\V,$ P1D6?)M\P-T$":MF;9Y";7-C@#]Z!59 !!&8( H."UY + M"=$L:H$!>#+L1Z"A16]X2[HBS^&Q99&M 5:[VF8:%C0*LB5&RXHT%6F$"("$ + M]68&/T!,<@0&A&, >2MZ".X++K'2V3S'4P.K'%;).>E5P-[2VB6B0.V@/"< + M9X&X%\@AX(0@QQ*T!?*8 V! H,D:W/R0B&W."5$) ")(8\L&?#@"# @2=&8B + M#3_(M49K)](6B2-N "$%BI$LX5TB"M!B@ 4V!",7#1\ HB/X AP@I_7#<8 + M/ED!4*"/*XB1G@X!0("BAVLY @$G'D7B!"VL"A-,# R$IH$*XQ1T6-D!8"! + M>T72EH@-=,BEP"<&5+"&=T5J%H@#R$ PH7,6/@*.#XWT=A89>[Y%)@@<;D:H + MCK>U^5UX "AB2Q^E:&K<#\@!H9QTSD%G%%)PK$',9DLUA4 & A!Q6FI:, (( + M$"H@H8=9CR%A'1+* @!%L]9A\6H:2^R:27++-1>)K=(! $>"!" 10@)(K.$9 + M9ZUE@B$(HJQ0QI@!H "@@)S1]B :$%!BI*AQ8J -01HL XX@F4 !8(=*": + MC=MZ"L"?[3X 3FRSU59J;C]TX2I1:7!+:R0+V7J4N+TZU4:G_06 Q@I!8A< + M'(\Q$&(F*]!!+RC#JK:"'O1"4S._.(,A$ED:40L #BN8<;0. L"@-!*%/2V + M8FLYN_ *)*A')\Z# J + MR-PR]P/)"IF,%""ZFICRK\$V?;>G \"PPG8 X#T %MO5MBXB@0P!5A_*D37 + M?VL%^%V6"(2:B0)S&$ ) A084,T#]0!@@339?( /EHOW-P"7E"G@7B8+_&/ + M) A,8 U#.!5@32YV+X"98YY2@ "--@! ,0(Q"" 9\@\($!TS@P#0 4 $(! + M",,E1+W"AM"@,!=YRH4W 1C0T+:9#BI@C0&!(##0-P[X!0!P1@;Y20\$-)@# + M %" HM-1P@"50$ %#& -!U@/9V8P8'\( ,:4(9BFPG>\(IWO.0-,##1VR 0 + M[ < H,_KCG_\, $ !XDP-&L0. :"0P*4U4 $/C. $*WC!PN20+ 0 @P?- + M\CL1$L]XR,,+SMQP1*# @87MR=_^^O>_ )X0#E4D "!,ASK5L(3W"A&1^#5;9,U+?F!*)D1+E54@J7B,,!BP@KJ ,04HB= + M J#B9XO$6P&@4;E\;081DS""!FA0*%!YYW2U,( E%& + P1AAI]PP"< , %I + MT&$#^C $)4"@!Q:"2HO\4T P#/ %[PW/ ;,@WUY@:8@(Z:!Z #5NK3'/03\ + MP !3("$E'$ - "SO1?J0D7W0 8 "7*D-@! 60R AGM9CE?;Z]XSHVD\2BA@ + M$ ;(P K>$$Z\&0 /+"P=+@.A2U[ZZ%9VO!!,XPG%D&!/ + M'0!_HG*2 -15FW;5,0OER.-J=I6(/CJ'#'5H QR^$ 8VL$$'(&A"&,Z0AC& + MP TI%D,9Y ""-+@!!&1@PQO"0(8=@P -92"RD>\@AS>XX0P* "*50QJQK4LW9"&1B=:U3C>=![_C0>9CT%.(1A#&680Z^1#6LPR@$ .91C#&^1 !EDG)#0C@'2\UU"&/(!@"" 8>1K.0(:!QUP.,Y^#'D(# + MLUX#K8XWYVL)N\"DZ80A!Z H B + M8&$F3'C"$(+ !(7@/0E66(@3JL"$PBLD"$*8@EWV'H2%#.$)1"C"0J @A21D + MNPA#Z+L3J""%+"AD"E1X@A06@OHJ"&$A3<#\Y_^^D"#XG>\ :$(2&N_YA$"! + M"9!?B.!GTH3;+X3-DH[SQT,^\I)C.YD@2#D=;#T'(I.!QVX8-IW)<'U(0YW5 + MW9^#R.'@\8N3?]!V:'$=/!Z:-N@ZU7/8=FCN_..G1[WK5*][V+6>=OZ#6NTM + M4 ,*I'4!B&O^]W9C]W\* 0(M4!=7)W>>1@,(:'?/EQ&.)P ](0 8(1=0(1=B + M(0!@)!>%(A=\D! "8!-R@0@FR @FN!-RP0DF2 HFB HF:!)R@0LFJ!QR@0PF + MB! )00#*$1DGL6;_4(3_L!!&>(0- 0'* 0$+L1*D9H))B(1&>!)8 ).F! ) + M@ <-@0#PX!!"F$Q3Z!!8$ (8H!!;V(5?V! $H! L,(8-<85K 0!IR!!>"(8* + M@0-PR!!E>(8*(1()H8,,(8AM6!D.T0(+T8F(JAF!"&D1 A" *HQ"* + MF! #(!8 X(,"0 X*X8-YH1!F*(DX0!.\" #8(,!D(R_F! H" !. + M$A7%F! &(':3DQ %X(+9^(,* 0DT40 *@8L!X ,H<(IU. #@,(>VB##JHQ P + MB!]MH! 7H!+F" 5#6!'JB(<)@0I[J! &0 )4<'LDP! )0 *9(8:9(K^9(J29(M&9,I*9)$0'DA^9"1-P4A^8SD0XR=F! G@ TU$(L < *# + M0 ?2L!"S@ $K$88(@(%4( !3, 51( ,($ 4QD "42 4!<)510 UCV4)11@54 + M, RL ' ,,, "V\)3OJ#X!P)4-$ 4#@)8#$ 59V0!460 VX 0$ 75$ 5U + M&04 4 T$,)91H !1, U1D !QB0$:$88'0 Q\ "( ,0$ R$ $$,)ES"0 ' + M$ !H*0!\*0,-4 P( &;&0&2^911J1 '@)HQ<)>IV0 P)?CPYN[^9B_V9O + MZ9O$^9A[298",)F5J1 (L)BWR9M1@)I]:0"/&04%4)U;"9F+J9W5N9U1X)W@ + MV9W5N9>0&9N4"1G,Z9RX"9D8L &Y>9V0"9_669U\>0#5>0!7F6V2=Y4R, %A + M.04$D)\".@73\)][&07V29;R*9_4:0U1X "M69>%*9_>*9D8, XE$ #3L*$< + MVJ$>VJ$:P1"X>'P+(0!U!P#!R! *,(**\,(2%QA \"*0 8 PT !0" #5U! #H! #T*0,X8P+ :6VV!!KR!!4 + M6J1NF:3\X!"3. Q&V@"5AQ\?T1#B*!:=/ + M^*(&"893MF)&YQ <@ 10T )#H !C(')M$'-P0 =;Y@:XU@.AT0)/ ,,& 1C + M<*.>F@,R0 ,U, ,M ,QP! : '-#\ 8JE@9WQF-8)@=:QF5!X (P< ,N$ ,1 + ML1 (0 )G(&1BT&(_"0 +()!(D 13\ 4Y205!D)$*P*W>^@4]N9-?\ 5;)@8- + M$0'K&F1#UFI?4*UO<*UL,( +00 D8 9PT*MLV*]P( .8FF*:ZF* ZJ\XIVD9 + M)(G#E@8CR! +D*E?$&EM0&?NJA 3:[!?X'[&=GP4JWV.9I)PL+!TT+ *71R + M0'\22[%EUFH+X0 4&W_]QYSK:@;Y*@9U + $@+( +%E + + end + @eof + uncompress /tmp/compress$$ + mv /tmp/compress$$ dump_all.o + + chmod 664 dump_all.o + + rm -f /tmp/unpack$$ + exit 0 *** overhead/class/machdep/hp_pa_risc/dynld.shar Thu May 30 20:38:32 1991 --- overhead/class/machdep/hp_pa_risc/dynld.shar.NEW Tue Apr 23 15:52:21 1991 *************** *** 0 **** --- 1,871 ---- + # This is a shell archive. Remove anything before this line, + # then unpack it by saving it in a file and typing "sh file". + # + # Wrapped by Cary Coutant on Mon Mar 11 15:13:20 1991 + # + # This archive contains: + # dynld.o + # + # Files are compressed using compress(1). + + LANG=""; export LANG + PATH=/bin:/usr/bin:$PATH; export PATH + + + rm -f /tmp/uud$$ + (echo "begin 777 /tmp/uud$$\n \nend" | uudecode) >/dev/null 2>&1 + if [ -f /tmp/uud$$ ] + then + rm -f /tmp/uud$$ + unpacker=uudecode + else + echo Compiling unpacker for non-ascii files + pwd=`pwd`; cd /tmp + cat >unpack$$.c <<-'EOF' + #include + #define DEC(c) (((c) - ' ') & 077) + main() + { + int n; + char dest[128], a,b,c,d; + + scanf("begin %o ", &n); + gets(dest); + + if (freopen(dest, "w", stdout) == NULL) { + perror(dest); + exit(1); + } + + while ((n=getchar()) != EOF && (n=DEC(n))!=0) { + while (n>0) { + a = DEC(getchar()); + b = DEC(getchar()); + c = DEC(getchar()); + d = DEC(getchar()); + if (n-- > 0) putchar(a << 2 | b >> 4); + if (n-- > 0) putchar(b << 4 | c >> 2); + if (n-- > 0) putchar(c << 6 | d); + } + n=getchar(); + } + exit(0); + } + EOF + cc -o unpack$$ unpack$$.c + rm unpack$$.c + cd $pwd + unpacker=/tmp/unpack$$ + fi + + echo x - dynld.o '[compressed]' + $unpacker <<'@eof' + begin 600 dynld.o + M'YV0 A8$,% @Q@1F !(J7,BP84) "EDDQ 8 2$-8"@4HQ*,F + M3)LT8T P>1.&3!DY+$!8N3HGS1LW((*X@ '#18P:#@$0 8 0=J%(?[)_;=P + M+MV&$, !@+ P@,(0"B'8K3LW+180?#]"$YG6;4*B;Q-B"8%!(8+%#!TW)! Q + MLF3*"H=0^&BQK>72:CLS#-!HX>3*"0M 9 @!]4+."24"8&T8=,(E5!(2H)>P + MMG#BPE7S3LA1X6N%"2 OK$##(6X N@44Z@T; !0D'QGIK-Y6?/+<";4G#&#( + MM6\ ": T[,!VLVH""[@[I_:15T+Z_2ETG6[XK:>+>]TI@$M#)O!AG6H%%*-? + M0F% DI "L#5X87<#QB;A;DH@J% &B#0$ R4/H@? 0],", :J,3DTXDR"J@: + MBPD-4(V('\G'4!)LI(C=A>2X2,AL!]0'9$))VJBB D4F].%GW2V@F4)1Z,90 + MAP LD(J+C)2F !X)97DAF><-V>67"6G"(P 1H+G0%J0(J1L#0[AHR8)[14EG + M<5&FIB*>ZUGQ)@0H-,1&B?:IV$ F+I["24(/8)+0HI1:FJ9NCZZG*94*#7#2 + M0GQ(=YMJ#WCDT',)W4+> +"5FB.'J*H*0"MO%H!#0W_LVJB:#WCCHBY,"$=+ + M0KT:ZR2PPB8DRIL(\+G0(.S86=QL#;$*P"^6P4;M1[2J",%L 6 +@+8$R*D0 + M(]>=JJ($;VE[#&P#(,=NCL@)JB:\"AGJ' C=+<. 0D$"\$AS !1LVKO^ O#! + MFP!8R! D9%@+@ 1UN+B,G -'7'%"'>NK&\8*.> :"*A=UA D<#BDF:\2#.)0 + M #Z@$# AL?%@&P %\&"90N!=+'-Z"M%LLT+0U*>6106@=IUF04NPW7I%U]P= + M-,0HA#+/00,@'=0TM4?T>E8KI.!"3*/A,M T,;I:V0E!$R@%:2LTVD=L7^RV + M1F0?G9"5:/-L[L\)1:W(S' # $US 80I^'KF+0R X:%6[3?/OB9DT0&)99:W + M!*TU9'1WTN"<$ J;=YXHWH73%/INEG.H[N:9+P3VQ8X@?KDTK)RV8N::W2Y! + M[E3W[:-#FYSL[$U8!&,?)XE'3 $1BKLD0Z81LC6D\9' + MNH61$K/D ][ R/8]\@'78&36ZOB =[2Q:#ZQI%N"V)= +40$3 ,",8N&R(@D + MSP @:$ 4!= N)T&@E"#8) $X$-W26 ,T-2F (:XI81,8!?AG&8G!16!9?PR + M/>H35&W>N5%3;/8&01P'0(443>,4JMQDY=]4FG>F95*,H<(AEIJ=W + M#1D!TY#@T&WZAXC/S.8T$=(0HP"@ C= Z#:YX1"/5L"/&DU/,XN2$ MD,J4 + M&,! 60H "^Q!I /@0$D3 IC1S!(^U 6 $)Q"L(:M).!%\(X\$T*E? + M13 -P4:1 +4C7 D.85GAB-)V"2G!.@9* 'VVE3Z0_:=?2;".BA(@E@LA0=I< + M.ZJ%F#4!$.BL6FQIMH28X ^Z)< N&<) %*PCN($D;D).,('@&K.W % !./>J + MEI7:,3=GT&T!&'M= +3@ ]KMSD(8R()S:%=+X[W)"K2[3@:N8![:_2QT6X#- + MP?+L8\KU[AP*&1L'-82!+CA&'@L 6^B^8 K:K:V!!4S= NPQOS#8@'9G\M^$ + MP& &%2U 7QE2@MF:J@"%Q2A\4LL5R4#X BOH+(!*!SEA/P@S27>L)F#<--H5J$H + M"#,S$?!(W0/,])()(0(H^TQ.,^M@&[H]@,].G! ?K$*D!XAGQW1PA$1KL!CF*^@6 >CE\1'^,% $9/;*/A[V + M1XC@D&.C4]E,-?,11O!L3P-Z&Y"&)Z$1\,4 7DN64*4 + M@&"8)N#/#'?"#P1[9_@46N, :,*F2YX &J-\"2J&@7T3L..))\0)_ O"[ + M$!,P#1 538!J&>)O^#31XZ,N3IE>H-L$H)HV"9'"&JB<@!CA)2%3(/>LX:.T + MA22&"E[N-7QR#74 5"'+8D^ =1.CA=::2@%_]KG@*JH R1+]WU160+1IDI M + MG(+D%UHT0_C%!3[;5P'QY%<:X'QXGBN$7V1X1][5]?B$D"'9#2"V JQ\L824 + MH;Z&5,"6.P^ -,@Z\Q<",^G3@/:2*Z#KE0> &JY!=\PPY 0_I[N<%>("ZX%! + MI H(,4/NQH9!BQUP#;E;&S9-[ 78?2'*_X=N%^#RA-SM#G<0;//7>7V+'S^> + M=]L#@^V[@$M#/R%[6,1 %R#&X5\*$=-?M]W0OX#U/_W\"4/$^D=/?/TS9 &J + MUW\5M0"PMUR;@P #:'L+T7MVA G3MWLME1!\, +TM #"MQ 6(($@0&4+P \. + MD8$ P =015T,X$@* 8)\L [TQ #,5E,:N()[YX(AN(%;QP#7)H-]$%C9A#TU + M)X-_< KR!,,@8(@4%$,X'BGDSI&.'0+\0+S PMYQ !)!P"P\0<[H'T@\T8* + M 1N!D%TD^& + 1N , BZQ0 *N(4)(0BO8(02!P IH(2FP@#6!0/S@PMYU #< + MI0$),0B21UT-T()Z" "%('U;UP#5!P"!: @S '@ T !3M!")R%DR%T4-8'X* + M$8B$,(*HUXB4EQ"!F C--8D)T0#W=XD)40C.9F>CJ'J!B AZ95\-4&NF" "' + MT(>P2':0F!"(\ T5U0#6I0*T4U$.P%UT:$?00&4.T$T&EQ",< #(>')4Q8PA + MM74. %0,(5F,X(4-\#P.L$[8R'C$Y@!!!@"2Y0C.2(WF)EF/,'4[.'%9Y58) + M\0C[, "FX@#Q!H\1 P'TN'#VIA =D!"00 +A5#)6QQ#_&#%;((S2LA K$(SU + MR&8+48P*<(Q/%$4.H'!) 9!G, L8@$7!,P R%))3$ R!)(A&04V< 11($-1 + M, TK&9*P4 #3, XD#O40 WF0,V49+3 A29)3( /# U8 P $ 51$%(! + M$ 4Q&04!0 T%8 L0.F<$2G( !("0 X@ $8 ,> + M40U1.9628Y58J95<"0!>"99B.4EE*0!H"90VD $!8 UKB0%^495+^9(W( I + M.9 1 !2"1N:80 !8 -(D VX ,#\)B!J1 ',)E(H "7&0 U< >9 + MR9'D(YDV8 02\)@.(4,8T */29694DZ9@0)X>*D,R\#"X:: M^J(N&J,PRJ$T^IXSZI,P( G= + MV1!G !G\)@%(#D)4 !GT*,R! Q !@R= W< @*()0^R9X0*BB0*BF0*BJ0*BN0*BR0)_*:$K0J'.:0,G>J0A&0.C + M8* R8 H0"IC3*9(D*:=Q6:=WNI5YNJ<>63(F&9Q;":BX&9)(.J@$D*<^B0!3 + MD "]*3G#Z*I9SZI/ N9BC0))R:0H?>J@?89+>&JY8.0H" + M$ ,N, !S20T#8 -0@)/?&:A_^JT>2@WO&@<-2@T&<*F:$0$%8 /NZI4( =( + M- T.VYC4,*P/>Y\X.0T!X+ 8*P#3H*O4<+$$, TU( -/60,S\)3P.@ U<'"/ + MB:YM,0 ,B['"BK$(^Y03^Y7\,0T'8 ,T( W^Y+F0$^*0"O + M^Z:?^K( (*D1B[=\*I@DB@$AT*45!)018 ,_@)?*9 -!\)957.0 KB@$JL+Y,PJI8>03 &0'!"X2XF9+ + MB;QNVIG7R:Q@/5 + M$,^T+%U+$,2( -7$ PD!,QD 5(J@4!< -;0 QP 6I-&-=, " + M&P->4+<*$ -?\*Z_%[@4]EA,6JZ@9"L86W(C%C+RG^:IB<*X&[+). + M +I-"[I(.@:2NZ?9>P *L L3P LV0 :JS 7O6@8"( -F@)Q6Q<$RH#:KK,)I + M@)?>+$,.0,[A/ SH 9J.P#6H",&T+$<'+?0NLJQ>@9UJR/CK#9J:;'DC,]G + M7,\\"P#YW+$RD ;G&]"P'*OJ7'A7N[;.6Q2JO,Q*_!$*$,H#,,HR*:QD' -K + M< #UBZ1LD,13:L 2$,I(2LK#"@-M4,6?"\KPXJ\[@#HR](-'*'3N=19\*'7/ BS=32' -L8,UMB=58,-)94-); + MW=4NO"("@ -N\,MBK<4M=EU>C %+T+%G?0 )0-6E/+4Q\ 8.W=?0>I-#G-59 + M8 "5W)-<_:$[? "[\ "\4 R[<6CK,%ZZ\3=6\-@_:Y9< !)J]E(FM+\P=4- + M3=2(/9U[;;1X/9.!+[9XEB94GZL5+&]S#"J1".I]>C S( ?OZ@*6FK=>.IJBB0>B + MF0=_B=0(H*J@Z0'C_ L0X-R:P0#S:0$"_ TH <^:0"PL <7FYZ3<)4_[+] + M&P$R1'W T,5U,*SO[=0SZ;"$O;'^*D,/4 T*(+ $:QD50)D8P &X/0=\2ZN2 + M@A9^@L& *5XC-[0,9_Q' @J+ @@^<&2TP ., /!D)["D)YDJ).F + M2PBK*>,9K@!.3@$"# $U.<8Z^;$(0*\;>P.#P+8?&^-O;0$80 G[RPL8\ C% + M7 "[D !P[@$;W45_:PA)J[E,"PN(8+$W, D?&G":H0 +R^<.*]?T.MVP+ '3 + M &)0 #6, T/0 T1 + M<+5PH.C3<-UOS962+JS/KK'A"<0+4;N&()/Y;>AF(P'<6P:\\+_4L WV9/H.Y,VD AI[0@#H)/2[A %(.EQW &X'>"9 + MF[%SO@L1 .<&0*E3(.EHS+1+^\1/ + MC .4X*^/:3*:80$24.T7'^D6HO%G60EPV[65Y; +@ .6\+48< 75#L5"K[$8 + MX '\(0.7@)>8X+'^2MQ-S_0\"_5V>T29,+JB.Y/;.;I?>_58?=/5L/57B^!1 + M+_93W_0\._9UB_9/S\L"F_/[_/8"&_<#K>"5Q<$QH&+W;@"23M@.>D,8> + M\)3I&0J.^PF:F[4F[[ =K+?"7_Q56YX<>:K0H?>?T+0Q*Y,EW^JD4+$X4 H5 + MB[3"&M48X!:'SG[)S_U.>[%?F_W;#\4",-V ]+7YO<-_&_VOB@J^+^0M,?"J + M8 ,50*\RI XP H'( ;@BCJ&[+:4-3@ ^2S9&37GUQ)4%4@B3^I)=@4J%.6K + MKM*LP@ ,$#XL+B$@KRR C=)85VD!V( E4*^8@'5R!7BI"?2O&3?DX( JJ"SJ + MJ7N1*(1$E=@>'F)L,]- PK@L&22*A1Z2.MKS1A@<+XLES038X.L%JH_ + MIU6ZH-ALFP86H)CU+P]6S&@8EDMO"\#))8 WIP!N@#!0? UA 6" &\#P>('J + MZH3PH1HF,6> #:.3+7 &W'#:V0*( AJP3?$AG#@&/"M#'#)"D P"(8P+@ +[ ') #-* , + MX $X\ ;D !," X (I8!,\ 1)\@N F*,C'ZQHY $D &TH =2 (,00-DQM?8$=U ;W2* + MFU$R4D8V8!DUHF/\B&!1+&;%C,@08B(^? -KH [ @:\8%L=B:"P*3#$H1L7_ + M@Q %(D$TB&:C/2I$&7)R%D!()(_:\3PJ ([H$=/ /DP#>N \?A0XH!J%(D14 + MC6'@"PQ&,W 5RL!3+ /<42$L +R8!N; 4 R)^2,]9L6UEC_:P&E\ ]0L0S;% + M,0 'VJ)"F "N\0L02#I@(,? :=2'8V -+(0$,!S) %-PD6S TR@ TJ@94^-J + M9(]4 ""ZQQ52:!2 ?%R()V=AA8$Y, >^P%<0D#1A#A#(,6 3FR)'/ -- 27/F25LP"H.RD(9)WD. 3 #@Q%* + M^L,@F1#?8Y$\DO21N+"!HN@3@:)09 @[YPUTRJ"89$81&1"59J E4LFNB(3L + M(Z>< V?Q"U0%GI, -J48^(H%LE1^%!S9&4MC5AP#=, .? %>"2-E)$.H "G2 + M5Y8!8"DLB>69-);0QU8.RZCH'#VC4Y@@8J .I(%$Z1 >@+2DC1;22\J!*YD_ + MAN-@; ,EQVXDRS+P*S^BLXR1'DP^6LJ#2"D%(I*,,@[R.4;'X/A_\B5%A(VJ + M<;SX2SF@&SNB'>B7SI$BXD,<.5Z^8W@ + MR[$BXD-]^"<]6,X$F'0@0C* C+DQ"V9L?(F4@FA.$)7X')O"*8$ 2K-@&D>N + ML _C9;T[)@W@&.:!5KHU4< + MC(5Q8^+&B3,'7.1O;)-O$D(RA (0!V"E2SPQA3$JSD45:19#I&@,G 1R,(K) + MN'D59F2--(Y5X O$ !G0$!R AUP#$T0.U,6KF 8(I50LDZO1)7).S[D0"@ 4 + MJ )4X M<&P-P.E/G#*"<"R$"7,[,60;@P$_\B&2S(* + MQME).$'DZ!2/9(Y[DVZ?I!E!E + MYT2>XR4NOH'2J"!A(T,X +.R?')(87)C/TW:H1-L)+/6B0X Q#,[ + M$D;:""8EI00@GGG22ODRVWI57DE0GT + M_TBZ030)TA5 SD@=ZX0;^F&Y@#&/1Y1D@# !J73XD$DEMS7L;'JWDO + M,=!#C(A5D2*2S6%I&+]"4WD*9" B"L@'$#-')A5M X=QX731FQ)7I),ZHN2R-D[)B=\5U"RX6P + M .1EUERB6[.)6@8"R22_ !VX WRMH7U:4>@*1Q8D)T35)I3 + MFL@ND9 "F*]*J + MBH&D&E8;0@*(JN*S-#:$ I!6H20_K93^U(X0TY/# KF?<2*DK("O%,0"2$A + M*" 5DV!Q8S8$M*D6->8$R8[FL2S&RDW)%#=H^J0#HE):,E8F]%:'Y%#5F@E1 + MD>H$SFD7(2)34)ML4R;6S4M%J.'M('&V3O'5X2Q=F-#0# + MU#%P0<+$P5L:NTQI[8W/LCNVQ/_9"!-DA.P.*[)'5 $EVR49%)RL'H*Q$ + ME;)B 094V1AP90<>&CVRY&C%MM@7>Q9C[' =LS86Q^I8'ML"?"Q)7+,T@,@: + MV>089YDLG;6S7>$K3%D]:V5!I:T\BN-2;UXC0?ME"6T;,+0S]HQLQ+9ZELIU6*?K)"-EE!VV8/;0T=M4N6C3[:*& D(VT;7;2 + M0J)9VV1K[5:XLYHVS^[9*WM6$Z5TI2JD%LP66C$;;,OLL&VT:=:.P-ID*VN5 + MK*5UME$VVN):/GM%TT 65:T+H=>6VE^;:LFLHCVSX+;8'MM82VG-+:U]LL\V + MTX(%:9MKMRHCG0,3UN!D6U.+:A&MM\6WKI:XC%LWVV_E;+,%N.EVX*[;*VL + MKJV\U;:GEMNJVH?;:L.M IBXRO82,=M+&W!O+:=EMTIQ41K44_)Q&:[(M;>L + MEMB^6F/+9BGNLO6W%[?.MEQU^W*OK #P"J/6RX+YN6V [V'W8>5U""4 \VI> + MSNMX@\#G[8W ,J*6 =);&G,BZMV;JG<(L5[7.P-@;XZ$"K37]IJ%W'L^1RQX + MQ;9*U^827IS[;2/N>$&YY=;BHMV]2W A+TP,,0[ P& !P 9'H!./0'5P ?< + M%0!P FP!.' %=-1'/ ![\@!FPP. +?C7!R07_FL+P@$]F;\J@;%1BK[R "Y0 + M MX&"Z'_A@,P5!P2 P2 #!" V^R%SY* C!"T@2O6$'U%!!#!$4"?Q(D,S UB + M(A-N ,Y =VJ*"$!'(@"%B0 *!__^@ TP@W- *8(3S4$"X 8)L#HD0.W0PB<@ + M ]L":Q! !@]/D ?0P(P"@GP1K0PC3D!@F 0 -7!PRC0D &2: ")X )+@:_("B@G]U +^0H*IE LR&"4!')@ ,EL27 + MS!#; G&0,11H()D ?84"X 8*T$VT<$W%PX.@^G YZU,:*$#!H "=R#,,'U1# + M :P.!0@D% "Z6+H(W\K@&.H +JA @@>_MN$S0 3=@!78@T(@Q^0#=[ 4 ($ + M:X 8_(!$L :*P0^(!"N -:(!HH 5L J'<=[806@ 8L !D! "P^0+T( + + MH!%60!JP"#1 <'49\*();@!=$ "+X![\@7+P (" ! $]A@(E!800'-6@!I0 + MR.,X/JP +8(.2@,-B%P 8 6L 8C, Q( %E@!(;(B)X2+3(56 !O@R D #*P + M-P"1&3(< %:A ;<@80@#?+!#O@'2R /_(!\0 ,J@P&X4@9 XADTR L@ - + MZ ,?@0,( "(P#7[!35X"?V G]^2DU@^"\E >)ED 2CE(B!1" !F,H"P"P5 + MY:N\3:[ "G@#*!D/C( @H-ZF,C0N $5YF%R!JQP EO(*@ ,H&2'' 84\ J" + M ;D!I P*T !-D #P !K( 0D $0QE&N"[, !9%@! 8 4X8P! DF' 55;*6> 1 + M (0( /L\4A&$R09"4R##O"4^\!.'LH+P YE@"4PC;/ $O#&D6 ):.-$4)'9 + MPA,8!C\@$$AC:FR-'519F#55D: ) + M"RQFWP4!#L%F!@%:>2D_9B"P#(X$'F#-/R -F.21W+C @!6)SHNY,E3GS2P! + M: 'N "N !U8&/"N,G36 M89QV9G(K"=NS,@P 3T^2R39P" + M!Z8R!+#0T1DYHS@]1 "V,S+@ X! !$CFA(".+7-I&"9:(#L/@>W,G_VS-LX$ + M 7I 1X("W9OAP K C33@!T0,X4RCE30(&,I+@)0A >0L""(T98Y<.& Z^X4, + MC9V5\HZ^T=N$.P\"0 $0O1DKM&/63K?:"_=HZ=Q?08"MADW#^EIG UN@+ + M ]L9.4. ["R=$P(.<,\/0!4, 0HB H: +P,!UP << !.D$H!@ BP!N2 PCE + MTC &#C5XS@,!VD[_@%! I _T5 T%L !T 0'( \@ QSD .T NC8G> #H + M(%R# Q]P"_"UXPK0PX0+=&K?_*,_=:C>S'M:*7/HW0 !3#40$'[(Y!*H:G.P + MJ,$ XK8&XD!2@P'%#0+0@,S@UC>: *3HS:P+& D4-;,&@2H LB] ;X!2/X( + M=?DCH^6OC)CQ ""X V JR!<0 4, :R <]QBU( " PNWO,$@#".. 0 '. + MO 3^$088!+K 9@\!@"T"CD$G 828 AT 0!@"*Z!*. 'V ,3&]#4('E]@_H + M \.D3+OI_PRDV[60WMO8>#9W8P)M#(!SO)X'@/ & 3B@03OF + M8 T$D+,R0 )_@ K!;0C0"1X!*/@!S0 -(.7OMTV& W0W!GY'E/F_H0$&, H + M &&@! Q"@!8# -_ :T^ >C&Q'X Y #"B")0E U3K1V "L#42T :U>R@C + M@6PP.1@ ,H AH 1 (,WX\&]!@V@9@( $9"!/W (+#@&S]O@V36W[TSPFK_Q + M?Z;-YALW!X*5K)"O@3@HW8/@"X !#%" + M2W :D ," !)X #< !'2"0V"R!<$0F 72>@Y4:T?0CJ7 '?<:TD"/DVPS4(0< + M 1[@S B@1$T!.FZSU0!\0P%J((##@+X' 28!'_\!Y\"1U^X'@ H(N '_ 8?@ + MCXL &Q"M!8 BP =_X O <3F.M^O)WH8#>1IPZVAB#0C0 7T& DF1LNB %6X$ + M0,#)13_G E>[G)\+@[X!X,$@^ ! X*)G=-P-!1: ]-$$"T ?& M + ML !T@ 'H! %Z"?@'6SV\)<#[#M!(P&<@@ #] ) !. $KSQ!)W.D@ ".! A + M @B@C \!!@ ((( F0-&9>3,K ^MKL,S T $$( 0, ) 0*Z9NE-'XN.[;T=Q + M DVGB[109\Y)73\3 2Q- SH ; TT +? "/W@40 _TVX_)9 $ "]WP!:,%R + M)@I$H < !Z0QAG -+@%$-2 ( 4^=?VOF$" (8GD(4 .,H!V+@.VGE' KL"O2]E!X /Y# 2@!08(+F# $1PN],Q:T0"\SITHP$T(/PP@+DV!,?@ + M'@ #YR[<-[,00 (%?@APA.I-CK+WA(?P CQN/^UQW0D(/!4"Z^&9?.?S.B_@%C + MH,#?# 5-\ X8<+'L G.,A3G@K==UE=&MJV4T<""_P!@ +[ + M#M\P0$&6 )! QPMP;(T)N#P&,)9'G 7@ #JO[3AP0T\.I7O46 [-^#1 % + M/%#LY=KT!@37 ,D+@37P[&?]$%CFAL :_/@Q@.T]_1!X&#X>>X\!<-_L8STB + M2/9$(=,3>6/9Z74] %O5XOH()@/ZM# BP \6E Q(]U<$R1VW6#?A%E?2A! + M@M^X#):NK]XKNW4U?E'^ "0 B\]Q<_3(; + M[YX) -WZ#0 ;'F^3K-P+#, !N,I6"4/+: EPA"Q=&A8 >,D &!X#_/!ML@1P + M-Q(8!"/@"U0!&E *O .(3P)+0.''9H3?Q /!?V;79CX.H._?S(UA\QI8XAO_ + MPS=PNXT$% $X +0H.2?? "P!.@"//9Q&N !, $(D $> 8[5 TM@>D]I4 $ + M9 !69NZ;&:G3?)L/".! $H_29,GP P$1L 1\&0H YQ+@ 6 !I[Z=H_[4%P!+ + M@"-<_0'P!7H U_?Z]>3R+_$F'IMG240 + MY1D\[]_,D]K&:VPD N+1OKO>U*]\!;3%R8X,WGOCDN]# ([380!/A8;R T#Z + MGGY&SU\.@.FY/PQ8 6B"S0, 8(":%XD&"/8/ !:0_M+P ' !!&#B;CIOC_CH + M/P9<^PT( !B ]??AU6]KP#)7ZKUX4!H05NH1>>+?&J!3''5*VODG!KAV.D C + MT?X%9<'>$G @/&FEP1(@!U5U:8#^M^_M;># ;Y8"K&\QP J0$7%_F,![=]ZI + M>&H 7>#J12[.'EERE74 !H VT.MY(.??9#;9G7^X$7P7,0P3'%K31TB\?V)> + MU4>6+ (H@R:@!.I9VL /D 044@9 ,3"=30Z)'@;@ , #$ "(E@U(@3M/4,8 + MZ ('V1#0#?P +8DNL %\ 0R *P != #70.?V 3 O8 $X "8>C0 SH#Z+7UG + MCI/T!()U/D ^T,3% /]9"I#/A0 DH F( KY]/T .L *48DB 8(<*O'E_I5!#= %!@$1 L&@ %P!7X'.Y[]!=$M =C #Y '#!(&P!SX#1QD2\ U + M\ .P9=? P38$!(-- . #4@ < ?TQ@ P -"; X &L 5/!/2&"0P!7V#8EP4 + M VK $G &9@%H0#=0NRT!WT!XA@9\<..<,A@%, #-("0 #/X 80 :0!& $O + M%Q@(H $T7)D6!28": ,AP20:G^:'K@-UFX+(0Z #6)Z"V'EQA8 0LA$I ' + M;A.OWW>0! )A5Q\1X 5\ K.@RD?F"0.!X!+0ON4 @V A> CN;0.?-E;P>6,' + MWS:V!HA]:P RX+Y)?'*??O:O@7R,W[V7WHE_-(!'<=<5 1\?/*8-N'Q(@ )X + MORD!2, MT&,P %P@)H":$1)K$#^ Z5UE"(@6 !7.?X4#[E;J%7BGGQ)X]65] + M;0 -8)1 5_?$F 3,G%BGTFXC95]9U\^I_8%? //";90#K&R+8OIV "A]* + M8Q/F &M ,K ,K@'*@!2X!BP#:. :P S\ %G "A# 30Z[ C[PW@EVV-\:L"#P + M>M??$J"D80$FG0& TJET-5Y;\ DF?;!>20 %B'\_X K@!Q0.NP(\H H:@1A@ + M$HB[80%,X!"@!:AC%L%0J)$I9'?=$6"2\89U&1*@YPD 20##1YD9 L=#9 ? + MM 5UF1+0]WD'M6!XE@ %PS %8@"- " @!R&'6)ZVR$F 3\ N_8)-"L 0"T + MP < 81EV\07$ 2X"8@:&_@/A 'LH1D8GDT#O<#(%@1 "HA:#\ : !A 'Z8 + M!."'UP (T %@ 6D ?K@>.FK7 )8G*[D)(D"SEP:X"3A &@ 1( %#0!28!DP# + M6,#()K:% ,H .#@?W@ CFR% #X0 LL S.!]^ !JB/0#'I+P 50$=R#@8 T9 !D @I /F 9 ,%8D60!K0'4,!5Q@!$9TE )^ = + M\'P>V2+0#[ALV"%72)20,@8#\A?LK0%U@F+&1%R$Q*&;X)== "F9(D#:J0"% + M8B=(E%Q_MUJYQVWL=7I@#2 C\7I)(,"&!0P"I$ 7\ \AVAA[$<2I@-+P&+H + MFB&&4< 24!B"?8)A$* 6-H)AWP] ".Z%35P(\)]E /EK]:Z;?CK0$^ ["WXRT!D0L8L,^5=H$:J08&F&G>78\QD;EV/4"%UO1% + M$AJ BH8FZB&[']_GNQQK^-P(2!>F;S(A;&8M3@X_0 " (AKOAPR 8 J[A + MA=89$@)FB0% "%QEFIL6(*IY::B=J88:+G/G'QC +_J+?P/ R*5E9T4 BJ8% + M+ .%0"!0S+5FYUEH*)9E 2^CX"8S=F?_8!*7,T)^(, S)[@1 NW8P7:A=6B$ + M0" 21QR]FU& "4)7598RC=;8O=8HLX-4YM0 B4/(A 9;"_O8;Z"'$7H&W + M!G@@P)Z;(-=H ;_:O*@"((W8VM#(OY%J@AD'4"_.C6H6?J?L_6IPH]*(GO%O + M()YK!IL]<;=?I]9(9&.!X/H6 #"""4!:]Z6-9'H(!*"9B0"20'1(+%IDO@L> + M,#G* ?)A!D #Z"%>P#20"WP ^, @H /8=JQ 7@?=D83)@ HXDCT,B("+!P"T + M@#%9P=$6P&6A(6,V.V9H@=M2!C3:@9C (& (V':J0&YW+P://F $2 B0 3 9 @!> + M: ,KP&4D!*( #EGAT+B"7,,ZYFJLHUN8 #1Q 8!L%@CN:CY /+#VJ6\.XRG8N( " + MCR"-UKB@ BJ>ZS@Y-"XMH&07N4B+3=]@$S!N9M( :E@*%GLX) Z8#;AY1 !R + MI@D,$T4 $N GP@"+ "@ ".@!TAPJL "4 P; ->#H80*'P ? F?EC20T7Z45V + M;6"DUW"P78\-GLWV^@D 2("; ,, ECB(Y!%!HZT'^$XUN%^:!XL\)ME >L; + M[]2^I0$SX0^@]MF$!9]@J)L5AMP88@B.G8*[ @U9BJ$!NP(.V1R>C+E;_;8" + M'$Q= B&!#5"2B4QOF#X6#H(="G#7"8 V("H"3)5Y<5 >TCQ.CUU65& + M /KW-T@?F0 "D ',B8?9^B?]W9(OW0*@1/:2R$"<: !T "7?"@#? !H@&"7 + M]]5E2X .B03PD'==<>A#5@2HF1"IF8T B@"7!P,D 6RC\WBC84#9P#8I!L1C + MB1X,8/G/D+_ )7 /N)#*0!$0N+2"' + M) 3" ( #936,I !+PP4$!H9L<,%'.CIZ9 + M17D0B@D9Y>1X6-AP']&6(YU48!Q&*#]>]$?)*BDX9"@VA 03YZ17:"=IP%L8PQ + M[!:<:1%(@,/'IUE\;0'&)P24>0(:KQ;P'8[$0.+HC2V.[5L"4$@:BS8A7B@8 + M(H*%X0F(&*(TBR%@V P,ALZ %.@XII>&H@"I/C8NQD5?P:=MDNYC(O, W%C+ + M&C@@ FA\;5@RF1'IAGO 2+8K8 ,,Y5U72W)(HB0=@(^Q $ #;E,WG5*@"W) + M'!*'*T JN08$@U$ #8" 4&8"@3]PUS4!2(#B]IG\ P0 :0D.@ $B0!*P*P # + MB\ %8) E 0L"+H 0*@#X@ %P!\I!4F'3EU$N 5%@%+ ++@$-9A30 -QPGP 2 + M,.?A 8K /P (: !)0$X #9R9!!RI!@K@CU ?EYD4.BX+P& S(]YP*%T78)65 + M!C> %K"318?LVDCFNZ1V[6 >L 9%9PL .N"Z'8;"()3V!3Z79Z"CN2=F 0L + M*R!/VI.71.RF*89OR)D$D 20%%G:Z1 ])@-)P _-9=YHNH + M@ *@TF$#+8*R)OZM=MN8[&BCH6[Z6479YWD-R=P()=!M<+UCVV%ARIDX"!P&$@ ] + M*0C\ Y_ -W!Q3\ ET@F8)PZP,^I"S2. EMT=@-< @L= S"3 + M=0!6)SZ0THV$X1G*28WI?O"-JAY#8YC"#>R^5]'P#_@?YT! + MXT!NIP:0<@L=.B!EBIZ[ 1+0;V*3NP$"H.EQ:PD!,!"^D6KW7IAF9RZ? GT + MV5 .G])B0@ .#(UQ _:Y_FF?]][2:&%(GY" ]@D(:)\#7O@ !"A\P( "< VP + M Y); '?4!7 HP*KF 81YM=OQ6>R5:=,;79$+))EHP$QF2IJ>U*?<>/QI:#[C + M,8>>[0;A9ST!!"AN(L"TML)!$]H $.!^HI\2P*HFE 6?8(#["03@A\= !@ , + MZ !'B!SFN1%P#$ ?@.DQ (, I@<$D E\IP"PJ)%J^ 8P(*"C&=ERW)T?FX= + M)@@ ## ?P"F]P", W)8][;A_0#OP \JAR60G6=;$#+*C$8=&!""0@) 'MX + MN#EJ**@R'8 ![Z+A1H9^;5L?5O0)1*.SI*H9X + M8IV91^(9:&E>)O!Z@@"RISY PA%TCB.7AP(,GWLHF2!\FI]CW/!Y4Z8KFQL! + MJIT9H'V: /!_VG- @)](60R>8J4Y$ +( $# 3 :R46OZP"/@ ( LL 4"@(< + M R"=*# -8**:* @@"11[MIZ?>/7I F 6;F$SHV(Z)$0 @ "3V@:*@)4H8C + M-2 $-&X,X@AJAOX "2*#F-N=GB&H_O&Y=0(EJ J*'U:A4*@&"M]0%CE %YH/ + M[(>Z:./F?I)JT$ KZJC1H#KCA5:+4F[2P)&8B3H!)YL$"L*)<"1;"5>!OFH: + M0 ;J-0BB&)ZMEQ1U&3\ &F"L!7!(@%%'B4(*MV@*FHMB=YP &,"/^J);'3"Z + M@3IJ^)Z^YX8&GG3HX*D/W +@0.T)D>*>N9T40-&A R =\ G*Q'K59UW8^<5P + M"0$R\)$BGP +C"2DFK0H^>70)ZD$X'^%Y*ZI"4I3(I#6FT) 28 DXYS*FE" + M@ ? I&@ 3 H%<*0CJ;;' 7@ :X#G-Y(N 3E!F>:[T!4W 'PZ>4$_^?NQI&* + M@/_-W@8*_&:$I#<6!PP!>^DDIJ4TT--! (, + M X '9'5&G2A M_0 50 08"FD<-7:(2 "@ !J !'@)I TT 68"4N "6 $#T + M-6M*P.>(824A! 0.C&#XZEW]\OR!' ,2@!K < $& >@ + MFC9QT:4V]J:9>;S3PLCVK6^1@,K9;;8!+5D"T)/^A&M^0+ + MV3!^8XZC]SRIF3?%V:< GG(:NH5^/MU39V$\ /J + M',94KJ67 .8GF.EC0^=+MU>N;>T:$I<30 $?Z6G8G+IQWQ\(D DL (%%)_ + M9 %':+OV )"!@$!!1OAE;?A;/(97(@"EP#30#V FT#9J: #3'#8 S: $:G%WW + M2IHARMH@0 Z 6K Y\@91'D0 !K "] ?>V/G&80'EWRU "M + M+H1[*#?8$"Z$%"%;('SRE.$-W*G$ 6=Y9(5:7^9F0=V/YC@:?@"#+FF727#+ + M #@0^?$ ;MQ0YM4]D4H9&XC5<0+SF$9 S8$"M0QK(-HJ/G51:P,P&%)L=)CL]T] KJ$) + MI9S 4 8&S&2W*!P NE&>1B@B((2*:T1HWFIR6FW[W@, !5B;&.H-H)PZ /_ + M5=BBNG(I)YF*MMJMFL"\N'CB?/39_88%"*YLZ>LI EQZN:BBQJ@1:I<>)'#I + M=9D)0:R'U%UH^]P/T JDK8/ V*HPHGD,8Y@*CIT!%L$X-C6*?S6:&,VD9O9][.5:9 "0!0)W]!K_%SIIS;>;[@:X B7H9Z"(X6Z + MC16.PNELUMTQDT0!!.!M$@78F28IW54'8]X4H 1 "D@ $Q@$P&/IW3P& $@" + M4QDL0 -4 (X+#9"!['62Q?E:$2@!4^0"D D4@P,]JG]/(UU0T.4#&P 9T-(5 + M@Z0:%B [2HXXEA(0P;*=HR,^L C< &# \H@# $J !(02O&#"B!\&;XM *) + M4(8&P#W #3 IG(:K%/<7I7($81D&I TL !J .Z=R + M>H:)'@CPOMD 4.RWN=.5!M< 6TD(2)$E&?#JYRT!"X)P^-_-:ZO.$;"(7@$] + M67+HN_!]!T*9U@OT&"-LX.?330"!W +570##X ;R';V @^L 2<"R ,/@!( + M 4P -,!H ?TL?B (D 'B '20",;,0@"=( 0( Q@KIT <+ F&@KL(WNYASUL + M%YL"0 <8 ). )_N93!F4@"E[L2D"P,"#-TQ4 =H@!& )* (MFRJ@!!Q,,( - + M /P@ (B #6"*.@!4IP4@#5@#&\ ^X AL<'J $' PJ0#';#*[S(( 8H #0 9 + M ,8L,FN'*@,GFS.+'42SVRQGY@"8 =CL-/MA'DPNP#1K!]JMEH 2X-N4K,)L + M>_:>\0+RF0&P4C*&2$ @0(4H -: 2 (( & 12@ @#!H 0@ "( 9 .QL, + M5 0/0#APD"D!T H*\ #8 W*8.PM[OBTN!44+"5BT2-W;$@#LLE[#-2?0!@-O + MW41+AZ&JEL :8 ]X#?6?+9NQ 0+\W4J+ M2REH O2X4$LWPI,8O-1K/*+,1G + MS>ZTVJPCP,TJ .,L-FL(;'#R[ 5 S_(,W6EK1LFEM"LM#& +S &(PAHPFRX! + MH*P-4 MX#60D#B (5 -=0"]PGW@-3=L(( RX9Q^ *2"?$0 B:6MFP(T HD B + M^P;2 !/ ^TH?4K"SP!@@"-"UB_E7+@%;24BW7TP""P!4TZ! + M6_XIN.TM@RO_P;<)[7Q;W]ZWE "%V\ZVMQ=NALO7;;@!0%O+&'ZX7D.(6[N1 + MN ;NYU8)F+B8P-5*"0@"*EN4>L>2I-/0I'#4_1,@@ U "2QT: "4Z\FB -<< + M!M"T=0&JY68+9GYC@T!=)\^FM;F="(G/^HD8 "E']1T(5]\5@ 4DL>^CK!D + MLD9* .X&!&B"(\!),-9V"9S@")L-/ "::I":"2!Z\=L&V[@4;I4!#M"4/651 + M6;+9]%5E%X"FI\5>C53(5 8"Y+F0*;<@K-P#3]D=<)J)"=+'!8!'^JL#&A\) + MAP(#OUD2L+Y% 8P@(*GP\4XV(2$I&*I]A6'!AQCJ9HMA(C#4M07O7; 2 .*$ + M! T4 ' !%!H4HWYJ(NSUSW8#+5QTBL-, E^MV]@ & +7I !!^QT ^ + M<.0D@ O= =HC6 + MPG)J <+X T!]'(&MYC6( @=OYJ=DJ0%;X8;W+-:;1:#G&5/H -N9?18 &*A< + M8-*'N\&;E)D>0J_%:.C &L -?&/F+?2X]!:G%ME^P@DH?;7;,+$$K#K_;%6I + M\2("_X#--H)F HE %C#IA:8$7"#0!0 =S8 @$*,-$TS 5LG8[2=LP':VG7)P + M(^@GD A\ 2>;.WG400JEGJ6P;5X26-TE(&N" ,3 '0"]?8X!0-S+OT&8G0 B + M,"BJ &FKW8OW&GUOJ0))S7" ?P,^X,X5J(@ :7>+'I9@;Q;P]@8 ;L!VE@B@ + M #%: ^#E:0*)@!9@\KYG[-\V\31.8QG ZP;WEG[1FJOGP5)S/1O.BYK= V=;S\N_\7P5 + M0=38\$Z-"T _0 !\ &@ 72 < KMOI%@X")0 6D G8!9Z!UY="RC=988_Y!(@ + MV'49+=\GL L$M_ (K#8P1VQVR7 /"H )^\8!^*M9KENKVGVU;I+P*R[*^9[ + MKZY;6+W6BMI8$I#/!0%"ZB= ?T%T'ZK -S '$ . + M//H5N3@ =MJN[3R110P\ U\"-? /C&0&P7": +"6RL H0 ]L S_!.?#@6N3R + MP.4;6X $&!&9N]5K[ + M7:_M:>OYHST 1 #A%WMN80_IW0< 3*3O@'QV #AW&2GT&98AOHZB ( !, !4 + M)['H"9'"YBT&H.H]:3S#O ?$RF<% #: "D, ?YX!L-OA*.B9PS;>,5>-G'-=@!#F>@XLMW" + M=>4_D,Q2C.9OA980H )I*X):PCG# 4#!6 [3PC>C5?>6!F?272;($2 "BT & + M\/9VD'[:.EP:I*V:(N);W/$,XIM59[<*O-!G 6#FOFF>YP?@ 10"# R/ WT + M -^PR:8.Q'VGL-T*HI%T;B)*]PFR="[=)S $X&YT*(A(LK$#)IPA@ [8;(: + M.O L.@*7IQT7K36@U)I8Z36H =7P%2@ -,0(["'0RT6O-AZ$R09:Q/5F+5<: + M3 ,@K!5@WN(#O%W1RQY@I!U &8 3:P"?W5YP!1H $.87"A03C$-9CF@4QQ2N + MB)MV"U\ X>@W+ 2$ $SA-$R9^2X.@%L*T5'$LR D$&6" 'H 3DP &'5" "O, + MO]%VV-I3+/]"C@& _C$0^[P8W3;1#J%\?"F QS&I9]9K#OJ@GY:4,P8.\;SKV>,%@?%$&87 + MD+:2KL)*+K !;,4!@,J+$)_%=H3/2P;D=N.C#?'%#R1S0 + M9], BK@/A&Z5IVDI!1P")9R'^D[29S4QYFA' ,=%+P! _.DBT+%I/!U#K@[K + M.^SSUG)^6G9\4=+&<,=?'/4" $Z CS:FNJ%A\*\V"0QOIH$$D*-M$SICF$9Z + MJIYG,)A*G :F&X _0+"ZADH=-/ '? "B #5@"&@ 'H"<"@1( S? .-![\F_N + M*PSPNC&9 BCP"0 @Q:U93^86X'PQ+#2@!]1Y=A[;^/=RGTD<($ &A*'00!_0 + M < #=MZ!0/1JGY9?:Y;< 0%: #4@"&P 'X!85@0@ !OG^ F=Q8PWVBA !RJ + MY[$/L)CI @L=TO@%W (Z\N6WGD+"%JI^[/8M<1AB?SRP @ AP$X*JAD!T$ V + MT!\;?B& & -D $$,@V \0$ @, G$ 0H =! ,4 @DVX? "!P"P0!,@ C4',* + M 8# +P $\+RP*.3H/!S)O>=NP%;6$]< *= XHF!@@"" ."..JSFEIF9;,)? + MGUP=&\46F2;@!S/*%J:CW"('RMLGX.IYGL=8P&)F*?\#@#*I[ DEH:P% + MZ*(X,B*@!QAD:*T<0*HUM8SA8J8'/,@C613X#^"1L]^3#,5%R=GK>SJD4@+)O)&D&:',-6R*ER"'. KH,)XT@&WQC""K,6 + MH!YWP3=KP J5:QH\B40P[XWV*2DW*J. + MG@TS90;?" 'P + M#B S[WN^&@U9,- [>*@MTU, W>>/S &*(.9 -2\ ?@!#_$&X ., 6?@)I U + M^P)3\P]@ ".M7/,/\ D, A< & ,3 /1J)"Y370!-X!7F@DX $@9!> (U)P= + MYQTK #P"J, ?< [0S3W$(8 *@ &F9(E"!3@ _T0%X A RE+N-N$(( )^,^+\ + M43P">ZD"X RH X! _Z@+& "%'XZE LAE!&P&8$Q> &J!+#<[08PP/=G.@\! + MP-X,NP + M0CU G2>P!66BZN:JJ9[.[FU]Q[7Z,DFG#B ^.QL=P /0#YC.@*[IK'2NR/4S + M98$@HP/EL^HL BP GP !T '< +_ 0K=8IHOX,3YH,>>29=P9!Z*LRN# !^ ' + M )T+@!]@L X!CP#>6])A?#FOZ$D9FP'C 2%T:> A

**#?H?R8# LVI"[2>RLLKL + M?3+,<2=E3 ?(C/WRF5>VW@) @$0*!)P!\0"I)@S< %] [QD*Z]!#(!<]?G+1 + M6 -, $ (K YRE&D]%F]!CM"""$9_0:K3F,;N@?/=EA 3; /^ #U &'0-=;>39K0L A8%JJ + M 9FG*7JUFM%ES2.H4A_$GS)?2P + MZ&M*5X=1,"@=O7[2@ D]?!B8TB=:+*U39'-1\"LGO(4 /:E2MYW=T(BO[X-0L=4NL!(+4* + M_2&C TRT22VDN9M*&@X02TYV4 7NTV D@*M]'$YL@4/@"4&\*7!,"33R[_= + MU,M*= BZ:UA,*@P<<()GP+ + M'\/[VMVNZF/!@0)PRSNI4A<4^B:&@#UJED@ 1T"^6EI?:!&'5Q8N7Y/%R)8 C ,&P GH%];2'9!Q/&A6/=7#AWBL%MI/$7+:IH + MV]GR1Y2AGL[?ZBDEBZFY9 /WP*EQ^!@%9\1E11V&UJ82QP 0 !'0(>J<)EH5B / ',6U.6EVJ>>_/E*0VL 3M8*H-Q@)T7#.8!0 01EEDB-8:-*$!8*;/ + M)8]]I7+.FA]3:.<2 0 ;"8!D?[EQ !=J#]P !MM*FAJ &M %$@0QWQXH!YH + MMS%MY( 7T LA]?1_@%&,!GX0?<*U:7[=L*_)^YP&-=$+"W^9':&"!)70JIR"2( + M *;P ")J$ (N=F^'8MEN+W9@*@Y%I + M;L:8+:9,=#L8"#1TM^&$N0YFFC? ]@N6C<\7P!I -:_,!NA$- + M6VNFI0B '&-XD9FTK;/] "& *(">=@#N*R"P"-P"SV+"ZRM0:(1 /7S<':1T + MZ"ZG#[S', &4![BPLHT^ZAN@V5K0#N82[ZBO9VW+3'F;0\V..$$DG0(@!ZP + MTHVP@T#;"A.O< 0 )RILZV8M-A& E)$ GR-=J@W7V#58!\#(K6B+Z;$=>B;; + M@8"F)_(A9=PJ?"-E.]O3 "Y0K6'9/<8T< 58B5_N,+AE=]EC*DE]7#9QU66D + MG<^QNL&R[,H(GJJCWR>0UA$!%S0" *(4 :$;6TF/&0$?<7A=K2$"R1OGE_+1 + MT]C:$1"MD0 .J#T "& #(%ML.H3> EWW2B, "L!B 6 $WB&'"7WH,9P#5@!'2)9\!?BD^N 7YBJ:>X + MX0!K@,S NUW>TAQM^O2A 4D1K;RO,G%AM86J73:;I2M=:!=J8WBA-Z87VI:% + MI%_8" :&@^&M2&FRNK+B>Q??0=AJ(E*7'C+5UV>%K2;R?7I(2*?2K6:&]3XW + M+M( @G"AN1>L 88UO$B6T),WP/3F #2K _2!\#26@M#W]'T@. .,%F2('( + M\3,.0(=UW[3IYOP[VR'3$&=P!Q)YU @0'XO 7K(U?<0M0!J+A3P5D^NKAZ5 + MQXV6FJ::>9M4OHI9H%_MN/1Z10*S5RKRA PL&@<;*(% @)H;$.R2\;/])P'? + M&FA;+K#]R8:3PR" 1=<"-T!E */.AK7AGK9-J'<'B* '( LR8" + MJ %!0.-"64#$UIK)YC$G +TO%PT"I $^ PI@>2:>%S 2D L(+6D A9D$*&DZ + MFSG0LWVY84 :8%B/<6E !-@ %,&, ) A9._FUG>1X4K 7UB[?8?,K1%<* 9 + ME 4!CNB#6+N9V.0V"-!DR9%%P#*'=M/8"\ )( !\ *$;4K@]6IA6! M /;F.3 @@'XR_#8!HR@@T ER=%%AY!P%*&F4APLUL*G8# + MP /GH'I $H"4>6OI[QH L*$ "67M-M!AWD!8JD?DH=;=WCJN/0*V>.V6\#I\1ZT)YX-+K1H R'JPO9;FYL67\8795%^T1F9W 34 + M\'LN (*PHJS8:]:*MV()O SNBBAA7^@6(I>N][!8++*$!)]DC? 5DI@X42;S + MV75;&FOL = #VG0RX + M &29:-L-@.BIC4%U3#XY-'2.7\SWF/&,D1_,2#," NWPSC?T:GX-8LMK$^3% + M2%_IU_/]?'"'T) %EP &L5*.>O+43 + MYUOG9L!UVH>/NX3ZN$PH]CW82MW'-R@O96LV,C 4,N0 &UK8[*J6X%H.*@<@ + M '\ ?LG:>L=;18F,^A%X"@+E@C@1P"U*? + MF"V."P+DP!?P:1LE0W4C0!20 ^ !@!EL^P ,NN5YLX8 8-D!@!#P -2( + MY3D"@$3< &HB$(!WD^<2!0.0 !F:L%]3IZ#9R?D:][$Z8K:6 Z0SZ$TJO== + MF!9\*1'@%"[B@ZDC#HDCILEV + M$G!L!P'%N2KPY28!XJ(G?@8& 09<2(<,F *;V<,0*%>GIL #8#ILBNT:+O!*8P'D.<(0"% + M$,CIX7)]')?=Z95!GEZ%%V4WP!?(IP/)1K>7UI51 6#9SLBH.^HC !)@!%@# + MJ_4P(4@WW(TZ@HX*) !40%3LA.H!"+HY$*GSH AZ!- #T.>DL[M]!SSHKV*O + M^"O:EL&B/3[610!V6CJ@#@ A#=F< (D 2PZ]XZZ2NN1P+!"K=^ [AU3L :< :F ]MZ + MM_ZM*P#B>C9 KK?K- #1'0Z, @ O3Y*RP#^.F,X J0"]/JY+@<0W5% OMZM + MNW5*0,0>#8P N$ 88*X7 "( T9T !"OE^KY.K$3LN# 8#(P 6(+)[ZP4 &""N!P ,>\K> 9#L_KKT. ) $+[RGX&A@(NN[EN + M1Q#=L<#,+K!;Q^)Z*G"P?W8]>Y?M ^#L" )L+&#ZQ%[(I#G>NV?'0'0KT>! + M@\0>!##LB#NK&K&G .LZPDYTYP#R>MP> - !XGH,,+:; + MZW8GT1T"!.Y3>[@>#&8 =3OBCAY'[!& 1)&R8P%$.S;@ P#L7?O&?DD4[>IZ + M*K"V P!^NS;00J+L&WO6W@WX L[*G"[$^RZN\&>!/#M5+OK_K'# BF[+D"T + MZ^Y6^VLWM2, .Z8/T++32+([$M"7K>Z^NP\0"U3OH<#7!@*DD26 ++#:;1-! + MM1PGOF,"DP H@$1(X$ZA1.JCY)X\@Q80@O>>& 0,.9UI+$V9);;+:+5Y]\" + M?08 ))\.+9OX[[FE*)R (O " #8 ?=(CT"PR^1,04JP,/;\*Y[.)##IP,[/ W?P[>0.7RR&5,P + MN$H\$1\QOO _0 *0Q+/P/\ .9GHRWGD=/C#$B_#!8 A Q:< 5WP/[RM2\1;Z + M-@$*?/&^W#UX"V[QA7L9?P]& 53\8@Y'LO&>># XF\/QX9D<#R-2\9@:H(?' + MLXE4?"+@Q\.G?#R0MAL4N5$\&+^UY_#)P)<;OBOQ.[PF@,6G E1\+)#;I0;F CS\#@^@WX,X/!^?#)!JH&4GG\?_ -$ %9\-?+GA0"G? + MK*GPEKP93\?S\8OYKS;(!X/I !4?#YB#.YDMCQC\YUA\)$#%GZI*/#WY"* # + M>L 1L+Z;P23\M4YO6P3T]AG@Q'^TZ$ &H+]+GR)A1XH#C @0#B@#Y2P(@ X + MX+63:FH9 &#.,Y]Y+K=^M=T -T#/?J"7Y[:[TWY3 M6Y?")M=QIZ"#K%WJWG + M @' PNFCXN?HN3U_Z*$"RYTYGT@3*P!]>9X"Z.N[PCX_PY/G9?L;E\LO=^5Z + M(AT ,!D+?>4NL!?T//S5UAZK9.?8HI7ZINN;VM>^%7P* + MGVYF$W)C@F$D0&DG<\%*.<9>#A$$] _P NB.I(#5G;R.VL@$ K!UUYNFP""@ + M#X@ ].8_@@H, OV "(#BJ(FR #4G G# E0$MT&KK [JC+3!JAP#J0+V)"ZCU + M(0";_H_H G ]A^B^\@*HMBXPE?D"K;8JH#L" W^])E!O*@.$O2+0U@$ SD!B + MKP>XK] JEVG5@;20*NM!8#:+\!??]J?EW, 8?_9=P _P!O@V3_3=X!=C]<+ + M@^>N"'#64JM]P*AMUGZ./\ @H-:3 )(];/\(P/4E@&9_ ;P9U)P)4*&KG RH !ZR'. )J_0IPVO\CD@!(#+0!?[[MH J-V"Q#8ZR&<@%K? ACV ( G ->W .V]FN@*K/=R + M:;E[[K8 IW,#, FR1L1:([ +-X(YHZM^H\%E6 J4 A4(@B 'S$ H )E0 /P + MD;%&Y>F>G"+WQXPCOVRAI4:( T7)_ + M3-\]J#AV?RHN,P"" 20 V#Y7HXUD _DG%D^,(H!R'-1IMI)GC_8>KXAD&$C *: + M 6 $)-)5;R[(O9D#@DB4[P]4^;TAEP^"9OF-J3X@#5D#]T#6B:5^H6%^F1]U + MDIWTV!7@YFN%6)VLSWMT@5Q#%T !Y[O'?!0&?N,B''B]_0'R + MF0) ;78!K>6$'YU! Y= ?SS0H84T'Y?O$&;Y1(;;B0%< Z+S/(?QL8%9_K$? + MI5X#. #9.;U\ 5?JFU_J^]$AT@)@"!2#Q/J\1QDBJ6_B$G#'HH6Y@ &0!1#0 + MCIJJ^B;.P._<+HKKPP?@0$Z>D9&S%4'CXOAM$T< D2K?"8 "06!P "< J4 + MK,/$$:#!?0&5P,F>6P#%?G0L= + MNH@(@#'P)B( V8"ZKTN^B9GJAX>99=T( FT!]3@JX@!8$66OW]V$O,JHS_PDOLV/[)?Y7G[D + MKP-< [T F1_MEYU9P))(=AJ=+!U+3NI__O'PAQ?H*P%YN=2/"-P "X(I6>B/ + MRXI^)@$ = ) I00\\]D9-A+C0N#P0_ EW,8^_.?]Q + M?/1\()IH#5K(#H%(8][@CW14UZD/@!6'#K@;H#;] N %T(#[WZ,O_R<$[ /^ + M :\!'0"A4P/-V'<-0,R4E:87Q3\%X':&G'>>PP&HYX91;JD_G_J(#%=ONH,! + M@$159HA, (DOA;7_NP%$_G!^83Z@4Q!0!S!T0MJH^@.8J@_9 Q8!-Q9/W%CJ:M.^8_XT + MT$0_3IW4U2/ )#BI80MH:Z1QR;\ T"J%^><=L @: "1@BP0_H(]#!@:N22,= + M=28[[D#-EX''=Z'+R4L) =IX.@7,S7_C 8 !Z +9!,@U6":G5$QG6V.5PDHU + M]1A!4#V U52/]H;Q8*?I AQ'N#FQGA& ;K'0@4@= >(!$ZE&0#U+#U!M^\CY + MGKYY%SP\ #0@#_# JF>AA7QR:@$LP&*P,=A%>.9 !J$)" #((%8C1489/%5 + M!D$,F<$#%!:!,V@J$P# TB#L#;4X#8!&J :+ "D@CZ#X:?/X/CI,VCL@@P* + M !JL$N1FX0#) ;A *T!A%S!Z@"P)[F,]@6@ P2 %Q#QD')8!^ ,FAW4@UB + M%IR#4+[EH*DL-C89G Y*!AF#IC+U7&BP3^/XV Z:M[ !JL$! #(@/(@+" ^B + M E2##:7J(#9-/9@:\ [&%)"#HD'E(&5P ( $" _B ,*#T<'YX&M0-!@;% W. + M!D6#M<$#E"D,&G 'H R&90B$E,%$!H+P'U =O ;D Q( -2888-P #[ !" 9, + M RX 5J(!X!' YX4(: 80 0!UR>E3!* -,@.3 "T HQ#B\$*(=ML S /N%+( + MEJ9)"0$.83( " (\!J)"(U#7B@%@!0@18;0X?TM0\HV2!L!V09 %' -X#E) + MP(Q^7P!H (5P$$#M0P!8 18 TXLC (QPMJ84(P1LL'8%O:,D X.-!8 0 !* Z7E + MTAZ&,)%_#K[OQ5>\"-WLK.PY%26_(]5\T1!X%S+ID_*)BP8&F 9P C0 BX#/D]%P U /H!ME + M9[H "*%KP">@ [ &(-4D=-1TPK'S7!Q'HO;?N-IX#:-@UX!? -5P 7#GJROQ + M SP BX!B !\@_20U] #4 JXV2T-VP-7&&, +8!M.#:N&4;"EH3U@;E@W1'1$ + MK(J$G8 BD%\]0^I2+PO)( + M %!2X[=($^%F_%8!R.T@ A +\K/<3G_-=U$ F)6)PH:&"+P<5V!* T K). - + M#XUD><-+@ :@"4 EV@#\ X"$JS(>@'0C0/-TX@*TG#( =(!1E/.0BA6=F09D + M C0 R0 O'P*@!B!M0MI, S !&X # /\O > -R'^9<O@)T "\0*@US\,&VC6 %X L %0#^LY7( ^DV%J&M )6!Y. + M ]1 S\,K -%F&J )Z!.B"1$ ?D!Z3 -+[D@Y61!_ %@$+5G[\/[GZ6P'X ^""V + M:P: UL,L /$PVH4V5*:5E>HY'0!#0-=KGI,+,..(AYXYB+Z#UCE ?F8# -C@ + M!RI_C3(%D0=P V1S9>5P?@T + ML()]EL)[0 _Q'7@%*!*R#W%419DX1OP0'Y ^ 6HJOPY4;")S$3H!H!%F-J$ + M ,)79ARLC&(J([-*<3CM!:8RE "@S "M<0&0T0$,9.H_\ (<#5;&.$0#^"M- + M9/@"- "@2D!@?A3C.A94 !0!N@!0P%2G"L"=FF7= &H "QT%0"W ##DVFJM + M)PA<%0#5129QFT#+^B=0 "I;,1H%P.;, J#5VB:HGPP %@!!0"7@$] -< !D + M ^ %-P!*XB( !_ +Z (H !!K&@"YC$,&(I"/$0"@ !8)D S1@ 'X!%..D9K" [4IJLS;@HK?,%H.40 + MY)Y+*1^Z7P!(B[ $8!N! >8Q9#0"%HH#MO:KO3GFGO5.2T:N1X<0_[1A]$;XOI-B9(>10"4.*-(#[&%O N79?\MGE + MEU(!W1COW=O'>C<3VMK5A*1'@2$?0#2 ,.0#R 8$ + M$P4 WBMPXI7&%';RR>YU)N")])L7P1<(+Q0%"@%DIV8^J!_Y3 0 !L#7,08T + M *Y9 2,\F23 KS0 F!C5<>I3$Z+I!1K ?:7IP +HCD !9#V4B!Y"%*#6$P&( 39[I "XWA)N*I/6PP>( + M $Y[OHNW7C[@9E-O4@4T%S=C_PA6@'01O?=.HN:X .!7E0%SP+G+!;#7\EWX + M];:+FS$]!&)OK3?> P P]OH!*X#$E)H(LG:\^H + MB09[_<7L7F7 $'#N*C+JCA !H[85@#B@WG1JTP>L "I9_PA( %QO!7#64A.5 + M]^X!*P!9 "2QREC@6_]4&:4!2SYXXGO&&,#RQ'#-2+#AT + M9H8SEX3\C42 9:@YV!4\?L1FI!D.$-<35FI!A4=6O>% + MF?(S3(#@X@* $8 $&#\Q .1C"( &P*AN,:< &#^9E4)#W<;HD)AI32, "#/K( + M9Q( ]YZ (Z%IX"AO-#C*@XAY?+HF0 * $V#%^A?%O^ #2!V)(V2*XOAMI#?: + M&P4 38!'4S<.OA:7*5'X&^4S"8=M([R1Y%AP-#G.O> Q]\9T8W1&A[5I2N2L + M&V&.YIEW(X[F)P=S+$N('.42-,=YX\VL[=6E"R[J'%>.CZ:LC,N1Z+@B4#X) + M'>EC5,?0CLQ1X,@8JCB:'!6. H TLK'$P:/.3K&&TN.2T>PX\LQE+9UG#AV + M'=&.+,>3([Y1 #!J&CMV$<)/9L>!8W;&! ((2 #4'< + M&RL!EP! 0+/B#I"_DP3H Q2/UP![ M51PR!X1#H2'I6.<'L&-P<7$5_XN$J )4#Q. R "8D? 8P' =_5N1,6= + MS!X&@(! P"> 0D;\HCJRM62.B8!#P,D,1 $ " 2LJT0 -0!-0+/"]^@U>C>Z + MKX !B0!GF1H@$( ( .( ;R.-IX:0"9@&70)T $H'@, >H#\77!Q$N#Z\@%$ + M'F.$P9K%'*L*^(@( *@1/@20(! 0"; ^HA]C!;5 #H!4[Q[XR7@%]!YC,<$ + M /X H4=-P.@Q_6C>:CY&9Q!?0(!$@"9@"#!]/ 2, :Z/<,?P30W@$O#(NS<& + M !B/0 #'H^L1]DAU' #L:=Z-B0!$@.CFZ==.:P4\!9F".C@?QQ?@!B 'P1AX + MJ+"%SL=1&@$@$- )H $J# T B0"U4KNI(4B%,!$^!9< (L ^H@%@!6D ,A\] + M!8@$0 )0!" 2J=EH&W'&9#;P9#Y + M /( @D@$ V Y>%2V@LHJYUW6("0 "^ 1H + M'P^+HJ],0 * "> 9:@5(&@%9/*K-(CCMJI@&* 'T%>]!$8 EFS8@&<1N$U)= + MO*87/34#P#< '? %< "4 B@^F8 T B@KYBAR?LH9: RP!( ,8H>A3( P" + M ZB1,L?'W!+ &I#%>S2QE=2-5P =EGPIM@2-E$9VQ1Z1TBJ/5RX! U (:-;D + M;PZ1G$1J54,Q!BB9X0N0%"4S1 &4HF>Q?P0F/!(X 5H![)S<&B#HN<14/"$E + M%5-(1T5!$%%QF,<,>-TEEX!WMJ*>8@E,IZ@6DAZ%?;9V)B'KW6O&>Z="2@6P + MD,)WXZ+)8B/QN]/U^P#4FR@!<+!X(>#JO\%)]!5TAF Z1S [!!A,$G8Q4^J( + M]>9C2)MKWB8,!' &J ;4LX@_WCR-E'E&AV:M(TJ" :IO[K+=P%$RBQ8-R.U + M H1_=9Y2H"@, @ +;!SE=1Q"L1N8SC8!#^ CW.GL!LAAL1LM59@&PB05BBD@ + M:OH!5DEW65@ ( 6 6SY@79#J-#D('#G + M@0R 9:5=T@>@VK9-$ >N;:9*9KV7SC, %8 S\#ER 1X FDF'4 \J2*69[ %8 + M _B(:Y#AY/@,#M0!:!SE)8&3>A9BW4@PRS1 XQ;'<*#V)%F2/BF?/,C8)^% :$D%Y:E*! "Y8 #D 6Z3:8W+8OR,0PF"^E & + MJ3B4/0"#SL_I ^"<-%$^ $B4^*,.0(EP#6*BS.U@ S2"\3/NI'?2! 4(L"MY + M\724UP##U1J$1YG;D7C)B3H #$H'Y6VRH#>:(1V]QV !"H!;P!?@ B!';*"! + MSNX!6 !%HUI- @<+1 ( =B)U8 PT&O22SD)P ) *>.)L(,450?@.:F9W/(- + M)U$S+AT-P#* %P"*W!^29*B$7R,W 2VBIL/7T1G6I&9.@("@C?5F _ '6 1T + M MI?[QED *E&-L;X@FTU*+^382QI2+=F 8!8PX999# R<\JFCF]2?]06V!\> + MS=Q0TP J0']L&C %()#IL(8V+)V6SQ-I(^9SK (\ F0!B($\!@%@ J#DD7*5 + M"W181YM4Y490 5 /V']5)1$ 1RIC $DP T!]*' Y NHLH(E)P?YF=(BJ'$]" + M9H!G?L!YP-FF2TD(("-Z*2=>EDHO&(&+ Z :"BR:!A5/\L+NS=TM;O.V22<& + MJ=!(E"33H&-H0B1.].(%NK9+TXLO%4TR./,'F!#Q 0 (#RE3H;F^Z$LHW") + M)?<"E45\@'VF).,'F!#= $R##P!_U($N2&7E@ 3T>4R#G\J3VH%&J&/VDZ$1 + M <([*A[[#%& S^-?(-7@KP(UW+8ZG7'(.A.[^38)Q[P#[AFGAC0'S\A,0O&< + M8]I@&\47S_=*#05WRO?8K&9J,9D/ )5+2<.R;-"48\XQD8NPXM_ I7,!X"@& + M@#X&O20.$%>1&&4& T 4L,[ + MRNQ&I "ZD>$R<;F]2@!0X/)@\YS_50= @4.%\/:Q&- /**TT%IH-.<6(@B: + MYE)/:CFZT%(O//,6?.H5DJ1Z,J&J'F&H)AFJ"0OTI)1EPR%8TBK%JJA%$"6Q + M1DY)%:5JTF5.T7.(=/H,[@H!(I]3%!!F3XFH/&Z1:JZ19ZDDP*(I/=.X)-/T + MCJYC[QY #2E >MD6 CM!1( 0B0TP($ ^!7\AHD 1-'X VG-=@AK,7(&V) + MUC0W2@"$V6N)US/G\7@1 ;PRBD5Y4@*@E# .!(@L;!5[^ + MA:)ZXT*$H&_J7!C]82]A9/8Y<@S]T]9RD;6GY3[N+=?OH=% + M!D9&2YEG@" @$-!"*PX!KY "KC!( 85-/\,$XI@=NSP*;B6TT)T-J6".Q_%31BMZR, $ 24 [X C0 T&SE36@1TS')MMT:Z/,N9?4YSP34,YDL(8+7!)-"LA;!Z;8&T#E(GO?-+P\Y + M9VI)N\L5W/RF_%>@&LHT /8"""K.#88' 9 ($"-) 9 "P+$TF)'W0410 "@ + M 4(")QJ=E+SK%'98^@1X>-8@AR6MI'< XZ7H<0I! !(!%X!GD;D*#: !C&6^ + MH_0"M$RG#@- &R"" GVA 7 W&( 9X4CP//-X.RP- EH#/X F@ZB)D#FZ[*V5 + MYM!RB,S49=.2+:?!=,LY,FF7X[+PTA# "3>U>@00 >PZ5[<^%?12"L1$PQDX + MA( !]Y^'57ZFW[>985,U:]I-]JE34AK KM&@X@(52G*T[Y0!["%D_.U + MI#QEU[(,C2S@CX.@2F'1 + MQ3X^+S(NVB(*HX.(TM@0!6@!'(#SD.B27^7--%V",U&7_RKA&AP*LK;(C E1 + MUO@]A8,T3$,-V84>2EX1 IHU5CXBP%?36=/)W(<%O)1KNIO'6]SF$##6W#SL + M<(X!!2H-#G%'TR-A P)TDP(X)9WYD<0+!V#/N0?^,TRU,I% !ZM"5-@5W2^[,72/I "DZ6#"YLC6*&M.DFZ!T5 + M 1X ECRA&,A O21KNB0PJKY3OP&=3R'SFWG(A&H.:*2:11KCU! @Q8.9,2!1 + M(98!H(! '8&I9DSBBVUYP8_G;.X43T!N@D(F&>F 8"",CT\%B&A [ (& 5D + MA_(VW$WH4;4H1*),*RW(++4(U PP% *#1"L."PH!-!S"8$03J=KJ&='\*FE + ME;2;]ASN)@CH?=-); M, G@!1 %1 02 %W#!G%G#.;YJ;@)MOTX33BH0.0)5= + M:*R;@I^A#^@'O6E%4F^&9\H[[4W9T4 Q(1#?G&_6-S%=<@D^@=+I*:.3<73] + M#?B:4SG!)9,3$##@?*H)=G ,\Z80HWSGY;,T>EPK)8 E@)]#18 #'!D$WY8 + M?A0W>(# ING(('.UX@2LK(X!<,Z[310L'M,BFAPPU4*,OP'!3DBG*F,W$DUU + M A8!78!Q5[(&1-._8K\M 4A6_J-!0$53!9!_HR_JE?0(T#R] + M.-E@_AW(E&$19_BK 24I+EEE?P" #J^+O<2S#,B F0T32S!#F+I%Z!*? 9\ + M @(!,DW&4$4IOBE!HV^"FRXC[BL! !H *4"6H@@IJAB V)^>H%_2"+ )F* ) + M 0B5?K2KY;)37I,0@(,].PU=>X%%P ^@VKGQ>O 991X&=[#9$?WIUZ4M&@#I + M9P!N?DDAP"8 _#>JB\S\=QH76CUZ)P!@$9 /N'9M:EPH+5\$T1KJ7>[G3B.DFDTJTB8!&ZI]89]&<0!QJUBV + M*KI8OH(-5M!R>U5H,@S*,J>>$L*_IF?(Y6DM.HQB9:<-H + M!)>5S*2*GN'H1:"-\2]Y8XQ%[1N\D,('$603.@$)AE :A2' $&+(T;884G4M + MF%A=#2807?+*8&4$^-N%_-)KM"$@ !&@B'09 5Y.9KJ*^#X:$SZ2,C,P2#@Q + M'(9,TBH8510H#) R"78G10W0(!]#0E !D#VTBJ! 7:-20#_$R+@%C &T <4 + M <@$@"D5CCT 3"8!4 Q]8Z)Q "XWG2*@'# $4#[MB88 20#XDY-/=H0ZP ]] + MK(1P'"=^V_?S$> %,.&(?TB&,(!KP*NF W! L\R<#NJ1]S[-02G(>D-^ P.4 + M@N"?+L/BA5!J W"4+%YLXE:?5CC4#T/D3902IJ7^BC."?YB,IP+JO<4'8R $0 + MR/9DQ0LR(@. _QFY*"F28P8 4H 5)%V L'$\0H".,.$!9 E#0W@^/E7R(!. + M [)Q5[9@$ =TV2:E:P<1!(-!&E"O4(HJVZ8,B@0D 9(B* !W7P9@$=!A$ 5 + M/[>?I:3SY_R3%%#_O'^F/C\ 4@ L0 BNBQ#'^('J^ZA]0]!'8_%B]U#"!@: 0/;&Q :0 78%-( D )G 6R.G00#@ 8(RBX B0%_M!9HQ@ + M -( E0$4P#4N_>F"Z@"$ 0R-00!2A@P@0,0!V "$ 52A"X!Q@#LGJ2,%@)O= + ML0@;A"Q10!G@CD4#: "\I1)+8( =P#F $UH#B,*$T?"8<"1UT*GH%+ %8(S- + M><9RT:-97N8SUX0&BA7AFB:?RZ6 H*^I\=DK$A8E/ILXQ:;"9SXG *!,"\MD + M '2@T40^J ]4%*#W_ >TF4PV>9NU%"[ X_0/Z/$Y'P0 <:LH&*6-D<-D@%)E + M,T4 4:HF6+AR7$2E^@$\ TR30L #2AM;X8RT 'XW(1]S1H50#1QH:/YL?08 + M9"@+7X OV;CF&S 19>B@#CI..8"=S"$ !7#DN_2@ C0_(-&%3M:F)'H1->G1 + MA1)LAJ$>)(/MU74#4/@XFLHX5#=0S8X,1#$NH\=D?RX&NLWB(+8P/<0 Z'I= + M IHYQQW:D^T)'$"1V@WH +A8^#O$(- 0'?#'Q*9514-25]&25%:4'(;/=(YA + M K*BYRK2CTX*+%K%5.1%##)XS*2R:-,)+5K!06C2C="BH"F$YA\3*6G,/(5U + M \I5",TIX"FL&02>_,<\\_P CX"B* B ,J?#7*VEE&PV;$U]X?9(!7 ($$&B + MS["2!QD3#:DFF[">U!V=PDR48YPDWV:1]G5H4X$U<5A@+DTS3Q# 5P,+L&&" + M&JX &@!_@+8M-_,0]0.$[5:C& \MP ; %P"O>XBE1B-V80"KF0]@-9KO408% + M CY66#.(F"] F68 (+K% 0P!ER?93:;I$Y<(8.'D()UMPC:"8!2H,K43(^8A + MJ&AG"3<"S0Z'B:,,"@,@1]MX7Z T@'.48-<.XIWLSW*2H( C0#W@%@ *. .4 + M T@UZH#[Q ^@:=@!D(IVI,"3 )N IQ008/,Z3 A,\/XQ]B*>&ZX&(($6Q0.L + MY-YSGA"TJ,L08'.!FAQ\2)U'?IJ7'(ATDP.30Y$*<%JD*M*9U.[F1.K,,P=X + M 9X!^5$=U<5 G+12?->T)' _;%K@!K1"U -E,?H% P ?L$!*5/T0$J3P38U + M#2N:/<.'@,709PA*\TK.CF!28;14&CL/2TIK,I6=XVA252^A9I?T:]@UC(*A + MTAYDH\.5I !@ # N GX @$ '=&T3K*,:', B$6^ D( ?X![0)WT(,-A.\@D + M!PX ]!A @"L@') G!93>!@,.M\'D0/AF41JF893>.ANED[&E)61F!# ;R-0H + M%$YO; &F64+ 'K(SV8<4&H8CDZS.2!!@"H#]1(YP2B\B_)"%@$D$)3(_:8FH + M%D( / !/"1K !V!#P)+%2DDEM-*% J@B*)[B0U4.L28PYA@J;!T6$HL+98: + M2X^ER-)DJ;)T6:2R,#IU*>R:>4!! J50^12I, *I6&@ ,!@D 8D N\ + M!0 3? /-31OABH ;" "PJKP&=1F/@K_4+4"<$ (3/^EL)TH0G\B(+ >( !\ + M,L44#-/=@,/4#1$ B"*@*00 !0"CP#O$Y;,;R)BZ!!YN(8W7D@0@/[ FE1QN + M$PH $X &0$A' # RW28, $RF&-.4*13 '1-%J,LLA_REG\S-3,5T/1 QQ9D" + M %P!-M.&Z2<3%A TE9A^,F4!.U, P"P@ ) B "P! 8"$0 *0"T@:3H%B2+< + M I*FN("DZ6Z@9TH X OL I*FY8XH0B^@:/H.Z1CX3($!%=,*@ 4@&) VM0 ( + M Y*FPX"D*3$@:5H,2)H: Y*FQX"D*3(@:9H,T)K691@.[Y 6@<0T,1 * "P + M!)P!2=-G0 " = B ! X*FT8#"Z0*@ 2 -& @L "( O(R=Z34@:0H.2)J& + M Y*FXH"DZ3C 9VH.*)J>2X9:RP%G@=,HZ;9VZ3E^GL-/8J>QT=DH[K9W: + 43F^GN-/YT=\H[[9WZ3G^GU5*R + + end + @eof + uncompress /tmp/compress$$ + mv /tmp/compress$$ dynld.o + + chmod 664 dynld.o + + rm -f /tmp/unpack$$ + exit 0 *** overhead/class/machdep/hp_pa_risc/dynld.ez Thu May 30 20:38:44 1991 --- overhead/class/machdep/hp_pa_risc/dynld.ez.NEW Tue Apr 23 15:52:23 1991 *************** *** 0 **** --- 1,460 ---- + \begindata{text,1074006416} + \textdsversion{12} + \template{roff} + + + \begindata{bp,1074343064} + \enddata{bp,1074343064} + \view{bpv,1074343064,0,0,0} + + + + \majorheading{DYNLD(3X) UNIX Programmer's Manual DYNLD(3X) + + } + + + \indent1{ + \begindata{bp,1074343104} + \enddata{bp,1074343104} + \view{bpv,1074343104,1,0,0} + + \tempindentneg1{ + \bold{NAME + + }}dynld - dynamic linking and loading of object modules + + \tempindentneg1{ + \bold{SYNOPSIS + + }}\bold{int _init_loader(); } + + + \bold{int _define_symbol(name, symbol_value); } + + + \bold{int _declare_undefined_symbol(char *name); } + + + \bold{int _declare_common_symbol(char *name, int length); } + + + \bold{int _set_unsat_handler(int (*handler)()); } + + + \bold{int _load_file(char *filename); } + + + \bold{int _load_module_from_memory(char *object); } + + + \bold{int _search_library(char *filename); } + + + \bold{int _unload_file(char *filename); } + + + \bold{int _reset_all_data(); } + + + \bold{char **_get_modules(char **module); } + + + \bold{char **_get_globals(char **module, char **symbol); } + + + \bold{char **_get_unsats(char **symbol); } + + + \bold{long _get_symbol_value(char *name); } + + + \bold{char **_get_symbol_name(long address, char **module, long *rem); } + + + \bold{char *_dloader_version(); } + + \tempindentneg1{ + \bold{DESCRIPTION + + }}The \italic{dynamic linker }supports dynamic linking and loading of object + modules from relocatable object files (``.o files'') and relocatable libraries + (``.a files''). It can be called to link and load individual .o files, or to + search and selectively load modules from libraries. It can also be used to + unload a previously loaded module. + + + Dynamically-loaded modules are loaded into the calling process' data space, + and the text is not shared by any other process. On the Series 800 + architecture, transfer of control between the code and data space requires + code sequences that are not part of the standard calling convention, and the + dynamic linker automatically supplies the appropriate code sequences in the + form of stub routines. + + + The \italic{_init_loader }routine initializes the dynamic linker. It must be + called before any other routines are called. + + + The \italic{_define_symbol }routine is used to make symbols known to the + dynamic linker that are defined in the main program and are available for + import by dynamically-loaded modules. Prior to loading any modules, the + following symbols should be defined for use by dynamically-loaded code: + + + \begindata{table,1074343144} + \cols 207 189 + "extern FILE __iob[]; "extern int errno; + "extern char *_stdbuf; "extern int errnet; + "extern char *_lastbuf; "extern char _errnet; + "extern char *_sibuf; "extern char *brk(); + "extern char *_smbuf; "extern char *__brk(); + "extern char *_sobuf; "extern char *sbrk(); + "extern char **environ; "extern char *_sbrk(); + "extern char **_environ; + \enddata{table,1074343144} + \view{spread,1074343144,2,0,0} + The following symbols should \italic{not }be defined: all millicode routines + (names beginning with ``$$''), \italic{sigsetjmp}, \italic{_sigsetjmp}, + \italic{siglongjmp}, and \italic{_siglongjmp}. These routines must be + dynamically loaded from the C library so that they are in the same space as + the code that calls them. + + + The \italic{_declare_undefined_symbol }routine adds a symbol name to the list + of currently undefined symbols. Its purpose is to prime the list with one or + more initial symbols prior to invoking \italic{_search_library}. + + + The \italic{_declare_common_symbol }routine adds a symbol name to the list of + currently undefined symbols. The symbol is recorded as a common request with + an associated length, and storage is allocated for it if the symbol remains + undefined. Common requests have the property that storage is allocated for the + largest of several requests for the same symbol. + + + The \italic{_set_unsat_handler }routine defines a procedure to be called + whenever a call is attempted to a procedure that is undefined at the time of + call. The unsat handler may be a routine in the main program or a + dynamically-loaded procedure. + + + The \italic{_load_file }routine loads a module from the named object file + unconditionally. If the module is already loaded, it is unloaded prior to + loading the new module (libraries are not unloaded). If the file is a library, + it loads every module unconditionally. Symbols defined in the loaded module + are used to resolve currently undefined symbols, and undefined symbols in the + loaded module are either resolved to previously defined symbols or added to + the list of undefined symbols. + + + The \italic{_load_module_from_memory }routine is identical to + \italic{_load_file}, except that the object module to be loaded is read from + memory instead of from a file. + + + The \italic{_search_library }routine searches the named library and loads + (individually) any modules that satisfy currently undefined symbols. As + symbols are added, the list of undefined symbols may grow, and the library is + iteratively searched until no more undefined symbols can be resolved. + + + The \italic{_unload_file }routine unloads the module specified. All symbols + defined in the module are removed. If any symbol in the module was used to + resolve undefined symbols, those symbols will be added back to the list of + undefined symbols. If a library symbol was used to resolve a symbol removed + when the module was unloaded and there are no other references to that library + symbol, the library symbol is also removed. + + + The module must have been loaded first before it can be unloaded. Libraries + are not unloaded (the library as a whole cannot be unloaded, but individual + modules \italic{can }be unloaded). + + + The \italic{_reset_all_data }routine resets all initialized data in + dynamically-loaded modules to the original state, and clears all common blocks + and bss sections to zero. + + + The \italic{_get_modules }routine returns the next module in the module list. + \italic{NULL }should be passed in the first time to get the first module in + the list. Subsequent calls should pass the previous return value. + + + The \italic{_get_globals }routine returns the next global symbol in the + module. If \italic{NULL }is passed as the module pointer, \italic{_get_globals + }will scan all global symbols; otherwise, it will scan only the global symbols + for the given module. \italic{NULL }should be passed in as the symbol pointer + for the first call. Subsequent calls should pass the previous return value. + + + The \italic{_get_unsats }routine returns the next undefined symbol in the list + of undefined symbols. \italic{NULL }should be passed in the first time to get + the first undefined symbol. Subsequent calls should pass the previous return + value. + + + The \italic{_get_symbol_value }routine returns the address of the named + symbol. If the named symbol is undefined, \italic{NULL }is returned. + + + The \italic{_get_symbol_name }routine returns a symbol name corresponding to a + given address, if the address is within any dynamically-loaded module. If the + \italic{module }parameter is not \italic{NULL}, the location that it points to + is filled in with a pointer to the name of the module that contains the + address. If the \italic{rem }parameter is not \italic{NULL}, the location that + it points to is filled in with the difference between actual address of the + returned symbol and the original address. The difference will always be + positive. If the given address is not within any module, \italic{NULL }is + returned and the last two parameters are not filled in. + + + The \italic{_dloader_version }routine returns a character string containing + the version number of the dynamic linker. + + \tempindentneg1{ + \bold{RETURN VALUE + + }}The \italic{_init_loader}, \italic{_define_symbol}, + \italic{_declare_undefined_symbol}, \italic{_declare_common_symbol}, + \italic{_set_unsat_handler}, \italic{_load_file}, + \italic{_load_module_from_memory}, \italic{_search_library}, + \italic{_unload_file}, and routines return an integer status value. A zero + status indicates successful completion of the operation; non-zero status + returns indicate an error condition. + + \tempindentneg1{ + \bold{EXAMPLES + + }} + + The dynamic linker should be initialized with code similar to the following: + + + }\indent1{\indent2{extern FILE __iob[]; + + extern char *_stdbuf, *_lastbuf, *_sibuf, *_smbuf, *_sobuf; + + extern char **environ, **_environ; + + extern int errno, errnet, _errnet; + + extern char *brk(), *__brk(), *sbrk(), *_sbrk(); + + + int status; + + + /* Initialize the dynamic linker */ + + status = _init_loader(); + + if (status != 0) + + exit(1); + + + /* Define the required symbols */ + + status = _define_symbol("__iob", (char *)__iob); + + status = _define_symbol("_bufendtab", (char *)&_bufendtab); + + status = _define_symbol("_stdbuf", (char *)&_stdbuf); + + status = _define_symbol("_lastbuf", (char *)&_lastbuf); + + status = _define_symbol("_sibuf", (char *)&_sibuf); + + status = _define_symbol("_smbuf", (char *)&_smbuf); + + status = _define_symbol("_sobuf", (char *)&_sobuf); + + status = _define_symbol("environ", (char *)&environ); + + status = _define_symbol("_environ", (char *)&_environ); + + status = _define_symbol("errno", (char *)&errno); + + status = _define_symbol("errnet", (char *)&errnet); + + status = _define_symbol("_errnet", (char *)&_errnet); + + status = _define_symbol("brk", (char *)brk); + + status = _define_symbol("__brk", (char *)__brk); + + status = _define_symbol("sbrk", (char *)sbrk); + + status = _define_symbol("_sbrk", (char *)_sbrk); + + if (status != 0) + + exit(1); + + + /* Load millicode */ + + status = _load_file("milli.a"); + + if (status != 0) + + exit(1); + + + }}\indent1{ + The millicode library \italic{milli.a }contains compiler support routines that + must exist in the same space as the code that uses it. Therefore, it must be + dynamically loaded into the data space so that other dynamically-loaded code + can function correctly. + + + After a file or several files are loaded, the C library (at least) should be + searched to resolve any unsatisfied references. The \italic{_get_unsats + }routine can be used to ensure all references are resolved. + + + }\indent1{\indent2{status = _load_file("func.o"); + + if (status != 0) + + exit(1); + + + status = _search_library("/lib/libc.a"); + + if (status != 0) + + exit(1); + + + if (_get_unsats(NULL) != NULL) \{ + + fprintf(stderr, "Unsatisfied symbols remain\\n"); + + exit(1); + + \} + + + }}\indent1{ + To extract a particular module from a library, the + \italic{_declare_undefined_symbol }routine can be used to force a reference to + the module, causing \italic{_search_library }to load it (and any other library + routines that it in turn references). + + + }\indent1{\indent2{status = _declare_undefined_symbol("func"); + + if (status != 0) + + exit(1); + + + status = _search_library("lib.a"); + + if (status != 0) + + exit(1); + + + }}\indent1{ + To call a dynamically-loaded function, the \italic{_get_symbol_value }routine + returns a value suitable for use as a function pointer. + + + }\indent1{\indent2{typedef void (*funcptr)(); + + + funcptr fp; + + + fp = _get_symbol_value(func_name); + + if (fp == NULL) \{ + + fprintf(stderr, "%s is not defined\\n", func_name); + + exit(1); + + \} + + + (*fp)(); + + + }}\indent1{ + The following command line links the \italic{dynamic linker }into a program + file. + + + }\indent1{\indent2{cc file1.o file2.o dynld.o -o prog + + + }}\indent1{\tempindentneg1{ + \bold{WARNINGS + + }}}\tempindentneg1{\indent2{o + + }}\indent2{Subspaces will be aligned on 8-byte boundaries only, regardless of + their requested alignment. Subspace access rights and residency requirements + are also ignored. + + + }\tempindentneg1{\indent2{o + + }}\indent2{Qualifiers on symbol names are not supported. + + + }\tempindentneg1{\indent2{o + + }}\indent2{Symbolic debug information is not supported. + + + }\tempindentneg1{\indent2{o + + }}\indent2{Unsatisfied symbols are not resolved by local symbols. + + + }\tempindentneg1{\indent2{o + + }}\indent2{No parameter type checking is performed. + + + }\tempindentneg1{\indent2{o + + }}\indent2{The modules within a library can be unloaded individually, but not + \italic{_unload_file }cannot unload an entire library. + + }\indent1{\tempindentneg1{ + \bold{FILES + + }}}\tempindentneg1{\tempindentneg2{\indent4{dynld.o + + }}}\indent4{Dynamic linker + + }\tempindentneg1{\tempindentneg2{\indent4{milli.a + + }}}\indent4{Millicode library + + }\indent1{\tempindentneg1{ + \bold{AUTHOR + + }}The dynamic linker was developed by Hewlett-Packard Company. + + \tempindentneg1{ + \bold{SEE ALSO + + }}ld(1). } + + + + \majorheading{Printed 3/6/91 Series 800 Only + + } + \begindata{bp,1074625392} + \enddata{bp,1074625392} + \view{bpv,1074625392,3,0,0} + \indent1{ + }\enddata{text,1074006416} *** overhead/class/machdep/hp_pa_risc/entry.spp Thu May 30 20:38:55 1991 --- overhead/class/machdep/hp_pa_risc/entry.spp.NEW Tue Apr 23 15:52:25 1991 *************** *** 0 **** --- 1,1740 ---- + /* + * Copyright BellSouth 1991 - All Rights Reserved + * For full copyright information see:'andrew/config/COPYRITE.bls'. + */ + + /* The code that follows was written for HP Precision Risc + * Architecture machines. It was written by David Anderson from + * the description in HP's Precision Architecture and Instruction + * Set Reference Manual, and by plagarizing cc -S output. + */ + + /* Might be better to let the assembler fill the delay slots below, + * but I did it myself. + */ + + /* For entry ClassEntry, set up index as 2nd parm for class_Lookup + * and branch to common code. + */ + + .space $TEXT$ + .subspa $CODE$,quad=0,align=4,access=44,CODE_ONLY + MainClassEntry + .proc + .CALLINFO CALLER,FRAME=32,ENTRY_GR=6,SAVE_RP + .entry + stw 2,-20(0,30) + STWM 3,96(0,30) + STW 4,-92(0,30) + STW 5,-88(0,30) + STW 6,-84(0,30) + STW 28,-80(0,30) + COPY 26,3 + COPY 25,4 + COPY 24,5 + COPY 23,6 + /* push the index */ + stw 31,-76(0,30) + .call argw0=gr,argw1=gr,rtnval=gr ;in=25,26, out=28 + bl class_Lookup,2 + copy 31,25 + + COPY 3,26 + COPY 4,25 + COPY 5,24 + COPY 6,23 + ldw -116(0,30),2 + ldw -84(0,30),6 + ldw -88(0,30),5 + ldw -92(0,30),4 + comibt,= 0,28,error + ldw -96(0,30),3 + + ldw -76(0,30),22 + sh2add 22,28,22 + ldw 0(0,22),22 + ldw -80(0,30),28 + b $$dyncall + ldo -96(30),30 + + error + /* if 0, return class_ErrorReturnValue */ + addil L'class_ErrorReturnValue-$global$,27 + ldw R'class_ErrorReturnValue-$global$(0,1),28 + bv 0(2) + .exit + ldo -96(30),30 + .procend + + + .space $TEXT$ + .subspa $CODE$ + ClassEntry0 + .proc + .callinfo + .entry + b MainClassEntry + ldi 0,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry1 + .proc + .callinfo + .entry + b MainClassEntry + ldi 1,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry2 + .proc + .callinfo + .entry + b MainClassEntry + ldi 2,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry3 + .proc + .callinfo + .entry + b MainClassEntry + ldi 3,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry4 + .proc + .callinfo + .entry + b MainClassEntry + ldi 4,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry5 + .proc + .callinfo + .entry + b MainClassEntry + ldi 5,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry6 + .proc + .callinfo + .entry + b MainClassEntry + ldi 6,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry7 + .proc + .callinfo + .entry + b MainClassEntry + ldi 7,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry8 + .proc + .callinfo + .entry + b MainClassEntry + ldi 8,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry9 + .proc + .callinfo + .entry + b MainClassEntry + ldi 9,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry10 + .proc + .callinfo + .entry + b MainClassEntry + ldi 10,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry11 + .proc + .callinfo + .entry + b MainClassEntry + ldi 11,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry12 + .proc + .callinfo + .entry + b MainClassEntry + ldi 12,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry13 + .proc + .callinfo + .entry + b MainClassEntry + ldi 13,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry14 + .proc + .callinfo + .entry + b MainClassEntry + ldi 14,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry15 + .proc + .callinfo + .entry + b MainClassEntry + ldi 15,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry16 + .proc + .callinfo + .entry + b MainClassEntry + ldi 16,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry17 + .proc + .callinfo + .entry + b MainClassEntry + ldi 17,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry18 + .proc + .callinfo + .entry + b MainClassEntry + ldi 18,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry19 + .proc + .callinfo + .entry + b MainClassEntry + ldi 19,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry20 + .proc + .callinfo + .entry + b MainClassEntry + ldi 20,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry21 + .proc + .callinfo + .entry + b MainClassEntry + ldi 21,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry22 + .proc + .callinfo + .entry + b MainClassEntry + ldi 22,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry23 + .proc + .callinfo + .entry + b MainClassEntry + ldi 23,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry24 + .proc + .callinfo + .entry + b MainClassEntry + ldi 24,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry25 + .proc + .callinfo + .entry + b MainClassEntry + ldi 25,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry26 + .proc + .callinfo + .entry + b MainClassEntry + ldi 26,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry27 + .proc + .callinfo + .entry + b MainClassEntry + ldi 27,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry28 + .proc + .callinfo + .entry + b MainClassEntry + ldi 28,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry29 + .proc + .callinfo + .entry + b MainClassEntry + ldi 29,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry30 + .proc + .callinfo + .entry + b MainClassEntry + ldi 30,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry31 + .proc + .callinfo + .entry + b MainClassEntry + ldi 31,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry32 + .proc + .callinfo + .entry + b MainClassEntry + ldi 32,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry33 + .proc + .callinfo + .entry + b MainClassEntry + ldi 33,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry34 + .proc + .callinfo + .entry + b MainClassEntry + ldi 34,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry35 + .proc + .callinfo + .entry + b MainClassEntry + ldi 35,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry36 + .proc + .callinfo + .entry + b MainClassEntry + ldi 36,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry37 + .proc + .callinfo + .entry + b MainClassEntry + ldi 37,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry38 + .proc + .callinfo + .entry + b MainClassEntry + ldi 38,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry39 + .proc + .callinfo + .entry + b MainClassEntry + ldi 39,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry40 + .proc + .callinfo + .entry + b MainClassEntry + ldi 40,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry41 + .proc + .callinfo + .entry + b MainClassEntry + ldi 41,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry42 + .proc + .callinfo + .entry + b MainClassEntry + ldi 42,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry43 + .proc + .callinfo + .entry + b MainClassEntry + ldi 43,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry44 + .proc + .callinfo + .entry + b MainClassEntry + ldi 44,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry45 + .proc + .callinfo + .entry + b MainClassEntry + ldi 45,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry46 + .proc + .callinfo + .entry + b MainClassEntry + ldi 46,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry47 + .proc + .callinfo + .entry + b MainClassEntry + ldi 47,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry48 + .proc + .callinfo + .entry + b MainClassEntry + ldi 48,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry49 + .proc + .callinfo + .entry + b MainClassEntry + ldi 49,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry50 + .proc + .callinfo + .entry + b MainClassEntry + ldi 50,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry51 + .proc + .callinfo + .entry + b MainClassEntry + ldi 51,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry52 + .proc + .callinfo + .entry + b MainClassEntry + ldi 52,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry53 + .proc + .callinfo + .entry + b MainClassEntry + ldi 53,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry54 + .proc + .callinfo + .entry + b MainClassEntry + ldi 54,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry55 + .proc + .callinfo + .entry + b MainClassEntry + ldi 55,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry56 + .proc + .callinfo + .entry + b MainClassEntry + ldi 56,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry57 + .proc + .callinfo + .entry + b MainClassEntry + ldi 57,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry58 + .proc + .callinfo + .entry + b MainClassEntry + ldi 58,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry59 + .proc + .callinfo + .entry + b MainClassEntry + ldi 59,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry60 + .proc + .callinfo + .entry + b MainClassEntry + ldi 60,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry61 + .proc + .callinfo + .entry + b MainClassEntry + ldi 61,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry62 + .proc + .callinfo + .entry + b MainClassEntry + ldi 62,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry63 + .proc + .callinfo + .entry + b MainClassEntry + ldi 63,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry64 + .proc + .callinfo + .entry + b MainClassEntry + ldi 64,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry65 + .proc + .callinfo + .entry + b MainClassEntry + ldi 65,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry66 + .proc + .callinfo + .entry + b MainClassEntry + ldi 66,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry67 + .proc + .callinfo + .entry + b MainClassEntry + ldi 67,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry68 + .proc + .callinfo + .entry + b MainClassEntry + ldi 68,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry69 + .proc + .callinfo + .entry + b MainClassEntry + ldi 69,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry70 + .proc + .callinfo + .entry + b MainClassEntry + ldi 70,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry71 + .proc + .callinfo + .entry + b MainClassEntry + ldi 71,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry72 + .proc + .callinfo + .entry + b MainClassEntry + ldi 72,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry73 + .proc + .callinfo + .entry + b MainClassEntry + ldi 73,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry74 + .proc + .callinfo + .entry + b MainClassEntry + ldi 74,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry75 + .proc + .callinfo + .entry + b MainClassEntry + ldi 75,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry76 + .proc + .callinfo + .entry + b MainClassEntry + ldi 76,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry77 + .proc + .callinfo + .entry + b MainClassEntry + ldi 77,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry78 + .proc + .callinfo + .entry + b MainClassEntry + ldi 78,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry79 + .proc + .callinfo + .entry + b MainClassEntry + ldi 79,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry80 + .proc + .callinfo + .entry + b MainClassEntry + ldi 80,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry81 + .proc + .callinfo + .entry + b MainClassEntry + ldi 81,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry82 + .proc + .callinfo + .entry + b MainClassEntry + ldi 82,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry83 + .proc + .callinfo + .entry + b MainClassEntry + ldi 83,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry84 + .proc + .callinfo + .entry + b MainClassEntry + ldi 84,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry85 + .proc + .callinfo + .entry + b MainClassEntry + ldi 85,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry86 + .proc + .callinfo + .entry + b MainClassEntry + ldi 86,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry87 + .proc + .callinfo + .entry + b MainClassEntry + ldi 87,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry88 + .proc + .callinfo + .entry + b MainClassEntry + ldi 88,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry89 + .proc + .callinfo + .entry + b MainClassEntry + ldi 89,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry90 + .proc + .callinfo + .entry + b MainClassEntry + ldi 90,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry91 + .proc + .callinfo + .entry + b MainClassEntry + ldi 91,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry92 + .proc + .callinfo + .entry + b MainClassEntry + ldi 92,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry93 + .proc + .callinfo + .entry + b MainClassEntry + ldi 93,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry94 + .proc + .callinfo + .entry + b MainClassEntry + ldi 94,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry95 + .proc + .callinfo + .entry + b MainClassEntry + ldi 95,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry96 + .proc + .callinfo + .entry + b MainClassEntry + ldi 96,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry97 + .proc + .callinfo + .entry + b MainClassEntry + ldi 97,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry98 + .proc + .callinfo + .entry + b MainClassEntry + ldi 98,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry99 + .proc + .callinfo + .entry + b MainClassEntry + ldi 99,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry100 + .proc + .callinfo + .entry + b MainClassEntry + ldi 100,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry101 + .proc + .callinfo + .entry + b MainClassEntry + ldi 101,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry102 + .proc + .callinfo + .entry + b MainClassEntry + ldi 102,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry103 + .proc + .callinfo + .entry + b MainClassEntry + ldi 103,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry104 + .proc + .callinfo + .entry + b MainClassEntry + ldi 104,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry105 + .proc + .callinfo + .entry + b MainClassEntry + ldi 105,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry106 + .proc + .callinfo + .entry + b MainClassEntry + ldi 106,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry107 + .proc + .callinfo + .entry + b MainClassEntry + ldi 107,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry108 + .proc + .callinfo + .entry + b MainClassEntry + ldi 108,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry109 + .proc + .callinfo + .entry + b MainClassEntry + ldi 109,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry110 + .proc + .callinfo + .entry + b MainClassEntry + ldi 110,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry111 + .proc + .callinfo + .entry + b MainClassEntry + ldi 111,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry112 + .proc + .callinfo + .entry + b MainClassEntry + ldi 112,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry113 + .proc + .callinfo + .entry + b MainClassEntry + ldi 113,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry114 + .proc + .callinfo + .entry + b MainClassEntry + ldi 114,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry115 + .proc + .callinfo + .entry + b MainClassEntry + ldi 115,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry116 + .proc + .callinfo + .entry + b MainClassEntry + ldi 116,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry117 + .proc + .callinfo + .entry + b MainClassEntry + ldi 117,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry118 + .proc + .callinfo + .entry + b MainClassEntry + ldi 118,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry119 + .proc + .callinfo + .entry + b MainClassEntry + ldi 119,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry120 + .proc + .callinfo + .entry + b MainClassEntry + ldi 120,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry121 + .proc + .callinfo + .entry + b MainClassEntry + ldi 121,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry122 + .proc + .callinfo + .entry + b MainClassEntry + ldi 122,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry123 + .proc + .callinfo + .entry + b MainClassEntry + ldi 123,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry124 + .proc + .callinfo + .entry + b MainClassEntry + ldi 124,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry125 + .proc + .callinfo + .entry + b MainClassEntry + ldi 125,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry126 + .proc + .callinfo + .entry + b MainClassEntry + ldi 126,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry127 + .proc + .callinfo + .entry + b MainClassEntry + ldi 127,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry128 + .proc + .callinfo + .entry + b MainClassEntry + ldi 128,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry129 + .proc + .callinfo + .entry + b MainClassEntry + ldi 129,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry130 + .proc + .callinfo + .entry + b MainClassEntry + ldi 130,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry131 + .proc + .callinfo + .entry + b MainClassEntry + ldi 131,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry132 + .proc + .callinfo + .entry + b MainClassEntry + ldi 132,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry133 + .proc + .callinfo + .entry + b MainClassEntry + ldi 133,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry134 + .proc + .callinfo + .entry + b MainClassEntry + ldi 134,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry135 + .proc + .callinfo + .entry + b MainClassEntry + ldi 135,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry136 + .proc + .callinfo + .entry + b MainClassEntry + ldi 136,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry137 + .proc + .callinfo + .entry + b MainClassEntry + ldi 137,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry138 + .proc + .callinfo + .entry + b MainClassEntry + ldi 138,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry139 + .proc + .callinfo + .entry + b MainClassEntry + ldi 139,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry140 + .proc + .callinfo + .entry + b MainClassEntry + ldi 140,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry141 + .proc + .callinfo + .entry + b MainClassEntry + ldi 141,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry142 + .proc + .callinfo + .entry + b MainClassEntry + ldi 142,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry143 + .proc + .callinfo + .entry + b MainClassEntry + ldi 143,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry144 + .proc + .callinfo + .entry + b MainClassEntry + ldi 144,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry145 + .proc + .callinfo + .entry + b MainClassEntry + ldi 145,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry146 + .proc + .callinfo + .entry + b MainClassEntry + ldi 146,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry147 + .proc + .callinfo + .entry + b MainClassEntry + ldi 147,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry148 + .proc + .callinfo + .entry + b MainClassEntry + ldi 148,31 + .procend + + .space $TEXT$ + .subspa $CODE$ + ClassEntry149 + .proc + .callinfo + .entry + b MainClassEntry + ldi 149,31 + .procend + + .space $TEXT$ + .subspa $LIT$,quad=0,align=8,access=44 + .subspa $CODE$ + .subspa $UNWIND$,quad=0,align=8,access=44 + .subspa $CODE$ + .subspa $CODE$ + .space $PRIVATE$ + .subspa $DATA$,quad=1,align=8,access=31 + $THIS_DATA$ + .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO + $THIS_BSS$ + + .import $global$,DATA + .import class_ErrorReturnValue,DATA + + .space $TEXT$ + .subspa $CODE$ + .export ClassEntry0,priv_lev=3 + .export ClassEntry1,priv_lev=3 + .export ClassEntry2,priv_lev=3 + .export ClassEntry3,priv_lev=3 + .export ClassEntry4,priv_lev=3 + .export ClassEntry5,priv_lev=3 + .export ClassEntry6,priv_lev=3 + .export ClassEntry7,priv_lev=3 + .export ClassEntry8,priv_lev=3 + .export ClassEntry9,priv_lev=3 + .export ClassEntry10,priv_lev=3 + .export ClassEntry11,priv_lev=3 + .export ClassEntry12,priv_lev=3 + .export ClassEntry13,priv_lev=3 + .export ClassEntry14,priv_lev=3 + .export ClassEntry15,priv_lev=3 + .export ClassEntry16,priv_lev=3 + .export ClassEntry17,priv_lev=3 + .export ClassEntry18,priv_lev=3 + .export ClassEntry19,priv_lev=3 + .export ClassEntry20,priv_lev=3 + .export ClassEntry21,priv_lev=3 + .export ClassEntry22,priv_lev=3 + .export ClassEntry23,priv_lev=3 + .export ClassEntry24,priv_lev=3 + .export ClassEntry25,priv_lev=3 + .export ClassEntry26,priv_lev=3 + .export ClassEntry27,priv_lev=3 + .export ClassEntry28,priv_lev=3 + .export ClassEntry29,priv_lev=3 + .export ClassEntry30,priv_lev=3 + .export ClassEntry31,priv_lev=3 + .export ClassEntry32,priv_lev=3 + .export ClassEntry33,priv_lev=3 + .export ClassEntry34,priv_lev=3 + .export ClassEntry35,priv_lev=3 + .export ClassEntry36,priv_lev=3 + .export ClassEntry37,priv_lev=3 + .export ClassEntry38,priv_lev=3 + .export ClassEntry39,priv_lev=3 + .export ClassEntry40,priv_lev=3 + .export ClassEntry41,priv_lev=3 + .export ClassEntry42,priv_lev=3 + .export ClassEntry43,priv_lev=3 + .export ClassEntry44,priv_lev=3 + .export ClassEntry45,priv_lev=3 + .export ClassEntry46,priv_lev=3 + .export ClassEntry47,priv_lev=3 + .export ClassEntry48,priv_lev=3 + .export ClassEntry49,priv_lev=3 + .export ClassEntry50,priv_lev=3 + .export ClassEntry51,priv_lev=3 + .export ClassEntry52,priv_lev=3 + .export ClassEntry53,priv_lev=3 + .export ClassEntry54,priv_lev=3 + .export ClassEntry55,priv_lev=3 + .export ClassEntry56,priv_lev=3 + .export ClassEntry57,priv_lev=3 + .export ClassEntry58,priv_lev=3 + .export ClassEntry59,priv_lev=3 + .export ClassEntry60,priv_lev=3 + .export ClassEntry61,priv_lev=3 + .export ClassEntry62,priv_lev=3 + .export ClassEntry63,priv_lev=3 + .export ClassEntry64,priv_lev=3 + .export ClassEntry65,priv_lev=3 + .export ClassEntry66,priv_lev=3 + .export ClassEntry67,priv_lev=3 + .export ClassEntry68,priv_lev=3 + .export ClassEntry69,priv_lev=3 + .export ClassEntry70,priv_lev=3 + .export ClassEntry71,priv_lev=3 + .export ClassEntry72,priv_lev=3 + .export ClassEntry73,priv_lev=3 + .export ClassEntry74,priv_lev=3 + .export ClassEntry75,priv_lev=3 + .export ClassEntry76,priv_lev=3 + .export ClassEntry77,priv_lev=3 + .export ClassEntry78,priv_lev=3 + .export ClassEntry79,priv_lev=3 + .export ClassEntry80,priv_lev=3 + .export ClassEntry81,priv_lev=3 + .export ClassEntry82,priv_lev=3 + .export ClassEntry83,priv_lev=3 + .export ClassEntry84,priv_lev=3 + .export ClassEntry85,priv_lev=3 + .export ClassEntry86,priv_lev=3 + .export ClassEntry87,priv_lev=3 + .export ClassEntry88,priv_lev=3 + .export ClassEntry89,priv_lev=3 + .export ClassEntry90,priv_lev=3 + .export ClassEntry91,priv_lev=3 + .export ClassEntry92,priv_lev=3 + .export ClassEntry93,priv_lev=3 + .export ClassEntry94,priv_lev=3 + .export ClassEntry95,priv_lev=3 + .export ClassEntry96,priv_lev=3 + .export ClassEntry97,priv_lev=3 + .export ClassEntry98,priv_lev=3 + .export ClassEntry99,priv_lev=3 + .export ClassEntry100,priv_lev=3 + .export ClassEntry101,priv_lev=3 + .export ClassEntry102,priv_lev=3 + .export ClassEntry103,priv_lev=3 + .export ClassEntry104,priv_lev=3 + .export ClassEntry105,priv_lev=3 + .export ClassEntry106,priv_lev=3 + .export ClassEntry107,priv_lev=3 + .export ClassEntry108,priv_lev=3 + .export ClassEntry109,priv_lev=3 + .export ClassEntry110,priv_lev=3 + .export ClassEntry111,priv_lev=3 + .export ClassEntry112,priv_lev=3 + .export ClassEntry113,priv_lev=3 + .export ClassEntry114,priv_lev=3 + .export ClassEntry115,priv_lev=3 + .export ClassEntry116,priv_lev=3 + .export ClassEntry117,priv_lev=3 + .export ClassEntry118,priv_lev=3 + .export ClassEntry119,priv_lev=3 + .export ClassEntry120,priv_lev=3 + .export ClassEntry121,priv_lev=3 + .export ClassEntry122,priv_lev=3 + .export ClassEntry123,priv_lev=3 + .export ClassEntry124,priv_lev=3 + .export ClassEntry125,priv_lev=3 + .export ClassEntry126,priv_lev=3 + .export ClassEntry127,priv_lev=3 + .export ClassEntry128,priv_lev=3 + .export ClassEntry129,priv_lev=3 + .export ClassEntry130,priv_lev=3 + .export ClassEntry131,priv_lev=3 + .export ClassEntry132,priv_lev=3 + .export ClassEntry133,priv_lev=3 + .export ClassEntry134,priv_lev=3 + .export ClassEntry135,priv_lev=3 + .export ClassEntry136,priv_lev=3 + .export ClassEntry137,priv_lev=3 + .export ClassEntry138,priv_lev=3 + .export ClassEntry139,priv_lev=3 + .export ClassEntry140,priv_lev=3 + .export ClassEntry141,priv_lev=3 + .export ClassEntry142,priv_lev=3 + .export ClassEntry143,priv_lev=3 + .export ClassEntry144,priv_lev=3 + .export ClassEntry145,priv_lev=3 + .export ClassEntry146,priv_lev=3 + .export ClassEntry147,priv_lev=3 + .export ClassEntry148,priv_lev=3 + .export ClassEntry149,priv_lev=3 + + .import $$dyncall,MILLICODE + .import class_Lookup,CODE + .end *** overhead/class/machdep/hp_pa_risc/makedo.csh Thu Jun 6 17:22:32 1991 --- overhead/class/machdep/hp_pa_risc/makedo.csh Thu Jun 6 17:23:54 1991 *************** *** 0 **** --- 1,84 ---- + #!/bin/csh -f + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ($#argv == 0) then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, doindex" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -e overrides the default entry point" + echo " -g causes .dog file to be generated for debugger use" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + if ($?entrypointcoming) then + set entrypoint=$file + unset entrypointcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -e: + set entrypointcoming + breaksw + case -g: + set gflag + breaksw + default: + if (! $?outfile) set outfile=$file + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if ($?entrypointcoming) then + echo "makedo: missing argument to -e switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + if (! $?entrypoint) then + set entrypoint=_${outfile:r}__GetClassInfo + endif + ld -r -o ${outfile:r}.do $filelist -e $entrypoint + + set retcode=$status + exit($retcode) *** overhead/class/machdep/hp_pa_risc/milli.shar Thu May 30 20:39:16 1991 --- overhead/class/machdep/hp_pa_risc/milli.shar.NEW Tue Apr 23 15:52:28 1991 *************** *** 0 **** --- 1,306 ---- + # This is a shell archive. Remove anything before this line, + # then unpack it by saving it in a file and typing "sh file". + # + # Wrapped by Cary Coutant on Thu Mar 7 09:46:23 1991 + # + # This archive contains: + # milli.o + # + # Files are compressed using compress(1). + + LANG=""; export LANG + PATH=/bin:/usr/bin:$PATH; export PATH + + + rm -f /tmp/uud$$ + (echo "begin 777 /tmp/uud$$\n \nend" | uudecode) >/dev/null 2>&1 + if [ -f /tmp/uud$$ ] + then + rm -f /tmp/uud$$ + unpacker=uudecode + else + echo Compiling unpacker for non-ascii files + pwd=`pwd`; cd /tmp + cat >unpack$$.c <<-'EOF' + #include + #define DEC(c) (((c) - ' ') & 077) + main() + { + int n; + char dest[128], a,b,c,d; + + scanf("begin %o ", &n); + gets(dest); + + if (freopen(dest, "w", stdout) == NULL) { + perror(dest); + exit(1); + } + + while ((n=getchar()) != EOF && (n=DEC(n))!=0) { + while (n>0) { + a = DEC(getchar()); + b = DEC(getchar()); + c = DEC(getchar()); + d = DEC(getchar()); + if (n-- > 0) putchar(a << 2 | b >> 4); + if (n-- > 0) putchar(b << 4 | c >> 2); + if (n-- > 0) putchar(c << 6 | d); + } + n=getchar(); + } + exit(0); + } + EOF + cc -o unpack$$ unpack$$.c + rm unpack$$.c + cd $pwd + unpacker=/tmp/unpack$$ + fi + + echo x - milli.o '[compressed]' + $unpacker <<'@eof' + begin 600 milli.o + M'YV0 A8$,% @Q@1F !(J7,BP84) #<$ -(08D(!"I$IA)!P )*&'A7BZOB1 + M80]2"A\D)* P0*:$(^@E#& H80D^"3&02"AQX1$=-O I) , *'#!?\6_IO + M(=.F#7& \"QI<(%"@L\=BPIL*O80$8 97P + M JN$#L[:99NP*@"W -XLA+O0XD(3C!S&]5O/*UB%7I@HW G !*3)"AB( (; + M (B9@!E^30^ +L/U[7O2=!C !XJX )"5$'T-Q75;=/&UY-]J DZ$E&^AP<>? + M?\8EU""!#,5U&8(3HD#?A0\"P%)"G$C84'\H0/$@A@O%!8N)#!E A5%8$$% + M95>1T$023#"1Q!!/$%$$C@!(0$(53ER1A!-$Z,BCCT *220 "9 A11)6!$$ + MC5,"4 )/M[8D(Q1#IGAD4DNV:1B)!S!Q!-"!,%$EP L0,(42#PA!15$;!D$ + MD3+V2<6?##5@I1%!? $DDC1*T>670DPQ!8X,P,#0B$@A<$"E#*U6X #O+=0 + M;T@E0$NH#+$08@(LH+H0BYDQP.E"WCF4P#"NOA6B M3DFA ;JS+C*P!XA+@ + M%\,BLBLWLRI4XH,+K-%L0KLA%>VT &@$[1[8,@?M(MBB8^PFV')G[2J^!@!@ + M0PL DRX%(3* 2+JB(L4 LY:VI"JTUTP; _&OI-NK0TQ ("_6,2[@;]HQ#M# + MNL4^R 2_A(2[QC^4A+O'NFB)#$F_I8F\2_I$A,O-.E"$R\[_IZ%5 ,7I M/ + MB V@X"\_-.\PK0 &/]C $[X*0*I##7"Q,PHTG[$S#C3/$71)+S.R,W0OGQ(T + M&33#LO.!+^-:+P "M,:0 Q $G=S+Q 2ML<^]?BV ?2_S$S1V#SJ 0- OUDU! + MT-4ZY (06N+E -(!*URW5CL[.W@&.=[D;AU<^RVN7Y3,NT F/K]RN7PUKV, + MKP/0J9 #U%SNN-_/7,YB 'B- SK!,^%%#^A4+\0Z ]@ #H7_"7TP-Y?#X#U + MB;XS #JPQ.->=O!T](X[X,'CE/P#,(!N\?1 @'ZV[;Y# ?K:#-W^ !B@/QN^ + M[W" [O'YN ,"^EW30P*ZR.Q_ /U" S1H%>Z@@"XX][B#!>@.Q[X'N"MXBP/@ + M U 6/),^%^SHA^5Q( ^=!('TN!-@%W>="]EQ0?BZ$7702 + M\@$2>#!A%^R?"WMR0@&ZL&$7/" )N09 "#"0A!$[(01=*+8E4H6"+E16\B( + M ]NB'T1&.%0,.&\"*1P)7 #8 1:2$*ZP5&&),P;'&](PK[M+P([)*'^8@> + M" "1A/\[)!%)2$ ](I&$"3RD%$GHP$-:D802U*,6AV)!.'YQ*!ID9 3&N) " + M(.5V$4!C*]?%2 FT\6L%\%0MY9B0 E0(@!*XHY>^MC\)\#$K2$N>! "9E=,5 + MDY!989HR$YF5U25$ H_,"M2 .;Y1F"R,BMT5*8LLY+'_4W@EJWT(P GP$LO"7*A + MPBR (1DY@6/VQE)BD*SEY4T*#5[F4F*9K.7G:1H-WL92H.&LY>E + M7*@Y>YG*C*HS(09X94(FX,ZRT#*C]RR++C/Z3YS^TJ #Q2DQ&0DO7QD@F>RC + M0$,-X$RF"M, THRJ1;^*/#1LGPSJB,MRS@!2(&3E@6=8UUI + M6=C)UI>6!9Y,G6E9PLC6FY:EC+>C0$\-H,:H!M4 _1QK4.*\"5S59\BJP50,@9+1@-0 U/EM6 W#CLVDU0$L9 + M60&W&D FHY7K 70*@ K8=5.?U>L!CDI;OQZ A@FI0$\/4%4S5B"H!Q"B91=[ + M +'2=K('J-W^+(#9A!P KHRT0$,/@#SV64"8!^#K=K=Z@'P"T )@/4!BPUO6 + M Y@/@!_0K4*WF]8#:':[;CT 1F]G =V>MGY$\-4!2FI&"_R6',ZS@'!CNEWC + MXBQY%N@I GY*X* B8(7O72P"EMK@R2(@AP"\0'>-DM44-Q0!1F3?!82)@+.F + M>*L(X%WR+@!6!-!U?Q.$K!-3T=K7Q50) R$@,-#0! + M0X6S,!, PSIO-0%0!2 &P)J 'B8/ V5-0%' ;DF8'CL + MPX!=$X!7,V) KPFHIZ#]FH#""KJG"0"?H(.:@(+6>;$)J*R@)YN B9K1,W(6 + M+?LR<.>0,C(#>WYM\C+PY]G>FM"XW759%<#;#*15 28$8 ;#>#9+!5PJ8KQDUT% %W'>#W #X?O,M3 7\EY$?8 ? !YP0#6Q5 0?&+SX + MSN#;:0"L"H!P\C2P; KG^]D79I\&W+H #E=ET BF?N + MUP6T>.8]74", :B!H"[ QC-?[+&!;]8!O3Y\)-E0*#WEQM?,<#0[.- 0QG0U0_H + ME0&/YHTP&3!I1G)@JPS - Y %8&=/IV'"@K T1-^;3*RWD<<"L#5$UYN3+ + MU6;\@%T9(&O*#]_6L/^\KE?O5P;XVHP<(+RP,Y]X8\.^\_60;P%OB^*H! + MT=Y?!QK: &O?K@/"-)3S.K#5!GQ[.&!M +G%7]8&H/O\:6T N\W8 ;0'XB5S\T\'TF9T8>D'XI!T >L%5VXSP> + M %8.('.,Y %E]3<\F%8.L'-!Z%8.\'-!*%<.,'0G:%<.@'1!J%<.H&/LXP%^ + MY0!01X,]Y0!5AX-!Y0!:YP&+Y0!?1X.3Y0!C!W$KY@!H%WP0,"T.P'9F! (+ + MX"L. '< ! ('=]N(4OV(>LH(#L@@ -Z>(/[ P*HX"L/ + M$'Z,! *D8(GF)X@]]0#:!@(L'\)$0)V]0#[=SLA + M(%(WTR( %B08>&8$ 68SY6($% + M.2_YF($;B0D>V8$;B0K3 @$B* +?X)$FR$@CL&(08(C[0P((<)-ZEQ DL $> + MV7?L4P(T,"ULY#PEL 2^$@&8:$8F0 A5^7BW4P)L4)7:9@)T0%4FM$<.D5.5 + ML0M#<#H1P")H:0*X0)8*$0%*]);+L)8+$0$5F1:N@0QRF1 1T(6[51G;\)>- + M!)+>Y1KK, ,$0$DR9B5 0E0R7L=X1J34)5Q")DF@ J&&0%V&!8FL ]X.9<8 + M!9K]F)?/%Q8G8)*-:6:FV9DSJ)J',)K7E"D)<0):^342,%2J68D,822P80+X + M,"T2H(K?@0(C@!$+(0'HQGT*H9P*(0'[YYP7\9NXF!#4"0#., NE!P"V@&CF + M P@!74 ,J49X&4Y[P4IXJ5IXI #ER7WEV4/ER0$"4)X?<)\P< /P"0,B + M, "U8 O.L)W=^9U,$)XP, 'ZR5WEZ1GE.0/Z:0/]J0'Z&0+Z61[EZ40!.J#< + MZ1#?V0T;2J >R@$$D 0AVJ$-@0$M<*(L8@L$4 O3@ $P<*+=B6@TZA 8X 0W + MFJ)+L*,,8:,"NIW69@L%$)[:$0"*0 VK=:+.X1M'V@C3$ "V0 U'&@G3X)U! + M.@O69J0ST0A**J754 U5JJ18RJ%-:A08D %"% "0< "U4 T&L*:4@ $><*)# + M&@?180E1BJZ[VJK%IH;,QX+14[9@0P)G^R4KJ[8"0 *8NA!Q:[0700(_9R?^>@-?, =HD 9F$(9QZ[!W + MZZ[EVJH,J[:'&[3ET1 ?>P:-^ZZ(^P61^[-7:Z^&6Q90:[A?R[ QD+FLV@9U + MP :.^IQL8+@"P :$"S9L8+>LZTRI.[?/B0>PBP>R>Q%XX+H"@ >KN[NHBP=2 + MN[LEN[MG:P!R4 9T\ 5T4+L_M[N5VT:V>SH#8+NW.[TQ8+?62[C6ZZX'@*U^ + M"[AA:+U.:[TA:[U=:[TM9KV5.[TR(+VY6[VYB[VY2[@$@*W+ZQ#LZZ[L.[ZY + M6[ZY>[ZYF[ZYN[Z\Z[XS +\S(+\SH+V\J[^\R[\SX+\S , S(, S0, TX+XT + M +\T(+\TP, TX, TP+\TX+\T , T(, T0, UX+XU +\U(+\UP, UX, UP+\U + MX+\U , UT&(%@*TR<+\,,;TU4+G=J[PP( -AX+XVP,3P:P/R:P,,; ,.; /\ + M:P/^:P, ; ,"; ,$? /N>P/P>P/R>P,,? ,.? /\>P/^>P, ? ,"? ,$C /N + MBP/PBP/RBP,,C ,.C /\BP/^BP, C ,"C ,$G /NFP/PFP-V^\-?0 -"C#]X + MD ,,G ,.G /\FP/^FP, G ,"G .52P#1VURB3+.W.Q31Z[HK$;VKN\HTF[DB + M$KU2Z\HP4+*TK+BE# ,)F]/MF]3M^\_M&]#M.]#M6]#MJ[B./ -='MK7'-J>W=>('<[ '+^,+0.. + MC"42 D4 9N0 8&CN /30)F +YNP%>/J\I?*! + MV^(+H:@U_@8#WDL%'N6.2P++VJRK[>/("^00C@823N$&2P+>6@9&GN$;WN%+ + M#N(32P=R$ 9X)2-T@ ;'Z^8$[K(-_N4K;@=^KN1SD 8(..4LSEDSN5F( >J + M+NA5/B:#>KQM<.-@0P>G; K[@:C^F.L2NM;GA ,(*NT:JN?.N&.GN)DW@:- + MVB*A^@5O8 =F0( 7@>LQLNN]GB%?T+?(JP9)/B:.3@?>#D\)L.T&[@9G,.ZK + M?>[I_NW>Q>WB[NY&\07LKNX-H0!]*PZKAQ4 <8 + M7E7X?NAG$.[V_J@,[_#RGA *@*IS$ :$SJESP.,+@>]].ZQB8.!CP/%7\?%G + M4._RK@ ,C_+PU "^6@;@6JIEH/$DOQ$F'^[@2JDS'P8;G^)CP*S-&JU> O2H + M*N(G_P9BT*ET<@!?0/3(RZL0ZP)-;A-( 55\!50<+RU>NC>"@)!( /P>.W@8ASZR.R\@CW,H6$ 0N ,P,/#_9_._9C4/9EUC/=ZS_=U__>!GQ3/WJW?2@>%KQ"';_58K_6CF@9=__5A+_F4;_DSC_EM + M+P-OWQ">3_=V+_ILL/=];_HV(/AI4>-)T/JNC_BQS_BT[_BV'_EDW^"5'P1H + MO_MLP/8>N_EP+_?"'_IY7_RD[_ O[ +_Z@[^Z5/^-7^M+?Z;MR6:[Y3;W7E_@6W]:;?O7/^DT^[*?[ + MU-[^ZWV_CR$$OP!(_ @@^E-_RL^[9#GWMP"AG_R3?K4/\HF]^Y?]MI\%]'ZM + MQ/]I0 X_ ;@^4-^(; LT#H%:/A,H .=_W\WV<3R%LP!HX + M^HZ? 5Q_O K8O3\ P "CWP,,@A(P]^4_[@<#LX(,['PTD/PUP0(( A,5K6M4 + M[Z\*GL K2/U4(.ZC@%OP!?*_ O %E6 8%(!C\ ,>P,P@\># %(1_#7#^0<#J + MMP*'8 O4?UU0\R'!\/?YF*#YBUR(# (WALH!+Z0$&(!0NA%BR"%_ (9D PZ + V-R; 1WP!C[! + M'+@ (EZWXW!ID@ NB$!.E"(^$V'0P(( + MFPD0%B; /GJ'"Z&B[)3S, &0QP1 0/A0(4R M3$![,-!V"D,)B#N%-RR0BC + MOJ "4DA>A7H0 %Z @5(#A2 &4E$"B R!$M"H !]AP+4%(E8 3H':$DNVJ$" + M=">22&0J@$6H /"C M@:DCAF*L!9L ]PP)8&XEH 0R-!3 B%N! 6 !A)!$! + M@ 4(*!: ;EB ,6,!S Q/O# 7H&=< &ER 1I24;P />$"'(@+\"PN0 :2B!= + MM%R ,5,A,,!5"HB'X >, "WP"'R (! ""P (6($.L ! 0&@BR" *B+O @$ + M%D O, !XD0 $ ;]X .AB"!",A-$P(L9>4!@7P&$-I+(VL,36Z1M4( + M&U>C;:R-N/$U6D8=( 4 05V\B^L ' # 7 4! 00 <9 @01[ !!&8!"'@/ + MQ1$(!,>B@ H5!> ',O1.&+'Z+@=F6-WU(X7@3N&1^\X'L$CV!"/Y]$[?@ . + M4 _BXES\CL=Q/58#]]@!X"-\C(O 43C6"1V0&MJB$, -DU & , + MD+F1-NI&!W),&H$^"C7H4*#N G3P*A;%& + M(H <@"@590# 0N@!Q3&.0D$-, MR )E80'H .@!?QD/;J2^-%3$LII 0 + M):(LE=$!$0#*PO@HKZ2DS "O$G+ @@60"S8EG9P&6N!&?DH H !$9:*$'( + M4G: 02DB@.6-9)4(H =42LB!#V9E!W"6P&78Y)22H&HB@"Z *+6!M924N:!>AH*1N2]K9 *XF@G@8N9+ + M>)D!$N8TR (H(!^L@EQ@%)PE.IB. F 59($/T T>)P[ !TP36O)- ^DWP:6\ + M#)SJ VT + M0 ) %T@**# $ 1ID$.Z)J(( /\@&Y002\HYHR.(?0'U,TN !A/*'-,H95@ + M >@" S CA:.43*%M %$& 1C9 P!C"JT",M0 = (7:AQ3: M E(& AQY( QD$ + M4F@#6 "A@(9B3AT:0GU .0BBG4!<> !]4$7GXPSM!D04"%315H H@X$2I8L& + M,A!4T48 1:6H#:6B&< 'E($@V@VTJ!Z HSX 9T;1(?I&TV@5+0%T5(OJ !VJ + M-0U $-"BXRF*CDX#H$8S0 \H!P@@!!A2<=$!] $UT $(@!"$T![0#"9H!YBB + M!C(8;-)2@"]QY C2!65TD[)110I*#8 H=:1S- A,TA%T1_VH(]6C0K25-M(> + M $AE:2"@I(,TC1;20SJ"$BD-1:+#E)(B@&$*1WE ,VBC8+2/,M(0R@-(J23] + MI0" Z!2)EI(L2D'V)6*M)F6@4CJ2L4%!ZBEAC299E,XT$8[ 2&5I<24 R"! + M;HI$R6D\-:9=X)(B@%(00G? %=V: 4!<; !+BDGY:0;8 9VTAWY2&UH=76D_ + M+07=5*#J GU*" II0-TZX/28AE)[*E!EY:@,!JGTH.)2/CH<0^H.Z*6,5* & + M4U>J3C< /BVC+769PE,D&D)UP#.-HM&TI-I2'0!19:DIU0#;E)%&5 "@ 3+J + M(@T$0U4#( )F*DSAJ;A8.>TTI.J )'E-G^I*#9-5E:BB (M:1LDI-E67^'(P + M,M$0F@.* 34( 9E47&0 ;=!5LVH&0 ;X$JFF4:^J5HUJ5_VH:E562E*QFDY] + MJ5IEIWOTG:;4;3-/?6E;G:7$IHTN4JR*6&5J.N6F3A4 8 !X $UA:F3% '!U + MKPI68IH!"JM0#:7J% .@ WM:3_>JN, @%6(EM99B@$\:R#0ISU5+YY6?*I/ + MC4$(O0'_5+8"@ M 4!& ;5TMT[4@FI1Q<4%,*H- + M%:3ZU=VZ5.%I=%6G6K&=7M?(>@%<:VV-J\[U/XQ*OAHF!X(IO0 R52^&5!MP + M4PU 3@T(H-6GB@L+ T\J64=K!; KL97_%I='RM+C:Q!,:KN5V)J 5SK?26P + MR&"84E2Z:A33:P!8L%FU L #^[I1):DI?2X45JC*U]ZB7S5LYTKF;5">!=Q^QX + M%1<3X#\\64;J9M$ /86L@U4"<-EN4&.QJ03(K)^UKZ99 [M11Z6A10>%%*3& + M6&**302L*\VRS.G/7MHO>VB9ZG\-M%;6OS;/61H!T,%9S:3WU=#J6?^*8BFM + MDV6UZG29D%9 2VE]HV$%M-@T KQ:2:MH<^V,M;""U=>24U[;9K\L!!BTJY68 + M0H >2VRSK*[5M",VN4* -1L$8*O9O*@_Q-(6V\$* 5ZMF/6MUU9<0 #:BDG/ + M00A] ;GUHCZ WFIN,\ +$*X+=3CJTW;[ I"KNEVNX%:6JEOH>F(CK;AX "$6 + MS6+3!P!G!>Z_=:T&%W?T6/+*8!] J T":):8.H!!&W'%A0-@MA47=R#,#3EM?D>G&O+81EN0ZVJYI7<=$ N.QB10 S + M%P T@(5[7TUI Q"R_E;G%MG]BDT; )Q-M327T7[:HLMSB2[-!08J5YTR &0[ + M8,4% V"V5%;GUME]&FX/QIJ5JY^6F#8 6VM(K>V2/1AF]IJ^7&QZ=5WNF,VJ + M#"#FSM6!@$T7 ,4]L0QV 839PVI*UXYBY;OB8@$,70_;=PNNR:V[WK;&]MVF + M2W@#+]2%L1X6FRH JAMYQ84"8+:P-:Q:WK2;:%NMY5VSQ':H9IVH&UD5 .<- + M!IGWSA)+SMMF32XQ70 I%_)&V[H;>PU "BT@9>=ZELC2RP]:^@MO1_7QV[: + MP7RK!>)=O GB\;';86MXZL7N=KE% M-\VME[4Y#MKEZZX + M0 "C]9H>5FR: )+EE&VJ@Q4![-JLBP"P[W?]LAOFVGK967H [N[P):8' ./B + M7?B[<3^M*3T U';^$M,C,TP%\/>MO=46DQH#S>O,5BW$/;SB0L!TWVV+30T + MY:7 XL( 8%TY.UBK"[1EL <@^+;>L!N!22Z;#;H&P-M^5T>;@0.PZXW U#?1 + M8F!G5GMO+P?&I@= ]]I>W!M66"SZK<"M4OSBV@Q,=L'NJ*W M1?LADD67!9B + M\.\=K 8 1]68DH *"]CI<(;^/Z*BP*@?(,N :"V.E3Z>@FRRUARI1Z+Y7& US52C;1K#O9A47! "#HE6(2H<'0/CMO.J4 )C@-AQ9 + M11D<9K $ !/,81(L(F*P$0[$2?@.BP@=_(BGJT<8ML%67 R ("Q\/6\;P07V + M=.UJXH^K7H=P&S$*%E84@PT'?%\OZO2"P\VUC<"!"9QE!8#O!;RQDA9_V;#1 + M30TPV, %GC;:FM( P(85KY\$!J%8R>I6 #!HS>XRSL(S. DWAOL)SGQMS4& + M71< P-G:FHVW[CG(QN3V@J;08_.*,I-!F44 2 .5-H*+BVZ%B$1ML + M$(]_@.+TT(/N 2-!-"_)XK:)Q("(KY#@:!;RJ0Z:4.%4BXTJ?>D;CY_P\"@<2!.Q@ + M(& &J=*U@#3( 1L 'ZP03MH#M@ 2[5 & 1"@C7: 5: %/$ G+:[:P$H:1YO#!PYH + M H6+##0#0 X8,&+RI4E.F2EY);?DPJP!YN07* 4Q>2;79 #@07'R4 X!(J G + M4V6AK)/!;T(XR@X@*4-=+1":F;(&< !.&13L2=079=@"QBIHC:6A^RW@H + M%#B N:P%O,%==@#:X!H(@0W@#5:S!M#+0. PHV2\J)A=PG98&?1 27 + M&1941T. 30. )/"3:. R0X(!W:#E@)]$ I=9*Q/HZ" %_*0$B(XRU!!@Y0 @ + M ZBR/,C/AF 8\^2$P)E#0%S6!8:@CB8$>4"5D<%;IJPP6D8# /^<$$!!0QV, + M.1IR&.B'0$B#=$)XT#RA*8=H'6VA!P0R-=( H$/WA1]-H2&'#(BD&QILO&44 + ML I" 2"0 *P2%_ !NMP!BD%#S<[;N3N3YN^'D 4+6J + MSI2M.I*^:E;MJE=UK$[5MKI6PVI=3:ME=:[VU;L:6/=J7!VLB?6PGM6W&EGS + MZF3]JXTULR[6REI8/^MCW:RCM;->UMA:6F?K:ZVMM?4D 42(5,.U^$8'=^T + MJ*0$F5I&AE'Z^!OQ(@D(DWSQ3OO%/$T(B*D &$^-^D\;ZGRMJ/7UHM[7B?I0 + M^^N!W:\+ML VV"+R44=JM4FI'>.EOHR9>E.W:_"P!M@#"E@#14 \K0%*C0/6P!&8"&O@(R"!-8"HH, :4 ( + M NL@25PF]> 9$ #:V \P($UX 2(Q1IX E-;12""-1 % D6 -2 !@@C4P + M!>I#0B &H6 -! $ *"!#?H\#\51"T3M'Q (EL#2;MJ\ P*L 8J 9: R,X& + MZ (4$>PP06.=M+^W&L@&_R 6!"U6<,2F-SP ! $ ! @ 98 J(0 J3LA+($N + MB0$V=^?^W$N &\SN)5"U < 2P-H(8 EL;1"P!+SV$@C;,& )D.TE<+:!P!)0 + MVTN@;2\!N(T%E@#=!@-+X&XO ;V]!/HV'E@"@!L0+ '!O00*-R18 HD;$RR! + MQ@T*;C?EC@[8 \! AD !&A ;L (0(!CEVP0 [.@_%> 3T!#0@1&C ! H Y + ;4 1\ 0H B>$-! #T@(!OP'_(/43:Z9(SX$ + + end + @eof + uncompress /tmp/compress$$ + mv /tmp/compress$$ milli.o + + chmod 664 milli.o + + rm -f /tmp/unpack$$ + exit 0 *** overhead/class/machdep/hp_pa_risc/symbols.c Thu May 30 20:39:29 1991 --- overhead/class/machdep/hp_pa_risc/symbols.c.NEW Tue Apr 23 15:52:29 1991 *************** *** 0 **** --- 1,86 ---- + /* + * Copyright BellSouth 1991 - All Rights Reserved + * For full copyright information see:'andrew/config/COPYRITE.bls'. + */ + + /* Symbols that are to be shared between static and dynamically + * loaded code (for dynld) */ + + /* These are the globals from the ATK class runtime system */ + extern class_Error; + extern class_ErrorReturnValue; + + extern class_EnterInfo(); + extern class_GetEText(); + extern class_IsLoaded(); + extern class_IsType(); + extern class_IsTypeByName(); + extern class_Load(); + extern class_Lookup(); + extern class_NewObject(); + extern class_PrependClassPath(); + extern class_SetClassPath(); + + extern strncpy(); + extern scandir(); + extern alphasort(); + extern etext; + extern _sigpause(); + extern sigpause(); + extern __sigpause(); + + #include + + extern FILE __iob[]; + extern char *_stdbuf, *_lastbuf, *_sibuf, *_smbuf, *_sobuf; + extern char **environ, **_environ; + extern int errno, errnet, _errnet; + extern char *brk(), *__brk(), *sbrk(), *_sbrk(); + + int define_symbols() + { + int status; + + status = _define_symbol("__iob", (char *)__iob); + status += _define_symbol("_bufendtab", (char *)&_bufendtab); + status += _define_symbol("_stdbuf", (char *)&_stdbuf); + status += _define_symbol("_lastbuf", (char *)&_lastbuf); + status += _define_symbol("_sibuf", (char *)&_sibuf); + status += _define_symbol("_smbuf", (char *)&_smbuf); + status += _define_symbol("_sobuf", (char *)&_sobuf); + status += _define_symbol("environ", (char *)&environ); + status += _define_symbol("_environ", (char *)&_environ); + status += _define_symbol("errno", (char *)&errno); + status += _define_symbol("errnet", (char *)&errnet); + status += _define_symbol("_errnet", (char *)&_errnet); + status += _define_symbol("brk", (char *)brk); + status += _define_symbol("__brk", (char *)__brk); + status += _define_symbol("sbrk", (char *)sbrk); + status += _define_symbol("_sbrk", (char *)_sbrk); + + status += _define_symbol("class_Error", (char *) &class_Error); + status += _define_symbol("class_ErrorReturnValue", (char *) &class_ErrorReturnValue); + status += _define_symbol("class_EnterInfo", (char *) class_EnterInfo); + status += _define_symbol("class_GetEText", (char *) class_GetEText); + status += _define_symbol("class_IsLoaded", (char *) class_IsLoaded); + status += _define_symbol("class_IsType", (char *) class_IsType); + status += _define_symbol("class_IsTypeByName", (char *) class_IsTypeByName); + status += _define_symbol("class_Load", (char *) class_Load); + status += _define_symbol("class_Lookup", (char *) class_Lookup); + status += _define_symbol("class_NewObject", (char *) class_NewObject); + status += _define_symbol("class_PrependClassPath", (char *) class_PrependClassPath); + status += _define_symbol("class_SetClassPath", (char *) class_SetClassPath); + + status += _define_symbol("strncpy", (char *) strncpy); + status += _define_symbol("scandir", (char *) scandir); + status += _define_symbol("alphasort", (char *) alphasort); + + status += _define_symbol("etext", (char *) &etext); + + /* status += _define_symbol("_sigpause", (char *) _sigpause); + */ + status += _define_symbol("sigpause", (char *) sigpause); + status += _define_symbol("__sigpause", (char *) __sigpause); + + return status; + } *** overhead/class/machdep/aix_31/makedo.csh Mon Aug 6 11:13:23 1990 --- overhead/class/machdep/aix_31/makedo.csh Thu Jun 6 17:23:28 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, dotest" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, dotest" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/aix_i386/makedo.csh Fri Aug 3 16:58:19 1990 --- overhead/class/machdep/aix_i386/makedo.csh Thu Jun 6 17:23:31 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/aix_rt/makedo.csh Wed Nov 22 13:24:12 1989 --- overhead/class/machdep/aix_rt/makedo.csh Thu Jun 6 17:23:34 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ( "$#argv" == 0 ) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/aos_rt/makedo.csh Wed Nov 22 13:25:54 1989 --- overhead/class/machdep/aos_rt/makedo.csh Thu Jun 6 17:23:37 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/apollo_68k/makedo.csh Thu Jan 10 14:57:07 1991 --- overhead/class/machdep/apollo_68k/makedo.csh Thu Jun 6 17:23:40 1991 *************** *** 20,26 **** # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. # ! # $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/apollo_68k/RCS/makedo.csh,v 1.1 89/09/21 13:37:38 zs01 Exp $ # $ACIS:makedo 1.2$ # $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/apollo_68k/RCS/makedo.csh,v $ --- 20,26 ---- # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. # ! # $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/apollo_68k/RCS/makedo.csh,v 1.2 1991/06/06 21:20:43 gk5g Exp $ # $ACIS:makedo 1.2$ # $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/apollo_68k/RCS/makedo.csh,v $ *************** *** 27,33 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, dotest" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 27,33 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, dotest" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/dec_mips/makedo.csh Wed Nov 22 13:27:58 1989 --- overhead/class/machdep/dec_mips/makedo.csh Thu Jun 6 17:23:45 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/dec_vax/makedo.csh Wed Nov 22 13:28:45 1989 --- overhead/class/machdep/dec_vax/makedo.csh Thu Jun 6 17:23:48 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/hp_68k/makedo.csh Wed Nov 22 13:29:27 1989 --- overhead/class/machdep/hp_68k/makedo.csh Thu Jun 6 17:23:51 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/i386_mach/makedo.csh Mon Aug 6 11:14:04 1990 --- overhead/class/machdep/i386_mach/makedo.csh Thu Jun 6 17:24:13 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/sun_68k/makedo.csh Wed Nov 22 13:30:50 1989 --- overhead/class/machdep/sun_68k/makedo.csh Thu Jun 6 17:24:02 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/sun_sparc/makedo.csh Wed Nov 22 13:32:01 1989 --- overhead/class/machdep/sun_sparc/makedo.csh Thu Jun 6 17:24:08 1991 *************** *** 2,8 **** # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ("$*" == "") then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" --- 2,8 ---- # Script to convert normal object files into a dynamically loadable module. if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew ! if ($#argv == 0) then echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." echo " -b overrides /usr/andrew/bin for finding dofix, doindex" echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" *** overhead/class/machdep/sco_i386/Imakefile Thu May 30 20:39:40 1991 --- overhead/class/machdep/sco_i386/Imakefile.NEW Thu Apr 25 16:21:12 1991 *************** *** 0 **** --- 1,54 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DependTarget(globalrefs._h) + + NormalObjectRule() + NormalAsmPPRule() + + all:: globals.o entry.o doload.o dofix.o dolist.o + + globals.o: globals.spp globalrefs._h + + globalrefs._h: libc.eplist + $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h + $(MV) ,globalrefs._h globalrefs._h + + libc.eplist: /lib/libc.a /lib/crt0.o getlist.awk + $(RM) /tmp/libhack.a + $(AR) /tmp/libhack.a /lib/crt0.o + $(NM) -ex /lib/libc.a /tmp/libhack.a | \ + $(TR) "|" " " | \ + $(AWK) -f getlist.awk | \ + grep -v "%_" > ,libc.eplist + $(MV) ,libc.eplist libc.eplist + + InstallLibrary(libcx.a, $(DESTDIR)/lib) + InstallCshScript(makedo.csh,$(DESTDIR)/bin/makedo) + + all:: libcx.a + + DelList._: libc.eplist + $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ + $(MV) ,DelList._ DelList._ + + libcx.a: /lib/libc.a /lib/crt0.o DelList._ $(COMPILERLIBS) + rm -rf new + mkdir new + cd new ; \ + ar x $(COMPILERLIBS) ; \ + cp /lib/libc.a libcx.a ; \ + chmod +w libcx.a ; \ + ar q libcx.a *.o /lib/crt0.o ; \ + ar d libcx.a `cat ../DelList._` + mv new/libcx.a libcx.a + rm -rf new + + clean:: + $(RM) DelList._ libc.eplist globalrefs._h ,* libcx.a + rm -fr new /tmp/libhack.a + + install:: + rm -rf ../machine + copy -rom . ../machine *** overhead/class/machdep/sco_i386/dofix.c Thu May 30 20:39:51 1991 --- overhead/class/machdep/sco_i386/dofix.c.NEW Thu Apr 25 16:21:14 1991 *************** *** 0 **** --- 1,281 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + dofix.c - convert .o file into .do file + + Author: John H Howard - April 9, 1987 + */ + + + #include + #include /* sys/file.h */ + #include + #include + #include + + #include <../common/safe.h> + + char *doload_getname(); + + /* set entry point */ + + FixEntryPoint(e, EntryPointName) + register struct doload_environment *e; + char *EntryPointName; + { + register SYMENT *sp; + register SYMENT *sbound; + + if (EntryPointName == NULL || *EntryPointName == NULL) + return; + + /* the following compensates for the missing _ at the beginning of AIX routine names */ + if (*EntryPointName == '_') + EntryPointName++; + sp = sbound = e->symtab; + (char *)sbound += e->filehdr.f_nsyms * SYMESZ; + for (; sp < sbound; (char *)sp += SYMESZ) { + if (sp->n_scnum != N_UNDEF + && (sp->n_sclass == C_EXT) + && strcmp(EntryPointName, doload_getname(e, sp)) == 0 ) { + e->aouthdr.entry = sp->n_value; + return; + } + + } /* end of loop */ + printf("***entry point %s undefined\n", EntryPointName); + fflush(stdout); + e->problems += 1; + return; + } + + /* write new symbol table */ + + WriteNewSym(e, outFD) + register struct doload_environment *e; + int outFD; + { + register int i; + register char *newcp; + long newstringsize; + char *newstrings = NULL; + SYMENT *sp; + + /* allocate new string table */ + + for (newstringsize = sizeof newstringsize, i = 0, sp = e->newsym; + i < e->newsymcount; i += 1, (char *)sp += SYMESZ) { + if (sp->n_zeroes == 0) + newstringsize += strlen(e->stringtab + sp->n_offset) + 1; + } + if (doload_trace > 0) + printf( " new symbol count %d, new string size %d\n", + e->newsymcount, newstringsize ) ; + newcp = newstrings = safe_malloc(e, newstringsize); + *(long *)newcp = newstringsize; + newcp += sizeof newstringsize; + + /* make a new string table */ + + for (i = 0, sp = e->newsym; i < e->newsymcount; i += 1, (char *)sp += SYMESZ) { + register char *oldcp ; + register int n ; + + if (sp->n_zeroes == 0) { + oldcp = e->stringtab + sp->n_offset ; + n = strlen(oldcp) + 1; + bcopy(oldcp, newcp, n); + sp->n_offset = newcp - newstrings; + newcp += n; + } + } + + /* write symbols and strings */ + + if (lseek(outFD, e->filehdr.f_symptr, 0) < 0) doload_punt(e, "symptr lseek failed"); + safe_write( e, outFD, (char *)e->newsym, e->newsymcount * SYMESZ); + safe_write(e, outFD, newstrings, newstringsize); + + /* clean up */ + + safe_free(newstrings); + + return; + } + + /* read, fix, and write out module */ + + FixIt(inFD, outFD, EntryPointName) + int inFD; /* open fd for .o file */ + int outFD; /* open fd for .do file */ + char *EntryPointName; /* entry point name */ + { + struct doload_environment E; + register struct doload_environment *e; + unsigned long n; /* number of relocation items */ + long rcount; /* number of relocation entries */ + long ssize; /* size of symbol table */ + int s; /* section index */ + RELOC *rp; /* relocation table pointer */ + + if (doload_trace > 1) + printf("FixIt(%d, %d, %s)\n", inFD, outFD, EntryPointName); + + /* set up environment */ + + doload_setup(e = &E, inFD, Fix); + if (setjmp(e->errorJump)) { + doload_cleanup(e); + return 99; + } + + /* read module into memory */ + doload_read(e); + + /* fix up symbol table */ + doload_preset(e); + + /* repair relocation tables */ + doload_fixup(e); + + /* get entry point */ + FixEntryPoint(e, EntryPointName); + + /* write out result */ + + e->filehdr.f_nsyms = e->newsymcount; + safe_write(e, outFD, (char *)&e->filehdr, FILHSZ); + safe_write(e, outFD, (char *)&e->aouthdr, e->filehdr.f_opthdr); + + for (s = 0; s < e->filehdr.f_nscns; s += 1) { + safe_write(e, outFD, (char *)&e->scn[s], SCNHSZ); + } + + for (s = 0, rcount = 0; s < e->filehdr.f_nscns; s += 1) { + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + if (lseek(outFD, e->scn[s].s_scnptr, 0) < 0) doload_punt(e, "section seek failed"); + safe_write(e, outFD, e->segptr[s], e->scn[s].s_size); + rcount += e->scn[s].s_nreloc; + break; + + case STYP_BSS: + rcount += e->scn[s].s_nreloc; + break; + } + } + + if (rcount > 0) { + rp = e->rtab; + for (s = 0; s < e->filehdr.f_nscns; s += 1) { + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + case STYP_BSS: + if (e->scn[s].s_nreloc > 0) { + if (lseek(outFD, e->scn[s].s_relptr, 0) < 0) doload_punt(e, "relocation seek failed"); + safe_write(e, outFD, (char *)rp, e->scn[s].s_nreloc * RELSZ); + (char *)rp += e->scn[s].s_nreloc * RELSZ; + } + break; + } + } + } + + WriteNewSym(e, outFD); + + doload_cleanup(e); + if (e->problems) + return 98; + else + return 0; + } + + static char *ComputeOutputFileName (InputFileName, extension) + char *InputFileName; + char *extension; + { + static char name[256]; + register char *p, *q; + char *ext; + + /* copy the input name and look for the last '.' */ + + for (p = InputFileName, q = name, ext = NULL; *p != '\0';) { + if (*p == '/') /* ignore period if '/' follows */ + p += 1, q = name, ext = NULL; + else + if ((*q++ = *p++) == '.') + ext = q - 1; + } + if (ext == NULL) + ext = q; + *ext = '\0'; + + /* overwrite the extension with new extension */ + + strncat(name, extension, 255); + if (strcmp(InputFileName, name) == 0) + strncat(name, extension, 255); + return name ; + } + + /* main program */ + + main(argc, argp) + int argc; + char **argp; + { + int infd; + int outfd; + int gotcha = 0; + char *outname; + char *EntryPointName = NULL; + int failed=0; + + while (--argc > 0) { + if (**++argp == '-') { + switch (*++*argp) { + case 'd': + doload_trace += 1; + break; + case 'e': + if (*++*argp) + EntryPointName = *argp; + else { + EntryPointName = *++argp; + argc--; + } + break; + default: + fprintf(stderr, "dofix: Unknown switch -%c ignored\n", *argp); + } + } + else { + gotcha += 1; + outname = ComputeOutputFileName(*argp, ".do"); + infd = open(*argp, O_RDONLY, 0); + if (infd < 0) + fprintf(stderr, "dofix: File %s not found\n", *argp); + else { + outfd = open(outname, O_WRONLY+O_CREAT+O_TRUNC, 0644); + if (outfd < 0) { + fprintf(stderr, "dofix: Can not write file %s\n", outname); + perror("dofix"); + } + else { + failed = FixIt(infd, outfd, EntryPointName); + close(outfd); + } + close(infd); + } + } + } + if (gotcha == 0) { + failed = FixIt(0, 1, EntryPointName); + } + exit(failed); + } *** overhead/class/machdep/sco_i386/dolist.c Thu May 30 20:40:02 1991 --- overhead/class/machdep/sco_i386/dolist.c.NEW Thu Apr 25 16:21:15 1991 *************** *** 0 **** --- 1,92 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + dolist.c - list contents of a.out or .o file + + Author: John H Howard - April 9, 1987 + */ + + + #include + #include + #include + #include + #include + + /* read and list module */ + + void ListIt(inFD) /* return pointer to data segment, */ + /* or NULL if error */ + int inFD; /* open fd for package file */ + { + struct doload_environment E; + register struct doload_environment *e; + RELOC *rp; + int s; + + /* set up environment */ + + doload_setup(e = &E, inFD, List); + if (setjmp(e->errorJump)) { + printf("\nerror exit taken\n"); fflush(stdout); fflush(stderr); + doload_cleanup(e); + return; + } + + /* read module into memory */ + + doload_read(e); + + /* list symbol table */ + + doload_preset(e); + + /* list contents */ + + doload_fixup(e); + + (void) puts("\n"); + doload_cleanup(e); + return ; + } + + /* main program for testing doload */ + + main(argc, argp) + int argc; + char **argp; + { + int fd; + int gotcha = 0; + + while (--argc > 0) { + if (**++argp == '-') { + switch (*++*argp) { + case 'd': + doload_trace += 1; + break; + default: + fprintf( stderr, + "dolist: Unknown switch -%c ignored\n", **argp); + } + } + else { + gotcha += 1; + fd = open(*argp, O_RDONLY, 0); + if (fd < 0) + fprintf(stderr, "dolist: File %s not found\n", *argp); + else { + (void) printf("Listing of program file %s\n", *argp); + ListIt(fd); + close(fd); + } + } + } + if (gotcha == 0) { + (void) puts("Listing of program file from standard input"); + ListIt(0); + } + return 0 ; + } *** overhead/class/machdep/sco_i386/doload.c Thu May 30 20:40:13 1991 --- overhead/class/machdep/sco_i386/doload.c.NEW Thu Apr 25 16:21:17 1991 *************** *** 0 **** --- 1,683 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + doload.c - dynamic loader for class system + + Author: John H Howard - April 4, 1987 + */ + + #include + #include + #include + #include + + #include /* sys/types.h */ + #include + + char *malloc(); + char *realloc(); + long lseek(); + + int doload_trace=0; /* nonzero if debugging */ + + #include "../common/safe.h" + + /* initialize state */ + + void doload_setup(e, inFD, mode) + struct doload_environment *e; + int inFD; + doload_mode mode; + { + e->mode = mode; + e->fd = inFD; + e->problems = 0; + e->rtab = NULL; + e->symtab = NULL; + e->stringtab = NULL; + e->newsym = NULL; + e->newsymcount = 0; + return; + } + + /* tear down environment */ + + void doload_cleanup(e) + struct doload_environment *e; + { + if (e->problems > 0) { + printf("%d problems found\n", e->problems); + printf("doload: Errors while processing\n"); + /* e->problems = 0; + doload_punt(e, "Errors while processing");*/ + } + safe_free((char *)e->rtab); + safe_free((char *)e->symtab); + safe_free(e->stringtab); + safe_free((char *)e->newsym); + return ; + } + + /* read module into memory */ + + void doload_read(e) + struct doload_environment *e; + { + long stringlen; /* length of string table */ + long csize; /* size of all contents */ + long rcount; /* number of relocation entries */ + long ssize; /* size of symbol table */ + int s; /* section index */ + RELOC *rp; /* relocation table pointer */ + + /* read file header */ + + safe_read(e, (char *)&(e->filehdr), (long)FILHSZ); + if (e->mode == List || doload_trace > 1) { + printf("\nFILE HEADER\n"); + printf(" magic = %x\n", e->filehdr.f_magic); + printf(" nscns = %x\n", e->filehdr.f_nscns); + printf(" timdat= %lx\n", e->filehdr.f_timdat); + printf(" symptr= %lx\n", e->filehdr.f_symptr); + printf(" nsyms = %lx\n", e->filehdr.f_nsyms); + printf(" opthdr= %x\n", e->filehdr.f_opthdr); + printf(" flags = %x\n", e->filehdr.f_flags); + } + if (e->filehdr.f_magic != I386MAGIC + #ifndef M_UNIX + && e->filehdr.f_magic != I386SVMAGIC + #endif + ) + doload_punt(e, "this is not an AIX PS/2 COFF file (bad magic number)"); + + /* read optional header */ + + if (e->filehdr.f_opthdr > 0) { + safe_read(e, (char *)&(e->aouthdr), (long)e->filehdr.f_opthdr); + if (e->mode == List || doload_trace > 1) { + printf("\nAOUT HEADER\n"); + printf(" magic = %x\n", e->aouthdr.magic); + printf(" vstamp= %x\n", e->aouthdr.vstamp); + printf(" tsize = %lx\n", e->aouthdr.tsize); + printf(" dsize = %lx\n", e->aouthdr.dsize); + printf(" bsize = %lx\n", e->aouthdr.bsize); + printf(" entry = %lx\n", e->aouthdr.entry); + printf(" dstart= %lx\n", e->aouthdr.text_start); + printf(" tstart= %lx\n", e->aouthdr.data_start); + } + #ifndef M_UNIX + switch (e->aouthdr.magic) { + case MAG_SHROT: + break; + case MAG_OVERLAY: + case MAG_NSHWRT: + case MAG_SHROTSEP: + case MAG_DPSHROT: + if (e->mode == List) + printf("WARNING: Wrong aouthdr magic number\n"); + else + doload_punt("wrong aouthdr magic number"); + break; + default: + doload_punt(e, "this is not an AIX PS/2 COFF file (wrong aouthdr magic number)"); + } /* endswitch */ + #endif + } + + /* read section headers */ + + if (e->filehdr.f_nscns > DOLOAD_MAXSCN) + doload_punt(e, "too many sections in loader file"); + for (s = 0, csize = 0, rcount = 0; s < e->filehdr.f_nscns; s += 1) { + safe_read(e, (char *)&(e->scn[s]), (long)SCNHSZ); + if (e->mode == List || doload_trace > 1) { + printf("\nSECTION HEADER %d\n", s); + printf(" name = %s\n", e->scn[s].s_name); + printf(" paddr = %lx\n", e->scn[s].s_paddr); + printf(" vaddr = %lx\n", e->scn[s].s_vaddr); + printf(" size = %lx\n", e->scn[s].s_size); + printf(" scnptr= %lx\n", e->scn[s].s_scnptr); + printf(" relptr= %lx\n", e->scn[s].s_relptr); + printf(" nreloc= %x\n", e->scn[s].s_nreloc); + printf(" flags = %lx\n", e->scn[s].s_flags); + } + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + case STYP_BSS: + csize += e->scn[s].s_size; + rcount += e->scn[s].s_nreloc; + break; + case STYP_INFO: + case STYP_REG: + case STYP_DSECT: + break; + default: + printf("***Unknown section type (s_flags = 0x%x)\n", e->scn[s].s_flags & 0xffff); + fflush(stdout); + e->problems += 1; + } + } + + /* read text plus data */ + + e->segptr[0] = safe_malloc(e, csize); + for (s = 0; s < e->filehdr.f_nscns; s += 1) { + + if (s > 0) + e->segptr[s] = e->segptr[s-1] + e->scn[s-1].s_size; + + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + case STYP_BSS: + #if 0 + if ((s == 0 & e->scn[s].s_vaddr != 0) || (s > 0 && e->segptr[s] != e->segptr[s-1] + e->scn[s-1].s_size)) { + printf("***Virtual address for section %d is inconsistent\n", s); + fflush(stdout); + e->problems += 1; + } + #endif + break; + default: + if (s != 0) + e->segptr[s] = e->segptr[s-1]; + } + + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + safe_lseek(e, e->scn[s].s_scnptr, 0); + safe_read(e, e->segptr[s], e->scn[s].s_size); + break; + case STYP_BSS: + bzero(e->segptr[s], e->scn[s].s_size); + break; + } + } + + /* read relocation information */ + + if (rcount > 0) { + rp = e->rtab = (RELOC *)safe_malloc(e, rcount*RELSZ); + for (s = 0; s < e->filehdr.f_nscns; s += 1) { + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + case STYP_BSS: + if (e->scn[s].s_nreloc > 0) { + safe_lseek(e, e->scn[s].s_relptr, 0); + safe_read(e, (char *)rp, (long)(e->scn[s].s_nreloc * RELSZ)); + ((char *)rp) += e->scn[s].s_nreloc * RELSZ; + } + break; + } + } + } + + /* read symbol table */ + + safe_lseek(e, e->filehdr.f_symptr, 0); + ssize = e->filehdr.f_nsyms * SYMESZ; + e->symtab = (SYMENT *)safe_malloc(e, ssize); + safe_read(e, (char *)e->symtab, ssize); + + /* read string table (assumed to come right after symbol table) */ + + if (read(e->fd, (char *)&stringlen, sizeof stringlen) == sizeof stringlen) { + e->stringtab = safe_malloc(e, stringlen); + safe_read( e, e->stringtab + sizeof stringlen, + stringlen - sizeof stringlen); + bcopy((char *)&stringlen, e->stringtab, sizeof stringlen); + } + + } + + /* read and relocate module */ + void *(* doload(inFD, name, bp, lenP, path) )() + /* or NULL if error */ + int inFD; /* open fd for package file */ + char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + /* Path is used by the MACH loader, not this one */ + { + struct doload_environment E; + register struct doload_environment *e; + int s; /* section index */ + + /* set up environment */ + + doload_setup(e = &E, inFD, Load); + if (setjmp(e->errorJump)) { + doload_cleanup(e); + return NULL; + } + + /* read module into memory */ + + doload_read(e); + + /* do relocation */ + + doload_preset(e); + + /* process contents */ + + doload_fixup(e); + + /* all done */ + + if (doload_trace > 0) { + printf( " %s:", name); + for (s = 0; s < e->filehdr.f_nscns; s += 1) + printf(" %.8s = 0x%.8x", e->scn[s].s_name, e->segptr[s]); + printf( " entry = 0x%.8x\n", e->segptr[0] + e->aouthdr.entry - + e->scn[0].s_vaddr); + fflush(stdout); + } + + if (bp!=NULL) + *bp = e->segptr[0]; + if (lenP!=NULL) + *lenP = e->aouthdr.tsize; + + doload_cleanup(e); + + return (void *(*)()) (e->segptr[0] + e->aouthdr.entry - + e->scn[0].s_vaddr); + } + + /* get symbol name */ + + /* CAUTION - returns a pointer to a static */ + + char *doload_getname(register struct doload_environment *e, SYMENT *sp) + { + char *np; + static char shortname[SYMNMLEN+1]; + + if (sp->n_zeroes != 0) { + strncpy(shortname, sp->n_name, sizeof shortname); + shortname[(sizeof shortname) - 1] = '\0'; + np = shortname; + } else if (sp->n_offset > 0) + np = e->stringtab + sp->n_offset; + else + np = "<>"; + return np; + } + + extern struct globaltab { + long entrypoint; /* entry point value */ + char *entryname; /* symbolic name */ + } globals[]; + extern long globalsize; + + /* preset global symbols */ + + /* resolves undefined referenses to known globals in symbol table */ + + doload_preset(e) + register struct doload_environment *e; + { + register SYMENT *sp; + register SYMENT *sbound; + int snum; + char *np; + int naux; + register int i; + long globalcount = globalsize / sizeof(struct globaltab); + + if (e->mode == List || doload_trace > 1) { + printf("\nSYMBOL TABLE\n"); + printf("\n # value section type sclass nx\n"); + } + + sp = sbound = e->symtab; + ((char *)sbound) += e->filehdr.f_nsyms * SYMESZ; + + for (snum = 0; sp < sbound; ((char *)sp) += SYMESZ, snum += 1) { + np = doload_getname(e, sp); + + if (e->mode == List || doload_trace > 1) { + printf("%4d %.8x", snum, sp->n_value); + if (sp->n_scnum > 0 && sp->n_scnum <= e->filehdr.f_nscns) + printf( " %7s", e->scn[sp->n_scnum - 1].s_name); + else if (sp->n_scnum == N_UNDEF) + printf( " N_UNDEF"); + else if (sp->n_scnum == N_DEBUG) + printf( " N_DEBUG"); + else + printf( " %7d", sp->n_scnum ); + printf(" %.4x", sp->n_type); + switch (sp->n_sclass) { + case C_EXT: + printf(" C_EXT"); + break; + case C_STAT: + printf(" C_STAT"); + break; + case C_FILE: + printf(" C_FILE"); + break; + default: + printf(" %6d", sp->n_sclass); + } + printf(" %2d", sp->n_numaux); + printf(" %s\n", np); + fflush(stdout); + } + + if (sp->n_scnum == N_DEBUG || sp->n_sclass != C_EXT || e->mode == List) + ; + + else if (sp->n_scnum == N_UNDEF) { + + /* handle named common allocation */ + if (e->mode == Load && sp->n_value > 0) { + char *addr; + long size; + + size = sp->n_value; + addr = safe_malloc(e, size); + bzero(addr, size); + /* + * We subtract the length from the pointer here + * because the references in the code have the length added. + * Why? I do not know. + */ + sp->n_value = (unsigned long)addr - size; + sp->n_scnum = N_ABS; + } + + /* handle currently undefined symbols */ + if (sp->n_value == 0) { + if (strcmp(np, "etext") == 0) { + if (e->mode == Load) { + sp->n_value = (long)e->segptr[0] + e->aouthdr.tsize; + sp->n_scnum = N_ABS; + } + } + else { + for (i = globalcount; --i >= 0; ) { + if (strcmp(globals[i].entryname, np) == 0) + break; + } + if (i < 0) { + printf("***Undefined symbol: %s\n", np); + fflush(stdout); + e->problems += 1; + } + else if (e->mode == Load) { + sp->n_value = globals[i].entrypoint; + sp->n_scnum = N_ABS; + } + } + } + } /* endif N_UNDEF */ + for (naux = sp->n_numaux; naux > 0; naux--) { + ((char *)sp) += AUXESZ; + snum += 1; + } + } + } + + /* compute relocation adjustment */ + + static long + adjust(e, tw, rp, format) + register struct doload_environment *e; + register long tw; + register RELOC *rp; + char *format; + { + SYMENT *sp; + int s; + register int j; + SYMENT *nsp; + + if (e->mode == List || doload_trace > 1) + printf(" %s", format); + + ((char *)sp) = (char *)e->symtab + rp->r_symndx * SYMESZ; + s = sp->n_scnum; + + switch (s) { + case N_ABS: + if (e->mode == List || doload_trace > 1) + printf( "0x%x+%s(=0x%x)", tw, doload_getname(e, sp), sp->n_value); + tw += sp->n_value; + break; + case N_UNDEF: + if (e->mode == List || doload_trace > 1) { + printf("%s", doload_getname(e, sp)); + if (tw != 0) + printf("+0x%x", tw); + } + if (e->mode == Load) { + printf("***undefined symbol %s\n", doload_getname(e, sp)); + fflush(stdout); + e->problems += 1; + } + break; + default: + if (s > 0 && s <= e->filehdr.f_nscns) { + /*printf("symndx %d, section %s\n",rp->r_symndx, e->scn[s-1].s_name);*/ + if (e->mode == List || doload_trace > 1) { + printf( "0x%x+%s", tw, e->scn[s - 1].s_name); + if (sp->n_value != 0) + printf("(0x%x)", sp->n_value); + } + tw += (long)e->segptr[s - 1] - e->scn[s - 1].s_vaddr; + } + else { + if (e->mode == List || doload_trace > 1) + printf( "0x%x<%d:0x%x>", tw, rp->r_symndx, s); + printf("***symbol type (n_scnum=%d) unknown\n", s); + fflush(stdout); + e->problems += 1; + } + } /* end switch */ + + /* preserve selected entries in the new smaller symbol table */ + + if (e->mode == Fix) { + sp->n_numaux = 0; + for (j = 0, nsp = e->newsym; j < e->newsymcount; j += 1, ((char *)nsp) += SYMESZ) + if (bcmp((char *)sp, (char *)nsp, SYMESZ) == 0) + break; + if (j >= e->newsymcount) { + e->newsymcount += 1; + e->newsym = (SYMENT *)safe_realloc(e, (char *)e->newsym, (long)(e->newsymcount * SYMESZ)); + ((char *)nsp) = (char *)e->newsym + j * SYMESZ; + bcopy(sp, (char *)nsp, SYMESZ); + } + if (doload_trace > 1) + printf(" %d->%d", rp->r_symndx, j); + rp->r_symndx = j; + } + + return tw; + } + + /* relocate one item */ + + static void + relocate(e, cp, rp) + register struct doload_environment *e; + register char *cp; + register RELOC *rp; + { + register long tw; + long pc; + + switch (rp->r_type) { + + case R_ABS: + break; + + case R_DIR16: + tw = *(short *)cp; + tw = adjust(e, tw, rp, "(DIR16)"); + if (e->mode == Load) { + *(short *)cp = tw; + } + break; + + case R_DIR32: + /* + printf("relocating DIR32: cp = %08x, ", cp); + fflush(stdout); + printf("*cp = %08x\n",*((long *)cp)); + */ + + tw = *((long *)cp); + /*printf("adjusting..");fflush(stdout);*/ + tw = adjust(e, tw, rp, "(DIR32)"); + /*printf("now it's %08x.\n",tw);*/ + if (e->mode == Load) + *(long *)cp = tw; + break; + + case R_PCRLONG: + tw = *(long *)cp; + pc = (long)cp + 4; + tw = adjust(e, tw + (pc - (long)e->segptr[0] + e->scn[0].s_vaddr), rp, "(PCRLONG)") - pc; + if (e->mode == Load) + *(long *)cp = tw; + break; + + default: + printf(" ***relocation type (r->type = %x) unknown\n", rp->r_type); + fflush(stdout); + e->problems += 1; + + } + + return; + } + + static void printaddr(e, cp) + register struct doload_environment *e; + register unsigned long cp; + { + printf("\n%.8x ", cp); + return ; + } + + /* format and display data */ + + static char *printdata(e, cp, base, bound) /* returns bound */ + register struct doload_environment *e; + register char *cp; + register char *base; + register char *bound; + { + int k; + + if (cp < bound) { + printaddr(e, (unsigned long)(cp - e->segptr[0])); + for (k = (cp - e->segptr[0]) & 0x0f; k > 0; k--) + printf(" "); + for (;;) { + printf(" %.2x", *cp++); + if (cp >= bound) + break; + if (((cp - e->segptr[0]) & 0x0f) == 0) + printaddr(e, (unsigned long)(cp - e->segptr[0])); + } + } + return bound; + } + + static int relocationbound(e, rp, bound) + register struct doload_environment *e; + register RELOC *rp; + int bound; + { + long result; + #ifdef undef + printf("\nRELOC %x\n", rp); + printf(" r_vaddr = 0x%lx\n", rp->r_vaddr); + printf(" r_symndx = 0x%lx\n", rp->r_symndx); + printf(" r_type = %d\n", rp->r_type); + #endif undef + /*printf("relocationbound(e, rp->r_vaddr=%08x, bound=%08x)\n", + rp->r_vaddr, bound);*/ + + switch (rp->r_type) { + + case R_DIR16: + case R_OPT16: + result = rp->r_vaddr + 2; + break; + + case R_DIR32: + case R_PCRLONG: + default: + result = rp->r_vaddr + 4; + } + + if (result > bound) { + printf("\nrelocation address 0x%x out of range 0x%x!\n", result, bound); + result = bound; + } + return result; + } + + static void fixsegment(e, n, base, sp, rpp) + register struct doload_environment *e; + register unsigned long n; /* number of relocation items */ + register char *base; + SCNHDR *sp; + RELOC **rpp; + { + register RELOC *rp = *rpp; + char *cp; + + for (cp = base; n > 0; n--, ((char *)rp) += RELSZ) { + /* + printf("\nn=%04d ",n); + printf("printdata(%08x, %08x, %08x, %08x)\n", + e,cp,base,(base+relocationbound(e,rp,(base+sp->s_size))-sp->s_vaddr)); + */ + if (e->mode == List || doload_trace > 1) + cp = printdata(e, cp, base, (char *)(base + relocationbound(e, rp, (int)(base + sp->s_size))- sp->s_vaddr)); + /*printf("relocate in base %08x: ",base);*/ + relocate(e, base + rp->r_vaddr - sp->s_vaddr, rp); + } + if (e->mode == List || doload_trace > 1) { + cp = printdata(e, cp, base, base + sp->s_size); + fflush(stdout); + } + + *rpp = rp; + return ; + } + + /* fix up loaded text */ + + doload_fixup(e) + register struct doload_environment *e; + { + RELOC *rp; + int s; + + for (s = 0, rp = e->rtab; s < e->filehdr.f_nscns; s += 1) { + + if (e->mode == List || doload_trace > 1) + printf("\n\n%s SEGMENT %d\n", e->scn[s].s_name, s); + + switch(e->scn[s].s_flags & 0xffff) { + case STYP_TEXT: + case STYP_DATA: + case STYP_BSS: + fixsegment(e, (unsigned long)e->scn[s].s_nreloc, e->segptr[s], &e->scn[s], &rp); + break; + } + } + } *** overhead/class/machdep/sco_i386/doload.h Thu May 30 20:40:24 1991 --- overhead/class/machdep/sco_i386/doload.h.NEW Thu Apr 25 16:21:18 1991 *************** *** 0 **** --- 1,44 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + doload.h - environment for dynamic loader + + Author: John H Howard - April 9, 1987 + */ + + + + /* here is the state during a load */ + + typedef enum doload_mode_enum { + Load, /* .. loading .do file */ + List, /* .. listing .do or .o file */ + Fix /* .. converting .o to .do file */ + } doload_mode; + + #define DOLOAD_MAXSCN 8 /* max number of sections */ + + struct doload_environment { + doload_mode mode; /* operating mode */ + int fd; /* input file descriptor */ + jmp_buf errorJump; /* error exit */ + int problems; /* count of problems encountered */ + FILHDR filehdr; /* COFF file header */ + AOUTHDR aouthdr; /* auxiliary header */ + SCNHDR scn[DOLOAD_MAXSCN]; /* section headers */ + char *segptr[DOLOAD_MAXSCN];/* segment address */ + RELOC *rtab; /* relocation table */ + SYMENT *symtab; /* symbol table */ + char *stringtab; /* string table */ + SYMENT *newsym; /* replacement symbol table */ + int newsymcount; /* number of new symbols */ + }; + + + extern int doload_trace; + + #define doload_extension ".do" + + extern void *(*doload() )(); *** overhead/class/machdep/sco_i386/entry.spp Thu May 30 20:40:34 1991 --- overhead/class/machdep/sco_i386/entry.spp.NEW Thu Apr 25 16:21:20 1991 *************** *** 0 **** --- 1,853 ---- + /* + * + * ****** + * + * PLEASE NOTE: + * + * This file is designed to be run through the C preprocessor before + * being passed to the assembler. + * + * ***** + * + * This is the code that breaks a link to ClassEntry routines + * and sets it to the set of routines given by the information + * pointed to by the first parameter. That structure contains the + * information needed to locate a module and verify that the module + * is the correct version along with some other infomation about the + * module. + * + * Each ClassEntry routine must provide a way to get an index indicating + * which entry was called. On the RT this is done by placing the index in + * the static data block that is passed to the procedure in R0. For other + * machines this would be done by having each entry point set a register + * to the index and then branching to the main body of this code. + * + * The main body of the code then does the following: + * -- Calls the class_Lookup procedure passing in the structure + * pointed to by the first parameter. + * -- class_Lookup returns the base address of the procedure table + * for the module. + * -- Use the index provided by the ClassEntry to look up the routine. + * -- Reset the stack to the state it was in before the call to this code. + * -- Make any adjustments to the stack, registers, etc. to make the + * called routine think that it was called directly. + * -- Branch (NOT a subroutine jump) to the real routine. This may be + * done differently for some new machine. + * + * NOTE1: There are currently 150 entry points. This was an arbitrary choice + * and can be changed as appropriate. If it is changed, definitions + * in class.h must also be changed. + */ + + /* + * Data section. Only used here to get access to class_ErrorReturnValue. + */ + .data + .globl class_ErrorReturnValue /* external used to get class_Lookup status */ + + + /* + * All the entry points come to this label. When they get + * here the stack is intact and EAX contains the index. + */ + .text + .globl class_Lookup /* used to dynamically load and bind code */ + L000: + + /* + * While in this routine (after the first few instructions) the stack + * looks like this: + * + * EBP + 0x28 parm... <-- EBP points here at entry time + * EBP + 0x24 parm4 + * EBP + 0x20 parm3 + * EBP + 0x1C parm2 + * EBP + 0x08 parm1 (pointer to header) + * EBP + 0x04 return address + * EBP + 0x00 saved EBP <-- EBP during execution + * EBP - 0x04 passed parm (passed index) + * EBP - 0x08 passed parm (pointer to header) + * + */ + + /* start of code...set up stack, etc. */ + pushl %ebp + movl %esp, %ebp + + /* set up registers and call to class_Lookup */ + pushl %eax /* index */ + pushl 0x08(%ebp) /* pointer to header */ + call class_Lookup + + /* back from class_Lookup */ + cmpl $0, %eax /* lookup failed? */ + je ErrorExit /* yes, return class_ErrorReturnValue */ + /* no, jump to the proper class routine */ + + /* non-zero value from class_Lookup is base of proc table */ + movl -0x04(%ebp), %edx /* get back index */ + movl (%eax, %edx, 4), %eax /* get routine address in %eax using the funky addr modes */ + leave /* fix up stack */ + jmp *%eax /* jump to the routine */ + + ErrorExit: + /* return the value in class_ErrorReturnValue */ + movl class_ErrorReturnValue, %eax /* get return value in correct place */ + leave /* restore stack */ + ret /* and return to caller */ + + + /* + * and now come the entry points. + */ + .globl ClassEntry0 + ClassEntry0: + movl $0, %eax + jmp L000 + + .globl ClassEntry1 + ClassEntry1: + movl $1, %eax + jmp L000 + + .globl ClassEntry2 + ClassEntry2: + movl $2, %eax + jmp L000 + + .globl ClassEntry3 + ClassEntry3: + movl $3, %eax + jmp L000 + + .globl ClassEntry4 + ClassEntry4: + movl $4, %eax + jmp L000 + + .globl ClassEntry5 + ClassEntry5: + movl $5, %eax + jmp L000 + + .globl ClassEntry6 + ClassEntry6: + movl $6, %eax + jmp L000 + + .globl ClassEntry7 + ClassEntry7: + movl $7, %eax + jmp L000 + + .globl ClassEntry8 + ClassEntry8: + movl $8, %eax + jmp L000 + + .globl ClassEntry9 + ClassEntry9: + movl $9, %eax + jmp L000 + + .globl ClassEntry10 + ClassEntry10: + movl $10, %eax + jmp L000 + + .globl ClassEntry11 + ClassEntry11: + movl $11, %eax + jmp L000 + + .globl ClassEntry12 + ClassEntry12: + movl $12, %eax + jmp L000 + + .globl ClassEntry13 + ClassEntry13: + movl $13, %eax + jmp L000 + + .globl ClassEntry14 + ClassEntry14: + movl $14, %eax + jmp L000 + + .globl ClassEntry15 + ClassEntry15: + movl $15, %eax + jmp L000 + + .globl ClassEntry16 + ClassEntry16: + movl $16, %eax + jmp L000 + + .globl ClassEntry17 + ClassEntry17: + movl $17, %eax + jmp L000 + + .globl ClassEntry18 + ClassEntry18: + movl $18, %eax + jmp L000 + + .globl ClassEntry19 + ClassEntry19: + movl $19, %eax + jmp L000 + + .globl ClassEntry20 + ClassEntry20: + movl $20, %eax + jmp L000 + + .globl ClassEntry21 + ClassEntry21: + movl $21, %eax + jmp L000 + + .globl ClassEntry22 + ClassEntry22: + movl $22, %eax + jmp L000 + + .globl ClassEntry23 + ClassEntry23: + movl $23, %eax + jmp L000 + + .globl ClassEntry24 + ClassEntry24: + movl $24, %eax + jmp L000 + + .globl ClassEntry25 + ClassEntry25: + movl $25, %eax + jmp L000 + + .globl ClassEntry26 + ClassEntry26: + movl $26, %eax + jmp L000 + + .globl ClassEntry27 + ClassEntry27: + movl $27, %eax + jmp L000 + + .globl ClassEntry28 + ClassEntry28: + movl $28, %eax + jmp L000 + + .globl ClassEntry29 + ClassEntry29: + movl $29, %eax + jmp L000 + + .globl ClassEntry30 + ClassEntry30: + movl $30, %eax + jmp L000 + + .globl ClassEntry31 + ClassEntry31: + movl $31, %eax + jmp L000 + + .globl ClassEntry32 + ClassEntry32: + movl $32, %eax + jmp L000 + + .globl ClassEntry33 + ClassEntry33: + movl $33, %eax + jmp L000 + + .globl ClassEntry34 + ClassEntry34: + movl $34, %eax + jmp L000 + + .globl ClassEntry35 + ClassEntry35: + movl $35, %eax + jmp L000 + + .globl ClassEntry36 + ClassEntry36: + movl $36, %eax + jmp L000 + + .globl ClassEntry37 + ClassEntry37: + movl $37, %eax + jmp L000 + + .globl ClassEntry38 + ClassEntry38: + movl $38, %eax + jmp L000 + + .globl ClassEntry39 + ClassEntry39: + movl $39, %eax + jmp L000 + + .globl ClassEntry40 + ClassEntry40: + movl $40, %eax + jmp L000 + + .globl ClassEntry41 + ClassEntry41: + movl $41, %eax + jmp L000 + + .globl ClassEntry42 + ClassEntry42: + movl $42, %eax + jmp L000 + + .globl ClassEntry43 + ClassEntry43: + movl $43, %eax + jmp L000 + + .globl ClassEntry44 + ClassEntry44: + movl $44, %eax + jmp L000 + + .globl ClassEntry45 + ClassEntry45: + movl $45, %eax + jmp L000 + + .globl ClassEntry46 + ClassEntry46: + movl $46, %eax + jmp L000 + + .globl ClassEntry47 + ClassEntry47: + movl $47, %eax + jmp L000 + + .globl ClassEntry48 + ClassEntry48: + movl $48, %eax + jmp L000 + + .globl ClassEntry49 + ClassEntry49: + movl $49, %eax + jmp L000 + + .globl ClassEntry50 + ClassEntry50: + movl $50, %eax + jmp L000 + + .globl ClassEntry51 + ClassEntry51: + movl $51, %eax + jmp L000 + + .globl ClassEntry52 + ClassEntry52: + movl $52, %eax + jmp L000 + + .globl ClassEntry53 + ClassEntry53: + movl $53, %eax + jmp L000 + + .globl ClassEntry54 + ClassEntry54: + movl $54, %eax + jmp L000 + + .globl ClassEntry55 + ClassEntry55: + movl $55, %eax + jmp L000 + + .globl ClassEntry56 + ClassEntry56: + movl $56, %eax + jmp L000 + + .globl ClassEntry57 + ClassEntry57: + movl $57, %eax + jmp L000 + + .globl ClassEntry58 + ClassEntry58: + movl $58, %eax + jmp L000 + + .globl ClassEntry59 + ClassEntry59: + movl $59, %eax + jmp L000 + + .globl ClassEntry60 + ClassEntry60: + movl $60, %eax + jmp L000 + + .globl ClassEntry61 + ClassEntry61: + movl $61, %eax + jmp L000 + + .globl ClassEntry62 + ClassEntry62: + movl $62, %eax + jmp L000 + + .globl ClassEntry63 + ClassEntry63: + movl $63, %eax + jmp L000 + + .globl ClassEntry64 + ClassEntry64: + movl $64, %eax + jmp L000 + + .globl ClassEntry65 + ClassEntry65: + movl $65, %eax + jmp L000 + + .globl ClassEntry66 + ClassEntry66: + movl $66, %eax + jmp L000 + + .globl ClassEntry67 + ClassEntry67: + movl $67, %eax + jmp L000 + + .globl ClassEntry68 + ClassEntry68: + movl $68, %eax + jmp L000 + + .globl ClassEntry69 + ClassEntry69: + movl $69, %eax + jmp L000 + + .globl ClassEntry70 + ClassEntry70: + movl $70, %eax + jmp L000 + + .globl ClassEntry71 + ClassEntry71: + movl $71, %eax + jmp L000 + + .globl ClassEntry72 + ClassEntry72: + movl $72, %eax + jmp L000 + + .globl ClassEntry73 + ClassEntry73: + movl $73, %eax + jmp L000 + + .globl ClassEntry74 + ClassEntry74: + movl $74, %eax + jmp L000 + + .globl ClassEntry75 + ClassEntry75: + movl $75, %eax + jmp L000 + + .globl ClassEntry76 + ClassEntry76: + movl $76, %eax + jmp L000 + + .globl ClassEntry77 + ClassEntry77: + movl $77, %eax + jmp L000 + + .globl ClassEntry78 + ClassEntry78: + movl $78, %eax + jmp L000 + + .globl ClassEntry79 + ClassEntry79: + movl $79, %eax + jmp L000 + + .globl ClassEntry80 + ClassEntry80: + movl $80, %eax + jmp L000 + + .globl ClassEntry81 + ClassEntry81: + movl $81, %eax + jmp L000 + + .globl ClassEntry82 + ClassEntry82: + movl $82, %eax + jmp L000 + + .globl ClassEntry83 + ClassEntry83: + movl $83, %eax + jmp L000 + + .globl ClassEntry84 + ClassEntry84: + movl $84, %eax + jmp L000 + + .globl ClassEntry85 + ClassEntry85: + movl $85, %eax + jmp L000 + + .globl ClassEntry86 + ClassEntry86: + movl $86, %eax + jmp L000 + + .globl ClassEntry87 + ClassEntry87: + movl $87, %eax + jmp L000 + + .globl ClassEntry88 + ClassEntry88: + movl $88, %eax + jmp L000 + + .globl ClassEntry89 + ClassEntry89: + movl $89, %eax + jmp L000 + + .globl ClassEntry90 + ClassEntry90: + movl $90, %eax + jmp L000 + + .globl ClassEntry91 + ClassEntry91: + movl $91, %eax + jmp L000 + + .globl ClassEntry92 + ClassEntry92: + movl $92, %eax + jmp L000 + + .globl ClassEntry93 + ClassEntry93: + movl $93, %eax + jmp L000 + + .globl ClassEntry94 + ClassEntry94: + movl $94, %eax + jmp L000 + + .globl ClassEntry95 + ClassEntry95: + movl $95, %eax + jmp L000 + + .globl ClassEntry96 + ClassEntry96: + movl $96, %eax + jmp L000 + + .globl ClassEntry97 + ClassEntry97: + movl $97, %eax + jmp L000 + + .globl ClassEntry98 + ClassEntry98: + movl $98, %eax + jmp L000 + + .globl ClassEntry99 + ClassEntry99: + movl $99, %eax + jmp L000 + + .globl ClassEntry100 + ClassEntry100: + movl $100, %eax + jmp L000 + + .globl ClassEntry101 + ClassEntry101: + movl $101, %eax + jmp L000 + + .globl ClassEntry102 + ClassEntry102: + movl $102, %eax + jmp L000 + + .globl ClassEntry103 + ClassEntry103: + movl $103, %eax + jmp L000 + + .globl ClassEntry104 + ClassEntry104: + movl $104, %eax + jmp L000 + + .globl ClassEntry105 + ClassEntry105: + movl $105, %eax + jmp L000 + + .globl ClassEntry106 + ClassEntry106: + movl $106, %eax + jmp L000 + + .globl ClassEntry107 + ClassEntry107: + movl $107, %eax + jmp L000 + + .globl ClassEntry108 + ClassEntry108: + movl $108, %eax + jmp L000 + + .globl ClassEntry109 + ClassEntry109: + movl $109, %eax + jmp L000 + + .globl ClassEntry110 + ClassEntry110: + movl $110, %eax + jmp L000 + + .globl ClassEntry111 + ClassEntry111: + movl $111, %eax + jmp L000 + + .globl ClassEntry112 + ClassEntry112: + movl $112, %eax + jmp L000 + + .globl ClassEntry113 + ClassEntry113: + movl $113, %eax + jmp L000 + + .globl ClassEntry114 + ClassEntry114: + movl $114, %eax + jmp L000 + + .globl ClassEntry115 + ClassEntry115: + movl $115, %eax + jmp L000 + + .globl ClassEntry116 + ClassEntry116: + movl $116, %eax + jmp L000 + + .globl ClassEntry117 + ClassEntry117: + movl $117, %eax + jmp L000 + + .globl ClassEntry118 + ClassEntry118: + movl $118, %eax + jmp L000 + + .globl ClassEntry119 + ClassEntry119: + movl $119, %eax + jmp L000 + + .globl ClassEntry120 + ClassEntry120: + movl $120, %eax + jmp L000 + + .globl ClassEntry121 + ClassEntry121: + movl $121, %eax + jmp L000 + + .globl ClassEntry122 + ClassEntry122: + movl $122, %eax + jmp L000 + + .globl ClassEntry123 + ClassEntry123: + movl $123, %eax + jmp L000 + + .globl ClassEntry124 + ClassEntry124: + movl $124, %eax + jmp L000 + + .globl ClassEntry125 + ClassEntry125: + movl $125, %eax + jmp L000 + + .globl ClassEntry126 + ClassEntry126: + movl $126, %eax + jmp L000 + + .globl ClassEntry127 + ClassEntry127: + movl $127, %eax + jmp L000 + + .globl ClassEntry128 + ClassEntry128: + movl $128, %eax + jmp L000 + + .globl ClassEntry129 + ClassEntry129: + movl $129, %eax + jmp L000 + + .globl ClassEntry130 + ClassEntry130: + movl $130, %eax + jmp L000 + + .globl ClassEntry131 + ClassEntry131: + movl $131, %eax + jmp L000 + + .globl ClassEntry132 + ClassEntry132: + movl $132, %eax + jmp L000 + + .globl ClassEntry133 + ClassEntry133: + movl $133, %eax + jmp L000 + + .globl ClassEntry134 + ClassEntry134: + movl $134, %eax + jmp L000 + + .globl ClassEntry135 + ClassEntry135: + movl $135, %eax + jmp L000 + + .globl ClassEntry136 + ClassEntry136: + movl $136, %eax + jmp L000 + + .globl ClassEntry137 + ClassEntry137: + movl $137, %eax + jmp L000 + + .globl ClassEntry138 + ClassEntry138: + movl $138, %eax + jmp L000 + + .globl ClassEntry139 + ClassEntry139: + movl $139, %eax + jmp L000 + + .globl ClassEntry140 + ClassEntry140: + movl $140, %eax + jmp L000 + + .globl ClassEntry141 + ClassEntry141: + movl $141, %eax + jmp L000 + + .globl ClassEntry142 + ClassEntry142: + movl $142, %eax + jmp L000 + + .globl ClassEntry143 + ClassEntry143: + movl $143, %eax + jmp L000 + + .globl ClassEntry144 + ClassEntry144: + movl $144, %eax + jmp L000 + + .globl ClassEntry145 + ClassEntry145: + movl $145, %eax + jmp L000 + + .globl ClassEntry146 + ClassEntry146: + movl $146, %eax + jmp L000 + + .globl ClassEntry147 + ClassEntry147: + movl $147, %eax + jmp L000 + + .globl ClassEntry148 + ClassEntry148: + movl $148, %eax + jmp L000 + + .globl ClassEntry149 + ClassEntry149: + movl $149, %eax + jmp L000 + + *** overhead/class/machdep/sco_i386/getlist.awk Thu May 30 20:40:46 1991 --- overhead/class/machdep/sco_i386/getlist.awk.NEW Thu Apr 25 16:21:21 1991 *************** *** 0 **** --- 1,147 ---- + # awk script to list all modules and entry points from a library which are + # needed (via transitive closure) for a given list of basic entry points + + # AIX version + + # the input to this awk script should be generated by: nm -go /lib/libc.a | tr "|" " " + + # data structures used here: + # + # definer[entry-point-name] = module-name + # epcount = # entry-point-name's seen so far + # ep[k] = k'th entry-point-name + # refcount[entry-point-name] = number of references by wanted modules + # referrer[entry-point-name.k] = k'th module-name with an undefined reference to this entry-point-name + # want[module-name] = "Y" if this module wanted + + # search output of nm and set up definers and referrers + + $1 == "Symbols" { + split($3, NameArray,"["); + split(NameArray[2], FileName, "]"); + ObjName = FileName[1]; + }; + + + ($3 == "extern") { + if ($4 == ".text" || $4 == ".data" || $4 == ".bss") { + if (definer[$1] == "") { + definer[ep[epcount++] = $1] = ObjName; + } + } + else { + referrer[$1 "." refcount[$1]++] = ObjName; + } + } + + # postprocessing + + END { + + + # Specify which entry points we definitely want. Edit this list to add entry points. + + want[definer["ProgramName"]] = "Y"; + want[definer["environ"]] = "Y"; + want[definer["_exit"]] = "Y"; + want[definer["abort"]] = "Y"; + want[definer["alloca"]] = "Y"; + want[definer["blt"]] = "Y"; + want[definer["bcopy"]] = "Y"; + want[definer["brk"]] = "Y"; + want[definer["bzero"]] = "Y"; + want[definer["calloc"]] = "Y"; + want[definer["cfree"]] = "Y"; + want[definer["errno"]] = "Y"; + want[definer["close"]] = "Y"; + want[definer["errno"]] = "Y"; + want[definer["creat"]] = "Y"; + want[definer["_ctype_"]] = "Y"; + want[definer["_doprnt"]] = "Y"; + want[definer["ecvt"]] = "Y"; + want[definer["fcvt"]] = "Y"; + want[definer["sys_errlist"]] = "Y"; + want[definer["sys_nerr"]] = "Y"; + want[definer["exit"]] = "Y"; + want[definer["fcntl"]] = "Y"; + want[definer["_filbuf"]] = "Y"; + want[definer["_iob"]] = "Y"; + want[definer["_cleanup"]] = "Y"; + want[definer["_flsbuf"]] = "Y"; + want[definer["fclose"]] = "Y"; + want[definer["fflush"]] = "Y"; + want[definer["fopen"]] = "Y"; + want[definer["fprintf"]] = "Y"; + want[definer["fread"]] = "Y"; + want[definer["fstat"]] = "Y"; + want[definer["fwrite"]] = "Y"; + want[definer["gcvt"]] = "Y"; + want[definer["getdtablesize"]] = "Y"; + want[definer["getpagesize"]] = "Y"; + want[definer["ioctl"]] = "Y"; + want[definer["isatty"]] = "Y"; + want[definer["lseek"]] = "Y"; + want[definer["malloc"]] = "Y"; + want[definer["modf"]] = "Y"; + want[definer["realloc"]] = "Y"; + want[definer["free"]] = "Y"; + want[definer["open"]] = "Y"; + want[definer["perror"]] = "Y"; + want[definer["printf"]] = "Y"; + want[definer["read"]] = "Y"; + want[definer["sbrk"]] = "Y"; + want[definer["curbrk"]] = "Y"; + want[definer["sigvec"]] = "Y"; + want[definer["sprintf"]] = "Y"; + want[definer["strlen"]] = "Y"; + want[definer["syscall"]] = "Y"; + want[definer["write"]] = "Y"; + want[definer["writev"]] = "Y"; + want[definer["ctype"]] = "Y"; + want[definer["doprnt"]] = "Y"; + want[definer["fltused"]] = "Y"; + want[definer["lastbuf"]] = "Y"; + want[definer["fac"]] = "Y"; + want[definer["ltostr"]] = "Y"; + want[definer["do_exit_funcs"]] = "Y"; + want[definer["bigpow"]] = "Y"; + want[definer["start"]] = "Y"; + want[definer["lct_numeric"]] = "Y"; + want[definer["cerror"]] = "Y"; + want[definer["bufsync"]] = "Y"; + want[definer["litpow"]] = "Y"; + want[definer["cleanup"]] = "Y"; + want[definer["iob"]] = "Y"; + want[definer["bufendtab"]] = "Y"; + want[definer["xflsbuf"]] = "Y"; + want[definer["allocs"]] = "Y"; + want[definer["findbuf"]] = "Y"; + want[definer["dtop"]] = "Y"; + want[definer["wrtchk"]] = "Y"; + want[definer["filbuf"]] = "Y"; + want[definer["findiop"]] = "Y"; + want[definer["flsbuf"]] = "Y"; + + # now take transitive closure of wanted modules + + for (needmore = "Y"; needmore == "Y"; needmore = "N") { + for ( i = 0; i < epcount; i++) { + if (want[definer[ep[i]]] != "Y") { + want[definer[ep[i]]] = "N"; + for ( j = 0; j < refcount[ep[i]]; j++ ) { + if (want[referrer[ep[i] "." j]] == "Y") { + want[definer[ep[i]]] = "Y"; + needmore = "Y"; + break; + } + } + } + } + } + + # write out all wanted module name and entry points + + for ( i = 0 ; i < epcount ; i++) + if (want[definer[ep[i]]] == "Y") + printf "%s %s\n", definer[ep[i]], ep[i]; + } *** overhead/class/machdep/sco_i386/globals.spp Thu May 30 20:40:57 1991 --- overhead/class/machdep/sco_i386/globals.spp.NEW Thu Apr 25 16:21:22 1991 *************** *** 0 **** --- 1,66 ---- + /* + * array of global entry points for dynamic loader + * + * Defines a table of entry points and their names + * + */ + + .text + + /* macros which actually define entry points */ + + /* globalref - direct reference to global symbol x */ + #if defined(__STDC__) + #define globalref(x) .globl x ; .text ; .long x , grfl___ ##x; .data ;grfl___ ##x: .string #x + #else + #define globalref(x) .globl x ; .text ; .long x , grfl___/**/x; .data; grfl___/**/x: .string "x" + #endif + + /* routine - reference to routine x */ + + #define routine(x) globalref(x); + + .globl globals + .globl globalsize + + globals: /* beginning of entry point table */ + + .data + /* compensate for assembler bug */ + .text + + /* from libclass */ + + globalref(class_RoutineStruct) + globalref(class_Error) + routine(class_NewObject) + routine(class_Load) + routine(class_IsLoaded) + routine(class_Lookup) + routine(class_IsType) + routine(class_IsTypeByName) + routine(class_EnterInfo) + routine(class_SetClassPath) + routine(class_PrependClassPath) + routine(class_GetEText) + routine(class_GetTextBase) + routine(class_GetTextLength) + + /* common symbols referred to but not defined directly in libc.a */ + + /* globalref(environ) /* common symbol, defined nowhere */ + /* globalref(errno) /* cerror */ + + /* do not delete the following line - make depends on it */ + + #include + + .text + + globalsize: + .long globalsize-globals + + /* special cases for missing entry points under various machine types */ + + + /* end of globals.s */ *** overhead/class/machdep/sco_i386/makedo.csh Thu Jun 6 17:22:32 1991 --- overhead/class/machdep/sco_i386/makedo.csh Thu Jun 6 17:23:58 1991 *************** *** 0 **** --- 1,91 ---- + #!/bin/csh -f + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ($#argv == 0) then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, doindex" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -e overrides the default entry point" + echo " -g causes .dog file to be generated for debugger use" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + if ($?entrypointcoming) then + set entrypoint=$file + unset entrypointcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -e: + set entrypointcoming + breaksw + case -g: + set gflag + breaksw + default: + if (! $?outfile) set outfile=$file + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if ($?entrypointcoming) then + echo "makedo: missing argument to -e switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + if (! $?entrypoint) then + set entrypoint=${outfile:r}__GetClassInfo + endif + ld -r -o ${outfile:r}.dog $filelist ${libdir}/libcx.a | egrep "ld:" + ${bindir}/dofix -e $entrypoint ${outfile:r}.dog + set retcode=$status + if (! $?gflag) rm ${outfile:r}.dog + if (! $retcode) then + ${bindir}/doindex ${outfile:r}.do + set retcode=$status + else + rm ${outfile:r}.do + endif + exit($retcode) *** overhead/class/machdep/sun_68k/Imakefile Thu Jan 10 14:57:21 1991 --- overhead/class/machdep/sun_68k/Imakefile.NEW Fri Feb 1 15:14:03 1991 *************** *** 18,29 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = ! #endif all:: globals.o entry.o doload.o --- 18,29 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; ! #endif /* RESOLVER_ENV */ all:: globals.o entry.o doload.o *************** *** 33,42 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) $(GETLIST) $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f $(GETLIST) >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 33,42 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} $(GETLIST) $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a ${GNULIB} /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f $(GETLIST) >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 44,49 **** --- 44,53 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 50,65 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new ! cd new; \ ! $(RESOLVER_CMD) \ ! $(CP) /lib/libc.a ,libcx.a; \ ! $(CHMODW) ,libcx.a; \ ar q ,libcx.a *.o /lib/crt0.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 54,70 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new ! cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ ! $(CP) /lib/libc.a ,libcx.a ; $(ARCHIVE_COM) \ ! $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o /lib/crt0.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/sun_68k/getlafs.awk Thu Jan 10 14:57:23 1991 --- overhead/class/machdep/sun_68k/getlafs.awk.NEW Fri Feb 1 14:25:09 1991 *************** *** 105,110 **** --- 105,112 ---- want[library["_gethostbyname"] "." definer["_gethostbyname"]] = "Y"; want[library["_gethostbyaddr"] "." definer["_gethostbyaddr"]] = "Y"; want[library["_sethostent"] "." definer["_sethostent"]] = "Y"; + if (definer["_gethostbyname"] != "gethostnamadr.o" ) + want[library["_gethostent"] "." definer["_gethostent"]] = "Y"; want[library["_res_querydomain"] "." definer["_res_querydomain"]] = "Y"; want[library["_res_mkquery"] "." definer["_res_mkquery"]] = "Y"; want[library["_res_send"] "." definer["_res_send"]] = "Y"; *************** *** 143,149 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 145,152 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/sun_68k/getlist.awk Thu Jan 10 14:57:24 1991 --- overhead/class/machdep/sun_68k/getlist.awk.NEW Fri Feb 1 14:25:10 1991 *************** *** 106,111 **** --- 106,113 ---- want[library["_gethostbyname"] "." definer["_gethostbyname"]] = "Y"; want[library["_gethostbyaddr"] "." definer["_gethostbyaddr"]] = "Y"; want[library["_sethostent"] "." definer["_sethostent"]] = "Y"; + if (definer["_gethostbyname"] != "gethostnamadr.o" ) + want[library["_gethostent"] "." definer["_gethostent"]] = "Y"; want[library["_res_querydomain"] "." definer["_res_querydomain"]] = "Y"; want[library["_res_mkquery"] "." definer["_res_mkquery"]] = "Y"; want[library["_res_send"] "." definer["_res_send"]] = "Y"; *************** *** 153,159 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 155,162 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/sun_68k_41/Imakefile Thu May 30 20:41:48 1991 --- overhead/class/machdep/sun_68k_41/Imakefile.NEW Thu Mar 21 14:33:25 1991 *************** *** 0 **** --- 1,21 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DependTarget() + + NormalObjectRule() + + .spp.o: + -$(RM) $@ ,$*.s ,$*.c + $(CP) $*.spp ,$*.c + $(CC) -E -I. $(LOCALINCLUDES) $(CFLAGS) ,$*.c > ,$*.s + $(AS) -k -o $*.o ,$*.s + $(RM) ,$*.c ,$*.s + + all:: globals.o entry.o doload.o + + InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + + globals.c: + touch globals.c *** overhead/class/machdep/sun_68k_41/doload.c Thu May 30 20:41:59 1991 --- overhead/class/machdep/sun_68k_41/doload.c.NEW Thu Mar 21 14:33:26 1991 *************** *** 0 **** --- 1,138 ---- + /* + Replacement for doload.c for the SunOS 4.1/S5R4 dynamic loader. + */ + + #include + #include + #include + + /* + * SunOS 4.1 doesn't have any #defines for the second argument to + * "dlopen()"; it just says "it has to be 1". S5R4 has defines for + * RTLD_LAZY, which makes it act the way SunOS 4.1 works, and RTLD_NOW, + * which makes it bind symbols at "dlopen()" time. Thus, we define + * RTLD_LAZY as 1 (which is what it's defined as in S5R4) if it's not + * defined (as is the case in SunOS 4.1). + */ + #ifndef RTLD_LAZY + #define RTLD_LAZY 1 + #endif + + /* This should be removed, but the machine independent code declares + * doload_Extension external expecting it to be defined in the machdep + * code. I suppose one might want to set this to something other than ".do" + * (like ".so") to conform to the SunOS 4.x/S5R4 convention but for now + * we will do it the way it has always been done. + */ + char doload_extension[] = ".do"; + + int doload_trace=0; /* nonzero if debugging */ + + /* doload: Load a dynamic object. + * + * Basically, this just calls the dynamic loader and relies on the + * system to do the right thing. + */ + char *doload(inFD, name, bp, lenP, path) /* return pointer to entry point, */ + /* or NULL if error */ + /* UNUSED */ int inFD; /* open fd for package file. */ + char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + { + char *dummy; + void *handle; + char *EntryPoint = NULL; + char epname[1024]; /* XXX - allocate dynamically? */ + register char *p; + + /* Doindex is going to free the memory associated with a dynamic object + * before loading another dynamic object to prevent memory bloat. + * + * Therefore this routine fakes something for doindex to free. Of course + * the correct way to do this is to add a routine to the doload interface to + * unload a dynamic object. (See the commented out doload_unload below.) + * If doindex and all the doload files for other machines are ever fixed, + * this code can be eliminated. + * + * Note that the loss of correct bp and len info is not to big a deal since + * it is mostly just used for debugging; SunOS 4.1 doesn't do this very + * well, but hopefully either S5R4 does it reasonably or will do so in the + * future. + */ + dummy = (char *) malloc(1); + if (dummy == NULL) + return NULL; + *bp = dummy; + *lenP = 1; + + /* + * We assume class_Error and class_RoutineStruct are in the + * dynamic-loading symbol table of the executable. + */ + + /* + * Load package + */ + handle = dlopen(path, RTLD_LAZY); + if ( handle == NULL ) + { + fprintf( stderr, "doload: Error loading package \"%s\" - %s\n", path, dlerror() ); + return NULL; + } + + /* + * Construct name of GetClassInfo symbol from the package name + * by stripping off the suffix and appending "__GetClassInfo". + * You can't get the entry point value from a shareable object + * from the "dl*()" routines, which is why we have to do this + * stuff. + * We strip off the suffix because "doindex", curse its soul, + * hands us the last component of the name of the *file* as + * the package name, suffix and all. + */ + (void) strcpy(epname, name); + p = strrchr(epname, '.'); + if (p == NULL) + p = epname + strlen(epname); + (void) strcpy(p, "__GetClassInfo"); + + /* + * Return entry point + */ + EntryPoint = (char *)dlsym( handle, epname ); + if ( EntryPoint == NULL ) + { + fprintf( stderr, "doload: Error finding entry point of package \"%s\" - %s\n", path, dlerror() ); + return NULL; + } + if ( doload_trace ) + printf(" %s: entry = 0x%.8x\n", name, EntryPoint); + + return( EntryPoint ); + } + + #if 0 + /* doload_free: Free the resources associated with a dynamically loaded */ + * object. + * The programmer is responsible for making sure that no pointers into the + * storage associated with the dynamic object are held. On most systems, + * this routine will simply do a "free(base);". This routine is provided + * for doindex to call. It cannot safely be used in most situations. + * + * If nobody actually uses "base" for anything other than handing it to + * "doload_free()", "doload()" should be changed to pass the handle gotten + * from "dlopen()" back as the base, since "dlclose()" takes that handle as + * an argument. + */ + doload_free(name, base) + char *name; + char *base; /* Not a string. */ + { + if (dlclose(base)) + { + fprintf( stderr, "doload_free: Error unloading package \"%s\" - %s\n", name, dlerror() ); + } + } + #endif *** overhead/class/machdep/sun_68k_41/doload.h Thu May 30 20:42:11 1991 --- overhead/class/machdep/sun_68k_41/doload.h.NEW Thu Mar 21 14:33:27 1991 *************** *** 0 **** --- 1,43 ---- + /*********************************************************** + Copyright IBM Corporation 1988 + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of IBM not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + ******************************************************************/ + /* + * doload.h - environment for dynamic loader + * + * Modified for SunOS 4.1/S5R4 by Guy Harris, November 1990. + * This file is not used by doload.c in SunOS 4.1/S5R4, rather it declares + * the external interface to the doload routine for other parts of the class + * system to use. + */ + + /* here is the state during a load */ + + typedef enum doload_mode_enum { + Load, /* .. loading .do file */ + List, /* .. listing .do or .o file */ + Fix /* .. converting .o to .do file */ + } doload_mode; + + extern int doload_trace; + + #define doload_extension ".do" + + extern void *(*doload() )(); *** overhead/class/machdep/sun_68k_41/entry.spp Thu May 30 20:42:21 1991 --- overhead/class/machdep/sun_68k_41/entry.spp.NEW Thu Mar 21 14:33:28 1991 *************** *** 0 **** --- 1,69 ---- + LL0: + .globl _class_Lookup + .data + .globl _class_ErrorReturnValue + .text + #ifdef mc68020 + .align 1 + #else + .even + #endif + | Sure hope I am not responsible for saving any registers across a call! + L000: + movl sp@(8),sp@- | Move 1st arg over return address & index + | index is already in right place as 2nd arg to class_Lookup + jbsr _class_Lookup | Call class_Lookup. + addqw #4, sp | Pop argument to class_Lookup. + tstl d0 + jne L001 + + | + | Get address of GOT, and use that to find _class_ErrorReturnValue + | in a position-independent fashion. + | + movl #__GLOBAL_OFFSET_TABLE_,a0 + lea pc@(0,a0:L),a0 + + movl a0@(_class_ErrorReturnValue:w),a0 + movl a0@,d0 + addqw #4,sp | pop index + rts + + L001: movl sp@+,d1 + asll #2,d1 + addl d1, d0 | Add index to returned value. + movl d0, a0 | Put it into an address register. + movl a0@, a0 | Get the function pointer to jmp to from memory. + jmp a0@ | Jump indirect off of scratch register. + + #ifdef __STDC__ + #define ClassEntry(n) \ + .globl _ClassEntry ## n: + #else + #define ClassEntry(n) \ + .globl _ClassEntry/**/n: + #endif + + #include <../common/entrydefs.h> + + #undef ClassEntry + #ifdef __STDC__ + #define ClassEntry(n) \ + _ClassEntry ## n: \ + movl \#n, sp@-; /* Push index onto stack for later. */ \ + bra L000 + #else + #define ClassEntry(n) \ + _ClassEntry/**/n: \ + movl #n, sp@-; /* Push index onto stack for later. */ \ + bra L000 + #endif + + #include <../common/entrydefs.h> + + #ifdef mc68020 + .align 1 + #else + .even + #endif + .data *** overhead/class/machdep/sun_68k_41/makedo.csh Thu Jun 6 17:22:32 1991 --- overhead/class/machdep/sun_68k_41/makedo.csh Thu Jun 6 17:24:04 1991 *************** *** 0 **** --- 1,89 ---- + #!/bin/csh -f + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ($#argv == 0) then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-g] [-s] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, doindex" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -g causes .dog file to be generated for debugger use" + echo " -s causes files to be picked up from 'shared' subdirectory" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -g: + set gflag + breaksw + case -s: + set sflag + breaksw + default: + if (! $?outfile) set outfile=$file + if ($?sflag) then + if ($file:e == o) then + set tail = $file:t + if ($tail == $file) then + # + # The tail of a one-component file name is the file + # name. Prepend "shared/" to it. + # + set file = shared/$tail + else + # + # Multi-component file name. Insert "shared/" + # before the last component. + # + set head = $file:h + set file = $head/shared/$tail + endif + endif + endif + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + ld -o ${outfile:r}.do $filelist -lresolv + exit($status) *** overhead/class/machdep/sun_sparc/Imakefile Thu Jan 10 14:57:25 1991 --- overhead/class/machdep/sun_sparc/Imakefile.NEW Fri Feb 1 15:14:07 1991 *************** *** 18,28 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 18,28 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 33,42 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) $(GETLIST) $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f $(GETLIST) >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 33,42 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} $(GETLIST) $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a ${GNULIB} /tmp/libhack.a | $(TR) ":" " " | \ $(AWK) -f $(GETLIST) >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 44,49 **** --- 44,53 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 50,66 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 54,71 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; $(ARCHIVE_COM) \ $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/sun_sparc/getlafs.awk Thu Jan 10 14:57:27 1991 --- overhead/class/machdep/sun_sparc/getlafs.awk.NEW Fri Feb 1 14:25:45 1991 *************** *** 108,113 **** --- 108,115 ---- want[library["_gethostbyname"] "." definer["_gethostbyname"]] = "Y"; want[library["_gethostbyaddr"] "." definer["_gethostbyaddr"]] = "Y"; want[library["_sethostent"] "." definer["_sethostent"]] = "Y"; + if (definer["_gethostbyname"] != "gethostnamadr.o" ) + want[library["_gethostent"] "." definer["_gethostent"]] = "Y"; want[library["_res_querydomain"] "." definer["_res_querydomain"]] = "Y"; want[library["_res_mkquery"] "." definer["_res_mkquery"]] = "Y"; want[library["_res_send"] "." definer["_res_send"]] = "Y"; *************** *** 146,152 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 148,155 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/sun_sparc/getlist.awk Thu Jan 10 14:57:28 1991 --- overhead/class/machdep/sun_sparc/getlist.awk.NEW Fri Feb 1 14:25:47 1991 *************** *** 108,113 **** --- 108,115 ---- want[library["_gethostbyname"] "." definer["_gethostbyname"]] = "Y"; want[library["_gethostbyaddr"] "." definer["_gethostbyaddr"]] = "Y"; want[library["_sethostent"] "." definer["_sethostent"]] = "Y"; + if (definer["_gethostbyname"] != "gethostnamadr.o" ) + want[library["_gethostent"] "." definer["_gethostent"]] = "Y"; want[library["_res_querydomain"] "." definer["_res_querydomain"]] = "Y"; want[library["_res_mkquery"] "." definer["_res_mkquery"]] = "Y"; want[library["_res_send"] "." definer["_res_send"]] = "Y"; *************** *** 146,152 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 148,155 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/machdep/sun_sparc_41/Imakefile Thu May 30 20:43:09 1991 --- overhead/class/machdep/sun_sparc_41/Imakefile.NEW Wed Apr 3 23:13:38 1991 *************** *** 0 **** --- 1,34 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DependTarget() + + NormalObjectRule() + + .spp.o: + -$(RM) $@ ,$*.s ,$*.c + $(CP) $*.spp ,$*.c + $(CC) -E -I. $(LOCALINCLUDES) $(CFLAGS) ,$*.c > ,$*.s + $(AS) -k -o $*.o ,$*.s + $(RM) ,$*.c ,$*.s + + #ifdef RESOLVER_ENV + libresolv.so.1.1: + if [ ! -d resolv ]; then mkdir resolv; fi + (cd resolv; \ + ar x /usr/lib/libresolv.a; \ + ld -assert pure-text -o ../libresolv.so.1.1 *.o) + + InstallFile(libresolv.so.1.1,$(INSTLIBFLAGS),$(DESTDIR)/lib) + + clean:: + $(RM) -rf resolv + #endif /* RESOLVER_LIB */ + + all:: globals.o entry.o doload.o + + globals.c: + touch globals.c + + InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) *** overhead/class/machdep/sun_sparc_41/doload.c Thu May 30 20:43:20 1991 --- overhead/class/machdep/sun_sparc_41/doload.c.NEW Thu Mar 21 14:33:34 1991 *************** *** 0 **** --- 1,138 ---- + /* + Replacement for doload.c for the SunOS 4.1/S5R4 dynamic loader. + */ + + #include + #include + #include + + /* + * SunOS 4.1 doesn't have any #defines for the second argument to + * "dlopen()"; it just says "it has to be 1". S5R4 has defines for + * RTLD_LAZY, which makes it act the way SunOS 4.1 works, and RTLD_NOW, + * which makes it bind symbols at "dlopen()" time. Thus, we define + * RTLD_LAZY as 1 (which is what it's defined as in S5R4) if it's not + * defined (as is the case in SunOS 4.1). + */ + #ifndef RTLD_LAZY + #define RTLD_LAZY 1 + #endif + + /* This should be removed, but the machine independent code declares + * doload_Extension external expecting it to be defined in the machdep + * code. I suppose one might want to set this to something other than ".do" + * (like ".so") to conform to the SunOS 4.x/S5R4 convention but for now + * we will do it the way it has always been done. + */ + char doload_extension[] = ".do"; + + int doload_trace=0; /* nonzero if debugging */ + + /* doload: Load a dynamic object. + * + * Basically, this just calls the dynamic loader and relies on the + * system to do the right thing. + */ + char *doload(inFD, name, bp, lenP, path) /* return pointer to entry point, */ + /* or NULL if error */ + /* UNUSED */ int inFD; /* open fd for package file. */ + char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + { + char *dummy; + void *handle; + char *EntryPoint = NULL; + char epname[1024]; /* XXX - allocate dynamically? */ + register char *p; + + /* Doindex is going to free the memory associated with a dynamic object + * before loading another dynamic object to prevent memory bloat. + * + * Therefore this routine fakes something for doindex to free. Of course + * the correct way to do this is to add a routine to the doload interface to + * unload a dynamic object. (See the commented out doload_unload below.) + * If doindex and all the doload files for other machines are ever fixed, + * this code can be eliminated. + * + * Note that the loss of correct bp and len info is not to big a deal since + * it is mostly just used for debugging; SunOS 4.1 doesn't do this very + * well, but hopefully either S5R4 does it reasonably or will do so in the + * future. + */ + dummy = (char *) malloc(1); + if (dummy == NULL) + return NULL; + *bp = dummy; + *lenP = 1; + + /* + * We assume class_Error and class_RoutineStruct are in the + * dynamic-loading symbol table of the executable. + */ + + /* + * Load package + */ + handle = dlopen(path, RTLD_LAZY); + if ( handle == NULL ) + { + fprintf( stderr, "doload: Error loading package \"%s\" - %s\n", path, dlerror() ); + return NULL; + } + + /* + * Construct name of GetClassInfo symbol from the package name + * by stripping off the suffix and appending "__GetClassInfo". + * You can't get the entry point value from a shareable object + * from the "dl*()" routines, which is why we have to do this + * stuff. + * We strip off the suffix because "doindex", curse its soul, + * hands us the last component of the name of the *file* as + * the package name, suffix and all. + */ + (void) strcpy(epname, name); + p = strrchr(epname, '.'); + if (p == NULL) + p = epname + strlen(epname); + (void) strcpy(p, "__GetClassInfo"); + + /* + * Return entry point + */ + EntryPoint = (char *)dlsym( handle, epname ); + if ( EntryPoint == NULL ) + { + fprintf( stderr, "doload: Error finding entry point of package \"%s\" - %s\n", path, dlerror() ); + return NULL; + } + if ( doload_trace ) + printf(" %s: entry = 0x%.8x\n", name, EntryPoint); + + return( EntryPoint ); + } + + #if 0 + /* doload_free: Free the resources associated with a dynamically loaded */ + * object. + * The programmer is responsible for making sure that no pointers into the + * storage associated with the dynamic object are held. On most systems, + * this routine will simply do a "free(base);". This routine is provided + * for doindex to call. It cannot safely be used in most situations. + * + * If nobody actually uses "base" for anything other than handing it to + * "doload_free()", "doload()" should be changed to pass the handle gotten + * from "dlopen()" back as the base, since "dlclose()" takes that handle as + * an argument. + */ + doload_free(name, base) + char *name; + char *base; /* Not a string. */ + { + if (dlclose(base)) + { + fprintf( stderr, "doload_free: Error unloading package \"%s\" - %s\n", name, dlerror() ); + } + } + #endif *** overhead/class/machdep/sun_sparc_41/doload.h Thu May 30 20:43:31 1991 --- overhead/class/machdep/sun_sparc_41/doload.h.NEW Thu Mar 21 14:33:35 1991 *************** *** 0 **** --- 1,43 ---- + /*********************************************************** + Copyright IBM Corporation 1988 + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of IBM not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + ******************************************************************/ + /* + * doload.h - environment for dynamic loader + * + * Modified for SunOS 4.1/S5R4 by Guy Harris, November 1990. + * This file is not used by doload.c in SunOS 4.1/S5R4, rather it declares + * the external interface to the doload routine for other parts of the class + * system to use. + */ + + /* here is the state during a load */ + + typedef enum doload_mode_enum { + Load, /* .. loading .do file */ + List, /* .. listing .do or .o file */ + Fix /* .. converting .o to .do file */ + } doload_mode; + + extern int doload_trace; + + #define doload_extension ".do" + + extern void *(*doload() )(); *** overhead/class/machdep/sun_sparc_41/entry.spp Thu May 30 20:43:41 1991 --- overhead/class/machdep/sun_sparc_41/entry.spp.NEW Thu Mar 21 14:33:35 1991 *************** *** 0 **** --- 1,54 ---- + .globl _class_Lookup + .data + .globl _class_ErrorReturnValue + .text + + #include + + L000: + save %sp,-SA(MINFRAME),%sp ! buy a stack frame + sll %g1, 2, %l0 ! save the class entry index + ! Do we really need the following instruction??? + mov %g1, %o1 ! index is second paramater(???) + call _class_Lookup ! call class_Lookup ... + mov %i0, %o0 ! ... copying first parameter + + tst %o0 ! test return value + bnz,a L001 ! if zero, error + ld [%o0 + %l0], %g1 ! if not, get address of function + + ! + ! Get address of GOT, and use that to find _class_ErrorReturnValue + ! in a position-independent fashion. + ! + L.1B: + call L.2B + sethi %hi((__GLOBAL_OFFSET_TABLE_-(L.1B-.))),%l0 + L.2B: + or %l0,%lo((__GLOBAL_OFFSET_TABLE_-(L.1B-.))),%l0 + add %l0,%o7,%l0 + + ld [%l0+_class_ErrorReturnValue], %l0 + ld [%l0],%l0 + ret ! so return with error code + restore %l0, %g0, %o0 + + L001: + jmp %g1 ! go there and + restore ! pop the stack frame + + #ifdef _STDC__ + #define ClassEntry(n) \ + .globl _ClassEntry ## n ;\ + _ClassEntry ## n: ;\ + ba L000 ;\ + mov n,%g1 + #else + #define ClassEntry(n) \ + .globl _ClassEntry/**/n ;\ + _ClassEntry/**/n: ;\ + ba L000 ;\ + mov n,%g1 + #endif + + #include <../common/entrydefs.h> *** overhead/class/machdep/sun_sparc_41/makedo.csh Thu Jun 6 17:22:33 1991 --- overhead/class/machdep/sun_sparc_41/makedo.csh Thu Jun 6 17:24:10 1991 *************** *** 0 **** --- 1,89 ---- + #!/bin/csh -f + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ($#argv == 0) then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-g] [-s] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, doindex" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -g causes .dog file to be generated for debugger use" + echo " -s causes files to be picked up from 'shared' subdirectory" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -g: + set gflag + breaksw + case -s: + set sflag + breaksw + default: + if (! $?outfile) set outfile=$file + if ($?sflag) then + if ($file:e == o) then + set tail = $file:t + if ($tail == $file) then + # + # The tail of a one-component file name is the file + # name. Prepend "shared/" to it. + # + set file = shared/$tail + else + # + # Multi-component file name. Insert "shared/" + # before the last component. + # + set head = $file:h + set file = $head/shared/$tail + endif + endif + endif + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + ld -o ${outfile:r}.do $filelist + exit($status) *** overhead/class/machdep/i386_mach/Imakefile Thu Jan 10 14:56:55 1991 --- overhead/class/machdep/i386_mach/Imakefile.NEW Fri Feb 1 15:14:10 1991 *************** *** 9,19 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! RESOLVER_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! #else ! RESOLVER_LIB = ! RESOLVER_CMD = #endif all:: globals.o entry.o doload.o --- 9,19 ---- #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) ! LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o ! RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ then ar x $(RESOLVER_LIB); fi; exit 0'; ! LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ ! then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; #endif all:: globals.o entry.o doload.o *************** *** 24,33 **** $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a /tmp/libhack.a | $(TR) ":()" " " | \ $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a --- 24,33 ---- $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h ! libc.eplist: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk $(RM) /tmp/libhack.a $(AR) /tmp/libhack.a /lib/crt0.o ! $(NM) -go $(RESOLVER_LIB) /lib/libc.a ${GNULIB} /tmp/libhack.a | $(TR) ":()" " " | \ $(AWK) -f getlist.awk >,libc.eplist $(MV) ,libc.eplist libc.eplist $(RM) /tmp/libhack.a *************** *** 35,40 **** --- 35,44 ---- InstallLibrary(libcx.a, $(DESTDIR)/lib) InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + all:: libcx.a DelList._: libc.eplist *************** *** 41,57 **** $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) DelList._ rm -rf new mkdir new ! cd new; \ ! $(RESOLVER_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a; \ ! $(CHMODW) ,libcx.a; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` $(RANLIB) libcx.a rm -rf new --- 45,62 ---- $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ $(MV) ,DelList._ DelList._ ! libcx.a: /lib/libc.a /lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ rm -rf new mkdir new ! cd new ; \ ! $(RESOLVER_SPLIT_CMD) \ $(CP) /lib/crt0.o crt0.o ; \ ! $(CP) /lib/libc.a ,libcx.a ; $(ARCHIVE_COM) \ ! $(CHMODW) ,libcx.a ; \ ar q ,libcx.a *.o mv new/,libcx.a libcx.a -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) $(RANLIB) libcx.a rm -rf new *** overhead/class/machdep/i386_mach/getlist.awk Thu Jan 10 14:56:56 1991 --- overhead/class/machdep/i386_mach/getlist.awk.NEW Fri Feb 1 14:26:18 1991 *************** *** 144,150 **** # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; needmore = "N") { for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; --- 144,151 ---- # now take transitive closure of wanted modules ! for (needmore = "Y"; needmore == "Y"; ) { ! needmore = "N"; for ( i = 0; i < epcount; i++) { if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { want[library[ep[i]] "." definer[ep[i]]] = "N"; *** overhead/class/lib/Imakefile Mon Aug 6 11:14:05 1990 --- overhead/class/lib/Imakefile.NEW Tue Apr 9 19:15:43 1991 *************** *** 7,24 **** DependTarget() NormalObjectRule() - NormalAsmPPRule() #ifndef _IBMR2 ! LibraryTarget(libclass.a, class.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o) #else /* _IBMR2 */ ! libclass.a: class.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o $(RM) $@ ! ld -o shr.o class.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o -bE:../machdep/machine/libclass.exp -bM:SRE -b I:../machdep/machine/libclass.imp -lc $(AR) $@ shr.o $(RM) shr.o #endif /* _IBMR2 */ InstallLibrary(libclass.a, $(DESTDIR)/lib) InstallFile(class.h, $(INSTINCFLAGS), $(DESTDIR)/include) InstallFile(mapping.h, $(INSTINCFLAGS), $(DESTDIR)/include) --- 7,44 ---- DependTarget() NormalObjectRule() #ifndef _IBMR2 ! #ifdef hp9000s800 ! LibraryTarget(classproc.a, classproc.o ../machdep/machine/entry.o) ! LibraryTarget(libclass.a, class.o classproc.o ../machdep/machine/dump_all.o ../machdep/machine/symbols.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/dynld.o) ! #else /* hp9000s800 */ ! #ifndef LIBDL_ENV ! LibraryTarget(libclass.a, class.o classproc.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o) ! #else /* LIBDL_ENV */ ! libclass.a: class.o classproc.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o ! $(RM) $@ ! ld $(SHLIBLDFLAGS) -o $@ shared/class.o classproc.o ../machdep/machine/entry.o \ ! ../machdep/machine/shared/doload.o shared/mapping.o \ ! shared/classind.o ../machdep/machine/shared/globals.o ! #endif /* LIBDL_ENV */ ! #endif /* hp9000s800 */ #else /* _IBMR2 */ ! libclass.a: class.o classproc.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o $(RM) $@ ! ld -o shr.o class.o classproc.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o -bE:../machdep/machine/libclass.exp -bM:SRE -b I:../machdep/machine/libclass.imp -lc $(AR) $@ shr.o $(RM) shr.o #endif /* _IBMR2 */ + #ifdef LIBDL_ENV + install.time:: libclass.a + $(INSTALL) $(INSTLIBFLAGS) libclass.a $(DESTDIR)/lib + #else /* LIBDL_ENV */ InstallLibrary(libclass.a, $(DESTDIR)/lib) + #ifdef hp9000s800 + InstallLibrary(classproc.a, $(DESTDIR)/lib) + #endif /* hp9000s800 */ + #endif /* LIBDL_ENV */ InstallFile(class.h, $(INSTINCFLAGS), $(DESTDIR)/include) InstallFile(mapping.h, $(INSTINCFLAGS), $(DESTDIR)/include) *** overhead/class/lib/class.c Fri Dec 21 15:01:58 1990 --- overhead/class/lib/class.c.NEW Wed Apr 3 21:26:50 1991 *************** *** 6,12 **** class.c - runtime support for class system */ ! char class_rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/lib/RCS/class.c,v 2.31 90/11/05 16:14:30 ajp Exp $"; #include /* sys/types.h sys/file.h */ --- 6,12 ---- class.c - runtime support for class system */ ! char class_rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/lib/RCS/class.c,v 2.33 91/04/02 17:03:12 susan Exp $"; #include /* sys/types.h sys/file.h */ *************** *** 15,21 **** --- 15,26 ---- #include #include #include + #ifdef M_UNIX + #include + #define direct dirent + #else #include + #endif #include #include *************** *** 28,36 **** extern char *getenv(); /* %%%% */ ! #if !SY_AIX12 extern int getpid(); ! #endif /* SY_AIX12 */ #ifdef _IBMR2 extern char _etext; #define etext _etext --- 33,41 ---- extern char *getenv(); /* %%%% */ ! #if !SY_AIX12 && !hpux extern int getpid(); ! #endif /* !SY_AIX12 && !hpux */ #ifdef _IBMR2 extern char _etext; #define etext _etext *************** *** 100,177 **** static struct pathentry *globalPath = NULL; - - - - long ClassEntry0(); long ClassEntry1(); long ClassEntry2(); long ClassEntry3(); long ClassEntry4(); - long ClassEntry5(); long ClassEntry6(); long ClassEntry7(); long ClassEntry8(); long ClassEntry9(); - long ClassEntry10(); long ClassEntry11(); long ClassEntry12(); long ClassEntry13(); long ClassEntry14(); - long ClassEntry15(); long ClassEntry16(); long ClassEntry17(); long ClassEntry18(); long ClassEntry19(); - long ClassEntry20(); long ClassEntry21(); long ClassEntry22(); long ClassEntry23(); long ClassEntry24(); - long ClassEntry25(); long ClassEntry26(); long ClassEntry27(); long ClassEntry28(); long ClassEntry29(); - long ClassEntry30(); long ClassEntry31(); long ClassEntry32(); long ClassEntry33(); long ClassEntry34(); - long ClassEntry35(); long ClassEntry36(); long ClassEntry37(); long ClassEntry38(); long ClassEntry39(); - long ClassEntry40(); long ClassEntry41(); long ClassEntry42(); long ClassEntry43(); long ClassEntry44(); - long ClassEntry45(); long ClassEntry46(); long ClassEntry47(); long ClassEntry48(); long ClassEntry49(); - long ClassEntry50(); long ClassEntry51(); long ClassEntry52(); long ClassEntry53(); long ClassEntry54(); - long ClassEntry55(); long ClassEntry56(); long ClassEntry57(); long ClassEntry58(); long ClassEntry59(); - long ClassEntry60(); long ClassEntry61(); long ClassEntry62(); long ClassEntry63(); long ClassEntry64(); - long ClassEntry65(); long ClassEntry66(); long ClassEntry67(); long ClassEntry68(); long ClassEntry69(); - long ClassEntry70(); long ClassEntry71(); long ClassEntry72(); long ClassEntry73(); long ClassEntry74(); - long ClassEntry75(); long ClassEntry76(); long ClassEntry77(); long ClassEntry78(); long ClassEntry79(); - long ClassEntry80(); long ClassEntry81(); long ClassEntry82(); long ClassEntry83(); long ClassEntry84(); - long ClassEntry85(); long ClassEntry86(); long ClassEntry87(); long ClassEntry88(); long ClassEntry89(); - long ClassEntry90(); long ClassEntry91(); long ClassEntry92(); long ClassEntry93(); long ClassEntry94(); - long ClassEntry95(); long ClassEntry96(); long ClassEntry97(); long ClassEntry98(); long ClassEntry99(); - long ClassEntry100(); long ClassEntry101(); long ClassEntry102(); long ClassEntry103(); long ClassEntry104(); - long ClassEntry105(); long ClassEntry106(); long ClassEntry107(); long ClassEntry108(); long ClassEntry109(); - long ClassEntry110(); long ClassEntry111(); long ClassEntry112(); long ClassEntry113(); long ClassEntry114(); - long ClassEntry115(); long ClassEntry116(); long ClassEntry117(); long ClassEntry118(); long ClassEntry119(); - long ClassEntry120(); long ClassEntry121(); long ClassEntry122(); long ClassEntry123(); long ClassEntry124(); - long ClassEntry125(); long ClassEntry126(); long ClassEntry127(); long ClassEntry128(); long ClassEntry129(); - long ClassEntry130(); long ClassEntry131(); long ClassEntry132(); long ClassEntry133(); long ClassEntry134(); - long ClassEntry135(); long ClassEntry136(); long ClassEntry137(); long ClassEntry138(); long ClassEntry139(); - long ClassEntry140(); long ClassEntry141(); long ClassEntry142(); long ClassEntry143(); long ClassEntry144(); - long ClassEntry145(); long ClassEntry146(); long ClassEntry147(); long ClassEntry148(); long ClassEntry149(); - - struct basicobject_methods class_RoutineStruct = { - NULL, - ClassEntry0, ClassEntry1, ClassEntry2, ClassEntry3, ClassEntry4, - ClassEntry5, ClassEntry6, ClassEntry7, ClassEntry8, ClassEntry9, - ClassEntry10, ClassEntry11, ClassEntry12, ClassEntry13, ClassEntry14, - ClassEntry15, ClassEntry16, ClassEntry17, ClassEntry18, ClassEntry19, - ClassEntry20, ClassEntry21, ClassEntry22, ClassEntry23, ClassEntry24, - ClassEntry25, ClassEntry26, ClassEntry27, ClassEntry28, ClassEntry29, - ClassEntry30, ClassEntry31, ClassEntry32, ClassEntry33, ClassEntry34, - ClassEntry35, ClassEntry36, ClassEntry37, ClassEntry38, ClassEntry39, - ClassEntry40, ClassEntry41, ClassEntry42, ClassEntry43, ClassEntry44, - ClassEntry45, ClassEntry46, ClassEntry47, ClassEntry48, ClassEntry49, - ClassEntry50, ClassEntry51, ClassEntry52, ClassEntry53, ClassEntry54, - ClassEntry55, ClassEntry56, ClassEntry57, ClassEntry58, ClassEntry59, - ClassEntry60, ClassEntry61, ClassEntry62, ClassEntry63, ClassEntry64, - ClassEntry65, ClassEntry66, ClassEntry67, ClassEntry68, ClassEntry69, - ClassEntry70, ClassEntry71, ClassEntry72, ClassEntry73, ClassEntry74, - ClassEntry75, ClassEntry76, ClassEntry77, ClassEntry78, ClassEntry79, - ClassEntry80, ClassEntry81, ClassEntry82, ClassEntry83, ClassEntry84, - ClassEntry85, ClassEntry86, ClassEntry87, ClassEntry88, ClassEntry89, - ClassEntry90, ClassEntry91, ClassEntry92, ClassEntry93, ClassEntry94, - ClassEntry95, ClassEntry96, ClassEntry97, ClassEntry98, ClassEntry99, - ClassEntry100, ClassEntry101, ClassEntry102, ClassEntry103, ClassEntry104, - ClassEntry105, ClassEntry106, ClassEntry107, ClassEntry108, ClassEntry109, - ClassEntry110, ClassEntry111, ClassEntry112, ClassEntry113, ClassEntry114, - ClassEntry115, ClassEntry116, ClassEntry117, ClassEntry118, ClassEntry119, - ClassEntry120, ClassEntry121, ClassEntry122, ClassEntry123, ClassEntry124, - ClassEntry125, ClassEntry126, ClassEntry127, ClassEntry128, ClassEntry129, - ClassEntry130, ClassEntry131, ClassEntry132, ClassEntry133, ClassEntry134, - ClassEntry135, ClassEntry136, ClassEntry137, ClassEntry138, ClassEntry139, - ClassEntry140, ClassEntry141, ClassEntry142, ClassEntry143, ClassEntry144, - ClassEntry145, ClassEntry146, ClassEntry147, ClassEntry148, ClassEntry149 - }; - - - - - /** ** ** local (static) functions for finding entries in the ClassList in various ways. --- 105,110 ---- *************** *** 179,185 **** **/ - static int FindEntryByType(info) struct classinfo *info; { --- 112,117 ---- *************** *** 296,303 **** class_Error=class_ErrNotLoaded; return -1; } - - char *class_Lookup(header,cpindex) --- 228,233 ---- *** overhead/class/lib/class.h Wed Sep 26 16:11:42 1990 --- overhead/class/lib/class.h.NEW Wed Apr 3 21:26:51 1991 *************** *** 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/projects/andrew/overhead/class/lib/RCS/class.h,v 2.17 90/06/06 12:27:14 gk5g Exp Locker: bader $ */ #ifndef class_DEFINED #define class_DEFINED 1 --- 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/projects/andrew/overhead/class/lib/RCS/class.h,v 2.18 91/04/02 17:03:02 susan Exp $ */ #ifndef class_DEFINED #define class_DEFINED 1 *************** *** 22,27 **** --- 22,30 ---- #define class_VERSIONNOTKNOWN -1 + #ifdef NULL + #undef NULL + #endif /* NULL */ #define NULL 0 #define TRUE 1 #define FALSE 0 *** overhead/class/lib/classproc.c Thu May 30 20:44:45 1991 --- overhead/class/lib/classproc.c.NEW Wed Apr 3 21:26:52 1991 *************** *** 0 **** --- 1,80 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + /* This is now separated off from class.c so that on the hp9000s800 + * class_RoutineStruct and the ClassEntry's can be loaded into + * both the text and data segments. Otherwise class procedure calls + * from dynamically loaded classes to other dynamically loaded classes + * will fail. + */ + + #include + + long ClassEntry0(); long ClassEntry1(); long ClassEntry2(); long ClassEntry3(); long ClassEntry4(); + long ClassEntry5(); long ClassEntry6(); long ClassEntry7(); long ClassEntry8(); long ClassEntry9(); + long ClassEntry10(); long ClassEntry11(); long ClassEntry12(); long ClassEntry13(); long ClassEntry14(); + long ClassEntry15(); long ClassEntry16(); long ClassEntry17(); long ClassEntry18(); long ClassEntry19(); + long ClassEntry20(); long ClassEntry21(); long ClassEntry22(); long ClassEntry23(); long ClassEntry24(); + long ClassEntry25(); long ClassEntry26(); long ClassEntry27(); long ClassEntry28(); long ClassEntry29(); + long ClassEntry30(); long ClassEntry31(); long ClassEntry32(); long ClassEntry33(); long ClassEntry34(); + long ClassEntry35(); long ClassEntry36(); long ClassEntry37(); long ClassEntry38(); long ClassEntry39(); + long ClassEntry40(); long ClassEntry41(); long ClassEntry42(); long ClassEntry43(); long ClassEntry44(); + long ClassEntry45(); long ClassEntry46(); long ClassEntry47(); long ClassEntry48(); long ClassEntry49(); + long ClassEntry50(); long ClassEntry51(); long ClassEntry52(); long ClassEntry53(); long ClassEntry54(); + long ClassEntry55(); long ClassEntry56(); long ClassEntry57(); long ClassEntry58(); long ClassEntry59(); + long ClassEntry60(); long ClassEntry61(); long ClassEntry62(); long ClassEntry63(); long ClassEntry64(); + long ClassEntry65(); long ClassEntry66(); long ClassEntry67(); long ClassEntry68(); long ClassEntry69(); + long ClassEntry70(); long ClassEntry71(); long ClassEntry72(); long ClassEntry73(); long ClassEntry74(); + long ClassEntry75(); long ClassEntry76(); long ClassEntry77(); long ClassEntry78(); long ClassEntry79(); + long ClassEntry80(); long ClassEntry81(); long ClassEntry82(); long ClassEntry83(); long ClassEntry84(); + long ClassEntry85(); long ClassEntry86(); long ClassEntry87(); long ClassEntry88(); long ClassEntry89(); + long ClassEntry90(); long ClassEntry91(); long ClassEntry92(); long ClassEntry93(); long ClassEntry94(); + long ClassEntry95(); long ClassEntry96(); long ClassEntry97(); long ClassEntry98(); long ClassEntry99(); + long ClassEntry100(); long ClassEntry101(); long ClassEntry102(); long ClassEntry103(); long ClassEntry104(); + long ClassEntry105(); long ClassEntry106(); long ClassEntry107(); long ClassEntry108(); long ClassEntry109(); + long ClassEntry110(); long ClassEntry111(); long ClassEntry112(); long ClassEntry113(); long ClassEntry114(); + long ClassEntry115(); long ClassEntry116(); long ClassEntry117(); long ClassEntry118(); long ClassEntry119(); + long ClassEntry120(); long ClassEntry121(); long ClassEntry122(); long ClassEntry123(); long ClassEntry124(); + long ClassEntry125(); long ClassEntry126(); long ClassEntry127(); long ClassEntry128(); long ClassEntry129(); + long ClassEntry130(); long ClassEntry131(); long ClassEntry132(); long ClassEntry133(); long ClassEntry134(); + long ClassEntry135(); long ClassEntry136(); long ClassEntry137(); long ClassEntry138(); long ClassEntry139(); + long ClassEntry140(); long ClassEntry141(); long ClassEntry142(); long ClassEntry143(); long ClassEntry144(); + long ClassEntry145(); long ClassEntry146(); long ClassEntry147(); long ClassEntry148(); long ClassEntry149(); + + struct basicobject_methods class_RoutineStruct = { + NULL, + ClassEntry0, ClassEntry1, ClassEntry2, ClassEntry3, ClassEntry4, + ClassEntry5, ClassEntry6, ClassEntry7, ClassEntry8, ClassEntry9, + ClassEntry10, ClassEntry11, ClassEntry12, ClassEntry13, ClassEntry14, + ClassEntry15, ClassEntry16, ClassEntry17, ClassEntry18, ClassEntry19, + ClassEntry20, ClassEntry21, ClassEntry22, ClassEntry23, ClassEntry24, + ClassEntry25, ClassEntry26, ClassEntry27, ClassEntry28, ClassEntry29, + ClassEntry30, ClassEntry31, ClassEntry32, ClassEntry33, ClassEntry34, + ClassEntry35, ClassEntry36, ClassEntry37, ClassEntry38, ClassEntry39, + ClassEntry40, ClassEntry41, ClassEntry42, ClassEntry43, ClassEntry44, + ClassEntry45, ClassEntry46, ClassEntry47, ClassEntry48, ClassEntry49, + ClassEntry50, ClassEntry51, ClassEntry52, ClassEntry53, ClassEntry54, + ClassEntry55, ClassEntry56, ClassEntry57, ClassEntry58, ClassEntry59, + ClassEntry60, ClassEntry61, ClassEntry62, ClassEntry63, ClassEntry64, + ClassEntry65, ClassEntry66, ClassEntry67, ClassEntry68, ClassEntry69, + ClassEntry70, ClassEntry71, ClassEntry72, ClassEntry73, ClassEntry74, + ClassEntry75, ClassEntry76, ClassEntry77, ClassEntry78, ClassEntry79, + ClassEntry80, ClassEntry81, ClassEntry82, ClassEntry83, ClassEntry84, + ClassEntry85, ClassEntry86, ClassEntry87, ClassEntry88, ClassEntry89, + ClassEntry90, ClassEntry91, ClassEntry92, ClassEntry93, ClassEntry94, + ClassEntry95, ClassEntry96, ClassEntry97, ClassEntry98, ClassEntry99, + ClassEntry100, ClassEntry101, ClassEntry102, ClassEntry103, ClassEntry104, + ClassEntry105, ClassEntry106, ClassEntry107, ClassEntry108, ClassEntry109, + ClassEntry110, ClassEntry111, ClassEntry112, ClassEntry113, ClassEntry114, + ClassEntry115, ClassEntry116, ClassEntry117, ClassEntry118, ClassEntry119, + ClassEntry120, ClassEntry121, ClassEntry122, ClassEntry123, ClassEntry124, + ClassEntry125, ClassEntry126, ClassEntry127, ClassEntry128, ClassEntry129, + ClassEntry130, ClassEntry131, ClassEntry132, ClassEntry133, ClassEntry134, + ClassEntry135, ClassEntry136, ClassEntry137, ClassEntry138, ClassEntry139, + ClassEntry140, ClassEntry141, ClassEntry142, ClassEntry143, ClassEntry144, + ClassEntry145, ClassEntry146, ClassEntry147, ClassEntry148, ClassEntry149 + }; + + *** overhead/class/pp/Imakefile Wed Nov 22 13:33:00 1989 --- overhead/class/pp/Imakefile.NEW Thu Jun 13 16:21:30 1991 *************** *** 2,8 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! DependTarget() NormalObjectRule() --- 2,11 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! #ifdef _IBMR2 ! CDEBUGFLAGS = ! #endif ! DependTarget() NormalObjectRule() *** overhead/class/testing/Imakefile Wed Sep 26 16:11:44 1990 --- overhead/class/testing/Imakefile.NEW Mon May 13 14:46:52 1991 *************** *** 2,11 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ CLASS=../pp/class MAKEDO=$(BASEDIR)/bin/makedo LOCALINCLUDES= -I../lib -I../machdep/machine -I. ! MAKEDOFLAGS=-b ../cmd -g -d $(BASEDIR)/lib IHFILES = testobj.ih testobj2.ih NormalObjectRule() --- 2,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + #ifdef RESOLVER_ENV + RESOLVER_LIB = ${RESOLVLIB} + #endif /* RESOLVER_ENV */ + CLASS=../pp/class MAKEDO=$(BASEDIR)/bin/makedo LOCALINCLUDES= -I../lib -I../machdep/machine -I. ! MAKEDOFLAGS= -g -b ../cmd -d $(BASEDIR)/lib IHFILES = testobj.ih testobj2.ih NormalObjectRule() *************** *** 18,23 **** test:: testobj.do test:: testobj2.do ! TestProgramTarget(testmain,testmain.o,$(BASEDIR)/lib/libclass.a,) --- 22,27 ---- test:: testobj.do test:: testobj2.do ! TestProgramTarget(testmain,testmain.o,$(BASEDIR)/lib/libclass.a ${RESOLVER_LIB},) *** overhead/conv/Imakefile Thu Jan 10 14:57:38 1991 --- overhead/conv/Imakefile.NEW Wed Apr 10 15:31:25 1991 *************** *** 1,12 **** #ifdef RESOLVER_ENV RESOLVER_LIB = $(RESOLVLIB) #else RESOLVER_LIB = #endif NormalObjectRule() ! ProgramTarget(conclass,conclass.o, ${UTILLIB} $(BASEDIR)/lib/libclass.a $(RESOLVER_LIB),) InstallProgram(conclass, $(DESTDIR)/bin) InstallFile(fixcons, ${INSTPROGFLAGS}, ${DESTDIR}/etc/) --- 1,20 ---- #ifdef RESOLVER_ENV + #ifdef LIBDL_ENV + SYS_LIBS = -lresolv + RESOLVER_LIB = + #else RESOLVER_LIB = $(RESOLVLIB) + SYS_LIBS = + #endif /* LIBDL_ENV */ #else RESOLVER_LIB = + SYS_LIBS = #endif + DependTarget() NormalObjectRule() ! ProgramTarget(conclass,conclass.o, ${UTILLIB} $(BASEDIR)/lib/libclass.a $(RESOLVER_LIB),$(SYS_LIBS) ${SUPLIBS} ${NETLIBS}) InstallProgram(conclass, $(DESTDIR)/bin) InstallFile(fixcons, ${INSTPROGFLAGS}, ${DESTDIR}/etc/) *** overhead/cmenu/Imakefile Wed Nov 22 13:36:02 1989 --- overhead/cmenu/Imakefile.NEW Wed Apr 3 21:27:05 1991 *************** *** 9,15 **** InstallLibrary(libcmenu.a, $(DESTDIR)/lib) InstallMultiple(cmenu.h cmerror.h, $(INSTINCFLAGS), $(DESTDIR)/include) ! TestProgramTarget(testmenu, testmenu.o, libcmenu.a $(XLIBDIR)/libX11.a,) DependTarget() --- 9,15 ---- InstallLibrary(libcmenu.a, $(DESTDIR)/lib) InstallMultiple(cmenu.h cmerror.h, $(INSTINCFLAGS), $(DESTDIR)/include) ! TestProgramTarget(testmenu, testmenu.o, libcmenu.a $(XLIBDIR)/libX11.a,${SUPLIBS} ${NETLIBS}) DependTarget() *** overhead/cmenu/cmcreate.c Mon Aug 6 11:14:16 1990 --- overhead/cmenu/cmcreate.c.NEW Tue May 21 15:30:25 1991 *************** *** 2,16 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.10 90/05/09 15:35:18 gk5g Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.10 90/05/09 15:35:18 gk5g Exp $"; #endif /* lint */ #include #include #include #include --- 2,17 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.15 1991/05/20 17:57:48 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.15 1991/05/20 17:57:48 gk5g Exp $"; #endif /* lint */ #include + #include #include #include #include *************** *** 34,50 **** /* * Make the menu's cursor. ! */ cursorPixmap = XCreateBitmapFromData(display, rootWindow, (char *) cursor_bits, (int)cursor_width, (int)cursor_height); ! ! cursorMaskPixmap = XCreatePixmapFromBitmapData(display, rootWindow, (char *) cursormask_bits, ! (int)cursormask_width, (int)cursormask_height, 0, 1, 1); ! /* ! * Set up the Color Stuctures for the cursor. ! */ foreColor.pixel = BlackPixel(display, DefaultScreen(display)); XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &foreColor); backColor.pixel = WhitePixel(display, DefaultScreen(display)); --- 35,49 ---- /* * Make the menu's cursor. ! */ cursorPixmap = XCreateBitmapFromData(display, rootWindow, (char *) cursor_bits, (int)cursor_width, (int)cursor_height); ! cursorMaskPixmap = XCreatePixmapFromBitmapData( ! display, rootWindow, (char *) cursormask_bits, (int) cursormask_width, (int) cursormask_height, BlackPixel(display, DefaultScreen(display)), WhitePixel(display, DefaultScreen(display)), 1); /* ! * Set up the Color Stuctures for the cursor. ! */ foreColor.pixel = BlackPixel(display, DefaultScreen(display)); XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &foreColor); backColor.pixel = WhitePixel(display, DefaultScreen(display)); *************** *** 325,330 **** --- 324,336 ---- dp->yShift = dp->titleFontHeight + dp->yTitleOffset + 2; dp->xShift = 16; + + if ((def_val = XGetDefault(dpy, def_env, "PaneSpread")) != NULL) { + extern double atof(); + double spread = atof(def_val); + dp->xShift *= spread; + if (dp->xShift < 4) dp->xShift = 4; + } dp->xTitleOffset = dp->titleFont->max_bounds.lbearing + dp->xShift / 3; *** overhead/cmenu/cmenu.help Mon Aug 6 11:14:18 1990 --- overhead/cmenu/cmenu.help.NEW Tue May 21 15:30:28 1991 *************** *** 1,19 **** ! \begindata{text,268707252} \textdsversion{12} ! \define{chapter ! } ! \define{section ! } ! \define{leftindent ! } ! \define{italic ! } ! \define{bold ! } ! \define{display ! } ! \define{smaller ! } \chapter{Cmenu: Controlling the menus for Andrew applications } --- 1,6 ---- ! \begindata{text,268804400} \textdsversion{12} ! \template{help} \chapter{Cmenu: Controlling the menus for Andrew applications } *************** *** 55,71 **** \bold{\italic{ClickInterval:} 350} ! This attribute (in milliseconds) determines the period of time, from the onset ! of the depression of the middle mouse button, during which you may release the ! middle mouse button and still have the menus up on the screen for selection ! purposes. In other words, you can peruse the menu stack without having the ! middle mouse button depressed. To select a menu option while in this state, ! you must again depress the middle mouse button on the selection of your ! choice. There is an invisible bounding box around the menu stack which, if ! you cross while the menus are up, will force the menus to be retracted without ! a selection. ! \bold{\italic{OverlapPct: 0}} \leftindent{Determines the percentage of overlap that is used when flipping to --- 42,58 ---- \bold{\italic{ClickInterval:} 350} ! \leftindent{This attribute (in milliseconds) determines the period of time, ! from the onset of the depression of the middle mouse button, during which you ! may release the middle mouse button and still have the menus up on the screen ! for selection purposes. In other words, you can peruse the menu stack without ! having the middle mouse button depressed. To select a menu option while in ! this state, you must again depress the middle mouse button on the selection of ! your choice. There is an invisible bounding box around the menu stack which, ! if you cross while the menus are up, will force the menus to be retracted ! without a selection. ! } \bold{\italic{OverlapPct: 0}} \leftindent{Determines the percentage of overlap that is used when flipping to *************** *** 78,108 **** cause the previous menu to be displayed without at least moving the mouse slightly past its left edge.} - }\leftindent{ - UseSaveUnder: 1 - - Determines whether or not the X server will save the bits under the menus so - that the application will not have to redraw the window when the menus are - retracted. The default value is 1. The reason this option exists is for - those displays (like the QDSS) where save unders are available, but slower - than just redrawing. ! MenuForeground: black ! Determines the color to use for the foreground when drawing the menus. The ! default value for the foreground color is black. This attribute is only ! consulted if the menus are being drawn on a color monitor. ! MenuBackground: white ! Determines the color to use for the background when drawing the menus. The ! default value for the background color is white. This attribute is only ! consulted if the menus are being drawn on a color monitor. } \section{Related tools} --- 65,101 ---- cause the previous menu to be displayed without at least moving the mouse slightly past its left edge.} + \italic{\bold{PaneSpread: 1 ! }}}\leftindent{\leftindent{Determines the separation distance between the ! edges of two consecutive menu cards in the menu stack. To specify that the ! cards be twice as separated, PaneSpread should be set to the value 2.}} ! \leftindent{\italic{\bold{ ! UseSaveUnder: 1}} + \leftindent{Determines whether or not the X server will save the bits under + the menus so that the application will not have to redraw the window when the + menus are retracted. The default value is 1. The reason this option exists + is for those displays (like the QDSS) where save unders are available, but + slower than just redrawing. ! } ! \bold{\italic{MenuForeground: black}} ! \leftindent{Determines the color to use for the foreground when drawing the ! menus. The default value for the foreground color is black. This attribute ! is only consulted if the menus are being drawn on a color monitor. } + \italic{\bold{MenuBackground: white}} + + \leftindent{Determines the color to use for the background when drawing the + menus. The default value for the background color is white. This attribute + is only consulted if the menus are being drawn on a color monitor. + }} \section{Related tools} *************** *** 118,121 **** XGetDefault(3X) ! }}\enddata{text,268707252} --- 111,114 ---- XGetDefault(3X) ! }}\enddata{text,268804400} *** overhead/cmenu/crsrimg.h Wed Nov 22 13:35:59 1989 --- overhead/cmenu/crsrimg.h.NEW Sun May 5 18:58:06 1991 *************** *** 2,9 **** * 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/overhead/cmenu/RCS/crsrimg.h,v 2.3 89/02/08 16:57:19 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/cmenu/RCS/crsrimg.h,v $ */ #define cursor_width 18 #define cursor_height 13 --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/crsrimg.h,v 2.6 1991/05/02 21:29:58 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/crsrimg.h,v $ */ #define cursor_width 18 #define cursor_height 13 *************** *** 19,26 **** --- 19,34 ---- #define cursormask_height 13 #define cursormask_x_hot 16 #define cursormask_y_hot 6 + #if defined(OPENWINDOWS_ENV) || defined(sys_sun4_41) || defined(sys_sun3_41) static char cursormask_bits[] = { + 0x00, 0x0e, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7e, 0x00, + 0xff, 0xff, 0x00, 0xff, 0xff, 0x01, 0xff, 0xff, 0x03, 0xff, 0xff, 0x01, + 0xff, 0xff, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x0e, 0x00}; + #else /* ! OPENWINDOWS_ENV && ! sys_sun4_41 && ! sys_sun3_41 */ + static char cursormask_bits[] = { 0xff, 0xf1, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xc1, 0xff, 0xff, 0x81, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x81, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xf1, 0xff}; + #endif /* OPENWINDOWS_ENV || sys_sun4_41 || sys_sun3_41 */ *** overhead/eli/bglisp/Imakefile Wed Nov 22 13:36:25 1989 --- overhead/eli/bglisp/Imakefile.NEW Wed Apr 3 21:27:15 1991 *************** *** 6,12 **** DependTarget() NormalObjectRule() ! ProgramTarget(bglisp, bglisp.o, $(BASEDIR)/lib/libeli.a $(BASEDIR)/lib/librxp.a $(MALLOCLIB) $(UTILLIB),) InstallProgram(bglisp, $(DESTDIR)/bin) InstallDocs(bglisp.help, ${DESTDIR}/help) --- 6,12 ---- DependTarget() NormalObjectRule() ! ProgramTarget(bglisp, bglisp.o, $(BASEDIR)/lib/libeli.a $(BASEDIR)/lib/librxp.a $(MALLOCLIB) $(UTILLIB),${SUPLIBS} ${NETLIBS}) InstallProgram(bglisp, $(DESTDIR)/bin) InstallDocs(bglisp.help, ${DESTDIR}/help) *** overhead/eli/lib/Imakefile Mon Mar 12 13:17:25 1990 --- overhead/eli/lib/Imakefile.NEW Wed Apr 3 21:27:23 1991 *************** *** 17,28 **** DependTarget() NormalObjectRule() ! YaccWithReplacement(eliy, eliyy) elil.o: eliy.h ! LexWithReplacement(elil, eliyy) LibraryTarget(libeli.a, $(OBJS)) InstallLibrary(libeli.a, $(DESTDIR)/lib) - --- 17,27 ---- DependTarget() NormalObjectRule() ! YaccWithReplacement(eliy,eliyy) elil.o: eliy.h ! LexWithReplacement(elil,eliyy) LibraryTarget(libeli.a, $(OBJS)) InstallLibrary(libeli.a, $(DESTDIR)/lib) *** overhead/fonts/lib/Imakefile Wed Nov 22 13:48:08 1989 --- overhead/fonts/lib/Imakefile.NEW Mon Jun 3 13:41:10 1991 *************** *** 8,13 **** #ifdef WM_ENV NormalObjectRule() LibraryTarget(libfont.a, fontio.o fntmanip.o fntnamng.o) ! InstallLibrary(libfont.a, $(DESTDIR)/lib) ! InstallMultiple(font.h fntmanip.h, $(INSTINCFLAGS), $(DESTDIR)/include) #endif /* WM_ENV */ --- 8,13 ---- #ifdef WM_ENV NormalObjectRule() LibraryTarget(libfont.a, fontio.o fntmanip.o fntnamng.o) ! InstallLibrary(libfont.a, $(WMBASEDIR)/lib) ! InstallMultiple(font.h fntmanip.h, $(INSTINCFLAGS), $(WMBASEDIR)/include) #endif /* WM_ENV */ *** overhead/fonts/cmd/Imakefile Wed Nov 22 13:40:08 1989 --- overhead/fonts/cmd/Imakefile.NEW Fri May 17 16:25:33 1991 *************** *** 14,22 **** #endif /* X11_ENV */ #ifdef WM_ENV ! ProgramTarget(fdbwm, fdbwm.o, $(BASEDIR)/lib/libfont.a $(UTILLIB),) InstallProgram(fdbwm, $(DESTDIR)/bin) ! ProgramTarget(wmfdb, wmfdb.o, $(BASEDIR)/lib/libfont.a $(UTILLIB),) InstallProgram(wmfdb, $(DESTDIR)/bin) #endif /* WM_ENV */ --- 14,22 ---- #endif /* X11_ENV */ #ifdef WM_ENV ! ProgramTarget(fdbwm, fdbwm.o, $(WMBASEDIR)/lib/libfont.a $(UTILLIB),) InstallProgram(fdbwm, $(DESTDIR)/bin) ! ProgramTarget(wmfdb, wmfdb.o, $(WMBASEDIR)/lib/libfont.a $(UTILLIB),) InstallProgram(wmfdb, $(DESTDIR)/bin) #endif /* WM_ENV */ *** overhead/fonts/fonts/adobe/Imakefile Wed Nov 22 13:44:25 1989 --- overhead/fonts/fonts/adobe/Imakefile.NEW Wed Apr 10 15:52:50 1991 *************** *** 88,93 **** DeclareFont(symba16) DeclareFont(symba22) - - InstallDocs(fonts.doc, ${DESTDIR}/doc/) --- 88,91 ---- *** overhead/fonts/fonts/programs/Imakefile Mon Aug 6 11:14:53 1990 --- overhead/fonts/fonts/programs/Imakefile.NEW Tue May 21 15:31:16 1991 *************** *** 20,32 **** DeclareFont(mailft12) NSDeclareFont(shape10) DeclareFont(tri10) ! DeclareFont(andyoffice12) #ifdef X11_ENV DeclareFont(xshape10) #endif /* X11_ENV */ ! #ifdef VAX_ENV icon12.snf: icn16x16.snf cp icn16x16.snf icon12.snf ! #endif /* VAX_ENV */ --- 20,32 ---- DeclareFont(mailft12) NSDeclareFont(shape10) DeclareFont(tri10) ! DeclareFont(andyof12) #ifdef X11_ENV DeclareFont(xshape10) #endif /* X11_ENV */ ! #if (defined (VAX_ENV) || defined(PMAX_ENV)) icon12.snf: icn16x16.snf cp icn16x16.snf icon12.snf ! #endif /* (defined (VAX_ENV) || defined(PMAX_ENV)) */ *** overhead/fonts/fonts/programs/andyof12.fdb Thu May 30 20:46:32 1991 --- overhead/fonts/fonts/programs/andyof12.fdb.NEW Thu Apr 4 21:56:09 1991 *************** *** 0 **** --- 1,1359 ---- + $magic 509 + $fontname andyoffice12 + $familyname andyoffice + $rotation 0 + $pointsize 12 + $Comment Copyright (c) 1984 Adobe Systems, Inc. + $Comment /adobe/fonttools/bitmaps/stdfontvec.ps HM14.bits + $Comment TOTAL BITMAP BYTES 1442 + $Comment GUIDELINES -3 0 8 11 DONE + $Comment WIDTHERR -96 -229 + $MaxNWtoOrigin 0,10 + $MaxNtoS 0,14 + $MaxWtoE 17,0 + $MaxWbase 0,0 + $MaxNewline 0,14 + $FontRepresentationType 1 BitmapIcon + $NIcons 128 + $character 32 sp + $spacing 4,0 + $character 33 ! + $box 1,11 + $origin -2,10 + $spacing 4,0 + $raster + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 0000 + 8000 + 8000 + $character 34 " + $box 3,3 + $origin -1,10 + $spacing 5,0 + $raster + A000 + A000 + A000 + $character 35 # + $box 7,10 + $origin 0,9 + $spacing 8,0 + $raster + 1400 + 1400 + 1400 + 7E00 + 2800 + 2800 + FC00 + 5000 + 5000 + 5000 + $character 36 $ + $box 7,13 + $origin 0,10 + $spacing 8,0 + $raster + 1000 + 7C00 + 9200 + 9200 + 9000 + 7C00 + 1200 + 1200 + 9200 + 9200 + 7C00 + 1000 + 1000 + $character 37 % + $box 11,11 + $origin 0,10 + $spacing 12,0 + $raster + 7080 + 8900 + 8900 + 7200 + 0200 + 0400 + 0800 + 09C0 + 1220 + 1220 + 21C0 + $character 38 & + $box 8,10 + $origin -1,9 + $spacing 10,0 + $raster + 3000 + 4800 + 4800 + 3000 + 2000 + 5100 + 8A00 + 8400 + 8A00 + 7100 + $character 39 ' + $box 2,3 + $origin -1,10 + $spacing 3,0 + $raster + C000 + 4000 + 8000 + $character 40 ( + $box 3,14 + $origin -1,10 + $spacing 5,0 + $raster + 2000 + 4000 + 4000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 4000 + 4000 + 2000 + $character 41 ) + $box 3,14 + $origin -1,10 + $spacing 5,0 + $raster + 8000 + 4000 + 4000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 4000 + 4000 + 8000 + $character 42 * + $box 5,5 + $origin -1,10 + $spacing 7,0 + $raster + 2000 + A800 + 7000 + A800 + 2000 + $character 43 + + $box 7,7 + $origin -1,7 + $spacing 9,0 + $raster + 1000 + 1000 + 1000 + FE00 + 1000 + 1000 + 1000 + $character 44 , + $box 2,4 + $origin 0,1 + $spacing 3,0 + $raster + 4000 + 4000 + 4000 + 8000 + $character 45 - + $box 5,1 + $origin -1,4 + $spacing 6,0 + $raster + F800 + $character 46 . + $box 1,2 + $origin -1,1 + $spacing 3,0 + $raster + 8000 + 8000 + $character 47 / + $box 4,11 + $origin 0,10 + $spacing 4,0 + $raster + 1000 + 1000 + 2000 + 2000 + 2000 + 4000 + 4000 + 4000 + 8000 + 8000 + 8000 + $character 48 0 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 7800 + $character 49 1 + $box 3,10 + $origin -2,9 + $spacing 7,0 + $raster + 2000 + E000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + $character 50 2 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 0400 + 0800 + 1000 + 2000 + 4000 + 8000 + FC00 + $character 51 3 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 0400 + 3800 + 0400 + 0400 + 8400 + 8400 + 7800 + $character 52 4 + $box 7,10 + $origin -1,9 + $spacing 8,0 + $raster + 0C00 + 1400 + 2400 + 4400 + 8400 + 8400 + FE00 + 0400 + 0400 + 0400 + $character 53 5 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + FC00 + 8000 + 8000 + F800 + 0400 + 0400 + 0400 + 8400 + 8400 + 7800 + $character 54 6 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8000 + 8000 + F800 + 8400 + 8400 + 8400 + 8400 + 7800 + $character 55 7 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + FC00 + 0400 + 0800 + 0800 + 1000 + 1000 + 2000 + 2000 + 4000 + 4000 + $character 56 8 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 7800 + 8400 + 8400 + 8400 + 8400 + 7800 + $character 57 9 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 8400 + 7C00 + 0400 + 0400 + 8400 + 7800 + $character 58 : + $box 1,7 + $origin -1,7 + $spacing 3,0 + $raster + 8000 + 8000 + 0000 + 0000 + 0000 + 8000 + 8000 + $character 59 ; + $box 2,10 + $origin 0,7 + $spacing 4,0 + $raster + 4000 + 4000 + 0000 + 0000 + 0000 + 0000 + 4000 + 4000 + 4000 + 8000 + $character 60 < + $box 6,5 + $origin -1,6 + $spacing 8,0 + $raster + 0C00 + 3000 + C000 + 3000 + 0C00 + $character 61 = + $box 6,3 + $origin -2,5 + $spacing 9,0 + $raster + FC00 + 0000 + FC00 + $character 62 > + $box 6,5 + $origin -1,6 + $spacing 8,0 + $raster + C000 + 3000 + 0C00 + 3000 + C000 + $character 63 ? + $box 6,11 + $origin -1,10 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 0800 + 1000 + 2000 + 2000 + 0000 + 2000 + 2000 + $character 64 @ + $box 17,1 + $spacing 17,0 + $raster + 00000000 + $character 65 A + $box 16,10 + $origin 0,9 + $spacing 17,0 + $raster + 3C00 + 4200 + 81F8 + 8004 + 8004 + 8004 + 8004 + 8004 + 8004 + FFFC + $character 66 B + $box 16,10 + $origin 0,9 + $spacing 17,0 + $raster + 3C00 + 4200 + 81F8 + 8004 + 9FFF + 9001 + A002 + A002 + C004 + FFFC + $character 67 C + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0100 + 0280 + 0440 + 0820 + 1010 + 2008 + 1010 + 0820 + 0440 + 0280 + 0100 + $character 68 D + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0FE0 + 0850 + 0848 + 0878 + 0808 + 0808 + 0808 + 0808 + 0808 + 0808 + 0FF8 + $character 69 E + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0FE0 + 0850 + 0848 + 0038 + 0D88 + 1248 + 2D88 + 4108 + 8A08 + AA88 + 4D38 + $character 70 F + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0FE0 + 0850 + 0848 + 0B78 + 0508 + 0A08 + 1408 + 2808 + 5008 + E808 + 4FF8 + $character 71 G + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 03E0 + 0FF8 + 0808 + 0FF8 + 0410 + 0550 + 0550 + 0550 + 0550 + 0410 + 07F0 + $character 72 H + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + FF80 + 8080 + 8080 + 8080 + 8080 + 8080 + 8080 + 8080 + FF80 + $character 73 I + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + FF80 + C180 + A280 + 9480 + 8880 + 9480 + A280 + C180 + FF80 + $character 74 J + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 00C0 + FDC0 + 8380 + 8300 + 8680 + 8680 + EC80 + BC80 + 9880 + FF80 + $character 75 K + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 00C0 + 01C0 + 0380 + 0300 + 0600 + 0600 + 6C00 + 3C00 + 1800 + 0800 + $character 76 L + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + C0C0 + 6180 + 3300 + 1E00 + 0C00 + 1E00 + 3300 + 6180 + C0C0 + $character 77 M + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + $character 78 N + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + 3E00 + 7F00 + FF80 + FF80 + FF80 + FF80 + FF80 + 7F00 + 3E00 + $character 79 O + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + 3E00 + 4100 + 8080 + 8080 + 8080 + 8080 + 8080 + 4100 + 3E00 + $character 80 P + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + FC00 + 8200 + 8200 + 8200 + 8200 + FC00 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 81 Q + $box 9,11 + $origin -1,10 + $spacing 11,0 + $raster + 1C00 + 6300 + 4100 + 8080 + 8080 + 8080 + 8080 + 8480 + 4300 + 6300 + 1C80 + $character 82 R + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + FC00 + 8200 + 8200 + 8200 + 8200 + FC00 + 8400 + 8200 + 8200 + 8200 + 8200 + $character 83 S + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + 3800 + 4400 + 8200 + 8000 + 6000 + 1800 + 0400 + 0200 + 8200 + 4400 + 3800 + $character 84 T + $box 9,11 + $origin 0,10 + $spacing 9,0 + $raster + FF80 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + $character 85 U + $box 8,11 + $origin -1,10 + $spacing 10,0 + $raster + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 4200 + 3C00 + $character 86 V + $box 9,11 + $origin -1,10 + $spacing 11,0 + $raster + 8080 + 8080 + 4100 + 4100 + 4100 + 2200 + 2200 + 1400 + 1400 + 0800 + 0800 + $character 87 W + $box 13,11 + $origin -1,10 + $spacing 15,0 + $raster + 8208 + 8208 + 8508 + 4510 + 4510 + 4510 + 28A0 + 28A0 + 28A0 + 1040 + 1040 + $character 88 X + $box 8,11 + $origin -1,10 + $spacing 10,0 + $raster + 8100 + 4200 + 4200 + 2400 + 1800 + 1800 + 2400 + 2400 + 4200 + 8100 + 8100 + $character 89 Y + $box 9,11 + $origin 0,10 + $spacing 9,0 + $raster + 8080 + 4100 + 4100 + 2200 + 2200 + 1400 + 0800 + 0800 + 0800 + 0800 + 0800 + $character 90 Z + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + FE00 + 0200 + 0400 + 0800 + 0800 + 1000 + 2000 + 2000 + 4000 + 8000 + FE00 + $character 91 [ + $box 3,14 + $origin -1,10 + $spacing 4,0 + $raster + E000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + E000 + $character 92 \ + $box 4,11 + $origin 0,10 + $spacing 4,0 + $raster + 8000 + 8000 + 4000 + 4000 + 4000 + 2000 + 2000 + 2000 + 1000 + 1000 + 1000 + $character 93 ] + $box 3,14 + $origin 0,10 + $spacing 4,0 + $raster + E000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + E000 + $character 94 ^ + $box 5,3 + $origin -1,10 + $spacing 7,0 + $raster + 2000 + 5000 + 8800 + $character 95 _ + $box 8,1 + $origin 0,-3 + $spacing 8,0 + $raster + FF00 + $character 96 ` + $box 2,3 + $origin 0,10 + $spacing 3,0 + $raster + 4000 + 8000 + C000 + $character 97 a + $box 7,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 0400 + 7C00 + 8400 + 8400 + 8C00 + 7600 + $character 98 b + $box 6,11 + $origin -1,10 + $spacing 8,0 + $raster + 8000 + 8000 + 8000 + B800 + C400 + 8400 + 8400 + 8400 + 8400 + C400 + B800 + $character 99 c + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8000 + 8000 + 8000 + 8400 + 7800 + $character 100 d + $box 6,11 + $origin -1,10 + $spacing 8,0 + $raster + 0400 + 0400 + 0400 + 7400 + 8C00 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + $character 101 e + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + FC00 + 8000 + 8000 + 8400 + 7800 + $character 102 f + $box 4,11 + $origin 0,10 + $spacing 5,0 + $raster + 3000 + 4000 + 4000 + F000 + 4000 + 4000 + 4000 + 4000 + 4000 + 4000 + 4000 + $character 103 g + $box 6,11 + $origin -1,7 + $spacing 8,0 + $raster + 7400 + 8C00 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + 0400 + 8400 + 7800 + $character 104 h + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + F000 + 9000 + 9000 + F000 + $character 105 i + $box 1,11 + $origin -1,10 + $spacing 3,0 + $raster + 8000 + 8000 + 0000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 106 j + $box 3,14 + $origin 0,10 + $spacing 4,0 + $raster + 2000 + 2000 + 0000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + C000 + $character 107 k + $box 6,11 + $origin -1,10 + $spacing 7,0 + $raster + 8000 + 8000 + 8000 + 8800 + 9000 + A000 + C000 + A000 + 9000 + 8800 + 8400 + $character 108 l + $box 1,11 + $origin -1,10 + $spacing 3,0 + $raster + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 109 m + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + F000 + F000 + F000 + F000 + $character 110 n + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + 6000 + F000 + F000 + 6000 + $character 111 o + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + 6000 + 9000 + 9000 + 6000 + $character 112 p + $box 6,11 + $origin -1,7 + $spacing 8,0 + $raster + B800 + C400 + 8400 + 8400 + 8400 + 8400 + C400 + B800 + 8000 + 8000 + 8000 + $character 113 q + $box 6,11 + $origin -1,7 + $spacing 8,0 + $raster + 7400 + 8C00 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + 0400 + 0400 + 0400 + $character 114 r + $box 4,8 + $origin -1,7 + $spacing 5,0 + $raster + B000 + C000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 115 s + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 8000 + 6000 + 1800 + 0400 + 8400 + 7800 + $character 116 t + $box 4,10 + $origin 0,9 + $spacing 5,0 + $raster + 4000 + 4000 + F000 + 4000 + 4000 + 4000 + 4000 + 4000 + 4000 + 3000 + $character 117 u + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + $character 118 v + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 8400 + 8400 + 8400 + 4800 + 4800 + 4800 + 3000 + 3000 + $character 119 w + $box 9,8 + $origin 0,7 + $spacing 9,0 + $raster + 8880 + 8880 + 8880 + 4900 + 4900 + 5500 + 2200 + 2200 + $character 120 x + $box 7,8 + $origin 0,7 + $spacing 8,0 + $raster + 8200 + 4400 + 2800 + 1000 + 1000 + 2800 + 4400 + 8200 + $character 121 y + $box 7,11 + $origin 0,7 + $spacing 8,0 + $raster + 8200 + 8200 + 4400 + 4400 + 2400 + 2800 + 1800 + 1000 + 1000 + 1000 + 6000 + $character 122 z + $box 6,8 + $origin 0,7 + $spacing 7,0 + $raster + FC00 + 0400 + 0800 + 1000 + 2000 + 4000 + 8000 + FC00 + $character 123 { + $box 5,14 + $origin 0,10 + $spacing 5,0 + $raster + 1800 + 2000 + 2000 + 2000 + 2000 + 4000 + 8000 + 4000 + 2000 + 2000 + 2000 + 2000 + 2000 + 1800 + $character 124 | + $box 1,14 + $origin -1,10 + $spacing 3,0 + $raster + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 125 } + $box 5,14 + $origin 0,10 + $spacing 5,0 + $raster + C000 + 2000 + 2000 + 2000 + 2000 + 1000 + 0800 + 1000 + 2000 + 2000 + 2000 + 2000 + 2000 + C000 + $character 126 ~ + $box 6,3 + $origin -1,5 + $spacing 8,0 + $raster + 6400 + B400 + 9800 + $end *** overhead/genmake/Imakefile Wed Nov 22 13:48:15 1989 --- overhead/genmake/Imakefile.NEW Wed Apr 3 21:27:51 1991 *************** *** 6,12 **** all:: mkgenmk gen1 gen2 gen3 $(RM) genmake ! ./mkgenmk ${IMAKE} DEFAULT_ANDREWDIR_ENV chmod +x genmake InstallProgram(genmake, $(DESTDIR)/bin) --- 6,12 ---- all:: mkgenmk gen1 gen2 gen3 $(RM) genmake ! $(CSHELL) ./mkgenmk ${IMAKE} DEFAULT_ANDREWDIR_ENV chmod +x genmake InstallProgram(genmake, $(DESTDIR)/bin) *** overhead/index/index.c Mon Aug 6 11:14:58 1990 --- overhead/index/index.c.NEW Wed Apr 3 21:27:55 1991 *************** *** 2,17 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v 2.4 90/07/12 14:40:43 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v 2.4 90/07/12 14:40:43 gk5g Exp $ "; #endif /* lint */ #include /* sys/types.h sys/file.h */ #include #include #include "index.h" --- 2,22 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v 2.5 91/04/02 17:05:55 susan Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v 2.5 91/04/02 17:05:55 susan Exp $ "; #endif /* lint */ #include /* sys/types.h sys/file.h */ + #ifdef M_UNIX + #include + #define direct dirent + #else #include + #endif #include #include "index.h" *** overhead/index/indexio.c Wed Nov 22 13:48:53 1989 --- overhead/index/indexio.c.NEW Wed Apr 3 21:27:57 1991 *************** *** 2,17 **** * 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/overhead/index/RCS/indexio.c,v 2.3 89/02/10 23:14:31 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/index/RCS/indexio.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/index/RCS/indexio.c,v 2.3 89/02/10 23:14:31 ghoti Exp $ "; #endif /* lint */ #include /* sys/types.h sys/file.h */ #include #include #include --- 2,22 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/indexio.c,v 2.4 91/04/02 17:06:05 susan Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/indexio.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/indexio.c,v 2.4 91/04/02 17:06:05 susan Exp $ "; #endif /* lint */ #include /* sys/types.h sys/file.h */ + #ifdef M_UNIX + #include + #define direct dirent + #else #include + #endif #include #include *** overhead/mail/hdrs/mailconf.h Fri Dec 21 15:02:27 1990 --- overhead/mail/hdrs/mailconf.h.NEW Tue Apr 9 19:16:45 1991 *************** *** 69,75 **** extern char *Organization, *NNTPhost, *NNTPuser, *DefaultSurfaceAddress; extern int AMS_UUCPSupported; ! extern int AMS_ViceQueueLifetime, AMS_ExtraViceQueueLifetime, AMS_ViceQueueLifetimeCap; /* Site configuration for message server. */ --- 69,75 ---- extern char *Organization, *NNTPhost, *NNTPuser, *DefaultSurfaceAddress; extern int AMS_UUCPSupported; ! extern int AMS_ViceQueueLifetime, AMS_ExtraViceQueueLifetime, AMS_ViceQueueLifetimeCap, AMS_CrossCellQueueLifetime; /* Site configuration for message server. */ *************** *** 135,140 **** --- 135,141 ---- extern char *AMS_MailBoxPrefix; /* Prefix for ``/userid'', giving file where mail is delivered. */ extern int AMS_DemandSeparatingCharacter; /* mail items separated by reserved char, e.g. ^A or ^C (yes/no value) */ + extern int AMS_DeleteLinesWithSeparator; /* delete lines up to newline if they contain separating char */ extern int AMS_SeparatingCharacter; /* The aforementioned separator's ascii value */ *************** *** 178,184 **** extern int AMS_WPValidation; /* Use white pages */ extern int AMS_PasswdValidation; /* Use passwd file */ extern int AMS_LocalDatabaseValidation; /* Use something else, defined locally in mailconf.c */ ! extern int AMS_AliasesValidation; /* Use /usr/lib/aliases file */ extern int AMS_NameSeparator; /* If non-zero, character to separate parts of names */ /* Value to override the enforcement of the reading of the external posting etiquette file */ --- 179,189 ---- extern int AMS_WPValidation; /* Use white pages */ extern int AMS_PasswdValidation; /* Use passwd file */ extern int AMS_LocalDatabaseValidation; /* Use something else, defined locally in mailconf.c */ ! #ifdef USE_MMDF_ENV ! extern int AMS_MMDFValidation; /* Use MMDF validation */ ! #endif ! extern int AMS_AliasesValidation; /* Use alias file */ ! extern char *AMS_AliasFileName; /* name of alias file */ extern int AMS_NameSeparator; /* If non-zero, character to separate parts of names */ /* Value to override the enforcement of the reading of the external posting etiquette file */ *** overhead/mail/lib/dropoff.c Wed Sep 26 16:11:51 1990 --- overhead/mail/lib/dropoff.c.NEW Fri Apr 26 16:48:49 1991 *************** *** 91,97 **** --- 91,101 ---- #include #include #include + + #if defined(AFS30_ENV) && !defined(AFS31_ENV) #include + #endif /* defined(AFS30_ENV) && !defined(AFS31_ENV) */ + #include #endif /* AFS_ENV */ *** overhead/mail/lib/Imakefile Fri Dec 21 15:02:28 1990 --- overhead/mail/lib/Imakefile.NEW Wed Apr 3 21:28:10 1991 *************** *** 3,12 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #ifdef RESOLVER_ENV ! RESOLVER_LIB = ${RESOLVLIB} #else RESOLVER_LIB = ! #endif /* RESOLVER_ENV */ OBJS = amsauth.o amsconf.o \ arpadate.o authret.o capture.o canon.o \ --- 3,19 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #ifdef RESOLVER_ENV ! #ifdef LIBDL_ENV ! SYS_LIBS = -lresolv ! RESOLVER_LIB = #else + RESOLVER_LIB = $(RESOLVLIB) + SYS_LIBS = + #endif /* LIBDL_ENV */ + #else RESOLVER_LIB = ! SYS_LIBS = ! #endif OBJS = amsauth.o amsconf.o \ arpadate.o authret.o capture.o canon.o \ *************** *** 20,26 **** NormalObjectRule() TESTLIBS = ${BASEDIR}/lib/libmail.a ${UTILLIB} ${PRSLIB} ${RESOLVER_LIB} ! TestingOnlyTestingRule(${TESTLIBS}) NormalYaccRule() NormalLexRule() --- 27,33 ---- NormalObjectRule() TESTLIBS = ${BASEDIR}/lib/libmail.a ${UTILLIB} ${PRSLIB} ${RESOLVER_LIB} ! TestingOnlyTestingRule(${TESTLIBS},${SYS_LIBS}) NormalYaccRule() NormalLexRule() *** overhead/mail/lib/amsconf.c Wed Nov 22 13:50:07 1989 --- overhead/mail/lib/amsconf.c.NEW Wed Apr 3 21:28:11 1991 *************** *** 7,12 **** --- 7,13 ---- binary directory */ + #include #include #include #include *** overhead/mail/lib/authret.c Fri Dec 21 15:02:30 1990 --- overhead/mail/lib/authret.c.NEW Tue Dec 4 09:09:48 1990 *************** *** 7,17 **** Handy functions to build authentication and return-path information. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/authret.c,v 2.10 90/10/23 15:16:21 gk5g Exp $"; #include #include - #include /* sys/types.h strings.h sys/file.h */ #include #include #ifdef WHITEPAGES_ENV --- 7,17 ---- Handy functions to build authentication and return-path information. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/authret.c,v 2.11 90/11/28 15:03:56 susan Exp $"; + #include /* sys/types.h strings.h sys/file.h */ #include #include #include #include #ifdef WHITEPAGES_ENV *** overhead/mail/lib/capture.c Wed Nov 22 13:51:57 1989 --- overhead/mail/lib/capture.c.NEW Wed Apr 3 21:28:12 1991 *************** *** 7,13 **** */ #include /* sys/time.h */ ! #include #include #include #include --- 7,13 ---- */ #include /* sys/time.h */ ! /*#include */ #include #include #include *** overhead/mail/lib/ckamsdel.c Fri Dec 21 15:02:32 1990 --- overhead/mail/lib/ckamsdel.c.NEW Tue Dec 4 09:09:52 1990 *************** *** 7,17 **** Check for AMS delivery system attributes in domains that may not even be cells. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/ckamsdel.c,v 2.19 90/10/24 12:44:53 gk5g Exp $"; #include #include - #include /* sys/types.h strings.h sys/file.h */ #include #include #include --- 7,17 ---- Check for AMS delivery system attributes in domains that may not even be cells. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/ckamsdel.c,v 2.20 90/11/28 15:04:05 susan Exp $"; + #include /* sys/types.h strings.h sys/file.h */ #include #include #include #include #include *** overhead/mail/lib/fwdvalid.c Fri Dec 21 15:02:34 1990 --- overhead/mail/lib/fwdvalid.c.NEW Tue Dec 4 09:09:55 1990 *************** *** 3,10 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* fwdvalid.c: implement the ValidateAddr() routine that validates mail addresses. */ ! #include #include #include #include #include --- 3,11 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* fwdvalid.c: implement the ValidateAddr() routine that validates mail addresses. */ ! #include + #include #include #include #include *** overhead/mail/lib/locname.c Fri Dec 21 15:02:36 1990 --- overhead/mail/lib/locname.c.NEW Tue Dec 4 09:09:57 1990 *************** *** 6,13 **** locname.c -- Low-level resolver of local addresses */ - #include #include /* sys/types.h strings.h */ #include #include #ifdef hpux --- 6,13 ---- locname.c -- Low-level resolver of local addresses */ #include /* sys/types.h strings.h */ + #include #include #include #ifdef hpux *** overhead/mail/lib/mailconf.c Fri Dec 21 15:02:38 1990 --- overhead/mail/lib/mailconf.c.NEW Tue Apr 9 19:16:56 1991 *************** *** 6,16 **** mailconf.c -- Mail system configuration parameters and data structures. */ #include #include #include #include - #include /* sys/types.h sys/file.h */ #include #include #include --- 6,16 ---- mailconf.c -- Mail system configuration parameters and data structures. */ + #include /* sys/types.h sys/file.h */ #include #include #include #include #include #include #include *************** *** 17,22 **** --- 17,23 ---- #include #include #include + #include #include *************** *** 110,116 **** --- 111,121 ---- /* Whether we're running on a limited system with 14 character file names */ + #ifdef M_UNIX + int AMS_UseShortFileNames = 1; + #else int AMS_UseShortFileNames = 0; + #endif /* Value to not always append the local domain name to local mail */ *************** *** 137,145 **** --- 142,158 ---- char *AMS_MailBoxPrefix = "/usr/spool/mail"; /* Prefix for ``/userid'', giving file where mail is delivered. */ #endif /* ((SY_U5x != 0) || defined(hpux)) */ + #ifdef USE_MMDF_ENV + int AMS_DemandSeparatingCharacter = 1; /* mail items separated by reserved char, e.g. ^A or ^C */ + + int AMS_SeparatingCharacter = 1; /* The aforementioned separator's ascii value */ + int AMS_DeleteLinesWithSeparator = 1; /* delete from separator to newline */ + #else int AMS_DemandSeparatingCharacter = 0; /* mail items separated by reserved char, e.g. ^A or ^C */ int AMS_SeparatingCharacter = 3; /* The aforementioned separator's ascii value */ + int AMS_DeleteLinesWithSeparator = 0; /* delete from separator to newline */ + #endif /* If we are not demanding a separting character, we are parsing the messages (ugh!) looking for From lines that seem to start new messages! How do *************** *** 267,272 **** --- 280,288 ---- /* AMS_ViceQueueLifetimeCap is the maximum believable age of a message. Messages older than this will not be considered to be expired; instead, the local clock will be considered suspect. */ int AMS_ViceQueueLifetimeCap = 2 * (8 + 5) * 24 * 60 * 60; /* Default is 26 days */ + /* AMS_CrossCellQueueLifetime gives how long we'll retry a message, testing whether a destination domain is an AMDS cell. After this time, we'll send the mail via other channels (oldsendmail) anyway. */ + int AMS_CrossCellQueueLifetime = 8 * 60 * 60; /* Default is eight hours */ + /* The following defines bboards everyone must subscribe to */ char *GlobalRequiredSubsFile = "%l/lib/RequiredSubscriptions"; *************** *** 381,386 **** --- 397,411 ---- int AMS_AliasesValidation = 1; #endif /* RUN_AMDS_ENV */ int AMS_LocalDatabaseValidation = 0; + #ifdef USE_MMDF_ENV + int AMS_MMDFValidation = 1; + #endif + + #ifdef M_UNIX + char *AMS_AliasFileName = "/usr/lib/mail/aliases"; + #else + char *AMS_AliasFileName = "/usr/lib/aliases"; + #endif /* A run-time Boolean to tell us if UUCP addresses are supposed to look like remote ones */ int AMS_UUCPSupported = 0; *************** *** 437,442 **** --- 462,468 ---- static struct ConfigStrings { char *ConfigKey, **ConfigParm; int Flags; } ConfigStrings[] = { + {"AMS_AliasFileName", &AMS_AliasFileName, f_none}, /* (4) */ {"AMS_MailBoxPrefix", &AMS_MailBoxPrefix, f_none}, /* (2) */ {"SpoolMailLockTemp", &SpoolMailLockTemp, f_none}, /* (2) */ {"SpoolMailLockDir", &SpoolMailLockDir, f_none}, /* (2) */ *************** *** 531,536 **** --- 557,563 ---- {"AMS_InitialDeathKnell", &AMS_InitialDeathKnell, f_none}, /* (2) */ {"AMS_MaximumDeathKnell", &AMS_MaximumDeathKnell, f_none}, /* (2) */ {"AMS_SeparatingCharacter", &AMS_SeparatingCharacter, f_none}, /* (2) */ + {"AMS_DeleteLinesWithSeparator", &AMS_DeleteLinesWithSeparator, f_none}, /* (2) */ #ifdef NOTDEF {"Postmaster_uid", &postmaster_uid, f_cell}, /* (3) */ *************** *** 538,548 **** --- 565,579 ---- {"AMS_ViceQueueLifetime", &AMS_ViceQueueLifetime, f_cell}, /* (3) */ {"AMS_ExtraViceQueueLifetime", &AMS_ExtraViceQueueLifetime, f_cell}, /* (3) */ {"AMS_ViceQueueLifetimeCap", &AMS_ViceQueueLifetimeCap, f_cell}, /* (3) */ + {"AMS_CrossCellQueueLifetime", &AMS_CrossCellQueueLifetime, f_cell}, /* (3) */ /* The next four of these can't be f_cell, since LocalDatabaseValidation can't be. */ {"AMS_WPValidation", &AMS_WPValidation, f_none}, /* (4) */ {"AMS_PasswdValidation", &AMS_PasswdValidation, f_none}, /* (4) */ {"AMS_LocalDatabaseValidation", &AMS_LocalDatabaseValidation, f_none}, /* (4) */ + #ifdef USE_MMDF_ENV + {"AMS_MMDFValidation", &AMS_MMDFValidation, f_none}, /* (4) */ + #endif {"AMS_NameSeparator", &AMS_NameSeparator, f_none}, /* (4) */ {NULL, NULL, f_none} *************** *** 596,602 **** int i, val, retVal; char *s, *olds; struct configurelist *CList = NULL; ! char *andyDir, *locDir; /* Currently, there's nothing in serviceconfig that needs to be checked on a per-cell basis. */ --- 627,633 ---- int i, val, retVal; char *s, *olds; struct configurelist *CList = NULL; ! char *andyDir, *locDir, *homeDir; /* Currently, there's nothing in serviceconfig that needs to be checked on a per-cell basis. */ *************** *** 688,694 **** *ConfigInts[i].ConfigParm = val; } } ! andyDir = locDir = NULL; if (retVal == 0) for (i=0; ConfigStrings[i].ConfigKey; ++i) { if (Cell != NULL && (ConfigStrings[i].Flags & f_cell) == 0) continue; s = NULL; --- 719,725 ---- *ConfigInts[i].ConfigParm = val; } } ! andyDir = locDir = homeDir = NULL; if (retVal == 0) for (i=0; ConfigStrings[i].ConfigKey; ++i) { if (Cell != NULL && (ConfigStrings[i].Flags & f_cell) == 0) continue; s = NULL; *************** *** 712,717 **** --- 743,754 ---- } else if (s[1] == 'l' || s[1] == 'L') { /* LocalDir */ if (locDir == NULL) locDir = (char *) LocalDir(NULL); newlen += strlen(locDir); + } else if (s[1] == 'h' || s[1] == 'H') { /* user's home directory */ + if (homeDir == NULL) { + struct passwd *PW = getpwuid(geteuid()); + homeDir = PW->pw_dir; + } + newlen += strlen(homeDir); } } t = malloc(newlen); *************** *** 722,727 **** --- 759,767 ---- strcat(t, s+2); } else if (s[1] == 'l' || s[1] == 'L') { /* LocalDir */ strcpy(t, locDir); + strcat(t, s+2); + } else if (s[1] == 'h' || s[1] == 'H') { /* user's home directory */ + strcpy(t, homeDir); strcat(t, s+2); } else if (s[1] == '%') { /* quoted percent sign */ strcpy(t, s+1); *** overhead/mail/lib/parseadd.c Wed Nov 22 13:50:42 1989 --- overhead/mail/lib/parseadd.c.NEW Wed Apr 3 21:28:18 1991 *************** *** 618,623 **** --- 618,624 ---- { register char *c, last; register enum { LEGAL, ILLEGAL, MUSTQUOTE } status; + int dots=1; /* See if any spaces */ for (status=LEGAL, c=Part, last='\0'; status!=MUSTQUOTE && *c!='\0'; c++) { *************** *** 657,662 **** --- 658,666 ---- if ((Mode & UP_SPACES_TO_DOTS) == 0 || status == MUSTQUOTE) return QuoteAndPrint(Part); + if (status == ILLEGAL && index(Part,',') == NULL) + dots=0; + /* Oh well, must turn spaces to dots */ for (c=Part; *c!='\0'; c++) switch(*c) { *************** *** 669,675 **** case ' ': /* Compress spaces & turn to dot */ while (*c == ' ' || *c == '\t') c++; c--; /* Back to last non-space */ ! IFPUTC('.'); break; default: IFPUTC(*c); } --- 673,684 ---- case ' ': /* Compress spaces & turn to dot */ while (*c == ' ' || *c == '\t') c++; c--; /* Back to last non-space */ ! if (dots) ! IFPUTC('.'); ! else { ! IFPUTC(','); ! IFPUTC(' '); ! } break; default: IFPUTC(*c); } *** overhead/mail/lib/qmail.c Fri Dec 21 15:02:41 1990 --- overhead/mail/lib/qmail.c.NEW Wed Apr 3 21:28:20 1991 *************** *** 117,123 **** --- 117,130 ---- #include #include #include + #ifdef M_UNIX + #include + #define direct dirent + #define namlen(d) (strlen((d)->d_name)) + #else #include + #define namlen(d) ((d)->d_namlen) + #endif #include #include #include "mail.h" *************** *** 265,271 **** } MatchCount = 0; while ((dp = readdir(dirp)) != NIL) { ! if (dp->d_namlen >= pfxlen && strncmp(pfx, dp->d_name, pfxlen) == 0 && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) ++MatchCount; } --- 272,280 ---- } MatchCount = 0; while ((dp = readdir(dirp)) != NIL) { ! if ( ! namlen(dp) >= pfxlen && ! strncmp(pfx, dp->d_name, pfxlen) == 0 && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) ++MatchCount; } *************** *** 294,300 **** start = the_time % MatchCount; q = 0; /* Cycle to an arbitrary point in the set of matching directories */ while (q < start && (dp = readdir(dirp)) != NIL) { ! if (dp->d_namlen >= pfxlen && strncmp(pfx, dp->d_name, pfxlen) == 0 && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) ++q; } q = 0; /* Now cycle through the matching dirs, trying to get our message queued */ --- 303,311 ---- start = the_time % MatchCount; q = 0; /* Cycle to an arbitrary point in the set of matching directories */ while (q < start && (dp = readdir(dirp)) != NIL) { ! if ( ! namlen(dp) >= pfxlen && ! strncmp(pfx, dp->d_name, pfxlen) == 0 && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) ++q; } q = 0; /* Now cycle through the matching dirs, trying to get our message queued */ *************** *** 316,322 **** rc = (errno == 0 || tfail(errno) || errno == ENFILE) ? Q_TEMP_FAIL : Q_DIR_ERR; break; } ! if (dp->d_namlen >= pfxlen && strncmp(pfx, dp->d_name, pfxlen) == 0 && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { ++q; /* We're trying a match */ sprintf(ThisDir, "%s/%s", dirname, dp->d_name); --- 327,335 ---- rc = (errno == 0 || tfail(errno) || errno == ENFILE) ? Q_TEMP_FAIL : Q_DIR_ERR; break; } ! if ( ! namlen(dp) >= pfxlen && ! strncmp(pfx, dp->d_name, pfxlen) == 0 && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { ++q; /* We're trying a match */ sprintf(ThisDir, "%s/%s", dirname, dp->d_name); *************** *** 495,501 **** host, name, arpadate()); /* Now write body */ ! #ifndef AIX if (fstat(file, &buf) < 0) { int err = errno; fclose(f); --- 508,514 ---- host, name, arpadate()); /* Now write body */ ! #if !defined(AIX) && !defined(M_UNIX) if (fstat(file, &buf) < 0) { int err = errno; fclose(f); *** overhead/mail/lib/rsearch.c Wed Nov 22 13:51:12 1989 --- overhead/mail/lib/rsearch.c.NEW Wed Apr 10 23:18:55 1991 *************** *** 10,24 **** * search for MX records for a domain name. */ ! #include ! #ifdef RESOLVER_ENV #include #include #include - #include #include - #include /* strings.h */ #include #include --- 10,22 ---- * search for MX records for a domain name. */ ! #include /* strings.h */ ! #include #ifdef RESOLVER_ENV #include #include #include #include #include #include *************** *** 31,37 **** int anslen; /* size of answer */ { char buf[PACKETSZ], tryname[2*MAXDNAME + 1]; - extern char *strcpy(); int n; if (!(_res.options & RES_INIT)) --- 29,34 ---- *************** *** 76,82 **** { register char *C1, *C2; FILE *fp; ! char *file, *getenv(), *strcpy(), *strncpy(); char buf[BUFSIZ]; static char abuf[MAXDNAME]; --- 73,79 ---- { register char *C1, *C2; FILE *fp; ! char *file, *getenv(); char buf[BUFSIZ]; static char abuf[MAXDNAME]; *************** *** 118,124 **** register char **domain; #endif /* RES_DNSRCH */ register HEADER *hp; - extern char *strcpy(); int n, NumDots; if (!(_res.options & RES_INIT)) --- 115,120 ---- *** overhead/mail/lib/scan822.c Fri Dec 21 15:02:42 1990 --- overhead/mail/lib/scan822.c.NEW Tue Dec 4 09:10:04 1990 *************** *** 4,11 **** \* ********************************************************************** */ /* scan822.c: routines to parse pieces of header lines. */ - #include #include /* strings.h */ #include #ifndef _IBMR2 --- 4,11 ---- \* ********************************************************************** */ /* scan822.c: routines to parse pieces of header lines. */ #include /* strings.h */ + #include #include #ifndef _IBMR2 *** overhead/mail/lib/stats.c Fri Dec 21 15:02:43 1990 --- overhead/mail/lib/stats.c.NEW Wed Apr 3 21:28:21 1991 *************** *** 7,16 **** stats.c -- Make statistics entries for mail system. */ ! #include #include - #include /* sys/types.h sys/time.h */ #include #include --- 7,15 ---- stats.c -- Make statistics entries for mail system. */ ! #include /* sys/types.h sys/time.h */ #include #include #include #include *************** *** 178,184 **** --- 177,185 ---- #ifdef NOTDEF register struct servent *serv; #endif /* NOTDEF */ + #ifndef hp9000s800 /* socket.h defines as extern u_long */ extern long inet_addr(); + #endif /* hp9000s800 */ /* Look up mail statistics service */ #ifdef NOTDEF *** overhead/mail/cmd/Imakefile Wed Nov 22 13:52:48 1989 --- overhead/mail/cmd/Imakefile.NEW Wed Apr 3 21:28:25 1991 *************** *** 8,16 **** NormalObjectRule() ProgramTarget(arpadate, arpadate.o, ${LIBS},) InstallProgram(arpadate, ${DESTDIR}/etc/) ! ProgramTarget(decode_id, decodeid.o, ${LIBS},) InstallProgram(decode_id, $(DESTDIR)/etc/) - ProgramTarget(ams_genid, amsgenid.o, ${LIBS},) InstallProgram(ams_genid, $(DESTDIR)/etc/) DependTarget() --- 8,16 ---- NormalObjectRule() ProgramTarget(arpadate, arpadate.o, ${LIBS},) InstallProgram(arpadate, ${DESTDIR}/etc/) ! ProgramTarget(decode_id, decodeid.o, ${LIBS},${NETLIBS}) ! ProgramTarget(ams_genid, amsgenid.o, ${LIBS},${NETLIBS}) InstallProgram(decode_id, $(DESTDIR)/etc/) InstallProgram(ams_genid, $(DESTDIR)/etc/) DependTarget() *** overhead/malloc/malloc.ci Fri Dec 21 15:02:48 1990 --- overhead/malloc/malloc.ci.NEW Tue May 28 17:50:29 1991 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1990 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v 2.15 90/10/31 15:13:10 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v 2.15 90/10/31 15:13:10 gk5g Exp $ "; #endif /* lint */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1990 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v 2.19 1991/05/28 21:49:36 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v 2.19 1991/05/28 21:49:36 gk5g Exp $ "; #endif /* lint */ /* *************** *** 56,66 **** #include #include - #ifdef _IBMR2 - #define malloc foobarbaz - #define realloc zabraboof - #endif _IBMR2 - static char msgbuf[200]; #define ferr4(fmt, a, b, c, d) {sprintf(msgbuf, fmt, a, b, c, d); \ write(2, msgbuf, strlen(msgbuf));} --- 56,61 ---- *************** *** 1045,1051 **** void AbortFullMessage (nbytes) register unsigned int nbytes; { register siz, segbytes; ! #ifdef hpux int rlp; #else /* hpux */ #ifdef AIX --- 1040,1046 ---- void AbortFullMessage (nbytes) register unsigned int nbytes; { register siz, segbytes; ! #if defined(hpux) || defined(M_UNIX) int rlp; #else /* hpux */ #ifdef AIX *************** *** 1061,1067 **** segbytes = ((siz+2*EPSILON+(SEGGRAIN-1)) / SEGGRAIN) * SEGGRAIN; ! #ifdef hpux rlp = ulimit(3, 0); if ((int)sbrk(0)+segbytes > etext+rlp) sprintf(buf, "Malloc abort. Attempt to allocate %d bytes caused data segment to exceed its maximum of %d bytes.\n", --- 1056,1062 ---- segbytes = ((siz+2*EPSILON+(SEGGRAIN-1)) / SEGGRAIN) * SEGGRAIN; ! #if defined(hpux) || defined(M_UNIX) rlp = ulimit(3, 0); if ((int)sbrk(0)+segbytes > etext+rlp) sprintf(buf, "Malloc abort. Attempt to allocate %d bytes caused data segment to exceed its maximum of %d bytes.\n", *** overhead/malloc/plumber.ci Mon Aug 6 11:15:32 1990 --- overhead/malloc/plumber.ci.NEW Thu May 9 15:06:09 1991 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v 2.9 90/06/11 15:18:17 wjh Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v 2.9 90/06/11 15:18:17 wjh Exp $ "; #endif /* lint */ /* --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v 2.11 1991/05/09 19:04:54 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v 2.11 1991/05/09 19:04:54 gk5g Exp $ "; #endif /* lint */ /* *************** *** 22,27 **** --- 22,28 ---- will be in multiple segments. The code here only processes the last of these. */ + #include #include #include #include *** overhead/parsec/Imakefile Wed Nov 22 13:55:09 1989 --- overhead/parsec/Imakefile.NEW Thu Jun 13 16:21:41 1991 *************** *** 2,7 **** --- 2,10 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + #if defined(sys_ps_aix12) || defined(sys_ps_aix11) + CDEBUGFLAGS = + #endif STRIPCPPLINES = egrep -v -f pat.grp YYHIDE = ./yyhide -vv *************** *** 13,25 **** NormalObjectRule() LibraryTarget(libpparsec.a, ${POBJS}) ! ProgramTarget(yyhide, yyhide.o, libpparsec.a, ${UTILLIB}) LibraryTarget(libparsec.a, ${OBJS}) CleanTarget(preyyhide pparsec.h parsec.h lex.yy.c y.tab.c y.tab.h y.output pgrammar.c ptokens.c grammar.c tokens.c) InstallFile(parsec.h, ${INSTINCFLAGS}, ${DESTDIR}/include) ! InstallDocs(parsec.d yyhide.d, ${DESTDIR}/doc) InstallProgram(yyhide, ${DESTDIR}/bin) InstallLibrary(libparsec.a, ${DESTDIR}/lib) --- 16,28 ---- NormalObjectRule() LibraryTarget(libpparsec.a, ${POBJS}) ! ProgramTarget(yyhide, yyhide.o, libpparsec.a, ${UTILLIB} ${SUPLIBS}) LibraryTarget(libparsec.a, ${OBJS}) CleanTarget(preyyhide pparsec.h parsec.h lex.yy.c y.tab.c y.tab.h y.output pgrammar.c ptokens.c grammar.c tokens.c) InstallFile(parsec.h, ${INSTINCFLAGS}, ${DESTDIR}/include) ! InstallDocs(parsec.doc yyhide.doc, ${DESTDIR}/doc) InstallProgram(yyhide, ${DESTDIR}/bin) InstallLibrary(libparsec.a, ${DESTDIR}/lib) *** overhead/parsec/parsec.d Wed Nov 22 13:54:32 1989 --- overhead/parsec/parsec.d.NEW Tue Apr 9 19:17:08 1991 *************** *** 1,4 **** ! \begindata{text,269215348} \textdsversion{12} \template{default} \define{indent --- 1,4 ---- ! \begindata{text,269346388} \textdsversion{12} \template{default} \define{indent *************** *** 363,371 **** }} ! \begindata{bp,269274080} ! \enddata{bp,269274080} ! \view{bpv,269274080,7,0,0} \heading{Example }Following is a trivial example of a parsec application. This program tries --- 363,371 ---- }} ! \begindata{bp,269238460} ! \enddata{bp,269238460} ! \view{bpv,269238460,6,0,0} \heading{Example }Following is a trivial example of a parsec application. This program tries *************** *** 421,426 **** --- 421,429 ---- \} + PC_DumpTokens(Tree, tokenVector); /}\italic{* Fill the token vector with + tokens *}\typewriter{/ + for (i = 0; i < numTokens; ++i) \{ if (!(i % 6)) *************** *** 461,475 **** July 1989 ! \begindata{bp,269273924} ! \enddata{bp,269273924} ! \view{bpv,269273924,8,0,0} \center{\bold{\bigger{Appendix }}} The grammar recognized by the PC_Parse function follows\footnote{\ ! \begindata{fnote,269273596} \textdsversion{12} \define{italic menu:[Font~1,Italic~11] --- 464,478 ---- July 1989 ! \begindata{bp,269497656} ! \enddata{bp,269497656} ! \view{bpv,269497656,7,0,0} \center{\bold{\bigger{Appendix }}} The grammar recognized by the PC_Parse function follows\footnote{\ ! \begindata{fnote,269326356} \textdsversion{12} \define{italic menu:[Font~1,Italic~11] *************** *** 477,484 **** This grammar corresponds almost exactly to the one given in Appendix B of \italic{The C Programming Language, Second Edition}, by B.W. Kernighan and D.M. Ritchie [Prentice-Hall, NJ].\ ! \enddata{fnote,269273596} ! \view{fnotev,269273596,9,0,0}}. In this grammar, lower_case strings are production names, UPPER_CASE strings are input tokens, and single typographical characters (like this exclamation point\bold{!}) are in boldface and are also input tokens. Italicized numbers in parentheses enumerate the --- 480,487 ---- This grammar corresponds almost exactly to the one given in Appendix B of \italic{The C Programming Language, Second Edition}, by B.W. Kernighan and D.M. Ritchie [Prentice-Hall, NJ].\ ! \enddata{fnote,269326356} ! \view{fnotev,269326356,8,0,0}}. In this grammar, lower_case strings are production names, UPPER_CASE strings are input tokens, and single typographical characters (like this exclamation point\bold{!}) are in boldface and are also input tokens. Italicized numbers in parentheses enumerate the *************** *** 1120,1126 **** Without folding, the parse tree for this file looks like this: ! \begindata{zip,269370100} %ViewWidth 438 %ViewHeight 268 *D;-1000,1400 --- 1123,1129 ---- Without folding, the parse tree for this file looks like this: ! \begindata{zip,269132212} %ViewWidth 438 %ViewHeight 268 *D;-1000,1400 *************** *** 1185,1200 **** *C;788,-985 >788,-1147 ! \enddata{zip,269370100} ! \view{zipview,269370100,10,0,270} ! \begindata{bp,269636648} ! \enddata{bp,269636648} ! \view{bpv,269636648,11,0,0} With folding, the parse tree is abbreviated to this: ! \begindata{zip,269608632} %ViewWidth 526 %ViewHeight 180 %ObjectWidth 571 --- 1188,1203 ---- *C;788,-985 >788,-1147 ! \enddata{zip,269132212} ! \view{zipview,269132212,9,0,270} ! \begindata{bp,269234492} ! \enddata{bp,269234492} ! \view{bpv,269234492,10,0,0} With folding, the parse tree is abbreviated to this: ! \begindata{zip,269127604} %ViewWidth 526 %ViewHeight 180 %ObjectWidth 571 *************** *** 1219,1226 **** *C;-8,176 >801,-304 ! \enddata{zip,269608632} ! \view{zipview,269608632,12,573,182} The uses of Parsec are numerous, however its usefulness is limited by the fact that it can only recognize C code proper; all pre-processor macros must be --- 1222,1229 ---- *C;-8,176 >801,-304 ! \enddata{zip,269127604} ! \view{zipview,269127604,11,573,182} The uses of Parsec are numerous, however its usefulness is limited by the fact that it can only recognize C code proper; all pre-processor macros must be *************** *** 1236,1239 **** selected identifiers static. It can also be used to write source-code indenters, call-graph generators, etc. ! \enddata{text,269215348} --- 1239,1242 ---- selected identifiers static. It can also be used to write source-code indenters, call-graph generators, etc. ! \enddata{text,269346388} *** overhead/parsec/parsec.doc Thu May 30 20:50:06 1991 --- overhead/parsec/parsec.doc.NEW Tue Apr 9 19:17:11 1991 *************** *** 0 **** --- 1,1242 ---- + \begindata{text,269346388} + \textdsversion{12} + \template{default} + \define{indent + menu:[Region~4,Indent~20] + attr:[LeftMargin LeftMargin Cm 41615] + attr:[RightMargin RightMargin Cm 41615]} + \define{footnote + + attr:[Flags OverBar Int Set] + attr:[FontSize PreviousFontSize Point -2]} + \center{\bold{\bigger{PARSEC + + }A library for parsing C programs + + }by Bob Glickstein + + } + \heading{Introduction + + }Parsec is a link-time object library which exports a number of functions + useful in the parsing of C program source. The main routine of parsec, + PC_Parse, returns a tree (whose structure is described in the Appendix) + representing the parsed version of the input. This tree can then be used to + perform analysis of or transformations upon the input. + + + \heading{Library Routines + + }These are the functions exported by libparsec.a. To use them, you must + include the header file parsec.h. + + + \bold{PC_Child} \smaller{[macro]} + + \indent{\typewriter{PC_ParseNode_t *\bold{PC_Child}(node, num) + + PC_ParseNode_t *node; + + int num; + + }\indent{Returns the \italic{num}\superscript{th} child of node \italic{node}. + \italic{Num} can be any number between 0 and + \bold{PC_NumChildren}(\italic{node}) - 1, inclusive. The operation is only + meaningful when performed on nodes of which both + \bold{PC_IsProductionNode}(\italic{node}) and + (\bold{PC_NumChildren}(\italic{node}) > 0) are true. + + }} + \bold{PC_CountTokens} + + \indent{\typewriter{int \bold{PC_CountTokens}(node) + + PC_ParseNode_t *node; + + }\indent{Returns the number of tokens required to recreate the original source + code associated with \italic{node}. Most useful when used in conjunction with + malloc to create a properly-sized buffer for \bold{PC_DumpTokens}. + + }} + \bold{PC_DumpTokens} + + \indent{\typewriter{int \bold{PC_DumpTokens}(node, tokvec) + + PC_ParseNode_t *node; + + PC_Token_t *tokvec; + + }\indent{\italic{Tokvec} is an array of tokens. \bold{PC_DumpTokens} fills + this array with the sequence of tokens representing the input corresponding to + \italic{node}. The result of this function should always equal + \bold{PC_CountTokens}(\italic{node}). + + }} + \bold{PC_IsCharToken} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_IsCharToken}(tok) + + PC_Token_t *tok; + + }\indent{Returns non-zero if \italic{tok} is a token corresponding to a single + character, otherwise returns zero. + + }} + \bold{PC_IsEnumerator} + + \indent{\typewriter{int \bold{PC_IsEnumerator}(str) + + char *str; + + }\indent{Returns non-zero if the null-terminated string \italic{str} is the + name of an enumeration constant defined in the input, otherwise returns zero. + + }} + \bold{PC_IsProductionNode} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_IsProductionNode}(node) + + PC_ParseNode_t *node; + + }\indent{Returns non-zero if \italic{node} is a production (non-token) node, + otherwise returns zero. + + }} + \bold{PC_IsTextToken} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_IsTextToken}(tok) + + PC_Token_t *tok; + + }\indent{Returns non-zero if \italic{tok} is a token containing a string of + text, otherwise returns zero. + + }} + \bold{PC_IsTokenNode} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_IsTokenNode}(node) + + PC_ParseNode_t *node; + + }\indent{Returns non-zero if \italic{node} is a token (non-production) node, + otherwise returns zero. + + }} + \bold{PC_IsTypedef} + + \indent{\typewriter{int PC_IsTypedef(str) + + char *str; + + }\indent{Returns non-zero if the null-terminated string \italic{str} is the + name of a typedef defined in the input, otherwise returns zero. + + }} + \bold{PC_NodeToken} \smaller{[macro]} + + \indent{\typewriter{PC_Token_t *\bold{PC_NodeToken}(node) + + PC_ParseNode_t *node; + + }\indent{Returns the token associated with \italic{node}. This operation is + only meaningful when performed on nodes of which + \bold{PC_IsTokenNode}(\italic{node}) is true. + + }} + \bold{PC_NodeType} \smaller{[macro]} + + \indent{\typewriter{PC_ParseNodeType_t \bold{PC_NodeType}(node) + + PC_ParseNode_t *node; + + }\indent{Returns the production type of \italic{node} (meaningful both for + production nodes and token nodes). The possible values for ``production + types'' are outlined in the Appendix. + + }} + \bold{PC_NumChildren} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_NumChildren}(node) + + PC_ParseNode_t *node; + + }\indent{Returns the number of children of \italic{node}. This operation is + only meaningful when performed on nodes of which + \bold{PC_IsProductionNode}(\italic{node}) is true. + + }} + \bold{PC_Parse} + + \indent{\typewriter{PC_ParseNode_t *\bold{PC_Parse}(fold) + + int fold; + + }\indent{Parses a C program on the standard input and returns the parse tree. + Will return NULL if a parsing error occurred, in which case the variable + \bold{PC_ParseError} (type: char *) \italic{might} point to a null-terminated + string describing the error (or it might be NULL). If \italic{fold} is + non-zero, then the parse tree will be abbreviated as described in the + Appendix. Such abbreviation makes some parse information slightly more + obscure, but saves a great deal of memory. + + }} + \bold{PC_PostWalkTree} + + \indent{\typewriter{int \bold{PC_PostWalkTree}(node, func, + combine, leafVal) + + PC_ParseNode_t *node; + + int (*func)(), combine, leafVal; + + }\indent{Performs a post-order traversal of the tree rooted at \italic{node}. + After a node's children are recursively visited, \italic{func} is applied to + the node. Returns the value of \italic{func} applied to the tree root + \italic{node}. \italic{Func} is a pointer to an integer function of four + arguments. These arguments are: PC_ParseNode_t *\italic{Node}, int + \italic{Depth}, int \italic{ChildrenVal} and int \italic{WhichChild}. + \italic{Node} is the current node to which \italic{func} is being applied; + \italic{Depth} is \italic{Node}'s depth in the tree relative to \italic{node} + (\italic{node} is at depth 0); \italic{ChildrenVal} is the combination of the + results of \italic{func} applied to \italic{Node}'s children; and + \italic{WhichChild} is a non-negative integer specifying which child of + \italic{Node}'s parent \italic{Node} is (except that \italic{WhichChild} is -1 + for the tree root \italic{node}). The \italic{combine} argument to + \bold{PC_PostWalkTree} specifies how the values of \italic{func} applied to + the children of a node should be combined and passed back to the parent as the + \italic{ChildrenVal} argument. The possible values for \italic{combine} are: + + \indent{\description{PC_COMBINE_ADD, which adds + \italic{func}(child\subscript{0}), ..., \italic{func}(child\subscript{n}) + together; + + PC_COMBINE_LOR, which does a logical or of \italic{func}(child\subscript{0}), + ..., \italic{func}(child\subscript{n}); + + PC_COMBINE_BITOR, which does a bitwise or of + \italic{func}(child\subscript{0}), ..., \italic{func}(child\subscript{n}); + + PC_COMBINE_LXOR, which does a logical exclusive-or of + \italic{func}(child\subscript{0}), ..., \italic{func}(child\subscript{n}); + + PC_COMBINE_BITXOR, which does a bitwise exclusive-or of + \italic{func}(child\subscript{0}), ..., \italic{func}(child\subscript{n}); + + PC_COMBINE_LAND, which does a logical and of + \italic{func}(child\subscript{0}), ..., \italic{func}(child\subscript{n}); + + PC_COMBINE_BITAND, which does a bitwise and of + \italic{func}(child\subscript{0}), ..., \italic{func}(child\subscript{n}); + + PC_COMBINE_MULTIPLY, which multiplies \italic{func}(child\subscript{0}), ..., + \italic{func}(child\subscript{n}) together. + + }}The \italic{leafVal} argument specifies what to pass as \italic{ChildrenVal} + when \italic{func} is applied to nodes with no children. + + }} + \bold{PC_PreWalkTree} + + \indent{\typewriter{int \bold{PC_PreWalkTree}(node, func, + rootVal) + + PC_ParseNode_t *node; + + int (*func)(), rootVal; + + }\indent{Performs a pre-order traversal of the tree rooted at \italic{node}. + Applies \italic{func} to a node and then recursively descends its children. + Returns the value of \italic{func} applied to the tree root \italic{node}. + \italic{Func} is a pointer to an integer function of five arguments. These + arguments are: PC_ParseNode_t *\italic{Node}, int \italic{Depth}, int + *\italic{Descend}, int \italic{ParentVal} and int \italic{WhichChild}. + \italic{Node} is the current node to which \italic{func} is being applied; + \italic{Depth} is \italic{Node}'s depth in the tree relative to \italic{node} + (\italic{node} is at depth 0); \italic{Descend} is a pointer to an integer + (explained below); \italic{ParentVal} is the result of \italic{func} applied + to \italic{Node}'s parent; and \italic{WhichChild} is a non-negative integer + specifying which child of \italic{Node}'s parent \italic{Node} is (except that + \italic{WhichChild} is -1 for the tree root \italic{node}). The integer + pointed to by \italic{Descend} is initially 1, but if it is set to zero, it + indicates to \bold{PC_PreWalkTree} that \italic{Node}'s children are not to be + recursively descended (this is useful in tree-pruning). The \italic{rootVal} + argument specifies what to pass as \italic{ParentVal} when \italic{func} is + applied to the tree root \italic{node}. + + }} + \bold{PC_SetCharToken} + + \indent{\typewriter{void \bold{PC_SetCharToken}(tok, c) + + PC_Token_t *tok; + + char c; + + }\indent{Makes \italic{tok} a character-token containing the character + \italic{c}. + + }} + \bold{PC_SetTextToken} + + \indent{\typewriter{void \bold{PC_SetTextToken}(tok, val, str) + + PC_Token_t *tok; + + int val; + + char *str; + + }\indent{Makes \italic{tok} a text-token with value \italic{val} and + containing the string \italic{str}. Possible values for \italic{val} are + outlined in the Appendix. + + }} + \bold{PC_SetToken} + + \indent{\typewriter{void \bold{PC_SetToken}(tok, val) + + PC_Token_t *tok; + + int val; + + }\indent{Makes \italic{tok} a non-character, non-text token (that is to say, + an encoded token) whose value is \italic{val}. Possible values for + \italic{val} are outlined in the Appendix. + + }} + \bold{PC_SubType} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_SubType}(node) + + PC_ParseNode_t *node; + + }\indent{Returns the production subtype of \italic{node}; consult the Appendix + for information about interpreting production types and subtypes. This + operation is only meaningful when performed on nodes of which + \bold{PC_IsProductionNode}(\italic{node}) is true. + + }} + \bold{PC_TokenChar} \smaller{[macro]} + + \indent{\typewriter{char \bold{PC_TokenChar}(tok) + + PC_Token_t *tok; + + }\indent{Returns the character associated with the token \italic{tok}. This + operation is only meaningful when performed on tokens of which + \bold{PC_IsCharToken}(\italic{tok}) is true. + + }} + \bold{PC_TokenChars} + + \indent{\typewriter{char *\bold{PC_TokenChars}(tok) + + PC_Token_t *tok; + + }\indent{Returns a null-terminated string containing a representation of the + token \italic{tok}; this representation corresponds to the input form of the + token. The result is returned in a static buffer which is overwritten with + each call. + + }} + \bold{PC_TokenText} \smaller{[macro]} + + \indent{\typewriter{char *\bold{PC_TokenText}(tok) + + PC_Token_t *tok; + + }\indent{Returns the text string associated with \italic{tok}. This operation + is only meaningful when performed on tokens of which + \bold{PC_IsTextToken}(\italic{tok}) is true. + + }} + \bold{PC_TokenVal} \smaller{[macro]} + + \indent{\typewriter{int \bold{PC_TokenVal}(tok) + + PC_Token_t *tok; + + }\indent{Returns the token code associated with \italic{tok}. Possible values + are outlined in the Appendix. This operation is only meaningful when + performed on tokens of which neither \bold{PC_IsCharToken}(\italic{tok}) nor + \bold{PC_IsTextToken}(\italic{tok}) is true. + + }} + + \begindata{bp,269137804} + \enddata{bp,269137804} + \view{bpv,269137804,12,0,0} + \heading{Example + + }Following is a trivial example of a parsec application. This program tries + to parse its input. If the input is a syntactically valid C module, then the + module is reproduced on the standard output, one token at a time; otherwise, + an error is reported. + + + \smaller{\indent{\typewriter{#include + + #include + + + \bold{main}() + + \{ + + PC_ParseNode_t *Tree; + + PC_Token_t *tokenVector; + + int numTokens, i; + + extern char *malloc(); + + + Tree = PC_Parse(1); /}\italic{* Folding is "on" + *}\typewriter{/ + + if (!Tree) \{ + + fprintf(stderr, + + "Input is not a syntactically valid C program\\n"); + + exit(1); + + \} + + numTokens = PC_CountTokens(Tree); + + tokenVector = (PC_Token_t *) + + malloc(numTokens * + + (sizeof(PC_Token_t))); + + if (!tokenVector) \{ + + fprintf(stderr, "Out of memory\\n"); + + exit(1); + + \} + + \typewriter{ PC_DumpTokens(Tree, tokenVector); /}}\italic{* Fill the token + vector with tokens *}\typewriter{\typewriter{/ + + } for (i = 0; i < numTokens; ++i) \{ + + if (!(i % 6)) + + putchar('\\n'); /}\italic{* Every six tokens, print a + newline *}\typewriter{/ + + printf("%s ", + + PC_TokenChars(&(tokenVector[i]))); + + \} + + putchar('\\n'); /}\italic{* Finish up with another + newline *}\typewriter{/ + + exit(0); /}\italic{* Normal termination + *}\typewriter{/ + + \} + + }}} + \heading{Bugs + + }PC_Parse currently can only read the standard input. + + There is no facility for identifying syntax errors in the input, except that + one did or did not occur. + + The parser is pretty slow. + + Pre-processor directives are not handled. + + + \heading{Author + + }Bob Glickstein, Information Technology Center, Carnegie Mellon University + + July 1989 + + \begindata{bp,269320804} + \enddata{bp,269320804} + \view{bpv,269320804,13,0,0} + \center{\bold{\bigger{Appendix + + }}} + The grammar recognized by the PC_Parse function + follows\footnote{\ + \begindata{fnote,269700720} + \textdsversion{12} + \define{italic + menu:[Font~1,Italic~11] + attr:[FontFace Italic Int Set]} + This grammar corresponds almost exactly to the one given in Appendix B of + \italic{The C Programming Language, Second Edition}, by B.W. Kernighan and + D.M. Ritchie [Prentice-Hall, NJ].\ + \enddata{fnote,269700720} + \view{fnotev,269700720,14,0,0}}. In this grammar, lower_case strings are + production names, UPPER_CASE strings are input tokens, and single + typographical characters (like this exclamation point\bold{!}) are in boldface + and are also input tokens. Italicized numbers in parentheses enumerate the + different rules for a given production. When such a number is followed by an + asterisk, it indicates that the node emitted is a token node rather than a + production node. + + + \indent{module \italic{(1)} ::= external_declaration + + module \italic{(2)} ::= module external_declaration + + + external_declaration \italic{(1)} ::= function_definition + + external_declaration \italic{(2)} ::= declaration + + + function_definition \italic{(1)} ::= declarator function_body + + function_definition \italic{(2)} ::= declaration_specifiers declarator + function_body + + + function_body \italic{(1)} ::= compound_statement + + function_body \italic{(2)} ::= declaration_list compound_statement + + + declaration \italic{(1)} ::= declaration_specifiers \bold{;} + + declaration \italic{(2)} ::= declaration_specifiers init_declarator_list + \bold{;} + + + declaration_list \italic{(1)} ::= declaration + + declaration_list \italic{(2)} ::= declaration_list declaration + + + declaration_specifiers \italic{(1)} ::= storage_class_specifier + + declaration_specifiers \italic{(2)} ::= storage_class_specifier + declaration_specifiers + + declaration_specifiers \italic{(3)} ::= type_specifier + + declaration_specifiers \italic{(4)} ::= type_specifier declaration_specifiers + + declaration_specifiers \italic{(5)} ::= type_qualifier + + declaration_specifiers \italic{(6)} ::= type_qualifier declaration_specifiers + + + storage_class_specifier \italic{(1*)} ::= PC_AUTO + + storage_class_specifier \italic{(2*)} ::= PC_REGISTER + + storage_class_specifier \italic{(3*)} ::= PC_STATIC + + storage_class_specifier \italic{(4*)} ::= PC_EXTERN + + storage_class_specifier \italic{(5*)} ::= PC_TYPEDEF + + + type_specifier \italic{(1*)} ::= PC_VOID + + type_specifier \italic{(2*)} ::= PC_CHAR + + type_specifier \italic{(3*)} ::= PC_SHORT + + type_specifier \italic{(4*)} ::= PC_INT + + type_specifier \italic{(5*)} ::= PC_LONG + + type_specifier \italic{(6*)} ::= PC_FLOAT + + type_specifier \italic{(7*)} ::= PC_DOUBLE + + type_specifier \italic{(8*)} ::= PC_SIGNED + + type_specifier \italic{(9*)} ::= PC_UNSIGNED + + type_specifier \italic{(10)} ::= struct_or_union_specifier + + type_specifier \italic{(11)} ::= enum_specifier + + type_specifier \italic{(12*)} ::= PC_TYPEDEF_NAME + + + type_qualifier \italic{(1*)} ::= PC_CONST + + type_qualifier \italic{(2*)} ::= PC_VOLATILE + + + struct_or_union_specifier \italic{(1)} ::= struct_or_union \bold{\{} + struct_declaration_list \bold{\}} + + struct_or_union_specifier \italic{(2)} ::= struct_or_union identifier \bold{\{} + struct_declaration_list \bold{\}} + + struct_or_union_specifier \italic{(3)} ::= struct_or_union identifier + + + struct_or_union \italic{(1*)} ::= PC_STRUCT + + struct_or_union \italic{(2*)} ::= PC_UNION + + + struct_declaration_list \italic{(1)} ::= struct_declaration + + struct_declaration_list \italic{(2)} ::= struct_declaration_list + struct_declaration + + + init_declarator_list \italic{(1)} ::= init_declarator + + init_declarator_list \italic{(2)} ::= init_declarator_list \bold{,} + init_declarator + + + init_declarator \italic{(1)} ::= declarator + + init_declarator \italic{(2)} ::= declarator \bold{=} initializer + + + struct_declaration \italic{(1)} ::= specifier_qualifier_list + struct_declarator_list \bold{;} + + + specifier_qualifier_list \italic{(1)} ::= type_specifier + + specifier_qualifier_list \italic{(2)} ::= type_specifier + specifier_qualifier_list + + specifier_qualifier_list \italic{(3)} ::= type_qualifier + + specifier_qualifier_list \italic{(4)} ::= type_qualifier + specifier_qualifier_list + + + struct_declarator_list \italic{(1)} ::= struct_declarator + + struct_declarator_list \italic{(2)} ::= struct_declarator_list \bold{,} + struct_declarator + + + struct_declarator \italic{(1)} ::= declarator + + struct_declarator \italic{(2)} ::= \bold{:} constant_expression + + struct_declarator \italic{(3)} ::= declarator \bold{:} constant_expression + + + enum_specifier \italic{(1)} ::= PC_ENUM \bold{\{} enumerator_list \bold{\}} + + enum_specifier \italic{(2)} ::= PC_ENUM identifier \bold{\{} enumerator_list + \bold{\}} + + enum_specifier \italic{(3)} ::= PC_ENUM identifier + + + enumerator_list \italic{(1)} ::= enumerator + + enumerator_list \italic{(2)} ::= enumerator_list \bold{,} enumerator + + + enumerator \italic{(1)} ::= identifier + + enumerator \italic{(2)} ::= identifier \bold{=} constant_expression + + + declarator \italic{(1)} ::= direct_declarator + + declarator \italic{(2)} ::= pointer direct_declarator + + + direct_declarator \italic{(1)} ::= identifier + + direct_declarator \italic{(2)} ::= \bold{(} declarator \bold{)} + + direct_declarator \italic{(3)} ::= direct_declarator \bold{[} \bold{]} + + direct_declarator \italic{(4)} ::= direct_declarator \bold{[} + constant_expression \bold{]} + + direct_declarator \italic{(5)} ::= direct_declarator \bold{(} + parameter_type_list \bold{)} + + direct_declarator \italic{(6)} ::= direct_declarator \bold{(} \bold{)} + + direct_declarator \italic{(7)} ::= direct_declarator \bold{(} identifier_list + \bold{)} + + + pointer \italic{(1)} ::= \bold{*} + + pointer \italic{(2)} ::= \bold{*} type_qualifier_list + + pointer \italic{(3)} ::= \bold{*} pointer + + pointer \italic{(4)} ::= \bold{*} type_qualifier_list pointer + + + type_qualifier_list \italic{(1)} ::= type_qualifier + + type_qualifier_list \italic{(2)} ::= type_qualifier_list type_qualifier + + + parameter_type_list \italic{(1)} ::= parameter_list + + parameter_type_list \italic{(2)} ::= parameter_list \bold{,} PC_ELLIPSIS + + + parameter_list \italic{(1)} ::= parameter_declaration + + parameter_list \italic{(2)} ::= parameter_list \bold{,} parameter_declaration + + + parameter_declaration \italic{(1)} ::= declaration_specifiers declarator + + parameter_declaration \italic{(2)} ::= declaration_specifiers + + parameter_declaration \italic{(3)} ::= declaration_specifiers + abstract_declarator + + + identifier_list \italic{(1)} ::= identifier + + identifier_list \italic{(2)} ::= identifier_list \bold{,} identifier + + + initializer \italic{(1)} ::= assignment_expression + + initializer \italic{(2)} ::= \bold{\{} initializer_list \bold{\}} + + initializer \italic{(3)} ::= \bold{\{} initializer_list \bold{,} \bold{\}} + + + initializer_list \italic{(1)} ::= initializer + + initializer_list \italic{(2)} ::= initializer_list \bold{,} initializer + + + type_name \italic{(1)} ::= specifier_qualifier_list + + type_name \italic{(2)} ::= specifier_qualifier_list abstract_declarator + + + abstract_declarator \italic{(1)} ::= pointer + + abstract_declarator \italic{(2)} ::= direct_abstract_declarator + + abstract_declarator \italic{(3)} ::= pointer direct_abstract_declarator + + + direct_abstract_declarator \italic{(1)} ::= \bold{(} abstract_declarator + \bold{)} + + direct_abstract_declarator \italic{(2)} ::= \bold{[} \bold{]} + + direct_abstract_declarator \italic{(3)} ::= \bold{[} constant_expression + \bold{]} + + direct_abstract_declarator \italic{(4)} ::= direct_abstract_declarator \bold{[} + \bold{]} + + direct_abstract_declarator \italic{(5)} ::= direct_abstract_declarator \bold{[} + constant_expression \bold{]} + + direct_abstract_declarator \italic{(6)} ::= \bold{(} \bold{)} + + direct_abstract_declarator \italic{(7)} ::= \bold{(} parameter_type_list + \bold{)} + + direct_abstract_declarator \italic{(8)} ::= direct_abstract_declarator \bold{(} + \bold{)} + + direct_abstract_declarator \italic{(9)} ::= direct_abstract_declarator \bold{(} + parameter_type_list \bold{)} + + + statement \italic{(1)} ::= labeled_statement + + statement \italic{(2)} ::= expression_statement + + statement \italic{(3)} ::= compound_statement + + statement \italic{(4)} ::= selection_statement + + statement \italic{(5)} ::= iteration_statement + + statement \italic{(6)} ::= jump_statement + + + labeled_statement \italic{(1)} ::= identifier \bold{:} statement + + labeled_statement \italic{(2)} ::= PC_CASE constant_expression \bold{:} + statement + + labeled_statement \italic{(3)} ::= PC_DEFAULT \bold{:} statement + + + expression_statement \italic{(1)} ::= \bold{;} + + expression_statement \italic{(2)} ::= expression \bold{;} + + + compound_statement \italic{(1)} ::= \bold{\{} \bold{\}} + + compound_statement \italic{(2)} ::= \bold{\{} declaration_list \bold{\}} + + compound_statement \italic{(3)} ::= \bold{\{} statement_list \bold{\}} + + compound_statement \italic{(4)} ::= \bold{\{} declaration_list statement_list + \bold{\}} + + + statement_list \italic{(1)} ::= statement + + statement_list \italic{(2)} ::= statement_list statement + + + selection_statement \italic{(1)} ::= PC_IF \bold{(} expression \bold{)} + statement + + selection_statement \italic{(2)} ::= PC_IF \bold{(} expression \bold{)} + statement PC_ELSE statement + + selection_statement \italic{(3)} ::= PC_SWITCH \bold{(} expression \bold{)} + statement + + + iteration_statement \italic{(1)} ::= PC_WHILE \bold{(} expression \bold{)} + statement + + iteration_statement \italic{(2)} ::= PC_DO statement PC_WHILE \bold{(} + expression \bold{)} \bold{;} + + iteration_statement \italic{(3)} ::= PC_FOR \bold{(} \bold{;} \bold{;} \bold{)} + statement + + iteration_statement \italic{(4)} ::= PC_FOR \bold{(} expression \bold{;} + \bold{;} \bold{)} statement + + iteration_statement \italic{(5)} ::= PC_FOR \bold{(} \bold{;} expression + \bold{;} \bold{)} statement + + iteration_statement \italic{(6)} ::= PC_FOR \bold{(} \bold{;} \bold{;} + expression \bold{)} statement + + iteration_statement \italic{(7)} ::= PC_FOR \bold{(} \bold{;} expression + \bold{;} expression \bold{)} statement + + iteration_statement \italic{(8)} ::= PC_FOR \bold{(} expression \bold{;} + \bold{;} expression \bold{)} statement + + iteration_statement \italic{(9)} ::= PC_FOR \bold{(} expression \bold{;} + expression \bold{;} \bold{)} statement + + iteration_statement \italic{(10)} ::= PC_FOR \bold{(} expression \bold{;} + expression \bold{;} expression \bold{)} statement + + + jump_statement \italic{(1)} ::= PC_GOTO identifier \bold{;} + + jump_statement \italic{(2)} ::= PC_CONTINUE \bold{;} + + jump_statement \italic{(3)} ::= PC_BREAK \bold{;} + + jump_statement \italic{(4)} ::= PC_RETURN \bold{;} + + jump_statement \italic{(5)} ::= PC_RETURN expression \bold{;} + + + expression \italic{(1)} ::= assignment_expression + + expression \italic{(2)} ::= expression \bold{,} assignment_expression + + + + assignment_expression \italic{(1)} ::= conditional_expression + + assignment_expression \italic{(2)} ::= unary_expression assignment_operator + assignment_expression + + + assignment_operator \italic{(1*)} ::= \bold{=} + + assignment_operator \italic{(2*)} ::= PC_MULASSIGN + + assignment_operator \italic{(3*)} ::= PC_DIVASSIGN + + assignment_operator \italic{(4*)} ::= PC_MODASSIGN + + assignment_operator \italic{(5*)} ::= PC_ADDASSIGN + + assignment_operator \italic{(6*)} ::= PC_SUBASSIGN + + assignment_operator \italic{(7*)} ::= PC_LEFTASSIGN + + assignment_operator \italic{(8*)} ::= PC_RIGHTASSIGN + + assignment_operator \italic{(9*)} ::= PC_ANDASSIGN + + assignment_operator \italic{(10*)} ::= PC_XORASSIGN + + assignment_operator \italic{(11*)} ::= PC_ORASSIGN + + + conditional_expression \italic{(1)} ::= logical_or_expression + + conditional_expression \italic{(2)} ::= logical_or_expression \bold{?} + expression \bold{:} conditional_expression + + + constant_expression \italic{(1)} ::= conditional_expression + + + logical_or_expression \italic{(1)} ::= logical_and_expression + + logical_or_expression \italic{(2)} ::= logical_or_expression PC_LOGICAL_OR + logical_and_expression + + + logical_and_expression \italic{(1)} ::= inclusive_or_expression + + logical_and_expression \italic{(2)} ::= logical_and_expression PC_LOGICAL_AND + inclusive_or_expression + + + inclusive_or_expression \italic{(1)} ::= exclusive_or_expression + + inclusive_or_expression \italic{(2)} ::= inclusive_or_expression \bold{|} + exclusive_or_expression + + + exclusive_or_expression \italic{(1)} ::= and_expression + + exclusive_or_expression \italic{(2)} ::= exclusive_or_expression \bold{^} + and_expression + + + and_expression \italic{(1)} ::= equality_expression + + and_expression \italic{(2)} ::= and_expression \bold{&} equality_expression + + + equality_expression \italic{(1)} ::= relational_expression + + equality_expression \italic{(2)} ::= equality_expression PC_EQUAL + relational_expression + + equality_expression \italic{(3)} ::= equality_expression PC_NOT_EQUAL + relational_expression + + + relational_expression \italic{(1)} ::= shift_expression + + relational_expression \italic{(2)} ::= relational_expression \bold{<} + shift_expression + + relational_expression \italic{(3)} ::= relational_expression \bold{>} + shift_expression + + relational_expression \italic{(4)} ::= relational_expression PC_LE + shift_expression + + relational_expression \italic{(5)} ::= relational_expression PC_GE + shift_expression + + + shift_expression \italic{(1)} ::= additive_expression + + shift_expression \italic{(2)} ::= shift_expression PC_LEFT additive_expression + + shift_expression \italic{(3)} ::= shift_expression PC_RIGHT + additive_expression + + + additive_expression \italic{(1)} ::= multiplicative_expression + + additive_expression \italic{(2)} ::= additive_expression \bold{+} + multiplicative_expression + + additive_expression \italic{(3)} ::= additive_expression \bold{-} + multiplicative_expression + + + multiplicative_expression \italic{(1)} ::= cast_expression + + multiplicative_expression \italic{(2)} ::= multiplicative_expression \bold{*} + cast_expression + + multiplicative_expression \italic{(3)} ::= multiplicative_expression \bold{/} + cast_expression + + multiplicative_expression \italic{(4)} ::= multiplicative_expression \bold{%} + cast_expression + + + cast_expression \italic{(1)} ::= unary_expression + + cast_expression \italic{(2)} ::= \bold{(} type_name \bold{)} cast_expression + + + unary_expression \italic{(1)} ::= postfix_expression + + unary_expression \italic{(2)} ::= PC_INCR unary_expression + + unary_expression \italic{(3)} ::= PC_DECR unary_expression + + unary_expression \italic{(4)} ::= unary_operator cast_expression + + unary_expression \italic{(5)} ::= PC_SIZEOF unary_expression + + unary_expression \italic{(6)} ::= PC_SIZEOF \bold{(} type_name \bold{)} + + + unary_operator \italic{(1*)} ::= \bold{&} + + unary_operator \italic{(2*)} ::= \bold{*} + + unary_operator \italic{(3*)} ::= \bold{+} + + unary_operator \italic{(4*)} ::= \bold{-} + + unary_operator \italic{(5*)} ::= \bold{~} + + unary_operator \italic{(6*)} ::= \bold{!} + + + postfix_expression \italic{(1)} ::= primary_expression + + postfix_expression \italic{(2)} ::= postfix_expression \bold{[} expression + \bold{]} + + postfix_expression \italic{(3)} ::= postfix_expression \bold{(} \bold{)} + + postfix_expression \italic{(4)} ::= postfix_expression \bold{(} + argument_expression_list \bold{)} + + postfix_expression \italic{(5)} ::= postfix_expression \bold{.} identifier + + postfix_expression \italic{(6)} ::= postfix_expression PC_DEREF identifier + + postfix_expression \italic{(7)} ::= postfix_expression PC_INCR + + postfix_expression \italic{(8)} ::= postfix_expression PC_DECR + + + primary_expression \italic{(1)} ::= identifier + + primary_expression \italic{(2)} ::= constant + + primary_expression \italic{(3*)} ::= PC_STRING_CONSTANT + + primary_expression \italic{(4)} ::= \bold{(} expression \bold{)} + + + argument_expression_list \italic{(1)} ::= assignment_expression + + argument_expression_list \italic{(2)} ::= argument_expression_list \bold{,} + assignment_expression + + + constant \italic{(1*)} ::= PC_INTEGER_CONSTANT + + constant \italic{(2*)} ::= PC_CHARACTER_CONSTANT + + constant \italic{(3*)} ::= PC_FLOATING_CONSTANT + + constant \italic{(4*)} ::= PC_ENUMERATION_CONSTANT + + + identifier \italic{(1*)} ::= PC_IDENTIFIER + + } + A node is emitted for every production in the above list. The production type + of the node can be retrieved with PC_NodeType. The value of this function is + a constant whose name is the string "pnt_" ("Parsec Node Type") followed by + the name of the production, such as pnt_module or pnt_storage_class_specifier. + When a production node is emitted, it has a subtype in addition to a + production type. The subtype is the parenthesized number in the above + grammar, and can be retrieved with PC_SubType. When the subtype in the above + grammar is followed by an asterisk, then a token node is emitted rather than a + production node. A token node is a node PC_ParseNode_t object, but it + contains a token (PC_Token_t) rather than some number of children. Token + nodes do not have subtypes, but the contents of the token are enough to + determine the exact rule which was recignized for that node. Tokens come in + three flavors: character tokens, text tokens and code tokens. A character + token is one of which PC_IsCharToken is true; it contains a single character + which corresponds exactly to a character that was recognized in the input + (accessible via PC_TokenChar). A text token is one of which PC_IsTextToken is + true and contains a value (accessible via PC_TokenVal) and a string + (accessible via PC_TokenText). The value indicates what kind of input was + recognized and the string contains the actual input. The following kinds of + tokens have text associated with them: Identifiers (PC_IDENTIFIER), Constants + (PC_STRING_CONSTANT, PC_INTEGER_CONSTANT, PC_CHARACTER_CONSTANT, + PC_FLOATING_CONSTANT, PC_ENUMERATION_CONSTANT), and typedef names + (PC_TYPEDEF_NAME). A code token is one containing one of the constant values + given above in the grammar, such as PC_INCR (which corresponds to the input + string "++"), or PC_TYPEDEF (which corresponds to the input string "typedef"). + + + When a production node has children, those children only correspond to the + sub-productions recognized in a given rule; no intervening input tokens are + saved. So, for example, if you have a node whose type is pnt_enum_specifier + and it has one child, the only way to tell whether it corresponds to + + + \indent{\bold{enum} \bold{\{} \italic{child-tokens} \bold{\}} + + } + or to + + + \indent{\bold{enum} \italic{child-tokens} + + } + is to examine the subtype (in this case, the subtype will be 1 or 3). + + + There are many rules in the grammar of the form + + + \indent{foo ::= bar + + } + that is, where a production contains exactly one subrule and no intervening + tokens. If the "fold" argument to PC_Parse is non-zero, then the resulting + tree will be abbreviated to eliminate nodes corresponding to productions like + "foo" above. For example, consider the following (very short!) C source file: + + + \indent{\typewriter{int num; + + }} + Without folding, the parse tree for this file looks like this: + + + \begindata{zip,269607984} + %ViewWidth 438 + %ViewHeight 268 + *D;-1000,1400 + N8.5X11 + >-1000,1400 + *A;34,1224 + Fandysans8b + Tpnt_module (1) + MCM + *A;51,916 + Fandysans8b + Tpnt_external_declaration (2) + MCM + *A;-942,179 + Fandysans8b + Tpnt_declaration_specifiers (3) + MCM + *A;34,599 + Fandysans8b + Tpnt_declaration (2) + MCM + *A;873,188 + Fandysans8b + Tpnt_init_declarator_list (1) + MCM + *A;-950,-222 + Fandysans8b + Tpnt_type_specifier: PC_INT + MCM + *A;839,-214 + Fandysans8b + Tpnt_init_declarator (1) + MCM + *A;805,-573 + Fandysans8b + Tpnt_declarator (1) + MCM + *A;805,-925 + Fandysans8b + Tpnt_direct_declarator (1) + MCM + *A;779,-1233 + Fandysans8b + Tpnt_identifier: num + MCM + *C;0,1147 + >8,1002 + *C;8,813 + >8,693 + *C;-17,505 + >-916,274 + *C;-916,111 + >-916,-128 + *C;8,505 + >779,265 + *C;796,137 + >796,-111 + *C;796,-265 + >796,-496 + *C;796,-625 + >796,-830 + *C;788,-985 + >788,-1147 + + \enddata{zip,269607984} + \view{zipview,269607984,15,0,270} + + \begindata{bp,269562536} + \enddata{bp,269562536} + \view{bpv,269562536,16,0,0} + With folding, the parse tree is abbreviated to this: + + + \begindata{zip,269430628} + %ViewWidth 526 + %ViewHeight 180 + %ObjectWidth 571 + %ObjectHeight 306 + *D;-1000,1400 + N8.5X11 + >-1000,1400 + *A;34,253 + Fandysans8b + Tpnt_declaration (2) + MCM + *A;-884,-386 + Fandysans8b + Tpnt_type_specifier: PC_INT + MCM + *A;820,-386 + Fandysans8b + Tpnt_identifier: num + MCM + *C;-25,176 + >-995,-304 + *C;-8,176 + >801,-304 + + \enddata{zip,269430628} + \view{zipview,269430628,17,573,182} + + The uses of Parsec are numerous, however its usefulness is limited by the fact + that it can only recognize C code proper; all pre-processor macros must be + resolved before the parser can recognize the input. Therefore, it is + customary to do the following to a C file before letting parsec process it: + + + \indent{cc -E -I\italic{include-directories} ... -D\italic{defines} ... + source.c | your-parsec-application + + } + Parsec has been used to implement yyhide, a Yacc/Lex postprocessor which makes + selected identifiers static. It can also be used to write source-code + indenters, call-graph generators, etc. + + \enddata{text,269346388} *** overhead/parsec/yyhide.doc Thu May 30 20:50:15 1991 --- overhead/parsec/yyhide.doc.NEW Tue Jan 22 14:31:49 1991 *************** *** 0 **** --- 1,705 ---- + \begindata{text,269298080} + \textdsversion{12} + \template{default} + \define{footnote + + attr:[Flags OverBar Int Set] + attr:[FontSize PreviousFontSize Point -2]} + \center{\bigger{\bold{YYHIDE + + }}\bold{A post-processor for Yacc and Lex files + + }by Bob Glickstein + + } + \heading{Introduction + + }The C programs created by Yacc and Lex define vast numbers of global + functions and variables. Since the names of these functions and variables are + always the same, name conflicts occur whenever one tries to load two Yacc or + two Lex-created object modules together (both modules will define yyparse(), + for example, and yytext, and yyval, and yylval, etc.). Fortunately, all + identifiers created by both Yacc and Lex begin with ``YY'' or ``yy'', making + them easy to find. Traditional solutions to the name-conflict problem are + kludgy: most people run the output of Yacc and Lex through a ``sed'' script + which converts all occurrences of ``YY'' and ``yy'' to some other string; + others include a long sequence of macro definitions at the top of a Yacc or + Lex redefining every ``YY'' and ``yy'' identifier (as in #define yyparse + MyParse). The problem with the former approach is that it avoids + name-conflict but doesn't eliminate ``namespace-pollution''; the latter + solution suffers from non-portability, since not all Yacc- and Lex-templates + define the same identifiers. Yyhide is a filter which makes all ``yy'' + identifiers static, thus eliminating both name-conflicts and + namespace-pollution in a portable fashion. + + + \heading{Operation of yyhide + + }Yyhide is a filter. It reads the source code for a C module on the standard + input and produces a transformed version of the same module on the standard + output. Because the ``C parser'' contained in yyhide can only recognize the + strict C grammar described in Appendix B of \italic{The C Programming + Language, Second Edition} (by B.W. Kernighan and D.M. Ritchie, Prentice-Hall, + NJ), the module must have all pre-processor macros resolved before being run + through yyhide. A typical sequence, therefore, would be + + + \indent{\typewriter{% \bold{yacc foo.y} + + % \bold{cc -E -I. -I/usr/andy/include y.tab.c | yyhide > foo.c} + + % \bold{cc -c foo.c} + + }} + (the -E option to cc means ``resolve pre-processor macros only''). Or, in a + Makefile, a suitable rule would be + + + \indent{.y.o: + + -rm -f $@ + + yacc $*.y + + cc -E $(INCLUDES) $(DEFINES) y.tab.c | yyhide > $*.c + + cc -c $*.c + + } + \heading{Coding rules enforced by yyhide + + }Certain Yacc- and Lex-coding styles are impossible when yyhide is used. For + example, since all ``yy'' identifiers are made static, no external module can + call ``yyparse''. There are two solutions to this new barrier. The first is + to enumerate only those identifiers which you need to remain global, and then + redefine them with macro definitions to prevent their being made static. An + example: + + \begindata{bp,268981452} + \enddata{bp,268981452} + \view{bpv,268981452,6,0,0} + \indent{\typewriter{%\{ + + /* File: foo.y + + * It is necessary to rename ``yyparse'' via a macro + + * since otherwise, yyhide will hide it and it won't be + + * accessible from other code + + */ + + + #define yyparse MyParseFunction + + %\} + + + %% + + + }\italic{...yacc rules here...} + + } + The second solution is to define an interface routine within the Yacc module + which calls yyparse. + + + \indent{\typewriter{%% + + + }\italic{...yacc rules here... + + }\typewriter{ + %% + + + /* This function has access to yyparse, + + * but nothing outside of this module does + + */ + + int CallMyYyparseFunction() + + \{ + + return (yyparse()); + + \} + + }} + A common practice when interfacing Yacc- and Lex-created modules is to use + Yacc's ``yylval'' symbol to return the text of an input token to the parser. + Here is a trivial example of this practice: + + + \center{\ + \begindata{table,269195608} + \rows 182 0 + \cols 287 169 + - - + | \begindata{text,269452076} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%\{ + + #include "y.tab.h" + + %\} + + + LTR [A-Za-z] + + + %% + + + [0-9]+ \{ + + yylval.num = atoi(yytext); + + return (NUMBER); + + \} + + \{LTR\}+ \{ + + strcpy(yylval.word, yytext); + + return (WORD); + + \} + + }}\enddata{text,269452076} + | \begindata{text,269408884} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%token NUMBER WORD + + + %union \{ + + int num; + + char word[20]; + + \} + + + %% + + + thing: + + WORD + + | NUMBER + + ; + + }}\enddata{text,269408884} + | + - - + | \begindata{text,268980264} + \textdsversion{12} + \template{default} + \center{Lex\ + }\enddata{text,268980264} + | \begindata{text,269543956} + \textdsversion{12} + \template{default} + \center{Yacc\ + }\enddata{text,269543956} + | + - - + \enddata{table,269195608} + \view{spread,269195608,7,0,0} + }\center{\bold{How yylval is sometimes used + + }} + Since yylval will be made static, this will no longer work. Again, there are + two ways around this; the macro-renaming method and the interface-routine + method. + + + \center{\ + \begindata{table,269535324} + \rows 192 0 + \cols 303 182 + - - + | \begindata{text,269533276} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%\{ + + #include "y.tab.h" + + extern YYSTYPE TokenVal; + + %\} + + + LTR [A-Za-z] + + + %% + + + [0-9]+ \{ + + TokenVal.num = atoi(yytext); + + return (NUMBER); + + \} + + \{LTR\}+ \{ + + strcpy(TokenVal.word, yytext); + + return (WORD); + + \} + + }}\enddata{text,269533276} + | \begindata{text,269565832} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%\{ + + #define yylval TokenVal + + %\} + + + %token NUMBER WORD + + + %union \{ + + int num; + + char word[20]; + + \} + + + %% + + + thing: + + WORD + + | NUMBER + + ; + + }}\enddata{text,269565832} + | + - - + | \begindata{text,269556536} + \textdsversion{12} + \template{default} + \center{Lex\ + }\enddata{text,269556536} + | \begindata{text,269588184} + \textdsversion{12} + \template{default} + \center{Yacc\ + }\enddata{text,269588184} + | + - - + \enddata{table,269535324} + \view{spread,269535324,8,0,0} + }\center{\bold{Macro-renaming method}} + + + \center{\ + \begindata{table,269578696} + \rows 291 0 + \cols 272 222 + - - + | \begindata{text,269576648} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%\{ + + #include "y.tab.h" + + extern void SetNumToken(), + + SetWordToken(); + + %\} + + + LTR [A-Za-z] + + + %% + + + [0-9]+ \{ + + SetNumToken(atoi(yytext)); + + return (NUMBER); + + \} + + \{LTR\}+ \{ + + SetWordToken(yytext); + + return (WORD); + + \} + + }}\enddata{text,269576648} + | \begindata{text,269609208} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%token NUMBER WORD + + + %union \{ + + int num; + + char word[20]; + + \} + + + %% + + + thing: + + WORD + + | NUMBER + + ; + + + %% + + + void SetNumToken(num) + + int num; + + \{ + + yylval.num = num; + + \} + + + void SetWordToken(word) + + char *word; + + \{ + + strcpy(yylval.word, word); + + \} + + }}\enddata{text,269609208} + | + - - + | \begindata{text,269599500} + \textdsversion{12} + \template{default} + \center{Lex\ + }\enddata{text,269599500} + | \begindata{text,269631356} + \textdsversion{12} + \template{default} + \center{Yacc\ + }\enddata{text,269631356} + | + - - + \enddata{table,269578696} + \view{spread,269578696,9,0,0} + }\center{\bold{Interface routines method + + }} + Another common practice is to process the Yacc source with Yacc's ``-d'' flag, + which causes Yacc to generate a header file (``y.tab.h'') in addition to the + normal y.tab.c file. The header file is useful for inclusion in a Lex-created + module, since it defines macros for all of the input token names and it + defines the type of the Yacc stack. The y.tab.h file for the immediately + preceding example would be + + + \indent{\typewriter{#define NUMBER 257 + + #define WORD 258 + + + typedef union \{ + + int num; + + char word[20]; + + \} YYSTYPE; + + }} + Unfortunately, YYSTYPE winds up being a global symbol which can't be made + static. It is therefore important to do a ``macro-rename'' of YYSTYPE to + something unique wherever YYSTYPE is used. The above example is modified + thus: + + + \begindata{table,269621892} + \rows 332 0 + \cols 272 223 + - - + | \begindata{text,269619844} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%\{ + + #define YYSTYPE MY_YACC_TYPE + + #include "y.tab.h" + + extern void SetNumToken(), + + SetWordToken(); + + %\} + + + LTR [A-Za-z] + + + %% + + + [0-9]+ \{ + + SetNumToken(atoi(yytext)); + + return (NUMBER); + + \} + + \{LTR\}+ \{ + + SetWordToken(yytext); + + return (WORD); + + \} + + }}\enddata{text,269619844} + | \begindata{text,269652324} + \textdsversion{12} + \template{default} + \typewriter{\smaller{%\{ + + #define YYSTYPE MY_YACC_TYPE + + %\} + + + %token NUMBER WORD + + + %union \{ + + int num; + + char word[20]; + + \} + + + %% + + + thing: + + WORD + + | NUMBER + + ; + + + %% + + + void SetNumToken(num) + + int num; + + \{ + + yylval.num = num; + + \} + + + void SetWordToken(word) + + char *word; + + \{ + + strcpy(yylval.word, word); + + \} + + }}\enddata{text,269652324} + | + - - + | \begindata{text,269642708} + \textdsversion{12} + \template{default} + \center{Lex\ + }\enddata{text,269642708} + | \begindata{text,269633624} + \textdsversion{12} + \template{default} + \center{Yacc\ + }\enddata{text,269633624} + | + - - + \enddata{table,269621892} + \view{spread,269621892,10,0,0} + \center{\bold{Interface routines method with YYSTYPE renamed + + }} + \heading{Options + + }Yyhide understands a -v command-line option, which causes it to do its work + verbosely. The more -v's you supply, the more verbose yyhide will be, up to + about 6 v's. + + + On some flavors of Unix (notably BSD 4.\italic{x}), yyhide also understands a + -r option which will set the resource limit for a given resource in yyhide's + process. The syntax of the -r option is + + + \indent{-r\italic{} + + } + where \italic{} is one of the letters c, d, s and m (standing for + "CPU time," "Data size," "Stack size," and "Memory (resident set) size," + respectively). \italic{} is either the letter u (signifying a request + for an unlimited resource) or an integer specifying the resource size. The + yyhide process may require lots of time and space (depending on the size of + the input), so you may need this option. See csh(1) and setrlimit(2) for more + about resource limits. A separate -r flag must be given for each resource + whose limit you wish to alter. + + + \heading{How it works + + }Yyhide first enumerates all of the top-level declarations in your module + (except the function definitions). It compares those declarations that were + declared ``extern'' with those declarations that were not declared ``extern''. + It then eliminates all redundant ``extern'' declarations (those declarations + that have non-extern counterparts elsewhere in the file). Such declarations + are often used as ``forward'' declarations, but they won't work if the object + that they are forwardly declaring is made static. Yyhide then finds all + typedefs and all struct, union or enum definitions that have ``tags'' + associated with them, and it outputs the definitions for those. It then sorts + the remaining declarations in order of + dependence\footnote{\ + \begindata{fnote,269656888} + \textdsversion{12} + \define{typewriter + menu:[Font~1,Typewriter~40] + attr:[FontFace FixedFace Int Set] + attr:[FontFamily AndyType Int 0]} + ``Dependence'' is defined in terms of initializers. In the declaration + \typewriter{int foo = bar;} foo is initialized with bar, and thus depends on + it. Since forward declarations have been eliminated, the definition of bar + must precede the definition of foo.\ + \enddata{fnote,269656888} + \view{fnotev,269656888,11,0,0}} and prints those out, prepending the keyword + ``static'' to the definition of any object whose name begins with ``yy'' or + ``YY'' (and which isn't already static or extern). Finally, yyhide prints out + the definitions of all the functions in the module, again placing the word + ``static'' where appropriate. While printing out a function definition, if an + ``extern'' declaration is encountered for a symbol that has already been + defined, that extern declaration is eliminated. + + + The C parser used by yyhide was written with Yacc and Lex, and yyhide is used + in its own construction to hide the variables in the Yacc and Lex modules. + + + \heading{Known Bugs + + }The current version of yyhide suffers from two known deficiencies. The + author shall endeavor to correct these in as little time as possible. + However, they do not render yyhide unusable in most cases. + + + \indent{ - If two top-level declarations refer to each other in their + (optional) initializer expression, yyhide will abort. I can't imagine any + cases where one would want to write code like this, but maybe you can. + Example: + + + \indent{\indent{\typewriter{int foo = bar; + + int bar = foo; + + }}} + + - If an identifier is declared ``extern'' within a function body, then it + must not contain an initializer expression. Although C allows this, yyhide + will barf. Example: + + + \indent{\indent{\typewriter{foo() + + \{ + + extern int bar = 7; + + /* yyhide can't handle this */ + + ... + + \} + + + }}}However, + + \indent{ + \indent{\typewriter{foo() + + \{ + + extern int bar; + + bar = 7; + + /* yyhide can handle this */ + + ... + + \} + + }}}} + \heading{Author + + }Bob Glickstein, Information Technology Center, Carnegie Mellon University + + July, 1989 + + \enddata{text,269298080} *** overhead/snap2/guardian/cmd/Imakefile Fri Dec 21 15:02:55 1990 --- overhead/snap2/guardian/cmd/Imakefile.NEW Thu Apr 11 16:11:50 1991 *************** *** 5,14 **** LOCALINCLUDES = -I../hdrs #ifdef RESOLVER_ENV ! RESOLVER_LIB = ${RESOLVLIB} #else RESOLVER_LIB = ! #endif /* RESOLVER_ENV */ #ifdef AFS_ENV /* librauth.a is part of an old distribution of AFS. It's not included in AFS3.0, but it's still AFS-related. */ --- 5,21 ---- LOCALINCLUDES = -I../hdrs #ifdef RESOLVER_ENV ! #ifdef LIBDL_ENV ! SYSLIBS = -L${DESTDIR}/lib -lresolv ! RESOLVER_LIB = #else + RESOLVER_LIB = $(RESOLVLIB) + SYSLIBS = + #endif /* LIBDL_ENV */ + #else RESOLVER_LIB = ! SYSLIBS = ! #endif #ifdef AFS_ENV /* librauth.a is part of an old distribution of AFS. It's not included in AFS3.0, but it's still AFS-related. */ *************** *** 23,33 **** ${LIBRAUTH} \ ${AFSBASEDIR}/lib/afs/libauth.a \ ${AFSBASEDIR}/lib/afs/libacl.a \ - ${AFSBASEDIR}/lib/libr.a \ - ${AFSBASEDIR}/lib/libscrypt.a \ ${AFSBASEDIR}/lib/afs/libsys.a \ ${AFSBASEDIR}/lib/librx.a \ ! ${AFSBASEDIR}/lib/liblwp.a #else /* AFS_ENV */ G_LIBSI = \ ${BASEDIR}/lib/libmail.a \ --- 30,40 ---- ${LIBRAUTH} \ ${AFSBASEDIR}/lib/afs/libauth.a \ ${AFSBASEDIR}/lib/afs/libacl.a \ ${AFSBASEDIR}/lib/afs/libsys.a \ ${AFSBASEDIR}/lib/librx.a \ ! ${AFSBASEDIR}/lib/librxkad.a \ ! ${AFSBASEDIR}/lib/liblwp.a \ ! $(AFSBASEDIR)/lib/libdes.a ${AFSUTILS} #else /* AFS_ENV */ G_LIBSI = \ ${BASEDIR}/lib/libmail.a \ *************** *** 55,61 **** NormalObjectRule() ! ProgramTarget(bioyat, bioya.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnapt.a ${UTILLIB},) DIRS = ${DESTDIR}/etc/snap \ ${DESTDIR}/etc/snap/servicest \ --- 62,68 ---- NormalObjectRule() ! ProgramTarget(bioyat, bioya.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnapt.a ${UTILLIB}, ${SYSLIBS} ${NETLIBS} ${SUPLIBS}) DIRS = ${DESTDIR}/etc/snap \ ${DESTDIR}/etc/snap/servicest \ *************** *** 66,88 **** InstallFileToFile(bioyat, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/bioya) InstallFile(snptguar.h, $(INSTINCFLAGS), $(DESTDIR)/include) ! ProgramTarget(fakeclientt, fakeclnt.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnapt.a ${UTILLIB},) InstallFileToFile(fakeclientt, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/fakeclient) InstallLink( $(DESTDIR)/etc/snap/servicest/fakeclient, $(DESTDIR)/etc/snap/servicest/messageserver) ! ProgramTarget(guardiant, ${G_OBJS} snptguar.o snptgerr.o, ${G_LIBST},) InstallProgram(guardiant, $(DESTDIR)/etc/snap) ! ProgramTarget(snaptestt, snaptest.o, $(BASEDIR)/lib/libsnapt.a $(BASEDIR)/lib/libmail.a $(UTILLIB),) InstallProgram(snaptestt, $(DESTDIR)/etc/snap) ! ProgramTarget(bioyas, bioya.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnap.a ${UTILLIB},) InstallFileToFile(bioyas, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/services/bioya) ! ProgramTarget(fakeclients, fakeclnt.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnap.a ${UTILLIB},) InstallFileToFile(fakeclients, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/services/fakeclient) InstallLink( $(DESTDIR)/etc/snap/services/fakeclient, $(DESTDIR)/etc/snap/services/messageserver) ! ProgramTarget(guardians, ${G_OBJS}, ${G_LIBSS},) InstallFileToFile(guardians, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/guardian) ! ProgramTarget(snaptests, snaptest.o, $(BASEDIR)/lib/libsnap.a $(BASEDIR)/lib/libmail.a $(UTILLIB),) InstallFileToFile(snaptests, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/snaptest) --- 73,95 ---- InstallFileToFile(bioyat, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/bioya) InstallFile(snptguar.h, $(INSTINCFLAGS), $(DESTDIR)/include) ! ProgramTarget(fakeclientt, fakeclnt.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnapt.a ${UTILLIB},${SYSLIBS} ${NETLIBS} ${SUPLIBS}) InstallFileToFile(fakeclientt, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/fakeclient) InstallLink( $(DESTDIR)/etc/snap/servicest/fakeclient, $(DESTDIR)/etc/snap/servicest/messageserver) ! ProgramTarget(guardiant, ${G_OBJS} snptguar.o snptgerr.o, ${G_LIBST},$(SYSLIBS) ${NETLIBS} ${SUPLIBS} ${AUTHLIBS}) InstallProgram(guardiant, $(DESTDIR)/etc/snap) ! ProgramTarget(snaptestt, snaptest.o, $(BASEDIR)/lib/libsnapt.a $(BASEDIR)/lib/libmail.a $(UTILLIB), ${SYSLIBS} ${NETLIBS} ${SUPLIBS}) InstallProgram(snaptestt, $(DESTDIR)/etc/snap) ! ProgramTarget(bioyas, bioya.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnap.a ${UTILLIB},${SYSLIBS} ${NETLIBS} ${SUPLIBS}) InstallFileToFile(bioyas, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/services/bioya) ! ProgramTarget(fakeclients, fakeclnt.o, $(BASEDIR)/lib/libgasp.a $(BASEDIR)/lib/libsnap.a ${UTILLIB}, ${SYSLIBS} ${NETLIBS} ${SUPLIBS}) InstallFileToFile(fakeclients, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/services/fakeclient) InstallLink( $(DESTDIR)/etc/snap/services/fakeclient, $(DESTDIR)/etc/snap/services/messageserver) ! ProgramTarget(guardians, ${G_OBJS}, ${G_LIBSS}, $(SYSLIBS) ${NETLIBS} ${SUPLIBS} ${AUTHLIBS}) InstallFileToFile(guardians, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/guardian) ! ProgramTarget(snaptests, snaptest.o, $(BASEDIR)/lib/libsnap.a $(BASEDIR)/lib/libmail.a $(UTILLIB),${SYSLIBS} ${NETLIBS} ${SUPLIBS}) InstallFileToFile(snaptests, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/snaptest) *** overhead/snap2/guardian/cmd/demonlog.c Wed Nov 22 13:57:31 1989 --- overhead/snap2/guardian/cmd/demonlog.c.NEW Wed Apr 3 21:28:52 1991 *************** *** 6,11 **** --- 6,12 ---- facility for deamons to write accounting records */ + #include #include #include #include *************** *** 42,48 **** if(ch!=(ch&0x7f))ch='?'; if((ch==',')||(ch<' ')||(ch==0x7f)) ch='?'; ! *(w++) = ch; } return s; } --- 43,52 ---- if(ch!=(ch&0x7f))ch='?'; if((ch==',')||(ch<' ')||(ch==0x7f)) ch='?'; ! if (*w != ch) ! *(w++) = ch; ! else ! w += 1; } return s; } *** overhead/snap2/guardian/cmd/fwddecl.h Wed Jan 17 16:40:18 1990 --- overhead/snap2/guardian/cmd/fwddecl.h.NEW Fri Dec 21 13:26:52 1990 *************** *** 2,9 **** * 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/snap2/guardian/cmd/RCS/fwddecl.h,v 1.3 89/10/16 10:48:52 cfe Exp Locker: aw0g $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/snap2/guardian/cmd/RCS/fwddecl.h,v $ */ /* Forward Declarations for guardian.c */ typedef char bool; --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/guardian/cmd/RCS/fwddecl.h,v 1.5 90/12/21 13:23:29 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/guardian/cmd/RCS/fwddecl.h,v $ */ /* Forward Declarations for guardian.c */ typedef char bool; *************** *** 95,107 **** void log_death(); #ifdef AFS_ENV static bool UserPermitted(); static bool homeCell(); static int CellPwdAuth(); - static int MultiTokensAuth(); static int PwdAuth(); - static int SetAuthorizedUsers(); - static int SetTokens(); static int VTokensAuth(); static int really_authenticate(); static void gclearauth(); #endif /* AFS_ENV */ --- 95,111 ---- void log_death(); #ifdef AFS_ENV static bool UserPermitted(); + #if 0 + static int SetTokens(); static bool homeCell(); static int CellPwdAuth(); static int PwdAuth(); static int VTokensAuth(); + static int InitializeRPC(); + static int ReportAuthError(); + #endif + static int MultiTokensAuth(); + static int SetAuthorizedUsers(); static int really_authenticate(); static void gclearauth(); #endif /* AFS_ENV */ *************** *** 108,115 **** #ifdef RAUTH #ifdef AFS_ENV static char *GetCellName(); - static int InitializeRPC(); - static int ReportAuthError(); #endif /* AFS_ENV */ #endif /* RAUTH */ --- 112,117 ---- *** overhead/snap2/guardian/cmd/guardian.c Fri Dec 21 15:02:59 1990 --- overhead/snap2/guardian/cmd/guardian.c.NEW Tue Apr 9 19:17:32 1991 *************** *** 8,14 **** Written: 17 September 1985 */ ! static char GuardianVersion[] = "$Revision: 2.88 $ $Date: 90/10/18 17:41:27 $"; #define GUARDIAN_PREIX_SKIP sizeof("xRevision") extern char *AndrewDir(); #ifndef _IBMR2 --- 8,14 ---- Written: 17 September 1985 */ ! static char GuardianVersion[] = "$Revision: 2.96 $ $Date: 91/04/09 17:04:26 $"; #define GUARDIAN_PREIX_SKIP sizeof("xRevision") extern char *AndrewDir(); #ifndef _IBMR2 *************** *** 57,63 **** #include #include /* New (Rx) authentication */ - #include #include #undef AFS_AUTH_DEFAULT #define AFS_AUTH_DEFAULT TRUE --- 57,62 ---- *************** *** 64,69 **** --- 63,74 ---- #define AUTH_KEYSIZE (sizeof(auth_EncryptionKey)) #endif /* AFS_ENV */ + #ifdef M_UNIX + #define SecureWare + #include + #include + #endif /* M_UNIX */ + #include /* forward declarations for this source file */ typedef unsigned char KEY[SNAP_KEYLEN]; *************** *** 76,82 **** #define TRUE 1 #define SERVICES_FILE "/etc/guardian.svc" ! extern int strcmp(), errno, sys_nerr; extern int SNAP_debugmask; static int SNAP_serv_port; extern struct passwd *getpwnam(); --- 81,87 ---- #define TRUE 1 #define SERVICES_FILE "/etc/guardian.svc" ! extern int errno, sys_nerr; extern int SNAP_debugmask; static int SNAP_serv_port; extern struct passwd *getpwnam(); *************** *** 463,468 **** --- 468,474 ---- return FALSE; } + #if 0 struct all_tokens_R { long bashme; ClearToken ctoken; *************** *** 471,482 **** long bashmetoo; }; typedef struct all_tokens_R gtokens,*gtokens_pt; static void gclearauth() { setpag(); } ! /* set tokens from clear and secret */ --- 477,489 ---- long bashmetoo; }; typedef struct all_tokens_R gtokens,*gtokens_pt; + #endif /* 0 */ static void gclearauth() { setpag(); } ! #if 0 /* set tokens from clear and secret */ *************** *** 526,557 **** return set_gerror(GASP_NO_AUTHORIZATION,"u_cell_authenticate"); return SetTokens(u,&toks); } - - static int MultiTokensAuth(u) - USERINFO_pt u; - { - register char *ThisCell; - register int tokens_id; - - ThisCell = GetCellName(); - if (ThisCell == NIL) return set_gerror(GASP_NO_CELL,"no_this_cell"); - tokens_id = ExtractCellID(u->password, u->len, ThisCell, 0 /*debug*/); - if (tokens_id == -1) - return set_gerror(GASP_NO_GUEST_ACCT,"extract_cell_id"); - if(u->uid != tokens_id) - return set_gerror(GASP_NO_AUTHORIZATION,"uid_neq_viceid"); - - /* Now, see if tokens are valid */ - if (setreuid(u->uid, 0)<0) /* make getuid() be roughly correct for old ktc.c */ - return set_gerror(GASP_CANT_SETUID,"setreuid_become_user"); - if (UnpackAndSetTokens(u->password,u->len, 0 /*debug*/, 1) < 0) { - if (setreuid(0, 0)) exit(EX_OSERR); - return set_gerror(GASP_NO_AUTHORIZATION,"unpackandsettokens"); - } - if (setreuid(0, 0)) exit(EX_OSERR); - return 0; - } - static int VTokensAuth(u) USERINFO *u; { --- 533,538 ---- *************** *** 585,590 **** --- 566,597 ---- return set_gerror(GASP_NO_AUTHORIZATION,"authentication"); return SetTokens(u,&toks); } + #endif /* 0 */ + + static int MultiTokensAuth(u) + USERINFO_pt u; + { + register char *ThisCell; + register int tokens_id; + + ThisCell = GetCellName(); + if (ThisCell == NIL) return set_gerror(GASP_NO_CELL,"no_this_cell"); + tokens_id = ExtractCellID(u->password, u->len, ThisCell, 0 /*debug*/); + if (tokens_id == -1) + return set_gerror(GASP_NO_GUEST_ACCT,"extract_cell_id"); + if(u->uid != tokens_id) + return set_gerror(GASP_NO_AUTHORIZATION,"uid_neq_viceid"); + + /* Now, see if tokens are valid */ + if (setreuid(u->uid, 0)<0) /* make getuid() be roughly correct for old ktc.c */ + return set_gerror(GASP_CANT_SETUID,"setreuid_become_user"); + if (UnpackAndSetTokens(u->password,u->len, 0 /*debug*/, 1) < 0) { + if (setreuid(0, 0)) exit(EX_OSERR); + return set_gerror(GASP_NO_AUTHORIZATION,"unpackandsettokens"); + } + if (setreuid(0, 0)) exit(EX_OSERR); + return 0; + } static int really_authenticate(u,from, remote) USERINFO *u; *************** *** 606,611 **** --- 613,619 ---- set tokens */ switch (u->type) { + #if 0 case 0: case GASP_PWD_STRING: return PwdAuth(u); *************** *** 613,618 **** --- 621,627 ---- return CellPwdAuth(u); case GASP_PWD_VTOKENS: return VTokensAuth(u); + #endif /* Take this out when you're sure it's correct to remove it. :) */ case GASP_PWD_MULTI_TOKENS: return MultiTokensAuth(u); default: *************** *** 792,797 **** --- 801,809 ---- int result, i; char *aDir; + #ifdef M_UNIX + set_auth_parameters(argc,argv); + #endif /*protect log files and core dumps*/ umask(077); /* Go somewhere we can dump core if necessary */ *************** *** 1247,1252 **** --- 1259,1265 ---- ReportNumError(level, id, msg, code); } + #if 0 #ifdef AFS_ENV static ReportAuthError(level, id, msg, code) int level; *************** *** 1256,1261 **** --- 1269,1275 ---- ReportNumError(level, id, msg, code); } #endif /* AFS_ENV */ + #endif /* Remove this when you're sure it's history. */ static void InitServices() { *************** *** 1306,1312 **** --- 1320,1330 ---- "Can't fork to become demon: %s", errno); if (pid > 0) exit(EX_OK); pid = getpid(); + #ifdef M_UNIX + setpgrp(); + #else setpgrp(pid, pid); + #endif /* Redirect stdout & stderr */ if (RunAsUser) return; *************** *** 1518,1524 **** --- 1536,1547 ---- debug(4, ("\tSelect, mask=0x%x, timeout=<%d,%d>...\n", readfds, SelectTime.tv_sec, SelectTime.tv_usec)); errno=0; /*clear for logging this request*/ + #ifdef M_UNIX + nfds = select(8, &readfds, NIL, NIL, &SelectTime); + exceptfds = 0; + #else nfds = select(32, &readfds, NIL, &exceptfds, &SelectTime); + #endif /* See if child signal received */ if (SigChildRcvd || (nfds < 0 && errno == EINTR) || (nfds == 0)) *************** *** 1967,1972 **** --- 1990,1998 ---- struct passwd *pw; int i; long now=time(0); + #ifdef M_UNIX + struct pr_passwd *prp; + #endif /*Will this request be authenticated?*/ if((service->type==UNAUTH_ONLY)|| *************** *** 2015,2022 **** *scn_out++ = ch; *scn_out=0; pw = getpwnam(pure_name); } ! if (pw == NIL) return set_gerror(GASP_CANT_FIND_USER,"user_not_in_passwd"); if((len==0)||(len>=MAX_PASSWORD)) return set_gerror(GASP_CANT_FIND_USER,"bogus_passwd_password"); bcopy(password,cur->password,len); --- 2041,2056 ---- *scn_out++ = ch; *scn_out=0; pw = getpwnam(pure_name); + #ifdef M_UNIX + prp = getprpwnam(pure_name); + #endif } ! #ifdef M_UNIX ! if (pw == NIL || prp == NIL) ! #else ! if (pw == NIL) ! #endif ! return set_gerror(GASP_CANT_FIND_USER,"user_not_in_passwd"); if((len==0)||(len>=MAX_PASSWORD)) return set_gerror(GASP_CANT_FIND_USER,"bogus_passwd_password"); bcopy(password,cur->password,len); *************** *** 2023,2029 **** --- 2057,2067 ---- bzero(&cur->password[len],MAX_PASSWORD-len); cur->len=len; cur->type=type; + #ifdef M_UNIX + cur->uid=prp->ufld.fd_uid; + #else cur->uid=pw->pw_uid; + #endif { int slen=strlen(pw->pw_dir); if((slen<=0)||(slen>=MAXPATHLEN)) *************** *** 2037,2043 **** /* perhaps there is a password to check*/ /* Check his password */ if (!ViceAuth) { ! if(!StrEql(crypt(cur->password, pw->pw_passwd), pw->pw_passwd)) { debug(128, ("failed: bad password]\n")); cur->bad_password_rc=set_gerror(GASP_NO_AUTHORIZATION,"bad_local_pass"); } --- 2075,2086 ---- /* perhaps there is a password to check*/ /* Check his password */ if (!ViceAuth) { ! #ifdef M_UNIX ! if (!StrEql(bigcrypt(cur->password, prp->ufld.fd_encrypt), prp->ufld.fd_encrypt)) ! #else ! if (!StrEql(crypt(cur->password, pw->pw_passwd), pw->pw_passwd)) ! #endif ! { debug(128, ("failed: bad password]\n")); cur->bad_password_rc=set_gerror(GASP_NO_AUTHORIZATION,"bad_local_pass"); } *************** *** 2282,2289 **** bcopy(server->key, key, SNAP_KEYLEN); /* See if server can accept another client */ ! if (!CanAcceptNewClient(server)) return set_gerror(GASP_TOO_MANY_CLIENTS,"too_many_clients"); /* Update server's client info */ NewClient(server, from); --- 2325,2334 ---- bcopy(server->key, key, SNAP_KEYLEN); /* See if server can accept another client */ ! if (!CanAcceptNewClient(server)) { ! printf("***TOO MANY CLIENTS\n"); fflush(stdout); return set_gerror(GASP_TOO_MANY_CLIENTS,"too_many_clients"); + } /* Update server's client info */ NewClient(server, from); *************** *** 2509,2514 **** --- 2554,2562 ---- debug(8, ("it didn't die")); } } while (st.pid > 0); + #ifdef M_UNIX + signal(SIGCHLD, ChildAction); + #endif debug(8, ("]\n")); } *************** *** 3182,3188 **** --- 3230,3240 ---- register struct passwd *pw; /* Find password entry */ + #ifdef M_UNIX + pw = getpwnam(wizard); + #else pw = getpwnam(wizard, dout, debugfd); + #endif if (pw == NIL) { ReportError(ERR_WARNING, NIL, "Can't find passwd entry: %s", wizard); return; *************** *** 3305,3310 **** --- 3357,3363 ---- return thiscell; } + #if 0 static bool homeCell(name) register char *name; { *************** *** 3330,3338 **** virgin = FALSE; return rc; } - return 0; } #endif /* AFS_ENV */ #endif /* RAUTH */ --- 3383,3391 ---- virgin = FALSE; return rc; } return 0; } + #endif /* Remove this when you're sure it's history.*/ #endif /* AFS_ENV */ #endif /* RAUTH */ *** overhead/snap2/loadserv/Imakefile Wed Nov 22 13:58:20 1989 --- overhead/snap2/loadserv/Imakefile.NEW Wed Apr 3 21:29:05 1991 *************** *** 8,15 **** $(BASEDIR)/lib/libmail.a \ $(UTILLIB) \ $(BASEDIR)/lib/liberrors.a \ - $(AFSBASEDIR)/lib/libr.a \ - $(AFSBASEDIR)/lib/libscrypt.a \ $(AFSBASEDIR)/lib/liblwp.a \ $(AFSBASEDIR)/lib/afs/libacl.a --- 8,13 ---- *************** *** 32,39 **** InstallFileToFile(loadservt, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/loadserv) #endif /* AFS_ENV */ ! ProgramTarget(loadavs, loadav.o snaperr.o snpfkscb.o, $(BASEDIR)/lib/libsnap.a,) InstallFileToFile(loadavs, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/loadav) ! ProgramTarget(loadavt, loadav.o snaperr.o snpfkscb.o, $(BASEDIR)/lib/libsnapt.a,) InstallFileToFile(loadavt, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/loadavt) --- 30,37 ---- InstallFileToFile(loadservt, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/loadserv) #endif /* AFS_ENV */ ! ProgramTarget(loadavs, loadav.o snaperr.o snpfkscb.o, $(BASEDIR)/lib/libsnap.a, ${SUPLIBS} ${NETLIBS}) InstallFileToFile(loadavs, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/loadav) ! ProgramTarget(loadavt, loadav.o snaperr.o snpfkscb.o, $(BASEDIR)/lib/libsnapt.a,${SUPLIBS} ${NETLIBS}) InstallFileToFile(loadavt, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/loadavt) *** overhead/snap2/nametime/Imakefile Wed Nov 22 13:58:41 1989 --- overhead/snap2/nametime/Imakefile.NEW Wed Apr 3 21:29:10 1991 *************** *** 2,14 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ DependTarget() NormalObjectRule() ! ProgramTarget(nametime, nametime.o, ,) InstallProgram(nametime, $(DESTDIR)/etc/snap) #ifdef RESOLVER_ENV ! ProgramTarget(nametimeg, nmtimeg.o,${RESOLVLIB} ,) InstallProgram(nametimeg, $(DESTDIR)/etc/snap) #endif /* RESOLVER_ENV */ --- 2,26 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + #ifdef RESOLVER_ENV + #ifdef LIBDL_ENV + SYS_LIBS = -lresolv + RESOLVER_LIB = + #else + RESOLVER_LIB = $(RESOLVLIB) + SYS_LIBS = + #endif /* LIBDL_ENV */ + #else + RESOLVER_LIB = + SYS_LIBS = + #endif DependTarget() NormalObjectRule() ! ProgramTarget(nametime, nametime.o, ,${SUPLIBS} ${NETLIBS}) InstallProgram(nametime, $(DESTDIR)/etc/snap) #ifdef RESOLVER_ENV ! ProgramTarget(nametimeg, nmtimeg.o,${RESOLVER_LIB} ,$(SYS_LIBS)) InstallProgram(nametimeg, $(DESTDIR)/etc/snap) #endif /* RESOLVER_ENV */ *** overhead/snap2/nametime/nametime.c Fri Dec 21 15:03:08 1990 --- overhead/snap2/nametime/nametime.c.NEW Wed Apr 3 21:29:12 1991 *************** *** 16,22 **** \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/nametime/RCS/nametime.c,v 2.4 90/09/17 14:18:40 gk5g Exp $"; #include /* sys/types.h sys/time.h */ --- 16,22 ---- \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/nametime/RCS/nametime.c,v 2.5 91/04/02 17:09:53 susan Exp $"; #include /* sys/types.h sys/time.h */ *************** *** 57,67 **** --- 57,69 ---- open ("/", 0); dup2 (0, 1); dup2 (0, 2); + #ifdef TIOCNOTTY i = open ("/dev/tty", 2); if (i >= 0) { ioctl (i, TIOCNOTTY, 0); close (i); } + #endif } #endif /* DEBUG */ nsock = socket (AF_INET, SOCK_DGRAM, 0); *** overhead/snap2/pcserver/Imakefile Fri Dec 21 15:03:21 1990 --- overhead/snap2/pcserver/Imakefile.NEW Wed Apr 3 21:29:17 1991 *************** *** 17,24 **** ${BASEDIR}/lib/liberrors.a \ ${LIBRAUTH} \ ${AFSBASEDIR}/lib/afs/libacl.a \ - ${AFSBASEDIR}/lib/libr.a \ - ${AFSBASEDIR}/lib/libscrypt.a \ ${AFSBASEDIR}/lib/afs/libsys.a \ ${AFSBASEDIR}/lib/librx.a \ ${AFSBASEDIR}/lib/liblwp.a --- 17,22 ---- *************** *** 45,54 **** NormalObjectRule() ! ProgramTarget(pcservers,pcssnap.o pcsvice.o ${PCSS_OBJS} , ${PCS_SERVER_LIBSS},) InstallFileToFile(pcservers, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/services/pcserver) ! ProgramTarget(pcservert,pcssnap.o pcsvice.o ${PCSS_OBJS} , ${PCS_SERVER_LIBST},) InstallFileToFile(pcservert, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/pcserver) #if 0 --- 43,52 ---- NormalObjectRule() ! ProgramTarget(pcservers,pcssnap.o pcsvice.o ${PCSS_OBJS} , ${PCS_SERVER_LIBSS},${SUPLIBS} ${NETLIBS}) InstallFileToFile(pcservers, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/services/pcserver) ! ProgramTarget(pcservert,pcssnap.o pcsvice.o ${PCSS_OBJS} , ${PCS_SERVER_LIBST},${SUPLIBS} ${NETLIBS}) InstallFileToFile(pcservert, $(INSTPROGFLAGS), $(DESTDIR)/etc/snap/servicest/pcserver) #if 0 *** overhead/snap2/pcserver/pcsexec.c Wed Nov 22 13:58:59 1989 --- overhead/snap2/pcserver/pcsexec.c.NEW Wed Apr 3 21:29:17 1991 *************** *** 70,75 **** --- 70,76 ---- MyEnvironment[4] = NULL; environ = MyEnvironment; + #ifdef TIOCNOTTY /* Grubby fix to disassociate this process from /dev/tty, */ /* courtesy of Bruce Lucas and Drew Perkins */ fd=open("/dev/tty", 2); *************** *** 77,82 **** --- 78,84 ---- ioctl(fd, TIOCNOTTY, 0); close(fd); } + #endif init_done = TRUE; return; *** overhead/snap2/pcserver/pcsprocs.c Mon Aug 6 11:15:54 1990 --- overhead/snap2/pcserver/pcsprocs.c.NEW Wed Apr 3 21:29:19 1991 *************** *** 29,35 **** --- 29,42 ---- #include #include #include + #ifdef M_UNIX + #include + #define direct dirent + #define namlen(d) (strlen((d)->d_name)) + #else #include + #define namlen(d) ((d)->d_namlen) + #endif #include #include #include *************** *** 291,298 **** /* Now reposition to "starting_from" entry */ if ((slen = strlen (Starting_from)) != 0) { for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (entry->d_namlen != 0) { ! if ((entry->d_namlen == slen) && (bcmp (Starting_from, entry->d_name, slen) == 0)) break; } --- 298,305 ---- /* Now reposition to "starting_from" entry */ if ((slen = strlen (Starting_from)) != 0) { for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (namlen(entry) != 0) { ! if ((namlen(entry) == slen) && (bcmp (Starting_from, entry->d_name, slen) == 0)) break; } *************** *** 303,310 **** Starting_from = localstart; slen++; for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (entry->d_namlen != 0) { ! if ((entry->d_namlen == slen) && (bcmp (Starting_from, entry->d_name, slen) == 0)) break; } --- 310,317 ---- Starting_from = localstart; slen++; for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (namlen(entry) != 0) { ! if ((namlen(entry) == slen) && (bcmp (Starting_from, entry->d_name, slen) == 0)) break; } *************** *** 316,322 **** uid = getuid (); gid = getgid (); for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (entry->d_namlen != 0) { PCNAME thisname; if (SplitNameAllowDots(entry->d_name, &thisname) == -1) continue; --- 323,329 ---- uid = getuid (); gid = getgid (); for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (namlen(entry) != 0) { PCNAME thisname; if (SplitNameAllowDots(entry->d_name, &thisname) == -1) continue; *************** *** 427,433 **** return PCS_NOPATH; result = PCS_NOMATCH; for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (entry->d_namlen != 0) { PCNAME thisname; if (SplitName(entry->d_name, &thisname) == -1) continue; --- 434,440 ---- return PCS_NOPATH; result = PCS_NOMATCH; for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (namlen(entry) != 0) { PCNAME thisname; if (SplitName(entry->d_name, &thisname) == -1) continue; *************** *** 466,472 **** result = PCS_NOMATCH; for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (entry->d_namlen != 0) { PCNAME thisname; if (SplitName(entry->d_name, &thisname) == -1) continue; --- 473,479 ---- result = PCS_NOMATCH; for (entry = readdir(dirp); entry != NULL; entry = readdir(dirp)) ! if (namlen(entry) != 0) { PCNAME thisname; if (SplitName(entry->d_name, &thisname) == -1) continue; *** overhead/snap2/pcserver/pcssnap.c Wed Nov 22 13:59:11 1989 --- overhead/snap2/pcserver/pcssnap.c.NEW Wed Apr 3 21:29:21 1991 *************** *** 26,35 **** --- 26,37 ---- * */ + #include #include #include #include #include + #include #include int PCS_debuglevel; *** overhead/snap2/pcserver/pcsutils.c Wed Nov 22 13:59:13 1989 --- overhead/snap2/pcserver/pcsutils.c.NEW Wed Apr 3 21:29:22 1991 *************** *** 24,30 **** --- 24,37 ---- #include #include #include + #ifdef M_UNIX + #include + #define direct dirent + #define namlen(d) (strlen((d)->d_name)) + #else #include + #define namlen(d) ((d)->d_namlen) + #endif #include #include *************** *** 607,614 **** } for (entry = readdir (dirp); entry != NULL; entry = readdir (dirp)) ! if (entry->d_namlen != 0) { ! if ((entry->d_namlen == nlen) && (dirmatch (temppath+i+1, entry->d_name) == 0)) { strcpy (temppath+i+1, entry->d_name); temppath[i] = '/'; --- 614,621 ---- } for (entry = readdir (dirp); entry != NULL; entry = readdir (dirp)) ! if (namlen(entry) != 0) { ! if ((namlen(entry) == nlen) && (dirmatch (temppath+i+1, entry->d_name) == 0)) { strcpy (temppath+i+1, entry->d_name); temppath[i] = '/'; *** overhead/snap2/pcserver/pcsvice.c Mon Aug 6 11:15:55 1990 --- overhead/snap2/pcserver/pcsvice.c.NEW Sun May 5 18:59:18 1991 *************** *** 15,26 **** * */ ! #if defined(AIX) && defined(i386) ! #define bool_t junk_type ! #include ! #undef bool_t ! #endif /* defined(AIX) && defined(i386) */ ! #include #include extern int PCS_debuglevel; #define TRUE 1 --- 15,21 ---- * */ ! #include #include extern int PCS_debuglevel; #define TRUE 1 *** overhead/snap2/snap2/snapclie.c Fri Dec 21 15:03:23 1990 --- overhead/snap2/snap2/snapclie.c.NEW Tue Dec 4 09:10:50 1990 *************** *** 6,19 **** * This package contains the SNAP [Simple Network Access Protocol] * Client Services Package * ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/snap2/RCS/snapclie.c,v 2.4 90/09/17 14:28:06 gk5g Exp $ */ #define SNAPSCRAM - #include #include /* sys/types.h sys/time.h */ #include #include #include --- 6,19 ---- * This package contains the SNAP [Simple Network Access Protocol] * Client Services Package * ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/snap2/RCS/snapclie.c,v 2.5 90/11/28 15:05:48 susan Exp $ */ #define SNAPSCRAM #include /* sys/types.h sys/time.h */ + #include #include #include #include *** overhead/snap2/snap2t/snptclie.c Fri Dec 21 15:03:25 1990 --- overhead/snap2/snap2t/snptclie.c.NEW Tue Dec 4 09:10:58 1990 *************** *** 6,19 **** * This package contains the SNAP [Simple Network Access Protocol] * Client Services Package * ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/snap2t/RCS/snptclie.c,v 1.7 90/09/17 14:27:40 gk5g Exp $ */ #define SNAPSCRAM - #include #include /* sys/types.h sys/time.h */ #include #include #include --- 6,19 ---- * This package contains the SNAP [Simple Network Access Protocol] * Client Services Package * ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/snap2/snap2t/RCS/snptclie.c,v 1.8 90/11/28 15:06:26 susan Exp $ */ #define SNAPSCRAM #include /* sys/types.h sys/time.h */ + #include #include #include #include *** overhead/util/cmd/Imakefile Wed Nov 22 14:01:36 1989 --- overhead/util/cmd/Imakefile.NEW Wed Apr 3 21:29:31 1991 *************** *** 9,18 **** #ifdef WHITEPAGES_ENV ! ProgramTarget(newbt, newbt.o, $(UTILLIB),) InstallProgram(newbt, $(DESTDIR)/etc) #endif /* WHITEPAGES_ENV */ ! ProgramTarget(pref, pref.o, $(UTILLIB),) InstallProgram(pref, $(DESTDIR)/bin) --- 9,18 ---- #ifdef WHITEPAGES_ENV ! ProgramTarget(newbt, newbt.o, $(UTILLIB),${NETLIBS}) InstallProgram(newbt, $(DESTDIR)/etc) #endif /* WHITEPAGES_ENV */ ! ProgramTarget(pref, pref.o, $(UTILLIB),${NETLIBS}) InstallProgram(pref, $(DESTDIR)/bin) *** overhead/util/hdrs/tokens.h Wed Nov 22 14:03:25 1989 --- overhead/util/hdrs/tokens.h.NEW Mon Dec 17 14:55:29 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/overhead/util/hdrs/RCS/tokens.h,v 2.5 89/02/16 12:58:25 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/hdrs/RCS/tokens.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/hdrs/RCS/tokens.h,v 2.5 89/02/16 12:58:25 ghoti Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* --- 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/projects/andrew/overhead/util/hdrs/RCS/tokens.h,v 2.7 90/12/14 20:21:59 ajp Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/hdrs/RCS/tokens.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/hdrs/RCS/tokens.h,v 2.7 90/12/14 20:21:59 ajp Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *************** *** 18,26 **** /* Length of packed tokens */ #ifdef AFS_ENV ! #define TOKENS_LEN ((12 * sizeof(long int)) \ ! + sizeof(AuthMagic) \ ! + 2*sizeof(auth_EncryptionKey)) #else /* AFS_ENV */ #define TOKENS_LEN 4 #endif /* AFS_ENV */ --- 18,24 ---- /* Length of packed tokens */ #ifdef AFS_ENV ! #define TOKENS_LEN ((12 * sizeof(long int) + 32)) #else /* AFS_ENV */ #define TOKENS_LEN 4 #endif /* AFS_ENV */ *** overhead/util/hdrs/util.h Wed Jan 17 16:40:26 1990 --- overhead/util/hdrs/util.h.NEW Fri Apr 26 13:16:18 1991 *************** *** 2,15 **** * 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/util/hdrs/RCS/util.h,v 2.24 89/12/14 14:35:17 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/hdrs/RCS/util.h,v $ */ #ifndef _UTIL_H_ #define _UTIL_H_ 1 #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/hdrs/RCS/util.h,v 2.24 89/12/14 14:35:17 cfe Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) * && defined(RCS_HDRS) */ --- 2,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/hdrs/RCS/util.h,v 2.25 1991/04/26 17:00:55 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/hdrs/RCS/util.h,v $ */ #ifndef _UTIL_H_ #define _UTIL_H_ 1 #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/hdrs/RCS/util.h,v 2.25 1991/04/26 17:00:55 gk5g Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) * && defined(RCS_HDRS) */ *************** *** 17,23 **** /* ************************************************************ *\ Declarations for miscellaneous routines in libutil.a ! $Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/hdrs/RCS/util.h,v 2.24 89/12/14 14:35:17 cfe Exp $ \* ************************************************************ */ --- 17,23 ---- /* ************************************************************ *\ Declarations for miscellaneous routines in libutil.a ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/hdrs/RCS/util.h,v 2.25 1991/04/26 17:00:55 gk5g Exp $ \* ************************************************************ */ *************** *** 464,467 **** storage, do NOT free. */ #endif /* AFS30_ENV */ ! #endif _UTIL_H_ --- 464,467 ---- storage, do NOT free. */ #endif /* AFS30_ENV */ ! #endif /* _UTIL_H_ */ *** overhead/util/lib/tokunpak.c Fri Dec 21 15:03:29 1990 --- overhead/util/lib/tokunpak.c.NEW Mon Dec 17 14:55:42 1990 *************** *** 7,23 **** from datagrams and setting them as current with Venus. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.19 90/10/12 14:44:49 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.19 90/10/12 14:44:49 gk5g Exp $"; #endif /* lint */ #include #include - #include /* sys/types.h sys/time.h */ #include #include #include --- 7,23 ---- from datagrams and setting them as current with Venus. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.21 90/12/17 13:35:30 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.21 90/12/17 13:35:30 gk5g Exp $"; #endif /* lint */ + #include /* sys/types.h sys/time.h */ #include #include #include #include #include *************** *** 26,32 **** #ifdef AFS_ENV #include #include - #include #include #include #include --- 26,31 ---- *************** *** 139,241 **** while ( ((p - tokens) % sizeof(unsigned long)) != 0) ++p; return (p - tokens); } - - static void UnpackBcrypt(tokens, ctok, stok, debug) - char *tokens; - ClearToken *ctok; - SecretToken *stok; - int debug; - { - #ifdef DEBUG - if (debug) { - int i; - char *p; - - p = tokens; - fputs("Packed tokens: 0x", stderr); - for (i=0; iAuthHandle = * (long *) tokens; - tokens += sizeof(long); - stok->Noise1 = * (long *) tokens; - tokens += sizeof(long); - stok->ViceId = * (long *) tokens; - tokens += sizeof(long); - stok->BeginTimestamp = * (long *) tokens; - tokens += sizeof(long); - stok->Noise2 = * (long *) tokens; - tokens += sizeof(long); - stok->EndTimestamp = * (long *) tokens; - tokens += sizeof(long); - stok->Noise3 = * (long *) tokens; - tokens += sizeof(long); - stok->Noise4 = * (long *) tokens; - tokens += sizeof(long); - - /* Now do clear token */ - ctok->AuthHandle = ntohl(* (long *) tokens); - tokens += sizeof(long); - ctok->ViceId = ntohl(* (long *) tokens); - tokens += sizeof(long); - ctok->BeginTimestamp = ntohl(* (long *) tokens); - tokens += sizeof(long); - ctok->EndTimestamp = ntohl(* (long *) tokens); - tokens += sizeof(long); - bcopy(tokens, stok->MagicString, sizeof(AuthMagic)); - tokens += sizeof(AuthMagic); - bcopy(tokens, &stok->HandShakeKey, KEYSIZE); - tokens += KEYSIZE; - bcopy(tokens, &ctok->HandShakeKey, KEYSIZE); - - #ifdef DEBUG - if (debug) { - int i; - char *p; - - p = (char *) ctok; - fputs("Clear token: 0x", stderr); - for (i=0; iname); strncpy(cell, srvP->cell, MAXCELLCHARS); } else { ! UnpackBcrypt(Read, ctokP, stokP, debug); ! Read += TOKENS_LEN; ! if (tok_GetStr(&Read, EndP, StrCellName, sizeof(StrCellName)) == 0) { ! *pWhere += *pWhereLen; ! *pWhereLen = 0; ! return -1; ! } ! ++Read; /* must skip over the terminating NUL in any case. */ ! while (((Read - (*pWhere)) % sizeof(long)) != 0) ++Read; ! ! /* We've now read the tokens, the primary flag, and the cell name. Check 'em. */ ! PrimFlag = StrCellName[0]; ! ! /* OK: let's return this one. */ ! *begdP = ctokP->BeginTimestamp; ! *expdP = ctokP->EndTimestamp; ! *vidP = ctokP->ViceId; ! vname[0] = '\0'; ! strncpy(cell, &StrCellName[1], MAXCELLCHARS); } *pWhereLen -= (Read - *pWhere); /* Advance the generator. */ *pWhere = Read; --- 192,198 ---- strcpy(vname, cliP->name); strncpy(cell, srvP->cell, MAXCELLCHARS); } else { ! return -1; } *pWhereLen -= (Read - *pWhere); /* Advance the generator. */ *pWhere = Read; *************** *** 345,364 **** int *primP, *locP; int debug; {/* exported: generate the information for clients, but not the ticket bits themselves. */ - ClearToken ctok; SecretToken stok; struct ktc_principal Srv, xCli; struct ktc_token Token; ! return(GenAuths(pWhere, pWhereLen, &Srv, &xCli, &Token, &ctok, &stok, begdP, expdP, vidP, cell, vname, primP, locP, debug)); } #else /* AFS_ENV */ { return 0; } #endif /* AFS_ENV */ ! int GenTokens(pWhere, pWhereLen, ctokP, stokP, expdP, vidP, cell, primP, locP, debug) #ifdef AFS_ENV char **pWhere; int *pWhereLen; - ClearToken *ctokP; SecretToken *stokP; unsigned long int *expdP; int *vidP; char *cell; int *primP, *locP; --- 232,249 ---- int *primP, *locP; int debug; {/* exported: generate the information for clients, but not the ticket bits themselves. */ struct ktc_principal Srv, xCli; struct ktc_token Token; ! return(GenAuths(pWhere, pWhereLen, &Srv, &xCli, &Token, begdP, expdP, vidP, cell, vname, primP, locP, debug)); } #else /* AFS_ENV */ { return 0; } #endif /* AFS_ENV */ ! int GenTokens(pWhere, pWhereLen, expdP, vidP, cell, primP, locP, debug) #ifdef AFS_ENV char **pWhere; int *pWhereLen; unsigned long int *expdP; int *vidP; char *cell; int *primP, *locP; *************** *** 370,376 **** struct ktc_principal Serv, xCli; struct ktc_token KTok; char vname[MAXCELLCHARS+1]; ! return GenAuths(pWhere, pWhereLen, &Serv, &xCli, &KTok, ctokP, stokP, &Beg, expdP, vidP, cell, vname, primP, locP, debug); } #else /* AFS_ENV */ { return 0; } --- 255,261 ---- struct ktc_principal Serv, xCli; struct ktc_token KTok; char vname[MAXCELLCHARS+1]; ! return GenAuths(pWhere, pWhereLen, &Serv, &xCli, &KTok, &Beg, expdP, vidP, cell, vname, primP, locP, debug); } #else /* AFS_ENV */ { return 0; } *************** *** 381,388 **** char *Where; int WhereLen, debug, setPag; {/* Unpack the result of the given Where string, up to its length, and set those tokens in those cells. */ - ClearToken ctoken; - SecretToken stoken; struct ktc_principal Server, Client; struct ktc_token KToken; char *Read; char StrCellName[1+MAXCELLCHARS+1]; --- 266,271 ---- *************** *** 394,400 **** Now = osi_GetSecs() + 15; TokIx = 0; Read = Where; Remaining = WhereLen; ! while (GenAuths(&Read, &Remaining, &Server, &Client, &KToken, &ctoken, &stoken, &Begd, &Expd, &VID, StrCellName, VName, &IsPrimary, &IsLocal, debug) > 0) { #ifdef DEBUG if (debug) { char *p; --- 277,283 ---- Now = osi_GetSecs() + 15; TokIx = 0; Read = Where; Remaining = WhereLen; ! while (GenAuths(&Read, &Remaining, &Server, &Client, &KToken, &Begd, &Expd, &VID, StrCellName, VName, &IsPrimary, &IsLocal, debug) > 0) { #ifdef DEBUG if (debug) { char *p; *************** *** 432,442 **** } } else { if (VID >= 0) { ! if (U_CellSetLocalTokens(wantSetPag, &ctoken, &stoken, StrCellName, IsPrimary) != 0) { ! if (Begd < Now && Now < Expd) ! return -1; /* Times ok: must be some real problem. */ ! } ! wantSetPag = 0; } else { if (wantSetPag) { setpag(); --- 315,321 ---- } } else { if (VID >= 0) { ! return -1; } else { if (wantSetPag) { setpag(); *************** *** 461,468 **** char *Where, *cellName; int WhereLen, debug; {/* Unpack the tokens at Where (for WhereLen), looking for a token for cell cellName. If one is found, return the ViceId for that cell. */ - ClearToken ctoken; - SecretToken stoken; char *Read, *SP; char StrCellName[1+MAXCELLCHARS+1]; struct ktc_principal Server, Client; struct ktc_token KToken; --- 340,345 ---- *************** *** 476,482 **** else if (cellName[0] == '&' && ULstrcmp(&cellName[1], WorkstationName) == 0) wantLocal = 1; Read = Where; Remaining = WhereLen; ! while (GenAuths(&Read, &Remaining, &Server, &Client, &KToken, &ctoken, &stoken, &Begd, &Expd, &VID, StrCellName, VName, &IsPrimary, &haveLocal, debug) > 0) { #ifdef DEBUG if (debug) { fprintf(stderr, "Token in cell %s: VID %d, vname %s.\n", StrCellName, VID, VName); --- 353,359 ---- else if (cellName[0] == '&' && ULstrcmp(&cellName[1], WorkstationName) == 0) wantLocal = 1; Read = Where; Remaining = WhereLen; ! while (GenAuths(&Read, &Remaining, &Server, &Client, &KToken, &Begd, &Expd, &VID, StrCellName, VName, &IsPrimary, &haveLocal, debug) > 0) { #ifdef DEBUG if (debug) { fprintf(stderr, "Token in cell %s: VID %d, vname %s.\n", StrCellName, VID, VName); *** overhead/util/lib/Imakefile Wed Nov 22 14:04:20 1989 --- overhead/util/lib/Imakefile.NEW Thu Apr 11 14:47:20 1991 *************** *** 10,15 **** --- 10,16 ---- WHITEPAGESFILES = #endif /* WHITEPAGES_ENV */ + #ifdef SCOunix OBJS = abbrpath.o alquery.o andrwdir.o \ andydir.o cellauth.o cawp.o config.o \ desym.o errhdlr.o \ *************** *** 24,31 **** titles.o tokpak.o tokunpak.o topen.o \ uerror.o ulsindex.o ulstlmat.o ulstrcmp.o \ usignal.o vclose.o venusop.o verbose.o \ ! writeall.o DependTarget() NormalObjectRule() --- 25,51 ---- titles.o tokpak.o tokunpak.o topen.o \ uerror.o ulsindex.o ulstlmat.o ulstrcmp.o \ usignal.o vclose.o venusop.o verbose.o \ ! writeall.o ossup.o osasm.o ! #else ! OBJS = abbrpath.o alquery.o andrwdir.o \ ! andydir.o cellauth.o cawp.o config.o \ ! desym.o errhdlr.o \ ! fdplumb.o fdplumb2.o fdplumb3.o \ ! fdplumb4.o fdplumb5.o fdplumb6.o \ ! foldedeq.o fpacheck.o fselect.o gtime.o \ ! fwrtallc.o getaddr.o gethome.o getla.o \ ! getmyhom.o getpty.o hname.o lcappend.o lineprom.o \ ! localdir.o newstr.o nicetime.o pause.o \ ! procstuf.o profile.o readlink.o svcconf.o \ ! setprof.o t2open.o tfail.o thiscell.o times.o \ ! titles.o tokpak.o tokunpak.o topen.o \ ! uerror.o ulsindex.o ulstlmat.o ulstrcmp.o \ ! usignal.o vclose.o venusop.o verbose.o \ ! writeall.o ossup.o ! #endif /* SCOunix */ + AFS_OBJS = lcstring.o ucstring.o + DependTarget() NormalObjectRule() *************** *** 32,39 **** LibraryTarget(libutil.a, $(OBJS) ${WHITEPAGESFILES}) InstallLibrary(libutil.a, $(DESTDIR)/lib) TESTLIBS = ${UTILLIB} ${MALLOCLIB} ${PRSLIB} ! TestingOnlyTestingRule(${TESTLIBS}) NormalHelpRule() InstallDocs(setup.help prefs.help prefs.tutr, ${DESTDIR}/help) --- 52,62 ---- LibraryTarget(libutil.a, $(OBJS) ${WHITEPAGESFILES}) InstallLibrary(libutil.a, $(DESTDIR)/lib) + LibraryTarget(libafs.a, $(AFS_OBJS)) + InstallLibrary(libafs.a, $(DESTDIR)/lib) + TESTLIBS = ${UTILLIB} ${MALLOCLIB} ${PRSLIB} ! TestingOnlyTestingRule(${TESTLIBS},) NormalHelpRule() InstallDocs(setup.help prefs.help prefs.tutr, ${DESTDIR}/help) *** overhead/util/lib/btw.c Mon Aug 6 11:16:23 1990 --- overhead/util/lib/btw.c.NEW Wed Apr 3 21:29:53 1991 *************** *** 9,19 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btw.c,v 2.16 90/07/30 14:26:53 gk5g Exp $"; #include #include #include #include #include /* file, time, strings */ #include --- 9,24 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btw.c,v 2.17 91/04/02 17:11:58 susan Exp $"; #include #include + #ifdef M_UNIX + #include + #define direct dirent + #else #include + #endif #include #include /* file, time, strings */ #include *************** *** 116,121 **** --- 121,128 ---- struct btFile *bF; int InitialIndexSize; { + if (InitialIndexSize == 0) + InitialIndexSize = 1; bF->Index = (unsigned long *) malloc(sizeof(unsigned long) * InitialIndexSize); if (bF->Index == NULL) return bterr_OutOfMemory; bF->IndexAlloc = InitialIndexSize; *** overhead/util/lib/btwp.c Fri Dec 21 15:03:32 1990 --- overhead/util/lib/btwp.c.NEW Tue Dec 4 09:11:32 1990 *************** *** 9,20 **** For use only internally to the WP library. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btwp.c,v 2.11 90/11/06 16:24:04 mcinerny Exp $"; #include #include #include - #include /* strings */ #include #include #ifdef WHITEPAGES_ENV /* avoid makedepend "errors" */ --- 9,20 ---- For use only internally to the WP library. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btwp.c,v 2.12 90/11/28 15:07:41 susan Exp $"; + #include /* strings */ #include #include #include #include #include #ifdef WHITEPAGES_ENV /* avoid makedepend "errors" */ *** overhead/util/lib/cellauth.c Mon Aug 6 11:16:30 1990 --- overhead/util/lib/cellauth.c.NEW Fri Dec 14 17:08:17 1990 *************** *** 7,17 **** Keep track of the current user's authentication status in different cells. \* ************************************************************ */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v 2.19 90/07/12 15:09:53 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v 2.19 90/07/12 15:09:53 gk5g Exp $"; #endif /* lint */ #include --- 7,17 ---- Keep track of the current user's authentication status in different cells. \* ************************************************************ */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v 2.20 90/12/06 14:29:28 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v 2.20 90/12/06 14:29:28 gk5g Exp $"; #endif /* lint */ #include *************** *** 24,30 **** #ifdef AFS_ENV #include #include - #include #include #include #endif /* AFS_ENV */ --- 24,29 ---- *** overhead/util/lib/fdplumb.c Mon Aug 6 11:16:32 1990 --- overhead/util/lib/fdplumb.c.NEW Wed Apr 3 21:29:55 1991 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.8 90/06/04 11:14:10 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.8 90/06/04 11:14:10 gk5g Exp $"; #endif /* lint */ #include --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.10 91/04/02 17:12:27 susan Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.10 91/04/02 17:12:27 susan Exp $"; #endif /* lint */ #include *************** *** 210,216 **** return(fd); } ! #ifndef hp9000s300 int dbg_socketpair(dom, typ, prot, sv) int dom, typ, prot, sv[2]; { --- 210,216 ---- return(fd); } ! #if !defined(hp9000s300) && !defined(M_UNIX) int dbg_socketpair(dom, typ, prot, sv) int dom, typ, prot, sv[2]; { *************** *** 223,226 **** } return(res); } ! #endif /* hp9000s300 */ --- 223,226 ---- } return(res); } ! #endif /* hpux */ *** overhead/util/lib/fdplumb6.c Wed Nov 22 14:07:06 1989 --- overhead/util/lib/fdplumb6.c.NEW Wed Apr 3 21:29:56 1991 *************** *** 2,9 **** * 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/overhead/util/lib/RCS/fdplumb6.c,v 2.4 89/02/10 23:25:28 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/fdplumb6.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb6.c,v 2.5 91/04/02 17:12:31 susan Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb6.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; *************** *** 11,17 **** --- 11,22 ---- #include /* types */ + #ifdef M_UNIX + #include + #define direct dirent + #else #include + #endif #include DIR *dbg_opendir(name) *** overhead/util/lib/getcpw.c Mon Aug 6 11:16:34 1990 --- overhead/util/lib/getcpw.c.NEW Thu Mar 21 15:42:38 1991 *************** *** 6,12 **** getcpw.c Routines to do Vice-cell-based getpwuid and getpwnam. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/getcpw.c,v 2.13 90/06/04 11:14:17 gk5g Exp $"; #include #include /* syslog.h */ --- 6,12 ---- getcpw.c Routines to do Vice-cell-based getpwuid and getpwnam. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/getcpw.c,v 2.14 91/03/21 15:41:10 gk5g Exp $"; #include #include /* syslog.h */ *************** *** 91,97 **** if (Res == wperr_NoError) RetP.pw_gid = atoi(NewPtr); else if (Res == wperr_NoSuchField) RetP.pw_gid = -1; else {cpw_error = Res; errno = ETIMEDOUT; return NULL;} ! #if (! defined(SYSV) && ! defined(AIX)) RetP.pw_quota = 0; /* pw_quota */ #endif /* ! SYSV && ! AIX */ #ifndef _IBMR2 --- 91,97 ---- if (Res == wperr_NoError) RetP.pw_gid = atoi(NewPtr); else if (Res == wperr_NoSuchField) RetP.pw_gid = -1; else {cpw_error = Res; errno = ETIMEDOUT; return NULL;} ! #if (! defined(SYSV) && ! defined(AIX) && ! defined(POSIX_ENV)) RetP.pw_quota = 0; /* pw_quota */ #endif /* ! SYSV && ! AIX */ #ifndef _IBMR2 *** overhead/util/lib/getpty.c Mon Aug 6 11:16:35 1990 --- overhead/util/lib/getpty.c.NEW Tue Jan 22 14:32:26 1991 *************** *** 2,8 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! static char rcsid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/getpty.c,v 1.8 90/06/12 14:54:15 gk5g Exp $"; /* This module contains the routine getpty. It returns file descriptors --- 2,8 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! static char rcsid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/getpty.c,v 1.9 91/01/21 18:17:17 gk5g Exp $"; /* This module contains the routine getpty. It returns file descriptors *************** *** 12,29 **** #include #include #ifdef hpux #include #include #endif /* hpux */ ! #ifdef AIX #include #include #include #include ! #endif /* AIX */ #ifdef hpux --- 12,31 ---- #include + #include #include + #ifdef hpux #include #include #endif /* hpux */ ! #if SY_AIX221 #include #include #include #include ! #endif /* SY_AIX221 */ #ifdef hpux *************** *** 44,49 **** --- 46,57 ---- #define MAX_PTYS 256 #endif + #if POSIX_ENV + #define OPEN_FLAGS O_RDWR|O_NOCTTY + #else + #define OPEN_FLAGS O_RDWR + #endif + static char *GetPtyNumberString(num) int num; { *************** *** 58,63 **** --- 66,72 ---- #endif /* SY_AIX221 */ return ptyNum; } + int GetPtyandName(masterFD, slaveFD,name,len) int *masterFD; int *slaveFD; *************** *** 64,69 **** --- 73,107 ---- char *name; int len; { + #if SY_AIX31 + /* AIX 3.1 lets us open a single device "/dev/ptc" which + * finds an available pty for us. ttyname() returns the + * name of that device. + */ + int master; + int slave; + char *ptyname; + + if ((master = open("/dev/ptc", OPEN_FLAGS)) < 0) + return 0; /* none left */ + if ((ptyname = ttyname(master)) == NULL) { + /* major weirdness */ + close(master); + return 0; + } + if ((slave = open(ptyname, OPEN_FLAGS)) < 0) { + /* more weirdness */ + close(master); + return 0; + } + if (name != NULL) + strncpy(name,ptyname,len); + if (masterFD != NULL) + *masterFD = master; + if (slaveFD != NULL) + *slaveFD = slave; + return 1; + #else int PtyNumber = 0; char ptcname[MAXPATHLEN]; char ptyname[MAXPATHLEN]; *************** *** 75,83 **** ptyNum = GetPtyNumberString(PtyNumber); strcpy(ptcname, MASTER_PTY_PREFIX); strcat(ptcname, ptyNum); ! if ((master = open (ptcname, 2)) >= 0) { ! #if defined(AIX) && !defined(_IBMR2) { int value; if ((value = ioctl(master, PTYSTATUS, 0)) == -1 || (value & 0xffff) != 0 || (value >> 16) != 1) { --- 113,122 ---- ptyNum = GetPtyNumberString(PtyNumber); strcpy(ptcname, MASTER_PTY_PREFIX); strcat(ptcname, ptyNum); ! if ((master = open (ptcname, OPEN_FLAGS)) >= 0) { ! #if SY_AIX221 { + /* Be sure this pty really is available. */ int value; if ((value = ioctl(master, PTYSTATUS, 0)) == -1 || (value & 0xffff) != 0 || (value >> 16) != 1) { *************** *** 85,95 **** continue; } } ! #endif /* defined(AIX) && !defined(_IBMR2) */ strcpy(ptyname, SLAVE_PTY_PREFIX); strcat(ptyname, ptyNum); if(name != NULL) strncpy(name,ptyname,len); ! if ((slave = open(ptyname, 2)) >= 0) { if (masterFD != NULL) *masterFD = master; if (slaveFD != NULL) --- 124,134 ---- continue; } } ! #endif /* SY_AIX221 */ strcpy(ptyname, SLAVE_PTY_PREFIX); strcat(ptyname, ptyNum); if(name != NULL) strncpy(name,ptyname,len); ! if ((slave = open(ptyname, OPEN_FLAGS)) >= 0) { if (masterFD != NULL) *masterFD = master; if (slaveFD != NULL) *************** *** 102,108 **** --- 141,149 ---- } return 0; + #endif /* SY_AIX31 */ } + int GetPty(masterFD, slaveFD) int *masterFD; int *slaveFD; *** overhead/util/lib/gtvpwkey.c Mon Aug 6 11:16:36 1990 --- overhead/util/lib/gtvpwkey.c.NEW Thu Mar 21 16:06:09 1991 *************** *** 6,12 **** gtvpwkey.c getvpwkey(key) is like getpwent given a WP key value, for Vice IDs. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/gtvpwkey.c,v 2.9 90/06/04 11:14:23 gk5g Exp $"; #include #include /* syslog.h */ --- 6,12 ---- gtvpwkey.c getvpwkey(key) is like getpwent given a WP key value, for Vice IDs. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/gtvpwkey.c,v 2.10 91/03/21 16:02:11 gk5g Exp $"; #include #include /* syslog.h */ *************** *** 113,119 **** if (Res == wperr_NoError) RetP.pw_gid = atoi(NewPtr); else if (Res == wperr_NoSuchField) RetP.pw_gid = -1; else {errno = ETIMEDOUT; return NULL;} ! #if (! defined(SYSV) && ! defined(AIX)) RetP.pw_quota = 0; /* pw_quota */ #endif /* ! SYSV && ! AIX */ #ifndef _IBMR2 --- 113,119 ---- if (Res == wperr_NoError) RetP.pw_gid = atoi(NewPtr); else if (Res == wperr_NoSuchField) RetP.pw_gid = -1; else {errno = ETIMEDOUT; return NULL;} ! #if (! defined(SYSV) && ! defined(AIX) && ! defined(POSIX_ENV)) RetP.pw_quota = 0; /* pw_quota */ #endif /* ! SYSV && ! AIX */ #ifndef _IBMR2 *** overhead/util/lib/pause.c Wed Nov 22 14:06:17 1989 --- overhead/util/lib/pause.c.NEW Wed Apr 3 21:29:57 1991 *************** *** 2,9 **** * 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/overhead/util/lib/RCS/pause.c,v 2.6 89/07/05 11:48:02 cfe Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/pause.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/pause.c,v 2.7 91/04/02 17:12:24 susan Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/pause.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; *************** *** 35,41 **** #define RPAUSE_ENABLE 2 /* enable pause on error */ #define RPAUSE_ALL 0x7fffffff /* all error number types */ ! #ifdef AIX return 0; #else /* #ifdef AIX */ struct sigvec OldS, NewS; --- 35,41 ---- #define RPAUSE_ENABLE 2 /* enable pause on error */ #define RPAUSE_ALL 0x7fffffff /* all error number types */ ! #if defined(AIX) || defined(M_UNIX) return 0; #else /* #ifdef AIX */ struct sigvec OldS, NewS; *** overhead/util/lib/prefs.help Fri Dec 21 15:03:36 1990 --- overhead/util/lib/prefs.help.NEW Mon Jun 10 12:00:41 1991 *************** *** 1,4 **** ! \begindata{text,268681116} \textdsversion{12} \template{help} --- 1,4 ---- ! \begindata{text,268764524} \textdsversion{12} \template{help} *************** *** 21,32 **** Quick Reference list of preferences ! \leftindent{Window and Mouse Properties} ! \leftindent{Console} ! \leftindent{Fonts and Templates EZ Andrew Message System --- 21,36 ---- Quick Reference list of preferences ! \leftindent{Window and Mouse Properties ! Menus ! Scrollbars + Console + + Fonts and Templates + EZ Andrew Message System *************** *** 209,215 **** ?E=DISPLAY=pgh\\:0:typescript.geometry:600x600 } ! \section{Reference list of preferences }\leftindent{ The sections below detail options that you can put into your preferences file, --- 213,219 ---- ?E=DISPLAY=pgh\\:0:typescript.geometry:600x600 } ! \section{Quick Reference list of preferences }\leftindent{ The sections below detail options that you can put into your preferences file, *************** *** 275,280 **** --- 279,550 ---- brings up most things in a dialog box.}}\section{ + }\leftindent{\bold{UseProgramNameInTitle: \italic{yes}} + + \leftindent{If this is set to "no", then the program name will not be included + in the window title bar. The default is that the program name will be + included in the window title bar. + + }\leftindent{ + }}\leftindent{\bold{MaxTitleLength: \italic{-1}} + + \leftindent{The value limits the maximum length of the string in the window + title bar. The default value is -1, indicating that the length of the window + title bar string is unlimited. The title bar string is made up of two + different parts: the first, which may be omitted, is the program name; the + second, some application-specific string. In the case of the Ez editor, the + program name is "\bold{ez}" and the application-specific portion is the + current file name or buffer. When a positive value is specified, the front + part of the application-specific string is truncated, limiting its total + length to this value. This preference is most useful with programs that place + a, potentially long, filename in the title bar. + + } + \bold{MaxIconLabelLength: \italic{-1}} + + \leftindent{The value limits the maximum length of the string in a window's + icon label. The default value is -1, indicating that the length of the + window's icon label is unlimited. The icon label is made up of two different + parts: the first is the program name; the second some application-specific + string. In the case of the Ez editor, the program name is "\bold{ez}" and the + application-specific portion is the current file name or buffer. When a + positive value is specified, the front part of the application-specific string + is truncated, limiting its total length to this value. This preference is + most useful with programs that place a, potentially long, filename in the icon + label. + + }} + \section{Menus + + }(for more information see the help files for Menus and Menubar) + + \leftindent{ \bold{Menubar: \italic{off}} + + \leftindent{Determines whether a menubar is provided across the top of every + window. Note: turning this on turns PopupMenus off by default, but if a + PopupMenus is explicity set to on the popup menus will be available. + + + }\bold{PopupMenus: \italic{on + + }}\leftindent{Determines whether popup (aka stack of cards) menus are + provided. + + } + \bold{MenubarCardDelay: \italic{0}} + + \leftindent{When one menucard is visible this is the amount of time, in + milliseconds, the mouse must remain stationary before a new menucard will be + brought up. + + + }\bold{PopupMenuList: (no default) + + }\leftindent{Allows you to list the names of menucards which should always + appear on a popup "stack of cards" menu. If the menubar is active and this + preference exists and is non-empty only menus in the list given will appear on + the "stack of cards". The format for this preference is: + + + \example{*.PopupMenuList: "Card1Name", "Card2Name"} + + + etc... Note that more than two cards can be listed and each card name must be + enclosed in quotes and there should be no space before the commas, leading + and trailing spaces and tabs will be ignored. + + + }\bold{CardOrder: (no default) + + }\leftindent{Allows you to change the ordering of menus. Each menu has a + priority from 1 to 100, menus with lower priority are placed to the left in + the menubar and towards the front in the "stack of cards". The format for + this preference is: + + + \example{*.CardOrder: "Card1Name~Card1Priority", "Card2Name~Card2Priority" + + } + (The above may appear as two lines on the screen but is really only one line.) + + This preference can change the order menus appear in \bold{both} the stack of + cards and in the menubar. + + + }\bold{PopupCardOrder: (no default)}\leftindent{\bold{ + + }}\leftindent{ This preference works just like the CardOrder preference except + it only affects the "popup" or stack of cards.} + + + \bold{MenubarCardOrder: (no default) + + }\leftindent{This preference works just like the CardOrder preference except + it only affects the menubar. + + + }}\leftindent{\bold{MenubarSpacing: \italic{5}}}\leftindent{ + + \leftindent{Sets amount of extra space (in pixels) around the names of menus + in the menubar. + + } + \bold{MenubarShadowDepth: }\italic{\bold{2} + + }\leftindent{The width of the boxes around selected items. + + } + \bold{MenubarTitleFont: }\italic{\bold{andy12b} + + }\leftindent{The font to use for the menu names. + + } + \bold{MenubarItemFont: }\italic{\bold{andy12b} + + }\leftindent{The font to use on the menu cards. + + } + \bold{MenubarTitleColor: }\italic{\bold{black} + + }}\leftindent{\leftindent{The color to draw the menu names + in.}}\leftindent{\leftindent{ + + } + \bold{MenubarBackgroundColor: }\italic{\bold{white} + + }\leftindent{The background color to use in the menubar. + + } + \bold{MenubarItemColor: }\italic{\bold{black} + + }\leftindent{The color to draw menu items in. + + } + \bold{MenubarCardBackgroundColor: }\italic{\bold{white} + + }\leftindent{The background color to use in menu cards. + + } + \bold{MenubarGrayItemColor: }\italic{\bold{black} + + }\leftindent{The color to draw inactive menu items in. + + } + \bold{MenubarGrayItemStipple: }\italic{\bold{None} + + }\leftindent{The stipple pattern to draw inactive menu items with. + + } + \bold{MenubarGrayTitleColor: }\italic{\bold{black} + + }\leftindent{The color to draw the titles of inactive menu cards. + + } + \bold{MenubarGrayTitleStipple: }\italic{\bold{None} + + }\leftindent{The path of a stipple pattern to draw the titles of inactive menu + cards, or None if no stipple pattern is desired. + + } + \bold{MenubarTopShadowColor: }\italic{\bold{black} + + }\leftindent{The color to draw the top of the selection box in the menubar in. + + } + \bold{MenubarTopShadowStipple: (defaults to gray)} + + \leftindent{The path of an X stipple pattern to draw the top of the selection + box in the menubar with, or None if no stipple pattern is desired. + + } + \bold{MenubarBottomShadowColor: }\italic{\bold{black} + + }\leftindent{The color to draw the bottom of the selection box in the menubar + in. + + } + \bold{MenubarBottomShadowStipple: }\italic{\bold{None} + + }\leftindent{The path to a stipple pattern to draw the bottom of the selection + box in the menubar in, or None if no stipple pattern is desired. + + } + \bold{MenubarCardTopShadowColor: }\italic{\bold{black} + + }\leftindent{The color to draw the top of the selection box around menu items + in. + + } + \bold{MenubarCardTopShadowStipple: (defaults to gray)} + + \leftindent{The path to a stipple pattern to draw the top of the selection box + around menu items with, or None if no stipple pattern is desired. + + } + \bold{MenubarCardBottomShadowColor: }\italic{\bold{black} + + }\leftindent{The color to draw the bottom of the selection box around menu + items in. + + } + \bold{MenubarCardBottomShadowStipple: }\italic{\bold{None} + + }\leftindent{The stipple pattern to draw the bottom of the selection box + around menu items with, or None if no stipple pattern is desired. + + }}\section{ + Scrollbars + + }\leftindent{\bold{MotifScrollBars:}\italic{\bold{ no} + + }\leftindent{ Determines if "Motif" style scrollbars are desired. + + } + \bold{ScrollbarWidth:}\italic{\bold{ }\bold{20} }\bold{(for normal scrollbars + )}\italic{,\bold{ 15 }}\bold{(for "Motif" style scrollbars)}\italic{ + + }\leftindent{ Determines the width of the scrollbar. + + } + \bold{DotWidth:}\italic{\bold{ 7} + + }\leftindent{ The width of the rectangle which indicates where the cursor is + or where the selection is. + + } + \bold{CornerShade:}\italic{\bold{ 8} + + }\leftindent{ A number from 0 (white) to 16 (black) indicating what shade + pattern should be used for the corners of the window which are left when two + scrollbars are being used (for instance when viewing a raster or table). + + } + \bold{EndZoneShade:}\italic{\bold{ 2} + + }\leftindent{ Same as CornerShade but for the end regions of the scrollbars. + + } + \bold{BackgroundShade:}\italic{\bold{ 4} + + }\leftindent{Same as CornerShade but for the region of the scrollbar not + covered by the elevator (the normally white rectangle which indicated what + portion of the document is visible). + + } + \bold{ElevatorShade:}\italic{\bold{ 0} + + }\leftindent{Same as CornerShade but for the interior of the rectangle which + shows which portion of the document is visible. + + } + \bold{ScrollbarPosition: (no default)} + + \leftindent{For text scrollbars this determines whether the scrollbar appears + on the left or the right. If it is set to be "right"(capitalization matters + here) the scrollbar will appear on the right of the text, if it is set to + anything else the scrollbar will appear to the left. + + }}\section{ }\leftindent{\bold{StartScrollTime: \italic{integer}} \leftindent{This value is used to set the time interval before repeat *************** *** 311,320 **** \leftindent{If this is set to "yes," then the image being scrolled will be updated as the user thumbs in the scroll bar with the left mouse down. The ! right mouse down will always thumb without updating the image.}}\section{ ! Console preferences}\section{ }\leftindent{ \bold{console.default: \italic{monitor}} --- 581,591 ---- \leftindent{If this is set to "yes," then the image being scrolled will be updated as the user thumbs in the scroll bar with the left mouse down. The ! right mouse down will always thumb without updating the image. ! }} ! \section{Console preferences}\section{ }\leftindent{ \bold{console.default: \italic{monitor}} *************** *** 419,427 **** \section{ EZ preferences} ! \leftindent{\bold{ez.bodyfont:\italic{ Andy12}} \leftindent{Controls the size and appearance of the font used for text in the EZ window. The default is a 12 point variable width font with serifs. Within EZ, overrides the \bold{bodyfont} preference, if any. --- 690,718 ---- \section{ EZ preferences} + \leftindent{ + \bold{ez.AllowKeyToggleToViMode: \italic{no}} + + \leftindent{In addition to responding to the EMACS editor command set, EZ has + the option of responding to the command set of the Berkeley VI editor. When + this preference is set to true, the keycommand t will toggle between + command sets. This is so you can switch between VI command set and EMACS + command set. It is set to false by default so beginning users don't suddenly + discover EZ no longer behaves. EZ can be made to come up in VI mode by + setting the \bold{editor} preference, or by setting an environment variable.} + + + \bold{ez.Editor: \italic{NULL}}\leftindent{ ! }\leftindent{It is comparatively easy for a user who prefers the VI command ! set to the EMACS command set to have EZ start up with the VI command set by ! default. Either set ez.Editor to \italic{vi} or set any one of the following ! environment variables to the string \italic{vi}: EDITOR, EDIT, ED, FCEDIT, ! VISUAL.} + + \bold{ez.bodyfont:\italic{ Andy12}} + \leftindent{Controls the size and appearance of the font used for text in the EZ window. The default is a 12 point variable width font with serifs. Within EZ, overrides the \bold{bodyfont} preference, if any. *************** *** 512,517 **** --- 803,809 ---- After the required time has elapsed, the message disappears when you type any keystroke into the window. The default is 15 seconds. + }\bold{ez.CompileCommand: \italic{build -k}}\leftindent{ This preference is used in the \italic{compile} package in EZ. It specifes a *************** *** 577,585 **** filename, EZ will bring up the specified filename in whatever directory you are in. ! }} ! \leftindent{\bold{ContentsList:\italic{chapter,section,subsection,paragraph,fun\ ! ction}} \leftindent{Specifies the title formats included in both the Table of Contents window and a printed table of contents. See the \italic{ez-contents } help --- 869,876 ---- filename, EZ will bring up the specified filename in whatever directory you are in. ! } ! \bold{ContentsList:\italic{chapter,section,subsection,paragraph,function}} \leftindent{Specifies the title formats included in both the Table of Contents window and a printed table of contents. See the \italic{ez-contents } help *************** *** 598,607 **** \leftindent{When set to yes, a table of contents will be included in each printed document, regardless of whether or not you open a Table of Contents window. A "yes" setting can be overridden by a -cn switch to \italic{ezprint} ! . See the \italic{ez-contents } help file.}} ! \leftindent{\bold{ez.StylesIncludeEnd: \italic{yes} ez.StylesIncludeBeginning: \italic{no}} --- 889,898 ---- \leftindent{When set to yes, a table of contents will be included in each printed document, regardless of whether or not you open a Table of Contents window. A "yes" setting can be overridden by a -cn switch to \italic{ezprint} ! . See the \italic{ez-contents } help file.} ! \bold{ez.StylesIncludeEnd: \italic{yes} ez.StylesIncludeBeginning: \italic{no}} *************** *** 609,621 **** add to the beginning of the style the text you add is \bold{not} in the style. When add to the end of the styled region, the text you add \bold{is} in the style. (Hence the defaults listed above.) Changing the defaults changes how ! text behaves when you add it to a styled region.}} ! \leftindent{\bold{tmacfile: \italic{pathname}} ! }\leftindent{\leftindent{Allows you to specify an alternate tmac file for ! ezprint to use when printing. }\bold{ez.hyphenate:\italic{ no}} --- 900,912 ---- add to the beginning of the style the text you add is \bold{not} in the style. When add to the end of the styled region, the text you add \bold{is} in the style. (Hence the defaults listed above.) Changing the defaults changes how ! text behaves when you add it to a styled region.} ! \bold{tmacfile: \italic{pathname}} ! \leftindent{Allows you to specify an alternate tmac file for ezprint to use ! when printing. }\bold{ez.hyphenate:\italic{ no}} *************** *** 622,631 **** \leftindent{If set to "yes", EZ will use hyphenation when printing.} - } - \section{Andrew Message System preferences} \leftindent{The preferences that are not prefixed with a program name will affect all Andrew Message System programs (see the \italic{ mail} help document to find out what those programs are). There are also "options" other --- 913,922 ---- \leftindent{If set to "yes", EZ will use hyphenation when printing.} + }\section{Andrew Message System preferences} + \leftindent{The preferences that are not prefixed with a program name will affect all Andrew Message System programs (see the \italic{ mail} help document to find out what those programs are). There are also "options" other *************** *** 1063,1068 **** --- 1354,1360 ---- + }\bold{ZipCreateTolerance: \italic{10}}\leftindent{ When you are creating an object with multiple segments in the zip editor, if *************** *** 1452,1455 **** link} ! }\enddata{text,268681116} --- 1744,1747 ---- link} ! }\enddata{text,268764524} *** overhead/util/lib/procstuf.c Mon Aug 6 11:16:40 1990 --- overhead/util/lib/procstuf.c.NEW Wed Apr 3 21:29:58 1991 *************** *** 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/projects/andrew/overhead/util/lib/RCS/procstuf.c,v 2.6 90/07/12 15:01:47 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/procstuf.c,v $ */ #ifndef lint --- 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/projects/andrew/overhead/util/lib/RCS/procstuf.c,v 2.8 91/04/02 17:12:19 susan Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/procstuf.c,v $ */ #ifndef lint *************** *** 12,20 **** /* convenient stuff for dealing with subprocesses */ #include /* sys/time.h index rindex */ ! #ifndef hp9000s300 #include ! #endif /* hp9000s300 */ #include extern char *getenv(); --- 12,20 ---- /* convenient stuff for dealing with subprocesses */ #include /* sys/time.h index rindex */ ! #ifndef hpux #include ! #endif /* hpux */ #include extern char *getenv(); *************** *** 122,138 **** /* trash second arg */ char *statustostr(status,buf,len) ! #ifdef hp9000s300 int *status; ! #else /* hp9000s300 */ union wait *status; ! #endif /* hp9000s300 */ char *buf; int len; { ! #ifdef hp9000s300 sprintf(buf,"status = %d.",*status); ! #else /* hp9000s300 */ if(WIFSTOPPED(*status)) strcpy(buf,"stopped."); else if(status->w_termsig!=0){ --- 122,138 ---- /* trash second arg */ char *statustostr(status,buf,len) ! #ifdef hpux || defined(M_UNIX) int *status; ! #else /* hpux */ union wait *status; ! #endif /* hpux */ char *buf; int len; { ! #ifdef hpux || defined(M_UNIX) sprintf(buf,"status = %d.",*status); ! #else /* hpux */ if(WIFSTOPPED(*status)) strcpy(buf,"stopped."); else if(status->w_termsig!=0){ *************** *** 146,151 **** return NULL; /* successful */ }else sprintf(buf,"exited with exit status of %d.",status->w_retcode); ! #endif /* hp9000s300 */ return buf; } --- 146,151 ---- return NULL; /* successful */ }else sprintf(buf,"exited with exit status of %d.",status->w_retcode); ! #endif /* hpux */ return buf; } *** overhead/util/lib/profile.c Mon Aug 6 11:16:41 1990 --- overhead/util/lib/profile.c.NEW Tue May 21 15:32:39 1991 *************** *** 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/projects/andrew/overhead/util/lib/RCS/profile.c,v 2.6 90/07/12 15:02:29 gk5g Exp $ */ /* $ACIS:profile.c 1.5$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v 2.6 90/07/12 15:02:29 gk5g Exp $"; #endif /* lint */ #include --- 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/projects/andrew/overhead/util/lib/RCS/profile.c,v 2.7 1990/11/27 17:09:38 ajp Exp $ */ /* $ACIS:profile.c 1.5$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v 2.7 1990/11/27 17:09:38 ajp Exp $"; #endif /* lint */ #include *************** *** 33,40 **** #define openglobalprofile() ((struct configurelist *) ReadConfigureFile(GLOBALPROFILE)) ! static struct configurelist *openprofile () { ! char *pl=(char *) getenv("PROFILES"); char *home=(char *) gethome(NULL); char *sep; int homelen=(home==NULL ? 0 : strlen(home)); --- 33,43 ---- #define openglobalprofile() ((struct configurelist *) ReadConfigureFile(GLOBALPROFILE)) ! static struct configurelist *openprofile (filename, defaultname) ! char *filename; ! char *defaultname; ! { ! char *pl=(char *) getenv(filename); char *home=(char *) gethome(NULL); char *sep; int homelen=(home==NULL ? 0 : strlen(home)); *************** *** 42,48 **** char tmpFileName[MAXPATHLEN]; if(pl==NULL || *pl=='\0') ! pl=DEFAULTPROFILES; do{ char *name; --- 45,51 ---- char tmpFileName[MAXPATHLEN]; if(pl==NULL || *pl=='\0') ! pl=defaultname; do{ char *name; *************** *** 92,99 **** char *GetProfileFileName() { if (! inited) { ! profileHead = openprofile(); ! GloprofileHead = openglobalprofile(); inited = 1; } --- 95,102 ---- char *GetProfileFileName() { if (! inited) { ! profileHead = openprofile("PROFILES", DEFAULTPROFILES); ! GloprofileHead = openprofile("GLOBALPROFILES", GLOBALPROFILE); inited = 1; } *************** *** 103,110 **** char *GetFirstProfileFileName() { if (! inited) { ! profileHead = openprofile(); ! GloprofileHead = openglobalprofile(); inited = 1; } --- 106,113 ---- char *GetFirstProfileFileName() { if (! inited) { ! profileHead = openprofile("PROFILES", DEFAULTPROFILES); ! GloprofileHead = openprofile("GLOBALPROFILES", GLOBALPROFILE); inited = 1; } *************** *** 127,134 **** char *var; { char *retval; if (! inited) { ! profileHead = openprofile(); ! GloprofileHead = openglobalprofile(); inited = 1; } #ifdef GLOBALPREFERENCE --- 130,137 ---- char *var; { char *retval; if (! inited) { ! profileHead = openprofile("PROFILES", DEFAULTPROFILES); ! GloprofileHead = openprofile("GLOBALPROFILES", GLOBALPROFILE); inited = 1; } #ifdef GLOBALPREFERENCE *** overhead/util/lib/setprof.c Mon Aug 6 11:16:43 1990 --- overhead/util/lib/setprof.c.NEW Thu May 30 19:09:18 1991 *************** *** 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/projects/andrew/overhead/util/lib/RCS/setprof.c,v 2.12 90/07/12 15:03:04 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/setprof.c,v $ */ #ifndef lint --- 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/projects/andrew/overhead/util/lib/RCS/setprof.c,v 2.14 91/05/24 22:44:52 gk5g Exp $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/setprof.c,v $ */ #ifndef lint *************** *** 74,84 **** MatchAllProgs = !strcmp(prog, "*"); ! if ((profileFileName = GetProfileFileName()) == NULL) ! if ((profileFileName = GetFirstProfileFileName()) == NULL) return -1; - /* * If the profile file is a symbolic link, we want to deal with * the physical file underlying it since we'll be renaming on top --- 74,84 ---- MatchAllProgs = !strcmp(prog, "*"); ! if (!(profileFileName = GetProfileFileName()) || ! access(profileFileName, W_OK)) ! if (!(profileFileName = GetFirstProfileFileName())) /* ~/preferences */ return -1; /* * If the profile file is a symbolic link, we want to deal with * the physical file underlying it since we'll be renaming on top *************** *** 116,125 **** /* Strictly speaking, this test just saves time. It could be omitted. */ ! if ((access(finalProfileFileName, W_OK) != 0) && (errno != ENOENT)) return -1; sprintf(newProfileFileName, "%s.NEW", profileFileName); /* Open preference file for locking */ oldR = fopen(profileFileName, osi_F_READLOCK); --- 116,133 ---- /* Strictly speaking, this test just saves time. It could be omitted. */ ! if ((access(finalProfileFileName, W_OK) != 0) && (errno != ENOENT)) { ! fprintf(stderr, ! "No write access on file '%s'.\n", ! finalProfileFileName); return -1; + } + #ifdef USESHORTFILENAMES + sprintf(newProfileFileName, "%s+", profileFileName); + #else sprintf(newProfileFileName, "%s.NEW", profileFileName); + #endif /* Open preference file for locking */ oldR = fopen(profileFileName, osi_F_READLOCK); *** overhead/util/lib/setup.help Wed Nov 22 14:15:39 1989 --- overhead/util/lib/setup.help.NEW Tue Apr 9 19:18:10 1991 *************** *** 1,4 **** ! \begindata{text,268660716} \textdsversion{12} \template{help} \chapter{The AndrewSetup File: Site Configuration} --- 1,4 ---- ! \begindata{text,268746076} \textdsversion{12} \template{help} \chapter{The AndrewSetup File: Site Configuration} *************** *** 1184,1200 **** default is five days. The mail is rejected to the postmaster, not the sender. ! ! ! ! ! ! } ! \italic{AMS_ViceQueueLifetimeCap: number} \indent{Default: 2246400 --- 1184,1202 ---- default is five days. The mail is rejected to the postmaster, not the sender. ! } ! \italic{AMS_CrossCellQueueLifetime: number} + \indent{Default: 28800 + The number represents the amount of time, in seconds, that a message will be } ! left in an Andrew File System mail queue awaiting delivery directly into a ! cooperating AFS cell (running AMDS). This behavior is useful when remote AFS ! cells are defined locally, but the servers for those cells are not yet ! running. The default value is eight hours. \italic{AMS_ViceQueueLifetimeCap: ! number} \indent{Default: 2246400 *************** *** 1355,1359 **** help ! white-pages\ ! }}\enddata{text,268660716} --- 1357,1362 ---- help ! white-pages ! ! }}\enddata{text,268746076} *** overhead/util/lib/times.c Wed Sep 26 16:12:08 1990 --- overhead/util/lib/times.c.NEW Wed Apr 3 21:30:02 1991 *************** *** 11,19 **** #include #include ! #if (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV)) extern char *timezone(); ! #endif /* (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV)) */ extern int errno; --- 11,19 ---- #include #include ! #if (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP800_ENV) && !defined(M_UNIX)) extern char *timezone(); ! #endif /* (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP800_ENV)) */ extern int errno; *************** *** 21,29 **** --- 21,35 ---- #if SY_AIXx #define HAS_GETTIMEOFDAY 1 #endif /* #if SY_AIXx */ + #ifdef HP300_ENV #define HAS_GETTIMEOFDAY 1 #endif /* #ifdef HP300_ENV */ + + #ifdef HP800_ENV + #define HAS_GETTIMEOFDAY 1 + #endif /* #ifdef HP800_ENV */ + #if SY_B4x #define HAS_GETTIMEOFDAY 1 #endif /* #if SY_B4x */ *** overhead/util/lib/tokpak.c Mon Aug 6 11:16:49 1990 --- overhead/util/lib/tokpak.c.NEW Mon Dec 17 14:55:48 1990 *************** *** 6,17 **** tokpak.c -- Subroutines for getting and packing Venus tokens into datagrams. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v 2.19 90/06/04 11:14:50 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v 2.19 90/06/04 11:14:50 gk5g Exp $"; #endif /* lint */ #include --- 6,17 ---- tokpak.c -- Subroutines for getting and packing Venus tokens into datagrams. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v 2.20 90/12/17 14:03:01 gk5g Exp $ */ /* $ACIS: $ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v 2.20 90/12/17 14:03:01 gk5g Exp $"; #endif /* lint */ #include *************** *** 23,29 **** #ifdef AFS_ENV #include #include - #include #include #include #include --- 23,28 ---- *************** *** 126,223 **** while ( ((p - where) % sizeof(unsigned long)) != 0) *p++ = '\3'; return (p - where); } - - #if 0 - static int PackBcrypt(ctok, stok, where, debug) - ClearToken *ctok; - SecretToken *stok; - register char *where; - int debug; - { - register char *p; - - #ifdef DEBUG - if (debug) { - int i; - - p = (char *) ctok; - fputs("Clear token: 0x", stderr); - for (i=0; iAuthHandle; - p += sizeof(long int); - * (long int *) p = stok->Noise1; - p += sizeof(long int); - * (long int *) p = stok->ViceId; - p += sizeof(long int); - * (long int *) p = stok->BeginTimestamp; - p += sizeof(long int); - * (long int *) p = stok->Noise2; - p += sizeof(long int); - * (long int *) p = stok->EndTimestamp; - p += sizeof(long int); - * (long int *) p = stok->Noise3; - p += sizeof(long int); - * (long int *) p = stok->Noise4; - p += sizeof(long int); - * (long int *) p = htonl(ctok->AuthHandle); - p += sizeof(long int); - * (long int *) p = htonl(ctok->ViceId); - p += sizeof(long int); - * (long int *) p = htonl(ctok->BeginTimestamp); - p += sizeof(long int); - * (long int *) p = htonl(ctok->EndTimestamp); - p += sizeof(long int); - bcopy(stok->MagicString, p, sizeof(AuthMagic)); - p += sizeof(AuthMagic); - bcopy(&stok->HandShakeKey, p, KEYSIZE); - p += KEYSIZE; - bcopy(&ctok->HandShakeKey, p, KEYSIZE); - - #ifdef DEBUG - if (debug) { - int i; - - p = where; - fputs("Packed tokens: 0x", stderr); - for (i=0; i --- 6,17 ---- ulstrcmp.c--compare strings ignoring alphabetic case. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/ulstrcmp.c,v 2.8 91/04/04 19:36:32 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/ulstrcmp.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/ulstrcmp.c,v 2.8 91/04/04 19:36:32 gk5g Exp $"; #endif /* lint */ #include *************** *** 51,78 **** } return(result); } - - /* Just like strncpy but shift-case in transit and forces null termination */ - /* Copied 8/24/89 from afs/util/casestrcpy.c to allow omission of lib/afs/util.a */ - - char *lcstring (d, s, n) - char *d; /* dest string */ - char *s; /* source string */ - int n; /* max transfer size */ - { char *original_d = d; - char c; - - if ((s == 0) || (d == 0)) return 0; /* just to be safe */ - while (n) { - c = *s++; - c = DOWNCASE(c); - *d++ = c; - if (c == 0) break; /* quit after transferring null */ - if (--n == 0) *(d-1) = 0; /* make sure null terminated */ - } - return original_d; - } - #undef DOWNCASE --- 51,56 ---- *** overhead/util/lib/usignal.c Wed Nov 22 14:12:11 1989 --- overhead/util/lib/usignal.c.NEW Wed Apr 3 21:30:03 1991 *************** *** 6,17 **** usignal.c -- Return a static string describing a signal value. */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/usignal.c,v 2.5 89/04/16 01:30:21 pgc Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/usignal.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/usignal.c,v 2.5 89/04/16 01:30:21 pgc Exp $"; #endif /* lint */ #include --- 6,17 ---- usignal.c -- Return a static string describing a signal value. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/usignal.c,v 2.6 91/04/02 17:12:39 susan Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/usignal.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/usignal.c,v 2.6 91/04/02 17:12:39 susan Exp $"; #endif /* lint */ #include *************** *** 22,28 **** { /* Returns a pointer to a static buffer containing English text describing the same signal condition that signalNumber describes (interpreted as a Unix signal number). The text has no newlines in it. We contend that this is what ``psignal'' should have been returning all along. */ static char SigBuff[40]; ! #if (!defined(hpux)) && (!defined(AIX)) extern char *sys_siglist[]; if (signalNumber < NSIG && signalNumber > 0) return sys_siglist[signalNumber]; --- 22,28 ---- { /* Returns a pointer to a static buffer containing English text describing the same signal condition that signalNumber describes (interpreted as a Unix signal number). The text has no newlines in it. We contend that this is what ``psignal'' should have been returning all along. */ static char SigBuff[40]; ! #if (!defined(hpux)) && (!defined(AIX) && !defined(M_UNIX)) extern char *sys_siglist[]; if (signalNumber < NSIG && signalNumber > 0) return sys_siglist[signalNumber]; *** overhead/util/lib/wpbase.c Fri Dec 21 15:03:39 1990 --- overhead/util/lib/wpbase.c.NEW Tue Dec 4 09:11:40 1990 *************** *** 8,18 **** Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpbase.c,v 2.14 90/11/14 12:30:37 gk5g Exp $"; #include #include - #include /* sys/file.h sys/types.h sys/time.h strings.h*/ #include #include #include /* itc.h -> truth.h DMT */ --- 8,18 ---- Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpbase.c,v 2.15 90/11/28 15:07:58 susan Exp $"; + #include /* sys/file.h sys/types.h sys/time.h strings.h*/ #include #include #include #include #include /* itc.h -> truth.h DMT */ *** overhead/util/lib/ossup.c Thu May 30 20:56:07 1991 --- overhead/util/lib/ossup.c.NEW Wed Apr 3 21:30:04 1991 *************** *** 0 **** --- 1,168 ---- + #include + #include + + #ifdef M_UNIX + #include + #include + + extern int link(), unlink(); + + #if defined(MEMMOVE_IS_BROKEN) + /* add bcopy() so we don't have to pull in -lX11 */ + + void bcopy (b1, b2, length) + register unsigned char *b1, *b2; + register length; + { + if (b1 >= b2 || (b1 + length) < b2) { + memcpy(b2, b1, length); /* Note: memmove was much slower */ + return; + } + + b2 += length; + b1 += length; + while (length--) { + *--b2 = *--b1; + } + } + #endif /* MEMMOVE_IS_BROKEN */ + + + #if defined(RENAME_IS_BROKEN) + /* This is due to a bug in rename() that limits it to 13 character + filenames! + */ + int + sco_rename(old,new) + char *old,*new; + { + int cc; + unlink(new); + cc = link(old,new); + if (cc>=0) { + cc = unlink(old); + if (cc<0) + unlink(new); + } + return cc; + } + #endif /* RENAME_IS_BROKEN */ + + + #include + + scandir(dirname, namelist, sel, comp) + char *dirname; + struct dirent *(*namelist[]); + int (*sel)(); + int (*comp)(); + { + #define NENT 16 + int nfound=0,nent=NENT; + DIR *dir; + struct dirent *thisent; + struct dirent **name_p,**base_p; + int size; + + base_p = (struct dirent **)malloc(sizeof(struct dirent *) * nent); + name_p = base_p; + dir = opendir(dirname); + if (dir == NULL) { + free(base_p); + return 0; + } + while ( (thisent = readdir(dir)) != NULL ) { + if (sel && ((*sel)(thisent))==0) + continue; + if (++nfound > nent) { + nent += NENT; + base_p = (struct dirent **)realloc(base_p, sizeof(struct dirent *) * nent); + name_p = base_p + nfound - 1; + } + size = thisent->d_reclen; + *name_p = (struct dirent *)malloc(size); + bcopy(thisent, *name_p, size); + name_p++; + } + closedir(dir); + + if (nfound < nent) { + base_p = (struct dirent **)realloc(base_p, sizeof(struct dirent *) * nfound); + } + if (comp) + qsort(base_p,nfound,sizeof(struct dirent *),comp); + + *namelist = base_p; + + return nfound; + } + + alphasort(dir1,dir2) + struct dirent **dir1, **dir2; + { + return strcmp((*dir1)->d_name,(*dir2)->d_name); + } + + #include + + sigset_t + sigblock(new) + sigset_t new; + { + sigset_t s_new, s_old; + s_new = new; + sigprocmask(SIG_BLOCK,&s_new,&s_old); + return s_old; + } + + sigsetmask(new) + sigset_t new; + { + sigset_t s_new = new; + + sigprocmask(SIG_SETMASK,&s_new,0); + } + + #include + + utimes(file, tvp) + char *file; + struct timeval *tvp; + { + struct utimbuf times; + times.actime = tvp[0].tv_sec; + times.modtime = tvp[1].tv_sec; + return utime(file,×); + } + + sco_gettimeofday(tp, tzp) + struct timeval *tp; + struct timezone *tzp; + { + if (tp == NULL) + return -1; + tp->tv_sec = time(0); + tp->tv_usec = 0; + } + + fsync(fd) + int fd; + { + return 0; + } + + #endif /* M_UNIX */ + + + #ifdef NO_ITIMER_ENV + int + setitimer(type, new, old) + int type; + struct itimerval *new,*old; + { + int prev = alarm(new->it_value.tv_sec); + if (old) + old->it_value.tv_sec = prev; + return 0; + } + #endif /* NO_ITIMER_ENV */ *** overhead/util/lib/osasm.s Thu May 30 20:56:16 1991 --- overhead/util/lib/osasm.s.NEW Wed Apr 3 21:30:06 1991 *************** *** 0 **** --- 1,8 ---- + .globl ftruncate + .globl _cerror + + ftruncate: + movl $0x0a28, %eax + lcall $0x7,$0 + jc _cerror + ret *** overhead/util/lib/lcstring.c Thu May 30 20:56:25 1991 --- overhead/util/lib/lcstring.c.NEW Thu Apr 11 13:57:06 1991 *************** *** 0 **** --- 1,70 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + lcstring.c-- copies a source string to a dest buff, converting all uppercase to lower. + */ + + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/lcstring.c,v 1.2 91/04/11 13:53:41 gk5g Exp $ */ + /* $ACIS: $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/lcstring.c,v $ */ + + #ifndef lint + static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/lcstring.c,v 1.2 91/04/11 13:53:41 gk5g Exp $"; + #endif /* lint */ + + #include + + #define DOWNCASE(x) (isascii(x) && isalpha(x) && isupper(x) ? (tolower(x)) : (x)) + /* + * Just like strncpy but shift-case in transit and forces null termination. + * Copied 8/24/89 from afs/util/casestrcpy.c to allow omission of + * lib/afs/util.a; NOTE: on the sun4c version of AFS we need + * lib/afs/util.a so this function is going into its very own module. + * (4/4/91) + */ + + char *lcstring (d, s, n) + char *d; /* dest string */ + char *s; /* source string */ + int n; /* max transfer size */ + { char *original_d = d; + char c; + + if ((s == 0) || (d == 0)) return 0; /* just to be safe */ + while (n) { + c = *s++; + c = DOWNCASE(c); + *d++ = c; + if (c == 0) break; /* quit after transferring null */ + if (--n == 0) *(d-1) = 0; /* make sure null terminated */ + } + return original_d; + } + + #undef DOWNCASE + + #ifdef TESTINGONLYTESTING + #include + main(argc,argv) + int argc; + char *argv[]; + { + char *str1, str2; + int len; + + switch(argc) { + case 3: + len = argv[3]; + str1 = strcpy(str1,(char*)malloc(strlen(argv[1]) + len + 1)); + str2 = strcpy(str2,(char*)malloc(strlen(argv[2]) + 1)); + printf("str1 %s\nstr2 %s\n", str1, str2); + result = lcstring(str1, str2, len); + break; + fprintf(stderr, "usage: lcstring s1 s2 [n].\n"); + exit(1); + } + printf("new str1: %s", str1); + } + #endif /* TESTINGONLYTESTING */ *** overhead/util/lib/ucstring.c Thu May 30 20:56:34 1991 --- overhead/util/lib/ucstring.c.NEW Thu Apr 11 13:57:07 1991 *************** *** 0 **** --- 1,71 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + ucstring.c-- copies a source string to a dest buff, converting all lowercase to upper. + */ + + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/ucstring.c,v 1.1 91/04/11 13:54:19 gk5g Exp $ */ + /* $ACIS: $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/ucstring.c,v $ */ + + #ifndef lint + static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/ucstring.c,v 1.1 91/04/11 13:54:19 gk5g Exp $"; + #endif /* lint */ + + #include + + #define UPCASE(x) (isascii(x) && isalpha(x) && isupper(x) ? (x) : (toupper(x))) + + /* + * Just like strncpy but shift-case in transit and forces null termination. + * Copied 8/24/89 from afs/util/casestrcpy.c to allow omission of + * lib/afs/util.a; NOTE: on the sun4c version of AFS we need + * lib/afs/util.a so this function is going into its very own module. + * (4/4/91) + */ + + char *ucstring (d, s, n) + char *d; /* dest string */ + char *s; /* source string */ + int n; /* max transfer size */ + { char *original_d = d; + char c; + + if ((s == 0) || (d == 0)) return 0; /* just to be safe */ + while (n) { + c = *s++; + c = UPCASE(c); + *d++ = c; + if (c == 0) break; /* quit after transferring null */ + if (--n == 0) *(d-1) = 0; /* make sure null terminated */ + } + return original_d; + } + + #undef UPCASE + + #ifdef TESTINGONLYTESTING + #include + main(argc,argv) + int argc; + char *argv[]; + { + char *str1, str2; + int len; + + switch(argc) { + case 3: + len = argv[3]; + str1 = strcpy(str1,(char*)malloc(strlen(argv[1]) + len + 1)); + str2 = strcpy(str2,(char*)malloc(strlen(argv[2]) + 1)); + printf("str1 %s\nstr2 %s\n", str1, str2); + result = ucstring(str1, str2, len); + break; + fprintf(stderr, "usage: ucstring s1 s2 [n].\n"); + exit(1); + } + printf("new str1: %s", str1); + } + #endif /* TESTINGONLYTESTING */ *** overhead/wputil/Imakefile Fri Dec 21 15:03:41 1990 --- overhead/wputil/Imakefile.NEW Tue Apr 9 19:18:17 1991 *************** *** 3,12 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #ifdef RESOLVER_ENV ! RESOLVER_LIB = ${RESOLVLIB} #else RESOLVER_LIB = ! #endif /* RESOLVER_ENV */ #ifdef AMS_ENV MAILLIB = ${BASEDIR}/lib/libmail.a --- 3,19 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #ifdef RESOLVER_ENV ! #ifdef LIBDL_ENV ! SYS_LIBS = -lresolv ! RESOLVER_LIB = #else + RESOLVER_LIB = $(RESOLVLIB) + SYS_LIBS = + #endif /* LIBDL_ENV */ + #else RESOLVER_LIB = ! SYS_LIBS = ! #endif #ifdef AMS_ENV MAILLIB = ${BASEDIR}/lib/libmail.a *************** *** 18,24 **** WPINIHIST=lastpass oldpass passwd.add passwd.chg wpadd wpadd.old WPININAMES=givenmap nickanal.awk nickbun.awk nickmap nickmap.old override override.old LIBS = ${MAILLIB} \ ! ${UTILLIB} \ ${BASEDIR}/lib/liberrors.a \ ${MALLOCLIB} --- 25,31 ---- WPINIHIST=lastpass oldpass passwd.add passwd.chg wpadd wpadd.old WPININAMES=givenmap nickanal.awk nickbun.awk nickmap nickmap.old override override.old LIBS = ${MAILLIB} \ ! ${UTILLIB} ${DESLIB} \ ${BASEDIR}/lib/liberrors.a \ ${MALLOCLIB} *************** *** 36,42 **** InstallProgram(nickgen, ${DESTDIR}/etc) ProgramTarget(genaccts, genaccts.o, ${LIBS},) InstallProgram(genaccts, ${DESTDIR}/etc) ! ProgramTarget(brisk, brisk.o, ${LIBS} ${RESOLVER_LIB},) InstallProgram(brisk, ${DESTDIR}/etc) InstallProgram(wpbuild, ${DESTDIR}/etc) InstallMultiple(${WPINI}, ${INSTINCFLAGS}, ${DESTDIR}/etc/initial_wp/) --- 43,49 ---- InstallProgram(nickgen, ${DESTDIR}/etc) ProgramTarget(genaccts, genaccts.o, ${LIBS},) InstallProgram(genaccts, ${DESTDIR}/etc) ! ProgramTarget(brisk, brisk.o, ${LIBS} ${RESOLVER_LIB},$(SYS_LIBS)) InstallProgram(brisk, ${DESTDIR}/etc) InstallProgram(wpbuild, ${DESTDIR}/etc) InstallMultiple(${WPINI}, ${INSTINCFLAGS}, ${DESTDIR}/etc/initial_wp/) *** overhead/wputil/brisk.c Wed Nov 22 14:30:29 1989 --- overhead/wputil/brisk.c.NEW Tue Jan 22 15:29:23 1991 *************** *** 122,138 **** static DBM *db = NULL; datum key, val; enum MailHostQuality mhq; extern struct state _res; if (db == NULL && ndbmFile != NULL) { db = dbm_open(ndbmFile, O_RDWR|O_CREAT, 0666); if (db == NULL) ndbmFile = NULL; #ifdef RES_DEFNAMES _res.options &= ~RES_DEFNAMES; ! #endif /* #ifdef RES_DEFNAMES */ #ifdef RES_DNSRCH _res.options &= ~RES_DNSRCH; ! #endif /* #ifdef RES_DNSRCH */ } if (db != NULL) { cvDown(hst); --- 122,142 ---- static DBM *db = NULL; datum key, val; enum MailHostQuality mhq; + #ifdef RESOLVER_ENV extern struct state _res; + #endif /* RESOLVER_ENV */ if (db == NULL && ndbmFile != NULL) { db = dbm_open(ndbmFile, O_RDWR|O_CREAT, 0666); if (db == NULL) ndbmFile = NULL; + #ifdef RESOLVER_ENV #ifdef RES_DEFNAMES _res.options &= ~RES_DEFNAMES; ! #endif /* !RES_DEFNAMES */ #ifdef RES_DNSRCH _res.options &= ~RES_DNSRCH; ! #endif /* RES_DNSRCH */ ! #endif /* RESOLVER_ENV */ } if (db != NULL) { cvDown(hst); *** overhead/wputil/genaccts.c Fri Dec 21 15:03:42 1990 --- overhead/wputil/genaccts.c.NEW Fri Dec 14 17:08:38 1990 *************** *** 7,16 **** Generate a copy of our names database for use at CS. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/wputil/RCS/genaccts.c,v 5.13 90/10/23 15:19:09 gk5g Exp $"; - #include #include #include #include #include --- 7,16 ---- Generate a copy of our names database for use at CS. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/wputil/RCS/genaccts.c,v 5.15 90/12/06 18:26:57 gk5g Exp $"; #include + #include #include #include #include *************** *** 20,26 **** --- 20,28 ---- #include #include + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ extern char *index(); extern int errno; *** overhead/wputil/makeboth.c Fri Dec 21 15:03:49 1990 --- overhead/wputil/makeboth.c.NEW Fri Dec 14 17:08:45 1990 *************** *** 19,25 **** \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/wputil/RCS/makeboth.c,v 5.29 90/11/06 16:24:10 mcinerny Exp $"; #include #include #include --- 19,26 ---- \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/wputil/RCS/makeboth.c,v 5.31 90/12/06 18:28:11 gk5g Exp $"; ! #include #include #include #include *************** *** 28,34 **** #include #include #include - #include #include #include #ifdef AMS_ENV --- 29,34 ---- *************** *** 40,46 **** --- 40,48 ---- #include extern int errno; + #ifndef _IBMR2 extern char *malloc(), *realloc(); + #endif /* _IBMR2 */ #include static int WPOpen; *** overhead/wpi/Imakefile Fri Dec 21 15:03:52 1990 --- overhead/wpi/Imakefile.NEW Thu Apr 4 22:44:08 1991 *************** *** 3,12 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #ifdef RESOLVER_ENV ! RESOLVER_LIB = ${RESOLVLIB} #else RESOLVER_LIB = ! #endif /* RESOLVER_ENV */ #ifdef AMS_ENV MAILLIB = ${BASEDIR}/lib/libmail.a --- 3,19 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #ifdef RESOLVER_ENV ! #ifdef LIBDL_ENV ! SYS_LIBS = -lresolv ! RESOLVER_LIB = #else + RESOLVER_LIB = $(RESOLVLIB) + SYS_LIBS = + #endif /* LIBDL_ENV */ + #else RESOLVER_LIB = ! SYS_LIBS = ! #endif #ifdef AMS_ENV MAILLIB = ${BASEDIR}/lib/libmail.a *************** *** 23,37 **** InstallLibrary(libwpi.a, ${DESTDIR}/lib) #ifdef AMS_ENV ! ProgramTarget(wpi,wpi.o,${LIBS},) InstallProgram(wpi, ${DESTDIR}/bin/) InstallHardLink(${DESTDIR}/bin/wpi,${DESTDIR}/bin/forward) #endif AMS_ENV ! ProgramTarget(wpiupdat,wpiupdat.o,${LIBS},) InstallProgram(wpiupdat, ${DESTDIR}/etc/) ! ProgramTarget(wpq,wpq.o,${LIBS},) InstallProgram(wpq, ${DESTDIR}/bin/) DependTarget() --- 30,44 ---- InstallLibrary(libwpi.a, ${DESTDIR}/lib) #ifdef AMS_ENV ! ProgramTarget(wpi,wpi.o,${LIBS},$(SYS_LIBS)) InstallProgram(wpi, ${DESTDIR}/bin/) InstallHardLink(${DESTDIR}/bin/wpi,${DESTDIR}/bin/forward) #endif AMS_ENV ! ProgramTarget(wpiupdat,wpiupdat.o,${LIBS},$(SYS_LIBS)) InstallProgram(wpiupdat, ${DESTDIR}/etc/) ! ProgramTarget(wpq,wpq.o,${LIBS},$(SYS_LIBS)) InstallProgram(wpq, ${DESTDIR}/bin/) DependTarget() *** overhead/wpi/wpi.c Fri Dec 21 15:03:54 1990 --- overhead/wpi/wpi.c.NEW Wed Apr 3 21:30:21 1991 *************** *** 496,502 **** } selfdomain = WPI_GetWorkingDomain(); } ! entry = WPI_Lookup(username, false); } if (just_print) { --- 496,505 ---- } selfdomain = WPI_GetWorkingDomain(); } ! if (!(entry = WPI_Lookup(username, false))) { ! fprintf(stderr, "WPI library error: %s\n",WPI_error_msg); ! exit(WPI_error_code); ! } } if (just_print) { *** overhead/pobbconf/AMS-Server.pobb Wed Nov 22 14:35:30 1989 --- overhead/pobbconf/AMS-Server.pobb.NEW Tue Apr 9 19:18:35 1991 *************** *** 54,58 **** --- 54,59 ---- AMS_ViceQueueLifetime: ?[AMS_ViceQueueLifetime] AMS_ExtraViceQueueLifetime: ?[AMS_ExtraViceQueueLifetime] AMS_ViceQueueLifetimeCap: ?[AMS_ViceQueueLifetimeCap] + AMS_CrossCellQueueLifetime: ?[AMS_CrossCellQueueLifetime] PostmasterAddress: ?[PostmasterTitle]@?[WorkstationCell] *** overhead/pobbconf/BBD.pobb Mon Aug 6 11:17:24 1990 --- overhead/pobbconf/BBD.pobb.NEW Sun May 5 18:59:55 1991 *************** *** 17,23 **** %ifdef pobb_AutoPost set CUIPROG=?[BigLocalDir]/cuin if ( ! -x $${CUIPROG} ) then ! if ( $${??ANDREWDIR} != 0 ) set CUIPROG=$${ANDREWDIR}/bin/cuin endif if ( ! -x $${CUIPROG} ) then set CUIPROG=?[POBBAndrewDir]/bin/cuin --- 17,25 ---- %ifdef pobb_AutoPost set CUIPROG=?[BigLocalDir]/cuin if ( ! -x $${CUIPROG} ) then ! if ( $${??ANDREWDIR} != 0 ) then ! set CUIPROG=$${ANDREWDIR}/bin/cuin ! endif endif if ( ! -x $${CUIPROG} ) then set CUIPROG=?[POBBAndrewDir]/bin/cuin *************** *** 24,29 **** --- 26,43 ---- endif if ( ! -x $${CUIPROG} ) set CUIPROG=cuin %endif pobb_AutoPost + %ifdef pobbenv_AFS + set FSPROG=?[BigLocalDir]/fs + if ( ! -x $${FSPROG} ) then + if ( $${??ANDREWDIR} != 0 ) then + set FSPROG=$${ANDREWDIR}/bin/fs + endif + endif + if ( ! -x $${FSPROG} ) then + set FSPROG=?[POBBAndrewDir]/bin/fs + endif + if ( ! -x $${FSPROG} ) set FSPROG=fs + %endif pobbenv_AFS # # NOW PROCESS ARGUMENTS # *************** *** 690,696 **** case "bbquota": echo "\typewriter{ .">>& $$POST echo "Volume Name Quota Used % Used Partition " >>& $$POST ! fs listquota ?[arrlist(BBDMonitorVolumePaths, " \\\n\t\t\t")] \ |& sort -u | sort +3nr -5 +0r -1 >>& $$POST echo "}">>& $$POST breaksw --- 704,710 ---- case "bbquota": echo "\typewriter{ .">>& $$POST echo "Volume Name Quota Used % Used Partition " >>& $$POST ! $${FSPROG} listquota ?[arrlist(BBDMonitorVolumePaths, " \\\n\t\t\t")] \ |& sort -u | sort +3nr -5 +0r -1 >>& $$POST echo "}">>& $$POST breaksw *** overhead/pobbconf/config.monitor.pobb Wed Nov 22 14:38:28 1989 --- overhead/pobbconf/config.monitor.pobb.NEW Sun May 5 18:59:56 1991 *************** *** 11,17 **** %ifdef pobb_RunMachines ! setenv PATH=/bin:/etc rehash # Check to see that everything in this machine's configuration is running. # The startup scripts leave tag files in the config dir (?[BigLocalDir]/config). --- 11,17 ---- %ifdef pobb_RunMachines ! setenv PATH /bin:/usr/bin:/etc rehash # Check to see that everything in this machine's configuration is running. # The startup scripts leave tag files in the config dir (?[BigLocalDir]/config). *** overhead/pobbconf/pobb-install.pobb Wed Sep 26 16:12:26 1990 --- overhead/pobbconf/pobb-install.pobb.NEW Fri May 24 17:12:55 1991 *************** *** 642,647 **** --- 642,648 ---- $$INSTLxqt newaddr.msh ?[AFSCaptureProcess]/Addrs/newaddr.csh set STAT=$$status if ($$STAT != 0) exit($$STAT) + cp /dev/null ?[AFSCaptureProcess]/Addrs/Addrs %endif pobb_CaptureAddresses %ifdef pobb_WPUpdate *** overhead/pobbconf/pobb.shutdown.pobb Wed Nov 22 14:43:06 1989 --- overhead/pobbconf/pobb.shutdown.pobb.NEW Sun May 5 18:59:58 1991 *************** *** 10,16 **** %ifdef pobb_RunMachines ! setenv PATH=/bin:/etc rehash # Check to see that everything in this machine's configuration is stopped, # so that we can reboot safely. --- 10,16 ---- %ifdef pobb_RunMachines ! setenv PATH /bin:/usr/bin:/etc rehash # Check to see that everything in this machine's configuration is stopped, # so that we can reboot safely. *** overhead/pobbconf/pobbscpt.c Mon Aug 6 11:17:38 1990 --- overhead/pobbconf/pobbscpt.c.NEW Tue Apr 9 19:18:38 1991 *************** *** 612,617 **** --- 612,618 ---- {"AMS_ViceQueueLifetime", &AMS_ViceQueueLifetime}, {"AMS_ExtraViceQueueLifetime", &AMS_ExtraViceQueueLifetime}, {"AMS_ViceQueueLifetimeCap", &AMS_ViceQueueLifetimeCap}, + {"AMS_CrossCellQueueLifetime", &AMS_CrossCellQueueLifetime}, {"AMS_PrinterNamesInSpoolDirectories", &AMS_PrinterNamesInSpoolDirectories}, {"AMS_PrinterNamesInPrintcap", &AMS_PrinterNamesInPrintcap}, {"AMS_OnAIX", &AMS_OnAIX}, *** overhead/pobbconf/queueBBD.pobb Mon Aug 6 11:17:41 1990 --- overhead/pobbconf/queueBBD.pobb.NEW Thu Apr 25 16:23:23 1991 *************** *** 78,84 **** endif %endif pobb_AutoPost endif ! if ( "$${XXX}" != "" ) then set OurArgs=`echo $${XXX}` else set OurArgs=`echo $$argv` --- 78,84 ---- endif %endif pobb_AutoPost endif ! if ( "$${XXX}" != "XXX" ) then set OurArgs=`echo $${XXX}` else set OurArgs=`echo $$argv` *** helpindex/Imakefile Mon Aug 6 11:17:49 1990 --- helpindex/Imakefile.NEW Thu Jun 6 13:31:03 1991 *************** *** 3,14 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ - MkdirTarget($(DESTDIR)/help) - - /* Everywhere: put help.aliases in ${DESTDIR}/help */ - - InstallFile(help.aliases, $(INSTLIBFLAGS), $(DESTDIR)/help) - /* Put site-specific help.overview and help.programs in ${DESTDIR}/lib */ #ifdef CMU_ENV --- 3,8 ---- END OF ANDREW PATCH 10