本文整理汇总了C++中s_cat函数的典型用法代码示例。如果您正苦于以下问题:C++ s_cat函数的具体用法?C++ s_cat怎么用?C++ s_cat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了s_cat函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ReadLinePromptSet
/*
* Sets the prompt
*/
void ReadLinePromptSet (const char *prompt)
{
rl_prompt_time = time (NULL);
s_init (&rl_prompt, COLSERVER, 0);
s_cat (&rl_prompt, ConvTo (prompt, ENC(enc_loc))->txt);
s_cat (&rl_prompt, COLNONE);
s_catc (&rl_prompt, ' ');
if (rl_prompt_stat != 0)
rl_prompt_stat = 2;
}
开发者ID:egphilippov,项目名称:buguldey-ai-foss,代码行数:13,代码来源:util_rl.c
示例2: ccl_binname
char* ccl_binname(char* bit) {
char* ret=q("");
char* _uname_m=uname_m();
char* _uname=uname_s();
if(strcmp(_uname,"linux")==0) {
if(strcmp(_uname_m,"armhf")!=0)
ret=s_cat(ret,q("l"),NULL);
}else if(strcmp(_uname,"windows")==0) {
ret=s_cat(ret,q("w"),NULL);
}else if(strcmp(_uname,"darwin")==0) {
ret=s_cat(ret,q("d"),NULL);
}else if(strcmp(_uname,"freebsd")==0) {
ret=s_cat(ret,q("f"),NULL);
}
if(strcmp(_uname_m,"x86-64")==0 ||
strcmp(_uname_m,"x86")==0) {
ret=s_cat(ret,q("x86"),NULL);
}else if(strcmp(_uname_m,"armhf")==0)
ret=s_cat(ret,q("arm"),NULL);
ret=s_cat(ret,q("cl"),NULL);
if((strcmp(_uname_m,"x86-64")==0 &&
strcmp(bit,"32")!=0) ||
(strcmp(_uname_m,"x86")==0 &&
strcmp(bit,"64")==0))
ret=s_cat(ret,q("64"),NULL);
return ret;
}
开发者ID:roswell,项目名称:roswell,代码行数:27,代码来源:cmd-run-ccl.c
示例3: G77_chmod_0
integer
G77_chmod_0 ( /* const */ char *name, /* const */ char *mode,
const ftnlen Lname, const ftnlen Lmode)
{
char *buff;
int i;
ftnlen l, l2;
ftnlen six = 6;
address a[6];
ftnlen ii[6];
char chmod_path[] = CHMOD_PATH;
l = strlen (chmod_path);
buff = malloc (Lname + Lmode + l + 3 + 13 + 1);
if (!buff)
return -1;
ii[0] = l;
a[0] = chmod_path;
ii[1] = 1;
a[1] = " ";
ii[2] = Lmode;
a[2] = mode;
ii[3] = 2;
a[3] = " '";
for (l2 = Lname; (l2 > 1) && (name[l2 - 1] == ' ');)
l2--;
ii[4] = l2;
a[4] = name;
ii[5] = 13;
a[5] = "' 2>/dev/null";
s_cat (buff, a, ii, &six, Lname + Lmode + l + 3 + 13);
buff[Lname + Lmode + l + 3 + 13] = '\0';
i = system (buff);
free (buff);
return i;
}
开发者ID:VargMon,项目名称:dd-wrt,代码行数:35,代码来源:chmod_.c
示例4: rl_insert_basic
/*
* Insert a character by unicode codepoint, display string in local encoding
* and its length, and its width in columns
*/
static void rl_insert_basic (wchar_tt ucs, const char *display, UDWORD len, UDWORD collen)
{
int i;
if (((rl_prompt_len + rl_colpos) % rl_columns) + collen > rl_columns)
{
for (i = (rl_columns - ((rl_prompt_len + rl_colpos) % rl_columns)); i > 0; i--)
{
wint_tt weof = WEOF;
s_insn (&rl_ucs, sizeof (wint_tt) * rl_ucspos, (const char *)&weof, sizeof (wint_tt));
s_insc (&rl_ucscol, rl_ucspos, 1);
s_insc (&rl_ucsbytes, rl_ucspos++, 1);
s_insc (&rl_display, rl_bytepos++, ' ');
s_catc (&rl_operate, ' ');
rl_colpos++;
}
}
s_insn (&rl_ucs, sizeof (wint_tt) * rl_ucspos, (const char *)&ucs, sizeof (wint_tt));
s_insc (&rl_ucscol, rl_ucspos, collen);
s_insc (&rl_ucsbytes, rl_ucspos++, len);
s_insn (&rl_display, rl_bytepos, display, len);
rl_colpos += collen;
rl_bytepos += len;
s_cat (&rl_operate, display);
}
开发者ID:egphilippov,项目名称:buguldey-ai-foss,代码行数:30,代码来源:util_rl.c
示例5: G77_time_0
/* Subroutine */ int G77_date_y2kbug_0 (char *buf, ftnlen buf_len)
{
/* System generated locals */
address a__1[5];
longint i__1;
integer i__2[5];
char ch__1[24];
/* Builtin functions */
/* Subroutine */ int s_copy(), s_cat();
/* Local variables */
static char cbuf[24];
extern longint G77_time_0 ();
extern /* Character */ VOID G77_ctime_0 ();
i__1 = G77_time_0 ();
G77_ctime_0 (ch__1, 24L, &i__1);
s_copy(cbuf, ch__1, 24L, 24L);
/* Writing concatenation */
i__2[0] = 2, a__1[0] = cbuf + 8;
i__2[1] = 1, a__1[1] = "-";
i__2[2] = 3, a__1[2] = cbuf + 4;
i__2[3] = 1, a__1[3] = "-";
i__2[4] = 2, a__1[4] = cbuf + 22;
s_cat(buf, a__1, i__2, &c__5, buf_len);
return 0;
} /* date_ */
开发者ID:aosm,项目名称:gcc3,代码行数:28,代码来源:date_.c
示例6: s_init
/*
* Export options into a string.
*/
const char *OptString (const Opt *opts)
{
static str_s str;
int i, flag;
val_t val = 0;
s_init (&str, "", 100);
for (i = 0; OptList[i].name; i++)
if (OptGetVal (opts, flag = OptList[i].flag, &val))
{
if (flag & COF_BOOL)
{
if (!*str.txt)
s_cat (&str, "options");
s_catf (&str, " %s %s", OptList[i].name, val ? "on" : "off");
}
else
{
if (*str.txt)
s_catc (&str, '\n');
if (flag & COF_NUMERIC)
s_catf (&str, "options %s %lu", OptList[i].name, UD2UL (val));
else if (flag & COF_COLOR)
s_catf (&str, "options %s %s", OptList[i].name, s_quote (OptS2C (strtable[val])));
else
s_catf (&str, "options %s %s", OptList[i].name, s_quote (strtable[val]));
}
}
if (*str.txt)
s_catc (&str, '\n');
return str.txt;
}
开发者ID:tadu,项目名称:climm,代码行数:37,代码来源:util_opts.c
示例7: rl_recheck
/*
* Re-check remaining line for multicolumn line break problems
*/
static void rl_recheck (BOOL clear)
{
int gpos, i;
gpos = rl_colpos;
while (rl_ucspos < rl_ucscol.len)
{
if (rl_ucs_at (&rl_ucs, rl_ucspos) == WEOF)
{
s_deln (&rl_ucs, sizeof (wint_tt) * rl_ucspos, sizeof (wint_tt));
s_delc (&rl_ucsbytes, rl_ucspos);
s_delc (&rl_ucscol, rl_ucspos);
s_delc (&rl_display, rl_bytepos);
}
else if (((rl_prompt_len + rl_colpos) % rl_columns)
+ (UBYTE)rl_ucscol.txt[rl_ucspos] > rl_columns)
{
for (i = (rl_columns - ((rl_prompt_len + rl_colpos) % rl_columns)); i > 0; i--)
{
wint_tt weof = WEOF;
s_insn (&rl_ucs, sizeof (wint_tt) * rl_ucspos, (const char *)&weof, sizeof (wint_tt));
s_insc (&rl_ucscol, rl_ucspos, 1);
s_insc (&rl_ucsbytes, rl_ucspos++, 1);
s_insc (&rl_display, rl_bytepos++, ' ');
s_catc (&rl_operate, ' ');
rl_colpos++;
}
}
else
{
s_catn (&rl_operate, rl_display.txt + rl_bytepos, rl_ucsbytes.txt[rl_ucspos]);
rl_bytepos += rl_ucsbytes.txt[rl_ucspos];
rl_colpos += rl_ucscol.txt[rl_ucspos];
rl_ucspos++;
}
}
#ifdef ANSI_TERM
s_cat (&rl_operate, " \b");
if (clear)
s_cat (&rl_operate, ANSI_CLEAR);
#else
s_cat (&rl_operate, " \b\b\b\b\b");
#endif
rl_goto (gpos);
}
开发者ID:egphilippov,项目名称:buguldey-ai-foss,代码行数:49,代码来源:util_rl.c
示例8: determin_impl
char* determin_impl(char* impl) {
char* version=NULL;
int pos;
cond_printf(1,"determin_impl:%s\n",impl);
if(impl && (pos=position_char("/",impl))!=-1) {
version=subseq(impl,pos+1,0);
impl=subseq(impl,0,pos);
}else {
if(!impl)
impl=get_opt("default.lisp",1);
if(impl) {
char* opt=s_cat(q(impl),q("."),q("version"),NULL);
version=get_opt(opt,1);
s(opt);
}
if(!impl)
impl=DEFAULT_IMPL;
impl=q(impl);
if(version)
version=q(version);
}
if(!version&&strcmp(impl,DEFAULT_IMPL)!=0) {
cond_printf(1,"once!%s,%s\n",impl,version);
if(!version)
s(version);
version=q("system");
}
if(!(impl && version)) {
char* cmd=cat(which(argv_orig[0]),verbose>0?(verbose>1?" -v -v":" -v"):""," setup",NULL);
char* ret;
if(impl) s(impl);
impl=q(DEFAULT_IMPL);
cond_printf(1,"cmd:%s\n",cmd);
ret=system_(cmd);
cond_printf(1,"ret:%s\n",ret);
s(ret);
char* path=s_cat(configdir(),q("config"),NULL);
global_opt=load_opts(path),s(path);;
version=get_opt(DEFAULT_IMPL".version",0);
}
return s_cat(impl,q("/"),version,NULL);
}
开发者ID:JamesTFarrington,项目名称:roswell,代码行数:43,代码来源:cmd-run.c
示例9: do_out
const void do_out(HandlerInfo *state, const char *str)
{
s_cat(state->out_buf, (char*) str);
if (strlen(str, MAX_STR_OUT_LEN*2) > MAX_STR_OUT_LEN) {
fprintf(ERRFILE, "ERROR: bad str\n");
fprintf(ERRFILE, "%s", str);
return;
}
}
开发者ID:joeedh,项目名称:cserver,代码行数:10,代码来源:boilerplate.c
示例10: rename_file
int rename_file(char* file,char* new_name) {
#ifndef HAVE_WINDOWS_H
char* cmd;
int ret;
cmd=s_cat(q("mv "),q(file),q(" "),q(new_name),NULL);
ret=System(cmd);
s(cmd);
return ret==0;
#else
return MoveFileEx(file,new_name,MOVEFILE_REPLACE_EXISTING);
#endif
}
开发者ID:JamesTFarrington,项目名称:roswell,代码行数:12,代码来源:util.c
示例11: app_init_home
void app_init_home( t_app *app)
{
int size = 16;
char name[size];
int size_home = _PATH_;
char path_home[size_home];
sys_get( "whoami", name, size);
s_cp( path_home, "/home/", size_home);
s_cat( path_home, name, size);
s_cat( path_home, "/.minuit/", size_home);
if( !sys_file_exists( path_home))
{
printf("Creating minuit home directory: %s\n", path_home);
mkdir( path_home, 0777);
}
s_cp( app->path_home, path_home, _PATH_);
}
开发者ID:rvba,项目名称:minuit,代码行数:22,代码来源:app.c
示例12: installed_p
int installed_p(struct install_options* param) {
int ret;
char *i,*impl;
impl=q(param->impl);
//TBD for util.
i=s_cat(configdir(),q("impls"),q(SLASH),q(param->arch),q(SLASH),q(param->os),q(SLASH),
q(impl),q(param->version?SLASH:""),q(param->version?param->version:""),q(SLASH),NULL);
ret=directory_exist_p(i);
cond_printf(1,"directory_exist_p(%s)=%d\n",i,ret);
s(i),s(impl);
return ret;
}
开发者ID:neuroradiology,项目名称:roswell,代码行数:13,代码来源:cmd-install.c
示例13: exec_arg
void exec_arg(char** arg) {
#ifdef _WIN32
int i;
char* cmd=q(arg[0]);
for(i=1;arg[i]!=NULL;++i) {
cmd=s_cat(cmd,q(" "),q("\""),escape_string(arg[i]),q("\""),NULL);
}
SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE);
exit(System(cmd));
s(cmd);
#else
execvp(arg[0],&(arg[0]));
#endif
}
开发者ID:guicho271828,项目名称:roswell,代码行数:14,代码来源:util_system.c
示例14: array_len
char *RQ_BuildQuery(char **query)
{
int i;
char *buf = NULL;
char *ret = NULL;
int qlen = array_len(query);
s_cat(ret, "?");
for (i=0; i<qlen/2; i++) {
int blen;
if (i > 0)
s_cat(ret, "&");
blen = array_len(query[i*2])*3+1;
array_resize(buf, blen);
RQ_EscapePath(query[i*2], buf, blen, RQ_ESC_QUERY|RQ_ESC_LABEL|RQ_ESC_PATH);
s_cat(ret, buf);
s_cat(ret, "=");
if (i*2+1 >= qlen) {
break;
}
blen = array_len(query[i*2+1])*3+1;
array_resize(buf, blen);
RQ_EscapePath(query[i*2+1], buf, blen, RQ_ESC_QUERY|RQ_ESC_LABEL|RQ_ESC_PATH);
s_cat(ret, buf);
}
return ret;
}
开发者ID:joeedh,项目名称:cserver,代码行数:37,代码来源:requestlib.c
示例15: switch
char *app_get_file_path( t_app *app, int type)
{
switch ( type)
{
case( APP_FILENAME_SAVE):
s_cp( app_filename_save, app->path_home, _PATH_);
s_cat( app_filename_save, "minuit.save", _PATH_);
return app_filename_save;
break;
default:
printf("[APP] Error, unknown filename\n");
return NULL;
break;
}
}
开发者ID:rvba,项目名称:minuit,代码行数:15,代码来源:app.c
示例16: ReadLinePromptHide
/*
* Hides the prompt
*/
void ReadLinePromptHide ()
{
int pos = rl_colpos;
ReadLineHandleSig ();
if (rl_prompt_stat == 0)
return;
s_init (&rl_operate, "", 0);
rl_goto (0);
s_catc (&rl_operate, '\r');
#ifdef ANSI_TERM
s_cat (&rl_operate, ANSI_CLEAR);
#endif
printf ("%s", rl_operate.txt);
rl_prompt_stat = 0;
rl_colpos = pos;
rl_print ("\r");
}
开发者ID:egphilippov,项目名称:buguldey-ai-foss,代码行数:20,代码来源:util_rl.c
示例17: s_cat
char *RQ_BuildReq(ReqInfo *req, int add_path, int code)
{
char *s = NULL;
char buf[1024];
char **headers = req->headers;
char *reason;
int i, len;
s_cat(s, req->method);
if (add_path) {
s_cat(s, " ");
s_cat(s, req->path);
}
if (code == 200) {
reason = "OK";
} else if (code > 400) {
reason = "ERR";
}
sprintf(buf, "http/1.1 %d %s\r\n", code, reason);
s_cat(s, buf);
len = array_len(headers);
for (i=0; i<len/2; i++) {
if (i*2+1 >= len) break;
s_cat(s, headers[i*2]);
s_cat(s, ": ");
s_cat(s, headers[i*2+1]);
s_cat(s, "\r\n");
}
s_cat(s, "\r\n");
return s;
}
开发者ID:joeedh,项目名称:cserver,代码行数:36,代码来源:requestlib.c
示例18: cmd_script_frontend
int cmd_script_frontend(int argc,char **argv,struct sub_command* cmd) {
FILE* in;
char buf[800];
int i=0,j,c;
int argc_;
char** argv_;
char** argv_gen;
struct opts* opt;
if(script_frontend_sentinel)
return cmd_script(argc,argv,cmd);
script_frontend_sentinel=1;
if(strcmp(argv[0],"--")==0)
++argv,--argc;
cond_printf(1,"frontend:script_%s:argc=%d argv[0]=%s\n",cmd->name,argc,argv[0]);
for(opt=local_opt;opt;opt=opt->next)
if(strcmp(opt->name,"lisp")==0)
opt->name=s_cat(q("*"),opt->name,NULL);
if((in=fopen(argv[0],"rb"))!=NULL) {
if(fgetc(in)!='#'||fgetc(in)!='!') {
fclose(in);
cmd_script(argc,argv,cmd);
}
for(i=0;i<3;++i)
while((c=fgetc(in))!=EOF && c!='\n');
for(i=0;(c=fgetc(in))!=EOF;buf[i++]=c)
if(c=='\r'||c=='\n'||i==799)
break;
fclose(in);
}
buf[i]='\0';
cond_printf(1,"ros_script_cmd=%s\n",buf);
argv_=parse_cmdline(buf,&argc_);
argv_gen=alloc(sizeof(char**)*(argc+argc_));
for(i=0;i<argc_-2&&strcmp(argv_[i+2],"$0")!=0;++i)
argv_gen[i]=argv_[i+2];
for(j=i;i<j+argc;++i)
argv_gen[i]=argv[i-j];
j=i;
for(i=0;i<j;i+=proccmd(j-i,&argv_gen[i],top_options,top_commands));
return 0;
}
开发者ID:JamesTFarrington,项目名称:roswell,代码行数:42,代码来源:cmd-run.c
示例19: sbcl_bin_expand
int sbcl_bin_expand(struct install_options* param) {
char* impl=param->impl;
char* version=q(param->version);
int ret;
char* home=configdir();
char* arch= arch_(param);
char* archive=cat(impl,"-",version,"-",arch,".msi",NULL);
char* log_path=cat(home,"impls",SLASH,"log",SLASH,impl,"-",version,"-",arch,SLASH,"install.log",NULL);
char* dist_path;
int pos=position_char("-",impl);
if(pos!=-1) {
impl=subseq(impl,0,pos);
}else
impl=q(impl);
dist_path=cat(home,"src",SLASH,impl,"-",version,"-",arch,SLASH,NULL);
printf("Extracting the msi archive. %s to %s\n",archive,dist_path);
archive=s_cat(q(home),q("archives"),q(SLASH),archive,NULL);
delete_directory(dist_path,1);
ensure_directories_exist(dist_path);
ensure_directories_exist(log_path);
if(dist_path[strlen(dist_path)-1]=='\\')
dist_path[strlen(dist_path)-1]='\0';
char* cmd=cat("msiexec.exe /a \"",
archive,
"\" targetdir=\"",
dist_path,
"\" /qn /lv ",
"\"",
log_path,
"\"",
NULL);
cmd=cat("cmd /c \"",cmd,"\"",NULL);
cond_printf(1,"msiexeccmd:%s\n",cmd);
ret=System(cmd);
s(impl);
s(dist_path);
s(log_path);
s(archive);
s(cmd),s(home),s(version),s(arch);
return !ret;
}
开发者ID:biwakonbu,项目名称:roswell,代码行数:42,代码来源:install-sbcl-bin_windows.c
示例20: rl_linecompress
/*
* Compresses part of the current edited line into an UTF8 string
*/
static void rl_linecompress (str_t line, UDWORD from, UDWORD to)
{
UDWORD i;
wint_tt ucs;
if (to == (UDWORD)-1)
to = rl_ucscol.len;
s_init (line, "", 0);
for (i = from; i < to; i++)
{
ucs = rl_ucs_at (&rl_ucs, i);
#if DEBUG_RL
fprintf (stderr, "ucs %x\n", ucs);
#endif
if (ucs != WEOF)
s_cat (line, ConvUTF8 (ucs));
}
#if DEBUG_RL
fprintf (stderr, "compress %s\n", s_qquote (line->txt));
#endif
}
开发者ID:egphilippov,项目名称:buguldey-ai-foss,代码行数:24,代码来源:util_rl.c
注:本文中的s_cat函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论