X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=internals%2F_PDCLIB_config.h;h=753080ba25cee8780f50c90f8d59f0cd9c0ac56d;hb=6da00d2f9ead7e732007fef0ae46c45523059f2d;hp=49afceeb2050b5c2eb8a57f569d58181e83a80a1;hpb=6d45909b9d6109c54bd0b79e508662fdd17b26d6;p=pdclib diff --git a/internals/_PDCLIB_config.h b/internals/_PDCLIB_config.h index 49afcee..753080b 100644 --- a/internals/_PDCLIB_config.h +++ b/internals/_PDCLIB_config.h @@ -16,6 +16,13 @@ /* The character (sequence) your platform uses as newline. */ #define _PDCLIB_endl "\n" +/* exit() can signal success to the host environment by the value of zero or */ +/* the constant EXIT_SUCCESS. Failure is signaled by EXIT_FAILURE. Note that */ +/* any other return value is "implementation-defined", i.e. your environment */ +/* is not required to handle it gracefully. Set your definitions here. */ +#define _PDCLIB_SUCCESS 0 +#define _PDCLIB_FAILURE -1 + /* -------------------------------------------------------------------------- */ /* Integers */ /* -------------------------------------------------------------------------- */ @@ -39,6 +46,30 @@ #define _PDCLIB_LONG_BYTES 4 #define _PDCLIB_LLONG_BYTES 8 +/* defines the div() function family that allows taking quotient */ +/* and remainder of an integer division in one operation. Many platforms */ +/* support this in hardware / opcode, and the standard permits ordering of */ +/* the return structure in any way to fit the hardware. That is why those */ +/* structs can be configured here. */ + +struct _PDCLIB_div_t +{ + int quot; + int rem; +}; + +struct _PDCLIB_ldiv_t +{ + long int quot; + long int rem; +}; + +struct _PDCLIB_lldiv_t +{ + long long int quot; + long long int rem; +}; + /* -------------------------------------------------------------------------- */ /* defines a set of integer types that are of a minimum width, and */ /* "usually fastest" on the system. (If, for example, accessing a single char */