/**
 * @file
 *
 * @brief
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 */

#ifndef ELEKTRA_PLUGIN_CCODE_H
#define ELEKTRA_PLUGIN_CCODE_H

#include <kdbplugin.h>

typedef struct
{
	unsigned char encode[256];
	unsigned char decode[256];

	char escape;

	char * buf;
	size_t bufalloc;
} CCodeData;

ssize_t keySetRaw (Key * key, const void * newBinary, size_t dataSize);

void elektraCcodeEncode (Key * cur, CCodeData * h);
void elektraCcodeDecode (Key * cur, CCodeData * h);

int elektraCcodeOpen (Plugin * handle, Key * k);
int elektraCcodeClose (Plugin * handle, Key * k);
int elektraCcodeGet (Plugin * handle, KeySet * ks, Key * parentKey);
int elektraCcodeSet (Plugin * handle, KeySet * ks, Key * parentKey);

Plugin * ELEKTRA_PLUGIN_EXPORT (ccode);

#endif

/**
 * @file
 *
 * @brief
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 */

#ifndef ELEKTRA_PLUGIN_CCODE_H
#define ELEKTRA_PLUGIN_CCODE_H

#include <kdbplugin.h>

typedef struct
{
	char encode[256];
	char decode[256];

	char escape;

	char * buf;
	size_t bufalloc;
} CCodeData;

ssize_t keySetRaw (Key * key, const void * newBinary, size_t dataSize);

void elektraCcodeEncode (Key * cur, CCodeData * h);
void elektraCcodeDecode (Key * cur, CCodeData * h);

int elektraCcodeOpen (Plugin * handle, Key * k);
int elektraCcodeClose (Plugin * handle, Key * k);
int elektraCcodeGet (Plugin * handle, KeySet * ks, Key * parentKey);
int elektraCcodeSet (Plugin * handle, KeySet * ks, Key * parentKey);

Plugin * ELEKTRA_PLUGIN_EXPORT (ccode);

#endif

--- 
+++ 
@@ -13,8 +13,8 @@
 
 typedef struct
 {
-	char encode[256];
-	char decode[256];
+	unsigned char encode[256];
+	unsigned char decode[256];
 
 	char escape;
 
CCode: Use `unsigned char` for mapping
