djbdnscurve6 45
djbdnscurve6
Loading...
Searching...
No Matches
cachetest.c
Go to the documentation of this file.
1#include "buffer.h"
2#include "exit.h"
3#include "str.h"
4#include "sipcache.h"
5
6int main(int argc,char **argv)
7{
8 int i;
9 char *x;
10 char *y;
11 unsigned int u;
12 uint32 ttl;
13
14 if (!cache_init(200)) _exit(111);
15
16 if (*argv) ++argv;
17
18 while ((x = *argv++)) {
19 i = str_chr(x,':');
20 if (x[i])
21 cache_set(x,i,x + i + 1,str_len(x) - i - 1,86400);
22 else {
23 y = cache_get(x,i,&u,&ttl);
24 if (y)
25 buffer_put(buffer_1,y,u);
26 buffer_puts(buffer_1,"\n");
27 }
28 }
29
30 buffer_flush(buffer_1);
31 _exit(0);
32}
int main()
Definition: axfrdns.c:323
struct line * x
char * cache_get(const char *, unsigned int, unsigned int *, uint32 *)
Definition: sipcache.c:73
void cache_set(const char *, unsigned int, const char *, unsigned int, uint32)
Definition: sipcache.c:119
int cache_init(unsigned int)
Definition: sipcache.c:177
unsigned long u
Definition: utime.c:10