Added `void *closure' argument.

2000-11-27  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/glibtop-backend-info.h
	(glibtop_backend_close_func_t): Added `void *closure' argument.

	* include/glibtop/call-vector.h: Changed the second argument
	of all function in the call vector from `glibtop_backend *' to
	`void *closure'.
This commit is contained in:
Martin Baulig
2000-11-26 23:29:15 +00:00
committed by Martin Baulig
parent 8a78a93e0c
commit 478be2d170
15 changed files with 74 additions and 57 deletions

View File

@@ -31,8 +31,6 @@
#include <glibtop.h>
#include <glibtop/union.h>
#include <glibtop/backend.h>
BEGIN_LIBGTOP_DECLS
struct _glibtop_call_vector

View File

@@ -82,16 +82,16 @@ sub parse_features_def {
if ($line_fields[3] eq '') {
$func_decl_code .= sprintf
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *%s);\n], $retval, $feature, $param_decl);
(qq[\t%s (*%s) (glibtop_server *, void *%s);\n], $retval, $feature, $param_decl);
} elsif ($line_fields[3] eq 'array') {
$func_decl_code .= sprintf
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *, glibtop_array *%s);\n], $retval, $feature, $param_decl);
(qq[\t%s (*%s) (glibtop_server *, void *, glibtop_array *%s);\n], $retval, $feature, $param_decl);
} elsif ($line_fields[3] =~ /^array/) {
$func_decl_code .= sprintf
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *, glibtop_array *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
(qq[\t%s (*%s) (glibtop_server *, void *, glibtop_array *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
} else {
$func_decl_code .= sprintf
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
(qq[\t%s (*%s) (glibtop_server *, void *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
}
}

View File

@@ -39,9 +39,10 @@ typedef struct _glibtop_backend_module glibtop_backend_module;
typedef struct _glibtop_call_vector glibtop_call_vector;
typedef int (*glibtop_backend_open_func_t) (glibtop_server *, glibtop_backend *,
u_int64_t, const char **);
typedef int (*glibtop_backend_close_func_t) (glibtop_server *, glibtop_backend *);
typedef int (*glibtop_backend_open_func_t) (glibtop_server *, glibtop_backend *,
u_int64_t, const char **);
typedef int (*glibtop_backend_close_func_t) (glibtop_server *, glibtop_backend *,
void *);
struct _glibtop_backend_info
{

View File

@@ -68,6 +68,12 @@ glibtop_backend *
glibtop_backend_get (const char *backend_name, u_int64_t features,
const char **backend_args, GError **error);
void
glibtop_backend_set_closure_data (glibtop_backend *backend, void *closure);
void *
glibtop_backend_get_closure_data (glibtop_backend *backend);
glibtop_call_vector *
glibtop_backend_get_call_vector (glibtop_backend *backend);