Make ef_open() extend files with fixed size automatically
Turns the fixed size into an invariant. Before, the files utility created them empty, then extended them.
This commit is contained in:
parent
31b9ff08f3
commit
7d2269b5ae
2 changed files with 49 additions and 35 deletions
|
@ -136,8 +136,6 @@ main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
ef_extend(EF_GAME, 1);
|
||||
ef_extend(EF_NATION, MAXNOC);
|
||||
ef_read(EF_NATION, 0, &nat);
|
||||
strcpy(nat.nat_cnam, "POGO");
|
||||
strcpy(nat.nat_pnam, "peter");
|
||||
|
@ -147,7 +145,6 @@ main(int argc, char *argv[])
|
|||
nat.nat_flags |= NF_FLASH;
|
||||
ef_write(EF_NATION, 0, &nat);
|
||||
printf("All praise to %s!\n", nat.nat_cnam);
|
||||
ef_extend(EF_REALM, MAXNOC * MAXNOR);
|
||||
if (mkdir(teldir, S_IRWXU | S_IRWXG) < 0 && errno != EEXIST) {
|
||||
perror(teldir);
|
||||
printf("Can't make telegram directory\n");
|
||||
|
@ -159,10 +156,6 @@ main(int argc, char *argv[])
|
|||
}
|
||||
close(creat(annfil, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
|
||||
|
||||
ef_extend(EF_SECTOR, WORLD_SZ());
|
||||
ef_extend(EF_MAP, MAXNOC);
|
||||
ef_extend(EF_BMAP, MAXNOC);
|
||||
|
||||
for (i = 0; i < EF_MAX; i++) {
|
||||
if (!EF_IS_GAME_STATE(i))
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue