aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-22 03:00:21 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-22 03:00:21 +0000
commita6aa66af589d62391abad0e95ccc747f69f1ad1f (patch)
tree8f1a6c2a69cc880a7a15c35ab426359ad53f5f61 /libbb
parentf4a999e9f2af0a3171d2747eb1e6fecddf5bbce3 (diff)
downloadbusybox-w32-a6aa66af589d62391abad0e95ccc747f69f1ad1f.tar.gz
busybox-w32-a6aa66af589d62391abad0e95ccc747f69f1ad1f.tar.bz2
busybox-w32-a6aa66af589d62391abad0e95ccc747f69f1ad1f.zip
Fix the build process so it does not do the evil #ifdef BB_FOO stuff.
Build exactly one .o file per function, and let the linker throw away the junk it doesn't want. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2882 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/unarchive.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c
index 199123ec4..635dcae35 100644
--- a/libbb/unarchive.c
+++ b/libbb/unarchive.c
@@ -38,8 +38,19 @@ typedef struct file_headers_s {
38 dev_t device; 38 dev_t device;
39} file_header_t; 39} file_header_t;
40 40
41
42extern void seek_sub_file(FILE *src_stream, const int count);
43extern char *extract_archive(FILE *src_stream, FILE *out_stream, const file_header_t *file_entry,
44 const int function, const char *prefix);
45
46
47#ifdef L_archive_offset
41off_t archive_offset; 48off_t archive_offset;
49#else
50extern off_t archive_offset;
51#endif
42 52
53#ifdef L_seek_sub_file
43void seek_sub_file(FILE *src_stream, const int count) 54void seek_sub_file(FILE *src_stream, const int count)
44{ 55{
45 int i; 56 int i;
@@ -52,8 +63,11 @@ void seek_sub_file(FILE *src_stream, const int count)
52 } 63 }
53 return; 64 return;
54} 65}
66#endif
55 67
56 68
69
70#ifdef L_extract_archive
57/* Extract the data postioned at src_stream to either filesystem, stdout or 71/* Extract the data postioned at src_stream to either filesystem, stdout or
58 * buffer depending on the value of 'function' which is defined in libbb.h 72 * buffer depending on the value of 'function' which is defined in libbb.h
59 * 73 *
@@ -202,7 +216,9 @@ char *extract_archive(FILE *src_stream, FILE *out_stream, const file_header_t *f
202 216
203 return(NULL); /* Maybe we should say if failed */ 217 return(NULL); /* Maybe we should say if failed */
204} 218}
219#endif
205 220
221#ifdef L_unarchive
206char *unarchive(FILE *src_stream, void *(*get_headers)(FILE *), 222char *unarchive(FILE *src_stream, void *(*get_headers)(FILE *),
207 const int extract_function, const char *prefix, char **extract_names) 223 const int extract_function, const char *prefix, char **extract_names)
208{ 224{
@@ -233,8 +249,9 @@ char *unarchive(FILE *src_stream, void *(*get_headers)(FILE *),
233 } 249 }
234 return(buffer); 250 return(buffer);
235} 251}
252#endif
236 253
237#if defined BB_AR || defined BB_DPKG_DEB || defined BB_DPKG 254#ifdef L_get_header_ar
238void *get_header_ar(FILE *src_stream) 255void *get_header_ar(FILE *src_stream)
239{ 256{
240 file_header_t *typed; 257 file_header_t *typed;
@@ -317,7 +334,7 @@ void *get_header_ar(FILE *src_stream)
317} 334}
318#endif 335#endif
319 336
320#if defined BB_CPIO 337#ifdef L_get_header_cpio
321void *get_header_cpio(FILE *src_stream) 338void *get_header_cpio(FILE *src_stream)
322{ 339{
323 file_header_t *cpio_entry = NULL; 340 file_header_t *cpio_entry = NULL;
@@ -378,7 +395,7 @@ void *get_header_cpio(FILE *src_stream)
378} 395}
379#endif 396#endif
380 397
381#if defined BB_UNTAR || defined BB_DPKG_DEB || defined BB_DPKG 398#ifdef L_get_header_tar
382void *get_header_tar(FILE *tar_stream) 399void *get_header_tar(FILE *tar_stream)
383{ 400{
384 union { 401 union {
@@ -455,7 +472,7 @@ void *get_header_tar(FILE *tar_stream)
455} 472}
456#endif 473#endif
457 474
458#if defined BB_DPKG || defined BB_DPKG_DEB 475#ifdef L_deb_extract
459char *deb_extract(const char *package_filename, FILE *out_stream, const int extract_function, 476char *deb_extract(const char *package_filename, FILE *out_stream, const int extract_function,
460 const char *prefix, const char *filename) 477 const char *prefix, const char *filename)
461{ 478{