• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ parse_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parse_rdma_header

static guint parse_rdma_header(tvbuff_t *tvb, guint offset, proto_tree *tree)
{
    offset = parse_list(tvb, offset, tree, hf_rpcordma_reads_count,  "Reads",  TRUE);
    offset = parse_list(tvb, offset, tree, hf_rpcordma_writes_count, "Writes", FALSE);
    offset = parse_list(tvb, offset, tree, hf_rpcordma_reply_count,  "Reply",  FALSE);
    return offset;
}
开发者ID:VonChenPlus,项目名称:wireshark,代码行数:7,代码来源:packet-rpcrdma.c


示例2: c14nMain

int c14nMain(int argc, char **argv) {
    int ret = -1, nonet = 1;
    
    /*
     * Init libxml
     */     
    xmlInitParser();
    LIBXML_TEST_VERSION
    
    /*
     * Parse command line and process file
     */

    if (argc > 2 && strcmp(argv[2], "--net") == 0) {
        nonet = 0;
        /* TODO: parse options properly */
        argc--;
        argv++;
    }

    if (argc < 4) {
        if (argc >= 3)
        {
            if (strcmp(argv[2], "--help") == 0 || strcmp(argv[2], "-h") == 0)
                c14nUsage(argv[0], EXIT_SUCCESS);
        }
        ret = run_c14n((argc > 2)? argv[2] : "-", 1, 0, NULL, NULL, nonet);
    } else if(strcmp(argv[2], "--with-comments") == 0) {
        ret = run_c14n(argv[3], 1, 0, (argc > 4) ? argv[4] : NULL, NULL, nonet);
    } else if(strcmp(argv[2], "--without-comments") == 0) {
        ret = run_c14n(argv[3], 0, 0, (argc > 4) ? argv[4] : NULL, NULL, nonet);
    } else if(strcmp(argv[2], "--exc-with-comments") == 0) {
        xmlChar **list;
        
        /* load exclusive namespace from command line */
        list = (argc > 5) ? parse_list((xmlChar *)argv[5]) : NULL;
        ret = run_c14n(argv[3], 1, 1, (argc > 4) ? argv[4] : NULL, list, nonet);
        if(list != NULL) xmlFree(list);
    } else if(strcmp(argv[2], "--exc-without-comments") == 0) {
        xmlChar **list;
        
        /* load exclusive namespace from command line */
        list = (argc > 5) ? parse_list((xmlChar *)argv[5]) : NULL;
        ret = run_c14n(argv[3], 0, 1, (argc > 4) ? argv[4] : NULL, list, nonet);
        if(list != NULL) xmlFree(list);
    } else {
        fprintf(stderr, "error: bad arguments.\n");
        c14nUsage(argv[0], EXIT_BAD_ARGS);
    }

    /* 
     * Shutdown libxml
     */
    xmlCleanupParser();
    xmlMemoryDump();
    
    return ret;
}
开发者ID:PeterMosmans,项目名称:xmlstar,代码行数:58,代码来源:xml_C14N.c


示例3: parse_block

/* parse_block • parsing of one block, returning next char to parse */
static void
parse_block(struct buf *ob, struct render *rndr, char *data, size_t size)
{
	size_t beg, end, i;
	char *txt_data;
	beg = 0;

	if (rndr->work.size > rndr->max_nesting)
		return;

	while (beg < size) {
		txt_data = data + beg;
		end = size - beg;

		if (data[beg] == '#')
			beg += parse_atxheader(ob, rndr, txt_data, end);

		else if (data[beg] == '<' && rndr->make.blockhtml &&
				(i = parse_htmlblock(ob, rndr, txt_data, end, 1)) != 0)
			beg += i;

		else if ((i = is_empty(txt_data, end)) != 0)
			beg += i;

		else if (is_hrule(txt_data, end)) {
			if (rndr->make.hrule)
				rndr->make.hrule(ob, rndr->make.opaque);

			while (beg < size && data[beg] != '\n')
				beg++;

			beg++;
		}

		else if ((rndr->ext_flags & MKDEXT_FENCED_CODE) != 0 &&
			(i = parse_fencedcode(ob, rndr, txt_data, end)) != 0)
			beg += i;

		else if ((rndr->ext_flags & MKDEXT_TABLES) != 0 &&
			(i = parse_table(ob, rndr, txt_data, end)) != 0)
			beg += i;

		else if (prefix_quote(txt_data, end))
			beg += parse_blockquote(ob, rndr, txt_data, end);

		else if (prefix_code(txt_data, end))
			beg += parse_blockcode(ob, rndr, txt_data, end);

		else if (prefix_uli(txt_data, end))
			beg += parse_list(ob, rndr, txt_data, end, 0);

		else if (prefix_oli(txt_data, end))
			beg += parse_list(ob, rndr, txt_data, end, MKD_LIST_ORDERED);

		else
			beg += parse_paragraph(ob, rndr, txt_data, end);
	}
}
开发者ID:nono,项目名称:upskirt,代码行数:59,代码来源:markdown.c


