X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_close.c;fp=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_close.c;h=7fc10a3ce89424a72258b7ef535bc6a26ab1df37;hb=950d2e48042173a75188b0a2dbe219ed91ff47cf;hp=0000000000000000000000000000000000000000;hpb=10f020f1a39804bbef8cd1cf35ef7c9a8e75c7d6;p=pdclib.old diff --git a/platform/win32/functions/_PDCLIB/_PDCLIB_close.c b/platform/win32/functions/_PDCLIB/_PDCLIB_close.c new file mode 100644 index 0000000..7fc10a3 --- /dev/null +++ b/platform/win32/functions/_PDCLIB/_PDCLIB_close.c @@ -0,0 +1,39 @@ +/* $Id$ */ + +/* _PDCLIB_close( _PDCLIB_fd_t fd ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +/* This is a stub example implementation of _PDCLIB_close() +*/ + +#include + +#ifndef REGTEST +#include <_PDCLIB_glue.h> +#include +#include + +void _PDCLIB_w32errno(void); +int _PDCLIB_close( HANDLE fd ) +{ + if(CloseHandle((HANDLE) fd)) + return 0; + _PDCLIB_w32errno(); + return 1; +} + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + /* No testdriver; tested in driver for _PDCLIB_open(). */ + return TEST_RESULTS; +} + +#endif