//-- Crawl Zip AZREADDIRP az_readdir(char * path) { int pathlen = strlen(path); char * pbuf = malloc(pathlen + 1); memset(pbuf, 0, pathlen + 1); AARRAYP res = aarray_create(); int i; for (i = 0; i < zip.numEntries; i++) { ZipEntry * ze = &zip.pEntries[i]; if (ze->fileNameLen > pathlen) { memcpy(pbuf, ze->fileName, pathlen); if (strcmp(pbuf, path) == 0) { int fl = ze->fileNameLen - pathlen + 1; char * fn = malloc(fl); memset(fn, 0, fl); int j; byte t = 0; for (j = pathlen; j < ze->fileNameLen; j++) { if (ze->fileName[j] == '/') { t = 1; break; } fn[j - pathlen] = ze->fileName[j]; } fn[j - pathlen] = 0; aarray_set(res, fn, (t ? "1" : "0")); free(fn); } } } AZREADDIRP ret = NULL; if (res->length > 0) { ret = malloc(sizeof(AZREADDIR)); ret->n = res->length; ret->f = malloc(sizeof(char *)*ret->n); ret->t = malloc(sizeof(byte) * ret->n); for (i = 0; i < res->length; i++) { ret->t[i] = (strcmp(res->items[i].val, "1") == 0) ? 1 : 0; ret->f[i] = strdup(res->items[i].key); } } aarray_free(res); return ret; }
void aui_cfg_release() { if (aui_cfg_array != NULL) { aarray_free(aui_cfg_array); } }
//* //* Release Loaded Language //* void alang_release(){ if (alang!=NULL){ aarray_free(alang); alang=NULL; } }
void alangd_release(){ if (aui_deflang!=NULL){ aarray_free(aui_deflang); aui_deflang=NULL; } }