X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/d6b0769fc8e6b1d3d40f0c4cd627aa7d984c70ed..2dddcd742b32cc37e3f7b7040869004c67b3e061:/src/common.h?ds=sidebyside diff --git a/src/common.h b/src/common.h index ceb6f82..0d93315 100644 --- a/src/common.h +++ b/src/common.h @@ -5,7 +5,7 @@ * * x3 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 + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -41,7 +41,7 @@ extern struct tm *localtime_r(const time_t *clock, struct tm *res); #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) @@ -56,6 +56,12 @@ extern struct tm *localtime_r(const time_t *clock, struct tm *res); #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 @@ -177,7 +183,7 @@ int mmatch(const char *glob, const char *newglob); int match_ircglob(const char *text, const char *glob); #define MATCH_USENICK 1 #define MATCH_VISIBLE 2 -int user_matches_glob(struct userNode *user, const char *glob, int flags); +int user_matches_glob(struct userNode *user, const char *glob, int flags, int shared); int is_overmask(char *mask); @@ -262,6 +268,7 @@ void tools_cleanup(void); 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);