X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=internals%2F_PDCLIB_int.h;h=a46c2dc6c7f93014a58cb85a3949e976891ce821;hb=ce0e5d8cd76b50f239fb8e95170502b146247b35;hp=0bad643c589157544f073781d1b33684f07c08e3;hpb=e34c756b945fd7970875fd42e81e636fe5dbd247;p=pdclib diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index 0bad643..a46c2dc 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -407,22 +407,38 @@ void _PDCLIB_closeall( void ); /* errno */ /* -------------------------------------------------------------------------- */ +/* If PDCLib would call its error number "errno" directly, there would be no way + to catch its value from underlying system calls that also use it (i.e., POSIX + operating systems). That is why we use an internal name, providing a means to + access it through . +*/ extern int _PDCLIB_errno; + +/* A mechanism for delayed evaluation. (Not sure if this is really necessary, so + no detailed documentation on the "why".) +*/ int * _PDCLIB_errno_func( void ); -/* ERANGE and EDOM are specified by the standard. */ -#define _PDCLIB_ERANGE 1 -#define _PDCLIB_EDOM 2 -/* Used in the example implementation for any kind of I/O error. */ -#define _PDCLIB_EIO 3 -/* Used in the example implementation for "unknown error". */ -#define _PDCLIB_EUNKNOWN 4 -/* Used in the example implementation for "invalid parameter value". */ -#define _PDCLIB_EINVAL 5 -/* Used in the example implementation for "I/O retries exceeded". */ -#define _PDCLIB_ERETRY 6 -/* One larger than the largest used errno */ -#define _PDCLIB_EMAX 7 - -/* TODO: Doing this via a static array is not the way to do it. */ -char const * _PDCLIB_errno_texts[ _PDCLIB_EMAX ]; +/* -------------------------------------------------------------------------- */ +/* lookup tables */ +/* -------------------------------------------------------------------------- */ + +#define _PDCLIB_CTYPE_ALPHA 1 +#define _PDCLIB_CTYPE_BLANK 2 +#define _PDCLIB_CTYPE_CNTRL 4 +#define _PDCLIB_CTYPE_GRAPH 8 +#define _PDCLIB_CTYPE_PUNCT 16 +#define _PDCLIB_CTYPE_SPACE 32 +#define _PDCLIB_CTYPE_LOWER 64 +#define _PDCLIB_CTYPE_UPPER 128 +#define _PDCLIB_CTYPE_DIGIT 256 +#define _PDCLIB_CTYPE_XDIGT 512 + +struct _PDCLIB_ctype_t +{ + _PDCLIB_uint16_t flags; + unsigned char upper; + unsigned char lower; + unsigned char collation; +}; +