-
RCS file: /home/cvs/jabberd2/c2s/authreg.c,v
retrieving revision 1.48
diff -u -r1.48 authreg.c
|
|
|
|
| 50 | 50 | extern int ar_anon_init(authreg_t); |
| 51 | 51 | #endif |
| 52 | 52 | |
| 53 | | char *module_names[] = { |
| | 53 | static const char *module_names[] = { |
| 54 | 54 | #ifdef STORAGE_MYSQL |
| 55 | 55 | "mysql", |
| 56 | 56 | #endif |
-
RCS file: /home/cvs/jabberd2/c2s/authreg_mysql.c,v
retrieving revision 1.15
diff -u -r1.15 authreg_mysql.c
|
|
|
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** Provide a configuration parameter or default value. */ |
| 322 | | char * _ar_mysql_param( config_t c, char * key, char * def ) { |
| | 322 | static char * _ar_mysql_param( config_t c, char * key, char * def ) { |
| 323 | 323 | char * value = config_get_one( c, key, 0 ); |
| 324 | 324 | if( value == NULL ) |
| 325 | 325 | return def; |
| … |
… |
|
| 332 | 332 | /* one each, in order, of the one character sprintf types that are */ |
| 333 | 333 | /* expected to follow the escape characters '%' in the template. */ |
| 334 | 334 | /* Returns 0 on success, or an error message on failures. */ |
| 335 | | char * _ar_mysql_check_template( char * template, char * types ) { |
| | 335 | static char * _ar_mysql_check_template( char * template, char * types ) { |
| 336 | 336 | int pScan = 0; |
| 337 | 337 | int pType = 0; |
| 338 | 338 | char c; |
| … |
… |
|
| 368 | 368 | /* required parameter placeholders. If there is an error, it is */ |
| 369 | 369 | /* written to the error log. */ |
| 370 | 370 | /* Returns 0 on success, or 1 on errors. */ |
| 371 | | int _ar_mysql_check_sql( authreg_t ar, char * sql, char * types ) { |
| | 371 | static int _ar_mysql_check_sql( authreg_t ar, char * sql, char * types ) { |
| 372 | 372 | char * error; |
| 373 | 373 | |
| 374 | 374 | error = _ar_mysql_check_template( sql, types ); |
-
RCS file: /home/cvs/jabberd2/mio/mio.c,v
retrieving revision 1.12
diff -u -r1.12 mio.c
|
|
|
|
| 74 | 74 | #define MIO_DEBUG 0 |
| 75 | 75 | #endif |
| 76 | 76 | #define mio_debug if(MIO_DEBUG) _mio_debug |
| 77 | | void _mio_debug(int line, const char *msgfmt, ...) |
| | 77 | static void _mio_debug(int line, const char *msgfmt, ...) |
| 78 | 78 | { |
| 79 | 79 | va_list ap; |
| 80 | 80 | va_start(ap,msgfmt); |
| … |
… |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** internally accept an incoming connection from a listen sock */ |
| 105 | | void _mio_accept(mio_t m, int fd) |
| | 105 | static void _mio_accept(mio_t m, int fd) |
| 106 | 106 | { |
| 107 | 107 | struct sockaddr_storage serv_addr; |
| 108 | 108 | socklen_t addrlen = (socklen_t) sizeof(serv_addr); |
| … |
… |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** internally change a connecting socket to a normal one */ |
| 157 | | void _mio_connect(mio_t m, int fd) |
| | 157 | static void _mio_connect(mio_t m, int fd) |
| 158 | 158 | { |
| 159 | 159 | mio_type_t type = FD(m,fd).type; |
| 160 | 160 | |
-
RCS file: /home/cvs/jabberd2/router/aci.c,v
retrieving revision 1.7
diff -u -r1.7 aci.c
|
|
|
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** see if a username is in an acl */ |
| 94 | | int aci_check(xht aci, char *type, char *name) { |
| | 94 | int aci_check(xht aci, const char *type, const char *name) { |
| 95 | 95 | aci_user_t list, scan; |
| 96 | 96 | |
| 97 | 97 | log_debug(ZONE, "checking for '%s' in acl 'all'", name); |
-
RCS file: /home/cvs/jabberd2/router/main.c,v
retrieving revision 1.50
diff -u -r1.50 main.c
|
|
|
|
| 23 | 23 | static sig_atomic_t router_shutdown = 0; |
| 24 | 24 | static sig_atomic_t router_logrotate = 0; |
| 25 | 25 | |
| 26 | | void router_signal(int signum) |
| | 26 | static void router_signal(int signum) |
| 27 | 27 | { |
| 28 | 28 | router_shutdown = 1; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | | void router_signal_hup(int signum) |
| | 31 | static void router_signal_hup(int signum) |
| 32 | 32 | { |
| 33 | 33 | router_logrotate = 1; |
| 34 | 34 | } |
-
RCS file: /home/cvs/jabberd2/router/router.h,v
retrieving revision 1.26
diff -u -r1.26 router.h
|
|
|
|
| 185 | 185 | |
| 186 | 186 | xht aci_load(router_t r); |
| 187 | 187 | void aci_unload(xht aci); |
| 188 | | int aci_check(xht acls, char *type, char *name); |
| | 188 | int aci_check(xht acls, const char *type, const char *name); |
| 189 | 189 | |
| 190 | 190 | int user_table_load(router_t r); |
| 191 | 191 | void user_table_unload(router_t r); |
-
RCS file: /home/cvs/jabberd2/sm/mod_iq_vcard.c,v
retrieving revision 1.25
diff -u -r1.25 mod_iq_vcard.c
|
|
|
|
| 37 | 37 | * using real foaf profiles, we'll have bigger things to worry about :) |
| 38 | 38 | */ |
| 39 | 39 | |
| 40 | | static char *_iq_vcard_map[] = { |
| | 40 | static const char *_iq_vcard_map[] = { |
| 41 | 41 | "FN", "fn", |
| 42 | 42 | "NICKNAME", "nickname", |
| 43 | 43 | "URL", "url", |
| … |
… |
|
| 64 | 64 | os_t os; |
| 65 | 65 | os_object_t o; |
| 66 | 66 | int i = 0, elem; |
| 67 | | char *vkey, *dkey, *vskey, ekey[10], cdata[4096]; |
| | 67 | char ekey[10], cdata[4096]; |
| | 68 | const char *vkey, *dkey, *vskey; |
| 68 | 69 | |
| 69 | 70 | log_debug(ZONE, "building object from packet"); |
| 70 | 71 | |
| … |
… |
|
| 107 | 108 | pkt_t pkt; |
| 108 | 109 | os_object_t o; |
| 109 | 110 | int i = 0, elem; |
| 110 | | char *vkey, *dkey, *vskey, ekey[10], *dval; |
| | 111 | char ekey[10], *dval; |
| | 112 | const char *vkey, *dkey, *vskey; |
| 111 | 113 | |
| 112 | 114 | log_debug(ZONE, "building packet from object"); |
| 113 | 115 | |
-
RCS file: /home/cvs/jabberd2/sm/pres.c,v
retrieving revision 1.41
diff -u -r1.41 pres.c
|
|
|
|
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | 39 | /** select a new top session based on current session presence */ |
| 40 | | void _pres_top(user_t user) { |
| | 40 | static void _pres_top(user_t user) { |
| 41 | 41 | sess_t scan; |
| 42 | 42 | |
| 43 | 43 | user->top = NULL; |
-
RCS file: /home/cvs/jabberd2/sm/storage.c,v
retrieving revision 1.21
diff -u -r1.21 storage.c
|
|
|
|
| 52 | 52 | extern st_ret_t st_sqlite_init(st_driver_t); |
| 53 | 53 | #endif |
| 54 | 54 | |
| 55 | | static char *st_driver_names[] = { |
| | 55 | static const char *st_driver_names[] = { |
| 56 | 56 | #ifdef STORAGE_DB |
| 57 | 57 | "db", |
| 58 | 58 | #endif |
| … |
… |
|
| 445 | 445 | return f; |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | | int _storage_match(st_filter_t f, os_object_t o, os_t os) { |
| | 448 | static int _storage_match(st_filter_t f, os_object_t o, os_t os) { |
| 449 | 449 | void *val; |
| 450 | 450 | os_type_t ot; |
| 451 | 451 | st_filter_t scan; |
-
RCS file: /home/cvs/jabberd2/sx/error.c,v
retrieving revision 1.13
diff -u -r1.13 error.c
|
|
|
|
| 21 | 21 | #include "sx.h" |
| 22 | 22 | |
| 23 | 23 | /** if you change these, reflect your changes in the defines in sx.h */ |
| 24 | | static char *_stream_errors[] = { |
| | 24 | static const char *_stream_errors[] = { |
| 25 | 25 | "bad-format", |
| 26 | 26 | "bad-namespace-prefix", |
| 27 | 27 | "conflict", |
| … |
… |
|
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | 52 | /** send an error */ |
| 53 | | void _sx_error(sx_t s, int err, char *text) { |
| | 53 | void _sx_error(sx_t s, int err, const char *text) { |
| 54 | 54 | int len = 0; |
| 55 | 55 | sx_buf_t buf; |
| 56 | 56 | |
| … |
… |
|
| 85 | 85 | s->want_write = 1; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | | void sx_error(sx_t s, int err, char *text) { |
| | 88 | void sx_error(sx_t s, int err, const char *text) { |
| 89 | 89 | assert(s != NULL); |
| 90 | 90 | assert(err >= 0 && err < stream_err_LAST); |
| 91 | 91 | |
-
RCS file: /home/cvs/jabberd2/sx/ssl.h,v
retrieving revision 1.7
diff -u -r1.7 ssl.h
|
|
|
|
| 25 | 25 | |
| 26 | 26 | #ifdef HAVE_SSL |
| 27 | 27 | |
| | 28 | #include <openssl/md5.h> |
| 28 | 29 | #include <openssl/ssl.h> |
| 29 | 30 | #include <openssl/err.h> |
| 30 | 31 | |
-
RCS file: /home/cvs/jabberd2/sx/sx.c,v
retrieving revision 1.21
diff -u -r1.21 sx.c
|
|
|
|
| 199 | 199 | if len>0 but data is NULL, the buffer will contain that many bytes |
| 200 | 200 | of garbage, to be overwritten by caller. otherwise, data pointed to |
| 201 | 201 | by 'data' will be copied into buf */ |
| 202 | | sx_buf_t _sx_buffer_new(char *data, int len, _sx_notify_t notify, void *notify_arg) { |
| | 202 | sx_buf_t _sx_buffer_new(const char *data, int len, _sx_notify_t notify, void *notify_arg) { |
| 203 | 203 | sx_buf_t buf; |
| 204 | 204 | |
| 205 | 205 | buf = (sx_buf_t) malloc(sizeof(struct _sx_buf_st)); |
| … |
… |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** debug macro helpers */ |
| 301 | | void __sx_debug(char *file, int line, const char *msgfmt, ...) { |
| | 301 | void __sx_debug(const char *file, int line, const char *msgfmt, ...) { |
| 302 | 302 | va_list ap; |
| 303 | 303 | char *pos, message[MAX_DEBUG]; |
| 304 | 304 | int sz; |
| … |
… |
|
| 316 | 316 | fflush(stderr); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | | int __sx_event(char *file, int line, sx_t s, sx_event_t e, void *data) { |
| | 319 | int __sx_event(const char *file, int line, sx_t s, sx_event_t e, void *data) { |
| 320 | 320 | int ret; |
| 321 | 321 | |
| 322 | 322 | _sx_debug(file, line, "tag %d event %d data 0x%x", s->tag, e, data); |
-
RCS file: /home/cvs/jabberd2/sx/sx.h,v
retrieving revision 1.33
diff -u -r1.33 sx.h
|
|
|
|
| 166 | 166 | sx_plugin_t sx_env_plugin(sx_env_t env, sx_plugin_init_t init, ...); |
| 167 | 167 | |
| 168 | 168 | /* send errors and close stuff */ |
| 169 | | void sx_error(sx_t s, int err, char *text); |
| | 169 | void sx_error(sx_t s, int err, const char *text); |
| 170 | 170 | void sx_close(sx_t s); |
| 171 | 171 | void sx_kill(sx_t s); |
| 172 | 172 | |
| … |
… |
|
| 197 | 197 | int _sx_chain_nad_read(sx_t s, nad_t nad); |
| 198 | 198 | |
| 199 | 199 | /* buffer utilities */ |
| 200 | | sx_buf_t _sx_buffer_new(char *data, int len, _sx_notify_t notify, void *notify_arg); |
| | 200 | sx_buf_t _sx_buffer_new(const char *data, int len, _sx_notify_t notify, void *notify_arg); |
| 201 | 201 | void _sx_buffer_free(sx_buf_t buf); |
| 202 | 202 | void _sx_buffer_clear(sx_buf_t buf); |
| 203 | 203 | void _sx_buffer_alloc_margin(sx_buf_t buf, int before, int after); |
| … |
… |
|
| 213 | 213 | void _sx_reset(sx_t s); |
| 214 | 214 | |
| 215 | 215 | /* send errors and close stuff */ |
| 216 | | void _sx_error(sx_t s, int err, char *text); |
| | 216 | void _sx_error(sx_t s, int err, const char *text); |
| 217 | 217 | void _sx_close(sx_t s); |
| 218 | 218 | |
| 219 | 219 | /** read/write plugin chain */ |
| … |
… |
|
| 347 | 347 | #define ZONE __FILE__,__LINE__ |
| 348 | 348 | |
| 349 | 349 | /** helper functions for macros when we're debugging */ |
| 350 | | void __sx_debug(char *file, int line, const char *msgfmt, ...); |
| | 350 | void __sx_debug(const char *file, int line, const char *msgfmt, ...); |
| 351 | 351 | |
| 352 | 352 | /** helper and internal macro for firing the callback */ |
| 353 | | int __sx_event(char *file, int line, sx_t s, sx_event_t e, void *data); |
| | 353 | int __sx_event(const char *file, int line, sx_t s, sx_event_t e, void *data); |
| 354 | 354 | #define _sx_event(s,e,data) __sx_event(ZONE, s, e, data) |
| 355 | 355 | |
| 356 | 356 | #ifdef SX_DEBUG |
-
RCS file: /home/cvs/jabberd2/util/config.c,v
retrieving revision 1.10
diff -u -r1.10 config.c
|
|
|
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** turn an xml file into a config hash */ |
| 75 | | int config_load(config_t c, char *file) |
| | 75 | int config_load(config_t c, const char *file) |
| 76 | 76 | { |
| 77 | 77 | struct build_data bd; |
| 78 | 78 | FILE *f; |
| … |
… |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** get the config element for this key */ |
| 235 | | config_elem_t config_get(config_t c, char *key) |
| | 235 | config_elem_t config_get(config_t c, const char *key) |
| 236 | 236 | { |
| 237 | 237 | return xhash_get(c->hash, key); |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** get config value n for this key */ |
| 241 | | char *config_get_one(config_t c, char *key, int num) |
| | 241 | char *config_get_one(config_t c, const char *key, int num) |
| 242 | 242 | { |
| 243 | 243 | config_elem_t elem = xhash_get(c->hash, key); |
| 244 | 244 | |
| … |
… |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** how many values for this key? */ |
| 255 | | int config_count(config_t c, char *key) |
| | 255 | int config_count(config_t c, const char *key) |
| 256 | 256 | { |
| 257 | 257 | config_elem_t elem = xhash_get(c->hash, key); |
| 258 | 258 | |
| … |
… |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** get an attr for this value */ |
| 266 | | char *config_get_attr(config_t c, char *key, int num, char *attr) |
| | 266 | char *config_get_attr(config_t c, const char *key, int num, const char *attr) |
| 267 | 267 | { |
| 268 | 268 | config_elem_t elem = xhash_get(c->hash, key); |
| 269 | 269 | |
-
RCS file: /home/cvs/jabberd2/util/jid.c,v
retrieving revision 1.27
diff -u -r1.27 jid.c
|
|
|
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** do stringprep on the pieces */ |
| 82 | | int jid_prep_pieces(prep_cache_t pc, char *node, char *domain, char *resource) { |
| | 82 | static int jid_prep_pieces(prep_cache_t pc, char *node, char *domain, char *resource) { |
| 83 | 83 | #ifdef HAVE_IDN |
| 84 | 84 | char str[1024], *prep; |
| 85 | 85 | |
-
RCS file: /home/cvs/jabberd2/util/log.c,v
retrieving revision 1.15
diff -u -r1.15 log.c
|
|
|
|
| 50 | 50 | { NULL, -1 } |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | | static int _log_facility(char *facility) { |
| | 53 | static int _log_facility(const char *facility) { |
| 54 | 54 | log_facility_t *lp; |
| 55 | 55 | |
| 56 | 56 | if (facility == NULL) { |
| … |
… |
|
| 64 | 64 | return lp->number; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | | log_t log_new(log_type_t type, char *ident, char *facility) |
| | 67 | log_t log_new(log_type_t type, const char *ident, const char *facility) |
| 68 | 68 | { |
| 69 | 69 | log_t log; |
| 70 | 70 | int fnum = 0; |
| … |
… |
|
| 168 | 168 | |
| 169 | 169 | #ifdef DEBUG |
| 170 | 170 | /** debug logging */ |
| 171 | | void debug_log(char *file, int line, const char *msgfmt, ...) |
| | 171 | void debug_log(const char *file, int line, const char *msgfmt, ...) |
| 172 | 172 | { |
| 173 | 173 | va_list ap; |
| 174 | 174 | char *pos, message[MAX_DEBUG]; |
-
RCS file: /home/cvs/jabberd2/util/nad.c,v
retrieving revision 1.34
diff -u -r1.34 nad.c
|
|
|
|
| 67 | 67 | #define BLOCKSIZE 1024 |
| 68 | 68 | |
| 69 | 69 | /** internal: do and return the math and ensure it gets realloc'd */ |
| 70 | | int _nad_realloc(void **oblocks, int len) |
| | 70 | static int _nad_realloc(void **oblocks, int len) |
| 71 | 71 | { |
| 72 | 72 | void *nblocks; |
| 73 | 73 | int nlen; |
| … |
… |
|
| 85 | 85 | #define NAD_SAFE(blocks, size, len) if((size) > len) len = _nad_realloc((void**)&(blocks),(size)); |
| 86 | 86 | |
| 87 | 87 | /** internal: append some cdata and return the index to it */ |
| 88 | | int _nad_cdata(nad_t nad, const char *cdata, int len) |
| | 88 | static int _nad_cdata(nad_t nad, const char *cdata, int len) |
| 89 | 89 | { |
| 90 | 90 | NAD_SAFE(nad->cdata, nad->ccur + len, nad->clen); |
| 91 | 91 | |
| … |
… |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** internal: create a new attr on any given elem */ |
| 98 | | int _nad_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen) |
| | 98 | static int _nad_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen) |
| 99 | 99 | { |
| 100 | 100 | int attr; |
| 101 | 101 | |
| … |
… |
|
| 598 | 598 | return ns; |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | | void _nad_escape(nad_t nad, int data, int len, int flag) |
| | 601 | static void _nad_escape(nad_t nad, int data, int len, int flag) |
| 602 | 602 | { |
| 603 | 603 | char *c; |
| 604 | 604 | int ic; |
| … |
… |
|
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | /** internal recursive printing function */ |
| 689 | | int _nad_lp0(nad_t nad, int elem) |
| | 689 | static int _nad_lp0(nad_t nad, int elem) |
| 690 | 690 | { |
| 691 | 691 | int attr; |
| 692 | 692 | int ndepth; |
-
RCS file: /home/cvs/jabberd2/util/pool.c,v
retrieving revision 1.10
diff -u -r1.10 pool.c
|
|
|
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** free a heap */ |
| 72 | | void _pool_heap_free(void *arg) |
| | 72 | static void _pool_heap_free(void *arg) |
| 73 | 73 | { |
| 74 | 74 | struct pheap *h = (struct pheap *)arg; |
| 75 | 75 | |
| … |
… |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** mem should always be freed last */ |
| 81 | | void _pool_cleanup_append(pool p, struct pfree *pf) |
| | 81 | static void _pool_cleanup_append(pool p, struct pfree *pf) |
| 82 | 82 | { |
| 83 | 83 | struct pfree *cur; |
| 84 | 84 | |
| … |
… |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** create a cleanup tracker */ |
| 99 | | struct pfree *_pool_free(pool p, pool_cleaner f, void *arg) |
| | 99 | static struct pfree *_pool_free(pool p, pool_cleaner f, void *arg) |
| 100 | 100 | { |
| 101 | 101 | struct pfree *ret; |
| 102 | 102 | |
| … |
… |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** create a heap and make sure it get's cleaned up */ |
| 113 | | struct pheap *_pool_heap(pool p, int size) |
| | 113 | static struct pheap *_pool_heap(pool p, int size) |
| 114 | 114 | { |
| 115 | 115 | struct pheap *ret; |
| 116 | 116 | struct pfree *clean; |
-
RCS file: /home/cvs/jabberd2/util/stanza.c,v
retrieving revision 1.9
diff -u -r1.9 stanza.c
|
|
|
|
| 23 | 23 | /* stanza manipulation */ |
| 24 | 24 | |
| 25 | 25 | typedef struct _stanza_error_st { |
| 26 | | char *name; |
| 27 | | char *type; |
| 28 | | char *code; |
| | 26 | const char *name; |
| | 27 | const char *type; |
| | 28 | const char *code; |
| 29 | 29 | } *stanza_error_t; |
| 30 | 30 | |
| 31 | 31 | /** if you change these, reflect your changes in the defines in util.h */ |
-
RCS file: /home/cvs/jabberd2/util/str.c,v
retrieving revision 1.8
diff -u -r1.8 str.c
|
|
|
|
| 91 | 91 | return atoi(a); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | | char *j_attr(const char** atts, char *attr) |
| | 94 | char *j_attr(const char** atts, const char *attr) |
| 95 | 95 | { |
| 96 | 96 | int i = 0; |
| 97 | 97 | |
| … |
… |
|
| 127 | 127 | return s; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | | void _spool_add(spool s, char *goodstr) |
| | 130 | static void _spool_add(spool s, char *goodstr) |
| 131 | 131 | { |
| 132 | 132 | struct spool_node *sn; |
| 133 | 133 | |
| … |
… |
|
| 353 | 353 | return temp; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | | char *zonestr(char *file, int line) |
| | 356 | static char *zonestr(char *file, int line) |
| 357 | 357 | { |
| 358 | 358 | static char buff[64]; |
| 359 | 359 | int i; |
-
RCS file: /home/cvs/jabberd2/util/util.h,v
retrieving revision 1.65
diff -u -r1.65 util.h
|
|
|
|
| 163 | 163 | int j_strncasecmp(const char *a, const char *b, int i); /* provides NULL safe strncasecmp wrapper */ |
| 164 | 164 | int j_strlen(const char *a); /* provides NULL safe strlen wrapper */ |
| 165 | 165 | int j_atoi(const char *a, int def); /* checks for NULL and uses default instead, convienence */ |
| 166 | | char *j_attr(const char** atts, char *attr); /* decode attr's (from expat) */ |
| | 166 | char *j_attr(const char** atts, const char *attr); /* decode attr's (from expat) */ |
| 167 | 167 | char *j_strnchr(const char *s, int c, int n); /* like strchr, but only searches n chars */ |
| 168 | 168 | |
| 169 | 169 | /** old convenience function, now in str.c */ |
| … |
… |
|
| 399 | 399 | |
| 400 | 400 | typedef struct log_facility_st |
| 401 | 401 | { |
| 402 | | char *facility; |
| | 402 | const char *facility; |
| 403 | 403 | int number; |
| 404 | 404 | } log_facility_t; |
| 405 | 405 | |
| 406 | | extern log_t log_new(log_type_t type, char *ident, char *facility); |
| | 406 | extern log_t log_new(log_type_t type, const char *ident, const char *facility); |
| 407 | 407 | extern void log_write(log_t log, int level, const char *msgfmt, ...); |
| 408 | 408 | extern void log_free(log_t log); |
| 409 | 409 | |
| … |
… |
|
| 574 | 574 | }; |
| 575 | 575 | |
| 576 | 576 | extern config_t config_new(void); |
| 577 | | extern int config_load(config_t c, char *file); |
| 578 | | extern config_elem_t config_get(config_t c, char *key); |
| 579 | | extern char *config_get_one(config_t c, char *key, int num); |
| 580 | | extern int config_count(config_t c, char *key); |
| 581 | | extern char *config_get_attr(config_t c, char *key, int num, char *attr); |
| | 577 | extern int config_load(config_t c, const char *file); |
| | 578 | extern config_elem_t config_get(config_t c, const char *key); |
| | 579 | extern char *config_get_one(config_t c, const char *key, int num); |
| | 580 | extern int config_count(config_t c, const char *key); |
| | 581 | extern char *config_get_attr(config_t c, const char *key, int num, const char *attr); |
| 582 | 582 | extern void config_free(config_t); |
| 583 | 583 | |
| 584 | 584 | |
| … |
… |
|
| 745 | 745 | /* debug logging */ |
| 746 | 746 | int get_debug_flag(void); |
| 747 | 747 | void set_debug_flag(int v); |
| 748 | | void debug_log(char *file, int line, const char *msgfmt, ...); |
| | 748 | void debug_log(const char *file, int line, const char *msgfmt, ...); |
| 749 | 749 | #define ZONE __FILE__,__LINE__ |
| 750 | 750 | #define MAX_DEBUG 8192 |
| 751 | 751 | |
-
RCS file: /home/cvs/jabberd2/util/xdata.c,v
retrieving revision 1.6
diff -u -r1.6 xdata.c
|
|
|
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** option insertion */ |
| 136 | | void xdata_option_new(xdata_field_t xdf, char *value, int lvalue, char *label, int llabel) { |
| | 136 | static void xdata_option_new(xdata_field_t xdf, char *value, int lvalue, char *label, int llabel) { |
| 137 | 137 | xdata_option_t xdo; |
| 138 | 138 | |
| 139 | 139 | assert((int) xdf); |
-
RCS file: /home/cvs/jabberd2/util/xhash.c,v
retrieving revision 1.11
diff -u -r1.11 xhash.c
|
|
|
|
| 25 | 25 | * This function uses the ELF hashing algorithm as reprinted in |
| 26 | 26 | * Andrew Binstock, "Hashing Rehashed," Dr. Dobb's Journal, April 1996. |
| 27 | 27 | */ |
| 28 | | int _xhasher(const char *s, int len) |
| | 28 | static int _xhasher(const char *s, int len) |
| 29 | 29 | { |
| 30 | 30 | /* ELF hash uses unsigned chars and unsigned arithmetic for portability */ |
| 31 | 31 | const unsigned char *name = (const unsigned char *)s; |
| … |
… |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | | xhn _xhash_node_new(xht h, int index) |
| | 48 | static xhn _xhash_node_new(xht h, int index) |
| 49 | 49 | { |
| 50 | 50 | xhn n; |
| 51 | 51 | int i = index % h->prime; |
| … |
… |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | | xhn _xhash_node_get(xht h, const char *key, int len, int index) |
| | 69 | static xhn _xhash_node_get(xht h, const char *key, int len, int index) |
| 70 | 70 | { |
| 71 | 71 | xhn n; |
| 72 | 72 | int i = index % h->prime; |