[MKISOFS]
[reactos.git] / reactos / sdk / tools / mkisofs / schilytools / include / schily / schily.h
1 /* @(#)schily.h 1.120 16/09/28 Copyright 1985-2016 J. Schilling */
2 /*
3 * Definitions for libschily
4 *
5 * This file should be included past:
6 *
7 * schily/mconfig.h / config.h
8 * schily/standard.h
9 * stdio.h
10 * stdlib.h (better use schily/stdlib.h)
11 * unistd.h (better use schily/unistd.h) needed f. LARGEFILE support
12 * schily/string.h
13 * sys/types.h
14 *
15 * If you need stdio.h, you must include it before schily/schily.h
16 *
17 * NOTE: If you need ctype.h and did not include stdio.h you need to
18 * include ctype.h past schily/schily.h as OpenBSD does not follow POSIX
19 * and defines EOF in ctype.h
20 *
21 * Copyright (c) 1985-2016 J. Schilling
22 */
23 /*
24 * The contents of this file are subject to the terms of the
25 * Common Development and Distribution License, Version 1.0 only
26 * (the "License"). You may not use this file except in compliance
27 * with the License.
28 *
29 * See the file CDDL.Schily.txt in this distribution for details.
30 * A copy of the CDDL is also available via the Internet at
31 * http://www.opensource.org/licenses/cddl1.txt
32 *
33 * When distributing Covered Code, include this CDDL HEADER in each
34 * file and include the License file CDDL.Schily.txt from this distribution.
35 */
36
37 #ifndef _SCHILY_SCHILY_H
38 #define _SCHILY_SCHILY_H
39
40 #ifndef _SCHILY_MCONFIG_H
41 #include <schily/mconfig.h>
42 #endif
43
44 #ifndef _SCHILY_STANDARD_H
45 #include <schily/standard.h>
46 #endif
47 #ifndef _SCHILY_CCOMDEFS_H
48 #include <schily/ccomdefs.h>
49 #endif
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 #if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(off_t)
56 # ifndef FOUND_OFF_T
57 # define FOUND_OFF_T
58 # endif
59 #endif
60 #if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(size_t)
61 # ifndef FOUND_SIZE_T
62 # define FOUND_SIZE_T
63 # endif
64 #endif
65 #if defined(_MSC_VER) && !defined(_SIZE_T_DEFINED)
66 # undef FOUND_SIZE_T
67 #endif
68
69 #ifdef __never_def__
70 /*
71 * It turns out that we cannot use the folloginw definition because there are
72 * some platforms that do not behave application friendly. These are mainly
73 * BSD-4.4 based systems (which #undef a definition when size_t is available.
74 * We actually removed this code because of a problem with QNX Neutrino.
75 * For this reason, it is important not to include <sys/types.h> directly but
76 * via the Schily SING include files so we know whether it has been included
77 * before we come here.
78 */
79 #if defined(_SIZE_T) || defined(_T_SIZE_) || defined(_T_SIZE) || \
80 defined(__SIZE_T) || defined(_SIZE_T_) || \
81 defined(_GCC_SIZE_T) || defined(_SIZET_) || \
82 defined(__sys_stdtypes_h) || defined(___int_size_t_h) || defined(size_t)
83
84 #ifndef FOUND_SIZE_T
85 # define FOUND_SIZE_T /* We already included a size_t definition */
86 #endif
87 #endif
88 #endif /* __never_def__ */
89
90 #if defined(HAVE_LARGEFILES)
91 # define _fcons _fcons64
92 # define fdup fdup64
93 # define fileluopen fileluopen64
94 # define fileopen fileopen64
95 # define filemopen filemopen64
96 # define filepos filepos64
97 # define filereopen filereopen64
98 # define fileseek fileseek64
99 # define filesize filesize64
100 # define filestat filestat64
101 # define _openfd _openfd64
102 #endif
103
104 /*
105 * The official POSIX rule is not to define "new" interfaces that
106 * are in conflict with older interfaces of the same name.
107 * Our interfaces fexec*() have been defined and published in 1982.
108 * The new POSIX interfaces define a different interface and the
109 * new POSIX interfaces even use names that are not compatible with
110 * POSIX rules. The new POSIX interfaces in question should be called
111 * fdexec*() to follow the rules of other similar POSIX functions.
112 * Simiar problems exist with getline()/fgetline().
113 */
114 #if defined(HAVE_RAW_FEXECL) || defined(HAVE_RAW_FEXECLE) || \
115 defined(HAVE_RAW_FEXECV) || defined(HAVE_RAW_FEXECVE)
116 #define RENAME_FEXEC
117 #endif
118 #if defined(HAVE_RAW_FSPAWNV) || defined(HAVE_RAW_FSPAWNL) || \
119 defined(HAVE_RAW_FSPAWNV_NOWAIT)
120 #define RENAME_FSPAWN
121 #endif
122 #if defined(HAVE_RAW_GETLINE) || defined(HAVE_RAW_FGETLINE)
123 #define RENAME_GETLINE
124 #endif
125
126 #ifdef __needed__
127 #define RENAME_FEXEC
128 #define RENAME_FSPAWN
129 #define RENAME_GETLINE
130 #endif
131
132 #if defined(RENAME_FEXEC) || defined(RENAME_FSPAWN)
133 #ifndef _SCHILY_UNISTD_H
134 #include <schily/unistd.h> /* Need to incl. before fexec*() protoypes */
135 #endif
136 #endif
137
138 #if defined(RENAME_GETLINE)
139 #ifndef _SCHILY_STDIO_H
140 #include <schily/stdio.h> /* Need to incl. before *getline() protoypes */
141 #endif
142
143 #endif
144
145 #ifdef EOF /* stdio.h has been included */
146
147 extern int _cvmod __PR((const char *, int *, int *));
148 extern FILE *_fcons __PR((FILE *, int, int));
149 extern FILE *fdup __PR((FILE *));
150 #if !defined(fdown) || defined(PROTOTYPES)
151 /*
152 * We cannot declare fdown() with K&R in case that fdown() has been #define'd
153 */
154 extern int fdown __PR((FILE *));
155 #endif
156 extern int js_fexecl __PR((const char *, FILE *, FILE *, FILE *,
157 const char *, ...));
158 extern int js_fexecle __PR((const char *, FILE *, FILE *, FILE *,
159 const char *, ...));
160 /* 6th arg not const, fexecv forces av[ac] = NULL */
161 extern int js_fexecv __PR((const char *, FILE *, FILE *, FILE *, int,
162 char **));
163 extern int js_fexecve __PR((const char *, FILE *, FILE *, FILE *,
164 char * const *, char * const *));
165 extern int js_fspawnv __PR((FILE *, FILE *, FILE *, int, char * const *));
166 extern int js_fspawnl __PR((FILE *, FILE *, FILE *, const char *, ...));
167 extern int js_fspawnv_nowait __PR((FILE *, FILE *, FILE *,
168 const char *, int, char *const*));
169 extern int js_fgetline __PR((FILE *, char *, int));
170 #ifdef FOUND_SIZE_T
171 extern ssize_t fgetaline __PR((FILE *, char **, size_t *));
172 extern ssize_t getaline __PR((char **, size_t *));
173 #endif
174 extern int fgetstr __PR((FILE *, char *, int));
175 extern int file_getraise __PR((FILE *));
176 extern void file_raise __PR((FILE *, int));
177 extern int fileclose __PR((FILE *));
178 extern FILE *fileluopen __PR((int, const char *));
179 extern FILE *fileopen __PR((const char *, const char *));
180 #ifdef _SCHILY_TYPES_H
181 extern FILE *filemopen __PR((const char *, const char *, mode_t));
182 #endif
183 #ifdef FOUND_OFF_T
184 extern off_t filepos __PR((FILE *));
185 #endif
186 #ifdef FOUND_SIZE_T
187 extern ssize_t fileread __PR((FILE *, void *, size_t));
188 extern ssize_t ffileread __PR((FILE *, void *, size_t));
189 #endif
190 extern FILE *filereopen __PR((const char *, const char *, FILE *));
191 #ifdef FOUND_OFF_T
192 extern int fileseek __PR((FILE *, off_t));
193 extern off_t filesize __PR((FILE *));
194 #endif
195 #ifdef S_IFMT
196 extern int filestat __PR((FILE *, struct stat *));
197 #endif
198 #ifdef FOUND_SIZE_T
199 extern ssize_t filewrite __PR((FILE *, void *, size_t));
200 extern ssize_t ffilewrite __PR((FILE *, void *, size_t));
201 #endif
202 extern int flush __PR((void));
203 extern int fpipe __PR((FILE **));
204 #ifdef __never__
205 extern int fprintf __PR((FILE *, const char *, ...)) __printflike__(2, 3);
206 #endif
207 extern int getbroken __PR((FILE *, char *, char, char **, int));
208 extern int ofindline __PR((FILE *, char, const char *, int,
209 char **, int));
210 extern int peekc __PR((FILE *));
211
212 #ifdef __never_def__
213 /*
214 * We cannot define this or we may get into problems with DOS based systems.
215 */
216 extern int spawnv __PR((FILE *, FILE *, FILE *, int, char * const *));
217 extern int spawnl __PR((FILE *, FILE *, FILE *, const char *, ...));
218 extern int spawnv_nowait __PR((FILE *, FILE *, FILE *,
219 const char *, int, char *const*));
220 #endif /* __never_def__ */
221 #endif /* EOF */
222
223 /*
224 * Flags for absfpath() and resolvefpath():
225 */
226 #define RSPF_EXIST 0x01 /* All path components must exist */
227 #define RSPF_NOFOLLOW_LAST 0x02 /* Don't follow link in last pathcomp */
228
229 #ifdef FOUND_SIZE_T
230 extern char *abspath __PR((const char *relp, char *absp, size_t asize));
231 extern char *absnpath __PR((const char *relp, char *absp, size_t asize));
232 extern char *absfpath __PR((const char *relp, char *absp, size_t asize,
233 int __flags));
234 #ifndef HAVE_RESOLVEPATH
235 extern int resolvepath __PR((const char *__path,
236 char *__buf, size_t __bufsiz));
237 #endif
238 extern int resolvenpath __PR((const char *__path,
239 char *__buf, size_t __bufsiz));
240 extern int resolvefpath __PR((const char *__path,
241 char *__buf, size_t __bufsiz, int __flags));
242 #endif
243
244 #ifdef _SCHILY_TYPES_H
245 extern int mkdirs __PR((char *, mode_t));
246 extern int makedirs __PR((char *, mode_t, int __striplast));
247 #endif
248
249 extern int lxchdir __PR((char *));
250 #ifdef HAVE_FCHDIR
251 #define fdsetname(fd, name) (0)
252 #define fdclosename(fd) (0)
253 #else
254 extern int fdsetname __PR((int fd, const char *name));
255 extern int fdclosename __PR((int fd));
256 #endif
257 extern int diropen __PR((const char *));
258 extern int dirrdopen __PR((const char *));
259 extern int dirclose __PR((int));
260
261 struct save_wd {
262 int fd;
263 char *name;
264 };
265
266 extern int savewd __PR((struct save_wd *sp));
267 extern void closewd __PR((struct save_wd *sp));
268 extern int restorewd __PR((struct save_wd *sp));
269
270
271 #ifdef _SCHILY_UTYPES_H
272 typedef struct gnmult {
273 char key;
274 Llong mult;
275 } gnmult_t;
276
277 extern int getllnum __PR((char *arg, Llong *lvalp));
278 extern int getxnum __PR((char *arg, long *valp, gnmult_t *mult));
279 extern int getllxnum __PR((char *arg, Llong *lvalp, gnmult_t *mult));
280
281 extern int getlltnum __PR((char *arg, Llong *lvalp));
282 extern int getxtnum __PR((char *arg, time_t *valp, gnmult_t *mult));
283 extern int getllxtnum __PR((char *arg, Llong *lvalp, gnmult_t *mult));
284 #endif
285 extern int getnum __PR((char *arg, long *valp));
286 #ifdef _SCHILY_TIME_H
287 extern int gettnum __PR((char *arg, time_t *valp));
288 #endif
289
290 #ifdef _SCHILY_TIME_H
291
292 extern int getnstimeofday __PR((struct timespec *__tp));
293 extern int setnstimeofday __PR((struct timespec *__tp));
294
295 #ifdef _SCHILY_UTYPES_H
296 extern Llong mklgmtime __PR((struct tm *));
297 #endif
298 extern time_t mkgmtime __PR((struct tm *));
299 #endif
300
301
302 #ifdef EOF /* stdio.h has been included */
303 #ifdef _SCHILY_TYPES_H
304 /*
305 * getperm() flags:
306 */
307 #define GP_NOX 0 /* This is not a dir and 'X' is not valid */
308 #define GP_DOX 1 /* 'X' perm character is valid */
309 #define GP_XERR 2 /* 'X' perm characters are invalid */
310 #define GP_FPERM 4 /* TRUE if we implement find -perm */
311 #define GP_UMASK 8 /* TRUE if we implement umask */
312
313 extern int getperm __PR((FILE *f, char *perm, char *opname, \
314 mode_t *modep, int smode, int flag));
315 extern void permtostr __PR((mode_t mode, char *));
316 #endif
317 #endif
318
319 #ifdef FOUND_SIZE_T
320 extern ssize_t _niread __PR((int, void *, size_t));
321 extern ssize_t _niwrite __PR((int, void *, size_t));
322 extern ssize_t _nixread __PR((int, void *, size_t));
323 extern ssize_t _nixwrite __PR((int, void *, size_t));
324 #endif
325 extern int _openfd __PR((const char *, int));
326 extern int on_comerr __PR((void (*fun)(int, void *), void *arg));
327 /*PRINTFLIKE1*/
328 extern void comerr __PR((const char *, ...)) __printflike__(1, 2);
329 /*PRINTFLIKE2*/
330 extern void xcomerr __PR((int, const char *, ...)) __printflike__(2, 3);
331 /*PRINTFLIKE2*/
332 extern void comerrno __PR((int, const char *, ...)) __printflike__(2, 3);
333 /*PRINTFLIKE3*/
334 extern void xcomerrno __PR((int, int, const char *, ...)) __printflike__(3, 4);
335 /*PRINTFLIKE1*/
336 extern int errmsg __PR((const char *, ...)) __printflike__(1, 2);
337 /*PRINTFLIKE2*/
338 extern int errmsgno __PR((int, const char *, ...)) __printflike__(2, 3);
339 #ifdef FOUND_SIZE_T
340 /*PRINTFLIKE3*/
341 extern int serrmsg __PR((char *, size_t, const char *, ...))
342 __printflike__(3, 4);
343 /*PRINTFLIKE4*/
344 extern int serrmsgno __PR((int, char *, size_t, const char *, ...))
345 __printflike__(4, 5);
346 #endif
347 extern void comexit __PR((int));
348 extern char *errmsgstr __PR((int));
349
350 #ifdef EOF /* stdio.h has been included */
351 /*PRINTFLIKE2*/
352 extern void fcomerr __PR((FILE *, const char *, ...))
353 __printflike__(2, 3);
354 /*PRINTFLIKE3*/
355 extern void fxcomerr __PR((FILE *, int, const char *, ...))
356 __printflike__(3, 4);
357 /*PRINTFLIKE3*/
358 extern void fcomerrno __PR((FILE *, int, const char *, ...))
359 __printflike__(3, 4);
360 /*PRINTFLIKE4*/
361 extern void fxcomerrno __PR((FILE *, int, int, const char *, ...))
362 __printflike__(4, 5);
363 /*PRINTFLIKE2*/
364 extern int ferrmsg __PR((FILE *, const char *, ...))
365 __printflike__(2, 3);
366 /*PRINTFLIKE3*/
367 extern int ferrmsgno __PR((FILE *, int, const char *, ...))
368 __printflike__(3, 4);
369 #ifdef _SCHILY_VARARGS_H
370 #define COMERR_RETURN 0
371 #define COMERR_EXIT 1
372 #define COMERR_EXCODE 2
373 /*PRINTFLIKE5*/
374 extern int _comerr __PR((FILE *, int, int, int,
375 const char *, va_list));
376 #endif
377 #endif
378
379 /*PRINTFLIKE1*/
380 extern int error __PR((const char *, ...)) __printflike__(1, 2);
381 #ifdef FOUND_SIZE_T
382 extern char *fillbytes __PR((void *, ssize_t, char));
383 extern char *zerobytes __PR((void *, ssize_t));
384 extern char *findbytes __PR((const void *, ssize_t, char));
385 #endif
386 extern char *findinpath __PR((char *__name, int __mode,
387 BOOL __plain_file, char *__path));
388 extern int findline __PR((const char *, char, const char *,
389 int, char **, int));
390 extern int js_getline __PR((char *, int));
391 extern int getstr __PR((char *, int));
392 extern int breakline __PR((char *, char, char **, int));
393 extern int getallargs __PR((int *, char * const**, const char *, ...));
394 extern int getargs __PR((int *, char * const**, const char *, ...));
395 extern int getfiles __PR((int *, char * const**, const char *));
396 extern char *astoi __PR((const char *, int *));
397 extern char *astol __PR((const char *, long *));
398 extern char *astolb __PR((const char *, long *, int base));
399 #ifdef _SCHILY_UTYPES_H
400 extern char *astoll __PR((const char *, Llong *));
401 extern char *astollb __PR((const char *, Llong *, int));
402 extern char *astoull __PR((const char *, Ullong *));
403 extern char *astoullb __PR((const char *, Ullong *, int));
404 #endif
405
406 extern int patcompile __PR((const unsigned char *, int, int *));
407 extern unsigned char *patmatch __PR((const unsigned char *, const int *,
408 const unsigned char *,
409 int, int, int, int[]));
410 extern unsigned char *patlmatch __PR((const unsigned char *, const int *,
411 const unsigned char *,
412 int, int, int, int[]));
413
414 #ifdef __never__
415 extern int printf __PR((const char *, ...)) __printflike__(1, 2);
416 #endif
417 #ifdef FOUND_SIZE_T
418 extern char *movebytes __PR((const void *, void *, ssize_t));
419 #endif
420
421 extern void save_args __PR((int, char **));
422 extern int saved_ac __PR((void));
423 extern char **saved_av __PR((void));
424 extern char *saved_av0 __PR((void));
425 extern char *searchfileinpath __PR((char *__name, int __mode,
426 int __file_mode, char *__path));
427 #define SIP_ANY_FILE 0x00 /* Search for any file type */
428 #define SIP_PLAIN_FILE 0x01 /* Search for plain files - not dirs */
429 #define SIP_NO_PATH 0x10 /* Do not do PATH search */
430 #define SIP_ONLY_PATH 0x20 /* Do only PATH search */
431 #define SIP_NO_STRIPBIN 0x40 /* Do not strip "/bin" from PATH elem. */
432 #define SIP_TYPE_MASK 0x0F /* Mask file type related bits */
433
434 #ifndef seterrno
435 extern int seterrno __PR((int));
436 #endif
437 extern void set_progname __PR((const char *));
438 extern char *get_progname __PR((void));
439 extern char *get_progpath __PR((void));
440 extern char *getexecpath __PR((void));
441
442 extern void setfp __PR((void * const *));
443 extern int wait_chld __PR((int)); /* for fspawnv_nowait() */
444 extern int geterrno __PR((void));
445 extern void raisecond __PR((const char *, long));
446 #ifdef __never__
447 /*
448 * sprintf() may be declared incorrectly somewhere else
449 * e.g. in old BSD include files
450 */
451 extern int sprintf __PR((char *, const char *, ...));
452 #endif
453 extern char *strcatl __PR((char *, ...));
454 #ifdef FOUND_SIZE_T
455 extern size_t strlcatl __PR((char *, size_t, ...));
456 #endif
457 extern int streql __PR((const char *, const char *));
458 #ifdef _SCHILY_WCHAR_H
459 extern wchar_t *wcscatl __PR((wchar_t *, ...));
460 #ifdef FOUND_SIZE_T
461 extern size_t wcslcatl __PR((wchar_t *, size_t, ...));
462 #endif
463 extern int wcseql __PR((const wchar_t *, const wchar_t *));
464 #endif
465 #ifdef va_arg
466 extern int format __PR((void (*)(char, long), long, const char *,
467 va_list));
468 extern int fprformat __PR((long, const char *, va_list));
469 #else
470 extern int format __PR((void (*)(char, long), long, const char *, void *));
471 extern int fprformat __PR((long, const char *, void *));
472 #endif
473
474 extern int ftoes __PR((char *, double, int, int));
475 extern int ftofs __PR((char *, double, int, int));
476 #ifdef HAVE_LONGDOUBLE
477 extern int qftoes __PR((char *, long double, int, int));
478 extern int qftofs __PR((char *, long double, int, int));
479 #endif
480
481 /*PRINTFLIKE1*/
482 extern int js_error __PR((const char *, ...)) __printflike__(1, 2);
483 /*PRINTFLIKE2*/
484 extern int js_dprintf __PR((int, const char *, ...))
485 __printflike__(2, 3);
486 #ifdef EOF /* stdio.h has been included */
487 /*PRINTFLIKE2*/
488 extern int js_fprintf __PR((FILE *, const char *, ...))
489 __printflike__(2, 3);
490 #endif /* EOF */
491 /*PRINTFLIKE1*/
492 extern int js_printf __PR((const char *, ...)) __printflike__(1, 2);
493 #ifdef FOUND_SIZE_T
494 /*PRINTFLIKE3*/
495 extern int js_snprintf __PR((char *, size_t, const char *, ...))
496 __printflike__(3, 4);
497 #endif
498 /*PRINTFLIKE2*/
499 extern int js_sprintf __PR((char *, const char *, ...))
500 __printflike__(2, 3);
501
502 #ifdef FOUND_SIZE_T
503 extern void swabbytes __PR((void *, ssize_t));
504 #endif
505 extern char **getmainfp __PR((void));
506 extern char **getavp __PR((void));
507 extern char *getav0 __PR((void));
508 extern void **getfp __PR((void));
509 extern int flush_reg_windows __PR((int));
510 #ifdef FOUND_SIZE_T
511 extern ssize_t cmpbytes __PR((const void *, const void *, ssize_t));
512 extern int cmpmbytes __PR((const void *, const void *, ssize_t));
513 extern ssize_t cmpnullbytes __PR((const void *, ssize_t));
514 #endif
515
516 #ifdef nonono
517 #if defined(HAVE_LARGEFILES)
518 /*
519 * To allow this, we need to figure out how to do autoconfiguration for off64_t
520 */
521 extern FILE *_fcons64 __PR((FILE *, int, int));
522 extern FILE *fdup64 __PR((FILE *));
523 extern FILE *fileluopen64 __PR((int, const char *));
524 extern FILE *fileopen64 __PR((const char *, const char *));
525 #ifdef FOUND_OFF_T
526 extern off64_t filepos64 __PR((FILE *));
527 #endif
528 extern FILE *filereopen64 __PR((const char *, const char *, FILE *));
529 #ifdef FOUND_OFF_T
530 extern int fileseek64 __PR((FILE *, off64_t));
531 extern off64_t filesize64 __PR((FILE *));
532 #endif
533 #ifdef S_IFMT
534 extern int filestat64 __PR((FILE *, struct stat *));
535 #endif
536 extern int _openfd64 __PR((const char *, int));
537 #endif
538 #endif
539
540 #ifndef NO_SCHILY_PRINT /* Define to disable *printf() redirects */
541 #ifdef SCHILY_PRINT
542 #ifdef __never__
543 #undef error
544 #define error js_error
545 #endif
546 #undef dprintf
547 #define dprintf js_dprintf
548 #undef fprintf
549 #define fprintf js_fprintf
550 #undef printf
551 #define printf js_printf
552 #undef snprintf
553 #define snprintf js_snprintf
554 #undef sprintf
555 #define sprintf js_sprintf
556 #else
557 #ifndef HAVE_SNPRINTF
558 #undef snprintf
559 #define snprintf js_snprintf
560 #endif
561 #endif
562 #endif
563
564 #ifndef NO_SCHILY_GETLINE /* Define to disable *getline() redirect */
565 #undef getline
566 #define getline js_getline
567 #undef fgetline
568 #define fgetline js_fgetline
569 #endif
570
571 #ifndef NO_SCHILY_FEXEC /* Define to disable fexec*() redirect */
572 #undef fexecl
573 #define fexecl js_fexecl
574 #undef fexecle
575 #define fexecle js_fexecle
576 #undef fexecv
577 #define fexecv js_fexecv
578 #undef fexecve
579 #define fexecve js_fexecve
580 #endif
581
582 #ifndef NO_SCHILY_FSPAWN /* Define to disable fspawn*() redirect */
583 #undef fspawnv
584 #define fspawnv js_fspawnv
585 #undef fspawnv_nowait
586 #define fspawnv_nowait js_fspawnv_nowait
587 #undef fspawnl
588 #define fspawnl js_fspawnl
589 #endif
590
591 extern int js_mexval __PR((int exval));
592 #ifdef FOUND_SIZE_T
593 extern void *js_malloc __PR((size_t size, char *msg));
594 extern void *js_realloc __PR((void *ptr, size_t size, char *msg));
595 #endif
596 extern char *js_savestr __PR((const char *s));
597
598 #ifdef _SCHILY_JMPDEFS_H
599
600 /*
601 * Special values for the "jmp" parameter.
602 *
603 * Control how the siglongjmp() should be handled:
604 */
605 #define JM_EXIT ((sigjmps_t *)-1) /* Call comexit(errno) instead */
606 #define JM_RETURN ((sigjmps_t *)0) /* Return instead */
607
608 extern int js_jmexval __PR((int exval));
609 #ifdef FOUND_SIZE_T
610 extern void *js_jmalloc __PR((size_t size, char *msg, sigjmps_t *jmp));
611 extern void *js_jrealloc __PR((void *ptr, size_t size, char *msg,
612 sigjmps_t *jmp));
613 #endif
614 extern char *js_jsavestr __PR((const char *s, sigjmps_t *jmp));
615
616 extern int js_fjmexval __PR((int exval));
617 #ifdef EOF /* stdio.h has been included */
618 #ifdef FOUND_SIZE_T
619 extern void *js_fjmalloc __PR((FILE *f, size_t size, char *msg,
620 sigjmps_t *jmp));
621 extern void *js_fjrealloc __PR((FILE *f, void *ptr, size_t size,
622 char *msg, sigjmps_t *jmp));
623 #endif
624 extern char *js_fjsavestr __PR((FILE *f, const char *s, sigjmps_t *jmp));
625 #endif /* EOF */
626 #endif /* _SCHILY_JMPDEFS_H */
627
628 #define ___mexval js_mexval
629 #define ___malloc js_malloc
630 #define ___realloc js_realloc
631 #define ___savestr js_savestr
632 #define __jmexval js_jmexval
633 #define __jmalloc js_jmalloc
634 #define __jrealloc js_jrealloc
635 #define __jsavestr js_jsavestr
636 #define __fjmalloc js_fjmalloc
637 #define __fjmexval js_fjmexval
638 #define __fjrealloc js_fjrealloc
639 #define __fjsavestr js_fjsavestr
640
641 #ifdef __cplusplus
642 }
643 #endif
644
645 #if defined(_JOS) || defined(JOS)
646 # ifndef _SCHILY_JOS_IO_H
647 # include <schily/jos_io.h>
648 # endif
649 #endif
650
651 #if !defined(_SCHILY_LIBPORT_H) && !defined(NO_LIBPORT_H)
652 #include <schily/libport.h>
653 #endif
654 #if !defined(_SCHILY_HOSTNAME_H) && defined(USE_HOSTNAME_H)
655 #include <schily/hostname.h>
656 #endif
657
658 #endif /* _SCHILY_SCHILY_H */