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

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

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

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

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

示例1: body_out

static void body_out(void *context, int rec_type, const char *buf,		             ssize_t len, off_t offset){    HBC_TEST_CONTEXT *dp = (HBC_TEST_CONTEXT *) context;    char   *out;    if (dp->body_checks == 0	|| (out = hbc_body_checks(context, dp->body_checks,				  buf, len, offset)) == buf) {	vstring_sprintf(dp->buf, "%d BODY %c %ld/t|%s",			dp->recno, rec_type, (long) offset, buf);	out_cb(dp, rec_type, STR(dp->buf), LEN(dp->buf), offset);    } else if (out != 0) {	vstring_sprintf(dp->buf, "%d BODY %c %ld/t|%s",			dp->recno, rec_type, (long) offset, out);	out_cb(dp, rec_type, STR(dp->buf), LEN(dp->buf), offset);	myfree(out);    }    dp->recno += 1;}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:20,


示例2: combobox_panel

static voidcombobox_panel(struct gui_panel_layout *panel, struct show_window *demo){    gui_int i = 0;    static const char *options[] = {"easy", "normal", "hard", "hell", "doom", "godlike"};    gui_panel_row(panel, 30, 3);    for (i = 0; i < (gui_int)LEN(options); i++) {        if (gui_panel_option(panel, options[i], demo->combo_selection == i))            demo->combo_selection = i;    }}
开发者ID:island-org,项目名称:gui,代码行数:11,


示例3: SKIP_SPACE

static const char *xml_parse_meta_text(ACL_XML *xml, const char *data){	int   ch;	if (LEN(xml->curr_node->text) == 0) {		SKIP_SPACE(data);	}	while ((ch = *data) != 0) {		if (xml->curr_node->quote) {			if (ch == xml->curr_node->quote) {				xml->curr_node->quote = 0;			}			ADDCH(xml->curr_node->text, ch);		} else if (IS_QUOTE(ch)) {			if (xml->curr_node->quote == 0) {				xml->curr_node->quote = ch;			}			ADDCH(xml->curr_node->text, ch);		} else if (ch == '<') {			xml->curr_node->nlt++;			ADDCH(xml->curr_node->text, ch);		} else if (ch == '>') {			if (xml->curr_node->nlt == 0) {				char *last;				size_t off;				data++;				xml->curr_node->status = ACL_XML_S_MEND;				if ((xml->curr_node->flag & ACL_XML_F_META_QM) == 0)					break;				last = acl_vstring_end(xml->curr_node->text) - 1;				if (last < STR(xml->curr_node->text) || *last != '?')					break;				off = ACL_VSTRING_LEN(xml->curr_node->text) - 1;				if (off == 0)					break;				ACL_VSTRING_AT_OFFSET(xml->curr_node->text, off);				ACL_VSTRING_TERMINATE(xml->curr_node->text);				xml_meta_attr(xml->curr_node);				break;			}			xml->curr_node->nlt--;			ADDCH(xml->curr_node->text, ch);		} else {			ADDCH(xml->curr_node->text, ch);		}		data++;	}	ACL_VSTRING_TERMINATE(xml->curr_node->text);	return (data);}
开发者ID:10jschen,项目名称:acl,代码行数:54,


示例4: gf3m_sub

/* $e <- x-y$ */static void gf3m_sub(element_t e, element_t a, element_t b) {    unsigned long *e1 = DATA1(e), *e2 = DATA2(e), *a1 = DATA1(a),            *a2 = DATA2(a), *b1 = DATA2(b), *b2 = DATA1(b);    unsigned i;    for (i = 0; i < LEN(e); i++, e1++, e2++, a1++, a2++, b1++, b2++) {        unsigned long t = (*a1 | *a2) & (*b1 | *b2), c1 = t ^ (*a1 | *b1), c2 =                t ^ (*a2 | *b2);        *e1 = c1;        *e2 = c2;    }}
开发者ID:mahdiz,项目名称:mpclib,代码行数:12,


示例5: postmap_header

static void postmap_header(void *ptr, int unused_header_class,			           const HEADER_OPTS *unused_header_info,			           VSTRING *header_buf,			           off_t offset){    /*     * Don't re-invent an already working wheel.     */    postmap_body(ptr, 0, STR(header_buf), LEN(header_buf), offset);}
开发者ID:Gelma,项目名称:Postfix,代码行数:11,


示例6: main

