37#ifndef _SCHILY_SCHILY_H
38#define _SCHILY_SCHILY_H
40#ifndef _SCHILY_MCONFIG_H
44#ifndef _SCHILY_STANDARD_H
47#ifndef _SCHILY_CCOMDEFS_H
55#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(off_t)
60#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(size_t)
65#if defined(_MSC_VER) && !defined(_SIZE_T_DEFINED)
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)
90#if defined(HAVE_LARGEFILES)
91# define _fcons _fcons64
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
114#if defined(HAVE_RAW_FEXECL) || defined(HAVE_RAW_FEXECLE) || \
115 defined(HAVE_RAW_FEXECV) || defined(HAVE_RAW_FEXECVE)
118#if defined(HAVE_RAW_FSPAWNV) || defined(HAVE_RAW_FSPAWNL) || \
119 defined(HAVE_RAW_FSPAWNV_NOWAIT)
122#if defined(HAVE_RAW_GETLINE) || defined(HAVE_RAW_FGETLINE)
123#define RENAME_GETLINE
129#define RENAME_GETLINE
132#if defined(RENAME_FEXEC) || defined(RENAME_FSPAWN)
133#ifndef _SCHILY_UNISTD_H
138#if defined(RENAME_GETLINE)
139#ifndef _SCHILY_STDIO_H
147extern int _cvmod __PR((
const char *,
int *,
int *));
150#if !defined(fdown) || defined(PROTOTYPES)
164 char *
const *,
char *
const *));
168 const char *,
int,
char *
const*));
174extern int fgetstr
__PR((
FILE *,
char *,
int));
175extern int file_getraise
__PR((
FILE *));
176extern void file_raise
__PR((
FILE *,
int));
178extern FILE *fileluopen
__PR((
int,
const char *));
180#ifdef _SCHILY_TYPES_H
190extern FILE *filereopen
__PR((
const char *,
const char *,
FILE *));
207extern int getbroken
__PR((
FILE *,
char *,
char,
char **,
int));
208extern int ofindline
__PR((
FILE *,
char,
const char *,
int,
219 const char *,
int,
char *
const*));
226#define RSPF_EXIST 0x01
227#define RSPF_NOFOLLOW_LAST 0x02
230extern char *abspath
__PR((
const char *relp,
char *absp,
size_t asize));
231extern char *absnpath
__PR((
const char *relp,
char *absp,
size_t asize));
232extern char *absfpath
__PR((
const char *relp,
char *absp,
size_t asize,
234#ifndef HAVE_RESOLVEPATH
235extern int resolvepath
__PR((
const char *__path,
236 char *__buf,
size_t __bufsiz));
238extern int resolvenpath
__PR((
const char *__path,
239 char *__buf,
size_t __bufsiz));
240extern int resolvefpath
__PR((
const char *__path,
241 char *__buf,
size_t __bufsiz,
int __flags));
244#ifdef _SCHILY_TYPES_H
246extern int makedirs
__PR((
char *,
mode_t,
int __striplast));
249extern int lxchdir
__PR((
char *));
251#define fdsetname(fd, name) (0)
252#define fdclosename(fd) (0)
257extern int diropen
__PR((
const char *));
258extern int dirrdopen
__PR((
const char *));
259extern int dirclose
__PR((
int));
271#ifdef _SCHILY_UTYPES_H
272typedef struct gnmult {
278extern int getxnum
__PR((
char *
arg,
long *valp, gnmult_t *mult));
279extern int getllxnum
__PR((
char *
arg,
Llong *lvalp, gnmult_t *mult));
282extern int getxtnum
__PR((
char *
arg,
time_t *valp, gnmult_t *mult));
283extern int getllxtnum
__PR((
char *
arg,
Llong *lvalp, gnmult_t *mult));
285extern int getnum
__PR((
char *
arg,
long *valp));
295#ifdef _SCHILY_UTYPES_H
303#ifdef _SCHILY_TYPES_H
313extern int getperm
__PR((
FILE *
f,
char *perm,
char *opname, \
322extern ssize_t _nixread
__PR((
int,
void *,
size_t));
323extern ssize_t _nixwrite
__PR((
int,
void *,
size_t));
341extern int serrmsg
__PR((
char *,
size_t,
const char *, ...))
344extern
int serrmsgno
__PR((
int,
char *,
size_t,
const char *, ...))
352extern void fcomerr
__PR((
FILE *,
const char *, ...))
361extern
void fxcomerrno
__PR((
FILE *,
int,
int,
const char *, ...))
369#ifdef _SCHILY_VARARGS_H
370#define COMERR_RETURN 0
372#define COMERR_EXCODE 2
384extern char *findbytes
__PR((
const void *,
ssize_t,
char));
386extern char *findinpath
__PR((
char *__name,
int __mode,
387 BOOL __plain_file,
char *__path));
388extern int findline
__PR((
const char *,
char,
const char *,
391extern int getstr
__PR((
char *,
int));
392extern int breakline
__PR((
char *,
char,
char **,
int));
394extern int getargs __PR((
int *,
char *
const**,
const char *, ...));
396extern char *astoi
__PR((
const char *,
int *));
397extern char *astol
__PR((
const char *,
long *));
398extern char *astolb
__PR((
const char *,
long *,
int base));
399#ifdef _SCHILY_UTYPES_H
402extern char *astoull
__PR((
const char *,
Ullong *));
403extern char *astoullb
__PR((
const char *,
Ullong *,
int));
407extern unsigned char *
patmatch __PR((
const unsigned char *,
const int *,
408 const unsigned char *,
409 int,
int,
int,
int[]));
410extern unsigned char *patlmatch
__PR((
const unsigned char *,
const int *,
411 const unsigned char *,
412 int,
int,
int,
int[]));
419extern char *movecbytes
__PR((
const void *,
void *,
int,
size_t));
427 int __file_mode,
char *__path));
428#define SIP_ANY_FILE 0x00
429#define SIP_PLAIN_FILE 0x01
430#define SIP_NO_PATH 0x10
431#define SIP_ONLY_PATH 0x20
432#define SIP_NO_STRIPBIN 0x40
433#define SIP_TYPE_MASK 0x0F
443extern void setfp
__PR((
void *
const *));
444extern int wait_chld
__PR((
int));
452extern int sprintf __PR((
char *,
const char *, ...));
454extern char *strcatl
__PR((
char *, ...));
456extern size_t strlcatl
__PR((
char *,
size_t, ...));
459#ifdef _SCHILY_WCHAR_H
460extern wchar_t *wcscatl
__PR((
wchar_t *, ...));
462extern size_t wcslcatl
__PR((
wchar_t *,
size_t, ...));
464extern int wcseql
__PR((
const wchar_t *,
const wchar_t *));
467extern int format __PR((
void (*)(
char,
void *),
void *,
const char *,
469extern int fprformat
__PR((
void *,
const char *,
va_list));
471extern int format __PR((
void (*)(
char,
void *),
void *,
const char *,
void *));
472extern int fprformat
__PR((
void *,
const char *,
void *));
476extern int ftofs __PR((
char *,
double,
int,
int));
477#ifdef HAVE_LONGDOUBLE
478extern int qftoes
__PR((
char *,
long double,
int,
int));
479extern int qftofs
__PR((
char *,
long double,
int,
int));
485extern
int js_dprintf
__PR((
int,
const char *, ...))
500extern int js_sprintf
__PR((
char *,
const char *, ...))
506extern char **getmainfp
__PR((
void));
507extern char **getavp
__PR((
void));
508extern char *getav0
__PR((
void));
509extern void **getfp
__PR((
void));
510extern int flush_reg_windows
__PR((
int));
513extern int cmpmbytes
__PR((
const void *,
const void *,
ssize_t));
518#if defined(HAVE_LARGEFILES)
524extern FILE *fileluopen64
__PR((
int,
const char *));
525extern FILE *fileopen64
__PR((
const char *,
const char *));
529extern FILE *filereopen64
__PR((
const char *,
const char *,
FILE *));
537extern int _openfd64
__PR((
const char *,
int));
541#ifndef NO_SCHILY_PRINT
545#define error js_error
548#define dprintf js_dprintf
550#define fprintf js_fprintf
552#define printf js_printf
554#define snprintf js_snprintf
556#define sprintf js_sprintf
560#define snprintf js_snprintf
565#ifndef NO_SCHILY_GETLINE
567#define getline js_getline
569#define fgetline js_fgetline
572#ifndef NO_SCHILY_FEXEC
574#define fexecl js_fexecl
576#define fexecle js_fexecle
578#define fexecv js_fexecv
580#define fexecve js_fexecve
583#ifndef NO_SCHILY_FSPAWN
585#define fspawnv js_fspawnv
587#define fspawnv_nowait js_fspawnv_nowait
589#define fspawnl js_fspawnl
592extern int js_mexval
__PR((
int exval));
594extern void *js_malloc
__PR((
size_t size,
char *
msg));
597extern char *js_savestr
__PR((
const char *
s));
599#ifdef _SCHILY_JMPDEFS_H
606#define JM_EXIT ((sigjmps_t *)-1)
607#define JM_RETURN ((sigjmps_t *)0)
609extern int js_jmexval
__PR((
int exval));
611extern void *js_jmalloc
__PR((
size_t size,
char *
msg, sigjmps_t *jmp));
615extern char *js_jsavestr
__PR((
const char *
s, sigjmps_t *jmp));
617extern int js_fjmexval
__PR((
int exval));
623 char *
msg, sigjmps_t *jmp));
625extern char *js_fjsavestr
__PR((
FILE *
f,
const char *
s, sigjmps_t *jmp));
629#define ___mexval js_mexval
630#define ___malloc js_malloc
631#define ___realloc js_realloc
632#define ___savestr js_savestr
633#define __jmexval js_jmexval
634#define __jmalloc js_jmalloc
635#define __jrealloc js_jrealloc
636#define __jsavestr js_jsavestr
637#define __fjmalloc js_fjmalloc
638#define __fjmexval js_fjmexval
639#define __fjrealloc js_fjrealloc
640#define __fjsavestr js_fjsavestr
646#if defined(_JOS) || defined(JOS)
647# ifndef _SCHILY_JOS_IO_H
648# include <schily/jos_io.h>
652#if !defined(_SCHILY_LIBPORT_H) && !defined(NO_LIBPORT_H)
655#if !defined(_SCHILY_HOSTNAME_H) && defined(USE_HOSTNAME_H)
656#include <schily/hostname.h>
char * astollb(const char *s, Llong *l, int base)
char * astoll(const char *s, Llong *l)
#define __printflike__(fmtarg, firstvararg)
EXPORT int _comerr(FILE *f, int exflg, int exc, int err, const char *msg, va_list args)
EXPORT char * errmsgstr(int err)
EXPORT void xcomerr(int exc, char *msg, va_alist)
EXPORT void comerrno(int err, char *msg, va_alist)
EXPORT void xcomerrno(int exc, int err, char *msg, va_alist)
EXPORT int errmsgno(int err, char *msg, va_alist)
EXPORT int on_comerr(void *func, void *arg)
EXPORT void comexit(int err)
EXPORT void comerr(char *msg, va_alist)
EXPORT int errmsg(char *msg, va_alist)
EXPORT int _cvmod(char *mode, int *omode, int *flag) const
EXPORT FILE * _fcons(FILE *fd, int f, int flag)
EXPORT int ftoes(register char *s, MDOUBLE val, register int fieldwidth, register int ndigits)
EXPORT int ftofs(register char *s, MDOUBLE val, register int fieldwidth, register int ndigits)
EXPORT ssize_t ffileread(FILE *f, void *buf, size_t len)
EXPORT int js_getline(char *buf, int len)
EXPORT int js_fgetline(register FILE *f, char *buf, register int len)
EXPORT FILE * fileopen(char *name, const char *mode) const
EXPORT ssize_t filewrite(FILE *f, void *vbuf, size_t len)
EXPORT char * fillbytes(void *tov, ssize_t cnt, char val)
EXPORT char * getexecpath()
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
__MINGW_EXTENSION typedef long long off64_t
EXPORT int js_printf(char *form, va_alist)
EXPORT int js_fprintf(FILE *file, char *form, va_alist)
EXPORT int js_snprintf(char *buf, unsigned maxcnt, char *form, va_alist)
#define sprintf(buf, format,...)
EXPORT char * movebytes(void *fromv, void *tov, ssize_t cnt) const
EXPORT ssize_t _niwrite(int f, void *buf, size_t count)
EXPORT void raisecond(char *signame, long arg2) const
EXPORT void set_progname(char *name) const
EXPORT void save_args(int ac, av)
EXPORT char * get_progname()
EXPORT char ** saved_av()
EXPORT char * saved_av0()
EXPORT char * get_progpath()
#define _openfd(name, omode)
_CRTIMP intptr_t __cdecl spawnv(_In_ int, _In_z_ const char *_Filename, _In_z_ char *const _ArgList[])
_CRTIMP intptr_t __cdecl spawnl(_In_ int, _In_z_ const char *_Filename, _In_z_ const char *_ArgList,...)
EXPORT char * searchfileinpath(char *name, int mode, int file_mode, char *path)
EXPORT int seterrno(int err)
EXPORT int streql(char *a, const char *b) const
EXPORT char * zerobytes(void *tov, ssize_t cnt)