]> git.pond.sub.org Git - empserver/blobdiff - include/news.h
Extend the common header of struct empobj to include uid
[empserver] / include / news.h
index 074227b7bb72ecbf19896a2c196e4e2fe2146abd..cc182a9109a14a72f7be77cc93d326b7f346166d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
@@ -29,7 +29,7 @@
  * 
  *  Known contributors to this file:
  *     Dave Pare
- *     Thomas Rushack
+ *     Thomas Ruschak
  *     Steve McClure
  */
 
  *     would be a pain, and it doesn't hurt to leave them in --ts
  */
 
-#ifndef _NEWS_H_
-#define _NEWS_H_
+#ifndef NEWS_H
+#define NEWS_H
+
+#include <time.h>
+#include "nsc.h"
 
 struct nwsstr {
+    /* initial part must match struct empobj */
     short ef_type;
+    short nws_uid;             /* unused */
+    /* end of part matching struct empobj */
     natid nws_ano;             /* "actor" country # */
-    short nws_uid;
-    s_char nws_vrb;            /* action (verb) */
+    signed char nws_vrb;       /* action (verb) */
     natid nws_vno;             /* "victim" country # */
-    s_char nws_ntm;            /* number of times */
+    signed char nws_ntm;       /* number of times */
     time_t nws_when;           /* time of action */
 };
 
 #define        NUM_RPTS        2       /* number of story alternates */
 
 struct rptstr {
+    signed char r_uid;
     int r_good_will;           /* how "nice" the action is */
     int r_newspage;            /* which page this item belongs on */
     char *r_newstory[NUM_RPTS];        /* texts for fmt( */
@@ -137,13 +143,14 @@ struct rptstr {
 #define N_PARA_UNOCC   75
 #define N_ALOSE_SCT    76
 #define N_PLOSE_SCT    77
-#define N_FIN_TROUBLE   78
-#define N_CREDIT_JUNK   79
+/* unused              78 */
+/* unused              79 */
 #define N_WELCH_DEAL    80
 #define N_LND_LOSE      81
 #define N_BOARD_LAND    82
 #define        N_MAX_VERB      82
 
+#define N_NOTUSED        0
 #define N_FOR            1
 #define N_FRONT          2
 #define N_SEA            3
@@ -157,14 +164,11 @@ struct rptstr {
 #define N_TELE          11
 #define        N_MAX_PAGE      11
 
-#define getnews(n, p) \
-       ef_read(EF_NEWS, n, p)
-#define putnews(n, p) \
-       ef_write(EF_NEWS, n, p)
-#define getnewsp(n) \
-       (struct nwsstr *) ef_ptr(EF_NEWS, n)
+#define getnews(n, p) ef_read(EF_NEWS, (n), (p))
+#define putnews(n, p) ef_write(EF_NEWS, (n), (p))
+#define getnewsp(n) ((struct nwsstr *)ef_ptr(EF_NEWS, (n)))
 
-extern struct rptstr rpt[];
-extern char *page_headings[];
+extern struct rptstr rpt[N_MAX_VERB + 2];
+extern struct symbol page_headings[N_MAX_PAGE + 2];
 
-#endif /* _NEWS_H_ */
+#endif