]> pd.if.org Git - pdclib/blob - platform/win32/functions/stdio/remove.c
913bdf3bee2aa6a95bed1f8288ab9c75146c40dd
[pdclib] / platform / win32 / functions / stdio / remove.c
1 /* $Id$ */
2
3 /* remove( const char * )
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 an example implementation of remove() fit for use with POSIX kernels.
10 */
11
12 #include <stdio.h>
13
14 #ifndef REGTEST
15
16 #include <string.h>
17 #include <errno.h>
18 #include <windows.h>
19
20 extern struct _PDCLIB_file_t * _PDCLIB_filelist;
21
22 extern void _PDCLIB_w32errno( void );
23 int remove( const char * pathname )
24 {
25     BOOL ok = DeleteFileA( pathname );
26     if(!ok) {
27         _PDCLIB_w32errno();
28         return -1;
29     } else return 0;
30 }
31
32 #endif
33
34 #ifdef TEST
35 #include <_PDCLIB_test.h>
36
37 int main( void )
38 {
39     /* Testing covered by ftell.c (and several others) */
40     return TEST_RESULTS;
41 }
42
43 #endif
44