Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/waterbox/libc/internals/_PDCLIB_glue.h
2 views
1
/* OS glue functions declaration <_PDCLIB_glue.h>
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 __PDCLIB_GLUE_H
8
#define __PDCLIB_GLUE_H __PDCLIB_GLUE_H
9
10
#include "_PDCLIB_int.h"
11
#include "_PDCLIB_io.h"
12
13
#include <stdbool.h>
14
#include <stddef.h>
15
16
#ifdef __cplusplus
17
extern "C" {
18
#endif
19
20
/* -------------------------------------------------------------------------- */
21
/* OS "glue", part 2 */
22
/* These are the functions you will have to touch, as they are where PDCLib */
23
/* interfaces with the operating system. */
24
/* They operate on data types partially defined by _PDCLIB_config.h. */
25
/* -------------------------------------------------------------------------- */
26
27
/* stdlib.h */
28
29
/* A system call that terminates the calling process, returning a given status
30
to the environment.
31
*/
32
_PDCLIB_noreturn void _PDCLIB_Exit( int status );
33
34
void *_PDCLIB_sbrk( size_t n );
35
36
/* stdio.h */
37
38
/* Open the file with the given name and mode. Return the file descriptor in
39
* *fd and a pointer to the operations structure in **ops on success.
40
*
41
* Return true on success and false on failure.
42
*/
43
bool _PDCLIB_open(
44
_PDCLIB_fd_t* fd, const _PDCLIB_fileops_t** ops,
45
char const * filename, unsigned int mode );
46
47
/* A system call that removes a file identified by name. Return zero on success,
48
non-zero otherwise.
49
*/
50
int _PDCLIB_remove( const char * filename );
51
52
/* A system call that renames a file from given old name to given new name.
53
Return zero on success, non-zero otherwise. In case of failure, the file
54
must still be accessible by old name. Any handling of open files etc. is
55
done by standard rename() already.
56
*/
57
int _PDCLIB_rename( const char * old, const char * newn);
58
59
#ifdef __cplusplus
60
}
61
#endif
62
63
#endif
64
65