src/mail.h

Go to the documentation of this file.
00001 
00002 /* mail.h */
00003 
00004 /* $Id: mail.h,v 1.4 2005/08/08 09:43:07 murrayma Exp $ */
00005 
00006 #ifndef _MAIL_H
00007 #define _MAIL_H
00008 
00009 #include "copyright.h"
00010 #include "config.h"
00011 #include "db.h"
00012 
00013 /* Some of this isn't implemented yet, but heralds the future! */
00014 #define M_ISREAD                0x0001
00015 #define M_UNREAD        0x0FFE
00016 #define M_CLEARED       0x0002
00017 #define M_URGENT        0x0004
00018 #define M_MASS          0x0008
00019 #define M_SAFE          0x0010
00020 #define M_RECEIPT       0x0020
00021 #define M_TAG           0x0040
00022 #define M_FORWARD       0x0080
00023                 /* 0x0100 - 0x0F00 reserved for folder numbers */
00024 #define M_FMASK         0xF0FF
00025 #define M_ALL           0x1000  /* Used in mail_selectors */
00026 #define M_MSUNREAD      0x2000  /* Mail selectors */
00027                 /* 0x4000 - 0x8000 available */
00028 
00029 #define MAX_FOLDERS     15
00030 #define FOLDER_NAME_LEN MBUF_SIZE
00031 #define FolderBit(f) (256 * (f))
00032 
00033 #define Urgent(m)       (m->read & M_URGENT)
00034 #define Mass(m)         (m->read & M_MASS)
00035 #define M_Safe(m)               (m->read & M_SAFE)
00036 #define Receipt(m)      (m->read & M_RECEIPT)
00037 #define Forward(m)      (m->read & M_FORWARD)
00038 #define Tagged(m)       (m->read & M_TAG)
00039 #define Folder(m)       ((m->read & ~M_FMASK) >> 8)
00040 #define Read(m)         (m->read & M_ISREAD)
00041 #define Cleared(m)      (m->read & M_CLEARED)
00042 #define Unread(m)       (!Read(m))
00043 #define All(ms)         (ms.flags & M_ALL)
00044 #define ExpMail(x)      (Wizard(x))
00045 
00046 #define MA_INC          2       /* what interval to increase the malias list */
00047 
00048 #define DASH_LINE  \
00049   "---------------------------------------------------------------------------"
00050 
00051 #define MAIL_ITER_ALL(mp, thing)        for((thing)=0; (thing)<mudstate.db_top; (thing)++) \
00052                                                 for (mp = (struct mail *)nhashfind((int)thing, &mudstate.mail_htab); mp != NULL; mp = mp->next)
00053 
00054 /* This macro requires you to put nextp = mp->next at
00055  * the beginning of the loop.
00056  */
00057 
00058 #define MAIL_ITER_SAFE(mp, thing, nextp)        for((thing)=0; (thing)<mudstate.db_top; (thing)++) \
00059                                                         for (mp = (struct mail *)nhashfind((int)thing, &mudstate.mail_htab); mp != NULL; mp = nextp)
00060 
00061 
00062 typedef unsigned int mail_flag;
00063 
00064 struct mail {
00065     struct mail *next;
00066     struct mail *prev;
00067     dbref to;
00068     dbref from;
00069     int number;
00070     const char *time;
00071     const char *subject;
00072     const char *tolist;
00073     int read;
00074 };
00075 
00076 struct mail_selector {
00077     int low, high;
00078     mail_flag flags;
00079     dbref player;
00080     int days, day_comp;
00081 };
00082 
00083 struct muser {
00084     dbref who;
00085     char *fwd;
00086     char *vacation;
00087     dbref *afilter;
00088     int status;
00089 };
00090 
00091 typedef struct mail_entry MENT;
00092 struct mail_entry {
00093     char *message;
00094     int count;
00095 };
00096 
00097 extern void set_player_folder(dbref, int);
00098 extern void do_malias_send(dbref, char *, char *, char *, int, mail_flag, int);
00099 extern struct malias *get_malias(dbref, char *);
00100 extern void load_malias(FILE *);
00101 extern void save_malias(FILE *);
00102 extern void malias_read(FILE *);
00103 extern void malias_write(FILE *);
00104 extern void do_malias_chown(dbref, char *, char *);
00105 extern void do_malias_desc(dbref, char *, char *);
00106 extern void do_expmail_start(dbref, char *, char *);
00107 extern void do_expmail_stop(dbref, int);
00108 extern void do_mail_quick(dbref, char *, char *);
00109 extern void do_malias_rename(dbref, char *, char *);
00110 extern void do_malias_adminlist(dbref);
00111 extern void do_malias_delete(dbref, char *);
00112 extern void do_malias_status(dbref);
00113 extern void do_malias_create(dbref, char *, char *);
00114 extern void do_malias_list(dbref, char *);
00115 extern void do_malias_list_all(dbref);
00116 extern void do_malias_add(dbref, char *, char *);
00117 extern void do_malias_remove(dbref, char *, char *);
00118 extern void check_mail_expiration(void);
00119 extern void check_mail(dbref, int, int);
00120 extern void do_mail_purge(dbref);
00121 #endif

Generated on Mon May 28 04:25:25 2007 for BattletechMUX by  doxygen 1.4.7