]> pd.if.org Git - pdclib/blob - platform/example/functions/_PDCLIB/_PDCLIB_fileops.c
PDCLib includes with quotes, not <>.
[pdclib] / platform / example / functions / _PDCLIB / _PDCLIB_fileops.c
1 /* _PDCLIB_fileops\r
2 \r
3    This file is part of the Public Domain C Library (PDCLib).\r
4    Permission is granted to use, modify, and / or redistribute at will.\r
5 */\r
6 \r
7 #ifndef REGTEST\r
8 #include <stdio.h>\r
9 #include <stdint.h>\r
10 #include "_PDCLIB_glue.h"\r
11 #include <errno.h>\r
12 \r
13 static bool readf( _PDCLIB_fd_t self, void * buf, size_t length, \r
14                    size_t * numBytesRead )\r
15 {\r
16     errno = ENOTSUP;\r
17     return false;\r
18 }\r
19 \r
20 static bool writef( _PDCLIB_fd_t self, const void * buf, size_t length, \r
21                    size_t * numBytesWritten )\r
22 {\r
23     errno = ENOTSUP;\r
24     return false;\r
25 }\r
26 static bool seekf( _PDCLIB_fd_t self, int_fast64_t offset, int whence,\r
27     int_fast64_t* newPos )\r
28 {\r
29     errno = ENOTSUP;\r
30     return false;\r
31 }\r
32 \r
33 static void closef( _PDCLIB_fd_t self )\r
34 {\r
35     errno = ENOTSUP;\r
36 }\r
37 \r
38 const _PDCLIB_fileops_t _PDCLIB_fileops = {\r
39     .read  = readf,\r
40     .write = writef,\r
41     .seek  = seekf,\r
42     .close = closef,\r
43 };\r
44 \r
45 #endif\r
46 \r
47 #ifdef TEST\r
48 #include "_PDCLIB_test.h"\r
49 \r
50 int main( void )\r
51 {\r
52     // Tested by stdio test cases\r
53     return TEST_RESULTS;\r
54 }\r
55 \r
56 #endif\r