|
|
| version 1.2, 2003/06/17 04:29:57 | version 1.3, 2004/03/22 22:32:51 |
|---|---|
| Line 34 | Line 34 |
| * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. | * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. |
| * @(#)pac.c 8.1 (Berkeley) 6/6/93 | * @(#)pac.c 8.1 (Berkeley) 6/6/93 |
| * $FreeBSD: src/usr.sbin/lpr/pac/pac.c,v 1.10.2.4 2002/04/26 18:17:52 gad Exp $ | * $FreeBSD: src/usr.sbin/lpr/pac/pac.c,v 1.10.2.4 2002/04/26 18:17:52 gad Exp $ |
| * $DragonFly: src/usr.sbin/lpr/pac/pac.c,v 1.1 2003/06/16 07:25:42 dillon Exp $ | * $DragonFly$ |
| */ | */ |
| /* | /* |
| Line 206 account(FILE *acctf) | Line 206 account(FILE *acctf) |
| { | { |
| char linebuf[BUFSIZ]; | char linebuf[BUFSIZ]; |
| double t; | double t; |
| register char *cp, *cp2; | char *cp, *cp2; |
| register struct hent *hp; | struct hent *hp; |
| register int ic; | int ic; |
| while (fgets(linebuf, BUFSIZ, acctf) != NULL) { | while (fgets(linebuf, BUFSIZ, acctf) != NULL) { |
| cp = linebuf; | cp = linebuf; |
| Line 247 static void | Line 247 static void |
| dumpit(void) | dumpit(void) |
| { | { |
| struct hent **base; | struct hent **base; |
| register struct hent *hp, **ap; | struct hent *hp, **ap; |
| register int hno, runs; | int hno, runs; |
| size_t c; | size_t c; |
| float feet; | float feet; |
| Line 285 dumpit(void) | Line 285 dumpit(void) |
| static void | static void |
| rewrite(void) | rewrite(void) |
| { | { |
| register struct hent *hp; | struct hent *hp; |
| register int i; | int i; |
| FILE *acctf; | FILE *acctf; |
| if ((acctf = fopen(sumfile, "w")) == NULL) { | if ((acctf = fopen(sumfile, "w")) == NULL) { |
| Line 325 rewrite(void) | Line 325 rewrite(void) |
| static struct hent * | static struct hent * |
| enter(const char name[]) | enter(const char name[]) |
| { | { |
| register struct hent *hp; | struct hent *hp; |
| register int h; | int h; |
| if ((hp = lookup(name)) != NULL) | if ((hp = lookup(name)) != NULL) |
| return(hp); | return(hp); |
| Line 350 enter(const char name[]) | Line 350 enter(const char name[]) |
| static struct hent * | static struct hent * |
| lookup(const char name[]) | lookup(const char name[]) |
| { | { |
| register int h; | int h; |
| register struct hent *hp; | struct hent *hp; |
| h = hash(name); | h = hash(name); |
| for (hp = hashtab[h]; hp != NULL; hp = hp->h_link) | for (hp = hashtab[h]; hp != NULL; hp = hp->h_link) |
| Line 367 lookup(const char name[]) | Line 367 lookup(const char name[]) |
| static int | static int |
| hash(const char name[]) | hash(const char name[]) |
| { | { |
| register int h; | int h; |
| register const char *cp; | const char *cp; |
| for (cp = name, h = 0; *cp; h = (h << 2) + *cp++) | for (cp = name, h = 0; *cp; h = (h << 2) + *cp++) |
| ; | ; |
| Line 381 hash(const char name[]) | Line 381 hash(const char name[]) |
| static int | static int |
| any(int ch, const char str[]) | any(int ch, const char str[]) |
| { | { |
| register int c = ch; | int c = ch; |
| register const char *cp = str; | const char *cp = str; |
| while (*cp) | while (*cp) |
| if (*cp++ == c) | if (*cp++ == c) |
| Line 398 any(int ch, const char str[]) | Line 398 any(int ch, const char str[]) |
| static int | static int |
| qucmp(const void *a, const void *b) | qucmp(const void *a, const void *b) |
| { | { |
| register const struct hent *h1, *h2; | const struct hent *h1, *h2; |
| register int r; | int r; |
| h1 = *(const struct hent * const *)a; | h1 = *(const struct hent * const *)a; |
| h2 = *(const struct hent * const *)b; | h2 = *(const struct hent * const *)b; |