1 /* Copyright (C) 1998-99 Martin Baulig
2    This file is part of LibGTop 1.0.
3 
4    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
5 
6    LibGTop is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License,
9    or (at your option) any later version.
10 
11    LibGTop is distributed in the hope that it will be useful, but WITHOUT
12    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14    for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with LibGTop; see the file COPYING. If not, write to the
18    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef __GLIBTOP_PROC_ARGS_H__
23 #define __GLIBTOP_PROC_ARGS_H__
24 
25 #include <glibtop.h>
26 #include <glibtop/global.h>
27 
28 G_BEGIN_DECLS
29 
30 #define GLIBTOP_PROC_ARGS_SIZE		0
31 
32 #define GLIBTOP_MAX_PROC_ARGS		1
33 
34 typedef struct _glibtop_proc_args	glibtop_proc_args;
35 
36 struct _glibtop_proc_args
37 {
38 	guint64	flags;
39 	guint64 size;			/* GLIBTOP_PROC_ARGS_SIZE	*/
40 };
41 
42 
43 char *
44 glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf,
45 			 pid_t pid, unsigned max_len);
46 
47 char *
48 glibtop_get_proc_args (glibtop_proc_args *buf, pid_t pid, unsigned max_len);
49 
50 #if GLIBTOP_SUID_PROC_ARGS
51 
52 # define glibtop_get_proc_args_r		glibtop_get_proc_args_p
53 
54   void _glibtop_init_proc_args_p (glibtop *server);
55 
56   char *
57   glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
58 			   pid_t pid, unsigned max_len);
59 
60 
61 #else /* !GLIBTOP_SUID_PROC_ARGS */
62 
63 # define glibtop_get_proc_args_r		glibtop_get_proc_args_s
64 
65   void _glibtop_init_proc_args_s (glibtop *server);
66 
67   char *
68   glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
69 			   pid_t pid, unsigned max_len);
70 #endif /* GLIBTOP_SUID_PROC_ARGS */
71 
72 
73 
74 /*
75  * NEW functions
76  */
77 
78 char **
79 glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf,
80 			 pid_t pid, unsigned max_len);
81 
82 /**
83  * glibtop_get_proc_argv:
84  * @buf:
85  * @pid:
86  * @max_len:
87  *
88  * Returns: (transfer full):
89  */
90 
91 char **
92 glibtop_get_proc_argv (glibtop_proc_args *buf, pid_t pid, unsigned max_len);
93 
94 
95 G_END_DECLS
96 
97 #endif
98