Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
6aad8e6a
Commit
6aad8e6a
authored
19 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
An #ifdef'd out sbbs_cmdstr() attempt. :-(
parent
bc7b9001
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/str_util.c
+160
-0
160 additions, 0 deletions
src/sbbs3/str_util.c
with
160 additions
and
0 deletions
src/sbbs3/str_util.c
+
160
−
0
View file @
6aad8e6a
...
...
@@ -561,3 +561,163 @@ void main(void)
}
#endif
#if 0 /* to be moved here from xtrn.cpp */
char* quoted_string(const char* str, char* buf, size_t maxlen)
{
if(strchr(str,' ')==NULL)
return((char*)str);
safe_snprintf(buf,maxlen,"\"%s\"",str);
return(buf);
}
#endif
#if 0 /* I think is is a misguided idea :-( */
char* sbbs_cmdstr(const char* src
,char* buf
,size_t buflen /* includes '\0' terminator */
,scfg_t* scfg
,user_t* user
,int node_num
,int minutes
,int rows
,int timeleft
,SOCKET socket_descriptor
,char* protocol
,char* ip_address
,char* fpath
,char* fspec
)
{
const char* nulstr = "";
char alias_buf[LEN_ALIAS+1];
char fpath_buf[MAX_PATH+1];
char fspec_buf[MAX_PATH+1];
char sysop_buf[sizeof(scfg->sys_op)];
keyed_string_t str_list[] = {
/* user alias */
{ 'a', user!=NULL ? quoted_string(user->alias, alias_buf, sizeof(alias_buf)) : nulstr },
{ 'A', user!=NULL ? user->alias : nulstr },
/* connection */
{ 'c', protocol },
{ 'C', protocol },
/* file path */
{ 'f', quoted_string(fpath, fpath_buf, sizeof(fpath_buf)) },
{ 'F', fpath },
/* temp dir */
{ 'g', scfg->temp_dir },
{ 'G', scfg->temp_dir },
/* IP address */
{ 'h', ip_address },
{ 'H', ip_address },
/* data dir */
{ 'j', scfg->data_dir },
{ 'J', scfg->data_dir },
/* ctrl dir */
{ 'k', scfg->ctrl_dir },
{ 'K', scfg->ctrl_dir },
/* node dir */
{ 'n', scfg->node_dir },
{ 'N', scfg->node_dir },
/* sysop */
{ 'o', quoted_string(scfg->sys_op, sysop_buf, sizeof(sysop_buf)) },
{ 'O', scfg->sys_op },
/* protocol */
{ 'p', protocol },
{ 'P', protocol },
/* system QWK-ID */
{ 'q', scfg->sys_id },
{ 'Q', scfg->sys_id },
/* file spec */
{ 's', quoted_string(fspec, fspec_buf, sizeof(fspec_buf)) },
{ 'S', fspec },
/* UART I/O Address (in hex) 'f' for FOSSIL */
{ 'u', "f" },
{ 'U', "f" },
/* text dir */
{ 'z', scfg->text_dir },
{ 'Z', scfg->text_dir },
/* exec dir */
{ '!', scfg->exec_dir },
{ '@',
#ifndef __unix__
scfg->exec_dir
#else
nulstr
#endif
}
,
/* .exe (on Windows) */
{
'.'
,
#ifndef __unix__
".exe"
#else
nulstr
#endif
},
/* terminator */
{
0
}
}
;
keyed_int_t
int_list
[]
=
{
/* node number */
{
'#'
,
node_num
},
/* DTE rate */
{
'b'
,
38400
},
{
'B'
,
38400
},
/* DCE rate */
{
'd'
,
30000
},
{
'D'
,
30000
},
/* Estimated Rate (cps) */
{
'e'
,
3000
},
{
'E'
,
3000
},
{
'h'
,
socket_descriptor
},
{
'H'
,
socket_descriptor
},
{
'l'
,
user
==
NULL
?
0
:
scfg
->
level_linespermsg
[
user
->
level
]
},
{
'L'
,
user
==
NULL
?
0
:
scfg
->
level_linespermsg
[
user
->
level
]
},
{
'm'
,
minutes
},
{
'M'
,
minutes
},
{
'r'
,
rows
},
{
'R'
,
rows
},
/* Time left in seconds */
{
't'
,
timeleft
},
{
'T'
,
timeleft
},
/* Credits */
{
'$'
,
user
==
NULL
?
0
:
(
user
->
cdt
+
user
->
freecdt
)
},
/* terminator */
{
0
}
};
return
replace_keyed_values
(
src
,
buf
,
buflen
,
'%'
,
str_list
,
int_list
,
TRUE
);
}
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment