|
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_DAEMON_H__
|
|
Packit |
d37888 |
#define __GLIBTOP_DAEMON_H__
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#include <glibtop.h>
|
|
Packit |
d37888 |
#include <glibtop/gnuserv.h>
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#include <glibtop/open.h>
|
|
Packit |
d37888 |
#include <glibtop/union.h>
|
|
Packit |
d37888 |
#include <glibtop/version.h>
|
|
Packit |
d37888 |
#include <glibtop/command.h>
|
|
Packit |
d37888 |
#include <glibtop/parameter.h>
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#include <fcntl.h>
|
|
Packit |
d37888 |
#include <sys/wait.h>
|
|
Packit |
d37888 |
#include <sys/socket.h>
|
|
Packit |
d37888 |
#include <syslog.h>
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
G_BEGIN_DECLS
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
/* Some don't have LOG_PERROR */
|
|
Packit |
d37888 |
#ifndef LOG_PERROR
|
|
Packit |
d37888 |
#define LOG_PERROR 0
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#if defined(HAVE_GETDTABLESIZE)
|
|
Packit |
d37888 |
#define GET_MAX_FDS() getdtablesize()
|
|
Packit |
d37888 |
#else
|
|
Packit |
d37888 |
/* Fallthrough case - please add other #elif cases above
|
|
Packit |
d37888 |
for different OS's as necessary */
|
|
Packit |
d37888 |
#define GET_MAX_FDS() 256
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#define _offset_union(p) ((char *) &resp->u.p - (char *) resp)
|
|
Packit |
d37888 |
#define _offset_data(p) _offset_union (data.p)
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#define MSG_BUFSZ sizeof (struct _glibtop_ipc_message)
|
|
Packit |
d37888 |
#define MSG_MSGSZ (MSG_BUFSZ - sizeof (long))
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
void handle_parent_connection (int s);
|
|
Packit |
d37888 |
void handle_slave_connection (int input, int output);
|
|
Packit |
d37888 |
void handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
|
Packit |
d37888 |
const void *parameter);
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
void do_output (int s, glibtop_response *resp, off_t offset,
|
|
Packit |
d37888 |
size_t data_size, const void *data);
|
|
Packit |
d37888 |
int do_read (int s, void *ptr, size_t total_size);
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
void syslog_message (int priority, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
|
Packit |
d37888 |
void syslog_io_message (int priority, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
extern gboolean enable_debug;
|
|
Packit |
d37888 |
extern gboolean verbose_output;
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
G_END_DECLS
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#endif
|