/** create new diskdir handle. * wraps underlying zzip_disk_open. */ zzip__new__ ZZIP_MEM_DISK* zzip_mem_disk_fdopen(int fd) { ZZIP_DISK* disk = zzip_disk_mmap(fd); if (! disk) { perror(error[_zzip_mem_disk_fdopen_fail]); return 0; } ___ ZZIP_MEM_DISK* dir = zzip_mem_disk_new(); zzip_mem_disk_load(dir, disk); return dir; ____; }
/** create new diskdir handle. * wraps underlying zzip_disk_open. */ zzip__new__ ZZIP_MEM_DISK* zzip_mem_disk_open(char* filename) { ZZIP_DISK* disk = zzip_disk_open(filename); if (! disk) { perror(error[_zzip_mem_disk_open_fail]); return 0; } ___ ZZIP_MEM_DISK* dir = zzip_mem_disk_new(); zzip_mem_disk_load(dir, disk); return dir; ____; }
/** create new diskdir handle. * wraps underlying zzip_disk_buffer. */ zzip__new__ ZZIP_MEM_DISK * zzip_mem_disk_buffer(char *buffer, size_t buflen) { ZZIP_DISK *disk = zzip_disk_buffer(buffer, buflen); if (! disk) { perror(error[_zzip_mem_disk_buffer_fail]); return 0; } ___ ZZIP_MEM_DISK *dir = zzip_mem_disk_new(); zzip_mem_disk_load(dir, disk); return dir; ____; }