#endif
#include <features.h>
-/* Stupid libc doesn't have a reliable way for use to know
- * that libc5 is being used. Assume this is good enough */
-#if ! defined __GLIBC__ && ! defined __UCLIBC__
+
+#if __GNU_LIBRARY__ < 5
/* libc5 doesn't define socklen_t */
typedef unsigned int socklen_t;
/* libc5 doesn't implement BSD 4.4 daemon() */
#define BUF_SIZE 8192
#define EXPAND_ALLOC 1024
-static inline int is_decimal(ch) { return ((ch >= '0') && (ch <= '9')); }
-static inline int is_octal(ch) { return ((ch >= '0') && (ch <= '7')); }
+static inline int is_decimal(int ch) { return ((ch >= '0') && (ch <= '9')); }
+static inline int is_octal(int ch) { return ((ch >= '0') && (ch <= '7')); }
/* Macros for min/max. */
#ifndef MIN
void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name);
void reset_ino_dev_hashtable(void);
-int copy_file(const char *srcName, const char *destName,
- int setModes, int followLinks, int forceFlag);
-int copy_file_chunk(int srcFd, int dstFd, off_t remaining);
+int copy_file(const char *src_name, const char *dst_name,
+ int set_modes, int follow_links, int force_flag, int quiet_flag);
+int copy_file_chunk(FILE *src_file, FILE *dst_file, unsigned long long chunksize);
char *buildName(const char *dirName, const char *fileName);
int makeString(int argc, const char **argv, char *buf, int bufLen);
char *getChunk(int size);
char *xgetcwd(char *cwd);
char *concat_path_file(const char *path, const char *filename);
+typedef struct ar_headers_s {
+ char *name;
+ off_t size;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;
+ time_t mtime;
+ off_t offset;
+ struct ar_headers_s *next;
+} ar_headers_t;
+extern ar_headers_t *get_ar_headers(FILE *in_file);
+extern int seek_ared_file(FILE *in_file, ar_headers_t *headers, const char *tar_gz_file);
+
+typedef enum extract_function_e {
+ extract_contents = 1,
+ extract_control = 2,
+ extract_info = 4,
+ extract_extract = 8,
+ extract_verbose_extract = 16,
+ extract_list = 32,
+ extract_fsys_tarfile = 64,
+ extract_field = 128,
+ extract_contents_to_file = 256
+} extract_function_t;
+extern char *deb_extract(const char *package_filename, const int function,
+ const char *argument, const char *argument2);
+extern char *untar(FILE *src_tar_file, FILE *output, const int untar_function,
+ const char *argument, const char *file_prefix);
+extern char *read_text_file_to_buffer(FILE *src_file);
+extern char *read_package_field(const char *package_buffer);
+
+extern int unzip(FILE *l_in_file, FILE *l_out_file);
+extern void gz_close(int gunzip_pid);
+extern int gz_open(FILE *compressed_file, int *pid);
+
+#define CT_AUTO 0
+#define CT_UNIX2DOS 1
+#define CT_DOS2UNIX 2
+/* extern int convert(char *fn, int ConvType); */
+
#endif /* __LIBBB_H__ */