]> git.ozlabs.org Git - ccan/blob - junkcode/rusty@rustcorp.com.au-ntdb/_info
.gitignore: ignore .fast-ok files, too.
[ccan] / junkcode / rusty@rustcorp.com.au-ntdb / _info
1 #include "config.h"
2 #include <stdio.h>
3 #include <string.h>
4
5 /**
6  * ntdb - Next Generation Trivial Database
7  *
8  * This package provides an experimental persistent keyword/data store.
9  * Its main advantage over tdb is that it's 64-bit.
10  *
11  * Example:
12  *      #include <stdio.h>
13  *      #include <err.h>
14  *      #include <unistd.h>
15  *      #include <ccan/ntdb/ntdb.h>
16  *
17  *      int main(int argc, char *argv[])
18  *      {
19  *              NTDB_DATA key = ntdb_mkdata("key", 3);
20  *              NTDB_DATA val = ntdb_mkdata("val", 3);
21  *              struct ntdb_context *ntdb;
22  *
23  *              ntdb = ntdb_open("example.ntdb", NTDB_DEFAULT,
24  *                               O_RDWR | O_CREAT | O_TRUNC, 0600, NULL);
25  *              if (ntdb == NULL)
26  *                      errx(1, "failed to open database file");
27  *
28  *              ntdb_store(ntdb, key, val, NTDB_INSERT);
29  *
30  *              ntdb_close(ntdb);
31  *
32  *              return 0;
33  *      }
34  *
35  * License: LGPL (v3 or any later version)
36  * Authors: Rusty Russell
37  *          Andrew Tridgell
38  *          Jeremy Allison
39  *          Jelmer Vernooij
40  *          Volker Lendecke
41  *          Andrew Esh
42  *          Simon McVittie
43  *          Tim Potter
44  * Maintainer: Rusty Russell <rusty@rustcorp.com.au>
45  */
46 int main(int argc, char *argv[])
47 {
48         if (argc != 2)
49                 return 1;
50
51         if (strcmp(argv[1], "depends") == 0) {
52                 printf("ccan/asearch\n");       
53                 printf("ccan/build_assert\n");  
54                 printf("ccan/cast\n");  
55                 printf("ccan/compiler\n");      
56                 printf("ccan/endian\n");        
57                 printf("ccan/hash\n");  
58                 printf("ccan/ilog\n");  
59                 printf("ccan/likely\n");        
60                 printf("ccan/tally\n"); 
61                 printf("ccan/typesafe_cb\n");   
62                 return 0;
63         }
64
65         if (strcmp(argv[1], "testdepends") == 0) {
66                 printf("ccan/failtest\n");      
67                 printf("ccan/err\n");   
68                 return 0;
69         }
70
71         return 1;
72 }