Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

...
 
Commits (1)
......@@ -53,8 +53,9 @@ static char* msg_sub_prop_desc[] = {
,"sub-board internal code"
,"sub-board name"
,"sub-board description"
,"sub-board QWK name"
,"newsgroup name (as configured or dymamically generated)"
,"QWK conference name"
,"area tag for FidoNet-style echoes, a.k.a. EchoTag <i>(introduced in v3.19)</i>"
,"newsgroup name (as configured or dynamically generated)"
,"sub-board access requirements"
,"sub-board reading requirements"
,"sub-board posting requirements"
......@@ -142,7 +143,14 @@ BOOL js_CreateMsgAreaProperties(JSContext* cx, scfg_t* cfg, JSObject* subobj, ui
if(!JS_DefineProperty(cx, subobj, "qwk_name", STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY))
return(FALSE);
if((js_str=JS_NewStringCopyZ(cx, subnewsgroupname(cfg, sub, str, sizeof(str))))==NULL)
if((js_str=JS_NewStringCopyZ(cx, sub_area_tag(cfg, sub, str, sizeof(str))))==NULL)
return(FALSE);
if(!JS_DefineProperty(cx, subobj, "area_tag", STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY))
return(FALSE);
if((js_str=JS_NewStringCopyZ(cx, sub_newsgroup_name(cfg, sub, str, sizeof(str))))==NULL)
return(FALSE);
if(!JS_DefineProperty(cx, subobj, "newsgroup", STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY))
......
......@@ -40,20 +40,6 @@ char *utos(char *str)
return(out);
}
char *stou(char *str)
{
static char out[128];
int i;
for(i=0;str[i];i++)
if(str[i]==' ')
out[i]='_';
else
out[i]=str[i];
out[i]=0;
return(out);
}
static bool new_grp(unsigned new_grpnum)
{
grp_t* new_group = malloc(sizeof(grp_t));
......@@ -871,20 +857,20 @@ void msgs_cfg()
fprintf(stream,"%-*s %-*s %s\n"
,LEN_EXTCODE, extcode
,FIDO_AREATAG_LEN
,cfg.sub[j]->newsgroup[0] ? cfg.sub[j]->newsgroup : stou(cfg.sub[j]->sname)
,sub_area_tag(&cfg, cfg.sub[j], str, sizeof(str))
,str2);
continue;
continue;
}
if(k==2) { /* BACKBONE.NA */
fprintf(stream,"%-*s %s\n"
,FIDO_AREATAG_LEN
,cfg.sub[j]->newsgroup[0] ? cfg.sub[j]->newsgroup : stou(cfg.sub[j]->sname)
,sub_area_tag(&cfg, cfg.sub[j], str, sizeof(str))
,cfg.sub[j]->lname);
continue;
}
if(k==3) { /* newsgroup.lst */
fprintf(stream,"%s %s\n"
,subnewsgroupname(&cfg, cfg.sub[j], str, sizeof(str))
,sub_newsgroup_name(&cfg, cfg.sub[j], str, sizeof(str))
,cfg.sub[j]->lname);
continue;
}
......
......@@ -767,7 +767,7 @@ char* utf8_to_cp437_str(char* str)
,/* decode error char: */CP437_INVERTED_EXCLAMATION_MARK);
}
char* subnewsgroupname(scfg_t* cfg, sub_t* sub, char* str, size_t size)
char* sub_newsgroup_name(scfg_t* cfg, sub_t* sub, char* str, size_t size)
{
memset(str, 0, size);
if(sub->newsgroup[0])
......@@ -802,6 +802,21 @@ char* subnewsgroupname(scfg_t* cfg, sub_t* sub, char* str, size_t size)
return str;
}
char* sub_area_tag(scfg_t* cfg, sub_t* sub, char* str, size_t size)
{
char* p;
memset(str, 0, size);
if(sub->newsgroup[0])
strncpy(str, sub->newsgroup, size - 1);
else {
strncpy(str, sub->sname, size - 1);
REPLACE_CHARS(str, ' ', '_', p);
strupr(str);
}
return str;
}
char* dir_area_tag(scfg_t* cfg, dir_t* dir, char* str, size_t size)
{
char* p;
......
......@@ -67,7 +67,8 @@ DLLEXPORT uint32_t str_to_bits(uint32_t currval, const char *str);
DLLEXPORT BOOL str_has_ctrl(const char*);
DLLEXPORT BOOL str_is_ascii(const char*);
DLLEXPORT char * utf8_to_cp437_str(char* str);
DLLEXPORT char * subnewsgroupname(scfg_t*, sub_t*, char*, size_t);
DLLEXPORT char * sub_newsgroup_name(scfg_t*, sub_t*, char*, size_t);
DLLEXPORT char * sub_area_tag(scfg_t*, sub_t*, char*, size_t);
DLLEXPORT char * dir_area_tag(scfg_t*, dir_t*, char*, size_t);
DLLEXPORT char * get_ctrl_dir(BOOL warn);
......