2 * collectd - src/collectd.h
3 * Copyright (C) 2005,2006 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; only version 2 of the License is applicable.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * Florian octo Forster <octo at verplant.org>
31 # include <sys/types.h>
34 # include <sys/stat.h>
45 # if !STDC_HEADERS && HAVE_MEMORY_H
54 # include <inttypes.h>
63 # include <sys/wait.h>
66 # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
69 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
86 #if TIME_WITH_SYS_TIME
87 # include <sys/time.h>
91 # include <sys/time.h>
100 # define assert(...) /* nop */
104 * This weird macro cascade forces the glibc to define `NAN'. I don't know
105 * another way to solve this, so more intelligent solutions are welcome. -octo
108 # define DISABLE__USE_ISOC99 1
109 # define __USE_ISOC99 1
112 #ifdef DISABLE__USE_ISOC99
113 # undef DISABLE__USE_ISOC99
119 # define NAMLEN(dirent) strlen((dirent)->d_name)
121 # define dirent direct
122 # define NAMLEN(dirent) (dirent)->d_namlen
124 # include <sys/ndir.h>
127 # include <sys/dir.h>
141 # include <sys/param.h>
145 # define syslog(...) /**/
146 # define openlog(...) /**/
147 # define closelog(...) /**/
161 # include <statgrab.h>
163 #if HAVE_SENSORS_SENSORS_H
164 # include <sensors/sensors.h>
168 #define PACKAGE_NAME "collectd"
172 #define PREFIX "/opt/" PACKAGE_NAME
176 #define SYSCONFDIR PREFIX "/etc"
180 #define CONFIGFILE SYSCONFDIR"/collectd.conf"
183 #ifndef PKGLOCALSTATEDIR
184 #define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
188 #define PIDFILE PREFIX "/var/run/" PACKAGE_NAME ".pid"
192 #define LOGFILE PREFIX"/var/log/"PACKAGE_NAME"/"PACKAGE_NAME".log"
196 #define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
199 #define MODE_SERVER 0x01
200 #define MODE_CLIENT 0x02
201 #define MODE_LOCAL 0x04
202 #define MODE_LOG 0x08
204 #ifndef COLLECTD_GRP_NAME
205 # define COLLECTD_GRP_NAME "collectd"
208 #ifndef COLLECTD_STEP
209 # define COLLECTD_STEP "10"
212 #ifndef COLLECTD_HEARTBEAT
213 # define COLLECTD_HEARTBEAT "25"
216 #ifndef COLLECTD_ROWS
217 # define COLLECTD_ROWS "1200"
221 # define COLLECTD_XFF 0.1
224 #define STATIC_ARRAY_LEN(array) (sizeof (array) / sizeof ((array)[0]))
226 extern char hostname_g[];
227 extern int interval_g;
229 /* int main (int argc, char **argv); */
231 #endif /* COLLECTD_H */