|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 1980 (0x7bc) Types: TextFile Names: »cleanup.c«
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89 └─⟦this⟧ »./DVIware/laser-setters/quicspool/src/cleanup.c« └─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦af5ba6c8e⟧ »unix3.0/DVIWARE.tar.Z« └─⟦ca79c7339⟧ └─⟦this⟧ »DVIware/laser-setters/quicspool/src/cleanup.c«
#ifndef lint static char *rcs = "$Header: cleanup.c,v 1.1 88/01/15 13:03:17 simpson Rel $"; #endif /* $Log: cleanup.c,v $ * Revision 1.1 88/01/15 13:03:17 simpson * initial release * * Revision 0.1 87/12/11 18:30:43 simpson * beta test * */ /* Cleanup and error routines */ #include <stdio.h> #include <local/profile.h> #include <local/qms.h> #include "constants.h" #include "fontnode.h" Boolean Accounting = FALSE; FILE *Accting; int NumPages = 0; char *User; char *Host; /* This routine is called on exit. It does some housekeeping before * exiting. */ void cleanup(head, exitstatus) struct FontNode *head; int exitstatus; { struct FontNode *p; void sanestate(); int portfont = 1204; PROFILE_VALUE *v, *getbindingvalue(); for (p = head; p; p = p->next) /* Delete user fonts */ if (p->qmsnumber > 30000 && (p->flags & LOADED)) printf("%s%d%c%s", DOWNLOAD, p->qmsnumber, p->flags & PORT ? 'P' : 'L', ENDCMD); if ((v = getbindingvalue("portraitfont")) && v->class == PROFILE_INTEGER) portfont = v->value.i; sanestate(portfont); fputs(QUICOFF, stdout); if (Accounting) { #ifdef TRW FILE *f; char badge[51], costcenter[51], chargenumber[51], sessionid[51]; char s[51], *strcpy(); if (!(f = fopen(ACCTFILE, "r"))) goto getout; while (fgets(s, 51, f)) if (strlen(s) > 0) { if (s[strlen(s) - 1] == '\n') s[strlen(s) - 1] = '\0'; switch (s[0]) { case 'b': (void)strcpy(badge, &s[1]); break; case 'e': (void)strcpy(costcenter, &s[1]); break; case 'u': (void)strcpy(chargenumber, &s[1]); break; case 's': (void)strcpy(sessionid, &s[1]); break; } } fprintf(Accting, "%s %s %s %s %d %s@%s\n", badge, costcenter, chargenumber, sessionid, NumPages, User, Host); (void)fclose(f); #else fprintf(Accting, "%d %s@%s\n", NumPages, User, Host); #endif (void)fclose(Accting); } getout: exit(exitstatus); }