Changeset 156
- Timestamp:
- 09/04/07 14:40:58 (20 months ago)
- Location:
- trunk
- Files:
-
- 21 modified
-
c2s/authreg.c (modified) (1 diff)
-
c2s/authreg_mysql.c (modified) (3 diffs)
-
router/aci.c (modified) (1 diff)
-
router/main.c (modified) (1 diff)
-
router/router.h (modified) (1 diff)
-
sm/mod_iq_vcard.c (modified) (3 diffs)
-
sm/pres.c (modified) (1 diff)
-
sm/storage.c (modified) (2 diffs)
-
sx/error.c (modified) (3 diffs)
-
sx/ssl.h (modified) (1 diff)
-
sx/sx.c (modified) (3 diffs)
-
sx/sx.h (modified) (4 diffs)
-
util/config.c (modified) (5 diffs)
-
util/jid.c (modified) (1 diff)
-
util/log.c (modified) (3 diffs)
-
util/nad.c (modified) (5 diffs)
-
util/pool.c (modified) (4 diffs)
-
util/str.c (modified) (3 diffs)
-
util/util.h (modified) (5 diffs)
-
util/xdata.c (modified) (1 diff)
-
util/xhash.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/c2s/authreg.c
r153 r156 54 54 #endif 55 55 56 char *module_names[] = {56 static const char *module_names[] = { 57 57 #ifdef STORAGE_MYSQL 58 58 "mysql", -
trunk/c2s/authreg_mysql.c
r2 r156 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 ) … … 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; … … 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 -
trunk/router/aci.c
r2 r156 92 92 93 93 /** see if a username is in an acl */ 94 int aci_check(xht aci, c har *type,char *name) {94 int aci_check(xht aci, const char *type, const char *name) { 95 95 aci_user_t list, scan; 96 96 -
trunk/router/main.c
r93 r156 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; -
trunk/router/router.h
r141 r156 202 202 xht aci_load(router_t r); 203 203 void aci_unload(xht aci); 204 int aci_check(xht acls, c har *type,char *name);204 int aci_check(xht acls, const char *type, const char *name); 205 205 206 206 int user_table_load(router_t r); -
trunk/sm/mod_iq_vcard.c
r4 r156 43 43 */ 44 44 45 static c har *_iq_vcard_map[] = {45 static const char *_iq_vcard_map[] = { 46 46 "FN", "fn", 47 47 "NICKNAME", "nickname", … … 98 98 os_object_t o; 99 99 int i = 0, elem; 100 char *vkey, *dkey, *vskey, ekey[10], cdata[VCARD_MAX_FIELD_SIZE]; 100 char ekey[10], cdata[VCARD_MAX_FIELD_SIZE]; 101 const char *vkey, *dkey, *vskey; 101 102 102 103 log_debug(ZONE, "building object from packet"); … … 141 142 os_object_t o; 142 143 int i = 0, elem; 143 char *vkey, *dkey, *vskey, ekey[10], *dval; 144 char ekey[10], *dval; 145 const char *vkey, *dkey, *vskey; 144 146 145 147 log_debug(ZONE, "building packet from object"); -
trunk/sm/pres.c
r22 r156 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 -
trunk/sm/storage.c
r14 r156 53 53 #endif 54 54 55 static c har *st_driver_names[] = {55 static const char *st_driver_names[] = { 56 56 #ifdef STORAGE_DB 57 57 "db", … … 472 472 } 473 473 474 int _storage_match(st_filter_t f, os_object_t o, os_t os) {474 static int _storage_match(st_filter_t f, os_object_t o, os_t os) { 475 475 void *val; 476 476 os_type_t ot; -
trunk/sx/error.c
r2 r156 22 22 23 23 /** if you change these, reflect your changes in the defines in sx.h */ 24 static c har *_stream_errors[] = {24 static const char *_stream_errors[] = { 25 25 "bad-format", 26 26 "bad-namespace-prefix", … … 51 51 52 52 /** send an error */ 53 void _sx_error(sx_t s, int err, c har *text) {53 void _sx_error(sx_t s, int err, const char *text) { 54 54 int len = 0; 55 55 sx_buf_t buf; … … 86 86 } 87 87 88 void sx_error(sx_t s, int err, c har *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); -
trunk/sx/ssl.h
r55 r156 26 26 #ifdef HAVE_SSL 27 27 28 #include <openssl/md5.h> 28 29 #include <openssl/ssl.h> 29 30 #include <openssl/err.h> -
trunk/sx/sx.c
r141 r156 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(c har *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 … … 298 298 299 299 /** debug macro helpers */ 300 void __sx_debug(c har *file, int line, const char *msgfmt, ...) {300 void __sx_debug(const char *file, int line, const char *msgfmt, ...) { 301 301 va_list ap; 302 302 char *pos, message[MAX_DEBUG]; … … 316 316 } 317 317 318 int __sx_event(c har *file, int line, sx_t s, sx_event_t e, void *data) {318 int __sx_event(const char *file, int line, sx_t s, sx_event_t e, void *data) { 319 319 int ret; 320 320 -
trunk/sx/sx.h
r78 r156 167 167 168 168 /* send errors and close stuff */ 169 void sx_error(sx_t s, int err, c har *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); … … 198 198 199 199 /* buffer utilities */ 200 sx_buf_t _sx_buffer_new(c har *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); … … 214 214 215 215 /* send errors and close stuff */ 216 void _sx_error(sx_t s, int err, c har *text);216 void _sx_error(sx_t s, int err, const char *text); 217 217 void _sx_close(sx_t s); 218 218 … … 348 348 349 349 /** helper functions for macros when we're debugging */ 350 void __sx_debug(c har *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(c har *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 -
trunk/util/config.c
r77 r156 73 73 74 74 /** turn an xml file into a config hash */ 75 int config_load(config_t c, c har *file)75 int config_load(config_t c, const char *file) 76 76 { 77 77 struct build_data bd; … … 233 233 234 234 /** get the config element for this key */ 235 config_elem_t config_get(config_t c, c har *key)235 config_elem_t config_get(config_t c, const char *key) 236 236 { 237 237 return xhash_get(c->hash, key); … … 239 239 240 240 /** get config value n for this key */ 241 char *config_get_one(config_t c, c har *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); … … 253 253 254 254 /** how many values for this key? */ 255 int config_count(config_t c, c har *key)255 int config_count(config_t c, const char *key) 256 256 { 257 257 config_elem_t elem = xhash_get(c->hash, key); … … 264 264 265 265 /** get an attr for this value */ 266 char *config_get_attr(config_t c, c har *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); -
trunk/util/jid.c
r141 r156 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; -
trunk/util/log.c
r44 r156 51 51 }; 52 52 53 static int _log_facility(c har *facility) {53 static int _log_facility(const char *facility) { 54 54 log_facility_t *lp; 55 55 … … 65 65 } 66 66 67 log_t log_new(log_type_t type, c har *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; … … 171 171 #ifdef DEBUG 172 172 /** debug logging */ 173 void debug_log(c har *file, int line, const char *msgfmt, ...)173 void debug_log(const char *file, int line, const char *msgfmt, ...) 174 174 { 175 175 va_list ap; -
trunk/util/nad.c
r93 r156 66 66 67 67 /** internal: do and return the math and ensure it gets realloc'd */ 68 int _nad_realloc(void **oblocks, int len)68 static int _nad_realloc(void **oblocks, int len) 69 69 { 70 70 void *nblocks; … … 84 84 85 85 /** internal: append some cdata and return the index to it */ 86 int _nad_cdata(nad_t nad, const char *cdata, int len)86 static int _nad_cdata(nad_t nad, const char *cdata, int len) 87 87 { 88 88 NAD_SAFE(nad->cdata, nad->ccur + len, nad->clen); … … 94 94 95 95 /** internal: create a new attr on any given elem */ 96 int _nad_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen)96 static int _nad_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen) 97 97 { 98 98 int attr; … … 842 842 } 843 843 844 void _nad_escape(nad_t nad, int data, int len, int flag)844 static void _nad_escape(nad_t nad, int data, int len, int flag) 845 845 { 846 846 char *c; … … 930 930 931 931 /** internal recursive printing function */ 932 int _nad_lp0(nad_t nad, int elem)932 static int _nad_lp0(nad_t nad, int elem) 933 933 { 934 934 int attr; -
trunk/util/pool.c
r2 r156 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; … … 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; … … 97 97 98 98 /** create a cleanup tracker */ 99 st ruct 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; … … 111 111 112 112 /** create a heap and make sure it get's cleaned up */ 113 st ruct pheap *_pool_heap(pool p, int size)113 static struct pheap *_pool_heap(pool p, int size) 114 114 { 115 115 struct pheap *ret; -
trunk/util/str.c
r2 r156 92 92 } 93 93 94 char *j_attr(const char** atts, c har *attr)94 char *j_attr(const char** atts, const char *attr) 95 95 { 96 96 int i = 0; … … 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; … … 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]; -
trunk/util/util.h
r90 r156 162 162 int j_strlen(const char *a); /* provides NULL safe strlen wrapper */ 163 163 int j_atoi(const char *a, int def); /* checks for NULL and uses default instead, convienence */ 164 char *j_attr(const char** atts, c har *attr); /* decode attr's (from expat) */164 char *j_attr(const char** atts, const char *attr); /* decode attr's (from expat) */ 165 165 char *j_strnchr(const char *s, int c, int n); /* like strchr, but only searches n chars */ 166 166 … … 399 399 typedef struct log_facility_st 400 400 { 401 c har*facility;401 const char *facility; 402 402 int number; 403 403 } log_facility_t; 404 404 405 extern log_t log_new(log_type_t type, c har *ident,char *facility);405 extern log_t log_new(log_type_t type, const char *ident, const char *facility); 406 406 extern void log_write(log_t log, int level, const char *msgfmt, ...); 407 407 extern void log_free(log_t log); … … 572 572 573 573 extern config_t config_new(void); 574 extern int config_load(config_t c, c har *file);575 extern config_elem_t config_get(config_t c, c har *key);576 extern char *config_get_one(config_t c, c har *key, int num);577 extern int config_count(config_t c, c har *key);578 extern char *config_get_attr(config_t c, c har *key, int num,char *attr);574 extern int config_load(config_t c, const char *file); 575 extern config_elem_t config_get(config_t c, const char *key); 576 extern char *config_get_one(config_t c, const char *key, int num); 577 extern int config_count(config_t c, const char *key); 578 extern char *config_get_attr(config_t c, const char *key, int num, const char *attr); 579 579 extern void config_free(config_t); 580 580 … … 731 731 732 732 typedef struct _stanza_error_st { 733 c har*name;734 c har*type;735 c har*code;733 const char *name; 734 const char *type; 735 const char *code; 736 736 } *stanza_error_t; 737 737 … … 776 776 int get_debug_flag(void); 777 777 void set_debug_flag(int v); 778 void debug_log(c har *file, int line, const char *msgfmt, ...);778 void debug_log(const char *file, int line, const char *msgfmt, ...); 779 779 #define ZONE __FILE__,__LINE__ 780 780 #define MAX_DEBUG 8192 -
trunk/util/xdata.c
r141 r156 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 -
trunk/util/xhash.c
r2 r156 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 */ … … 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; … … 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;
