=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/Attic/username.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/top/Attic/username.c 1997/08/14 14:00:27 1.1 --- src/usr.bin/top/Attic/username.c 1997/08/22 07:16:31 1.2 *************** *** 1,4 **** ! /* $OpenBSD: username.c,v 1.1 1997/08/14 14:00:27 downsj Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: username.c,v 1.2 1997/08/22 07:16:31 downsj Exp $ */ /* * Top users/processes display for Unix *************** *** 30,46 **** * This makes the table size independent of the passwd file size. */ #include #include #include "top.local.h" #include "utils.h" struct hash_el { ! int uid; char name[9]; }; #define is_empty_hash(x) (hash_table[x].name[0] == 0) /* simple minded hashing function */ --- 30,51 ---- * This makes the table size independent of the passwd file size. */ + #include #include + #include #include #include "top.local.h" #include "utils.h" struct hash_el { ! uid_t uid; char name[9]; }; + static int enter_user __P((uid_t, char *, int)); + static int get_user __P((uid_t)); + #define is_empty_hash(x) (hash_table[x].name[0] == 0) /* simple minded hashing function */ *************** *** 53,59 **** /* We depend on that for hash_table and YOUR compiler had BETTER do it! */ struct hash_el hash_table[Table_size]; ! init_hash() { /* --- 58,64 ---- /* We depend on that for hash_table and YOUR compiler had BETTER do it! */ struct hash_el hash_table[Table_size]; ! void init_hash() { /* *************** *** 65,71 **** char *username(uid) ! register int uid; { register int hashindex; --- 70,76 ---- char *username(uid) ! register uid_t uid; { register int hashindex; *************** *** 79,85 **** return(hash_table[hashindex].name); } ! int userid(username) char *username; --- 84,90 ---- return(hash_table[hashindex].name); } ! uid_t userid(username) char *username; *************** *** 102,110 **** return(pwd->pw_uid); } ! int enter_user(uid, name, wecare) ! register int uid; register char *name; int wecare; /* 1 = enter it always, 0 = nice to have */ --- 107,115 ---- return(pwd->pw_uid); } ! static int enter_user(uid, name, wecare) ! register uid_t uid; register char *name; int wecare; /* 1 = enter it always, 0 = nice to have */ *************** *** 138,146 **** * and cache any entries we pass over while looking. */ ! int get_user(uid) ! register int uid; { struct passwd *pwd; --- 143,151 ---- * and cache any entries we pass over while looking. */ ! static int get_user(uid) ! register uid_t uid; { struct passwd *pwd;