示例4: do_state_init

static void do_state_init(char *ibuf, char **pscan)
{
    if (**pscan == '#'){
        stack_push(&state_stack, current_state);
        current_state = STATE_SHARP;
        ++*pscan;
    } else if (**pscan == '\''){
		stack_push(&state_stack, current_state);
		current_state = STATE_QUOTE;
		++*pscan;
		do_state_init(ibuf, pscan);
	}else if (**pscan == '.'){
        stack_push(&state_stack, current_state);
        current_state = STATE_DOT;
        ++*pscan;
    } else if (**pscan == '+'){
        stack_push(&state_stack, current_state);
        current_state = STATE_ADD;
        ++*pscan;
    } else if (**pscan == '-'){
        stack_push(&state_stack, current_state);
        current_state = STATE_SUB;
        ++*pscan;
    } else if (is_digit(**pscan)){
        stack_push(&state_stack, current_state);
        current_state = STATE_NUM;
    } else if (is_initial(**pscan)){
        stack_push(&state_stack, current_state);
        current_state = STATE_SYM;
    } else if (**pscan == '"'){
        stack_push(&state_stack, current_state);
        current_state = STATE_STR;
        ++*pscan;
    } else if (**pscan == '('){
        parse_list(ibuf, pscan);
    } else if (**pscan == ')'){
        if (current_state == STATE_LIST){
            parse_list(ibuf, pscan);
        }else if (current_state == STATE_VEC){
            parse_vector(ibuf, pscan);
        }else {
            printf("Error: unexpected ')' -- READ\n");
			do_input_error(pscan);
        }
    } else if(is_atmosphere(**pscan)){
        eat_atmosphere(pscan);
    } else{
        perror("Error: Bad input. -- READ\n");
		do_input_error(pscan);
    }
}
开发者ID:lienhua34,项目名称:CSchemer,代码行数:51,代码来源:read_parse.c


示例5: main

int main(int argc, char **argv) {
    int ret = -1;

    /*
     * Init libxml
     */
    xmlInitParser();
    LIBXML_TEST_VERSION

    /*
     * Parse command line and process file
     */
    if( argc < 3 ) {
	fprintf(stderr, "Error: wrong number of arguments.\n");
	usage(argv[0]);
    } else if(strcmp(argv[1], "--with-comments") == 0) {
	ret = test_c14n(argv[2], 1, XML_C14N_1_0, (argc > 3) ? argv[3] : NULL, NULL);
    } else if(strcmp(argv[1], "--without-comments") == 0) {
	ret = test_c14n(argv[2], 0, XML_C14N_1_0, (argc > 3) ? argv[3] : NULL, NULL);
    } else if(strcmp(argv[1], "--1-1-with-comments") == 0) {
	ret = test_c14n(argv[2], 1, XML_C14N_1_1, (argc > 3) ? argv[3] : NULL, NULL);
    } else if(strcmp(argv[1], "--1-1-without-comments") == 0) {
	ret = test_c14n(argv[2], 0, XML_C14N_1_1, (argc > 3) ? argv[3] : NULL, NULL);
    } else if(strcmp(argv[1], "--exc-with-comments") == 0) {
	xmlChar **list;

	/* load exclusive namespace from command line */
	list = (argc > 4) ? parse_list((xmlChar *)argv[4]) : NULL;
	ret = test_c14n(argv[2], 1, XML_C14N_EXCLUSIVE_1_0, (argc > 3) ? argv[3] : NULL, list);
	if(list != NULL) xmlFree(list);
    } else if(strcmp(argv[1], "--exc-without-comments") == 0) {
	xmlChar **list;

	/* load exclusive namespace from command line */
	list = (argc > 4) ? parse_list((xmlChar *)argv[4]) : NULL;
	ret = test_c14n(argv[2], 0, XML_C14N_EXCLUSIVE_1_0, (argc > 3) ? argv[3] : NULL, list);
	if(list != NULL) xmlFree(list);
    } else {
	fprintf(stderr, "Error: bad option.\n");
	usage(argv[0]);
    }

    /*
     * Shutdown libxml
     */
    xmlCleanupParser();
    xmlMemoryDump();

    return((ret >= 0) ? 0 : 1);
}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:50,代码来源:testC14N.c


示例6: ParseCommon

static void ParseCommon(map_string_t *settings, const char *conf_filename)
{
    const char *value;

    value = get_map_string_item_or_NULL(settings, "OpenGPGCheck");
    if (value)
    {
        settings_bOpenGPGCheck = string_to_bool(value);
        remove_map_string_item(settings, "OpenGPGCheck");
    }

    value = get_map_string_item_or_NULL(settings, "BlackList");
    if (value)
    {
        settings_setBlackListedPkgs = parse_list(value);
        remove_map_string_item(settings, "BlackList");
    }

    value = get_map_string_item_or_NULL(settings, "BlackListedPaths");
    if (value)
    {
        settings_setBlackListedPaths = parse_list(value);
        remove_map_string_item(settings, "BlackListedPaths");
    }

    value = get_map_string_item_or_NULL(settings, "ProcessUnpackaged");
    if (value)
    {
        settings_bProcessUnpackaged = string_to_bool(value);
        remove_map_string_item(settings, "ProcessUnpackaged");
    }

    value = get_map_string_item_or_NULL(settings, "Interpreters");
    if (value)
    {
        settings_Interpreters = parse_list(value);
        remove_map_string_item(settings, "Interpreters");
    }

    map_string_iter_t iter;
    const char *name;
    /*char *value; - already declared */
    init_map_string_iter(&iter, settings);
    while (next_map_string_iter(&iter, &name, &value))
    {
        error_msg("Unrecognized variable '%s' in '%s'", name, conf_filename);
    }
}
开发者ID:babycaseny,项目名称:abrt,代码行数:48,代码来源:abrt-action-save-package-data.c


示例7: parse_template

static Node *
parse_template (TextgenTemplate *tpl, const gchar *text, gint length,
                GError **error)
{
  GList *tokens = NULL;
  Node *node = NULL;
  GError *tmp_error = NULL;
  
  tokens = tokenize (tpl, text, length, &tmp_error);
  if (tmp_error)
    {
      g_propagate_error (error, tmp_error);
      goto finish;
    }

  node = parse_list (tpl, tokens, NULL, NULL, &tmp_error);
  if (tmp_error)
    {
      g_propagate_error (error, tmp_error);
      goto finish;
    }

finish:
  g_list_free_full (tokens, free_token);
  return node;
}
开发者ID:lamefun,项目名称:textgen,代码行数:26,代码来源:textgen-template.c


示例8: lex

struct AstNode *parse_source(
        char *source,
        void *data,
        ParserAstCallback acb)
{
    struct DomNode *dom;
    struct AstNode *ast;

    struct ParserState state = { data, acb };

    dom = lex(source);
    if (err_state()) {
        err_push("PARSE", "Failed parsing source");
        return NULL;
    }

    ast = parse_list(dom, &state);
    if (err_state()) {
        err_push("PARSE", "Failed parsing DOM list");
        dom_free(dom);
        return NULL;
    }

    dom_free(dom);
    return ast;
}
开发者ID:k-stachowiak,项目名称:moon-lang,代码行数:26,代码来源:parse.c


示例9: soup_header_parse_list

/**
 * soup_header_parse_list:
 * @header: a header value
 *
 * Parses a header whose content is described by RFC2616 as
 * "#something", where "something" does not itself contain commas,
 * except as part of quoted-strings.
 *
 * Return value: (transfer full) (element-type utf8): a #GSList of
 * list elements, as allocated strings
 **/
GSList *
soup_header_parse_list (const char *header)
{
	g_return_val_if_fail (header != NULL, NULL);

	return parse_list (header, ',');
}
开发者ID:simonmiddleton,项目名称:libsoup,代码行数:18,代码来源:soup-headers.c


示例10: my_init_serveur

void			my_init_serveur(t_server *s_info) {
  fd_set		readfds;
  int			i = 0;
  time_t		*t;
  struct timeval	*time;

  create_socket_s(s_info);
  s_info->graph = 0;
  my_prompt_welc(s_info);
  s_info->list = NULL;
  s_info->egg = NULL;
  create_ele_fct(s_info);
  while (check_victory(s_info) != 1) {
    time->tv_sec= 1;
    FD_ZERO(&readfds);
    FD_SET(socket_s, &readfds);
    parc_sock(s_info);
    s_info->list = parse_list(s_info);
    i = 0;
    while (socket_com[i].socket != -2) {
      if (socket_com[i].socket != -1)
	FD_SET(socket_com[i].socket, &readfds);
      i++;
    }
    select_s(s_info, &readfds, time);
  }
}
开发者ID:Aiscky,项目名称:Zappy,代码行数:27,代码来源:server.c


