Subversion Repositories SvarDOS

Rev

Rev 591 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 591 Rev 608
Line 12... Line 12...
12
struct funchdr {
12
struct funchdr {
13
  unsigned char funcname[8];
13
  unsigned char funcname[8];
14
  unsigned short funcsiz;
14
  unsigned short funcsiz;
15
};
15
};
16
 
16
 
-
 
17
static unsigned char filebuff[1024];
-
 
18
 
17
 
19
 
18
/* fills a country struct with default values */
20
/* fills a country struct with default values */
19
static void country_default(struct country *countrydata) {
21
static void country_default(struct country *countrydata) {
20
 
22
 
21
  /* first clear the memory */
23
  /* first clear the memory */
Line 43... Line 45...
43
 
45
 
44
 
46
 
45
/* Loads data from a country.sys file into a country struct.
47
/* Loads data from a country.sys file into a country struct.
46
 * Returns 0 on success, non-zero otherwise. */
48
 * Returns 0 on success, non-zero otherwise. */
47
int country_read(struct country *countrydata, const char *fname) {
49
int country_read(struct country *countrydata, const char *fname) {
48
  unsigned char filebuff[1024];
-
 
49
  short firstentryoffs;
50
  short firstentryoffs;
50
  unsigned char *subfunctions[16] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
51
  unsigned char *subfunctions[16] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
51
                                     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
52
                                     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
52
  short filesize;
53
  short filesize;
53
  short subfunctionscount;
54
  short subfunctionscount;
Line 127... Line 128...
127
 
128
 
128
 
129
 
129
/* Computes a new country.sys file based on data from a country struct.
130
/* Computes a new country.sys file based on data from a country struct.
130
 * Returns 0 on success, non-zero otherwise. */
131
 * Returns 0 on success, non-zero otherwise. */
131
int country_write(const char *fname, struct country *c) {
132
int country_write(const char *fname, struct country *c) {
132
  unsigned char filebuff[1024];
-
 
133
  short filesize = 0;
133
  short filesize = 0;
134
  FILE *fd;
134
  FILE *fd;
135
  int x;
135
  int x;
136
  short subfunction_id[7] = {1,2,4,5,6,7,35};
136
  short subfunction_id[7] = {1,2,4,5,6,7,35};
137
  short subfunction_ptr[7];
137
  short subfunction_ptr[7];