]> git.sur5r.net Git - cc65/blob - include/geos/gfile.h
functions that do not modify data take const char* as argument
[cc65] / include / geos / gfile.h
1 /*
2   GEOS filesystem functions
3
4   ported to small C on 25.12.1999
5   by Maciej 'YTM/Alliance' Witkowiak
6 */
7
8 #ifndef _GFILE_H
9 #define _GFILE_H
10
11 #ifndef _GSTRUCT_H
12 #include <geos/gstruct.h>
13 #endif
14
15 struct filehandle *__fastcall__ Get1stDirEntry(void);
16 struct filehandle *__fastcall__ GetNxtDirEntry(void);
17
18 char __fastcall__ FindFTypes(char *buffer, char ftype, char fmaxnum, const char *classtxt);
19
20 char __fastcall__ FindFile(const char *fname);
21 char __fastcall__ ReadFile(struct tr_se *myTrSe, char *buffer, int flength);
22 char __fastcall__ SaveFile(struct fileheader *myHeader);
23 char __fastcall__ FreeFile(struct tr_se myTable[]);
24 char __fastcall__ DeleteFile(const char *fname);
25 char __fastcall__ RenameFile(const char *source, const char *target);
26
27 char __fastcall__ ReadByte(void);
28
29 char __fastcall__ FollowChain(struct tr_se *startTrSe, char *buffer);
30 char __fastcall__ GetFHdrInfo(struct filehandle *myFile);
31
32 char __fastcall__ OpenRecordFile(const char *fname);
33 char __fastcall__ CloseRecordFile(void);
34 char __fastcall__ NextRecord(void);
35 char __fastcall__ PreviousRecord(void);
36 char __fastcall__ PointRecord(char);
37 char __fastcall__ DeleteRecord(void);
38 char __fastcall__ InsertRecord(void);
39 char __fastcall__ AppendRecord(void);
40 char __fastcall__ ReadRecord(char *buffer, int flength);
41 char __fastcall__ WriteRecord(const char *buffer, int flength);
42 char __fastcall__ UpdateRecordFile(void);
43
44 /* GEOS filetypes */
45 #define NOT_GEOS        0
46 #define BASIC           1
47 #define ASSEMBLY        2
48 #define DATA            3
49 #define SYSTEM          4
50 #define DESK_ACC        5
51 #define APPLICATION     6
52 #define APPL_DATA       7
53 #define FONT            8
54 #define PRINTER         9
55 #define INPUT_DEVICE    10
56 #define DISK_DEVICE     11
57 #define SYSTEM_BOOT     12
58 #define TEMPORARY       13
59 #define AUTO_EXEC       14
60 #define INPUT_128       15
61 #define NUMFILETYPES    16
62 /* supported structures */
63 #define SEQUENTIAL      0
64 #define VLIR            1
65 /* DOS filetypes */
66 #define DEL             0
67 #define SEQ             1
68 #define PRG             2
69 #define USR             3
70 #define REL             4
71 #define CBM             5
72 /* directory offsets */
73 /* offsets in dir entry */
74 #define FRST_FILE_ENTRY 2
75 #define OFF_CFILE_TYPE  0
76 #define OFF_DE_TR_SC    1
77 #define OFF_FNAME       3
78 #define OFF_GHDR_PTR    19
79 #define OFF_GSTRUC_TYPE 21
80 #define OFF_GFILE_TYPE  22
81 #define OFF_YEAR        23
82 #define OFF_SIZE        28
83 #define OFF_NXT_FILE    32
84 /* offsets in file header */
85 #define O_GHIC_WIDTH    2
86 #define O_GHIC_HEIGHT   3
87 #define O_GHIC_PIC      4
88 #define O_GHCMDR_TYPE   68
89 #define O_GHGEOS_TYPE   69
90 #define O_GHSTR_TYPE    70
91 #define O_GHST_ADDR     71
92 #define O_GHEND_ADDR    73
93 #define O_GHST_VEC      75
94 #define O_GHFNAME       77
95 #define O_128_FLAGS     96
96 #define O_GH_AUTHOR     97
97 #define O_GHP_DISK      97
98 #define O_GHP_FNAME     117
99 #define O_GHINFO_TXT    0xa0
100
101 #endif