]> pd.if.org Git - pdclib/blob - platform/win32/functions/_PDCLIB/_PDCLIB_rename.c
PDCLib includes with quotes, not <>.
[pdclib] / platform / win32 / functions / _PDCLIB / _PDCLIB_rename.c
1 /* _PDCLIB_rename( const char *, const char * )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8
9 #ifndef REGTEST
10 #include "_PDCLIB_glue.h"
11 #include <errno.h>
12 #include <windows.h>
13
14 void _PDCLIB_w32errno( void );
15 int _PDCLIB_rename( const char * old, const char * new )
16 {
17
18     BOOL ok = MoveFile(old, new);
19     if(!ok) {
20         _PDCLIB_w32errno();
21     }
22     return !ok;
23 }
24
25 #endif
26
27 #ifdef TEST
28 #include "_PDCLIB_test.h"
29
30 #include <stdlib.h>
31
32 int main( void )
33 {
34     return TEST_RESULTS;
35 }
36
37 #endif