X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=internals%2F_PDCLIB_int.h;h=fc2b75bdd00e5a25c7dead5b965cfd6968590536;hb=9f87d9e27e74d9e06e0c93114ffd70a45ee152fa;hp=b5003af51557e7fea2adc6e16dd69513940cf9ef;hpb=36b77c1eaf2ffddb76ef8ed2e6acd046682875c7;p=pdclib diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index b5003af..fc2b75b 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -6,20 +6,16 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#ifndef _PDCLIB_INT_H +#define _PDCLIB_INT_H _PDCLIB_INT_H + /* -------------------------------------------------------------------------- */ /* You should not have to edit anything in this file; if you DO have to, it */ /* would be considered a bug / missing feature: notify the author(s). */ /* -------------------------------------------------------------------------- */ -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif - -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H _PDCLIB_AUX_H #include <_PDCLIB_aux.h> -#endif /* null pointer constant */ #define _PDCLIB_NULL 0 @@ -407,25 +403,17 @@ 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; -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 ]; +/* A mechanism for delayed evaluation. (Not sure if this is really necessary, so + no detailed documentation on the "why".) +*/ +int * _PDCLIB_errno_func( void ); /* -------------------------------------------------------------------------- */ /* lookup tables */ @@ -450,10 +438,4 @@ struct _PDCLIB_ctype_t unsigned char collation; }; -struct _PDCLIB_locale_t -{ - struct _PDCLIB_ctype_t * ctype; -}; - -struct _PDCLIB_locale_t _PDCLIB_locale_info; - +#endif