X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Fftrylockfile.c;h=efb67199bee0b7e86c38b365f954a5d48083e551;hp=a06dc57048a52944fdba54a9118988ede026f877;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=5d2d7d278a2fabd52a252676c6e5b1bb9be630c7 diff --git a/functions/stdio/ftrylockfile.c b/functions/stdio/ftrylockfile.c index a06dc57..efb6719 100644 --- a/functions/stdio/ftrylockfile.c +++ b/functions/stdio/ftrylockfile.c @@ -1,40 +1,40 @@ -/* ftrylockfile( FILE * ) - - This file is part of the Public Domain C Library (PDCLib). - Permission is granted to use, modify, and / or redistribute at will. -*/ - -#include -#include - -#ifndef REGTEST -#include <_PDCLIB_io.h> -#include -#include - -int _PDCLIB_ftrylockfile( FILE * file ) -{ - int res = mtx_trylock( &file->lock ); - switch(res) { - case thrd_success: - return 0; - case thrd_busy: - return 1; - - default: - abort(); - } -} - -#endif - -#ifdef TEST -#include <_PDCLIB_test.h> - -int main( void ) -{ - // Not tested here - tested by other stdio test drivers - return TEST_RESULTS; -} - -#endif +/* ftrylockfile( FILE * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#include + +#ifndef REGTEST +#include "_PDCLIB_io.h" +#include +#include + +int _PDCLIB_ftrylockfile( FILE * file ) +{ + int res = mtx_trylock( &file->lock ); + switch(res) { + case thrd_success: + return 0; + case thrd_busy: + return 1; + + default: + abort(); + } +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + // Not tested here - tested by other stdio test drivers + return TEST_RESULTS; +} + +#endif