void init_dfiles(void) { int i = 0; while(i < sizeof(dfile_hardload) / sizeof(dfile_hardload[0])) { if(dfile_create(dfile_hardload[i].name, dfile_hardload[i].path, dfile_hardload[i].flags, 1) < 0) vmlog(7, "init_dfiles: error loading `%s'\n", dfile_hardload[i].path); else vmlog(0, "init_dfiles: successfully loaded `%s'\n", dfile_hardload[i].path); i++; } return; }
/* CREATE * ------------------------------------------------------------------------- */ struct gstor_create_ret gstor_create(const char * name) { struct gstor_create_ret ret; string_t petri_filename = string_concat(name,".petri",0); if (INVALID_STR(petri_filename)) goto error; string_t dfile_filename = string_concat(name,".dfile",0); if (INVALID_STR(dfile_filename)) goto error; if (petri_create(string_tochar(petri_filename))!=0) goto error; if (dfile_create(string_tochar(dfile_filename))!=0) goto error; string_destroy(petri_filename); string_destroy(dfile_filename); return ret.result = GSTOR_OKAY, ret; error: return ret.result = GSTOR_ERROR, ret; }