New type. (glibtop_backend_module): New private type.

2000-01-12  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/backend.h (glibtop_backend_entry): New type.
	(glibtop_backend_module): New private type.

	* lib/backend.c (glibtop_register_backend): This now takes a
	`glibtop_backend_entry' argument, not a `glibtop_backend_info' one.
	(glibtop_backend_by_id): Return a `glibtop_backend_entry' type,
	not a `glibtop_backend_info' one.
	(glibtop_backend_by_name): Likewise.

	* lib/init-backends.c: If we have libxml, read all `.backend' files
	in $(LIBGTOP_BACKEND_DIR), XML parse them and register them via
	`glibtop_backend_register'. This builds a list of all currently
	supported backends without actually loading them into memory.

	* lib/open-backend.c (glibtop_open_backend_l): GModule load the
	backend if it's not already in memory.
This commit is contained in:
Martin Baulig
2000-01-12 20:37:21 +00:00
committed by Martin Baulig
parent 8d532c6298
commit e2e5c3a1cc
6 changed files with 249 additions and 17 deletions

View File

@@ -34,6 +34,8 @@
BEGIN_LIBGTOP_DECLS
typedef struct _glibtop_backend_info glibtop_backend_info;
typedef struct _glibtop_backend_entry glibtop_backend_entry;
typedef struct _glibtop_backend_module glibtop_backend_module;
typedef struct _glibtop_backend_private glibtop_backend_private;
typedef struct _glibtop_backend glibtop_backend;
@@ -52,6 +54,29 @@ struct _glibtop_backend_info
glibtop_call_vector *call_vector;
};
#ifdef _IN_LIBGTOP
#include <gmodule.h>
/* private structure */
struct _glibtop_backend_module
{
int refcount;
GModule *module;
};
#endif /* _IN_LIBGTOP */
struct _glibtop_backend_entry
{
char *name;
char *libtool_name;
char *shlib_name;
glibtop_backend_info *info;
glibtop_backend_module *_priv;
};
struct _glibtop_backend
{
glibtop_backend_info *info;
@@ -59,15 +84,15 @@ struct _glibtop_backend
};
long
glibtop_register_backend (glibtop_backend_info *info);
glibtop_register_backend (glibtop_backend_entry *entry);
void
glibtop_unregister_backend (long id);
glibtop_backend_info *
glibtop_backend_entry *
glibtop_backend_by_id (long id);
glibtop_backend_info *
glibtop_backend_entry *
glibtop_backend_by_name (const char *backend_name);
void