示例11: header_allow

void header_allow(const char *s)
{
  if (parse_list(s, &re_token, 0, UINT_MAX, 0))
    lookup("ok");
  else
    lookup("badallow");
}
开发者ID:krishnaneeraja,项目名称:PDS_Demo,代码行数:7,代码来源:httplint.c


示例12: header_pragma

void header_pragma(const char *s)
{
  if (parse_list(s, &re_token_value, 1, UINT_MAX, 0))
    lookup("ok");
  else
    lookup("badpragma");
}
开发者ID:krishnaneeraja,项目名称:PDS_Demo,代码行数:7,代码来源:httplint.c


示例13: xmlDocGetRootElement

void
RL::Heap::parse_doc (std::string raw)
{
  doc = std::tr1::shared_ptr<xmlDoc> (xmlRecoverMemory (raw.c_str (), raw.length ()), xmlFreeDoc);
  if ( !doc)
    doc = std::tr1::shared_ptr<xmlDoc> (xmlNewDoc (BAD_CAST "1.0"), xmlFreeDoc);
  xmlNodePtr doc_root = xmlDocGetRootElement (doc.get ());

  if (doc_root == NULL
      || doc_root->name == NULL
      || !xmlStrEqual (BAD_CAST "resource-lists", doc_root->name)) {

    std::cout << "Invalid document in " << __PRETTY_FUNCTION__ << std::endl;
    // FIXME: warn the user somehow?
    doc.reset ();
  } else {


    for (xmlNodePtr child = doc_root->children;
	 child != NULL;
	 child = child->next)
      if (child->type == XML_ELEMENT_NODE
	  && child->name != NULL
	  && xmlStrEqual (BAD_CAST ("list"), child->name)) {

	parse_list (child);
	break; // read only one!
      }
  }
}
开发者ID:NeoWing,项目名称:ekiga-3.2.7,代码行数:30,代码来源:rl-heap.cpp


示例14: xlog

/* @data is a string of form [email protected][+host][:[email protected][+host]]
 */
static struct servers *method_list(char *data)
{
	char *copy, *ptr=data;
	char **list;
	int i, listsize;
	struct servers *rv=NULL;

	xlog(L_NOTICE, "method_list(%s)", data);
	for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
		ptr++;
	list = malloc(listsize * sizeof(char *));
	copy = strdup(data);
	if (copy)
		xlog(L_NOTICE, "converted to %s", copy);
	if (list && copy) {
		ptr = copy;
		for (i=0; i<listsize; i++) {
			list[i] = strsep(&ptr, ":");
		}
		rv = parse_list(list);
	}
	free(copy);
	free(list);
	replicas_print(rv);
	return rv;
}
开发者ID:KunX,项目名称:nfs-utils,代码行数:28,代码来源:fsloc.c


示例15: stream_peek

static json_t *parse_value(stream_t *stream, size_t flags, json_error_t *error)
{
    json_t *result = NULL;
    char *string;
    int c = stream_peek(stream);

    switch (c) {
    case 'd':
        result = parse_dict(stream, flags, error);
        break;
    case 'l':
        result = parse_list(stream, flags, error);
        break;
    case 'i':
        stream_getc(stream);
        result = parse_integer(stream, flags, error);
        break;
    case EOF:
        error_set(error, stream, "unexpected EOF");
        break;
    default:
        if (json_isdigit(c)) {
            string = parse_string(stream, flags, error);
            if (string) {
                result = json_string_nocheck(string);
                jsonp_free(string);
            }
        } else {
            error_set(error, stream, "invalid character: %c", c);
        }
    }
    return result;
}
开发者ID:japeq,项目名称:jansson-bencode,代码行数:33,代码来源:bencode.c


示例16: parse_word

