Byte - in has now valguard

FossilOrigin-Name: 7926e93ff40c6f5f6b34190ed6591339025f1a23c93469370c1fa160176571e5
This commit is contained in:
7u83@mail.ru
2018-04-25 08:43:27 +00:00
parent 98c682e7e6
commit 1f68439fa7
32 changed files with 189 additions and 112 deletions

View File

@ -4,19 +4,23 @@
#include "log.h"
#include "dbg.h"
cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *type,
cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *type,
const void * valguard,
const uint8_t * data, int len)
{
cw_KTV_t mdata, *mresult;
int exists;
mdata.key=cw_strdup(key);
mdata.valguard=valguard;
if (!mdata.key){
cw_log(LOG_ERR, "Can't allocate memory for KTV key %s: %s",
key,strerror(errno));
return NULL;
}
mresult = type->get(&mdata,data,len);
if (!mresult){
cw_log(LOG_ERR, "Can't create kvstore element for key %s of type %s: %s",