diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-25 22:24:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-25 22:24:42 +0000 |
commit | c890b76cde9288a8d9f2faa3046fbb06341c8082 (patch) | |
tree | b2c072b5ad2fba45a6bf5856209963fbf37375c3 /src/include/gnunet_datacache_lib.h | |
parent | 2ec742c593419e3225fa87dcf44ca96fb62d62b5 (diff) | |
download | gnunet-c890b76cde9288a8d9f2faa3046fbb06341c8082.tar.gz gnunet-c890b76cde9288a8d9f2faa3046fbb06341c8082.zip |
towards datacache implementation
Diffstat (limited to 'src/include/gnunet_datacache_lib.h')
-rw-r--r-- | src/include/gnunet_datacache_lib.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index 64d1d4883..1ee8eb8e2 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h | |||
@@ -51,12 +51,14 @@ struct GNUNET_DATACACHE_Handle; | |||
51 | /** | 51 | /** |
52 | * Create a data cache. | 52 | * Create a data cache. |
53 | * | 53 | * |
54 | * @param sched scheduler to use | ||
54 | * @param cfg configuration to use | 55 | * @param cfg configuration to use |
55 | * @param section section in the configuration that contains our options | 56 | * @param section section in the configuration that contains our options |
56 | * @return handle to use to access the service | 57 | * @return handle to use to access the service |
57 | */ | 58 | */ |
58 | struct GNUNET_DATACACHE_Handle * | 59 | struct GNUNET_DATACACHE_Handle * |
59 | GNUNET_DATACACHE_create (struct GNUNET_CONFIGURATION_Handle *cfg, | 60 | GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched, |
61 | struct GNUNET_CONFIGURATION_Handle *cfg, | ||
60 | const char *section); | 62 | const char *section); |
61 | 63 | ||
62 | 64 | ||
@@ -85,8 +87,9 @@ typedef void (*GNUNET_DATACACHE_Iterator) (void *cls, | |||
85 | 87 | ||
86 | 88 | ||
87 | /** | 89 | /** |
88 | * Store an item in the datastore. | 90 | * Store an item in the datacache. |
89 | * | 91 | * |
92 | * @param h handle to the datacache | ||
90 | * @param key key to store data under | 93 | * @param key key to store data under |
91 | * @param size number of bytes in data | 94 | * @param size number of bytes in data |
92 | * @param data data to store | 95 | * @param data data to store |
@@ -95,7 +98,8 @@ typedef void (*GNUNET_DATACACHE_Iterator) (void *cls, | |||
95 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) | 98 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) |
96 | */ | 99 | */ |
97 | int | 100 | int |
98 | GNUNET_DATACACHE_put (const GNUNET_HashCode * key, | 101 | GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, |
102 | const GNUNET_HashCode * key, | ||
99 | uint32_t size, | 103 | uint32_t size, |
100 | const char *data, | 104 | const char *data, |
101 | unsigned int type, | 105 | unsigned int type, |
@@ -104,8 +108,9 @@ GNUNET_DATACACHE_put (const GNUNET_HashCode * key, | |||
104 | 108 | ||
105 | /** | 109 | /** |
106 | * Iterate over the results for a particular key | 110 | * Iterate over the results for a particular key |
107 | * in the datastore. | 111 | * in the datacache. |
108 | * | 112 | * |
113 | * @param h handle to the datacache | ||
109 | * @param key what to look up | 114 | * @param key what to look up |
110 | * @param type entries of which type are relevant? | 115 | * @param type entries of which type are relevant? |
111 | * @param iter maybe NULL (to just count) | 116 | * @param iter maybe NULL (to just count) |
@@ -113,7 +118,8 @@ GNUNET_DATACACHE_put (const GNUNET_HashCode * key, | |||
113 | * @return the number of results found | 118 | * @return the number of results found |
114 | */ | 119 | */ |
115 | unsigned int | 120 | unsigned int |
116 | GNUNET_DATACACHE_get (const GNUNET_HashCode * key, | 121 | GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, |
122 | const GNUNET_HashCode * key, | ||
117 | unsigned int type, | 123 | unsigned int type, |
118 | GNUNET_DATACACHE_Iterator iter, | 124 | GNUNET_DATACACHE_Iterator iter, |
119 | void *iter_cls); | 125 | void *iter_cls); |