当前位置: 首页>>代码示例>>C++>>正文


C++ s_cat函数代码示例

本文整理汇总了C++中s_cat函数的典型用法代码示例。如果您正苦于以下问题:C++ s_cat函数的具体用法?C++ s_cat怎么用?C++ s_cat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了s_cat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的s_cat函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。