示例#1
0
文件: Json.c 项目: doly/minikonoha
kbool_t LoadJsonModule(KonohaFactory *factory, ModuleType type)
{
	static KModuleInfo ModuleInfo = {
		"Json", "0.1", 0, "json",
	};
	factory->JsonDataInfo            = &ModuleInfo;
	factory->IsJsonType             = IsJsonType;
	factory->CreateJson             = CreateJson;
	factory->ParseJson              = ParseJson;
	factory->FreeJson               = FreeJson;
	factory->JsonToNewText          = JsonToNewText;
	factory->DoJsonEach             = DoJsonEach;
	factory->RetrieveJsonKeyValue   = RetrieveJsonKeyValue;
	factory->SetJsonKeyValue        = SetJsonKeyValue;
	factory->SetJsonValue           = SetJsonValue;
	factory->GetJsonBoolean         = GetJsonBoolean;
	factory->GetJsonInt             = GetJsonInt;
	factory->GetJsonFloat           = GetJsonFloat;
	factory->GetJsonText            = GetJsonText;
	factory->GetJsonSize            = GetJsonSize;
	factory->RetrieveJsonArrayAt = RetrieveJsonArrayAt;
	factory->SetJsonArrayAt      = SetJsonArrayAt;
	factory->AppendJsonArray        = AppendJsonArray;

	factory->JsonHandler            = (JSONMemoryPool *) malloc(sizeof(JSONMemoryPool));
	JSONMemoryPool_Init((JSONMemoryPool *)factory->JsonHandler);
	return true;
}
示例#2
0
文件: Json.c 项目: stadaki/konoha3
// -------------------------------------------------------------------------
static void InitJsonContext(KonohaContext *kctx)
{
	KonohaFactory *factory = (KonohaFactory *) kctx->platApi;
	JSONMemoryPool *mp = (JSONMemoryPool *) malloc(sizeof(JSONMemoryPool));
	JSONMemoryPool_Init(mp);
	factory->JsonModule.JsonHandler = (void *) mp;
}