您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ string_alloc函数代码示例

51自学网 2021-06-03 08:30:01
  C++
这篇教程C++ string_alloc函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了string_alloc函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: parse_windows_proxy_setting

static const char *parse_windows_proxy_setting (const char *str, struct auto_proxy_info_entry *e, struct gc_arena *gc){  char buf[128];  const char *ret = NULL;  struct buffer in;  CLEAR (*e);  buf_set_read (&in, (const uint8_t *)str, strlen (str));  if (strchr (str, '=') != NULL)    {      if (buf_parse (&in, '=', buf, sizeof (buf)))	ret = string_alloc (buf, gc);    }	  if (buf_parse (&in, ':', buf, sizeof (buf)))    e->server = string_alloc (buf, gc);  if (e->server && buf_parse (&in, '/0', buf, sizeof (buf)))    e->port = atoi (buf);  return ret;}
开发者ID:alephzain,项目名称:archos-gpl-gen8,代码行数:25,


示例2: get_auth_challenge

/* * See management/management-notes.txt for more info on the * the dynamic challenge/response protocol implemented here. */struct auth_challenge_info *get_auth_challenge (const char *auth_challenge, struct gc_arena *gc){  if (auth_challenge)    {      struct auth_challenge_info *ac;      const int len = strlen (auth_challenge);      char *work = (char *) gc_malloc (len+1, false, gc);      char *cp;      struct buffer b;      buf_set_read (&b, (const uint8_t *)auth_challenge, len);      ALLOC_OBJ_CLEAR_GC (ac, struct auth_challenge_info, gc);      /* parse prefix */      if (!buf_parse(&b, ':', work, len))	return NULL;      if (strcmp(work, "CRV1"))	return NULL;      /* parse flags */      if (!buf_parse(&b, ':', work, len))	return NULL;      for (cp = work; *cp != '/0'; ++cp)	{	  const char c = *cp;	  if (c == 'E')	    ac->flags |= CR_ECHO;	  else if (c == 'R')	    ac->flags |= CR_RESPONSE;	}            /* parse state ID */      if (!buf_parse(&b, ':', work, len))	return NULL;      ac->state_id = string_alloc(work, gc);      /* parse user name */      if (!buf_parse(&b, ':', work, len))	return NULL;      ac->user = (char *) gc_malloc (strlen(work)+1, true, gc);      openvpn_base64_decode(work, (void*)ac->user, -1);      /* parse challenge text */      ac->challenge_text = string_alloc(BSTR(&b), gc);      return ac;    }  else    return NULL;}
开发者ID:huamichaelchen,项目名称:openvpn,代码行数:56,


示例3: argv_printf_arglist

