X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/d0f04f713ca0b689f745842fcc9e61d24610f11a..59b38cc02dd57c5a072cf206794548fbb37e0571:/src/common.h diff --git a/src/common.h b/src/common.h index eafa96f..ffee4f4 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, @@ -95,6 +95,7 @@ extern void x3_free(const char *, unsigned int, void *); extern void verify(const void *ptr); # define verify(x) verify(x) # endif + #elif defined(WITH_MALLOC_SLAB) # define malloc(n) slab_malloc(__FILE__, __LINE__, (n)) # undef calloc @@ -119,6 +120,9 @@ extern void verify(const void *ptr); # define verify(ptr) (void)(ptr) #endif +extern char *x3_msnprintf(const int size, const char *format, ...); +#define msnprintf x3_msnprintf + extern time_t now; extern int quit_services; extern struct log_type *MAIN_LOG; @@ -250,6 +254,7 @@ 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); char *time2str(time_t thetime); +extern char *pretty_mask(char *mask); void tools_init(void); void tools_cleanup(void); @@ -264,7 +269,10 @@ void string_buffer_append_substring(struct string_buffer *buf, const char *tail, void string_buffer_append_vprintf(struct string_buffer *buf, const char *fmt, va_list args); void string_buffer_append_printf(struct string_buffer *buf, const char *fmt, ...); void string_buffer_replace(struct string_buffer *buf, unsigned int from, unsigned int len, const char *repl); +void +irc_strtolower(char *str); +int str_is_number(const char *str); #define enabled_string(string) (!irccasecmp((string), "on") || !strcmp((string), "1") || !irccasecmp((string), "enabled")) #define disabled_string(string) (!irccasecmp((string), "off") || !strcmp((string), "0") || !irccasecmp((string), "disabled")) #define true_string(string) (!irccasecmp((string), "true") || !strcmp((string), "1") || !irccasecmp((string), "yes"))