summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2005-08-02 09:47:21 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2005-08-02 09:47:21 +0000
commit78cb7832c50f0cbb8225a201d46539198cf99a25 (patch)
tree907169723e04fa7a360739f8ca00c714e7104efd
parentb3979e69426cd74386ed9fc6e99f55a4ec353b88 (diff)
downloadlibgtop-78cb7832c50f0cbb8225a201d46539198cf99a25.tar.gz
Moved _glibtop_init_hook_[sp] declaration to private glibtop/init_hooks.h.
* configure.in: * include/glibtop/Makefile.am: * include/glibtop/glibtop-server.h: * include/glibtop/init_hooks.h: * include/glibtop/sysdeps.h: * lib/init.c: (glibtop_init_s): * lib/sysdeps.c: * sysdeps/aix/open.c: (glibtop_init_p): * sysdeps/common/sysdeps_suid.c: * sysdeps/freebsd/open.c: (glibtop_init_p): * sysdeps/osf1/open_suid.c: (glibtop_init_p): * sysdeps/solaris/open_suid.c: (glibtop_init_p): * sysdeps/stub_suid/open.c: (glibtop_init_p): Moved _glibtop_init_hook_[sp] declaration to private glibtop/init_hooks.h. Marked them const. Fixed GLIBTOP_SUID_NETLIST issues.
-rw-r--r--ChangeLog21
-rw-r--r--configure.in2
-rw-r--r--include/glibtop/Makefile.am2
-rw-r--r--include/glibtop/glibtop-server.h5
-rw-r--r--include/glibtop/init_hooks.h11
-rw-r--r--include/glibtop/sysdeps.h4
-rw-r--r--lib/init.c3
-rw-r--r--lib/sysdeps.c12
-rw-r--r--sysdeps/aix/open.c4
-rw-r--r--sysdeps/common/sysdeps_suid.c6
-rw-r--r--sysdeps/freebsd/open.c3
-rw-r--r--sysdeps/osf1/open_suid.c4
-rw-r--r--sysdeps/solaris/open_suid.c4
-rw-r--r--sysdeps/stub_suid/open.c3
14 files changed, 61 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a4925cc..e9668ff7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2005-08-02 Benoît Dejean <TazForEver@dlfp.org>
+
+ * configure.in:
+ * include/glibtop/Makefile.am:
+ * include/glibtop/glibtop-server.h:
+ * include/glibtop/init_hooks.h:
+ * include/glibtop/sysdeps.h:
+ * lib/init.c: (glibtop_init_s):
+ * lib/sysdeps.c:
+ * sysdeps/aix/open.c: (glibtop_init_p):
+ * sysdeps/common/sysdeps_suid.c:
+ * sysdeps/freebsd/open.c: (glibtop_init_p):
+ * sysdeps/osf1/open_suid.c: (glibtop_init_p):
+ * sysdeps/solaris/open_suid.c: (glibtop_init_p):
+ * sysdeps/stub_suid/open.c: (glibtop_init_p):
+
+ Moved _glibtop_init_hook_[sp] declaration to private
+ glibtop/init_hooks.h. Marked them const.
+
+ Fixed GLIBTOP_SUID_NETLIST issues.
+
2005-07-24 Benoît Dejean <TazForEver@dlfp.org>
* NEWS:
diff --git a/configure.in b/configure.in
index 95fe0ac6..23c04ae6 100644
--- a/configure.in
+++ b/configure.in
@@ -8,7 +8,7 @@ AC_CANONICAL_SYSTEM
LIBGTOP_MAJOR_VERSION=2
LIBGTOP_MINOR_VERSION=11
-LIBGTOP_MICRO_VERSION=90
+LIBGTOP_MICRO_VERSION=91
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_VERSION)
diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am
index 2940a2e9..4b1bdb1e 100644
--- a/include/glibtop/Makefile.am
+++ b/include/glibtop/Makefile.am
@@ -10,4 +10,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
netlist.h procopenfiles.h open.h
-noinst_HEADERS = error.h write.h read_data.h read.h
+noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h
diff --git a/include/glibtop/glibtop-server.h b/include/glibtop/glibtop-server.h
index 53730fa3..13878b39 100644
--- a/include/glibtop/glibtop-server.h
+++ b/include/glibtop/glibtop-server.h
@@ -36,11 +36,6 @@ typedef struct _glibtop_server_info glibtop_server_info;
typedef struct _glibtop_closure glibtop_closure;
-typedef int (*glibtop_init_func_t) (glibtop_server *, glibtop_closure *);
-
-extern glibtop_init_func_t _glibtop_init_hook_s [];
-extern glibtop_init_func_t _glibtop_init_hook_p [];
-
struct _glibtop_server_info
{
int ncpu; /* Number of CPUs, zero if single-processor */
diff --git a/include/glibtop/init_hooks.h b/include/glibtop/init_hooks.h
new file mode 100644
index 00000000..e26be6ec
--- /dev/null
+++ b/include/glibtop/init_hooks.h
@@ -0,0 +1,11 @@
+#ifndef H_LIBGTOP_INIT_HOOKS_1122955666
+#define H_LIBGTOP_INIT_HOOKS_1122955666
+
+#include <glibtop.h>
+
+typedef void (*glibtop_init_func_t)(glibtop *);
+
+extern const glibtop_init_func_t _glibtop_init_hook_s[];
+extern const glibtop_init_func_t _glibtop_init_hook_p[];
+
+#endif /* H_LIBGTOP_INIT_HOOKS_1122955666 */
diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h
index 545e796c..23d65c7f 100644
--- a/include/glibtop/sysdeps.h
+++ b/include/glibtop/sysdeps.h
@@ -58,10 +58,6 @@ G_BEGIN_DECLS
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
-typedef void (*glibtop_init_func_t) (glibtop *);
-extern glibtop_init_func_t _glibtop_init_hook_s [];
-extern glibtop_init_func_t _glibtop_init_hook_p [];
-
typedef struct _glibtop_sysdeps glibtop_sysdeps;
struct _glibtop_sysdeps
diff --git a/lib/init.c b/lib/init.c
index 898f4730..c544655e 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -26,6 +26,7 @@
#include <glibtop/sysdeps.h>
#include <glibtop/open.h>
#include <glibtop/parameter.h>
+#include <glibtop/init_hooks.h>
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 42800
@@ -219,7 +220,7 @@ glibtop *
glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags)
{
glibtop *server;
- glibtop_init_func_t *init_fkt;
+ const glibtop_init_func_t *init_fkt;
if (server_ptr == NULL)
return NULL;
diff --git a/lib/sysdeps.c b/lib/sysdeps.c
index 88f7a2fe..e0413632 100644
--- a/lib/sysdeps.c
+++ b/lib/sysdeps.c
@@ -22,6 +22,7 @@
#include <glibtop.h>
#include <glibtop/union.h>
#include <glibtop/sysdeps.h>
+#include <glibtop/init_hooks.h>
const unsigned long glibtop_server_features =
GLIBTOP_SUID_CPU +
@@ -43,9 +44,10 @@ GLIBTOP_SUID_PROC_SEGMENT +
GLIBTOP_SUID_PROC_ARGS +
GLIBTOP_SUID_PROC_MAP +
GLIBTOP_SUID_NETLOAD +
+GLIBTOP_SUID_NETLIST +
GLIBTOP_SUID_PPP;
-glibtop_init_func_t _glibtop_init_hook_s [] = {
+const glibtop_init_func_t _glibtop_init_hook_s [] = {
#if !GLIBTOP_SUID_CPU
glibtop_init_cpu_s,
#endif
@@ -103,13 +105,16 @@ glibtop_init_func_t _glibtop_init_hook_s [] = {
#if !GLIBTOP_SUID_NETLOAD
glibtop_init_netload_s,
#endif
+#if !GLIBTOP_SUID_NETLIST
+ glibtop_init_netlist_s,
+#endif
#if !GLIBTOP_SUID_PPP
glibtop_init_ppp_s,
#endif
NULL
};
-glibtop_init_func_t _glibtop_init_hook_p [] = {
+const glibtop_init_func_t _glibtop_init_hook_p [] = {
#if GLIBTOP_SUID_CPU
glibtop_init_cpu_p,
#endif
@@ -167,6 +172,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
#if GLIBTOP_SUID_NETLOAD
glibtop_init_netload_p,
#endif
+#if GLIBTOP_SUID_NETLIST
+ glibtop_init_netlist_p,
+#endif
#if GLIBTOP_SUID_PPP
glibtop_init_ppp_p,
#endif
diff --git a/sysdeps/aix/open.c b/sysdeps/aix/open.c
index 8a0757fa..5c4056ba 100644
--- a/sysdeps/aix/open.c
+++ b/sysdeps/aix/open.c
@@ -26,7 +26,7 @@
#include <glibtop.h>
#include <glibtop/error.h>
#include <glibtop/open.h>
-
+#include <glibtop/init_hooks.h>
#include "glibtop_suid.h"
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
@@ -35,7 +35,7 @@ void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags)
{
- glibtop_init_func_t *init_fkt;
+ const glibtop_init_func_t *init_fkt;
if (server == NULL)
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c
index 97731d9f..5b52348c 100644
--- a/sysdeps/common/sysdeps_suid.c
+++ b/sysdeps/common/sysdeps_suid.c
@@ -25,8 +25,9 @@
#include <glibtop/open.h>
#include <glibtop/union.h>
#include <glibtop/sysdeps.h>
+#include <glibtop/init_hooks.h>
-glibtop_init_func_t _glibtop_init_hook_p [] = {
+const glibtop_init_func_t _glibtop_init_hook_p [] = {
#if GLIBTOP_SUID_CPU
glibtop_init_cpu_p,
#endif
@@ -84,6 +85,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
#if GLIBTOP_SUID_NETLOAD
glibtop_init_netload_p,
#endif
+#if GLIBTOP_SUID_NETLIST
+ glibtop_init_netlist_p,
+#endif
#if GLIBTOP_SUID_PPP
glibtop_init_ppp_p,
#endif
diff --git a/sysdeps/freebsd/open.c b/sysdeps/freebsd/open.c
index 8546ae2c..2d66f39e 100644
--- a/sysdeps/freebsd/open.c
+++ b/sysdeps/freebsd/open.c
@@ -23,6 +23,7 @@
#include <glibtop.h>
#include <glibtop/open.h>
+#include <glibtop/init_hooks.h>
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
@@ -30,7 +31,7 @@ void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags)
{
- glibtop_init_func_t *init_fkt;
+ const glibtop_init_func_t *init_fkt;
if (server == NULL)
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
diff --git a/sysdeps/osf1/open_suid.c b/sysdeps/osf1/open_suid.c
index 95f9d360..913169e3 100644
--- a/sysdeps/osf1/open_suid.c
+++ b/sysdeps/osf1/open_suid.c
@@ -23,7 +23,7 @@
#include <glibtop.h>
#include <glibtop/open.h>
-
+#include <glibtop/init_hooks.h>
#include <glibtop_suid.h>
#include <unistd.h>
@@ -35,7 +35,7 @@ void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags)
{
- glibtop_init_func_t *init_fkt;
+ const glibtop_init_func_t *init_fkt;
if (server == NULL)
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
diff --git a/sysdeps/solaris/open_suid.c b/sysdeps/solaris/open_suid.c
index 95d8ae95..6da260dd 100644
--- a/sysdeps/solaris/open_suid.c
+++ b/sysdeps/solaris/open_suid.c
@@ -23,7 +23,7 @@
#include <glibtop.h>
#include <glibtop/open.h>
-
+#include <glibtop/init_hooks.h>
#include <glibtop_suid.h>
#include <unistd.h>
@@ -35,7 +35,7 @@ void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags)
{
- glibtop_init_func_t *init_fkt;
+ const glibtop_init_func_t *init_fkt;
if (server == NULL)
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
diff --git a/sysdeps/stub_suid/open.c b/sysdeps/stub_suid/open.c
index b903acd9..d498f795 100644
--- a/sysdeps/stub_suid/open.c
+++ b/sysdeps/stub_suid/open.c
@@ -23,6 +23,7 @@
#include <glibtop.h>
#include <glibtop/open.h>
+#include <glibtop/init_hooks.h>
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
@@ -30,7 +31,7 @@ void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags)
{
- glibtop_init_func_t *init_fkt;
+ const glibtop_init_func_t *init_fkt;
if (server == NULL)
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");