=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/top.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/top/top.c 1997/08/14 14:00:26 1.1 --- src/usr.bin/top/top.c 1997/08/22 07:16:30 1.2 *************** *** 1,7 **** ! /* $OpenBSD: top.c,v 1.1 1997/08/14 14:00:26 downsj Exp $ */ ! char *copyright = ! "Copyright (c) 1984 through 1996, William LeFebvre"; /* * Top users/processes display for Unix --- 1,6 ---- ! /* $OpenBSD: top.c,v 1.2 1997/08/22 07:16:30 downsj Exp $ */ ! const char copyright[] = "Copyright (c) 1984 through 1996, William LeFebvre"; /* * Top users/processes display for Unix *************** *** 31,40 **** * FD_SET - macros FD_SET and FD_ZERO are used when defined */ ! #include "os.h" #include #include ! #include #include /* includes specific to top */ --- 30,43 ---- * FD_SET - macros FD_SET and FD_ZERO are used when defined */ ! #include ! #include ! #include #include #include ! #include ! #include ! #include #include /* includes specific to top */ *************** *** 55,80 **** /* build Signal masks */ #define Smask(s) (1 << ((s) - 1)) - /* for system errors */ - extern int errno; - - /* for getopt: */ - extern int optind; - extern char *optarg; - /* imported from screen.c */ extern int overstrike; /* signal handling routines */ ! sigret_t leave(); ! sigret_t onalrm(); ! sigret_t tstop(); #ifdef SIGWINCH ! sigret_t winch(); #endif ! /* internal routines */ ! void quit(); /* values which need to be accessed by signal handlers */ static int max_topn; /* maximum displayable processes */ --- 58,75 ---- /* build Signal masks */ #define Smask(s) (1 << ((s) - 1)) /* imported from screen.c */ extern int overstrike; /* signal handling routines */ ! static void leave __P((int)); ! static void onalrm __P((int)); ! static void tstop __P((int)); #ifdef SIGWINCH ! static void winch __P((int)); #endif ! static void reset_display __P((void)); /* values which need to be accessed by signal handlers */ static int max_topn; /* maximum displayable processes */ *************** *** 85,95 **** /* routines that don't return int */ - char *username(); - char *ctime(); - char *kill_procs(); - char *renice_procs(); - #ifdef ORDER extern int (*proc_compares[])(); #else --- 80,85 ---- *************** *** 99,136 **** caddr_t get_process_info(); - /* different routines for displaying the user's identification */ - /* (values assigned to get_userid) */ - char *username(); - char *itoa7(); - - /* display routines that need to be predeclared */ - int i_loadave(); - int u_loadave(); - int i_procstates(); - int u_procstates(); - int i_cpustates(); - int u_cpustates(); - int i_memory(); - int u_memory(); - int i_message(); - int u_message(); - int i_header(); - int u_header(); - int i_process(); - int u_process(); - /* pointers to display routines */ ! int (*d_loadave)() = i_loadave; ! int (*d_procstates)() = i_procstates; ! int (*d_cpustates)() = i_cpustates; ! int (*d_memory)() = i_memory; ! int (*d_message)() = i_message; ! int (*d_header)() = i_header; ! int (*d_process)() = i_process; ! main(argc, argv) int argc; char *argv[]; --- 89,105 ---- caddr_t get_process_info(); /* pointers to display routines */ ! void (*d_loadave)() = i_loadave; ! void (*d_procstates)() = i_procstates; ! void (*d_cpustates)() = i_cpustates; ! void (*d_memory)() = i_memory; ! void (*d_message)() = i_message; ! void (*d_header)() = i_header; ! void (*d_process)() = i_process; ! int main(argc, argv) int argc; char *argv[]; *************** *** 904,910 **** * screen will get redrawn. */ ! reset_display() { d_loadave = i_loadave; --- 873,879 ---- * screen will get redrawn. */ ! static void reset_display() { d_loadave = i_loadave; *************** *** 920,933 **** * signal handlers */ ! sigret_t leave() /* exit under normal conditions -- INT handler */ { end_screen(); exit(0); } ! sigret_t tstop(i) /* SIGTSTP handler */ int i; --- 889,904 ---- * signal handlers */ ! void leave(unused) /* exit under normal conditions -- INT handler */ + int unused; + { end_screen(); exit(0); } ! void tstop(i) /* SIGTSTP handler */ int i; *************** *** 960,966 **** } #ifdef SIGWINCH ! sigret_t winch(i) /* SIGWINCH handler */ int i; --- 931,937 ---- } #ifdef SIGWINCH ! void winch(i) /* SIGWINCH handler */ int i; *************** *** 989,995 **** /*NOTREACHED*/ } ! sigret_t onalrm() /* SIGALRM handler */ { /* this is only used in batch mode to break out of the pause() */ --- 960,968 ---- /*NOTREACHED*/ } ! void onalrm(unused) /* SIGALRM handler */ ! ! int unused; { /* this is only used in batch mode to break out of the pause() */