xref: /dragonfly/usr.bin/top/globalstate.h (revision dc4f0af1)
1*dc4f0af1Szrj /*
2*dc4f0af1Szrj  * Copyright (c) 1984 through 2008, William LeFebvre
3*dc4f0af1Szrj  * All rights reserved.
4*dc4f0af1Szrj  *
5*dc4f0af1Szrj  * Redistribution and use in source and binary forms, with or without
6*dc4f0af1Szrj  * modification, are permitted provided that the following conditions are met:
7*dc4f0af1Szrj  *
8*dc4f0af1Szrj  *     * Redistributions of source code must retain the above copyright
9*dc4f0af1Szrj  * notice, this list of conditions and the following disclaimer.
10*dc4f0af1Szrj  *
11*dc4f0af1Szrj  *     * Redistributions in binary form must reproduce the above
12*dc4f0af1Szrj  * copyright notice, this list of conditions and the following disclaimer
13*dc4f0af1Szrj  * in the documentation and/or other materials provided with the
14*dc4f0af1Szrj  * distribution.
15*dc4f0af1Szrj  *
16*dc4f0af1Szrj  *     * Neither the name of William LeFebvre nor the names of other
17*dc4f0af1Szrj  * contributors may be used to endorse or promote products derived from
18*dc4f0af1Szrj  * this software without specific prior written permission.
19*dc4f0af1Szrj  *
20*dc4f0af1Szrj  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21*dc4f0af1Szrj  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*dc4f0af1Szrj  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23*dc4f0af1Szrj  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24*dc4f0af1Szrj  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25*dc4f0af1Szrj  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26*dc4f0af1Szrj  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27*dc4f0af1Szrj  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28*dc4f0af1Szrj  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29*dc4f0af1Szrj  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30*dc4f0af1Szrj  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*dc4f0af1Szrj  */
32*dc4f0af1Szrj 
33*dc4f0af1Szrj /*
34*dc4f0af1Szrj  * The global state of top is described in this structure.  It is passed
35*dc4f0af1Szrj  * to routines that may need to examine or alter it.
36*dc4f0af1Szrj  */
37*dc4f0af1Szrj 
38*dc4f0af1Szrj #ifndef _GLOBALSTATE_H_
39*dc4f0af1Szrj #define _GLOBALSTATE_H_
40*dc4f0af1Szrj 
41*dc4f0af1Szrj #include "machine.h"
42*dc4f0af1Szrj 
43*dc4f0af1Szrj typedef struct globalstate {
44*dc4f0af1Szrj     struct timeval now;
45*dc4f0af1Szrj     struct timeval refresh;
46*dc4f0af1Szrj     int fulldraw;
47*dc4f0af1Szrj     int topn;
48*dc4f0af1Szrj     int max_topn;
49*dc4f0af1Szrj     int delay;
50*dc4f0af1Szrj     int displays;
51*dc4f0af1Szrj     int order_index;
52*dc4f0af1Szrj     int show_cpustates;
53*dc4f0af1Szrj     int show_tags;
54*dc4f0af1Szrj     int show_usernames;
55*dc4f0af1Szrj     int use_color;
56*dc4f0af1Szrj     int smart_terminal;
57*dc4f0af1Szrj     int interactive;
58*dc4f0af1Szrj     char *header_text;
59*dc4f0af1Szrj     char *order_name;    /* only used before call to machine_init */
60*dc4f0af1Szrj     char *order_namelist;
61*dc4f0af1Szrj     char *(*get_userid)(int);
62*dc4f0af1Szrj     struct process_select pselect;
63*dc4f0af1Szrj     struct statics *statics;
64*dc4f0af1Szrj } globalstate;
65*dc4f0af1Szrj 
66*dc4f0af1Szrj #endif /* _GLOBALSTATE_H_ */
67