1 | /* $Id: glibtop.h,v 1.1.1.1 2003-01-02 04:56:04 ghudson Exp $ */ |
---|
2 | |
---|
3 | /* Copyright (C) 1998-99 Martin Baulig |
---|
4 | This file is part of LibGTop 1.0. |
---|
5 | |
---|
6 | Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. |
---|
7 | |
---|
8 | LibGTop is free software; you can redistribute it and/or modify it |
---|
9 | under the terms of the GNU General Public License as published by |
---|
10 | the Free Software Foundation; either version 2 of the License, |
---|
11 | or (at your option) any later version. |
---|
12 | |
---|
13 | LibGTop is distributed in the hope that it will be useful, but WITHOUT |
---|
14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
16 | for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with LibGTop; see the file COPYING. If not, write to the |
---|
20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
21 | Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef __GLIBTOP_H__ |
---|
25 | #define __GLIBTOP_H__ |
---|
26 | |
---|
27 | #include <glibtop/global.h> |
---|
28 | |
---|
29 | #include <glibtop_server.h> |
---|
30 | #include <glibtop/types.h> |
---|
31 | |
---|
32 | #ifdef HAVE_GLIBTOP_MACHINE_H |
---|
33 | #include <glibtop_machine.h> |
---|
34 | #endif |
---|
35 | |
---|
36 | #ifndef GLIBTOP_MOUNTENTRY_LEN |
---|
37 | #define GLIBTOP_MOUNTENTRY_LEN 79 |
---|
38 | #endif |
---|
39 | |
---|
40 | typedef struct _glibtop glibtop; |
---|
41 | |
---|
42 | #include <glibtop/sysdeps.h> |
---|
43 | |
---|
44 | struct _glibtop |
---|
45 | { |
---|
46 | unsigned flags; |
---|
47 | unsigned method; /* Server Method */ |
---|
48 | unsigned error_method; /* Error Method */ |
---|
49 | #ifdef HAVE_GLIBTOP_MACHINE_H |
---|
50 | glibtop_machine machine; /* Machine dependent data */ |
---|
51 | #endif |
---|
52 | int input [2]; /* Pipe client <- server */ |
---|
53 | int output [2]; /* Pipe client -> server */ |
---|
54 | int socket; /* Accepted connection of a socket */ |
---|
55 | int ncpu; /* Number of CPUs, zero if single-processor */ |
---|
56 | unsigned long os_version_code; /* Version code of the operating system */ |
---|
57 | const char *name; /* Program name for error messages */ |
---|
58 | const char *server_command; /* Command used to invoke server */ |
---|
59 | const char *server_host; /* Host the server should run on */ |
---|
60 | const char *server_user; /* Name of the user on the target host */ |
---|
61 | const char *server_rsh; /* Command used to connect to the target host */ |
---|
62 | unsigned long features; /* Server is required for this features */ |
---|
63 | unsigned long server_port; /* Port on which daemon is listening */ |
---|
64 | glibtop_sysdeps sysdeps; /* Detailed feature list */ |
---|
65 | glibtop_sysdeps required; /* Required feature list */ |
---|
66 | pid_t pid; /* PID of the server */ |
---|
67 | }; |
---|
68 | |
---|
69 | extern glibtop *glibtop_global_server; |
---|
70 | |
---|
71 | extern const unsigned long glibtop_server_features; |
---|
72 | |
---|
73 | #define glibtop_init() glibtop_init_r(&glibtop_global_server, 0, 0); |
---|
74 | |
---|
75 | #define glibtop_close() glibtop_close_r(glibtop_global_server); |
---|
76 | |
---|
77 | glibtop * |
---|
78 | glibtop_init_r (glibtop **server_ptr, |
---|
79 | unsigned long features, |
---|
80 | unsigned flags); |
---|
81 | |
---|
82 | glibtop * |
---|
83 | glibtop_init_s (glibtop **server_ptr, |
---|
84 | unsigned long features, |
---|
85 | unsigned flags); |
---|
86 | |
---|
87 | #ifdef GLIBTOP_GUILE |
---|
88 | |
---|
89 | /* You need to link with -lgtop_guile to get this stuff here. */ |
---|
90 | |
---|
91 | void glibtop_boot_guile (void); |
---|
92 | |
---|
93 | #endif |
---|
94 | |
---|
95 | #ifdef GLIBTOP_GUILE_NAMES |
---|
96 | |
---|
97 | /* You need to link with -lgtop_guile_names to get this stuff here. */ |
---|
98 | |
---|
99 | void glibtop_boot_guile_names (void); |
---|
100 | |
---|
101 | #ifndef GLIBTOP_NAMES |
---|
102 | #define GLIBTOP_NAMES |
---|
103 | #endif |
---|
104 | |
---|
105 | #endif |
---|
106 | |
---|
107 | #endif |
---|