aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runit/runit_lib.c552
-rw-r--r--runit/runit_lib.h240
2 files changed, 4 insertions, 788 deletions
diff --git a/runit/runit_lib.c b/runit/runit_lib.c
index 181d43836..aa1d96002 100644
--- a/runit/runit_lib.c
+++ b/runit/runit_lib.c
@@ -34,207 +34,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "libbb.h"
#include "runit_lib.h"
-#if 0
-/*** buffer.c ***/
-
-void buffer_init(buffer *s,int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len)
-{
- s->x = buf;
- s->fd = fd;
- s->op = op;
- s->p = 0;
- s->n = len;
-}
-
-
-/*** buffer_get.c ***/
-
-static int oneread(int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len)
-{
- int r;
-
- for (;;) {
- r = op(fd,buf,len);
- if (r == -1 && errno == EINTR)
- continue;
- return r;
- }
-}
-
-static int getthis(buffer *s,char *buf,unsigned len)
-{
- if (len > s->p) len = s->p;
- s->p -= len;
- memcpy(buf,s->x + s->n,len);
- s->n += len;
- return len;
-}
-
-int buffer_feed(buffer *s)
-{
- int r;
-
- if (s->p)
- return s->p;
- r = oneread(s->op,s->fd,s->x,s->n);
- if (r <= 0)
- return r;
- s->p = r;
- s->n -= r;
- if (s->n > 0)
- memmove(s->x + s->n,s->x,r);
- return r;
-}
-
-int buffer_bget(buffer *s,char *buf,unsigned len)
-{
- int r;
-
- if (s->p > 0)
- return getthis(s,buf,len);
- if (s->n <= len)
- return oneread(s->op,s->fd,buf,s->n);
- r = buffer_feed(s);
- if (r <= 0)
- return r;
- return getthis(s,buf,len);
-}
-
-int buffer_get(buffer *s,char *buf,unsigned len)
-{
- int r;
-
- if (s->p > 0)
- return getthis(s,buf,len);
- if (s->n <= len)
- return oneread(s->op,s->fd,buf,len);
- r = buffer_feed(s);
- if (r <= 0)
- return r;
- return getthis(s,buf,len);
-}
-
-char *buffer_peek(buffer *s)
-{
- return s->x + s->n;
-}
-
-void buffer_seek(buffer *s,unsigned len)
-{
- s->n += len;
- s->p -= len;
-}
-
-
-/*** buffer_put.c ***/
-
-static int allwrite(int (*op)(int fd,char *buf,unsigned len),int fd,const char *buf,unsigned len)
-{
- int w;
-
- while (len) {
- w = op(fd,(char*)buf,len);
- if (w == -1) {
- if (errno == EINTR)
- continue;
- return -1; /* note that some data may have been written */
- }
- /* if (w == 0) ; luser's fault */
- buf += w;
- len -= w;
- }
- return 0;
-}
-
-int buffer_flush(buffer *s)
-{
- int p;
-
- p = s->p;
- if (!p) return 0;
- s->p = 0;
- return allwrite(s->op,s->fd,s->x,p);
-}
-
-int buffer_putalign(buffer *s,const char *buf,unsigned len)
-{
- unsigned n;
-
- while (len > (n = s->n - s->p)) {
- memcpy(s->x + s->p,buf,n);
- s->p += n;
- buf += n;
- len -= n;
- if (buffer_flush(s) == -1) return -1;
- }
- /* now len <= s->n - s->p */
- memcpy(s->x + s->p,buf,len);
- s->p += len;
- return 0;
-}
-
-int buffer_put(buffer *s,const char *buf,unsigned len)
-{
- unsigned n;
-
- n = s->n;
- if (len > n - s->p) {
- if (buffer_flush(s) == -1) return -1;
- /* now s->p == 0 */
- if (n < BUFFER_OUTSIZE) n = BUFFER_OUTSIZE;
- while (len > s->n) {
- if (n > len) n = len;
- if (allwrite(s->op,s->fd,buf,n) == -1) return -1;
- buf += n;
- len -= n;
- }
- }
- /* now len <= s->n - s->p */
- memcpy(s->x + s->p,buf,len);
- s->p += len;
- return 0;
-}
-
-int buffer_putflush(buffer *s,const char *buf,unsigned len)
-{
- if (buffer_flush(s) == -1)
- return -1;
- return allwrite(s->op,s->fd,buf,len);
-}
-
-int buffer_putsalign(buffer *s,const char *buf)
-{
- return buffer_putalign(s,buf,strlen(buf));
-}
-
-int buffer_puts(buffer *s,const char *buf)
-{
- return buffer_put(s,buf,strlen(buf));
-}
-
-int buffer_putsflush(buffer *s,const char *buf)
-{
- return buffer_putflush(s,buf,strlen(buf));
-}
-
-
-/*** buffer_read.c ***/
-
-int buffer_unixread(int fd,char *buf,unsigned len)
-{
- return read(fd,buf,len);
-}
-
-
-/*** buffer_write.c ***/
-
-int buffer_unixwrite(int fd,char *buf,unsigned len)
-{
- return write(fd,buf,len);
-}
-#endif
-
-
/*** byte_chr.c ***/
unsigned byte_chr(char *s,unsigned n,int c)
@@ -290,16 +89,6 @@ int fd_move(int to,int from)
}
-#if 0
-/*** fifo.c ***/
-
-int fifo_make(const char *fn,int mode)
-{
- return mkfifo(fn, mode);
-}
-#endif
-
-
/*** fmt_ptime.c ***/
void fmt_ptime30nul(char *s, struct taia *ta) {
@@ -344,60 +133,6 @@ unsigned fmt_taia25(char *s, struct taia *t) {
}
-#ifdef UNUSED
-/*** fmt_uint.c ***/
-
-unsigned fmt_uint(char *s,unsigned u)
-{
- return fmt_ulong(s,u);
-}
-
-
-/*** fmt_uint0.c ***/
-
-unsigned fmt_uint0(char *s,unsigned u,unsigned n)
-{
- unsigned len;
- len = fmt_uint(FMT_LEN, u);
- while (len < n) {
- if (s)
- *s++ = '0';
- ++len;
- }
- if (s)
- fmt_uint(s, u);
- return len;
-}
-#endif
-
-
-#ifdef UNUSED
-/*** fmt_ulong.c ***/
-
-unsigned fmt_ulong(char *s,unsigned long u)
-{
- unsigned len; unsigned long q;
- len = 1; q = u;
- while (q > 9) { ++len; q /= 10; }
- if (s) {
- s += len;
- do { *--s = '0' + (u % 10); u /= 10; } while (u); /* handles u == 0 */
- }
- return len;
-}
-#endif
-
-
-#ifdef UNUSED
-/*** tai_now.c ***/
-
-void tai_now(struct tai *t)
-{
- tai_unix(t, time(NULL));
-}
-#endif
-
-
/*** tai_pack.c ***/
static /* as it isn't used anywhere else */
@@ -447,8 +182,6 @@ void tai_unpack(const char *s,struct tai *t)
/*** taia_add.c ***/
-/* XXX: breaks tai encapsulation */
-
void taia_add(struct taia *t,const struct taia *u,const struct taia *v)
{
t->sec.x = u->sec.x + v->sec.x;
@@ -465,34 +198,8 @@ void taia_add(struct taia *t,const struct taia *u,const struct taia *v)
}
-#ifdef UNUSED
-/*** taia_frac.c ***/
-
-double taia_frac(const struct taia *t)
-{
- return (t->atto * 0.000000001 + t->nano) * 0.000000001;
-}
-
-
-/*** taia_approx.c ***/
-
-double taia_approx(const struct taia *t)
-{
- return t->sec->x + taia_frac(t);
-}
-#endif
-
-static
-uint64_t taia2millisec(const struct taia *t)
-{
- return (t->sec.x * 1000) + (t->nano / 1000000);
-}
-
-
/*** taia_less.c ***/
-/* XXX: breaks tai encapsulation */
-
int taia_less(const struct taia *t, const struct taia *u)
{
if (t->sec.x < u->sec.x) return 1;
@@ -539,8 +246,6 @@ void taia_pack(char *s, const struct taia *t)
/*** taia_sub.c ***/
-/* XXX: breaks tai encapsulation */
-
void taia_sub(struct taia *t, const struct taia *u, const struct taia *v)
{
unsigned long unano = u->nano;
@@ -572,70 +277,15 @@ void taia_uint(struct taia *t, unsigned s)
}
-/*** stralloc_cat.c ***/
-#if 0
-
-int stralloc_cat(stralloc *sato,const stralloc *safrom)
-{
- return stralloc_catb(sato,safrom->s,safrom->len);
-}
-
-
-/*** stralloc_catb.c ***/
-
-int stralloc_catb(stralloc *sa,const char *s,unsigned n)
-{
- if (!sa->s) return stralloc_copyb(sa,s,n);
- if (!stralloc_readyplus(sa,n + 1)) return 0;
- memcpy(sa->s + sa->len,s,n);
- sa->len += n;
- sa->s[sa->len] = 'Z'; /* ``offensive programming'' */
- return 1;
-}
-
-
-/*** stralloc_cats.c ***/
-
-int stralloc_cats(stralloc *sa,const char *s)
-{
- return stralloc_catb(sa,s,strlen(s));
-}
-
-
-/*** stralloc_eady.c ***/
-
-GEN_ALLOC_ready(stralloc,char,s,len,a,i,n,x,30,stralloc_ready)
-GEN_ALLOC_readyplus(stralloc,char,s,len,a,i,n,x,30,stralloc_readyplus)
-
-
-/*** stralloc_opyb.c ***/
-
-int stralloc_copyb(stralloc *sa,const char *s,unsigned n)
-{
- if (!stralloc_ready(sa,n + 1)) return 0;
- memcpy(sa->s,s,n);
- sa->len = n;
- sa->s[n] = 'Z'; /* ``offensive programming'' */
- return 1;
-}
-
-
-/*** stralloc_opys.c ***/
+/*** iopause.c ***/
-int stralloc_copys(stralloc *sa,const char *s)
+static
+uint64_t taia2millisec(const struct taia *t)
{
- return stralloc_copyb(sa,s,strlen(s));
+ return (t->sec.x * 1000) + (t->nano / 1000000);
}
-/*** stralloc_pend.c ***/
-
-GEN_ALLOC_append(stralloc,char,s,len,a,i,n,x,30,stralloc_readyplus,stralloc_append)
-
-#endif /* stralloc */
-
-/*** iopause.c ***/
-
void iopause(iopause_fd *x,unsigned len,struct taia *deadline,struct taia *stamp)
{
int millisecs;
@@ -711,130 +361,6 @@ int open_write(const char *fn)
}
-/*** openreadclose.c ***/
-#if 0
-int openreadclose(const char *fn,stralloc *sa,unsigned bufsize)
-{
- int fd;
- fd = open_read(fn);
- if (fd == -1) {
- if (errno == ENOENT) return 0;
- return -1;
- }
- if (readclose(fd,sa,bufsize) == -1) return -1;
- return 1;
-}
-#endif
-
-
-/*** pathexec_env.c ***/
-#if 0
-static stralloc plus;
-static stralloc tmp;
-
-int pathexec_env(const char *s,const char *t)
-{
- if (!s) return 1;
- if (!stralloc_copys(&tmp,s)) return 0;
- if (t) {
- if (!stralloc_cats(&tmp,"=")) return 0;
- if (!stralloc_cats(&tmp,t)) return 0;
- }
- if (!stralloc_0(&tmp)) return 0;
- return stralloc_cat(&plus,&tmp);
-}
-
-void pathexec(char **argv)
-{
- char **e;
- unsigned elen;
- unsigned i;
- unsigned j;
- unsigned split;
- unsigned t;
-
- if (!stralloc_cats(&plus,"")) return;
-
- elen = 0;
- for (i = 0;environ[i];++i)
- ++elen;
- for (i = 0;i < plus.len;++i)
- if (!plus.s[i])
- ++elen;
-
- e = malloc((elen + 1) * sizeof(char *));
- if (!e) return;
-
- elen = 0;
- for (i = 0;environ[i];++i)
- e[elen++] = environ[i];
-
- j = 0;
- for (i = 0;i < plus.len;++i)
- if (!plus.s[i]) {
- split = str_chr(plus.s + j,'=');
- for (t = 0;t < elen;++t)
- if (memcmp(plus.s + j,e[t],split) == 0)
- if (e[t][split] == '=') {
- --elen;
- e[t] = e[elen];
- break;
- }
- if (plus.s[j + split])
- e[elen++] = plus.s + j;
- j = i + 1;
- }
- e[elen] = 0;
-
- pathexec_run(*argv,argv,e);
- free(e);
-}
-#endif
-
-/*** pathexec_run.c ***/
-#if 0
-static stralloc tmp;
-
-void pathexec_run(const char *file,char *const *argv,char *const *envp)
-{
- const char *path;
- unsigned split;
- int savederrno;
-
- if (file[str_chr(file,'/')]) {
- execve(file,argv,envp);
- return;
- }
-
- path = getenv("PATH");
- if (!path) path = "/bin:/usr/bin";
-
- savederrno = 0;
- for (;;) {
- split = str_chr(path,':');
- if (!stralloc_copyb(&tmp,path,split)) return;
- if (!split)
- if (!stralloc_cats(&tmp,".")) return;
- if (!stralloc_cats(&tmp,"/")) return;
- if (!stralloc_cats(&tmp,file)) return;
- if (!stralloc_0(&tmp)) return;
-
- execve(tmp.s,argv,envp);
- if (errno != ENOENT) {
- savederrno = errno;
- if ((errno != EACCES) && (errno != EPERM) && (errno != EISDIR)) return;
- }
-
- if (!path[split]) {
- if (savederrno) errno = savederrno;
- return;
- }
- path += split;
- path += 1;
- }
-}
-#endif
-
/*** pmatch.c ***/
unsigned pmatch(const char *p, const char *s, unsigned len) {
@@ -878,62 +404,6 @@ unsigned pmatch(const char *p, const char *s, unsigned len) {
}
-#if 0
-/*** prot.c ***/
-
-int prot_gid(int gid)
-{
- gid_t x = gid;
- if (setgroups(1,&x) == -1) return -1;
- return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
-}
-
-int prot_uid(int uid)
-{
- return setuid(uid);
-}
-#endif
-
-
-/*** readclose.c ***/
-#if 0
-int readclose_append(int fd,stralloc *sa,unsigned bufsize)
-{
- int r;
- for (;;) {
- if (!stralloc_readyplus(sa,bufsize)) { close(fd); return -1; }
- r = read(fd,sa->s + sa->len,bufsize);
- if (r == -1) if (errno == EINTR) continue;
- if (r <= 0) { close(fd); return r; }
- sa->len += r;
- }
-}
-
-int readclose(int fd,stralloc *sa,unsigned bufsize)
-{
- if (!stralloc_copys(sa,"")) { close(fd); return -1; }
- return readclose_append(fd,sa,bufsize);
-}
-#endif
-
-#if 0
-/*** scan_ulong.c ***/
-
-unsigned scan_ulong(const char *s,unsigned long *u)
-{
- unsigned pos = 0;
- unsigned long result = 0;
- unsigned long c;
- while ((c = (unsigned long) (unsigned char) (s[pos] - '0')) < 10) {
- result = result * 10 + c;
- ++pos;
- }
- *u = result;
- return pos;
-}
-#endif
-
-
#ifdef UNUSED
/*** seek_set.c ***/
@@ -944,20 +414,6 @@ int seek_set(int fd,seek_pos pos)
#endif
-/*** sig.c ***/
-
-//int sig_alarm = SIGALRM;
-//int sig_child = SIGCHLD;
-//int sig_cont = SIGCONT;
-//int sig_hangup = SIGHUP;
-//int sig_int = SIGINT;
-//int sig_pipe = SIGPIPE;
-//int sig_term = SIGTERM;
-
-//void (*sig_defaulthandler)(int) = SIG_DFL;
-//void (*sig_ignorehandler)(int) = SIG_IGN;
-
-
/*** sig_block.c ***/
void sig_block(int sig)
diff --git a/runit/runit_lib.h b/runit/runit_lib.h
index ea4b33123..7b268e276 100644
--- a/runit/runit_lib.h
+++ b/runit/runit_lib.h
@@ -25,62 +25,6 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*** buffer.h ***/
-
-#if 0
-typedef struct buffer {
- char *x;
- unsigned p;
- unsigned n;
- int fd;
- int (*op)(int fd,char *buf,unsigned len);
-} buffer;
-
-//#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
-//#define BUFFER_INSIZE 8192
-#define BUFFER_OUTSIZE 8192
-
-extern void buffer_init(buffer *,int (*)(int fd,char *buf,unsigned len),int,char *,unsigned);
-
-extern int buffer_flush(buffer *);
-//extern int buffer_put(buffer *,const char *,unsigned);
-extern int buffer_putalign(buffer *,const char *,unsigned);
-extern int buffer_putflush(buffer *,const char *,unsigned);
-//extern int buffer_puts(buffer *,const char *);
-extern int buffer_putsalign(buffer *,const char *);
-extern int buffer_putsflush(buffer *,const char *);
-
-#define buffer_PUTC(s,c) \
- ( ((s)->n != (s)->p) \
- ? ( (s)->x[(s)->p++] = (c), 0 ) \
- : buffer_put((s),&(c),1) \
- )
-
-extern int buffer_get(buffer *,char *,unsigned);
-extern int buffer_bget(buffer *,char *,unsigned);
-extern int buffer_feed(buffer *);
-
-extern char *buffer_peek(buffer *);
-extern void buffer_seek(buffer *,unsigned);
-
-#define buffer_PEEK(s) ( (s)->x + (s)->n )
-#define buffer_SEEK(s,len) ( ( (s)->p -= (len) ) , ( (s)->n += (len) ) )
-
-#define buffer_GETC(s,c) \
- ( ((s)->p > 0) \
- ? ( *(c) = (s)->x[(s)->n], buffer_SEEK((s),1), 1 ) \
- : buffer_get((s),(c),1) \
- )
-
-extern int buffer_copy(buffer *,buffer *);
-
-extern int buffer_unixread(int,char *,unsigned);
-/* Actually, int buffer_unixwrite(int,const char *,unsigned),
- but that 'const' will produce warnings... oh well */
-extern int buffer_unixwrite(int,char *,unsigned);
-#endif
-
-
/*** byte.h ***/
extern unsigned byte_chr(char *s,unsigned n,int c);
@@ -102,35 +46,6 @@ extern int fd_copy(int,int);
extern int fd_move(int,int);
-/*** fifo.h ***/
-
-//extern int fifo_make(const char *,int);
-
-
-/*** fmt.h ***/
-
-//#define FMT_ULONG 40 /* enough space to hold 2^128 - 1 in decimal, plus \0 */
-//#define FMT_LEN ((char *) 0) /* convenient abbreviation */
-
-//extern unsigned fmt_uint(char *,unsigned);
-//extern unsigned fmt_uint0(char *,unsigned,unsigned);
-//extern unsigned fmt_xint(char *,unsigned);
-//extern unsigned fmt_nbbint(char *,unsigned,unsigned,unsigned,unsigned);
-//extern unsigned fmt_ushort(char *,unsigned short);
-//extern unsigned fmt_xshort(char *,unsigned short);
-//extern unsigned fmt_nbbshort(char *,unsigned,unsigned,unsigned,unsigned short);
-//extern unsigned fmt_ulong(char *,unsigned long);
-//extern unsigned fmt_xlong(char *,unsigned long);
-//extern unsigned fmt_nbblong(char *,unsigned,unsigned,unsigned,unsigned long);
-
-//extern unsigned fmt_plusminus(char *,int);
-//extern unsigned fmt_minus(char *,int);
-//extern unsigned fmt_0x(char *,int);
-
-//extern unsigned fmt_str(char *,const char *);
-//extern unsigned fmt_strn(char *,const char *,unsigned);
-
-
/*** tai.h ***/
struct tai {
@@ -139,14 +54,6 @@ struct tai {
#define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64_t) (u)))
-//extern void tai_now(struct tai *);
-
-//#define tai_approx(t) ((double) ((t)->x))
-
-//extern void tai_add(struct tai *,const struct tai *,const struct tai *);
-//extern void tai_sub(struct tai *,const struct tai *,const struct tai *);
-//#define tai_less(t,u) ((t)->x < (u)->x)
-
#define TAI_PACK 8
//extern void tai_pack(char *,const struct tai *);
extern void tai_unpack(const char *,struct tai *);
@@ -166,9 +73,6 @@ struct taia {
extern void taia_now(struct taia *);
-//extern double taia_approx(const struct taia *);
-//extern double taia_frac(const struct taia *);
-
extern void taia_add(struct taia *,const struct taia *,const struct taia *);
extern void taia_addsec(struct taia *,const struct taia *,int);
extern void taia_sub(struct taia *,const struct taia *,const struct taia *);
@@ -195,73 +99,6 @@ extern void fmt_ptime30nul(char *, struct taia *);
extern unsigned fmt_taia25(char *, struct taia *);
-#ifdef UNUSED
-/*** gen_alloc.h ***/
-
-#define GEN_ALLOC_typedef(ta,type,field,len,a) \
- typedef struct ta { type *field; unsigned len; unsigned a; } ta;
-
-
-/*** gen_allocdefs.h ***/
-
-#define GEN_ALLOC_ready(ta,type,field,len,a,i,n,x,base,ta_ready) \
-int ta_ready(ta *x,unsigned n) \
-{ unsigned i; \
- if (x->field) { \
- i = x->a; \
- if (n > i) { \
- x->a = base + n + (n >> 3); \
- x->field = realloc(x->field,x->a * sizeof(type)); \
- if (x->field) return 1; \
- x->a = i; return 0; } \
- return 1; } \
- x->len = 0; \
- return !!(x->field = malloc((x->a = n) * sizeof(type))); }
-
-#define GEN_ALLOC_readyplus(ta,type,field,len,a,i,n,x,base,ta_rplus) \
-int ta_rplus(ta *x,unsigned n) \
-{ unsigned i; \
- if (x->field) { \
- i = x->a; n += x->len; \
- if (n > i) { \
- x->a = base + n + (n >> 3); \
- x->field = realloc(x->field,x->a * sizeof(type)); \
- if (x->field) return 1; \
- x->a = i; return 0; } \
- return 1; } \
- x->len = 0; \
- return !!(x->field = malloc((x->a = n) * sizeof(type))); }
-
-#define GEN_ALLOC_append(ta,type,field,len,a,i,n,x,base,ta_rplus,ta_append) \
-int ta_append(ta *x,const type *i) \
-{ if (!ta_rplus(x,1)) return 0; x->field[x->len++] = *i; return 1; }
-
-
-/*** stralloc.h ***/
-GEN_ALLOC_typedef(stralloc,char,s,len,a)
-
-extern int stralloc_ready(stralloc *,unsigned);
-extern int stralloc_readyplus(stralloc *,unsigned);
-extern int stralloc_copy(stralloc *,const stralloc *);
-extern int stralloc_cat(stralloc *,const stralloc *);
-extern int stralloc_copys(stralloc *,const char *);
-extern int stralloc_cats(stralloc *,const char *);
-extern int stralloc_copyb(stralloc *,const char *,unsigned);
-extern int stralloc_catb(stralloc *,const char *,unsigned);
-extern int stralloc_append(stralloc *,const char *); /* beware: this takes a pointer to 1 char */
-extern int stralloc_starts(stralloc *,const char *);
-
-#define stralloc_0(sa) stralloc_append(sa,"")
-
-extern int stralloc_catulong0(stralloc *,unsigned long,unsigned);
-extern int stralloc_catlong0(stralloc *,long,unsigned);
-
-#define stralloc_catlong(sa,l) (stralloc_catlong0((sa),(l),0))
-#define stralloc_catuint0(sa,i,n) (stralloc_catulong0((sa),(i),(n)))
-#define stralloc_catint0(sa,i,n) (stralloc_catlong0((sa),(i),(n)))
-#define stralloc_catint(sa,i) (stralloc_catlong0((sa),(i),0))
-#endif
-
/*** iopause.h ***/
typedef struct pollfd iopause_fd;
@@ -287,88 +124,13 @@ extern int open_trunc(const char *);
extern int open_write(const char *);
-/*** openreadclose.h ***/
-#if 0
-extern int openreadclose(const char *,stralloc *,unsigned);
-#endif
-
-/*** pathexec.h ***/
-
-//extern void pathexec_run(const char *,char *const *,char *const *);
-//extern int pathexec_env(const char *,const char *);
-//extern void pathexec(char **);
-
-
/*** pmatch.h ***/
extern unsigned pmatch(const char *, const char *, unsigned);
-/*** prot.h ***/
-
-//extern int prot_gid(int);
-//extern int prot_uid(int);
-
-
-/*** readclose.h ***/
-#if 0
-extern int readclose_append(int,stralloc *,unsigned);
-extern int readclose(int,stralloc *,unsigned);
-#endif
-
-/*** scan.h ***/
-
-#if 0
-extern unsigned scan_uint(const char *,unsigned *);
-extern unsigned scan_xint(const char *,unsigned *);
-extern unsigned scan_nbbint(const char *,unsigned,unsigned,unsigned,unsigned *);
-extern unsigned scan_ushort(const char *,unsigned short *);
-extern unsigned scan_xshort(const char *,unsigned short *);
-extern unsigned scan_nbbshort(const char *,unsigned,unsigned,unsigned,unsigned short *);
-extern unsigned scan_ulong(const char *,unsigned long *);
-extern unsigned scan_xlong(const char *,unsigned long *);
-extern unsigned scan_nbblong(const char *,unsigned,unsigned,unsigned,unsigned long *);
-
-extern unsigned scan_plusminus(const char *,int *);
-extern unsigned scan_0x(const char *,unsigned *);
-
-extern unsigned scan_whitenskip(const char *,unsigned);
-extern unsigned scan_nonwhitenskip(const char *,unsigned);
-extern unsigned scan_charsetnskip(const char *,const char *,unsigned);
-extern unsigned scan_noncharsetnskip(const char *,const char *,unsigned);
-
-extern unsigned scan_strncmp(const char *,const char *,unsigned);
-extern unsigned scan_memcmp(const char *,const char *,unsigned);
-
-extern unsigned scan_long(const char *,long *);
-extern unsigned scan_8long(const char *,unsigned long *);
-#endif
-
-
-/*** seek.h ***/
-
-//typedef unsigned long seek_pos;
-
-//extern seek_pos seek_cur(int);
-
-//extern int seek_set(int,seek_pos);
-//extern int seek_end(int);
-
-//extern int seek_trunc(int,seek_pos);
-
-//#define seek_begin(fd) (seek_set((fd),(seek_pos) 0))
-
-
/*** sig.h ***/
-//extern int sig_alarm;
-//extern int sig_child;
-//extern int sig_cont;
-//extern int sig_hangup;
-//extern int sig_int;
-//extern int sig_pipe;
-//extern int sig_term;
-
extern void sig_catch(int,void (*)(int));
#define sig_ignore(s) (sig_catch((s), SIG_IGN))
#define sig_uncatch(s) (sig_catch((s), SIG_DFL))
@@ -378,8 +140,6 @@ extern void sig_unblock(int);
extern void sig_blocknone(void);
extern void sig_pause(void);
-extern void sig_dfl(int);
-
/*** str.h ***/