// read variable content from file, return 0 if error xml_variable_t * XSD_Variable_Load(char *filename) { xml_variable_t *document; vfsfile_t *f; if (!(f = FS_OpenVFS(filename, "rb", FS_ANY))) { return NULL; } document = (xml_variable_t *) XSD_Variable_LoadFromHandle(f, VFS_GETLEN(f)); VFS_CLOSE(f); return document; }
// read variable content from file, return 0 if error xml_variable_t * XSD_Variable_Load(char *filename) { xml_variable_t *document; #ifndef WITH_FTE_VFS FILE *f = NULL; int len; if ((len = FS_FOpenFile(filename, &f)) < 0) return NULL; document = (xml_variable_t *) XSD_Variable_LoadFromHandle(f, len); fclose(f); #else vfsfile_t *f; if (!(f = FS_OpenVFS(filename, "rb", FS_ANY))) { return NULL; } document = (xml_variable_t *) XSD_Variable_LoadFromHandle(f, VFS_GETLEN(f)); VFS_CLOSE(f); #endif return document; }