MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / do_extract

Function do_extract

common/minizip/miniunz.c:475–509  ·  view source on GitHub ↗
(uf,opt_extract_without_path,opt_overwrite,password)

Source from the content-addressed store, hash-verified

473
474
475int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
476 unzFile uf;
477 int opt_extract_without_path;
478 int opt_overwrite;
479 const char* password;
480{
481 uLong i;
482 unz_global_info64 gi;
483 int err;
484 FILE* fout=NULL;
485
486 err = unzGetGlobalInfo64(uf,&gi);
487 if (err!=UNZ_OK)
488 printf("error %d with zipfile in unzGetGlobalInfo \n",err);
489
490 for (i=0;i<gi.number_entry;i++)
491 {
492 if (do_extract_currentfile(uf,&opt_extract_without_path,
493 &opt_overwrite,
494 password) != UNZ_OK)
495 break;
496
497 if ((i+1)<gi.number_entry)
498 {
499 err = unzGoToNextFile(uf);
500 if (err!=UNZ_OK)
501 {
502 printf("error %d with zipfile in unzGoToNextFile\n",err);
503 break;
504 }
505 }
506 }
507
508 return 0;
509}
510
511int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
512 unzFile uf;

Callers 1

mainFunction · 0.85

Calls 3

unzGetGlobalInfo64Function · 0.85
do_extract_currentfileFunction · 0.85
unzGoToNextFileFunction · 0.85

Tested by

no test coverage detected