b5eefc64cec9557047572e14cf86c2c07717123a
[dragonfly.git] / contrib / top / utils.h
1 /*
2  *  Top users/processes display for Unix
3  *  Version 3
4  *
5  *  This program may be freely redistributed,
6  *  but this entire comment MUST remain intact.
7  *
8  *  Copyright (c) 1984, 1989, William LeFebvre, Rice University
9  *  Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
10  */
11
12 /* prototypes for functions found in utils.c */
13
14 int atoiwi(const char *);
15 char *ltoa(long);
16 char *ltoa7(long);
17 int digits(long);
18 char *strecpy(char *, const char *);
19 char **argparse(char *, int *);
20 long percentages(int cnt, int *out, long *new, long *old, long *diffs);
21 const char *errmsg(int);
22 char *format_time(long);
23 char *format_k(long);
24 char *format_k2(long);
25 int string_index(char *string, const char **array);
26
27 struct proc;
28 struct process_select;
29 struct system_info;
30 #ifdef ORDER
31 extern int (*proc_compares[])(const void *, const void *);
32 extern int compare_cpu(const void *, const void *);
33 #else
34 extern int proc_compare(const void *, const void *);
35 #endif
36 int proc_owner(int pid);
37 caddr_t get_process_info(struct system_info *si, struct process_select *sel,
38                          int (*compare)(const void *, const void *));
39 void get_system_info(struct system_info *si);
40 void quit(int);