コード例 #1
0
ファイル: xml_storage.c プロジェクト: kartik0000/c-obix-tools
int xmldb_init()
{
    if (_storage != NULL)
    {
        //TODO: replace with mega log
        log_error("Storage has been already initialized!");
        return -1;
    }

    int error = ixmlDocument_createDocumentEx(&_storage);
    if (error != IXML_SUCCESS)
    {
        log_error("Unable to initialize the storage. (error %d).", error);
        return error;
    }

    // load storage contents from files:
    log_debug("Loading server storage data from files..");
    int i;
    for (i = 0; i < OBIX_STORAGE_FILES_COUNT; i++)
    {
        error = xmldb_loadFile(OBIX_STORAGE_FILES[i]);
        if (error != 0)
        {
            return error;
        }
    }

    log_debug("Storage is initialized!");
    return 0;
}
コード例 #2
0
ファイル: document.c プロジェクト: da2ce7/ixml
IXML_Document *ixmlDocument_createDocument()
{
	IXML_Document *doc = NULL;

	ixmlDocument_createDocumentEx(&doc);

	return doc;
}