/* * Function : libaroma_stream_zip * Return Value: LIBAROMA_STREAMP * Descriptions: new stream from zip file */ LIBAROMA_STREAMP libaroma_stream_zip( char * zip_path, char * zpath) { if ((!zip_path) || (!zpath)) { ALOGW("libaroma_stream_zip zip_path/zpath is invalid"); return 0; } /* Init Zip */ LIBAROMA_ZIP zip = libaroma_zip(zip_path); if (!zip) { return 0; } /* Allocating Adapter */ bytep mem; int mem_sz = libaroma_zip_read(zip, &mem, zpath, 1); /* Release ZIP */ libaroma_zip_release(zip); /* not valid */ if (mem_sz == 0) { return 0; } LIBAROMA_STREAMP ret = (LIBAROMA_STREAMP) malloc(sizeof(LIBAROMA_STREAM)); ret->data = mem; ret->size = mem_sz; ret->ismmap = 0; snprintf(ret->uri, LIBAROMA_STREAM_URI_LENGTH, "zip://%s#%s", zip_path, zpath); return ret; } /* End of libaroma_stream_zip */
/* release recovery */ byte recovery_release(){ recovery_release_ui(); libaroma_wm_set_ui_thread(NULL); if (_recovery.zip){ libaroma_zip_release(_recovery.zip); _recovery.zip=NULL; } return libaroma_end(); }