Blame glibtop.h

Packit d37888
/* Copyright (C) 1998-99 Martin Baulig
Packit d37888
   This file is part of LibGTop 1.0.
Packit d37888
Packit d37888
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
Packit d37888
Packit d37888
   LibGTop is free software; you can redistribute it and/or modify it
Packit d37888
   under the terms of the GNU General Public License as published by
Packit d37888
   the Free Software Foundation; either version 2 of the License,
Packit d37888
   or (at your option) any later version.
Packit d37888
Packit d37888
   LibGTop is distributed in the hope that it will be useful, but WITHOUT
Packit d37888
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit d37888
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit d37888
   for more details.
Packit d37888
Packit d37888
   You should have received a copy of the GNU General Public License
Packit d37888
   along with LibGTop; see the file COPYING. If not, write to the
Packit d37888
   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit d37888
   Boston, MA 02110-1301, USA.
Packit d37888
*/
Packit d37888
Packit d37888
#ifndef __GLIBTOP_H__
Packit d37888
#define __GLIBTOP_H__
Packit d37888
Packit d37888
/* for pid_t, uid_t, gid_t */
Packit d37888
#include <sys/types.h>
Packit d37888
Packit d37888
Packit d37888
#include <glib.h>
Packit d37888
#include <glib-object.h>
Packit d37888
Packit d37888
G_BEGIN_DECLS
Packit d37888
Packit d37888
typedef struct _glibtop		glibtop;
Packit d37888
typedef struct _glibtop_machine	glibtop_machine;
Packit d37888
Packit d37888
/**
Packit d37888
 *  LIBGTOP_CHECK_VERSION
Packit d37888
 *  @major: Major version number
Packit d37888
 *  @minor: Minor version number
Packit d37888
 *  @micro: Micro version number
Packit d37888
 *
Packit d37888
 *  Checks if the version given is compatable with this version of the
Packit d37888
 *  library.  For example, LIBGTOP_CHECK_VERSION(1.2.3) would return TRUE
Packit d37888
 *  if the version is 1.2.5, and FALSE if 1.1.0.  This can be used in
Packit d37888
 *  build tests.
Packit d37888
 *
Packit d37888
 **/
Packit d37888
Packit d37888
#include <libgtopconfig.h>
Packit d37888
Packit d37888
#define LIBGTOP_CHECK_VERSION(major, minor, micro)    \
Packit d37888
(LIBGTOP_MAJOR_VERSION > (major) || \
Packit d37888
(LIBGTOP_MAJOR_VERSION == (major) && LIBGTOP_MINOR_VERSION > (minor)) || \
Packit d37888
(LIBGTOP_MAJOR_VERSION == (major) && LIBGTOP_MINOR_VERSION == (minor) && \
Packit d37888
LIBGTOP_MICRO_VERSION >= (micro)))
Packit d37888
Packit d37888
Packit d37888
#include <glibtop/global.h>
Packit d37888
Packit d37888
#include <glibtop_server.h>
Packit d37888
Packit d37888
#ifndef GLIBTOP_MOUNTENTRY_LEN
Packit d37888
#define GLIBTOP_MOUNTENTRY_LEN	79
Packit d37888
#endif
Packit d37888
Packit d37888
Packit d37888
#include <glibtop/sysdeps.h>
Packit d37888
Packit d37888
#include <glibtop/close.h>
Packit d37888
Packit d37888
Packit d37888
struct _glibtop
Packit d37888
{
Packit d37888
	unsigned flags;
Packit d37888
	unsigned method;		/* Server Method */
Packit d37888
	unsigned error_method;		/* Error Method */
Packit d37888
	int input [2];			/* Pipe client <- server */
Packit d37888
	int output [2];			/* Pipe client -> server */
Packit d37888
	int socket;			/* Accepted connection of a socket */
Packit d37888
	int ncpu;			/* Number of CPUs, zero if single-processor */
Packit d37888
	int real_ncpu;			/* Real number of CPUs. Only ncpu are monitored */
Packit d37888
	unsigned long os_version_code;	/* Version code of the operating system */
Packit d37888
	const char *name;		/* Program name for error messages */
Packit d37888
	const char *server_command;	/* Command used to invoke server */
Packit d37888
	const char *server_host;	/* Host the server should run on */
Packit d37888
	const char *server_user;	/* Name of the user on the target host */
Packit d37888
	const char *server_rsh;		/* Command used to connect to the target host */
Packit d37888
	unsigned long features;		/* Server is required for this features */
Packit d37888
	unsigned long server_port;	/* Port on which daemon is listening */
Packit d37888
	glibtop_sysdeps sysdeps;	/* Detailed feature list */
Packit d37888
	glibtop_sysdeps required;	/* Required feature list */
Packit d37888
	pid_t pid;			/* PID of the server */
Packit d37888
Packit d37888
	uid_t uid;
Packit d37888
	uid_t euid;
Packit d37888
	gid_t gid;
Packit d37888
	gid_t egid;
Packit d37888
Packit d37888
	glibtop_machine *machine;	/* Machine dependent data */
Packit d37888
};
Packit d37888
Packit d37888
extern glibtop *glibtop_global_server;
Packit d37888
Packit d37888
extern const unsigned long glibtop_server_features;
Packit d37888
Packit d37888
/**
Packit d37888
 * glibtop_init:
Packit d37888
 *
Packit d37888
 * Returns: (transfer none):
Packit d37888
 */
Packit d37888
glibtop *
Packit d37888
glibtop_init (void);
Packit d37888
Packit d37888
Packit d37888
/**
Packit d37888
 * glibtop_init_r:
Packit d37888
 * @server_ptr: (out):
Packit d37888
 * @features:
Packit d37888
 * @flags:
Packit d37888
 *
Packit d37888
 * Returns: (transfer none):
Packit d37888
 */
Packit d37888
glibtop *
Packit d37888
glibtop_init_r (glibtop **server_ptr,
Packit d37888
		unsigned long features,
Packit d37888
		unsigned flags);
Packit d37888
Packit d37888
Packit d37888
/**
Packit d37888
 * glibtop_init_s:
Packit d37888
 * @server_ptr: (out):
Packit d37888
 * @features:
Packit d37888
 * @flags:
Packit d37888
 *
Packit d37888
 * Returns: (transfer none):
Packit d37888
 */
Packit d37888
glibtop *
Packit d37888
glibtop_init_s (glibtop **server_ptr,
Packit d37888
		unsigned long features,
Packit d37888
		unsigned flags);
Packit d37888
Packit d37888
GType     glibtop_get_type (void) G_GNUC_CONST;
Packit d37888
Packit d37888
G_END_DECLS
Packit d37888
Packit d37888
#endif