reject: Create EF_REJECT table of struct rejectstr
New struct rejectstr is basically empty so far. The next commit will move reject state from struct natstr to struct rejectstr. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
f9f3900595
commit
f35f16c0a2
24 changed files with 302 additions and 190 deletions
|
@ -74,6 +74,7 @@ empobj_in_use(int type, void *p)
|
|||
case EF_COUNTRY:
|
||||
return ((struct natstr *)p)->nat_stat != STAT_UNUSED;
|
||||
case EF_CONTACT:
|
||||
case EF_REJECT:
|
||||
return empobj_in_use(EF_NATION,
|
||||
ef_ptr(EF_NATION,
|
||||
((struct ef_typedstr *)p)->uid));
|
||||
|
|
|
@ -168,6 +168,9 @@ struct empfile empfile[] = {
|
|||
{EF_CONTACT, "contact", NULL, "contact", contact_ca, EF_BAD,
|
||||
UNMAPPED_CACHE(struct contactstr, MAXNOC, EFF_TYPED),
|
||||
contact_oninit, NULL, NULL, NULL},
|
||||
{EF_REJECT, "reject", NULL, "reject", reject_ca, EF_BAD,
|
||||
UNMAPPED_CACHE(struct rejectstr, MAXNOC, EFF_TYPED),
|
||||
NULL, NULL, NULL, NULL},
|
||||
{EF_LOAN, "loan", NULL, "loan", loan_ca, EF_BAD,
|
||||
UNMAPPED_CACHE(struct lonstr, -1, EFF_TYPED),
|
||||
NULL, NULL, NULL, NULL},
|
||||
|
|
|
@ -659,6 +659,15 @@ struct castr contact_ca[] = {
|
|||
#undef CURSTR
|
||||
};
|
||||
|
||||
struct castr reject_ca[] = {
|
||||
#define CURSTR struct rejectstr
|
||||
{"uid", fldoff(rej_uid), NSC_INT, 0, NULL, EF_REJECT, 0, CA_DUMP},
|
||||
{"timestamp", fldoff(rej_timestamp), NSC_TIME, 0, NULL,
|
||||
EF_BAD, 0, CA_DUMP_NONE},
|
||||
{NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0, CA_DUMP}
|
||||
#undef CURSTR
|
||||
};
|
||||
|
||||
struct castr realm_ca[] = {
|
||||
#define CURSTR struct realmstr
|
||||
/* uid is encoded in cnum, realm */
|
||||
|
|
|
@ -110,6 +110,7 @@ ef_open_srv(void)
|
|||
failed |= !ef_open(EF_LOST, 0);
|
||||
failed |= !ef_open(EF_REALM, EFF_MEM);
|
||||
failed |= !ef_open(EF_CONTACT, EFF_MEM);
|
||||
failed |= !ef_open(EF_REJECT, EFF_MEM);
|
||||
if (!failed)
|
||||
failed |= ef_open_view(EF_COUNTRY);
|
||||
if (failed) {
|
||||
|
@ -139,4 +140,5 @@ ef_close_srv(void)
|
|||
ef_close(EF_LOST);
|
||||
ef_close(EF_REALM);
|
||||
ef_close(EF_CONTACT);
|
||||
ef_close(EF_REJECT);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue