Skip to content

Commit

Permalink
unify naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Raab committed Jun 22, 2010
1 parent cd8a72b commit 062e017
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
35 changes: 20 additions & 15 deletions src/plugins/template/template.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
template.c - Skeleton of a plugin to be copied
template.c - Skeleton of a plugin
-------------------
begin : Fri May 21 2010
copyright : (C) 2010 by Markus Raab
Expand All @@ -13,42 +13,47 @@
* *
***************************************************************************/



/***************************************************************************
* *
* This is the skeleton of the methods you'll have to implement in order *
* to provide libelektra.so a valid plugin. *
* Simple fill the empty _template functions with your code and you are *
* to provide a valid plugin. *
* Simple fill the empty functions with your code and you are *
* ready to go. *
* *
***************************************************************************/


#include "template.h"

int kdbOpen_template(Plugin *handle, Key *errorKey)
int elektraTemplateOpen(Plugin *handle, Key *errorKey)
{
/* plugin initialization logic */

return 0; /* success */
return 1; /* success */
}

int kdbClose_template(Plugin *handle, Key *errorKey)
int elektraTemplateClose(Plugin *handle, Key *errorKey)
{
/* free all plugin resources and shut it down */

return 0; /* success */
return 1; /* success */
}

int kdbGet_template(Plugin *handle, KeySet *returned, Key *parentKey)
int elektraTemplateGet(Plugin *handle, KeySet *returned, Key *parentKey)
{
/* get all keys */

return 1; /* success */
}

int kdbSet_template(Plugin *handle, KeySet *returned, Key *parentKey)
int elektraTemplateSet(Plugin *handle, KeySet *returned, Key *parentKey)
{
/* set all keys */

return 1; /* success */
}

int elektraTemplateError(Plugin *handle, KeySet *returned, Key *parentKey)
{
/* set all keys */

Expand All @@ -58,10 +63,10 @@ int kdbSet_template(Plugin *handle, KeySet *returned, Key *parentKey)
Plugin *ELEKTRA_PLUGIN_EXPORT(template)
{
return elektraPluginExport("template",
ELEKTRA_PLUGIN_OPEN, &kdbOpen_template,
ELEKTRA_PLUGIN_CLOSE, &kdbClose_template,
ELEKTRA_PLUGIN_GET, &kdbGet_template,
ELEKTRA_PLUGIN_SET, &kdbSet_template,
ELEKTRA_PLUGIN_OPEN, &elektraTemplateOpen,
ELEKTRA_PLUGIN_CLOSE, &elektraTemplateClose,
ELEKTRA_PLUGIN_GET, &elektraTemplateGet,
ELEKTRA_PLUGIN_SET, &elektraTemplateSet,
ELEKTRA_PLUGIN_END);
}

24 changes: 12 additions & 12 deletions src/plugins/template/template.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
template.h - Skeleton of backends to access the Key Database
template.c - Skeleton of a plugin
-------------------
begin : Fri May 21 2010
copyright : (C) 2010 by Markus Raab
Expand All @@ -13,28 +13,28 @@
* *
***************************************************************************/



/***************************************************************************
* *
* This is the skeleton of the methods you'll have to implement in order *
* to provide libelektra.so a valid plugin. *
* Replace all occurences of "template" with your plugin name. *
* Simple fill the empty template functions with your code and you are *
* to provide a valid plugin. *
* Simple fill the empty functions with your code and you are *
* ready to go. *
* *
***************************************************************************/

#ifndef ELEKTRA_PLUGIN_template_H
#define ELEKTRA_PLUGIN_template_H

#ifndef ELEKTRA_PLUGIN_TEMPLATE_H
#define ELEKTRA_PLUGIN_TEMPLATE_H

#include <kdbplugin.h>


int kdbOpen_template(Plugin *handle, Key *errorKey);
int kdbClose_template(Plugin *handle, Key *errorKey);
int kdbGet_template(Plugin *handle, KeySet *ks, Key *parentKey);
int kdbSet_template(Plugin *handle, KeySet *ks, Key *parentKey);
int elektraTemplateOpen(Plugin *handle, Key *errorKey);
int elektraTemplateClose(Plugin *handle, Key *errorKey);
int elektraTemplateGet(Plugin *handle, KeySet *ks, Key *parentKey);
int elektraTemplateSet(Plugin *handle, KeySet *ks, Key *parentKey);
int elektraTemplateError(Plugin *handle, KeySet *ks, Key *parentKey);

Plugin *ELEKTRA_PLUGIN_EXPORT(template);

#endif

0 comments on commit 062e017

Please sign in to comment.