X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;ds=sidebyside;f=functions%2Ferrno%2Ferrno.c;fp=functions%2Ferrno%2Ferrno.c;h=75a564fbfd2033356944a2b49616c6e498835b75;hb=261086b873397b437ad024d44e9467f0fb2586ba;hp=0000000000000000000000000000000000000000;hpb=4321ebdd142b534d8b7b6c31e01790f77ac46319;p=pdclib diff --git a/functions/errno/errno.c b/functions/errno/errno.c new file mode 100644 index 0000000..75a564f --- /dev/null +++ b/functions/errno/errno.c @@ -0,0 +1,37 @@ +/* _PDCLIB_errno + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#ifndef REGTEST +#include + +/* Temporary */ + +static int _PDCLIB_errno = 0; + +int * _PDCLIB_errno_func() +{ + return &_PDCLIB_errno; +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + errno = 0; + TESTCASE( errno == 0 ); + errno = EDOM; + TESTCASE( errno == EDOM ); + errno = ERANGE; + TESTCASE( errno == ERANGE ); + return TEST_RESULTS; +} + +#endif +