OSDN Git Service

Merge pull request #1829 from sikabane-works/feature/refactor-rbe_type
[hengbandforosx/hengbandosx.git] / src / util / angband-files.h
1 #pragma once
2
3 #include "system/angband.h"
4
5 /* Force definitions -- see fd_seek() */
6 #ifndef SEEK_SET
7 #define SEEK_SET 0
8 #endif
9 #ifndef SEEK_CUR
10 #define SEEK_CUR 1
11 #endif
12 #ifndef SEEK_END
13 #define SEEK_END 2
14 #endif
15
16 /* Force definitions -- see fd_lock() */
17 #ifndef F_UNLCK
18 #define F_UNLCK 0
19 #endif
20 #ifndef F_RDLCK
21 #define F_RDLCK 1
22 #endif
23 #ifndef F_WRLCK
24 #define F_WRLCK 2
25 #endif
26
27 #ifdef SET_UID
28 extern void user_name(char *buf, int id);
29 #ifndef HAVE_USLEEP
30 extern int usleep(ulong usecs);
31 #endif
32 #endif
33
34 #define FILE_READ_BUFF_SIZE 65535
35
36 errr path_parse(char *buf, int max, concptr file);
37 errr path_build(char *buf, int max, concptr path, concptr file);
38 FILE *angband_fopen(concptr file, concptr mode);
39 FILE *angband_fopen_temp(char *buf, int max);
40 errr angband_fgets(FILE *fff, char *buf, ulong n);
41 errr angband_fputs(FILE *fff, concptr buf, ulong n);
42 errr angband_fclose(FILE *fff);
43 errr fd_kill(concptr file);
44 errr fd_move(concptr file, concptr what);
45 errr fd_copy(concptr file, concptr what);
46 int fd_make(concptr file, BIT_FLAGS mode);
47 int fd_open(concptr file, int flags);
48 errr fd_lock(int fd, int what);
49 errr fd_seek(int fd, ulong n);
50 errr fd_chop(int fd, ulong n);
51 errr fd_read(int fd, char *buf, ulong n);
52 errr fd_write(int fd, concptr buf, ulong n);
53 errr fd_close(int fd);