-extern int dpkg_deb_main(int argc, char **argv)
-{
- const int dpkg_deb_contents = 1;
- const int dpkg_deb_control = 2;
-// const int dpkg_deb_info = 4;
- const int dpkg_deb_extract = 8;
- const int dpkg_deb_verbose_extract = 16;
- int opt=0;
- int optflag=0;
- int extract_flag = FALSE;
- int list_flag = FALSE;
- int verbose_flag = FALSE;
- int extract_to_stdout = FALSE;
- char ar_filename[15];
- int srcFd=0;
- int status=0;
- ar_headers_t *ar_headers = NULL;
- char **extract_list=NULL;
- char *target_dir=NULL;
-
- while ((opt = getopt(argc, argv, "cexX")) != -1) {
- switch (opt) {
- case 'c':
- optflag |= dpkg_deb_contents;
- break;
- case 'e':
- optflag |= dpkg_deb_control;
- break;
-/* case 'I':
- optflag |= dpkg_deb_info;
- break;
-*/
- case 'x':
- optflag |= dpkg_deb_extract;
- break;
- case 'X':
- optflag |= dpkg_deb_verbose_extract;
- break;
- default:
- usage(dpkg_deb_usage);
- return EXIT_FAILURE;
- }
- }
+ /* Setup an ar archive handle that refers to the gzip sub archive */
+ ar_archive = init_handle();
+ ar_archive->sub_archive = tar_archive;
+ ar_archive->filter = filter_accept_list_reassign;