Changeset f99cf462c3bf905a727087a97e5c305a52256d5e
- Timestamp:
- 03/17/09 18:23:09
(4 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1237314189 +0000
- git-parent:
[1712d2083a4d20733321e30c097dbcd337332eee]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1237314189 +0000
- Message:
add a string specific retrieve to make common const char * str fetches easiser. Fix some warnings in utils. refs #34
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rb7ec807 |
rf99cf46 |
|
| 220 | 220 | return 0; |
|---|
| 221 | 221 | } |
|---|
| | 222 | int noit_hash_retr_str(noit_hash_table *h, const char *k, int klen, const char **dstr) { |
|---|
| | 223 | int rv; |
|---|
| | 224 | void *vptr = NULL; |
|---|
| | 225 | rv = noit_hash_retrieve(h,k,klen,&vptr); |
|---|
| | 226 | *dstr = vptr; |
|---|
| | 227 | return rv; |
|---|
| | 228 | } |
|---|
| 222 | 229 | int noit_hash_delete(noit_hash_table *h, const char *k, int klen, |
|---|
| 223 | 230 | NoitHashFreeFunc keyfree, NoitHashFreeFunc datafree) { |
|---|
| rb7ec807 |
rf99cf46 |
|
| 76 | 76 | NoitHashFreeFunc keyfree, NoitHashFreeFunc datafree); |
|---|
| 77 | 77 | int noit_hash_retrieve(noit_hash_table *h, const char *k, int klen, void **data); |
|---|
| | 78 | int noit_hash_retr_str(noit_hash_table *h, const char *k, int klen, const char **data); |
|---|
| 78 | 79 | int noit_hash_delete(noit_hash_table *h, const char *k, int klen, |
|---|
| 79 | 80 | NoitHashFreeFunc keyfree, NoitHashFreeFunc datafree); |
|---|
| r84d6f13 |
rf99cf46 |
|
| 254 | 254 | noit_log_stream_t |
|---|
| 255 | 255 | noit_log_stream_find(const char *name) { |
|---|
| 256 | | noit_log_stream_t ls; |
|---|
| 257 | | if(noit_hash_retrieve(&noit_loggers, name, strlen(name), (void **)&ls)) { |
|---|
| 258 | | return ls; |
|---|
| | 256 | void *vls; |
|---|
| | 257 | if(noit_hash_retrieve(&noit_loggers, name, strlen(name), &vls)) { |
|---|
| | 258 | return (noit_log_stream_t)vls; |
|---|
| 259 | 259 | } |
|---|
| 260 | 260 | return NULL; |
|---|
| … | … | |
| 374 | 374 | strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", tm); |
|---|
| 375 | 375 | snprintf(fbuf, sizeof(fbuf), "[%s.%06d %s:%d] %s", |
|---|
| 376 | | tbuf, now->tv_usec, file, line, format); |
|---|
| | 376 | tbuf, (int)now->tv_usec, file, line, format); |
|---|
| 377 | 377 | format = fbuf; |
|---|
| 378 | 378 | } |
|---|