## GlibTop

GlibTop — Server initilization

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #include <glibtop.h>

    #define             GLIBTOP_MOUNTENTRY_LEN
    #define             LIBGTOP_CHECK_VERSION               (major, minor, micro)
                        glibtop;
    extern              glibtop *glibtop_global_server;
    glibtop *           glibtop_init                        (void);
    glibtop *           glibtop_init_r                      (glibtop **server_ptr,
                                                             unsigned long  features,
                                                             unsigned  flags);
    glibtop *           glibtop_init_s                      (glibtop **server_ptr,
                                                             unsigned long  features,
                                                             unsigned  flags);
    extern              const unsigned long glibtop_server_features;

## Description

You do not need to worry about the glibtop * server structure if you don't need - the library exports a glibtop_global_server which you can use everywhere a glibtop * is expected.

Most of the library and all of the sysdeps function also have an alias (which is the function name without the <suffix>_l</suffix>, <suffix>_s</suffix> or <suffix>_r</suffix> suffix) which don't take a glibtop * as argument but uses the glibtop_global_server instead.

## Details

### GLIBTOP_MOUNTENTRY_LEN

    #define GLIBTOP_MOUNTENTRY_LEN 79

### LIBGTOP_CHECK_VERSION()

    #define             LIBGTOP_CHECK_VERSION(major, minor, micro)

`major` : |
`minor` : |
`micro` : |

### glibtop

    typedef struct {
    	unsigned flags;
    	unsigned method;		/* Server Method */
    	unsigned error_method;		/* Error Method */
    	glibtop_machine machine; /* Machine dependent data */
    	int input [2];			/* Pipe client <- server */
    	int output [2];			/* Pipe client -> server */
    	int socket;			/* Accepted connection of a socket */
    	int ncpu;			/* Number of CPUs, zero if single-processor */
    	int real_ncpu;			/* Real number of CPUs. Only ncpu are monitored */
    	unsigned long os_version_code; /* Version code of the operating system */
    	const char *name;		/* Program name for error messages */
    	const char *server_command; /* Command used to invoke server */
    	const char *server_host; /* Host the server should run on */
    	const char *server_user; /* Name of the user on the target host */
    	const char *server_rsh;		/* Command used to connect to the target host */
    	unsigned long features;		/* Server is required for this features */
    	unsigned long server_port; /* Port on which daemon is listening */
    	glibtop_sysdeps sysdeps; /* Detailed feature list */
    	glibtop_sysdeps required; /* Required feature list */
    	pid_t pid;			/* PID of the server */
    } glibtop;

### glibtop_global_server

    extern glibtop *glibtop_global_server;

### glibtop_init ()

    glibtop *           glibtop_init                        (void);

Server initialization.

Returns : | A glibtop reference.

### glibtop_init_r ()

    glibtop *           glibtop_init_r                      (glibtop **server_ptr,
                                                             unsigned long  features,
                                                             unsigned  flags);

`server_ptr` : |
`features` : |
`flags` : |
Returns : |

### glibtop_init_s ()

    glibtop *           glibtop_init_s                      (glibtop **server_ptr,
                                                             unsigned long  features,
                                                             unsigned  flags);

`server_ptr` : |
`features` : |
`flags` : |
Returns : |

### glibtop_server_features

    extern const unsigned long glibtop_server_features;