main(int unused_argc, char **unused_argv){    VSTRING *raw = vstring_alloc(BUFLEN);    VSTRING *hex = vstring_alloc(100);    int     len;    while ((len = read_buf(VSTREAM_IN, raw)) > 0) {	hex_quote(hex, STR(raw));	if (hex_unquote(raw, STR(hex)) == 0)	    msg_fatal("bad input: %.100s", STR(hex));	if (LEN(raw) != len)	    msg_fatal("len %d != raw len %d", len, LEN(raw));	if (vstream_fwrite(VSTREAM_OUT, STR(raw), LEN(raw)) != LEN(raw))	    msg_fatal("write error: %m");    }    vstream_fflush(VSTREAM_OUT);    vstring_free(raw);    vstring_free(hex);    return (0);}
开发者ID:TonyChengTW,项目名称:Rmail,代码行数:20,


示例7: gf3m_to_bytes

int gf3m_to_bytes(unsigned char *d, element_ptr e) {    unsigned long *a = DATA1(e), *b = DATA2(e);    unsigned long i, j;    for (i = 0; i < LEN(e); i++, a++, b++) {        for (j = 0; j < sizeof(unsigned long) * 8; j += 8) {            *(d++) = (unsigned char) ((*a) >> j);            *(d++) = (unsigned char) ((*b) >> j);        }    }    return SIZE(e);}
开发者ID:mahdiz,项目名称:mpclib,代码行数:11,


示例8: rbug_send_texture_read_reply

int rbug_send_texture_read_reply(struct rbug_connection *__con,                                 uint32_t serial,                                 uint32_t format,                                 uint32_t blockw,                                 uint32_t blockh,                                 uint32_t blocksize,                                 uint8_t *data,                                 uint32_t data_len,                                 uint32_t stride,                                 uint32_t *__serial){	uint32_t __len = 0;	uint32_t __pos = 0;	uint8_t *__data = NULL;	int __ret = 0;	LEN(8); /* header */	LEN(4); /* serial */	LEN(4); /* format */	LEN(4); /* blockw */	LEN(4); /* blockh */	LEN(4); /* blocksize */	LEN_ARRAY(1, data); /* data */	LEN(4); /* stride */	/* align */	PAD(__len, 8);	__data = (uint8_t*)MALLOC(__len);	if (!__data)		return -ENOMEM;	WRITE(4, int32_t, ((int32_t)RBUG_OP_TEXTURE_READ_REPLY));	WRITE(4, uint32_t, ((uint32_t)(__len / 4)));	WRITE(4, uint32_t, serial); /* serial */	WRITE(4, uint32_t, format); /* format */	WRITE(4, uint32_t, blockw); /* blockw */	WRITE(4, uint32_t, blockh); /* blockh */	WRITE(4, uint32_t, blocksize); /* blocksize */	WRITE_ARRAY(1, uint8_t, data); /* data */	WRITE(4, uint32_t, stride); /* stride */	/* final pad */	PAD(__pos, 8);	if (__pos != __len) {		__ret = -EINVAL;	} else {		rbug_connection_send_start(__con, RBUG_OP_TEXTURE_READ_REPLY, __len);		rbug_connection_write(__con, __data, __len);		__ret = rbug_connection_send_finish(__con, __serial);	}	FREE(__data);	return __ret;}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:56,


示例9: rotate_block

/* rotate pieces in blocks by either 90^ or -90^ around (0, 0) pivot */static int rotate_block(struct blocks *block, enum blocks_input_cmd cmd){	int new_x, new_y;	int bounds_x, bounds_y;	int dir = 1;	size_t i;	if (!block)		return -1;	/* Don't rotate O block */	if (block->type == O_BLOCK)		return 1;	if (cmd == ROT_LEFT)		dir = -1;	/* Check each piece for a collision before we write any changes */	for (i = 0; i < LEN(block->p); i++) {		bounds_x = block->p[i].y * (-dir) + block->col_off;		bounds_y = block->p[i].x * (dir) + block->row_off;		/* Check for out of bounds on each piece */		if (bounds_x < 0 || bounds_x >= BLOCKS_MAX_COLUMNS ||		    bounds_y < 0 || bounds_y >= BLOCKS_MAX_ROWS ||		    /* Also check if a piece already exists here */		    blocks_at_yx(bounds_y, bounds_x))			return 0;	}	/* No collisions, so update the block position. */	for (i = 0; i < LEN(block->p); i++) {		new_x = block->p[i].y * (-dir);		new_y = block->p[i].x * (dir);		block->p[i].x = new_x;		block->p[i].y = new_y;	}	return 1;}
开发者ID:theta43,项目名称:tetris,代码行数:42,


