summaryrefslogtreecommitdiff
path: root/package/cfgfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'package/cfgfs/src')
-rw-r--r--package/cfgfs/src/compress.c2
-rw-r--r--package/cfgfs/src/compress.h4
-rw-r--r--package/cfgfs/src/defs.h7
-rw-r--r--package/cfgfs/src/ft_creat.c2
-rw-r--r--package/cfgfs/src/fts.c34
-rw-r--r--package/cfgfs/src/fts_gnu.h4
-rw-r--r--package/cfgfs/src/fts_subs.c2
-rw-r--r--package/cfgfs/src/fts_subs.h2
-rw-r--r--package/cfgfs/src/minilzop.h2
-rw-r--r--package/cfgfs/src/pack.h2
-rw-r--r--package/cfgfs/src/sys_linux.c7
-rw-r--r--package/cfgfs/src/sysdeps.h2
-rw-r--r--package/cfgfs/src/tool.c2
-rw-r--r--package/cfgfs/src/unwraps.c6
-rw-r--r--package/cfgfs/src/wraps.c4
15 files changed, 25 insertions, 57 deletions
diff --git a/package/cfgfs/src/compress.c b/package/cfgfs/src/compress.c
index b75959c4e..efec3ef8c 100644
--- a/package/cfgfs/src/compress.c
+++ b/package/cfgfs/src/compress.c
@@ -28,8 +28,6 @@
#include "defs.h"
#include "compress.h"
-__RCSID("$MirOS: contrib/hosted/fwcf/compress.c,v 1.7 2006/09/23 23:46:35 tg Exp $");
-
static void compress_initialise(void);
static fwcf_compressor *fwcf_compressors = NULL;
diff --git a/package/cfgfs/src/compress.h b/package/cfgfs/src/compress.h
index c421aca5c..c0f92380b 100644
--- a/package/cfgfs/src/compress.h
+++ b/package/cfgfs/src/compress.h
@@ -31,14 +31,11 @@ typedef struct FWCF_COMPRESSOR {
uint8_t code;
} fwcf_compressor;
-__BEGIN_DECLS
/* 0=success 1=EINVAL 2=slot already used */
int compress_register(fwcf_compressor *);
-__END_DECLS
/* END of plug-in API description, version 1.0 */
-__BEGIN_DECLS
/* low-level */
fwcf_compressor *compress_enumerate(void);
int compress_list(void);
@@ -47,6 +44,5 @@ int compress_list(void);
fwcf_compressor *compressor_get(uint8_t);
int compressor_getbyname(const char *);
int list_compressors(void);
-__END_DECLS
#endif
diff --git a/package/cfgfs/src/defs.h b/package/cfgfs/src/defs.h
index b19046a27..c099ffb5a 100644
--- a/package/cfgfs/src/defs.h
+++ b/package/cfgfs/src/defs.h
@@ -18,13 +18,6 @@
#define __RCSID(x) static const char __rcsid[] __attribute__((used)) = (x)
#endif
-#ifndef BSD
-#define uint8_t u_int8_t
-#define uint16_t u_int16_t
-#define uint32_t u_int32_t
-#define uint64_t u_int64_t
-#endif
-
#ifndef __dead
#define __dead __attribute__((noreturn))
#endif
diff --git a/package/cfgfs/src/ft_creat.c b/package/cfgfs/src/ft_creat.c
index 5838f8647..e9424e159 100644
--- a/package/cfgfs/src/ft_creat.c
+++ b/package/cfgfs/src/ft_creat.c
@@ -221,7 +221,7 @@ make_file(char *n, uint8_t *buf, size_t len)
}
if ((size_t)write(fd, buf, len) != len)
- warn("could not write %lu bytes", (u_long)len);
+ warn("could not write %lu bytes", (unsigned long)len);
if (close(fd))
warn("close");
diff --git a/package/cfgfs/src/fts.c b/package/cfgfs/src/fts.c
index e271ed538..02d4bfea8 100644
--- a/package/cfgfs/src/fts.c
+++ b/package/cfgfs/src/fts.c
@@ -52,8 +52,6 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#include "defs.h"
-__RCSID("$MirOS: contrib/hosted/fwcf/fts.c,v 1.3 2007/07/02 14:50:21 tg Exp $");
-
#define internal_function
/* Largest alignment size needed, minus one.
@@ -67,15 +65,15 @@ __RCSID("$MirOS: contrib/hosted/fwcf/fts.c,v 1.3 2007/07/02 14:50:21 tg Exp $");
#endif
-static FTSENT *fts_alloc __P((FTS *, const char *, int)) internal_function;
-static FTSENT *fts_build __P((FTS *, int)) internal_function;
-static void fts_lfree __P((FTSENT *)) internal_function;
-static void fts_load __P((FTS *, FTSENT *)) internal_function;
-static size_t fts_maxarglen __P((char * const *)) internal_function;
-static void fts_padjust __P((FTS *, FTSENT *)) internal_function;
-static int fts_palloc __P((FTS *, size_t)) internal_function;
-static FTSENT *fts_sort __P((FTS *, FTSENT *, int)) internal_function;
-static u_short fts_stat __P((FTS *, FTSENT *, int)) internal_function;
+static FTSENT *fts_alloc (FTS *, const char *, int) internal_function;
+static FTSENT *fts_build (FTS *, int) internal_function;
+static void fts_lfree (FTSENT *) internal_function;
+static void fts_load (FTS *, FTSENT *) internal_function;
+static size_t fts_maxarglen (char * const *) internal_function;
+static void fts_padjust (FTS *, FTSENT *) internal_function;
+static int fts_palloc (FTS *, size_t) internal_function;
+static FTSENT *fts_sort (FTS *, FTSENT *, int) internal_function;
+static u_short fts_stat (FTS *, FTSENT *, int) internal_function;
static int fts_safe_changedir(FTS *, FTSENT *, int, char *);
#ifndef MAX
@@ -101,7 +99,7 @@ FTS *
fts_open(argv, options, compar)
char * const *argv;
register int options;
- int (*compar) __P((const FTSENT **, const FTSENT **));
+ int (*compar) (const FTSENT **, const FTSENT **);
{
register FTS *sp;
register FTSENT *p, *root;
@@ -119,7 +117,7 @@ fts_open(argv, options, compar)
if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
return (NULL);
memset(sp, 0, sizeof(FTS));
- sp->fts_compar = (int (*) __P((const void *, const void *))) compar;
+ sp->fts_compar = (int (*) (const void *, const void *)) compar;
sp->fts_options = options;
/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
@@ -694,11 +692,11 @@ fts_build(sp, type)
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
continue;
- if ((p = fts_alloc(sp, dp->d_name, (int)_D_EXACT_NAMLEN (dp))) == NULL)
+ if ((p = fts_alloc(sp, dp->d_name, (int)strlen(dp->d_name))) == NULL)
goto mem1;
- if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
+ if (strlen(dp->d_name) >= maxlen) {/* include space for NUL */
oldaddr = sp->fts_path;
- if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
+ if (fts_palloc(sp, strlen(dp->d_name) + len + 1)) {
/*
* No more memory for path or structures. Save
* errno, free up the current structure and the
@@ -723,7 +721,7 @@ mem1: saved_errno = errno;
maxlen = sp->fts_pathlen - len;
}
- if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
+ if (len + strlen(dp->d_name) >= USHRT_MAX) {
/*
* In an FTSENT, fts_pathlen is a u_short so it is
* possible to wraparound here. If we do, free up
@@ -740,7 +738,7 @@ mem1: saved_errno = errno;
}
p->fts_level = level;
p->fts_parent = sp->fts_cur;
- p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
+ p->fts_pathlen = len + strlen(dp->d_name);
#if defined FTS_WHITEOUT && 0
if (dp->d_type == DT_WHT)
diff --git a/package/cfgfs/src/fts_gnu.h b/package/cfgfs/src/fts_gnu.h
index 08d45a085..9cc6d4d38 100644
--- a/package/cfgfs/src/fts_gnu.h
+++ b/package/cfgfs/src/fts_gnu.h
@@ -123,15 +123,11 @@ typedef struct _ftsent {
char fts_name[1]; /* file name */
} FTSENT;
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
FTSENT *fts_children(FTS *, int);
int fts_close(FTS *);
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **));
FTSENT *fts_read(FTS *);
int fts_set(FTS *, FTSENT *, int);
-__END_DECLS
#endif /* !_FTS_H_ */
diff --git a/package/cfgfs/src/fts_subs.c b/package/cfgfs/src/fts_subs.c
index ec40219f8..311048a26 100644
--- a/package/cfgfs/src/fts_subs.c
+++ b/package/cfgfs/src/fts_subs.c
@@ -37,8 +37,6 @@
#define FTSF_INTERNALS
#include "fts_subs.h"
-__RCSID("$MirOS: contrib/hosted/fwcf/fts_subs.c,v 1.8 2007/07/02 14:53:03 tg Exp $");
-
static FTS *handle;
char ftsf_prefix[PATH_MAX];
diff --git a/package/cfgfs/src/fts_subs.h b/package/cfgfs/src/fts_subs.h
index c7d2c10fc..b83616a87 100644
--- a/package/cfgfs/src/fts_subs.h
+++ b/package/cfgfs/src/fts_subs.h
@@ -27,11 +27,9 @@ typedef struct FTSF_ENTRY ftsf_entry;
extern const char ftsf_prefix[];
#endif
-__BEGIN_DECLS
void ftsf_start(const char *);
/* returns -1 on error, 0 on empty, 1 on okay */
int ftsf_next(ftsf_entry *);
void ftsf_debugent(ftsf_entry *);
-__END_DECLS
#endif
diff --git a/package/cfgfs/src/minilzop.h b/package/cfgfs/src/minilzop.h
index 8c23c674e..9d0c37735 100644
--- a/package/cfgfs/src/minilzop.h
+++ b/package/cfgfs/src/minilzop.h
@@ -9,11 +9,9 @@
#ifndef MINILZOP_H
#define MINILZOP_H
-__BEGIN_DECLS
int minilzop(int ifd, int ofd, int compr_alg, int decompress);
/* TODO: use the two below for the “outer filesystem” as well */
void read_aszdata(int, char **, size_t *);
void write_aszdata(int, const char *, size_t);
-__END_DECLS
#endif
diff --git a/package/cfgfs/src/pack.h b/package/cfgfs/src/pack.h
index 9dfb8233f..3b6e518fd 100644
--- a/package/cfgfs/src/pack.h
+++ b/package/cfgfs/src/pack.h
@@ -77,7 +77,6 @@ typedef struct FTSF_ENTRY ftsf_entry;
res; \
})
-__BEGIN_DECLS
char *ft_pack(ftsf_entry *);
char *ft_packm(void);
@@ -90,6 +89,5 @@ void ft_creatm(char *, const char *);
char *fwcf_unpack(int, size_t *);
char *fwcf_pack(char *, size_t, int, size_t *);
char *fwcf_packm(const char *, int, size_t *);
-__END_DECLS
#endif
diff --git a/package/cfgfs/src/sys_linux.c b/package/cfgfs/src/sys_linux.c
index 38283a44d..af730dd42 100644
--- a/package/cfgfs/src/sys_linux.c
+++ b/package/cfgfs/src/sys_linux.c
@@ -23,6 +23,7 @@
#include <err.h>
#include <fcntl.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -30,8 +31,6 @@
#include "defs.h"
#include "sysdeps.h"
-__RCSID("$MirOS: contrib/hosted/fwcf/sys_linux.c,v 1.3 2006/09/26 10:25:03 tg Exp $");
-
void
pull_rndata(uint8_t *buf, size_t n)
{
@@ -42,7 +41,7 @@ pull_rndata(uint8_t *buf, size_t n)
return;
}
if ((size_t)read(fd, buf, n) != n)
- warn("Cannot read %lu bytes from /dev/urandom", (u_long)n);
+ warn("Cannot read %lu bytes from /dev/urandom", (unsigned long)n);
close(fd);
}
@@ -56,6 +55,6 @@ push_rndata(uint8_t *buf, size_t n)
return;
}
if ((size_t)write(fd, buf, n) != n)
- warn("Cannot write %lu bytes to /dev/urandom", (u_long)n);
+ warn("Cannot write %lu bytes to /dev/urandom", (unsigned long)n);
close(fd);
}
diff --git a/package/cfgfs/src/sysdeps.h b/package/cfgfs/src/sysdeps.h
index 34313f58c..8c248139f 100644
--- a/package/cfgfs/src/sysdeps.h
+++ b/package/cfgfs/src/sysdeps.h
@@ -9,9 +9,7 @@
#ifndef SYSDEPS_H
#define SYSDEPS_H
-__BEGIN_DECLS
void pull_rndata(uint8_t *, size_t);
void push_rndata(uint8_t *, size_t);
-__END_DECLS
#endif
diff --git a/package/cfgfs/src/tool.c b/package/cfgfs/src/tool.c
index 3daf141cd..a9e475c4a 100644
--- a/package/cfgfs/src/tool.c
+++ b/package/cfgfs/src/tool.c
@@ -32,8 +32,6 @@
#include "minilzop.h"
#include "pack.h"
-__RCSID("$MirOS: contrib/hosted/fwcf/tool.c,v 1.7 2007/03/09 22:35:13 tg Exp $");
-
static __dead void usage(void);
static int mkfwcf(int, const char *, int);
static int unfwcf(int, const char *);
diff --git a/package/cfgfs/src/unwraps.c b/package/cfgfs/src/unwraps.c
index d03f297e3..37117d6e6 100644
--- a/package/cfgfs/src/unwraps.c
+++ b/package/cfgfs/src/unwraps.c
@@ -83,13 +83,13 @@ fwcf_unpack(int fd, size_t *inner)
if ((x = compressor_get(c)->decompress(udata, *inner, cdata + 12,
outer - 16)) != *inner)
- errx(1, "size mismatch: decompressed %lu, want %lu", (u_long)x,
- (u_long)*inner);
+ errx(1, "size mismatch: decompressed %lu, want %lu", (unsigned long)x,
+ (unsigned long)*inner);
push_rndata((uint8_t *)cdata + outer, maxln - outer);
free(cdata);
#ifdef DEBUG
fprintf(stderr, "fwcf_unpack: decompressed outer %lu inner %lu\n",
- (u_long)outer, (u_long)*inner);
+ (unsigned long)outer, (unsigned long)*inner);
#endif
return (udata);
}
diff --git a/package/cfgfs/src/wraps.c b/package/cfgfs/src/wraps.c
index 7923b76be..923aecbd8 100644
--- a/package/cfgfs/src/wraps.c
+++ b/package/cfgfs/src/wraps.c
@@ -67,9 +67,9 @@ fwcf_pack(char *odata, size_t i, int algo, size_t *dstsz)
char *data, *cdata;
if (i > 0xFFFFFF)
- errx(1, "inner size of %lu too large", (u_long)i);
+ errx(1, "inner size of %lu too large", (unsigned long)i);
#ifdef DEBUG
- fprintf(stderr, "fwcf_pack: algo %02X packing %lu\n", algo, (u_long)i);
+ fprintf(stderr, "fwcf_pack: algo %02X packing %lu\n", algo, (unsigned long)i);
#endif
if ((j = compressor_get(algo)->compress(&cdata, odata, i)) == -1)