3 #include <libbb/libbb.h>
8 * gcc -o opkg_extract_test opkg_extract_test.c -I./busybox-0.60.2/libbb -L./busybox-0.60.2 -lbb
11 const char *applet_name
;
13 int main(int argc
, char *argv
[])
16 * see libbb.h and let your imagination run wild
17 * or, set the last item below to extract_one_to_buffer, and you get the control file in
19 * or, set the last one to extract_all_to_fs, and, well, guess what happens
22 /* enum extract_functions_e dowhat = extract_control_tar_gz | extract_unconditional | extract_one_to_buffer; */
23 enum extract_functions_e dowhat
=
24 extract_control_tar_gz
| extract_all_to_fs
| extract_preserve_date
;
30 fprintf(stderr
, "syntax: %s <opkg file> [<file_to_extract>]\n",
41 returned
= deb_extract(argv
[1], stdout
, dowhat
, NULL
, filename
, &err
);
44 fprintf(stderr
, "returned %s\n", returned
);
46 fprintf(stderr
, "extract returned nuthin'\n");