]> pd.if.org Git - pdclib/blob - platform/win32/functions/_PDCLIB/_PDCLIB_close.c
Initial pass at a port to win32
[pdclib] / platform / win32 / functions / _PDCLIB / _PDCLIB_close.c
1 /* $Id$ */
2
3 /* _PDCLIB_close( _PDCLIB_fd_t fd )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 /* This is a stub example implementation of _PDCLIB_close()
10 */
11
12 #include <stdio.h>
13
14 #ifndef REGTEST
15 #include <_PDCLIB_glue.h>
16 #include <errno.h>
17 #include <windows.h>
18
19 void _PDCLIB_w32errno(void);
20 int _PDCLIB_close( HANDLE fd )
21 {
22     if(CloseHandle((HANDLE) fd))
23         return 0;
24     _PDCLIB_w32errno();
25     return 1;
26 }
27
28 #endif
29
30 #ifdef TEST
31 #include <_PDCLIB_test.h>
32
33 int main( void )
34 {
35     /* No testdriver; tested in driver for _PDCLIB_open(). */
36     return TEST_RESULTS;
37 }
38
39 #endif