contact: Create EF_CONTACT table of struct contactstr
New struct contactstr is basically empty so far. The next commit will move contact state from struct natstr to struct contactstr. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
7cc34abaca
commit
4b4df53485
24 changed files with 314 additions and 187 deletions
|
@ -155,6 +155,7 @@ enum {
|
|||
EF_TRADE,
|
||||
EF_POWER,
|
||||
EF_NATION,
|
||||
EF_CONTACT,
|
||||
EF_LOAN,
|
||||
EF_MAP,
|
||||
EF_BMAP,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* Ken Stevens, 1995
|
||||
* Steve McClure, 1998-2000
|
||||
* Ron Koenderink, 2005-2008
|
||||
* Markus Armbruster, 2005-2014
|
||||
* Markus Armbruster, 2005-2016
|
||||
*/
|
||||
|
||||
#ifndef NAT_H
|
||||
|
@ -149,6 +149,16 @@ struct natstr {
|
|||
/* Coastwatch and skywatch */
|
||||
#define FOUND_COAST 3
|
||||
|
||||
struct contactstr {
|
||||
/* initial part must match struct empobj */
|
||||
signed ef_type: 8;
|
||||
unsigned con_seqno: 12;
|
||||
unsigned con_generation: 12;
|
||||
int con_uid;
|
||||
time_t con_timestamp;
|
||||
/* end of part matching struct empobj */
|
||||
};
|
||||
|
||||
extern char *relates[];
|
||||
|
||||
/* procedures relating to nation stuff */
|
||||
|
@ -156,6 +166,10 @@ extern char *relates[];
|
|||
#define putnat(p) ef_write(EF_NATION, (p)->nat_cnum, (p))
|
||||
#define getnatp(n) ((struct natstr *)ef_ptr(EF_NATION, (n)))
|
||||
|
||||
#define getcontact(n, p) ef_read(EF_CONTACT, (n), (p))
|
||||
#define putcontact(p) ef_write(EF_CONTACT, (p)->con_uid, (p))
|
||||
#define getcontactp(n) ((struct contactstr *)ef_ptr(EF_CONTACT, (n)))
|
||||
|
||||
#define getrealm(r, n, p) ef_read(EF_REALM, ((r) + ((n) * MAXNOR)), (p))
|
||||
#define putrealm(p) ef_write(EF_REALM, (p)->r_uid, (p))
|
||||
|
||||
|
|
|
@ -273,6 +273,7 @@ extern struct castr commodity_ca[];
|
|||
extern struct castr trade_ca[];
|
||||
extern struct castr nat_ca[];
|
||||
extern struct castr cou_ca[];
|
||||
extern struct castr contact_ca[];
|
||||
extern struct castr realm_ca[];
|
||||
extern struct castr game_ca[];
|
||||
extern struct castr intrchr_ca[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue