void e_exit(int ec) { (void) set_ec(ec); do_exit(); }
void do_files(int i, int argc, char *argv[]) { if (opt->verbose >= 1) { show_head(); UiPacker::uiHeader(); } for ( ; i < argc; i++) { infoHeader(); const char *iname = argv[i]; char oname[ACC_FN_PATH_MAX+1]; oname[0] = 0; try { do_one_file(iname,oname); } catch (const Exception &e) { unlink_ofile(oname); if (opt->verbose >= 1 || (opt->verbose >= 0 && !e.isWarning())) printErr(iname,&e); set_ec(e.isWarning() ? EXIT_WARN : EXIT_ERROR); } catch (const Error &e) { unlink_ofile(oname); printErr(iname,&e); e_exit(EXIT_ERROR); } catch (std::bad_alloc *e) { unlink_ofile(oname); printErr(iname,"out of memory"); UNUSED(e); //delete e; e_exit(EXIT_ERROR); } catch (const std::bad_alloc &) { unlink_ofile(oname); printErr(iname,"out of memory"); e_exit(EXIT_ERROR); } catch (std::exception *e) { unlink_ofile(oname); printUnhandledException(iname,e); //delete e; e_exit(EXIT_ERROR); } catch (const std::exception &e) { unlink_ofile(oname); printUnhandledException(iname,&e); e_exit(EXIT_ERROR); } catch (...) { unlink_ofile(oname); printUnhandledException(iname,NULL); e_exit(EXIT_ERROR); } } if (opt->cmd == CMD_COMPRESS) UiPacker::uiPackTotal(); else if (opt->cmd == CMD_DECOMPRESS) UiPacker::uiUnpackTotal(); else if (opt->cmd == CMD_LIST) UiPacker::uiListTotal(); else if (opt->cmd == CMD_TEST) UiPacker::uiTestTotal(); else if (opt->cmd == CMD_FILEINFO) UiPacker::uiFileInfoTotal(); }