示例10: rbug_send_shader_list_reply

int rbug_send_shader_list_reply(struct rbug_connection *__con,                                uint32_t serial,                                rbug_shader_t *shaders,                                uint32_t shaders_len,                                uint32_t *__serial){	uint32_t __len = 0;	uint32_t __pos = 0;	uint8_t *__data = NULL;	int __ret = 0;	LEN(8); /* header */	LEN(4); /* serial */	LEN_ARRAY(8, shaders); /* shaders */	/* align */	PAD(__len, 8);	__data = (uint8_t*)MALLOC(__len);	if (!__data)		return -ENOMEM;	WRITE(4, int32_t, ((int32_t)RBUG_OP_SHADER_LIST_REPLY));	WRITE(4, uint32_t, ((uint32_t)(__len / 4)));	WRITE(4, uint32_t, serial); /* serial */	WRITE_ARRAY(8, rbug_shader_t, shaders); /* shaders */	/* final pad */	PAD(__pos, 8);	if (__pos != __len) {		__ret = -EINVAL;	} else {		rbug_connection_send_start(__con, RBUG_OP_SHADER_LIST_REPLY, __len);		rbug_connection_write(__con, __data, __len);		__ret = rbug_connection_send_finish(__con, __serial);	}	FREE(__data);	return __ret;}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:41,


示例11: name2sig

intname2sig(const char *name){	size_t i;	for (i = 0; i < LEN(sigs); i++)		if (!strcasecmp(sigs[i].name, name))			return sigs[i].sig;	eprintf("%s: bad signal name/n", name);	return -1; /* not reached */}
开发者ID:michaelforney,项目名称:sbase,代码行数:12,


示例12: gf3m_neg

/* $y <- (-x)$ */static void gf3m_neg(element_t y, element_t x) {    unsigned long *a1 = DATA1(x), *a2 = DATA2(x), *c1 = DATA1(y),            *c2 = DATA2(y);    if (a1 == c1) {        unsigned i;        for (i = 0; i < LEN(y); i++, a1++, a2++)            swap(a1, a2);    } else {        memcpy(c1, a2, SIZE(y) / 2);        memcpy(c2, a1, SIZE(y) / 2);    }}
开发者ID:mahdiz,项目名称:mpclib,代码行数:13,


示例13: test_get_flow_info_one_flow

