196 |
initialize (char *argv0) |
initialize (char *argv0) |
197 |
{ |
{ |
198 |
atexit (&cleanup); |
atexit (&cleanup); |
199 |
|
progname = argv0; |
|
progname = strrchr (argv0, '/'); |
|
|
|
|
|
if (progname != NULL) |
|
|
progname++; |
|
|
else |
|
|
progname = argv0; |
|
200 |
} |
} |
201 |
|
|
202 |
static bool __attribute__ ((unused)) |
/* Create archive callback. */ |
203 |
create_archive_callback (struct uar_archive *uar __attribute__ ((unused)), |
static bool |
204 |
|
create_archive_callback (struct uar_archive *uar, |
205 |
struct uar_file *file __attribute__ ((unused)), |
struct uar_file *file __attribute__ ((unused)), |
206 |
const char *fullname __attribute__ ((unused)), |
const char *uar_name __attribute__ ((unused)), |
207 |
const char *fullpath) |
const char *fs_name, enum uar_error_level level, |
208 |
|
const char *message) |
209 |
{ |
{ |
210 |
if (!params.verbose) |
if (level == UAR_ELEVEL_NONE) |
211 |
return true; |
{ |
212 |
|
if (params.verbose) |
213 |
|
fprintf (stdout, "%s\n", fs_name); |
214 |
|
} |
215 |
|
else if (level == UAR_ELEVEL_WARNING) |
216 |
|
perr ("warning: %s: %s\n", fs_name, |
217 |
|
message != NULL ? message : uar_strerror (uar)); |
218 |
|
else if (level == UAR_ELEVEL_ERROR) |
219 |
|
perr ("error: %s: %s\n", fs_name, |
220 |
|
message != NULL ? message : uar_strerror (uar)); |
221 |
|
|
|
fprintf (stdout, "%s\n", fullpath); |
|
222 |
return true; |
return true; |
223 |
} |
} |
224 |
|
|
241 |
return; |
return; |
242 |
} |
} |
243 |
|
|
244 |
|
uar_set_create_callback (uar, &create_archive_callback); |
245 |
|
|
246 |
for (size_t i = 0; i < params.ntargets; i++) |
for (size_t i = 0; i < params.ntargets; i++) |
247 |
{ |
{ |
248 |
struct stat stinfo = { 0 }; |
struct stat stinfo = { 0 }; |
255 |
return; |
return; |
256 |
} |
} |
257 |
|
|
258 |
struct uar_file *file = uar_stream_add_entry ( |
struct uar_file *file |
259 |
uar, basename (params.rtargets[i]), params.rtargets[i], &stinfo, |
= uar_stream_add_entry (uar, basename (params.rtargets[i]), |
260 |
&create_archive_callback); |
params.rtargets[i], &stinfo); |
261 |
|
|
262 |
if (file == NULL || uar_has_error (uar)) |
if (file == NULL || uar_has_error (uar)) |
263 |
{ |
{ |