Debian Codegraph @

acorn/riscos.h

raw
1 /*
2 Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
3
4 See the accompanying file LICENSE, version 2000-Apr-09 or later
5 (the contents of which are also included in zip.h) for terms of use.
6 If, for some reason, all these files are missing, the Info-ZIP license
7 also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
8 */
9 /* riscos.h */
10
11 #ifndef __riscos_h
12 #define __riscos_h
13
14 #include <time.h>
15 #include <stdio.h>
16
17 typedef struct {
18 int errnum;
19 char errmess[252];
20 } os_error;
21
22 #ifndef __swiven_h
23 # include "swiven.h"
24 #endif
25
26 #define MAXPATHLEN 256
27 #define MAXFILENAMELEN 64 /* should be 11 for ADFS, 13 for DOS, 64 seems a sensible value... */
28 #define DIR_BUFSIZE 1024 /* this should be enough to read a whole E-Format directory */
29
30 struct stat {
31 unsigned int st_dev;
32 int st_ino;
33 unsigned int st_mode;
34 int st_nlink;
35 unsigned short st_uid;
36 unsigned short st_gid;
37 unsigned int st_rdev;
38 unsigned int st_size;
39 unsigned int st_blksize;
40 time_t st_atime;
41 time_t st_mtime;
42 time_t st_ctime;
43 };
44
45 typedef struct {
46 char *dirname;
47 void *buf;
48 int size;
49 char *act;
50 int offset;
51 int read;
52 } DIR;
53
54 #define dstrm DIR
55
56 struct dirent {
57 unsigned int d_off; /* offset of next disk directory entry */
58 int d_fileno; /* file number of entry */
59 size_t d_reclen; /* length of this record */
60 size_t d_namlen; /* length of d_name */
61 char d_name[MAXFILENAMELEN]; /* name */
62 };
63
64 typedef struct {
65 unsigned int load_addr;
66 unsigned int exec_addr;
67 int lenght;
68 int attrib;
69 int objtype;
70 char name[13];
71 } riscos_direntry;
72
73 #define SPARKID 0x4341 /* = "AC" */
74 #define SPARKID_2 0x30435241 /* = "ARC0" */
75
76 typedef struct {
77 short ID;
78 short size;
79 int ID_2;
80 unsigned int loadaddr;
81 unsigned int execaddr;
82 int attr;
83 int zero;
84 } extra_block;
85
86
87 #define S_IFMT 0770000
88
89 #define S_IFDIR 0040000
90 #define S_IFREG 0100000 /* 0200000 in UnixLib !?!?!?!? */
91
92 #ifndef S_IEXEC
93 # define S_IEXEC 0000100
94 # define S_IWRITE 0000200
95 # define S_IREAD 0000400
96 #endif
97
98 extern char *exts2swap; /* Extensions to swap */
99
100 int stat(char *filename,struct stat *res);
101 DIR *opendir(char *dirname);
102 struct dirent *readdir(DIR *d);
103 char *readd(DIR *d);
104 void closedir(DIR *d);
105 int unlink(char *f);
106 int chmod(char *file, int mode);
107 void setfiletype(char *fname,int ftype);
108 void getRISCOSexts(char *envstr);
109 int checkext(char *suff);
110 int swapext(char *name, char *exptr);
111 void remove_prefix(void);
112 void set_prefix(void);
113 struct tm *riscos_localtime(const time_t *timer);
114 struct tm *riscos_gmtime(const time_t *timer);
115
116 int riscos_fseek(FILE *fd, long offset, int whence);
117 /* work around broken assumption that fseek() is OK with -ve file offsets */
118
119 #endif /* !__riscos_h */