]> pd.if.org Git - pdclib/blobdiff - platform/example/functions/_PDCLIB/rename.c
PDCLib includes with quotes, not <>.
[pdclib] / platform / example / functions / _PDCLIB / rename.c
index 9996e7c73bf0882dc15c904aeb9b5dc1b32e1593..8ae31f6b517204f56047d77a43a3f838b362700b 100644 (file)
@@ -1,42 +1,29 @@
-/* $Id$ */
-
-/* Release $Name$ */
-
 /* _PDCLIB_rename( const char *, const char * )
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
+#include <stdio.h>
+
 #ifndef REGTEST
-#include <unistd.h>
-#include <_PDCLIB_glue.h>
+#include "_PDCLIB_glue.h"
+#include <errno.h>
 
 int _PDCLIB_rename( const char * old, const char * new )
 {
-    /* Note that the behaviour if new file exists is implementation-defined.
-       There is nothing wrong with either overwriting it or failing the
-       operation, but you might want to document whichever you chose.
-       This example fails if new file exists.
-    */
-    if ( link( old, new ) == 0 )
-    {
-        return unlink( old );
-    }
-    else
-    {
-        return -1;
-    }
+    errno = ENOTSUP;
 }
 
 #endif
 
 #ifdef TEST
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
+
+#include <stdlib.h>
 
 int main( void )
 {
-    TESTCASE( NO_TESTDRIVER );
     return TEST_RESULTS;
 }