Added `_priv_module' pointer (type glibtop_backend_module). Made the

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

	* 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
	(glibtop_backend_entry): Made the `info' field const since it points
	to gmodule loaded memory.

	* lib/close.c (glibtop_close_r): Close all currently opened backends.
This commit is contained in:
Martin Baulig
2000-01-12 21:30:13 +00:00
committed by Martin Baulig
parent 12e32ffc24
commit 31067e703d
4 changed files with 51 additions and 5 deletions

View File

@@ -35,8 +35,8 @@ int
glibtop_open_backend_l (glibtop *server, const char *backend_name,
u_int64_t features, const char **backend_args)
{
const glibtop_backend_info *info;
glibtop_backend_entry *entry;
glibtop_backend_info *info;
glibtop_backend *backend;
entry = glibtop_backend_by_name (backend_name);
@@ -67,14 +67,15 @@ glibtop_open_backend_l (glibtop *server, const char *backend_name,
return -GLIBTOP_ERROR_NO_SUCH_BACKEND;
}
entry->_priv->refcount++;
}
entry->_priv->refcount++;
info = entry->info;
if (!info) return -GLIBTOP_ERROR_NO_SUCH_BACKEND;
backend = glibtop_calloc_r (server, 1, sizeof (glibtop_backend));
backend->_priv_module = entry->_priv;
backend->info = info;
if (info->open) {