Code

autoconf info page mentions that including config.h has to be done this way.
[collectd.git] / src / users.h
index f8b95445bcf6c118ab01b3f0f904057c00fd7abf..02f23dcdc27147cc58d6dd8866dbd6756dbde0a5 100644 (file)
@@ -1,34 +1,44 @@
-/* 
- * users.h
+/**
+ * collectd - src/users.h
+ * Copyright (C) 2005  Sebastian Harl
  *
- * users plugin for collectd
+ * This program 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 2 of the License, or (at your
+ * option) any later version.
  *
- * This plugin collects the number of users currently logged into the system.
+ * This program 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.
  *
- * Written by Sebastian Harl <sh@tokkee.org>
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
- * This program 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 2 of the License, or
- * (at your option) any later version.
- * 
- * This program 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
+ * Authors:
+ *   Sebastian Harl <sh at tokkee.org>
+ **/
 
 #ifndef USERS_H
 #define USERS_H 1
 
-#include "config.h"
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if !defined(HAVE_UTMPX_H) || !defined(HAVE_GETUTXENT)
+#undef HAVE_UTMPX_H
+#undef HAVE_GETUTXENT
+#endif
+
+#if !defined(HAVE_UTMP_H) || !defined(HAVE_GETUTENT)
+#undef HAVE_UTMPX_H
+#undef HAVE_GETUTXENT
+#endif
 
 #ifndef COLLECT_USERS
-#if defined(HAVE_UTMPX_H) && defined(HAVE_GETUTXENT)
+#if defined(HAVE_UTMPX_H) || defined(HAVE_UTMP_H)
 #define COLLECT_USERS 1
 #else
 #define COLLECT_USERS 0
@@ -40,7 +50,5 @@ void users_read(void);
 void users_submit(unsigned int);
 void users_write(char *, char *, char *);
 
-void module_register(void);
-
 #endif /* ! defined(USERS_H) */