#include "compat.h"
#include "proto.h"
-#if !defined(HAVE_LOCALTIME_R) && !defined(__CYGWIN__)
-extern struct tm *localtime_r(const time_t *clock, struct tm *res);
-#elif defined(__CYGWIN__)
-# define localtime_r(clock, res) memcpy(res, localtime(clock), sizeof(struct tm));
-#endif
-
#ifndef true
#define true 1
#endif
#define false 0
#endif
-#define ArrayLength(x) (sizeof(x)/sizeof(x[0]))
+#define ArrayLength(x) (sizeof(x)/sizeof(x[0]))
#define safestrncpy(dest, src, len) do { char *d = (dest); const char *s = (src); size_t l = strlen(s)+1; if ((len) < l) l = (len); memmove(d, s, l); d[l-1] = 0; } while (0)
-#ifdef __GNUC__
+#if __GNUC__
#define PRINTF_LIKE(M,N) __attribute__((format (printf, M, N)))
#else
#define PRINTF_LIKE(M,N)
#define UNUSED_ARG(ARG) ARG
#endif
+#if defined(__GNUC__) && (__GNUC__ < 3)
+# define GCC_VARMACROS 1
+#elif !defined(S_SPLINT_S)
+# define C99_VARMACROS 1
+#endif
+
#if defined(WITH_MALLOC_DMALLOC)
# define DMALLOC_FUNC_CHECK 1
# include <string.h>
# define verify(ptr) (void)(ptr)
#endif
-extern time_t now;
+extern unsigned long now;
extern int quit_services;
extern struct log_type *MAIN_LOG;
+extern const char git_version[];
typedef union irc_in_addr {
uint32_t in6_32[4];
unsigned int n, found;\
verify(list->list);\
for (found=n=0; n<list->used; n++) {\
- if (list->list[n] == new_item) {\
- memmove(list->list+n, list->list+n+1, (list->used-n-1)*sizeof(list->list[n]));\
- found = 1;\
- list->used--;\
- }\
+ if (list->list[n] == new_item) {\
+ memmove(list->list+n, list->list+n+1, (list->used-n-1)*sizeof(list->list[n]));\
+ found = 1;\
+ list->used--;\
+ }\
}\
return found;\
}\
* minutes, and 10 seconds" (27 characters). Other languages will
* vary, so there's plenty of leeway.
*/
-#define INTERVALLEN 50
+#define INTERVALLEN 50
struct handle_info;
-char *intervalString(char *output, time_t interval, struct handle_info *hi);
+char *intervalString(char *output, unsigned long interval, struct handle_info *hi);
int getipbyname(const char *name, unsigned long *ip);
int set_policer_param(const char *param, void *data, void *extra);
const char *strtab(unsigned int ii);
int irccasecmp(const char *stra, const char *strb);
int ircncasecmp(const char *stra, const char *strb, unsigned int len);
const char *irccasestr(const char *haystack, const char *needle);
+char *ircstrlower(char *str);
DECLARE_LIST(string_buffer, char);
void string_buffer_append_string(struct string_buffer *buf, const char *tail);