3 int do_print_member( lar_archive *ar, const char *name )
7 if( (member = lar_open_member(ar, name)) != NULL )
9 write(fileno(stdout), member->data, member->length);
10 lar_close_member(member);
13 LAR_DIE("Unable to locate archive member");
18 int do_print_index( lar_archive *ar )
20 lar_index *index = ar->index;
25 lar_get_filename(ar, index, filename);
26 printf("%s\n", filename);
33 int do_require( const char *package )
39 if( (ar = lar_find_archive(package)) != NULL )
41 if( (mb = lar_find_member(ar, package)) != NULL )
43 write(fileno(stdout), mb->data, mb->length);
54 int main( int argc, const char* argv[] )
64 if( (ar = lar_open(argv[2])) != NULL )
67 stat = do_print_member(ar, argv[3]);
69 stat = do_print_index(ar);
75 LAR_DIE("Failed to open archive");
81 stat = do_require(argv[2]);
90 printf("\tlar show <archive> [<member>]\n");
91 printf("\tlar require <package>\n");