/**
	слово:
		список в скобках {}
		подстановка выражения в скобках []
*/
int
parse_word(char *text,char **endptr,Tag *toptag) {
	char *p,*s;
	Tag *tag;
	tag=NULL;
	s=text;

	if (s==NULL || isblank(*s)||strchr(EXPTERM,*s)) return 1;
	if (toptag) tag=mark(WORD,text,text,toptag);

	while(*s) {
		p=s;
		switch(*s) {
			case '{' : parse_list(s,&s,tag);break;
			case '[' : parse_command(s,&s,tag);break;
			case '\'': parse_string(s,&s,tag);break;
			case '\"': parse_subst(s,&s,tag);break;
			case '$' : parse_variable(s,&s,tag);break;
			default:
				if (s[0]=='#' && s[1]!='#' && s[1]!='!') {
					parse_macro(s,&s,tag);
				} else if (s[0]=='#' && s[1]=='?' && s[2]=='>') {
					parse_print(s,&s,tag);
				} else if ((s[0]=='-' && isdigit(s[1])) || isdigit(*s))
					parse_numeric(s,&s,tag);
				else
					mark_cspn(CHARS,BLANK EXPTERM "(",s,&s,tag);
		}
		if (strchr(BLANK EXPTERM,*s)) break;
		if (p==s) break;
	}
	if (endptr) *endptr=s;
	return 0;
}
开发者ID:nektomk,项目名称:parser,代码行数:39,代码来源:parser.c


示例17: while

cell_t *parse_sexpr(file_io_t * in, file_io_t * err)
{
        int c;
        if (in != NULL)
                while ((c = wrap_get(in)) != '\0') {
                        if (isspace(c))
                                continue;

                        if (isdigit(c)) {
                                wrap_ungetc(in, c);
                                return parse_number(in, err);
                        }

                        switch (c) {
                        case '(':
                                return parse_list(in, err);
                        case '"':
                                return parse_string(in, err);
                        case EOF:
                                print_error("EOF, nothing to parse", err);
                                return NULL;
                        case ')':
                                print_error("Unmatched ')'", err);
                                return NULL;
                        default:
                                wrap_ungetc(in, c);
                                return parse_symbol(in, err);
                        }

                }

        print_error("parse_expr in == NULL", err);
        return NULL;
}
开发者ID:he110world,项目名称:junk,代码行数:34,代码来源:sexpr.c


示例18: switch

static struct AstNode *parse_literal_compound(
        struct DomNode *dom,
        struct ParserState *state)
{
    enum AstLiteralCompoundType type;
    struct AstNode *exprs = NULL;

    /* 1. Is compound. */
    if (dom_node_is_atom(dom)) {
        return NULL;
    }

    /* 2. Is of ARRAY or TUPLE type. */
    switch (dom->cpd_type) {
    case DOM_CPD_ARRAY:
        type = AST_LIT_CPD_ARRAY;
        break;

    case DOM_CPD_TUPLE:
        type = AST_LIT_CPD_TUPLE;
        break;

    case DOM_CPD_CORE:
    default:
        return NULL;
    }

    /* 3. Has 0 or more expressions. */
    exprs = parse_list(dom->cpd_children, state);
    if (err_state()) {
        return NULL;
    } else {
        return ast_make_literal_compound(type, exprs);
    }
}
开发者ID:k-stachowiak,项目名称:moon-lang,代码行数:35,代码来源:parse.c


示例19: ast_make_spec_do

static struct AstNode *parse_do_block(
        struct DomNode *dom,
        struct ParserState *state)
{
    struct AstNode *exprs = NULL;
    struct DomNode *child = NULL;

    /* 1. Is compound CORE. */
    if (!dom_node_is_spec_compound(dom, DOM_CPD_CORE)) {
        return NULL;
    }

    /* 2. Has 2 or more children. */
    if (!dom_node_is_cpd_min_size(dom, 2)) {
        return NULL;
    }

    child = dom->cpd_children;

    /* 3.1. 1st child is "do" keyword. */
    if (!dom_node_is_spec_reserved_atom(child, DOM_RES_DO)) {
        return NULL;
    }
    child = child->next;

    /* 3.2. Has 1 or more further expressions. */
    if (!(exprs = parse_list(child, state))) {
        return NULL;
    }

    return ast_make_spec_do(exprs);
}
开发者ID:k-stachowiak,项目名称:moon-lang,代码行数:32,代码来源:parse.c


示例20: header_trailer

void header_trailer(const char *s)
{
  if (parse_list(s, &re_token, 1, UINT_MAX, 0))
    lookup("ok");
  else
    lookup("badtrailer");
}
开发者ID:krishnaneeraja,项目名称:PDS_Demo,代码行数:7,代码来源:httplint.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ parse_msg函数代码示例发布时间:2022-05-30
下一篇:
C++ parse_line函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap