]> pd.if.org Git - pdclib/blobdiff - functions/stdio/funlockfile.c
PDCLIB-15 PDCLIB-16:
[pdclib] / functions / stdio / funlockfile.c
diff --git a/functions/stdio/funlockfile.c b/functions/stdio/funlockfile.c
new file mode 100644 (file)
index 0000000..0845aab
--- /dev/null
@@ -0,0 +1,37 @@
+/* funlockfile(FILE * )\r
+\r
+   This file is part of the Public Domain C Library (PDCLib).\r
+   Permission is granted to use, modify, and / or redistribute at will.\r
+*/\r
+\r
+#include <stdio.h>\r
+#include <stdarg.h>\r
+\r
+#ifndef REGTEST\r
+#include <threads.h>\r
+#include <stdlib.h>\r
+\r
+void funlockfile( FILE * file )\r
+{\r
+    int res = mtx_unlock( &file->lock );\r
+    switch(res) {\r
+        case thrd_success:\r
+            return;\r
+\r
+        default:\r
+            abort();\r
+    }\r
+}\r
+\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+\r
+int main( void )\r
+{\r
+    // Not tested here - tested by other stdio test drivers\r
+    return TEST_RESULTS;\r
+}\r
+\r
+#endif\r