Commit 932ca4e4 authored by rswindell's avatar rswindell
Browse files

Renamed subject_crc() to smb_subject_crc(), faddrtoa() to smb_faddrtoa(),

and net_addr() to smb_netaddr().
parent ec2a0982
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -104,7 +104,7 @@ bool sbbs_t::bulkmail(uchar *ar)
msg_client_hfields(&msg,&client);
smb_hfield_str(&msg,SUBJECT,title);
msg.idx.subj=subject_crc(title);
msg.idx.subj=smb_subject_crc(title);
msg.hdr.when_written.time=time(NULL);
msg.hdr.when_written.zone=sys_timezone(&cfg);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -277,7 +277,7 @@ bool sbbs_t::email(int usernumber, char *top, char *subj, long mode)
msg_client_hfields(&msg,&client);
smb_hfield_str(&msg,SUBJECT,title);
msg.idx.subj=subject_crc(title);
msg.idx.subj=smb_subject_crc(title);
smb_dfield(&msg,TEXT_BODY,length);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -195,8 +195,8 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
hdr.orignode =cfg.faddr[i].node;
hdr.origpoint =cfg.faddr[i].point;
faddrtoa(&cfg.faddr[i],str);
bprintf(text[NetMailing],hdr.to,faddrtoa(&addr,tmp),hdr.from,str);
smb_faddrtoa(&cfg.faddr[i],str);
bprintf(text[NetMailing],hdr.to,smb_faddrtoa(&addr,tmp),hdr.from,str);
hdr.attr=(FIDO_LOCAL|FIDO_PRIVATE);
......@@ -356,11 +356,11 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
if(mode&WM_FILE)
sprintf(str,"%s sent NetMail file attachment to %s (%s)"
,useron.alias
,hdr.to,faddrtoa(&addr,tmp));
,hdr.to,smb_faddrtoa(&addr,tmp));
else
sprintf(str,"%s sent NetMail to %s (%s)"
,useron.alias
,hdr.to,faddrtoa(&addr,tmp));
,hdr.to,smb_faddrtoa(&addr,tmp));
logline("EN",str);
cc_found=0;
......@@ -553,7 +553,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
sprintf(str,"%.25s",block+71); /* Title */
smb_hfield(&msg,SUBJECT,strlen(str),str);
msg.idx.subj=subject_crc(str);
msg.idx.subj=smb_subject_crc(str);
}
if(qnet) {
......@@ -575,7 +575,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
strcpy(fulladdr,senderaddr);
sprintf(str,"BADADDR: %s",addr);
smb_hfield(&msg,SUBJECT,strlen(str),str);
msg.idx.subj=subject_crc(str);
msg.idx.subj=smb_subject_crc(str);
net=NET_NONE;
smb_hfield(&msg,SENDERNETTYPE,sizeof(net),&net);
}
......@@ -776,8 +776,8 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
hdr.orignode =cfg.faddr[i].node;
hdr.origpoint =cfg.faddr[i].point;
faddrtoa(&cfg.faddr[i],str);
bprintf(text[NetMailing],hdr.to,faddrtoa(&fidoaddr,tmp),hdr.from,str);
smb_faddrtoa(&cfg.faddr[i],str);
bprintf(text[NetMailing],hdr.to,smb_faddrtoa(&fidoaddr,tmp),hdr.from,str);
tm.tm_mon=((qwkbuf[8]&0xf)*10)+(qwkbuf[9]&0xf);
if (tm.tm_mon) tm.tm_mon--;
tm.tm_mday=((qwkbuf[11]&0xf)*10)+(qwkbuf[12]&0xf);
......@@ -873,7 +873,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
sprintf(str,"%s sent NetMail to %s @%s via QWK"
,useron.alias
,hdr.to,faddrtoa(&fidoaddr,tmp));
,hdr.to,smb_faddrtoa(&fidoaddr,tmp));
logline("EN",str);
}
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -156,17 +156,17 @@ void sbbs_t::show_msghdr(smbmsg_t* msg)
if(msg->to_ext)
bprintf(text[MsgToExt],msg->to_ext);
if(msg->to_net.addr)
bprintf(text[MsgToNet],net_addr(&msg->to_net));
bprintf(text[MsgToNet],smb_netaddr(&msg->to_net));
if(!(msg->hdr.attr&MSG_ANONYMOUS) || SYSOP) {
bprintf(text[MsgFrom],msg->from);
if(msg->from_ext)
bprintf(text[MsgFromExt],msg->from_ext);
if(msg->from_net.addr && !strchr(msg->from,'@'))
bprintf(text[MsgFromNet],net_addr(&msg->from_net));
bprintf(text[MsgFromNet],smb_netaddr(&msg->from_net));
}
bprintf(text[MsgDate]
,timestr((time_t *)&msg->hdr.when_written.time)
,zonestr(msg->hdr.when_written.zone));
,smb_zonestr(msg->hdr.when_written.zone,NULL));
CRLF;
......@@ -311,15 +311,15 @@ void sbbs_t::msgtotxt(smbmsg_t* msg, char *str, int header, int tails)
if(msg->to_ext)
fprintf(out," #%s",msg->to_ext);
if(msg->to_net.addr)
fprintf(out," (%s)",net_addr(&msg->to_net));
fprintf(out," (%s)",smb_netaddr(&msg->to_net));
fprintf(out,"\r\nFrom : %s",msg->from);
if(msg->from_ext && !(msg->hdr.attr&MSG_ANONYMOUS))
fprintf(out," #%s",msg->from_ext);
if(msg->from_net.addr)
fprintf(out," (%s)",net_addr(&msg->from_net));
fprintf(out," (%s)",smb_netaddr(&msg->from_net));
fprintf(out,"\r\nDate : %.24s %s"
,timestr((time_t *)&msg->hdr.when_written.time)
,zonestr(msg->hdr.when_written.zone));
,smb_zonestr(msg->hdr.when_written.zone,NULL));
fprintf(out,"\r\n\r\n"); }
buf=smb_getmsgtxt(&smb,msg,tails);
......
......@@ -441,7 +441,7 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if(sbbs->current_msg==NULL || sbbs->current_msg->to_net.type==NET_NONE)
p=nulstr;
else
p=net_addr(&sbbs->current_msg->to_net);
p=smb_netaddr(&sbbs->current_msg->to_net);
break;
case BBS_PROP_MSG_TO_AGENT:
if(sbbs->current_msg!=NULL)
......@@ -463,7 +463,7 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if(sbbs->current_msg==NULL || sbbs->current_msg->from_net.type==NET_NONE)
p=nulstr;
else
p=net_addr(&sbbs->current_msg->from_net);
p=smb_netaddr(&sbbs->current_msg->from_net);
break;
case BBS_PROP_MSG_FROM_AGENT:
if(sbbs->current_msg!=NULL)
......@@ -485,7 +485,7 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if(sbbs->current_msg==NULL || sbbs->current_msg->replyto_net.type==NET_NONE)
p=nulstr;
else
p=net_addr(&sbbs->current_msg->replyto_net);
p=smb_netaddr(&sbbs->current_msg->replyto_net);
break;
case BBS_PROP_MSG_REPLYTO_AGENT:
if(sbbs->current_msg!=NULL)
......
......@@ -201,7 +201,7 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
} else
cp="";
smb_hfield_str(msg, SUBJECT, cp);
msg->idx.subj=subject_crc(cp);
msg->idx.subj=smb_subject_crc(cp);
if(JS_GetProperty(cx, hdr, "from", &val) && !JSVAL_NULL_OR_VOID(val)) {
if((cp=JS_GetStringBytes(JS_ValueToString(cx,val)))==NULL)
......@@ -697,7 +697,7 @@ js_get_msg_header(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
JS_DefineProperty(cx, hdrobj, "to_net_type",INT_TO_JSVAL(msg.to_net.type)
,NULL,NULL,JSPROP_ENUMERATE);
if(msg.to_net.type
&& (js_str=JS_NewStringCopyZ(cx,net_addr(&msg.to_net)))!=NULL)
&& (js_str=JS_NewStringCopyZ(cx,smb_netaddr(&msg.to_net)))!=NULL)
JS_DefineProperty(cx, hdrobj, "to_net_addr"
,STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE);
......@@ -706,7 +706,7 @@ js_get_msg_header(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
JS_DefineProperty(cx, hdrobj, "from_net_type",INT_TO_JSVAL(msg.from_net.type)
,NULL,NULL,JSPROP_ENUMERATE);
if(msg.from_net.type
&& (js_str=JS_NewStringCopyZ(cx,net_addr(&msg.from_net)))!=NULL)
&& (js_str=JS_NewStringCopyZ(cx,smb_netaddr(&msg.from_net)))!=NULL)
JS_DefineProperty(cx, hdrobj, "from_net_addr"
,STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE);
......@@ -716,7 +716,7 @@ js_get_msg_header(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
JS_DefineProperty(cx, hdrobj, "replyto_net_type",INT_TO_JSVAL(msg.replyto_net.type)
,NULL,NULL,JSPROP_ENUMERATE);
if(msg.replyto_net.type
&& (js_str=JS_NewStringCopyZ(cx,net_addr(&msg.replyto_net)))!=NULL)
&& (js_str=JS_NewStringCopyZ(cx,smb_netaddr(&msg.replyto_net)))!=NULL)
JS_DefineProperty(cx, hdrobj, "replyto_net_addr"
,STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE);
......
......@@ -871,7 +871,7 @@ js_zonestr(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
zone=(short)val;
}
if((js_str = JS_NewStringCopyZ(cx, zonestr(zone)))==NULL)
if((js_str = JS_NewStringCopyZ(cx, smb_zonestr(zone,NULL)))==NULL)
return(JS_FALSE);
*rval = STRING_TO_JSVAL(js_str);
......
......@@ -2216,7 +2216,7 @@ static void smtp_thread(void* arg)
,socket, startup->dnsbl_tag);
}
smb_hfield_str(&msg, SUBJECT, p);
msg.idx.subj=subject_crc(p);
msg.idx.subj=smb_subject_crc(p);
continue;
}
if(!strnicmp(buf, "FROM:", 5)
......@@ -2312,7 +2312,7 @@ static void smtp_thread(void* arg)
if(msg.idx.subj==0) {
p="";
smb_hfield(&msg, SUBJECT, 0, p);
msg.idx.subj=subject_crc(p);
msg.idx.subj=smb_subject_crc(p);
}
/* Security logging */
......
......@@ -63,7 +63,7 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
sprintf(from,"%.128s",msg->from);
else if(msg->from_net.type==NET_FIDO)
sprintf(from,"%.128s@%.128s"
,msg->from,faddrtoa((faddr_t *)msg->from_net.addr,tmp));
,msg->from,smb_faddrtoa((faddr_t *)msg->from_net.addr,tmp));
else if(msg->from_net.type==NET_INTERNET)
sprintf(from,"%.128s",(char*)msg->from_net.addr);
else
......@@ -80,7 +80,7 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
if(msg->to_net.addr && (uint)subnum==INVALID_SUB) {
if(msg->to_net.type==NET_FIDO)
sprintf(to,"%.128s@%s",msg->to,faddrtoa((faddr_t *)msg->to_net.addr,tmp));
sprintf(to,"%.128s@%s",msg->to,smb_faddrtoa((faddr_t *)msg->to_net.addr,tmp));
else if(msg->to_net.type==NET_INTERNET)
sprintf(to,"%.128s",(char*)msg->to_net.addr);
else if(msg->to_net.type==NET_QWK) {
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -250,7 +250,7 @@ bool sbbs_t::inetmail(char *into, char *subj, long mode)
smb_hfield_str(&msg,SUBJECT,title);
strcpy(str,title);
msg.idx.subj=subject_crc(str);
msg.idx.subj=smb_subject_crc(str);
smb_dfield(&msg,TEXT_BODY,length);
......@@ -439,7 +439,7 @@ bool sbbs_t::qnetmail(char *into, char *subj, long mode)
msg_client_hfields(&msg,&client);
smb_hfield_str(&msg,SUBJECT,title);
msg.idx.subj=subject_crc(title);
msg.idx.subj=smb_subject_crc(title);
smb_dfield(&msg,TEXT_BODY,length);
......
......@@ -84,7 +84,7 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
msgattr=(ushort)(remsg->hdr.attr&MSG_PRIVATE);
sprintf(top,text[RegardingByToOn],title,touser,remsg->to
,timestr((time_t *)&remsg->hdr.when_written.time)
,zonestr(remsg->hdr.when_written.zone));
,smb_zonestr(remsg->hdr.when_written.zone,NULL));
} else {
title[0]=0;
touser[0]=0;
......@@ -371,7 +371,7 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
msg_client_hfields(&msg,&client);
smb_hfield_str(&msg,SUBJECT,title);
msg.idx.subj=subject_crc(title);
msg.idx.subj=smb_subject_crc(title);
smb_dfield(&msg,TEXT_BODY,length);
......
......@@ -126,7 +126,7 @@ bool sbbs_t::qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
sprintf(str,"%25.25s",hdrblk+71); /* Subject */
truncsp(str);
smb_hfield_str(&msg,SUBJECT,str);
msg.idx.subj=subject_crc(str);
msg.idx.subj=smb_subject_crc(str);
/********************************/
/* Convert the QWK message text */
......
......@@ -361,7 +361,7 @@ void sbbs_t::readmail(uint usernumber, int which)
strcpy(str,msg.from);
else if(msg.from_net.type==NET_FIDO) /* FidoNet type */
sprintf(str,"%s @%s",msg.from
,faddrtoa((faddr_t *)msg.from_net.addr,tmp));
,smb_faddrtoa((faddr_t *)msg.from_net.addr,tmp));
else if(msg.from_net.type==NET_INTERNET)
strcpy(str,(char *)msg.from_net.addr);
else
......
......@@ -115,9 +115,9 @@ void sbbs_t::msghdr(smbmsg_t* msg)
/* fixed fields */
bprintf("%-16.16s %s %s\r\n","when_written"
,timestr((time_t *)&msg->hdr.when_written.time), zonestr(msg->hdr.when_written.zone));
,timestr((time_t *)&msg->hdr.when_written.time), smb_zonestr(msg->hdr.when_written.zone,NULL));
bprintf("%-16.16s %s %s\r\n","when_imported"
,timestr((time_t *)&msg->hdr.when_imported.time), zonestr(msg->hdr.when_imported.zone));
,timestr((time_t *)&msg->hdr.when_imported.time), smb_zonestr(msg->hdr.when_imported.zone,NULL));
bprintf("%-16.16s %04Xh\r\n","type" ,msg->hdr.type);
bprintf("%-16.16s %04Xh\r\n","version" ,msg->hdr.version);
bprintf("%-16.16s %04Xh\r\n","attr" ,msg->hdr.attr);
......@@ -810,7 +810,7 @@ int sbbs_t::scanposts(uint subnum, long mode, char *find)
strcpy(str,msg.from);
else if(msg.from_net.type==NET_FIDO)
sprintf(str,"%s @%s",msg.from
,faddrtoa((faddr_t *)msg.from_net.addr,tmp));
,smb_faddrtoa((faddr_t *)msg.from_net.addr,tmp));
else if(msg.from_net.type==NET_INTERNET)
strcpy(str,(char *)msg.from_net.addr);
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment