chiark
/
gitweb
/
~mdw
/
misc
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
space.[c1]: Document the `-v' option finally.
[misc]
/
cdb-probe.c
1
#include <errno.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <string.h>
5
6
#include <cdb.h>
7
8
const char *prog;
9
10
static void check(const char *p)
11
{
12
int rc;
13
unsigned l;
14
15
rc = cdb_seek(0, p, strlen(p), &l);
16
if (rc < 0) {
17
fprintf(stderr, "%s: cdb_seek: %s\n", prog, strerror(errno));
18
exit(111);
19
}
20
if (rc) exit(0);
21
}
22
23
int main(int argc, char *argv[])
24
{
25
prog = argv[0];
26
if (argc != 2) {
27
fprintf(stderr, "usage: %s KEY <CDB\n", prog);
28
exit(111);
29
}
30
check(argv[1]);
31
return (1);
32
}