int main(int argc, char** args) { int rc = -1; log4c_init(); if (argc <= 1) { help(argc, args); return 1; } if (!parse_opt(argc, args)) { help(argc, args); return 1; } if (flag_help) { help(argc, args); return 0; } if (optind < argc) { GError *local_error = NULL; int i; for (i = optind; i < argc; i++) { /* Sanity check */ PRINT_DEBUG("Going to work with chunk file [%s]\n", args[i]); /* Run decompression */ if(uncompress_chunk2(args[i], preserve, keep_pending, &local_error) != 1) { if(local_error) PRINT_ERROR("Failed to uncompress chunk [%s] :\n %s", args[i], local_error->message); else PRINT_ERROR("Failed to uncompress chunk [%s] : no error\n",args[i]); if (keep_pending) PRINT_DEBUG("%s.pending file kept\n", args[i]); } else { PRINT_DEBUG("Chunk [%s] uncompressed\n",args[i]); } } } return rc; }
int uncompress_chunk(const gchar* path, gboolean preserve, GError ** error) { return uncompress_chunk2(path, preserve, FALSE, error); }