Move realms from the nation file into a new realms file:

(boundstr, realmstr): Rename, new members ef_type, r_cnum, r_uid,
r_realm, r_timestamp.
(natstr): Remove member nat_b[].
(EF_REALM, realm_ca): New.
(empfile): Add it.
(ef_open_srv, ef_close_srv, main): Deal with new file.
(getrealm, putrealm): New.
(add, new, real, list_realm, sarg_getrange): Use them.
This commit is contained in:
Ron Koenderink 2006-01-13 13:18:56 +00:00
parent 04a8b84592
commit 45adbdb00e
11 changed files with 94 additions and 34 deletions

View file

@ -79,8 +79,9 @@ main(int argc, char *argv[])
s_char *filename;
int x, y;
struct natstr nat;
struct realmstr realm;
struct sctstr sct;
int i;
int i, j;
s_char *map;
int opt;
char *config_file = NULL;
@ -151,6 +152,17 @@ main(int argc, char *argv[])
nat.nat_cnum = i;
putnat((&nat));
}
memset(&realm, 0, sizeof(realm));
realm.ef_type = EF_REALM;
for (i = 0; i < MAXNOC; i++) {
realm.r_cnum = i;
for (j = 0; j < MAXNOR; j++) {
realm.r_realm = j;
realm.r_uid = (i * MAXNOR) + j;
realm.r_timestamp = current_time;
putrealm(&realm);
}
}
if (access(teldir, F_OK) < 0 && mkdir(teldir, 0750) < 0) {
perror(teldir);
printf("Can't make telegram directory\n");