diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-27 22:21:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-27 22:21:52 +0000 |
commit | 8c7839512039212ba88e48d856d0ac9835fdec67 (patch) | |
tree | 4aa5cb8737ab74799096cb8560180890aa2bb5d7 /runit/runit_lib.h | |
parent | e06bed30cfcde7b9e320aff8a4c878c72416c4c4 (diff) | |
download | busybox-w32-8c7839512039212ba88e48d856d0ac9835fdec67.tar.gz busybox-w32-8c7839512039212ba88e48d856d0ac9835fdec67.tar.bz2 busybox-w32-8c7839512039212ba88e48d856d0ac9835fdec67.zip |
runit cleanup part 1
Diffstat (limited to 'runit/runit_lib.h')
-rw-r--r-- | runit/runit_lib.h | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/runit/runit_lib.h b/runit/runit_lib.h index f4beb560e..f594f8f69 100644 --- a/runit/runit_lib.h +++ b/runit/runit_lib.h | |||
@@ -107,46 +107,46 @@ extern int fifo_make(const char *,int); | |||
107 | 107 | ||
108 | /*** fmt.h ***/ | 108 | /*** fmt.h ***/ |
109 | 109 | ||
110 | #define FMT_ULONG 40 /* enough space to hold 2^128 - 1 in decimal, plus \0 */ | 110 | //#define FMT_ULONG 40 /* enough space to hold 2^128 - 1 in decimal, plus \0 */ |
111 | #define FMT_LEN ((char *) 0) /* convenient abbreviation */ | 111 | //#define FMT_LEN ((char *) 0) /* convenient abbreviation */ |
112 | 112 | ||
113 | extern unsigned fmt_uint(char *,unsigned); | 113 | //extern unsigned fmt_uint(char *,unsigned); |
114 | extern unsigned fmt_uint0(char *,unsigned,unsigned); | 114 | //extern unsigned fmt_uint0(char *,unsigned,unsigned); |
115 | extern unsigned fmt_xint(char *,unsigned); | 115 | //extern unsigned fmt_xint(char *,unsigned); |
116 | extern unsigned fmt_nbbint(char *,unsigned,unsigned,unsigned,unsigned); | 116 | //extern unsigned fmt_nbbint(char *,unsigned,unsigned,unsigned,unsigned); |
117 | extern unsigned fmt_ushort(char *,unsigned short); | 117 | //extern unsigned fmt_ushort(char *,unsigned short); |
118 | extern unsigned fmt_xshort(char *,unsigned short); | 118 | //extern unsigned fmt_xshort(char *,unsigned short); |
119 | extern unsigned fmt_nbbshort(char *,unsigned,unsigned,unsigned,unsigned short); | 119 | //extern unsigned fmt_nbbshort(char *,unsigned,unsigned,unsigned,unsigned short); |
120 | extern unsigned fmt_ulong(char *,unsigned long); | 120 | //extern unsigned fmt_ulong(char *,unsigned long); |
121 | extern unsigned fmt_xlong(char *,unsigned long); | 121 | //extern unsigned fmt_xlong(char *,unsigned long); |
122 | extern unsigned fmt_nbblong(char *,unsigned,unsigned,unsigned,unsigned long); | 122 | //extern unsigned fmt_nbblong(char *,unsigned,unsigned,unsigned,unsigned long); |
123 | 123 | ||
124 | extern unsigned fmt_plusminus(char *,int); | 124 | //extern unsigned fmt_plusminus(char *,int); |
125 | extern unsigned fmt_minus(char *,int); | 125 | //extern unsigned fmt_minus(char *,int); |
126 | extern unsigned fmt_0x(char *,int); | 126 | //extern unsigned fmt_0x(char *,int); |
127 | 127 | ||
128 | extern unsigned fmt_str(char *,const char *); | 128 | //extern unsigned fmt_str(char *,const char *); |
129 | extern unsigned fmt_strn(char *,const char *,unsigned); | 129 | //extern unsigned fmt_strn(char *,const char *,unsigned); |
130 | 130 | ||
131 | 131 | ||
132 | /*** tai.h ***/ | 132 | /*** tai.h ***/ |
133 | 133 | ||
134 | struct tai { | 134 | struct tai { |
135 | uint64_t x; | 135 | uint64_t x; |
136 | } ; | 136 | }; |
137 | 137 | ||
138 | #define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64_t) (u))) | 138 | #define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64_t) (u))) |
139 | 139 | ||
140 | extern void tai_now(struct tai *); | 140 | //extern void tai_now(struct tai *); |
141 | 141 | ||
142 | #define tai_approx(t) ((double) ((t)->x)) | 142 | //#define tai_approx(t) ((double) ((t)->x)) |
143 | 143 | ||
144 | extern void tai_add(struct tai *,const struct tai *,const struct tai *); | 144 | //extern void tai_add(struct tai *,const struct tai *,const struct tai *); |
145 | extern void tai_sub(struct tai *,const struct tai *,const struct tai *); | 145 | //extern void tai_sub(struct tai *,const struct tai *,const struct tai *); |
146 | #define tai_less(t,u) ((t)->x < (u)->x) | 146 | //#define tai_less(t,u) ((t)->x < (u)->x) |
147 | 147 | ||
148 | #define TAI_PACK 8 | 148 | #define TAI_PACK 8 |
149 | extern void tai_pack(char *,const struct tai *); | 149 | //extern void tai_pack(char *,const struct tai *); |
150 | extern void tai_unpack(const char *,struct tai *); | 150 | extern void tai_unpack(const char *,struct tai *); |
151 | 151 | ||
152 | extern void tai_uint(struct tai *,unsigned); | 152 | extern void tai_uint(struct tai *,unsigned); |
@@ -158,14 +158,14 @@ struct taia { | |||
158 | struct tai sec; | 158 | struct tai sec; |
159 | unsigned long nano; /* 0...999999999 */ | 159 | unsigned long nano; /* 0...999999999 */ |
160 | unsigned long atto; /* 0...999999999 */ | 160 | unsigned long atto; /* 0...999999999 */ |
161 | } ; | 161 | }; |
162 | 162 | ||
163 | extern void taia_tai(const struct taia *,struct tai *); | 163 | //extern void taia_tai(const struct taia *,struct tai *); |
164 | 164 | ||
165 | extern void taia_now(struct taia *); | 165 | extern void taia_now(struct taia *); |
166 | 166 | ||
167 | extern double taia_approx(const struct taia *); | 167 | //extern double taia_approx(const struct taia *); |
168 | extern double taia_frac(const struct taia *); | 168 | //extern double taia_frac(const struct taia *); |
169 | 169 | ||
170 | extern void taia_add(struct taia *,const struct taia *,const struct taia *); | 170 | extern void taia_add(struct taia *,const struct taia *,const struct taia *); |
171 | extern void taia_addsec(struct taia *,const struct taia *,int); | 171 | extern void taia_addsec(struct taia *,const struct taia *,int); |
@@ -175,10 +175,10 @@ extern int taia_less(const struct taia *,const struct taia *); | |||
175 | 175 | ||
176 | #define TAIA_PACK 16 | 176 | #define TAIA_PACK 16 |
177 | extern void taia_pack(char *,const struct taia *); | 177 | extern void taia_pack(char *,const struct taia *); |
178 | extern void taia_unpack(const char *,struct taia *); | 178 | //extern void taia_unpack(const char *,struct taia *); |
179 | 179 | ||
180 | #define TAIA_FMTFRAC 19 | 180 | //#define TAIA_FMTFRAC 19 |
181 | extern unsigned taia_fmtfrac(char *,const struct taia *); | 181 | //extern unsigned taia_fmtfrac(char *,const struct taia *); |
182 | 182 | ||
183 | extern void taia_uint(struct taia *,unsigned); | 183 | extern void taia_uint(struct taia *,unsigned); |
184 | 184 | ||
@@ -187,10 +187,13 @@ extern void taia_uint(struct taia *,unsigned); | |||
187 | 187 | ||
188 | #define FMT_PTIME 30 | 188 | #define FMT_PTIME 30 |
189 | 189 | ||
190 | extern unsigned fmt_ptime(char *, struct taia *); | 190 | /* NUL terminated */ |
191 | extern unsigned fmt_taia(char *, struct taia *); | 191 | extern void fmt_ptime30nul(char *, struct taia *); |
192 | /* NOT terminated! */ | ||
193 | extern unsigned fmt_taia25(char *, struct taia *); | ||
192 | 194 | ||
193 | 195 | ||
196 | #ifdef UNUSED | ||
194 | /*** gen_alloc.h ***/ | 197 | /*** gen_alloc.h ***/ |
195 | 198 | ||
196 | #define GEN_ALLOC_typedef(ta,type,field,len,a) \ | 199 | #define GEN_ALLOC_typedef(ta,type,field,len,a) \ |
@@ -233,7 +236,6 @@ int ta_append(ta *x,const type *i) \ | |||
233 | 236 | ||
234 | 237 | ||
235 | /*** stralloc.h ***/ | 238 | /*** stralloc.h ***/ |
236 | #if 0 | ||
237 | GEN_ALLOC_typedef(stralloc,char,s,len,a) | 239 | GEN_ALLOC_typedef(stralloc,char,s,len,a) |
238 | 240 | ||
239 | extern int stralloc_ready(stralloc *,unsigned); | 241 | extern int stralloc_ready(stralloc *,unsigned); |
@@ -314,6 +316,7 @@ extern int readclose(int,stralloc *,unsigned); | |||
314 | 316 | ||
315 | /*** scan.h ***/ | 317 | /*** scan.h ***/ |
316 | 318 | ||
319 | #if 0 | ||
317 | extern unsigned scan_uint(const char *,unsigned *); | 320 | extern unsigned scan_uint(const char *,unsigned *); |
318 | extern unsigned scan_xint(const char *,unsigned *); | 321 | extern unsigned scan_xint(const char *,unsigned *); |
319 | extern unsigned scan_nbbint(const char *,unsigned,unsigned,unsigned,unsigned *); | 322 | extern unsigned scan_nbbint(const char *,unsigned,unsigned,unsigned,unsigned *); |
@@ -337,6 +340,7 @@ extern unsigned scan_memcmp(const char *,const char *,unsigned); | |||
337 | 340 | ||
338 | extern unsigned scan_long(const char *,long *); | 341 | extern unsigned scan_long(const char *,long *); |
339 | extern unsigned scan_8long(const char *,unsigned long *); | 342 | extern unsigned scan_8long(const char *,unsigned long *); |
343 | #endif | ||
340 | 344 | ||
341 | 345 | ||
342 | /*** seek.h ***/ | 346 | /*** seek.h ***/ |
@@ -345,30 +349,27 @@ typedef unsigned long seek_pos; | |||
345 | 349 | ||
346 | extern seek_pos seek_cur(int); | 350 | extern seek_pos seek_cur(int); |
347 | 351 | ||
348 | extern int seek_set(int,seek_pos); | 352 | //extern int seek_set(int,seek_pos); |
349 | extern int seek_end(int); | 353 | extern int seek_end(int); |
350 | 354 | ||
351 | extern int seek_trunc(int,seek_pos); | 355 | extern int seek_trunc(int,seek_pos); |
352 | 356 | ||
353 | #define seek_begin(fd) (seek_set((fd),(seek_pos) 0)) | 357 | //#define seek_begin(fd) (seek_set((fd),(seek_pos) 0)) |
354 | 358 | ||
355 | 359 | ||
356 | /*** sig.h ***/ | 360 | /*** sig.h ***/ |
357 | 361 | ||
358 | extern int sig_alarm; | 362 | //extern int sig_alarm; |
359 | extern int sig_child; | 363 | //extern int sig_child; |
360 | extern int sig_cont; | 364 | //extern int sig_cont; |
361 | extern int sig_hangup; | 365 | //extern int sig_hangup; |
362 | extern int sig_int; | 366 | //extern int sig_int; |
363 | extern int sig_pipe; | 367 | //extern int sig_pipe; |
364 | extern int sig_term; | 368 | //extern int sig_term; |
365 | |||
366 | extern void (*sig_defaulthandler)(int); | ||
367 | extern void (*sig_ignorehandler)(int); | ||
368 | 369 | ||
369 | extern void sig_catch(int,void (*)(int)); | 370 | extern void sig_catch(int,void (*)(int)); |
370 | #define sig_ignore(s) (sig_catch((s),sig_ignorehandler)) | 371 | #define sig_ignore(s) (sig_catch((s),SIG_IGN)) |
371 | #define sig_uncatch(s) (sig_catch((s),sig_defaulthandler)) | 372 | #define sig_uncatch(s) (sig_catch((s),SIG_DFL)) |
372 | 373 | ||
373 | extern void sig_block(int); | 374 | extern void sig_block(int); |
374 | extern void sig_unblock(int); | 375 | extern void sig_unblock(int); |