WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
/**
* @file datastore/plugin_datastore_template.c
/**
* Context for all functions in this plugin.
*/
-struct Plugin
-{
+struct Plugin {
/**
* Our execution environment.
*/
* @return number of bytes used on disk
*/
static void
-template_plugin_estimate_size (void *cls, unsigned long long *estimate)
+template_plugin_estimate_size(void *cls, unsigned long long *estimate)
{
if (NULL == estimate)
return;
- GNUNET_break (0);
+ GNUNET_break(0);
*estimate = 0;
}
* @param cont_cls continuation closure
*/
static void
-template_plugin_put (void *cls,
- const struct GNUNET_HashCode *key,
- bool absent,
- uint32_t size,
- const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
- uint32_t anonymity,
- uint32_t replication,
- struct GNUNET_TIME_Absolute expiration,
- PluginPutCont cont,
- void *cont_cls)
+template_plugin_put(void *cls,
+ const struct GNUNET_HashCode *key,
+ bool absent,
+ uint32_t size,
+ const void *data,
+ enum GNUNET_BLOCK_Type type,
+ uint32_t priority,
+ uint32_t anonymity,
+ uint32_t replication,
+ struct GNUNET_TIME_Absolute expiration,
+ PluginPutCont cont,
+ void *cont_cls)
{
- GNUNET_break (0);
- cont (cont_cls, key, size, GNUNET_SYSERR, "not implemented");
+ GNUNET_break(0);
+ cont(cont_cls, key, size, GNUNET_SYSERR, "not implemented");
}
* @param proc_cls closure for proc
*/
static void
-template_plugin_get_key (void *cls,
- uint64_t next_uid,
- bool random,
- const struct GNUNET_HashCode *key,
- enum GNUNET_BLOCK_Type type,
- PluginDatumProcessor proc,
- void *proc_cls)
+template_plugin_get_key(void *cls,
+ uint64_t next_uid,
+ bool random,
+ const struct GNUNET_HashCode *key,
+ enum GNUNET_BLOCK_Type type,
+ PluginDatumProcessor proc,
+ void *proc_cls)
{
- GNUNET_break (0);
+ GNUNET_break(0);
}
* @param proc_cls closure for proc
*/
static void
-template_plugin_get_replication (void *cls, PluginDatumProcessor proc,
- void *proc_cls)
+template_plugin_get_replication(void *cls, PluginDatumProcessor proc,
+ void *proc_cls)
{
- GNUNET_break (0);
+ GNUNET_break(0);
}
* @param proc_cls closure for proc
*/
static void
-template_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
- void *proc_cls)
+template_plugin_get_expiration(void *cls, PluginDatumProcessor proc,
+ void *proc_cls)
{
- GNUNET_break (0);
+ GNUNET_break(0);
}
* @param proc_cls closure for proc
*/
static void
-template_plugin_get_zero_anonymity (void *cls, uint64_t next_uid,
- enum GNUNET_BLOCK_Type type,
- PluginDatumProcessor proc, void *proc_cls)
+template_plugin_get_zero_anonymity(void *cls, uint64_t next_uid,
+ enum GNUNET_BLOCK_Type type,
+ PluginDatumProcessor proc, void *proc_cls)
{
- GNUNET_break (0);
+ GNUNET_break(0);
}
* Drop database.
*/
static void
-template_plugin_drop (void *cls)
+template_plugin_drop(void *cls)
{
- GNUNET_break (0);
+ GNUNET_break(0);
}
* @param proc_cls closure for proc
*/
static void
-template_get_keys (void *cls,
- PluginKeyProcessor proc,
- void *proc_cls)
+template_get_keys(void *cls,
+ PluginKeyProcessor proc,
+ void *proc_cls)
{
- proc (proc_cls, NULL, 0);
+ proc(proc_cls, NULL, 0);
}
* @param cont_cls continuation closure for @a cont
*/
static void
-template_plugin_remove_key (void *cls,
- const struct GNUNET_HashCode *key,
- uint32_t size,
- const void *data,
- PluginRemoveCont cont,
- void *cont_cls)
+template_plugin_remove_key(void *cls,
+ const struct GNUNET_HashCode *key,
+ uint32_t size,
+ const void *data,
+ PluginRemoveCont cont,
+ void *cont_cls)
{
- GNUNET_break (0);
- cont (cont_cls, key, size, GNUNET_SYSERR, "not implemented");
+ GNUNET_break(0);
+ cont(cont_cls, key, size, GNUNET_SYSERR, "not implemented");
}
* @return our "struct Plugin*"
*/
void *
-libgnunet_plugin_datastore_template_init (void *cls)
+libgnunet_plugin_datastore_template_init(void *cls)
{
struct GNUNET_DATASTORE_PluginEnvironment *env = cls;
struct GNUNET_DATASTORE_PluginFunctions *api;
struct Plugin *plugin;
- plugin = GNUNET_new (struct Plugin);
+ plugin = GNUNET_new(struct Plugin);
plugin->env = env;
- api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions);
+ api = GNUNET_new(struct GNUNET_DATASTORE_PluginFunctions);
api->cls = plugin;
api->estimate_size = &template_plugin_estimate_size;
api->put = &template_plugin_put;
api->drop = &template_plugin_drop;
api->get_keys = &template_get_keys;
api->remove_key = &template_plugin_remove_key;
- GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, "template",
- _("Template database running\n"));
+ GNUNET_log_from(GNUNET_ERROR_TYPE_INFO, "template",
+ _("Template database running\n"));
return api;
}
* @return always NULL
*/
void *
-libgnunet_plugin_datastore_template_done (void *cls)
+libgnunet_plugin_datastore_template_done(void *cls)
{
struct GNUNET_DATASTORE_PluginFunctions *api = cls;
struct Plugin *plugin = api->cls;
- GNUNET_free (plugin);
- GNUNET_free (api);
+ GNUNET_free(plugin);
+ GNUNET_free(api);
return NULL;
}