From 7ba17b2bee193a940e5f4a9edbadef486bddc167 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 12 Jan 2000 21:38:55 +0000 Subject: [PATCH] New error constant. 2000-01-12 Martin Baulig * include/glibtop/errors.h (GLIBTOP_ERROR_NO_BACKEND_OPENED): New error constant. * lib/lib.pl (glibtop_get__l): Don't dump core when there is no backend opened, but return GLIBTOP_ERROR_NO_BACKEND_OPENED. --- ChangeLog | 6 ++++++ include/glibtop/errors.h | 5 +++-- lib/lib.pl | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06a13369..6fe57704 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2000-01-12 Martin Baulig + * include/glibtop/errors.h (GLIBTOP_ERROR_NO_BACKEND_OPENED): + New error constant. + + * lib/lib.pl (glibtop_get__l): Don't dump core when there + is no backend opened, but return GLIBTOP_ERROR_NO_BACKEND_OPENED. + * include/glibtop/backend.h (glibtop_backend): Added `_priv_module' pointer (type glibtop_backend_module). Made the `info' field const since this now points to gmodule loaded memory diff --git a/include/glibtop/errors.h b/include/glibtop/errors.h index 7ee6c35d..56f5b9a7 100644 --- a/include/glibtop/errors.h +++ b/include/glibtop/errors.h @@ -46,10 +46,11 @@ BEGIN_LIBGTOP_DECLS #define GLIBTOP_ERROR_NO_SUCH_BACKEND 10 #define GLIBTOP_ERROR_NOT_IMPLEMENTED 11 +#define GLIBTOP_ERROR_NO_BACKEND_OPENED 12 -#define GLIBTOP_ERROR_DEMARSHAL_ERROR 12 +#define GLIBTOP_ERROR_DEMARSHAL_ERROR 13 -#define GLIBTOP_MAX_ERROR 13 +#define GLIBTOP_MAX_ERROR 14 char * glibtop_get_error_string_l (glibtop *server, unsigned error_number); diff --git a/lib/lib.pl b/lib/lib.pl index a5cd85a8..3af22a8e 100755 --- a/lib/lib.pl +++ b/lib/lib.pl @@ -158,6 +158,9 @@ sub output { } $sysdeps_code = sprintf + ("\tif (!server->_priv)\n\treturn -GLIBTOP_ERROR_NO_BACKEND_OPENED;\n\n"); + + $sysdeps_code .= sprintf ("\tfor (list = server->_priv->backend_list;\n\t list; list = list->next) {\n\t\tglibtop_backend *backend = list->data;\n\n\t\tif (!backend->info || !backend->info->call_vector)\n\t\t\tcontinue;\n\n\t\tif (backend->info->call_vector->%s) {\n", $feature); if ($line_fields[3] eq '') {