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>
123 # define syslog(...) syslog(__VA_ARGS__)
125 # define openlog(...) openlog(__VA_ARGS__)
127 # define openlog(...) /**/
130 # define closelog(...) closelog(__VA_ARGS__)
132 # define closelog(...) /**/
135 # define syslog(...) /**/
136 # define openlog(...) /**/
137 # define closelog(...) /**/
146 #endif /* HAVE_LIBRRD */
148 /* Won't work without the header file */
155 #include <sys/param.h>
156 #endif /* HAVE_LIBKSTAT */
158 /* Won't work without the header file */
159 #ifndef HAVE_STATGRAB_H
160 #undef HAVE_LIBSTATGRAB
163 #ifdef HAVE_LIBSTATGRAB
164 #include <statgrab.h>
167 #define MODE_SERVER 0x01
168 #define MODE_CLIENT 0x02
169 #define MODE_LOCAL 0x03
171 extern time_t curtime;
172 extern int operating_mode;
174 #endif /* COLLECTD_H */