/usr/include/gkrellm2/gkrellmd.h is in gkrellmd 2.3.6~rc1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | /* GKrellM
| Copyright (C) 1999-2014 Bill Wilson
|
| Author: Bill Wilson billw@gkrellm.net
| Latest versions might be found at: http://gkrellm.net
|
|
| GKrellM is free software: you can redistribute it and/or modify it
| under the terms of the GNU General Public License as published by
| the Free Software Foundation, either version 3 of the License, or
| (at your option) any later version.
|
| GKrellM is distributed in the hope that it will be useful, but WITHOUT
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
| or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
| License for more details.
|
| You should have received a copy of the GNU General Public License
| along with this program. If not, see http://www.gnu.org/licenses/
|
|
| Additional permission under GNU GPL version 3 section 7
|
| If you modify this program, or any covered work, by linking or
| combining it with the OpenSSL project's OpenSSL library (or a
| modified version of that library), containing parts covered by
| the terms of the OpenSSL or SSLeay licenses, you are granted
| additional permission to convey the resulting work.
| Corresponding Source for a non-source form of such a combination
| shall include the source code for the parts of OpenSSL used as well
| as that of the covered work.
*/
#ifndef GKRELLMD_H
#define GKRELLMD_H
#include "log.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <time.h>
#if (defined(__sun) && defined(__SVR4)) || defined(SOLARIS_8)
#define __solaris__
#endif
#if !defined(WIN32)
#include <unistd.h>
#include <utime.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <pwd.h>
#include <grp.h>
#if defined(__solaris__)
#include <sys/filio.h>
#endif /* defined(__solaris__) */
#include <sys/select.h>
#include <sys/wait.h>
#else
#include <winsock2.h>
#include <ws2tcpip.h>
typedef int sa_family_t; // WIN32 uses int for ai_family;
#include <stdint.h> // defines uint32_t
#endif /* !defined(WIN32) */
#include <sys/stat.h>
#include <sys/types.h>
#include <locale.h>
#include <signal.h>
#include <errno.h>
#if !defined(PACKAGE_D)
#define PACKAGE_D "gkrellmd"
#endif
/* Internationalization support.
*/
#if defined (ENABLE_NLS)
#include <libintl.h>
# undef _
# define _(String) dgettext(PACKAGE_D,String)
# if defined(gettext_noop)
# define N_(String) gettext_noop(String)
# else
# define N_(String) (String)
# endif /* gettext_noop */
#else
# define _(String) (String)
# define N_(String) (String)
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,String) (String)
# define dcgettext(Domain,String,Type) (String)
# define bindtextdomain(Domain,Directory) (Domain)
#endif /* ENABLE_NLS */
/* -------------------------------------------------------------------
*/
#define GKRELLMD_VERSION_MAJOR 2
#define GKRELLMD_VERSION_MINOR 3
#define GKRELLMD_VERSION_REV 6
#define GKRELLMD_EXTRAVERSION "-RC1"
#define GKRELLMD_CHECK_VERSION(major,minor,rev) \
(GKRELLMD_VERSION_MAJOR > (major) || \
(GKRELLMD_VERSION_MAJOR == (major) && GKRELLMD_VERSION_MINOR > (minor)) || \
(GKRELLMD_VERSION_MAJOR == (major) && GKRELLMD_VERSION_MINOR == (minor) && \
GKRELLMD_VERSION_REV >= (rev)))
#define GKRELLMD_CONFIG "gkrellmd.conf"
#if defined(WIN32)
// no dot in front of config-filename on win32
#define GKRELLMD_USER_CONFIG GKRELLMD_CONFIG
#else
#define GKRELLMD_USER_CONFIG ".gkrellmd.conf"
#endif
#define GKRELLMD_PLUGINS_DIR ".gkrellm2/plugins-gkrellmd"
#if !defined(WIN32)
#define GKRELLMD_LOCAL_PLUGINS_DIR "/usr/local/lib/gkrellm2/plugins-gkrellmd"
#if !defined(GKRELLMD_SYSTEM_PLUGINS_DIR)
#define GKRELLMD_SYSTEM_PLUGINS_DIR "/usr/lib/gkrellm2/plugins-gkrellmd"
#endif
#define GKRELLMD_SYS_ETC "/etc"
#define GKRELLMD_LOCAL_ETC "/usr/local/etc"
#endif // !defined(WIN32)
typedef struct _GkrellmdClient
{
gint major_version,
minor_version,
rev_version;
gchar *hostname;
gint fd;
gboolean served,
alive,
last_client;
gboolean feature_subdisk;
GString *input_gstring;
void (*input_func)(struct _GkrellmdClient *, gchar *);
}
GkrellmdClient;
typedef struct
{
gint timer_ticks,
second_tick,
two_second_tick,
five_second_tick,
ten_second_tick,
minute_tick;
}
GkrellmdTicks;
extern GkrellmdTicks GK;
typedef struct
{
gboolean need_serve;
const gchar *serve_name;
gboolean serve_name_sent;
GString *serve_gstring;
GkrellmdClient *client;
GList *config_list;
gboolean is_plugin;
void *handle;
gchar *path;
void (*client_input_func)(GkrellmdClient *, gchar *);
}
GkrellmdMonitorPrivate;
typedef struct _GkrellmdMonitor
{
gchar *name;
void (*update_monitor)(struct _GkrellmdMonitor *mon,
gboolean first_update);
void (*serve_data)(struct _GkrellmdMonitor *mon,
gboolean first_serve);
void (*serve_setup)(struct _GkrellmdMonitor *mon);
GkrellmdMonitorPrivate
*privat;
}
GkrellmdMonitor;
/* gkrellmd serve data functions used by builtins and plugins.
*/
void gkrellmd_plugin_serve_setup(GkrellmdMonitor *mon,
gchar *name, gchar *line);
void gkrellmd_need_serve(GkrellmdMonitor *mon);
void gkrellmd_set_serve_name(GkrellmdMonitor *mon, const gchar *name);
void gkrellmd_serve_data(GkrellmdMonitor *mon, gchar *line);
void gkrellmd_add_serveflag_done(gboolean *);
gboolean gkrellmd_check_client_version(GkrellmdMonitor *mon,
gint major, gint minor, gint rev);
const gchar *gkrellmd_config_getline(GkrellmdMonitor *mon);
void gkrellmd_client_input_connect(GkrellmdMonitor *mon,
void (*func)(GkrellmdClient *, gchar *));
/* Small set of useful functions duplicated from src/utils.c.
| These really should just be in the gkrellm_ namespace for sysdep code
| common to gkrellm and gkrellmd, but for convenience, offer them in
| both gkrellm_ and gkrellmd_ namespaces.
*/
void gkrellmd_free_glist_and_data(GList **list_head);
gboolean gkrellmd_getline_from_gstring(GString **, gchar *, gint);
gchar *gkrellmd_dup_token(gchar **string, gchar *delimeters);
gboolean gkrellmd_dup_string(gchar **dst, gchar *src);
void gkrellm_free_glist_and_data(GList **list_head);
gboolean gkrellm_getline_from_gstring(GString **, gchar *, gint);
gchar *gkrellm_dup_token(gchar **string, gchar *delimeters);
gboolean gkrellm_dup_string(gchar **dst, gchar *src);
/* Plugins should use above data serve functions instead of this.
*/
gint gkrellmd_send_to_client(GkrellmdClient *client, gchar *buf);
/* Misc
*/
void gkrellmd_add_mailbox(gchar *);
GkrellmdTicks *gkrellmd_ticks(void);
gint gkrellmd_get_timer_ticks(void);
#endif // GKRELLMD_H
|