c99(1): Staticize.
[dragonfly.git] / contrib / top / top.h
blob876024269eca875d3a48134bb159a2014db1a55e
1 /*
2 * Copyright (c) 1984 through 2008, William LeFebvre
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
14 * distribution.
16 * * Neither the name of William LeFebvre nor the names of other
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * Top - a top users display for Berkeley Unix
36 * General (global) definitions
39 #ifndef _TOP_H_
40 #define _TOP_H_
42 #include <sys/time.h>
44 /* Maximum number of columns allowed for display */
45 #define MAX_COLS 512
47 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
48 #define LOG1024 10
50 /* Special atoi routine returns either a non-negative number or one of: */
51 #define Infinity -1
52 #define Invalid -2
54 /* maximum number we can have */
55 #define Largest 0x7fffffff
58 * The entire display is based on these next numbers being defined as is.
61 #define NUM_AVERAGES 3
63 struct ext_decl {
64 int (*f_minibar)(char *, int);
65 int (*f_display)(char *, int);
69 * "Table_size" defines the size of the hash tables used to map uid to
70 * username. Things will work best if the number is a prime number.
71 * We use a number that should be suitable for most installations.
73 #ifndef Table_size
74 #define Table_size 8191
75 #endif
77 void gettime(struct timeval *);
78 void quit(int);
80 int n_cpus;
81 int enable_ncpus;
83 #endif /* _TOP_H_ */