Move MSG_* defines to JAM_* defines to build on OSX

This commit is contained in:
Andrew Pamment 2017-03-16 17:50:06 +10:00
parent 723c172527
commit fcad3457ed
4 changed files with 52 additions and 52 deletions

View File

@ -142,7 +142,7 @@ int bwave_scan_area(int confr, int area, int areano, int totmsgs, FILE *fti_file
*last_ptr += msghs->msgs[k]->msg_h->TxtLen; *last_ptr += msghs->msgs[k]->msg_h->TxtLen;
if (msghs->msgs[k]->msg_h->Attribute & MSG_LOCAL) { if (msghs->msgs[k]->msg_h->Attribute & JAM_MSG_LOCAL) {
fti.flags |= FTI_MSGLOCAL; fti.flags |= FTI_MSGLOCAL;
} }
@ -432,7 +432,7 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
JAM_ClearMsgHeader( &jmh ); JAM_ClearMsgHeader( &jmh );
jmh.DateWritten = dwritten; jmh.DateWritten = dwritten;
jmh.Attribute |= MSG_LOCAL; jmh.Attribute |= JAM_MSG_LOCAL;
if (conf.mail_conferences[confr]->realnames == 0) { if (conf.mail_conferences[confr]->realnames == 0) {
strcpy(buffer, gUser->loginname); strcpy(buffer, gUser->loginname);
} else { } else {
@ -471,7 +471,7 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_NEWSGROUP_AREA) { if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_NEWSGROUP_AREA) {
jmh.Attribute |= MSG_TYPEECHO; jmh.Attribute |= JAM_MSG_TYPEECHO;
if (conf.mail_conferences[confr]->fidoaddr->point) { if (conf.mail_conferences[confr]->fidoaddr->point) {
sprintf(buffer, "%d:%d/%d.%d", conf.mail_conferences[confr]->fidoaddr->zone, sprintf(buffer, "%d:%d/%d.%d", conf.mail_conferences[confr]->fidoaddr->zone,
@ -503,8 +503,8 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
jmh.MsgIdCRC = JAM_Crc32(buffer, strlen(buffer)); jmh.MsgIdCRC = JAM_Crc32(buffer, strlen(buffer));
} else if (conf.mail_conferences[confr]->mail_areas[confr]->type == TYPE_NETMAIL_AREA) { } else if (conf.mail_conferences[confr]->mail_areas[confr]->type == TYPE_NETMAIL_AREA) {
jmh.Attribute |= MSG_TYPENET; jmh.Attribute |= JAM_MSG_TYPENET;
jmh.Attribute |= MSG_PRIVATE; jmh.Attribute |= JAM_MSG_PRIVATE;
if (conf.mail_conferences[confr]->fidoaddr->point) { if (conf.mail_conferences[confr]->fidoaddr->point) {
sprintf(buffer, "%d:%d/%d.%d", conf.mail_conferences[confr]->fidoaddr->zone, sprintf(buffer, "%d:%d/%d.%d", conf.mail_conferences[confr]->fidoaddr->zone,

View File

@ -89,35 +89,35 @@ typedef struct {
/* /*
** Message status bits ** Message status bits
*/ */
#define MSG_LOCAL 0x00000001L /* Msg created locally */ #define JAM_MSG_LOCAL 0x00000001L /* Msg created locally */
#define MSG_INTRANSIT 0x00000002L /* Msg is in-transit */ #define JAM_MSG_INTRANSIT 0x00000002L /* Msg is in-transit */
#define MSG_PRIVATE 0x00000004L /* Private */ #define JAM_MSG_PRIVATE 0x00000004L /* Private */
#define MSG_READ 0x00000008L /* Read by addressee */ #define JAM_MSG_READ 0x00000008L /* Read by addressee */
#define MSG_SENT 0x00000010L /* Sent to remote */ #define JAM_MSG_SENT 0x00000010L /* Sent to remote */
#define MSG_KILLSENT 0x00000020L /* Kill when sent */ #define JAM_MSG_KILLSENT 0x00000020L /* Kill when sent */
#define MSG_ARCHIVESENT 0x00000040L /* Archive when sent */ #define JAM_MSG_ARCHIVESENT 0x00000040L /* Archive when sent */
#define MSG_HOLD 0x00000080L /* Hold for pick-up */ #define JAM_MSG_HOLD 0x00000080L /* Hold for pick-up */
#define MSG_CRASH 0x00000100L /* Crash */ #define JAM_MSG_CRASH 0x00000100L /* Crash */
#define MSG_IMMEDIATE 0x00000200L /* Send Msg now, ignore restrictions */ #define JAM_MSG_IMMEDIATE 0x00000200L /* Send Msg now, ignore restrictions */
#define MSG_DIRECT 0x00000400L /* Send directly to destination */ #define JAM_MSG_DIRECT 0x00000400L /* Send directly to destination */
#define MSG_GATE 0x00000800L /* Send via gateway */ #define JAM_MSG_GATE 0x00000800L /* Send via gateway */
#define MSG_FILEREQUEST 0x00001000L /* File request */ #define JAM_MSG_FILEREQUEST 0x00001000L /* File request */
#define MSG_FILEATTACH 0x00002000L /* File(s) attached to Msg */ #define JAM_MSG_FILEATTACH 0x00002000L /* File(s) attached to Msg */
#define MSG_TRUNCFILE 0x00004000L /* Truncate file(s) when sent */ #define JAM_MSG_TRUNCFILE 0x00004000L /* Truncate file(s) when sent */
#define MSG_KILLFILE 0x00008000L /* Delete file(s) when sent */ #define JAM_MSG_KILLFILE 0x00008000L /* Delete file(s) when sent */
#define MSG_RECEIPTREQ 0x00010000L /* Return receipt requested */ #define JAM_MSG_RECEIPTREQ 0x00010000L /* Return receipt requested */
#define MSG_CONFIRMREQ 0x00020000L /* Confirmation receipt requested */ #define JAM_MSG_CONFIRMREQ 0x00020000L /* Confirmation receipt requested */
#define MSG_ORPHAN 0x00040000L /* Unknown destination */ #define JAM_MSG_ORPHAN 0x00040000L /* Unknown destination */
#define MSG_ENCRYPT 0x00080000L /* Msg text is encrypted */ #define JAM_MSG_ENCRYPT 0x00080000L /* Msg text is encrypted */
#define MSG_COMPRESS 0x00100000L /* Msg text is compressed */ #define JAM_MSG_COMPRESS 0x00100000L /* Msg text is compressed */
#define MSG_ESCAPED 0x00200000L /* Msg text is seven bit ASCII */ #define JAM_MSG_ESCAPED 0x00200000L /* Msg text is seven bit ASCII */
#define MSG_FPU 0x00400000L /* Force pickup */ #define JAM_MSG_FPU 0x00400000L /* Force pickup */
#define MSG_TYPELOCAL 0x00800000L /* Msg is for local use only (no export) */ #define JAM_MSG_TYPELOCAL 0x00800000L /* Msg is for local use only (no export) */
#define MSG_TYPEECHO 0x01000000L /* Msg is for conference distribution */ #define JAM_MSG_TYPEECHO 0x01000000L /* Msg is for conference distribution */
#define MSG_TYPENET 0x02000000L /* Msg is direct network mail */ #define JAM_MSG_TYPENET 0x02000000L /* Msg is direct network mail */
#define MSG_NODISP 0x20000000L /* Msg may not be displayed to user */ #define JAM_MSG_NODISP 0x20000000L /* Msg may not be displayed to user */
#define MSG_LOCKED 0x40000000L /* Msg is locked, no editing possible */ #define JAM_MSG_LOCKED 0x40000000L /* Msg is locked, no editing possible */
#define MSG_DELETED 0x80000000L /* Msg is deleted */ #define JAM_MSG_DELETED 0x80000000L /* Msg is deleted */
/* /*
** Message header ** Message header

View File

@ -37,8 +37,8 @@
- Fixed comparison between signed and unsigned variable in JAM_AddMessage() - Fixed comparison between signed and unsigned variable in JAM_AddMessage()
- Improved handling of ActiveMsgs counter. JAM_AddMessage() now only - Improved handling of ActiveMsgs counter. JAM_AddMessage() now only
increases ActiveMsgs if the added message does not have MSG_DELETED set. increases ActiveMsgs if the added message does not have JAM_MSG_DELETED set.
JAM_ChangeMsgHeader() decreases ActiveMsgs if MSG_DELETED is set and the JAM_ChangeMsgHeader() decreases ActiveMsgs if JAM_MSG_DELETED is set and the
message wasn't already deleted. JAM_DeleteMessage() now only decreases message wasn't already deleted. JAM_DeleteMessage() now only decreases
ActiveMsgs if the message wasn't already deleted. ActiveMsgs if the message wasn't already deleted.
@ -263,7 +263,7 @@ int JAM_ChangeMsgHeader( s_JamBase* Base_PS,
return JAM_IO_ERROR; return JAM_IO_ERROR;
} }
if( ( Header_PS->Attribute & MSG_DELETED ) && !(OldHeader_S.Attribute & MSG_DELETED) ) { if( ( Header_PS->Attribute & JAM_MSG_DELETED ) && !(OldHeader_S.Attribute & JAM_MSG_DELETED) ) {
/* message is deleted now but wasn't before */ /* message is deleted now but wasn't before */
BaseHeader_S.ActiveMsgs--; BaseHeader_S.ActiveMsgs--;
} }
@ -449,8 +449,8 @@ int JAM_AddMessage( s_JamBase* Base_PS,
return JAM_IO_ERROR; return JAM_IO_ERROR;
} }
if(!(Header_PS->Attribute & MSG_DELETED)) if(!(Header_PS->Attribute & JAM_MSG_DELETED))
BaseHeader_S.ActiveMsgs++; /* Only increase ActiveMsgs if MSG_DELETED not set */ BaseHeader_S.ActiveMsgs++; /* Only increase ActiveMsgs if JAM_MSG_DELETED not set */
/* write message base header */ /* write message base header */
@ -553,7 +553,7 @@ int JAM_DeleteMessage( s_JamBase* Base_PS,
} }
OldAttribute_I = Header_S.Attribute; OldAttribute_I = Header_S.Attribute;
Header_S.Attribute |= MSG_DELETED; Header_S.Attribute |= JAM_MSG_DELETED;
/* find header */ /* find header */
if ( fseek( Base_PS->HdrFile_PS, Index_S.HdrOffset, SEEK_SET ) ) { if ( fseek( Base_PS->HdrFile_PS, Index_S.HdrOffset, SEEK_SET ) ) {
@ -582,7 +582,7 @@ int JAM_DeleteMessage( s_JamBase* Base_PS,
return JAM_IO_ERROR; return JAM_IO_ERROR;
} }
if(!(OldAttribute_I & MSG_DELETED)) if(!(OldAttribute_I & JAM_MSG_DELETED))
BaseHeader_S.ActiveMsgs--; /* decrease ActiveMsgs if the message wasn't already deleted */ BaseHeader_S.ActiveMsgs--; /* decrease ActiveMsgs if the message wasn't already deleted */
/* write message base header */ /* write message base header */

View File

@ -284,7 +284,7 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r
continue; continue;
} }
if (jmh.Attribute & MSG_DELETED) { if (jmh.Attribute & JAM_MSG_DELETED) {
JAM_DelSubPacket(jsp); JAM_DelSubPacket(jsp);
continue; continue;
} }
@ -345,7 +345,7 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r
jamm->subject = strdup("(No Subject)"); jamm->subject = strdup("(No Subject)");
} }
if (jmh.Attribute & MSG_PRIVATE) { if (jmh.Attribute & JAM_MSG_PRIVATE) {
if (!msg_is_to(user, jamm->to, jamm->daddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf) && if (!msg_is_to(user, jamm->to, jamm->daddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf) &&
!msg_is_from(user, jamm->from, jamm->oaddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf)) { !msg_is_from(user, jamm->from, jamm->oaddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf)) {
@ -1422,7 +1422,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
sprintf(buffer, "%s", asctime(&msg_date)); sprintf(buffer, "%s", asctime(&msg_date));
buffer[strlen(buffer) - 1] = '\0'; buffer[strlen(buffer) - 1] = '\0';
s_printf(get_string(109), buffer, mailno + 1, msghs->msg_count); s_printf(get_string(109), buffer, mailno + 1, msghs->msg_count);
s_printf(get_string(110), (msghs->msgs[mailno]->msg_h->Attribute & MSG_SENT ? "SENT" : "")); s_printf(get_string(110), (msghs->msgs[mailno]->msg_h->Attribute & JAM_MSG_SENT ? "SENT" : ""));
s_printf(get_string(111)); s_printf(get_string(111));
body = (char *)malloc(msghs->msgs[mailno]->msg_h->TxtLen); body = (char *)malloc(msghs->msgs[mailno]->msg_h->TxtLen);
@ -1653,7 +1653,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
JAM_ClearMsgHeader( &jmh ); JAM_ClearMsgHeader( &jmh );
jmh.DateWritten = time(NULL); jmh.DateWritten = time(NULL);
jmh.Attribute |= MSG_LOCAL; jmh.Attribute |= JAM_MSG_LOCAL;
jsp = JAM_NewSubPacket(); jsp = JAM_NewSubPacket();
jsf.LoID = JAMSFLD_SENDERNAME; jsf.LoID = JAMSFLD_SENDERNAME;
@ -1677,7 +1677,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) { if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
jmh.Attribute |= MSG_TYPEECHO; jmh.Attribute |= JAM_MSG_TYPEECHO;
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) {
if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) { if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) {
@ -1725,8 +1725,8 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
jmh.ReplyCRC = JAM_Crc32(buffer, strlen(buffer)); jmh.ReplyCRC = JAM_Crc32(buffer, strlen(buffer));
} }
} else if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NETMAIL_AREA) { } else if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NETMAIL_AREA) {
jmh.Attribute |= MSG_TYPENET; jmh.Attribute |= JAM_MSG_TYPENET;
jmh.Attribute |= MSG_PRIVATE; jmh.Attribute |= JAM_MSG_PRIVATE;
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) {
if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) { if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) {
@ -2112,7 +2112,7 @@ int mail_menu(struct user_record *user) {
JAM_ClearMsgHeader( &jmh ); JAM_ClearMsgHeader( &jmh );
jmh.DateWritten = (uint32_t)time(NULL); jmh.DateWritten = (uint32_t)time(NULL);
jmh.Attribute |= MSG_LOCAL; jmh.Attribute |= JAM_MSG_LOCAL;
if (conf.mail_conferences[user->cur_mail_conf]->realnames == 0) { if (conf.mail_conferences[user->cur_mail_conf]->realnames == 0) {
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_WWIV) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_WWIV) {
sprintf(buffer, "%s #%d @%d", user->loginname, user->id, conf.mail_conferences[user->cur_mail_conf]->wwivnode); sprintf(buffer, "%s #%d @%d", user->loginname, user->id, conf.mail_conferences[user->cur_mail_conf]->wwivnode);
@ -2148,7 +2148,7 @@ int mail_menu(struct user_record *user) {
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) { if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
jmh.Attribute |= MSG_TYPEECHO; jmh.Attribute |= JAM_MSG_TYPEECHO;
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) {
if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) { if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) {
@ -2183,8 +2183,8 @@ int mail_menu(struct user_record *user) {
} }
} else } else
if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NETMAIL_AREA) { if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NETMAIL_AREA) {
jmh.Attribute |= MSG_TYPENET; jmh.Attribute |= JAM_MSG_TYPENET;
jmh.Attribute |= MSG_PRIVATE; jmh.Attribute |= JAM_MSG_PRIVATE;
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) {
if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) { if (conf.mail_conferences[user->cur_mail_conf]->fidoaddr->point) {
sprintf(buffer, "%d:%d/%d.%d", conf.mail_conferences[user->cur_mail_conf]->fidoaddr->zone, sprintf(buffer, "%d:%d/%d.%d", conf.mail_conferences[user->cur_mail_conf]->fidoaddr->zone,