voidargv_printf_arglist (struct argv *a, const char *format, const unsigned int flags, va_list arglist){  struct gc_arena gc = gc_new ();  char *term;  const char *f = format;  if (!(flags & APA_CAT))    argv_reset (a);  argv_extend (a, 1); /* ensure trailing NULL */  while ((term = argv_term (&f)) != NULL)     {      if (term[0] == '%')	{	  if (!strcmp (term, "%s"))	    {	      char *s = va_arg (arglist, char *);	      if (!s)		s = "";	      argv_append (a, string_alloc (s, NULL));	      argv_system_str_append (a, s, true);	    }	  else if (!strcmp (term, "%sc"))	    {	      char *s = va_arg (arglist, char *);	      if (s)		{		  int nparms;		  char *parms[MAX_PARMS+1];		  int i;		  nparms = parse_line (s, parms, MAX_PARMS, "SCRIPT-ARGV", 0, D_ARGV_PARSE_CMD, &gc);		  if (nparms)		    {		      for (i = 0; i < nparms; ++i)			argv_append (a, string_alloc (parms[i], NULL));		    }		  else		    argv_append (a, string_alloc (s, NULL));		  argv_system_str_append (a, s, false);		}	      else		{		  argv_append (a, string_alloc ("", NULL));		  argv_system_str_append (a, "echo", false);		}	    }
开发者ID:huamichaelchen,项目名称:openvpn,代码行数:49,


示例4: string_alloc

char *get_host(UriUriA *uri){	char *ret_str = NULL;	int i, len = 0;	if (uri->hostData.ip4)		return *string_printf(&ret_str, "%d.%d.%d.%d", uri->hostData.ip4->data[0],			uri->hostData.ip4->data[1], uri->hostData.ip4->data[2], uri->hostData.ip4->data[3]);		if (uri->hostData.ip6) {		ret_str = string_alloc(40);		for (i = 0; i < 16; i++) {			len += sprintf(ret_str + len, "%2.2x", uri->hostData.ip6->data[i]);			if (i % 2 == 1 && i < 15)				ret_str[len++] = ':';		}		return ret_str;	}	if (uri->hostData.ipFuture.first) 		return string_nnew(uri->hostData.ipFuture.first,			uri->hostData.ipFuture.afterLast - uri->hostData.ipFuture.first);	if (uri->hostText.first) 		return string_nnew(uri->hostText.first, uri->hostText.afterLast - uri->hostText.first);	return NULL;}
开发者ID:ASpade,项目名称:mulk,代码行数:29,


示例5: FormatMessage

static char *ms_error_text(DWORD ms_err){    LPVOID lpMsgBuf = NULL;    char *rv = NULL;    FormatMessage(	FORMAT_MESSAGE_ALLOCATE_BUFFER |	FORMAT_MESSAGE_FROM_SYSTEM |	FORMAT_MESSAGE_IGNORE_INSERTS,	NULL, ms_err,	MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */	(LPTSTR) &lpMsgBuf, 0, NULL);    if (lpMsgBuf) {	char *p;	rv = string_alloc(lpMsgBuf, NULL);	LocalFree(lpMsgBuf);	/* trim to the left */	if (rv)	    for (p = rv + strlen(rv) - 1; p >= rv; p--) {		if (isspace(*p))		    *p = '/0';		else		    break;	    }    }    return rv;}
开发者ID:746bce42110a11028656eca33867,项目名称:openvpn,代码行数:27,


示例6: _doc_process_var

static void _doc_process_var(doc_ptr doc, cptr name){    if (strcmp(name, "version") == 0)    {        string_ptr s = string_alloc_format("%d.%d.%d", VER_MAJOR, VER_MINOR, VER_PATCH);        doc_insert(doc, string_buffer(s));        string_free(s);    }    else if (strlen(name) > 3 && strncmp(name, "FF_", 3) == 0)    {        char buf[100];        int  f_idx;        sprintf(buf, "%s", name + 3);        f_idx = f_tag_to_index(buf);        if (0 <= f_idx && f_idx < max_f_idx)        {            string_ptr s = string_alloc();            feature_type *feat = &f_info[f_idx];            string_printf(s, "<color:%c>%c</color>",                attr_to_attr_char(feat->d_attr[F_LIT_STANDARD]),                feat->d_char[F_LIT_STANDARD]);            doc_insert(doc, string_buffer(s));            string_free(s);        }    }}
开发者ID:Alkalinear,项目名称:poschengband,代码行数:30,


示例7: GuizmOVPN_tools

/* * GuizmOVPN_get_auto_proxy (struct gc_arena *gc) : *      Detect proxy settings */struct auto_proxy_info *GuizmOVPN_get_auto_proxy (struct gc_arena *gc){    guizmovpn_ctx.bAutoproxy=true;        GuizmOVPN_tools("handle_proxy");        struct auto_proxy_info *pi;        char szHTTPProxyIP[32];    char szHTTPProxyPort[32];    int32_t HTTPProxyPort=0;        szHTTPProxyIP[0]='/0';    GuizmOVPN_ReadPrefs("HTTPProxy",szHTTPProxyIP);        szHTTPProxyPort[0]='/0';    GuizmOVPN_ReadPrefs("HTTPPort",szHTTPProxyPort);    HTTPProxyPort=atoi(szHTTPProxyPort);        if(strlen(szHTTPProxyIP)>7 && HTTPProxyPort>=0)    {        ALLOC_OBJ_CLEAR_GC (pi, struct auto_proxy_info, gc);        pi->http.server=string_alloc(szHTTPProxyIP,gc);        pi->http.port = HTTPProxyPort;                msg (M_INFO,"Proxy detected : %s:%d",szHTTPProxyIP,HTTPProxyPort);        return pi;    } else {    	return NULL;    }}
开发者ID:AVESH-RAI,项目名称:guizmovpn,代码行数:35,


示例8: make_string_fn

static obj_t make_string_fn(obj_t args, Reporter rep){	size_t nargs, i, k;	char ch;	string str;	nargs = list_length(args);	if (nargs == 0 || nargs > 2) {		reportf(rep, "make-string: "			"length and optional fill char expected");		return unspecific;	}	if (!is_num(list_ref(args, 0))) {		reportf(rep, "make-string: "			"first argument must be a non-negative integer");		return unspecific;	}	if (nargs == 2 && !is_char(list_ref(args, 1))) {		reportf(rep, "make-string: "			"second argument must be a character");		return unspecific;	}	k = fetch_num(list_ref(args, 0));	ch  = (nargs == 1) ? 0 : fetch_char(list_ref(args, 1));	str = string_alloc(k);	for (i = 0; i < str->len; i++)		str->data[i] = ch;	return make_string(str);}
开发者ID:miklos1,项目名称:scene,代码行数:31,


示例9: pkcs11_certificate_dn

char *pkcs11_certificate_dn (pkcs11h_certificate_t cert, struct gc_arena *gc){  char *ret = NULL;  char dn[1024] = {0};  mbedtls_x509_crt mbed_crt = {0};  if (mbedtls_pkcs11_x509_cert_bind(&mbed_crt, cert)) {      msg (M_FATAL, "PKCS#11: Cannot retrieve mbed TLS certificate object");      goto cleanup;  }  if (-1 == mbedtls_x509_dn_gets (dn, sizeof(dn), &mbed_crt.subject)) {      msg (M_FATAL, "PKCS#11: mbed TLS cannot parse subject");      goto cleanup;  }  ret = string_alloc(dn, gc);cleanup:  mbedtls_x509_crt_free(&mbed_crt);  return ret;}
开发者ID:746bce42110a11028656eca33867,项目名称:openvpn,代码行数:25,


示例10: get_pa_var

static char *get_pa_var (const char *key, const char *pa, struct gc_arena *gc){  char k[64];  char v[256];  const char *content = pa;  while (true)    {      const int status = get_key_value(content, k, v, sizeof(k), sizeof(v), &content);      if (status)	{	  if (!strcmp(key, k))	    return string_alloc(v, gc);	}      else	return NULL;      /* advance to start of next key */      if (*content == ',')	++content;      while (*content && isspace(*content))	++content;    }}
开发者ID:ThomasHabets,项目名称:openvpn,代码行数:25,


示例11: prepare_push_reply

/** * Prepare push options, based on local options and available peer info. * * @param options	Connection options * @param tls_multi	TLS state structure for the current tunnel * * @return true on success, false on failure. */static boolprepare_push_reply (struct options *o, struct tls_multi *tls_multi){  const char *optstr = NULL;  const char * const peer_info = tls_multi->peer_info;  /* Send peer-id if client supports it */  optstr = peer_info ? strstr(peer_info, "IV_PROTO=") : NULL;  if (optstr)    {      int proto = 0;      int r = sscanf(optstr, "IV_PROTO=%d", &proto);      if ((r == 1) && (proto >= 2))	{	  push_option_fmt(o, M_USAGE, "peer-id %d", tls_multi->peer_id);	}    }  /* Push cipher if client supports Negotiable Crypto Parameters */  if (tls_peer_info_ncp_ver (peer_info) >= 2 && o->ncp_enabled)    {      /* Push the first cipher from --ncp-ciphers to the client.       * TODO: actual negotiation, instead of server dictatorship. */      char *push_cipher = string_alloc(o->ncp_ciphers, &o->gc);      o->ciphername = strtok (push_cipher, ":");      push_option_fmt(o, M_USAGE, "cipher %s", o->ciphername);    }  return true;}
开发者ID:ValdikSS,项目名称:openvpn-with-patches,代码行数:37,


示例12: obj_mul

Object obj_mul(Object a, Object b) {    if (a.type == b.type && a.type == TYPE_NUM) {        GET_NUM(a) *= GET_NUM(b);        return a;    }    if (a.type == TYPE_NUM && b.type == TYPE_STR) {        Object temp = a;        a = b;        b = temp;    }    if (a.type == TYPE_STR && b.type == TYPE_NUM) {        int len = GET_STR_LEN(a);        Object des;        if (len == 0)            return a;        int times = (int) GET_NUM(b);        if (times <= 0)            return sz_to_string("");        if (times == 1)            return a;        des = string_alloc(NULL, len * times);        char* s = GET_STR(des);        int i;        for (i = 0; i < times; i++) {            strncpy(s, GET_STR(a), len);            s += len;        }        return des;    }    tm_raise("obj_mul: can not multiply %o and %o", a, b);    return NONE_OBJECT;}
开发者ID:xupingmao,项目名称:minipy,代码行数:32,


示例13: obj_add

Object obj_add(Object a, Object b) {    if (TM_TYPE(a) == TM_TYPE(b)) {        switch (TM_TYPE(a)) {        case TYPE_NUM:            GET_NUM(a) += GET_NUM(b);            return a;        case TYPE_STR: {            char* sa = GET_STR(a);            char* sb = GET_STR(b);            int la = GET_STR_LEN(a);            int lb = GET_STR_LEN(b);            if (la == 0) {return b;    }            if (lb == 0) {return a;    }            int len = la + lb;            Object des = string_alloc(NULL, len);            char*s = GET_STR(des);            memcpy(s, sa, la);            memcpy(s + la, sb, lb);            return des;        }        case TYPE_LIST: {            return list_add(GET_LIST(a), GET_LIST(b));        }        }    }    tm_raise("obj_add: can not add %o and %o", (a), (b));    return NONE_OBJECT;}
开发者ID:xupingmao,项目名称:minipy,代码行数:28,


示例14: string_new

int string_new( const char * text ){    int len = strlen( text ) + 1 ;    int i;    /* Reuse strings */    for ( i = 0; i < string_count; i++ ) if ( !strcmp( text, string_mem + string_offset[ i ] ) ) return i;    if ( string_count == string_max )    {        string_max += 1024 ;        string_offset = ( int * ) realloc( string_offset, string_max * sizeof( int ) ) ;        if ( string_offset == 0 )        {            fprintf( stdout, "Too many strings/n" ) ;            exit( 1 ) ;        }    }    while ( string_used + len >= string_allocated ) string_alloc( 1024 ) ;    string_offset[ string_count ] = string_used ;    strcpy( string_mem + string_used, text ) ;    string_used += len ;    return string_count++ ;}
开发者ID:GarethNelson,项目名称:BennuGD,代码行数:26,


示例15: string_alloc

string_t *string_copy(string_t *str){    string_t *res = string_alloc();    if (str->buf)        string_set(res, str->buf);    return res;}
开发者ID:poschengband,项目名称:emrys,代码行数:7,


示例16: cmd_en

/* EN: Enter Newline */void cmd_en (int argc, char *argv[]){	pad_t  *pad = e->cpad;	int     xpos;	int     ypos;	line_t *cline;	line_t *newline;	char   *extratext;	int    intab;	if (!(e->cpad->flags & FILE_WRITE))	{		output_message_c ("en", "Pad is read-only.");		return;	}	ypos = pad->curs_y + pad->offset_y;	if (ypos > pad->line_count)		pad_grow (pad, ypos);	LINE_insert (pad, ypos, "");	cline = LINE_get_line_at (pad, ypos);	if (cline->str != NULL)	{		xpos = get_string_pos (pad->curs_x + pad->offset_x, cline->str->data, &intab);		if ((size_t)xpos < strlen (cline->str->data))		{			/* We're 'inside' the string. Get the text on the			 * right, and truncate the current string. Then put			 * the 'extra' text on the line we've inserted or			 * allocated.			 */			extratext = cline->str->data + xpos;			newline = LINE_get_line_at (pad, ypos + 1);			newline->str = string_alloc ("%s", extratext);			string_truncate (cline->str, xpos);		}	}	pad->curs_x   = 1;	pad->offset_x = 0;	if (pad->curs_y == pad->height)	{		pad->offset_y++;	}	else	{		pad->curs_y++;	}	if (e->occupied_window == COMMAND_WINDOW)		e->occupied_window = COMMAND_WINDOW_EXECUTE;	else		pad_modified (pad);}
开发者ID:jgarlick,项目名称:gronda,代码行数:60,


示例17: argv_clone

struct argvargv_clone (const struct argv *a, const size_t headroom){  struct argv r;  size_t i;  argv_init (&r);  for (i = 0; i < headroom; ++i)    argv_append (&r, NULL);  if (a)    {      for (i = 0; i < a->argc; ++i)	argv_append (&r, string_alloc (a->argv[i], NULL));      r.system_str = string_alloc (a->system_str, NULL);    }  return r;}
开发者ID:huamichaelchen,项目名称:openvpn,代码行数:17,


示例18: get_proxy_authenticate

/* * Extract the Proxy-Authenticate header from the stream. * Consumes all headers. */static intget_proxy_authenticate (socket_descriptor_t sd,		        int timeout,			char **data,			struct gc_arena *gc,		        volatile int *signal_received){  char buf[256];  int ret = HTTP_AUTH_NONE;  while (true)    {      if (!recv_line (sd, buf, sizeof (buf), timeout, true, NULL, signal_received))	{	  *data = NULL;	  return HTTP_AUTH_NONE;	}      chomp (buf);      if (!strlen(buf))	return ret;      if (ret == HTTP_AUTH_NONE && !strncmp(buf, "Proxy-Authenticate: ", 20))	{	  if (!strncmp(buf+20, "Basic ", 6))	    {	      msg (D_PROXY, "PROXY AUTH BASIC: '%s'", buf);	      *data = string_alloc(buf+26, gc);	      ret = HTTP_AUTH_BASIC;	    }#if PROXY_DIGEST_AUTH	  else if (!strncmp(buf+20, "Digest ", 7))	    {	      msg (D_PROXY, "PROXY AUTH DIGEST: '%s'", buf);	      *data = string_alloc(buf+27, gc);	      ret = HTTP_AUTH_DIGEST;	    }#endif#if NTLM	  else if (!strncmp(buf+20, "NTLM", 4))	    {	      msg (D_PROXY, "PROXY AUTH HTLM: '%s'", buf);	      *data = NULL;	      ret = HTTP_AUTH_NTLM;	    }#endif	}    }}
开发者ID:ThomasHabets,项目名称:openvpn,代码行数:50,


示例19: argv_insert_head

struct argvargv_insert_head (const struct argv *a, const char *head){  struct argv r;  char *s;  r = argv_clone (a, 1);  r.argv[0] = string_alloc (head, NULL);  s = r.system_str;  r.system_str = string_alloc (head, NULL);  if (s)    {      argv_system_str_append (&r, s, false);      free (s);    }  return r;}
开发者ID:huamichaelchen,项目名称:openvpn,代码行数:17,


示例20: bf_time_asctime

Object bf_time_asctime() {    time_t rawtime;    struct tm* timeinfo;        time(&rawtime);    timeinfo = localtime ( &rawtime );    char* ct = asctime(timeinfo); // ct ends with /n    return string_alloc(ct, strlen(ct)-1);}
开发者ID:xupingmao,项目名称:minipy,代码行数:9,


示例21: alloc_string_array

void alloc_string_array(string_array_t *dest, int ndims, ...){    size_t elements = 0;    va_list ap;    va_start(ap, ndims);    elements = alloc_base_array(dest, ndims, ap);    va_end(ap);    dest->data = string_alloc(elements);}
开发者ID:bernhardbachmann,项目名称:OMCompiler,代码行数:9,


示例22: string_dup

Char* string_dup(const Char* str){  if (!str) return 0;  if (!*str) return &s_empty;  const size_t len = std::strlen(str);  Char* const cpy = string_alloc(static_cast<UnsignedLong>(len));  if (cpy) std::strncpy(cpy, str, len + 1);  return cpy;}
开发者ID:Fantasticer,项目名称:OpenDDS,代码行数:9,


示例23: tokeniser_advance

static void tokeniser_advance(Tokeniser* t){    ASSERT(!tokeniser_eof(t), "next() on empty tokeniser");    SET(t->tokenIndex, nil_make());    skipSpace(t);    if (*t->cursor == 0) {        t->eof = 1;        return;    }    const char* punctChars = "()'";    for (int i = 0; punctChars[i] != 0; i++) {        if (*t->cursor == punctChars[i]) {            t->cursor++;            SET(t->tokenIndex, makeToken(&punctChars[i], 1));            return;        }    }    if (*t->cursor == '"') {        // Find out how long the escaped string is, and check it was terminated        // properly.        int length = 0;        t->cursor++; // advance past the initial "        const char* end = stringEscape(t->cursor, countChars, &length);        if (*end != '"') {            THROW("Expected /", got EOF");        }        // Now allocate a string and copy it in.        Pointer ptr = string_alloc(length);        char* dest = (char*) string_get(ptr);        stringEscape(t->cursor, copyChars, &dest);        *dest = 0;        // Advance the cursor past the string.        t->cursor = end + 1;        SET(t->tokenIndex, ptr);    }    else {        // Scan out a token        const char* start = t->cursor;        while (1) {            char c = *t->cursor;            if ((c == 0) || isspace(c) || isdelim(c)) {                int length = t->cursor - start;                SET(t->tokenIndex, makeToken(start, length));                break;            }            // Advance the cursor now, not earlier.            t->cursor++;        }    }}
开发者ID:sdt,项目名称:bootstrap-a-scheme,代码行数:57,


示例24: ArgvWrapper

    ArgvWrapper(const Argv& argv)    {      size_t i;      argc = argv.size();      cargv = new char *[argc+1];      for (i = 0; i < argc; ++i)	cargv[i] = string_alloc(argv[i]);      cargv[i] = NULL;    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:9,


示例25: make_base64_string2

uint8_t *make_base64_string2 (const uint8_t *str, int src_len, struct gc_arena *gc){  uint8_t *ret = NULL;  char *b64out = NULL;  ASSERT (base64_encode ((const void *)str, src_len, &b64out) >= 0);  ret = (uint8_t *) string_alloc (b64out, gc);  free (b64out);  return ret;}
开发者ID:alephzain,项目名称:archos-gpl-gen8,代码行数:10,


示例26: cmd_ed

/* ED: Edit Delete ('delete') */void cmd_ed (int argc, char *argv[]){	pad_t  *pad = e->cpad;	int    xpos;	int    ypos;	line_t *cline;	line_t *cline2;	int    intab;	int    len;	if (!(e->cpad->flags & FILE_WRITE))	{		output_message_c ("ed", "Pad is read-only.");		return;	}	ypos = pad->curs_y + pad->offset_y;	if (ypos > pad->line_count)	{		pad_grow (pad, ypos);		pad_modified (pad);		return;	}	cline = LINE_get_line_at (pad, ypos);	len = xpos = 0;	if (cline->str) {		xpos = get_string_pos (pad->curs_x + pad->offset_x, cline->str->data, &intab);		len  = strlen (cline->str->data);	}	if (xpos < len) {		string_remove (cline->str, xpos, 1);	} else {		cline2 = LINE_get_line_at (pad, ypos + 1);		if (cline2 != NULL)		{			if (cline2->str != NULL)			{				if (cline->str == NULL)					cline->str = string_alloc ("");				if (cline->str)					string_insert (cline->str, xpos, "%s", cline2->str->data);			}			LINE_remove (pad, cline2);		}	}	pad_modified (pad);}
开发者ID:jgarlick,项目名称:gronda,代码行数:56,


示例27: add_client

static booladd_client(const char *line, const char *prefix, const int line_num, struct pf_cn_elem ***next, const bool exclude){    struct pf_cn_elem *e;    ALLOC_OBJ_CLEAR(e, struct pf_cn_elem);    e->rule.exclude = exclude;    e->rule.cn = string_alloc(line, NULL);    **next = e;    *next = &e->next;    return true;}
开发者ID:benjdag,项目名称:openvpn,代码行数:11,


示例28: string_fn

static obj_t string_fn(obj_t args, Reporter rep){	string str;	size_t i;	if (!args_plus_match(rep, args, 0, is_char))		return unspecific;	str = string_alloc(list_length(args));	for (i = 0; !is_null(args); i++, args = cdr(args))		str->data[i] = fetch_char(car(args));	return make_string(str);}
开发者ID:miklos1,项目名称:scene,代码行数:12,


示例29: add_env_item

static voidadd_env_item(char *str, const bool do_alloc, struct env_item **list, struct gc_arena *gc){    struct env_item *item;    ASSERT(str);    ASSERT(list);    ALLOC_OBJ_GC(item, struct env_item, gc);    item->string = do_alloc ? string_alloc(str, gc) : str;    item->next = *list;    *list = item;}
开发者ID:anlaneg,项目名称:openvpn,代码行数:13,



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


C++ string_append函数代码示例
C++ stringValue函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。