OSDN Git Service

Merge remote-tracking branch 'remotes/hengbandosx/english-mind-edits' into feature...
[hengband/hengband.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(huge usecs);
31 #endif
32 #endif
33
34 #define FILE_READ_BUFF_SIZE 65535
35 extern char *file_read__buf;
36 extern char *file_read__swp;
37 extern char *file_read__tmp;
38
39 errr path_parse(char *buf, int max, concptr file);
40 errr path_build(char *buf, int max, concptr path, concptr file);
41 FILE *angband_fopen(concptr file, concptr mode);
42 FILE *angband_fopen_temp(char *buf, int max);
43 errr angband_fgets(FILE *fff, char *buf, huge n);
44 errr angband_fputs(FILE *fff, concptr buf, huge n);
45 errr angband_fclose(FILE *fff);
46 errr fd_kill(concptr file);
47 errr fd_move(concptr file, concptr what);
48 errr fd_copy(concptr file, concptr what);
49 int fd_make(concptr file, BIT_FLAGS mode);
50 int fd_open(concptr file, int flags);
51 errr fd_lock(int fd, int what);
52 errr fd_seek(int fd, huge n);
53 errr fd_chop(int fd, huge n);
54 errr fd_read(int fd, char *buf, huge n);
55 errr fd_write(int fd, concptr buf, huge n);
56 errr fd_close(int fd);