void test_get_flow_info_one_flow( void** state ){	char* links[] = { "alink", "onemore", NULL };	datalink_id_t link_ids[ LEN( links ) - 1 ] = { 13, 15 };	char* ips[] = { "1.2.3.4", "4.3.2.1" };	dladm_flow_attr_t attrs[] = { { .fa_linkid = link_ids[ 0 ],	                                .fa_flowname = "aflow",	                                .fa_flow_desc = { .fd_mask = FLOW_IP_LOCAL | FLOW_IP_PROTOCOL | FLOW_ULP_PORT_LOCAL,	                                                  .fd_protocol = IPPROTO_TCP,	                                                  .fd_local_port = 12 } },	                              { .fa_linkid = link_ids[ 1 ],
开发者ID:robertboczek,项目名称:solaris-crossbow,代码行数:12,


示例14: midi_pop

MidiEvent midi_pop(){	if (!midi_count()) err(1, "midi queue underflow");	locker(1);	MidiEvent me = *head++;	if (head == &events[LEN(events)]) head = events;	nevent--;	locker(0);	return me;}
开发者ID:cjxgm,项目名称:learning,代码行数:12,


示例15: attr_print64_long_num

static void attr_print64_long_num(ACL_VSTREAM *fp, unsigned long long_num){    static __thread ACL_VSTRING *plain;    if (plain == 0) {	plain = acl_vstring_alloc(10);	acl_pthread_atexit_add(plain, free_vstring);    }    acl_vstring_sprintf(plain, "%lu", long_num);    attr_print64_str(fp, STR(plain), (int) LEN(plain));}
开发者ID:1514louluo,项目名称:acl,代码行数:12,


示例16: deinitialization

/*!	/brief frees the sem[] array	/param owner		if owner is nonzero, further deinitialization (sem_unlink)		is performed	/details		Every element of sem[] will be SEM_FAILED after this function		is called. If owner is nonzero, the semaphores will be unlinked*/static void free_semaphores(int owner){    int i;    for(i = 0; i < LEN(sem); i++) {        if(sem[i] != SEM_FAILED) {            (void)sem_close(sem[i]);            sem[i] = SEM_FAILED;        }        if(owner != 0)            (void)sem_unlink(SEM_NAME[i]);    }}
开发者ID:chtisgit,项目名称:osue,代码行数:21,


示例17: print_resolved_types

static void print_resolved_types(TYPERUN *pp){    fprintf(stderr, "   Types: ");    while(pp)    {        BidiStrIndex i;        for(i = 0; i < LEN (pp); i++)            fprintf(stderr, "%c", bidi_type_name(pp->type));        pp = pp->next;    }    fprintf(stderr, "/n");}
开发者ID:hyller,项目名称:GladiatorLibrary,代码行数:12,


示例18: reset

const std::list<rfc822_addr*>& rfc822::parse_addrs(const char* in){	reset();	if (in == NULL || *in == 0)	{		logger_error("input invalid");		return (addrs_);	}	TOK822 *tree = tok822_parse(in);	if (tree == NULL)	{		logger_error("tok822_parse(%s) error", in);		return (addrs_);	}	const ACL_VSTRING* comment_prev = NULL;	string buf;	for (TOK822 *tp = tree; tp; tp = tp->next)	{		if (tp->type == TOK822_ATOM			|| tp->type == TOK822_COMMENT			|| tp->type == TOK822_QSTRING			|| tp->vstr != NULL)		{			comment_prev = tp->vstr;		}		if (tp->type != TOK822_ADDR || tp->head == NULL)			continue;		ACL_VSTRING* addrp = acl_vstring_alloc(32);		(void) tok822_internalize(addrp, tp->head, TOK822_STR_DEFL);		rfc822_addr* addr = (rfc822_addr*)			acl_mymalloc(sizeof(rfc822_addr));		addr->addr = acl_vstring_export(addrp);		if (comment_prev)		{			buf.clear();			rfc2047::decode(STR(comment_prev), LEN(comment_prev),				&buf, "gb18030");			addr->comment = acl_mystrdup(buf.c_str());			comment_prev = NULL;		}		else			addr->comment = NULL;		addrs_.push_back(addr);	}	tok822_free_tree(tree);	return (addrs_);}
开发者ID:10jschen,项目名称:acl,代码行数:53,


示例19: main

int     main(int unused_argc, char **unused_argv){    VSTRING *unquoted = vstring_alloc(BUFLEN);    VSTRING *quoted = vstring_alloc(100);    ssize_t len;    while ((len = read_buf(VSTREAM_IN, unquoted)) > 0) {	xtext_quote(quoted, STR(unquoted), "+=");	if (xtext_unquote(unquoted, STR(quoted)) == 0)	    msg_fatal("bad input: %.100s", STR(quoted));	if (LEN(unquoted) != len)	    msg_fatal("len %ld != unquoted len %ld",		      (long) len, (long) LEN(unquoted));	if (vstream_fwrite(VSTREAM_OUT, STR(unquoted), LEN(unquoted)) != LEN(unquoted))	    msg_fatal("write error: %m");    }    vstream_fflush(VSTREAM_OUT);    vstring_free(unquoted);    vstring_free(quoted);    return (0);}
开发者ID:aosm,项目名称:postfix,代码行数:21,


示例20: parse_json

static void parse_json(const char *data){	ACL_JSON *json = acl_json_alloc();	ACL_VSTRING *buf1 = acl_vstring_alloc(128);	ACL_VSTRING *buf2 = acl_vstring_alloc(128);	ACL_ARRAY *nodes;	const char *tag = "header";	printf("buf    src: %s/r/n", data);	printf("------------------------------------------------/r/n");	acl_json_update(json, data);	acl_json_build(json, buf1);	printf("result src: %s/r/n", STR(buf1));	printf("------------------------------------------------/r/n");	nodes = acl_json_getElementsByTagName(json, tag);	if (nodes == NULL)	{		printf("not found tag: %s/r/n", tag);		acl_vstring_free(buf1);		acl_vstring_free(buf2);		acl_json_free(json);		return;	}	printf(">>>tag: %s, len: %d/r/n", tag, acl_array_size(nodes));	ACL_ITER iter;#define	STR	acl_vstring_str#define	LEN	ACL_VSTRING_LEN	acl_foreach(iter, nodes)	{		ACL_JSON_NODE *node = (ACL_JSON_NODE*) iter.data;		ACL_JSON_NODE *tag_node = node->tag_node;		if (tag_node == NULL)			continue;		printf(">>>tag: %s/r/n", STR(node->ltag));		ACL_ITER iter2;		acl_foreach(iter2, tag_node)		{			ACL_JSON_NODE *node1 = (ACL_JSON_NODE*) iter2.data;			if (node1->ltag == NULL || LEN(node1->ltag) == 0)				continue;			printf(">>>child tag: %s, txt: %s/r/n", STR(node1->ltag),				node1->text ? STR(node1->text) : "null");		}
开发者ID:10jschen,项目名称:acl,代码行数:53,


示例21: node_editor_link

static voidnode_editor_link(struct node_editor *editor, int in_id, int in_slot,    int out_id, int out_slot){    struct node_link *link;    assert((zr_size)editor->link_count < LEN(editor->links));    link = &editor->links[editor->link_count++];    link->input_id = in_id;    link->input_slot = in_slot;    link->output_id = out_id;    link->output_slot = out_slot;}
开发者ID:twinaphex,项目名称:zahnrad,代码行数:12,


示例22: main

int main(void){    pc.baud(115200);    pc.printf("ADC test:/r/n");    while (1) {        for (int i = 0; i < LEN(s_ch); i++)            pc.printf("%d: %4X  ", i, s_ch[i].read_u16());        pc.printf("/r/n");        wait(1);    }    return 0;}
开发者ID:vinothgcdm,项目名称:mbed,代码行数:12,


示例23: shift_chars

static inline void shift_chars(struct part *p, int y, int s){	chr *a;	int l = LEN(y);	if ((unsigned)l > MAXINT / sizeof(chr)) overalloc();	a = mem_alloc(l * sizeof(chr));	memcpy(a, &POS(0, y), l * sizeof(chr));	set_hchars(p, 0, y, s, (p->data->data[y].c << 11) | ' ');	copy_chars(p, s, y, l, a);	mem_free(a);	move_links(p, 0, y, s, y);}
开发者ID:ebichu,项目名称:dd-wrt,代码行数:12,


示例24: sig2name

const char *sig2name(const int sig){	size_t i;	for (i = 0; i < LEN(sigs); i++)		if (sigs[i].sig == sig)			return sigs[i].name;	eprintf("%d: bad signal number/n", sig);	return NULL; /* not reached */}
开发者ID:michaelforney,项目名称:sbase,代码行数:12,


示例25: rbug_send_shader_info

int rbug_send_shader_info(struct rbug_connection *__con,                          rbug_context_t context,                          rbug_shader_t shader,                          uint32_t *__serial){	uint32_t __len = 0;	uint32_t __pos = 0;	uint8_t *__data = NULL;	int __ret = 0;	LEN(8); /* header */	LEN(8); /* context */	LEN(8); /* shader */	/* align */	PAD(__len, 8);	__data = (uint8_t*)MALLOC(__len);	if (!__data)		return -ENOMEM;	WRITE(4, int32_t, ((int32_t)RBUG_OP_SHADER_INFO));	WRITE(4, uint32_t, ((uint32_t)(__len / 4)));	WRITE(8, rbug_context_t, context); /* context */	WRITE(8, rbug_shader_t, shader); /* shader */	/* final pad */	PAD(__pos, 8);	if (__pos != __len) {		__ret = -EINVAL;	} else {		rbug_connection_send_start(__con, RBUG_OP_SHADER_INFO, __len);		rbug_connection_write(__con, __data, __len);		__ret = rbug_connection_send_finish(__con, __serial);	}	FREE(__data);	return __ret;}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:40,


示例26: rn_lookup

/* * Search for exact match in given @head. * Assume host bits are cleared in @v_arg if @m_arg is not NULL * Note that prefixes with /32 or /128 masks are treated differently * from host routes. */struct radix_node *rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head){	struct radix_node *x;	caddr_t netmask;	if (m_arg != NULL) {		/*		 * Most common case: search exact prefix/mask		 */		x = rn_addmask(m_arg, head->rnh_masks, 1,		    head->rnh_treetop->rn_offset);		if (x == NULL)			return (NULL);		netmask = x->rn_key;		x = rn_match(v_arg, head);		while (x != NULL && x->rn_mask != netmask)			x = x->rn_dupedkey;		return (x);	}	/*	 * Search for host address.	 */	if ((x = rn_match(v_arg, head)) == NULL)		return (NULL);	/* Check if found key is the same */	if (LEN(x->rn_key) != LEN(v_arg) || bcmp(x->rn_key, v_arg, LEN(v_arg)))		return (NULL);	/* Check if this is not host route */	if (x->rn_mask != NULL)		return (NULL);	return (x);}
开发者ID:ironpillow,项目名称:netmap-fwd,代码行数:46,


示例27: CORD_cat

CORD CORD_cat(CORD x, CORD y){    size_t result_len;    int depth;    size_t lenx;    if (x == CORD_EMPTY) return(y);    if (y == CORD_EMPTY) return(x);    if (CORD_IS_STRING(y)) {        return(CORD_cat_char_star(x, y, strlen(y)));    } else if (CORD_IS_STRING(x)) {        lenx = strlen(x);        depth = DEPTH(y) + 1;    } else {        int depthy = DEPTH(y);        lenx = LEN(x);        depth = DEPTH(x) + 1;        if (depthy >= depth) depth = depthy + 1;    }    result_len = lenx + LEN(y);    {        struct Concatenation * result = GC_NEW(struct Concatenation);        if (NULL == result) OUT_OF_MEMORY;        result->header = CONCAT_HDR;        result->depth = (char)depth;        if (lenx <= MAX_LEFT_LEN)            result->left_len = (unsigned char)lenx;        result->len = (word)result_len;        result->left = x;        GC_PTR_STORE_AND_DIRTY((void *)&result->right, y);        GC_reachable_here(x);        if (depth >= MAX_DEPTH) {            return(CORD_balance((CORD)result));        } else {            return((CORD) result);        }    }}
开发者ID:Hamayama,项目名称:Gauche,代码行数:40,


示例28: rbug_send_context_draw_blocked

int rbug_send_context_draw_blocked(struct rbug_connection *__con,                                   rbug_context_t context,                                   rbug_block_t block,                                   uint32_t *__serial){	uint32_t __len = 0;	uint32_t __pos = 0;	uint8_t *__data = NULL;	int __ret = 0;	LEN(8); /* header */	LEN(8); /* context */	LEN(4); /* block */	/* align */	PAD(__len, 8);	__data = (uint8_t*)MALLOC(__len);	if (!__data)		return -ENOMEM;	WRITE(4, int32_t, ((int32_t)RBUG_OP_CONTEXT_DRAW_BLOCKED));	WRITE(4, uint32_t, ((uint32_t)(__len / 4)));	WRITE(8, rbug_context_t, context); /* context */	WRITE(4, rbug_block_t, block); /* block */	/* final pad */	PAD(__pos, 8);	if (__pos != __len) {		__ret = -EINVAL;	} else {		rbug_connection_send_start(__con, RBUG_OP_CONTEXT_DRAW_BLOCKED, __len);		rbug_connection_write(__con, __data, __len);		__ret = rbug_connection_send_finish(__con, __serial);	}	FREE(__data);	return __ret;}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:40,


示例29: LEN

/* DSR:CL_BUG: (See comment for join method in Misc.h): */TCHAR* Misc::join (const TCHAR* a, const TCHAR* b, const TCHAR* c,                   const TCHAR* d, const TCHAR* e, const TCHAR* f){#define LEN(x) (x == NULL ? 0 : _tcslen(x))    const size_t totalLen = LEN(a) + LEN(b) + LEN(c) + LEN(d) + LEN(e) + LEN(f)        + sizeof(TCHAR); /* Space for terminator. */    TCHAR* buf = _CL_NEWARRAY(TCHAR, totalLen);    buf[0] = 0;    if (a != NULL)        _tcscat(buf, a);    if (b != NULL)        _tcscat(buf, b);    if (c != NULL)        _tcscat(buf, c);        if (d != NULL)        _tcscat(buf, d);    if (e != NULL)        _tcscat(buf, e);    if (f != NULL)        _tcscat(buf, f);    return buf;}
开发者ID:Afreeca,项目名称:qt,代码行数:30,



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


C++ LENGTH函数代码示例
C++ LEMUR_THROW函数代码示例
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1