Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/waterbox/libc/functions/_PDCLIB/_PDCLIB_fileops.c
2 views
1
/* _PDCLIB_fileops
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
#ifndef REGTEST
8
#include <stdio.h>
9
#include <stdint.h>
10
#include "_PDCLIB_glue.h"
11
#include <errno.h>
12
13
static bool readf( _PDCLIB_fd_t self, void * buf, size_t length,
14
size_t * numBytesRead )
15
{
16
errno = ENOTSUP;
17
return false;
18
}
19
20
static bool writef( _PDCLIB_fd_t self, const void * buf, size_t length,
21
size_t * numBytesWritten )
22
{
23
errno = ENOTSUP;
24
return false;
25
}
26
static bool seekf( _PDCLIB_fd_t self, int_fast64_t offset, int whence,
27
int_fast64_t* newPos )
28
{
29
errno = ENOTSUP;
30
return false;
31
}
32
33
static void closef( _PDCLIB_fd_t self )
34
{
35
errno = ENOTSUP;
36
}
37
38
const _PDCLIB_fileops_t _PDCLIB_fileops = {
39
.read = readf,
40
.write = writef,
41
.seek = seekf,
42
.close = closef,
43
};
44
45
#endif
46
47
#ifdef TEST
48
#include "_PDCLIB_test.h"
49
50
int main( void )
51
{
52
// Tested by stdio test cases
53
return TEST_RESULTS;
54
}
55
56
#endif
57
58