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


C++ EI函数代码示例

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


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

示例1: ei_x_encode_error_tuple_atom

int ei_x_encode_error_tuple_atom(ei_x_buff *buff, char *atom) {
    EI(ei_x_encode_version(buff));
    EI(ei_x_encode_tuple_header(buff, 2));
    EI(ei_x_encode_atom(buff, "error"));
    EI(ei_x_encode_atom(buff, atom));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:7,代码来源:ei_util.c

示例2: k_set_prio

int
k_set_prio (char prio)
{
    int i;

    if (!k_running) {
        return (-1);
    }

    DI ();

    if ((prio <= 0) || (DMY_PRIO <= prio)) {
        // not legal value my friend
        EI ();
        return (-2);
    }
    i = pRun->prio;

    pRun->prio = prio;
    prio_enQ (pAQ, deQ (pRun));
    ki_task_shift ();

    EI ();

    return (i);
}
开发者ID:carycode,项目名称:krnl,代码行数:26,代码来源:krnl.c

示例3: imalloc

/*
 * Get memory 
 */
LOCAL void* imalloc( size_t size, IMACB *imacb )
{
	QUEUE	*q;
	VP	mem;
	UW	imask;

	/* If it is smaller than the minimum fragment size,
	   allocate the minimum size to it. */
	if ( size < MIN_FRAGMENT ) {
		size = MIN_FRAGMENT;
	}
	size = ROUND(size);

	DI(imask);  /* Exclusive control by interrupt disable */
	SpinLock(&MemLockObj);

	/* Search FreeQue */
	q = searchFreeArea(size, imacb);
	if ( q != &imacb->freeque ) {
		/* There is free area: Split from FreeQue once */
		removeFreeQue(q);

		q = q - 1;
	} else {
		/* Reserve new pages because there is no free space */
		QUEUE	*e;
		size_t	n;

		/* Reserve pages */
		SpinUnlock(&MemLockObj);
		EI(imask);
		n = PageCount(size + sizeof(QUEUE) * 2);
		q = GetSysMemBlk(n, imacb->mematr);
		if ( q == NULL ) {
			goto err_ret;  /* Insufficient memory */
		}
		DI(imask);
		SpinLock(&MemLockObj);

		/* Register on AreaQue */
		e = (QUEUE*)((VB*)q + n * pagesz) - 1;
		insertAreaQue(&imacb->areaque, e);
		insertAreaQue(&imacb->areaque, q);
		setAreaFlag(q, AREA_TOP);
		setAreaFlag(e, AREA_END);
	}

	/* Allocate memory */
	mem = mem_alloc(q, size, imacb);

	SpinUnlock(&MemLockObj);
	EI(imask);
	return mem;

err_ret:
	BMS_DEBUG_PRINT(("imalloc error\n"));
	return NULL;
}
开发者ID:kidasan,项目名称:tkernel,代码行数:61,代码来源:imalloc.c

示例4: ei_x_encode_time

int ei_x_encode_time(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    EI(ei_x_encode_atom(types, "time"));
    int v = r->i;
    if(opts->day_seconds_is_q_time) {
        v = msec_to_sec(v);
    }
    EI(ei_x_encode_ki_val(values, v));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:9,代码来源:q2e.c

示例5: ei_x_encode_kstring

int ei_x_encode_kstring(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    EI(ei_x_encode_atom(types, "string"));
    if(r->n == 0) {
        EI(ei_x_encode_empty_list(values));
    } else {
        EI(ei_x_encode_string_len(values, (const char*)kC(r), r->n));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:9,代码来源:q2e.c

示例6: ei_x_encode_dict_impl

int ei_x_encode_dict_impl(ei_x_buff* types, ei_x_buff* values, const char* t, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(types, r->n+1));
    EI(ei_x_encode_atom(types, t));
    EI(ei_x_encode_tuple_header(values, r->n));
    int i;
    for(i=0; i<r->n; ++i) {
        EI(ei_x_encode_k_tv(types, values, kK(r)[i], opts));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:10,代码来源:q2e.c

示例7: ei_x_encode_unknown

int ei_x_encode_unknown(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(types, r->n+1));
    EI(ei_x_encode_long(types, r->t));
    EI(ei_x_encode_tuple_header(values, r->n));
    int i;
    for(i=0; i<r->n; ++i) {
        EI(ei_x_encode_k_tv(types, values, kK(r)[i], opts));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:10,代码来源:q2e.c

示例8: ei_x_encode_datetime

int ei_x_encode_datetime(ei_x_buff* types, ei_x_buff* values, K r, QOpts* opts) {
    if(opts->unix_timestamp_is_q_datetime) {
        long v = datetime_to_unix_timestamp(r->f);
        EI(ei_x_encode_atom(types, "datetime"));
        EI(ei_x_encode_long(values, v));
    } else {
        EI(ei_x_encode_kf(types, values, "datetime", r, opts));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:10,代码来源:q2e.c

示例9: ei_x_encode_same_list_byte

int ei_x_encode_same_list_byte(ei_x_buff* types, ei_x_buff* values, const char* t, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(types, 2));
    EI(ei_x_encode_atom(types, "list"));
    EI(ei_x_encode_atom(types, t));
    if(r->n == 0) {
        EI(ei_x_encode_empty_list(values));
    } else {
        EI(ei_x_encode_string_len(values, (const char*)kG(r), r->n));
    }
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:11,代码来源:q2e.c

示例10: _SifCmdIntHandler

int _SifCmdIntHandler()
{
	u128 packet[8];
	u128 *pktbuf;
	struct cmd_data *cmd_data = &_sif_cmd_data;
	SifCmdHeader_t *header;
	SifCmdHandlerData_t *cmd_handlers;
	int size, pktquads, id, i = 0;

	EI();

	header = (SifCmdHeader_t *)cmd_data->pktbuf;

	if (!(size = (header->size & 0xff)))
		goto out;

	/* TODO: Don't copy anything extra */
	pktquads = (size + 30) >> 4;
	header->size = 0;
	if (pktquads) {
		pktbuf = (u128 *)cmd_data->pktbuf;
		while (pktquads--) {
			packet[i] = pktbuf[i];
			i++;
		}
	}

	iSifSetDChain();

	header = (SifCmdHeader_t *)packet;
	/* Get the command handler id and determine which handler list to
	   dispatch from.  */
	id = header->cid & ~SYSTEM_CMD;

	if (id < CMD_HANDLER_MAX) {
		if (header->cid & SYSTEM_CMD) {
			cmd_handlers = cmd_data->sys_cmd_handlers;
		}
		else {
			cmd_handlers = cmd_data->usr_cmd_handlers;
		}
	} else {
		goto out;
	}

	if (cmd_handlers[id].handler)
		cmd_handlers[id].handler(packet, cmd_handlers[id].harg);

out:
	EE_SYNC();
	EI();
	return 0;
}
开发者ID:EvertonSilva,项目名称:ps2sdk,代码行数:53,代码来源:sifcmd.c

示例11: ei_x_encode_kf_val

int ei_x_encode_kf_val(ei_x_buff* values, double f) {
    EI_X_ENCODE_NULL_OR_INF(f, nf, wf);
    if(f == nf || q2e_isnan(f)) {
        EI(ei_x_encode_atom(values, "null"));
        return 0;
    } else if(f == wf) {
        EI(ei_x_encode_atom(values, "infinity"));
        return 0;
    }
    EI(ei_x_encode_double(values, f));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:12,代码来源:q2e.c

示例12: ei_x_encode_k

int ei_x_encode_k(ei_x_buff* x, K r, QOpts* opts) {
    EI(ei_x_encode_tuple_header(x, 2));
    ei_x_buff* types = x;
    ei_x_buff values;
    EI(ei_x_new(&values));
    EIC(ei_x_encode_k_tv(types, &values, r, opts),
            ei_x_free(&values)); // cleanup expression
    // TODO - JMS - is there a way to do this without deep copying data?
    EIC(ei_x_append(types, &values),
            ei_x_free(&values)); // cleanup expression
    EI(ei_x_free(&values));
    return 0;
}
开发者ID:csurface,项目名称:gen_q,代码行数:13,代码来源:q2e.c

示例13: main

int main(){
	DI();//disable interrupts or hell breaks loose during hardware config
	construct_system();//bind device addresses
	init_system();//init devices
		//clear all interrupts
	clearall_interrupts();
	EI();//enable interrupts: we have UART_recieve
	
	//set the lcd contrast
	//lcd_contrast(0x42);
	lcd_contrast(0x32);
	//clear the lcd
	clearram();
	//show boot up message
	show_bootup();
	//clear boot message
	clearram();
	//screen layout
	screen_layout();
	send(1, 225);
	send(1, 255);
	send(1, 2);
	while(1)
	{
		get_temperature1();
		get_temperature2();
		get_light();
		get_pressure();
		get_humidity();
		get_soilwetness();
		display();
		delay_ms(800);		
	}
	return 0;
}
开发者ID:Muriukidavid,项目名称:z8_64k,代码行数:35,代码来源:main.c

示例14: uart_putchar

int uart_putchar(unsigned char c)
{
    int buffer_loc;

    if(c == '\n') {
        while(uart_putchar('\r')) {
            ;
        }
    }

    if(trans_buffer_size < BUFFER_SIZE) {
        DI();

        buffer_loc = (trans_buffer_current + trans_buffer_size) % BUFFER_SIZE;
        trans_buffer[buffer_loc] = c;
        trans_buffer_size++;

        //trigger the interrupt if already ready to transmit
        if((U0STAT0 & UART_TRAN_RDY) &&
                ((IRQ0SET & UART_IRQ_TRAN) == 0)) {
            IRQ0SET |= UART_IRQ_TRAN;
        }

        EI();
    }
    else {
        return 1;
    }

    return 0;
}
开发者ID:mharlan,项目名称:embedded-labs,代码行数:31,代码来源:uart.c

示例15: knl_Ifree

/*
 * Free memory
 *	It may be called during interrupt disable. In this case, need to wait
 *	 until interrupt is enabled and until free.
 */
EXPORT void  knl_Ifree( void *ptr )
{
	QUEUE	*aq;
	UINT	imask;

	DI(imask);  /* Exclusive control by interrupt disable */

	aq = (QUEUE*)ptr - 1;
	clrAreaFlag(aq, AREA_USE);

	if ( !chkAreaFlag(aq->next, AREA_USE) ) {
		/* Merge with free area in after location */
		knl_removeFreeQue(aq->next + 1);
		knl_removeAreaQue(aq->next);
	}

	if ( !chkAreaFlag(aq->prev, AREA_USE) ) {
		/* Merge with free area in front location */
		aq = aq->prev;
		knl_removeFreeQue(aq + 1);
		knl_removeAreaQue(aq->next);
	}

	knl_appendFreeArea(knl_imacb, aq);

	EI(imask);
}
开发者ID:chenyifu,项目名称:utkernel-pi,代码行数:32,代码来源:memory.c


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