2 * collectd - src/collectd.h
3 * Copyright (C) 2005 Florian octo Forster
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Florian octo Forster <octo at verplant.org>
32 # include <sys/types.h>
35 # include <sys/stat.h>
46 # if !STDC_HEADERS && HAVE_MEMORY_H
55 # include <inttypes.h>
64 # include <sys/wait.h>
67 # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
70 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
87 #if TIME_WITH_SYS_TIME
88 # include <sys/time.h>
92 # include <sys/time.h>
100 # define NAMLEN(dirent) strlen((dirent)->d_name)
102 # define dirent direct
103 # define NAMLEN(dirent) (dirent)->d_namlen
105 # include <sys/ndir.h>
108 # include <sys/dir.h>
122 # include <sys/param.h>
126 # define syslog(...) syslog(__VA_ARGS__)
128 # define openlog(...) openlog(__VA_ARGS__)
130 # define openlog(...) /**/
133 # define closelog(...) closelog(__VA_ARGS__)
135 # define closelog(...) /**/
138 # define syslog(...) /**/
139 # define openlog(...) /**/
140 # define closelog(...) /**/
154 # include <statgrab.h>
156 #if HAVE_SENSORS_SENSORS_H
157 # include <sensors/sensors.h>
161 #define PACKAGE_NAME "collectd"
165 #define PREFIX "/opt/" PACKAGE_NAME
169 #define SYSCONFDIR PREFIX "/etc"
173 #define CONFIGFILE SYSCONFDIR"/collectd.conf"
176 #ifndef PKGLOCALSTATEDIR
177 #define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
181 #define PIDFILE PREFIX "/var/run/" PACKAGE_NAME ".pid"
185 #define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
188 #define MODE_SERVER 0x01
189 #define MODE_CLIENT 0x02
190 #define MODE_LOCAL 0x03
192 extern time_t curtime;
193 extern int operating_mode;
195 /* int main (int argc, char **argv); */
197 #endif /* COLLECTD_H */