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


C++ DPUTS函数代码示例

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


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

示例1: dht11_check_response

uint8_t dht11_check_response(void)
{
    uint8_t k;

    k = 150;
    while(DHT_READ)
    {
        _delay_us(2);
        k--;
        if( k < 1 )
        {
            DPUTS("no start condition 1");
            return 1;  // time out
        }
    }

    k = 150;
    while(!DHT_READ)
    {
        _delay_us(2);
        k--;
        if( k < 1 )
        {
            DPUTS("no start condition 2");
            return 2;  // time out
        }
    }

    return 0;
}
开发者ID:dzavalishin,项目名称:smart-home-devices,代码行数:30,代码来源:io_dht.c

示例2: minilink_init

/** Initialize minilink internal data.
 * \param stack_space Amount of stack space to reserve.
 */
void minilink_init(void) {

	char *tmpptr;

	init_freearea_base();

	DPUTS("Scanning free ROM space...");
	for (tmpptr = freerom_end - 1; tmpptr >= freerom_start; tmpptr--) {
		if (*tmpptr != (char) 0xff && *tmpptr != (char) 0x00) break;
	}
	freerom_start = (char*) ALIGN_WORD_NEXT((uintptr_t )tmpptr);

	DPUTS("Minilink init OK");

}
开发者ID:cmorty,项目名称:contiki-minilink,代码行数:18,代码来源:minilink.c

示例3: makezleparams

mod_export void
makezleparams(int ro)
{
    struct zleparam *zp;

    for(zp = zleparams; zp->name; zp++) {
	Param pm = createparam(zp->name, (zp->type |PM_SPECIAL|PM_REMOVABLE|
					  PM_LOCAL|(ro ? PM_READONLY : 0)));
	if (!pm)
	    pm = (Param) paramtab->getnode(paramtab, zp->name);
	DPUTS(!pm, "param not set in makezleparams");

	pm->level = locallevel + 1;
	pm->u.data = zp->data;
	switch(PM_TYPE(zp->type)) {
	    case PM_SCALAR:
		pm->gsu.s = zp->gsu;
		break;
	    case PM_ARRAY:
		pm->gsu.a = (GsuArray)zp->gsu;
		break;
	    case PM_INTEGER:
		pm->gsu.i = (GsuInteger)zp->gsu;
		pm->base = 10;
		break;
	}
	if ((zp->type & PM_UNSET) && (zmod.flags & MOD_MULT))
	    pm->node.flags &= ~PM_UNSET;
    }
}
开发者ID:psych0tik,项目名称:zsh,代码行数:30,代码来源:zle_params.c

示例4: parse_subscript

mod_export char *
parse_subscript(char *s, int sub)
{
    int l = strlen(s), err;
    char *t;

    if (!*s || *s == ']')
	return 0;
    lexsave();
    untokenize(t = dupstring(s));
    inpush(t, 0, NULL);
    strinbeg(0);
    len = 0;
    bptr = tokstr = s;
    bsiz = l + 1;
    err = dquote_parse(']', sub);
    if (err) {
	err = *bptr;
	*bptr = 0;
	untokenize(s);
	*bptr = err;
	s = 0;
    } else
	s = bptr;
    strinend();
    inpop();
    DPUTS(cmdsp, "BUG: parse_subscript: cmdstack not empty.");
    lexrestore();
    return s;
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:30,代码来源:lex.c

示例5: parse_subscript

mod_export char *
parse_subscript(char *s, int sub, int endchar)
{
    int l = strlen(s), err;
    char *t;

    if (!*s || *s == endchar)
	return 0;
    zcontext_save();
    untokenize(t = dupstring(s));
    inpush(t, 0, NULL);
    strinbeg(0);
    lexbuf.len = 0;
    lexbuf.ptr = tokstr = s;
    lexbuf.siz = l + 1;
    err = dquote_parse(endchar, sub);
    if (err) {
	err = *lexbuf.ptr;
	*lexbuf.ptr = '\0';
	untokenize(s);
	*lexbuf.ptr = err;
	s = NULL;
    } else {
	s = lexbuf.ptr;
    }
    strinend();
    inpop();
    DPUTS(cmdsp, "BUG: parse_subscript: cmdstack not empty.");
    zcontext_restore();
    return s;
}
开发者ID:netroby,项目名称:zsh,代码行数:31,代码来源:lex.c

示例6: addcompparams

static void
addcompparams(struct compparam *cp, Param *pp)
{
    for (; cp->name; cp++, pp++) {
	Param pm = createparam(cp->name,
			       cp->type |PM_SPECIAL|PM_REMOVABLE|PM_LOCAL);
	if (!pm)
	    pm = (Param) paramtab->getnode(paramtab, cp->name);
	DPUTS(!pm, "param not set in addcompparams");

	*pp = pm;
	pm->level = locallevel + 1;
	if ((pm->u.data = cp->var)) {
	    switch(PM_TYPE(cp->type)) {
	    case PM_SCALAR:
		pm->gsu.s = &compvarscalar_gsu;
		break;
	    case PM_INTEGER:
		pm->gsu.i = &compvarinteger_gsu;
		pm->base = 10;
		break;
	    case PM_ARRAY:
		pm->gsu.a = &compvararray_gsu;
		break;
	    }
	} else {
	    pm->gsu.s = cp->gsu;
	}
    }
}
开发者ID:Jaharmi,项目名称:zsh,代码行数:30,代码来源:complete.c

示例7: dec_tindent

static void
dec_tindent(void)
{
    DPUTS(tindent == 0, "attempting to decrement tindent below zero");
    if (tindent > 0)
	tindent--;
}
开发者ID:SumiTomohiko,项目名称:rush,代码行数:7,代码来源:text.c

示例8: setpmmapfiles

static void
setpmmapfiles(Param pm, HashTable ht)
{
    int i;
    HashNode hn;

    /* just to see if I've understood what's happening */
    DPUTS(pm != mapfile_pm, "BUG: setpmmapfiles called for wrong param");

    if (!ht)
	return;

    if (!(pm->flags & PM_READONLY))
	for (i = 0; i < ht->hsize; i++)
	    for (hn = ht->nodes[i]; hn; hn = hn->next) {
		struct value v;

		v.isarr = v.inv = v.start = 0;
		v.end = -1;
		v.arr = NULL;
		v.pm = (Param) hn;

		setpmmapfile(v.pm, ztrdup(getstrvalue(&v)));
	    }
    deleteparamtable(ht);
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:26,代码来源:mapfile.c

示例9: setmathvar

static mnumber
setmathvar(struct mathvalue *mvp, mnumber v)
{
    if (mvp->pval) {
	/*
	 * This value may have been hanging around for a while.
	 * Be ultra-paranoid in checking the variable is still valid.
	 */
	char *s = mvp->lval, *ptr;
	Param pm;
	DPUTS(!mvp->lval, "no variable name but variable value in math");
	if ((ptr = strchr(s, '[')))
	    s = dupstrpfx(s, ptr - s);
	pm = (Param) paramtab->getnode(paramtab, s);
	if (pm == mvp->pval->pm) {
	    if (noeval)
		return v;
	    setnumvalue(mvp->pval, v);
	    return v;
	}
	/* Different parameter, start again from scratch */
	mvp->pval = NULL;
    }
    if (!mvp->lval) {
	zerr("lvalue required");
	v.type = MN_INTEGER;
	v.u.l = 0;
	return v;
    }
    if (noeval)
	return v;
    untokenize(mvp->lval);
    setnparam(mvp->lval, v);
    return v;
}
开发者ID:brandt,项目名称:zsh,代码行数:35,代码来源:math.c

示例10: parse_subscript

mod_export char *
parse_subscript(char *s, int sub, int endchar)
{
    int l = strlen(s), err, toklen;
    char *t;

    if (!*s || *s == endchar)
	return 0;
    zcontext_save();
    untokenize(t = dupstring(s));
    inpush(t, 0, NULL);
    strinbeg(0);
    /*
     * Warning to Future Generations:
     *
     * This way of passing the subscript through the lexer is brittle.
     * Code above this for several layers assumes that when we tokenise
     * the input it goes into the same place as the original string.
     * However, the lexer may overwrite later bits of the string or
     * reallocate it, in particular when expanding aliaes.  To get
     * around this, we copy the string and then copy it back.  This is a
     * bit more robust but still relies on the underlying assumption of
     * length preservation.
     */
    lexbuf.len = 0;
    lexbuf.ptr = tokstr = dupstring(s);
    lexbuf.siz = l + 1;
    err = dquote_parse(endchar, sub);
    toklen = (int)(lexbuf.ptr - tokstr);
    DPUTS(toklen > l, "Bad length for parsed subscript");
    memcpy(s, tokstr, toklen);
    if (err) {
	char *strend = s + toklen;
	err = *strend;
	*strend = '\0';
	untokenize(s);
	*strend = err;
	s = NULL;
    } else {
	s += toklen;
    }
    strinend();
    inpop();
    DPUTS(cmdsp, "BUG: parse_subscript: cmdstack not empty.");
    zcontext_restore();
    return s;
}
开发者ID:AMDmi3,项目名称:zsh,代码行数:47,代码来源:lex.c

示例11: cmdpop

void
cmdpop(void)
{
    if (cmdsp <= 0) {
	DPUTS(1, "BUG: cmdstack empty");
	fflush(stderr);
    } else
	cmdsp--;
}
开发者ID:jackleaks,项目名称:zsh,代码行数:9,代码来源:prompt.c

示例12: lexrestore

mod_export void
lexrestore(void)
{
    struct lexstack *ln;

    DPUTS(!lstack, "BUG: lexrestore() without lexsave()");
    incmdpos = lstack->incmdpos;
    incond = lstack->incond;
    incasepat = lstack->incasepat;
    dbparens = lstack->dbparens;
    isfirstln = lstack->isfirstln;
    isfirstch = lstack->isfirstch;
    histactive = lstack->histactive;
    histdone = lstack->histdone;
    stophist = lstack->stophist;
    chline = lstack->hline;
    hptr = lstack->hptr;
    if (cmdstack)
	free(cmdstack);
    cmdstack = lstack->cstack;
    cmdsp = lstack->csp;
    tok = lstack->tok;
    isnewlin = lstack->isnewlin;
    tokstr = lstack->tokstr;
    yytext = lstack->yytext;
    bptr = lstack->bptr;
    bsiz = lstack->bsiz;
    len = lstack->len;
    chwords = lstack->chwords;
    chwordlen = lstack->chwordlen;
    chwordpos = lstack->chwordpos;
    hwgetword = lstack->hwgetword;
    lexstop = lstack->lexstop;
    hdocs = lstack->hdocs;
    hgetc = lstack->hgetc;
    hungetc = lstack->hungetc;
    hwaddc = lstack->hwaddc;
    hwbegin = lstack->hwbegin;
    hwend = lstack->hwend;
    addtoline = lstack->addtoline;
    if (ecbuf)
	zfree(ecbuf, eclen);
    eclen = lstack->eclen;
    ecused = lstack->ecused;
    ecnpats = lstack->ecnpats;
    ecbuf = lstack->ecbuf;
    ecstrs = lstack->ecstrs;
    ecsoffs = lstack->ecsoffs;
    ecssub = lstack->ecssub;
    ecnfunc = lstack->ecnfunc;
    hlinesz = lstack->hlinesz;
    errflag = 0;

    ln = lstack->next;
    free(lstack);
    lstack = ln;
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:57,代码来源:lex.c

示例13: elfLoad

/*****************************************************************************
	DISCRIPTION	: ELFロード
	ARGUMENT	: pElfHead	= ELF構造体
	RETURN		: 0			= 正常終了
				: 0以外		= 異常終了
	NOTE		: -
	UPDATED		: 2013-09-03
*****************************************************************************/
char* elfLoad(char* pcBuf)
{
	ELF_HEAD* pElfHead = (ELF_HEAD*)pcBuf;
	int16 iRet;
	if((iRet = elfCheck(pElfHead)) < 0){
		DPUTS((uint08*)"elfCheck() error!! > ");
		DPHEX(iRet, 8, 1);
		DPUTS((uint08*)"\n");
		return NULL;
	}

	if((iRet = elfLoadProgram(pElfHead)) < 0){
		DPUTS((uint08*)"elfLoadProgram() error!!\n");
		DPHEX(iRet, 8, 1);
		DPUTS((uint08*)"\n");
		return NULL;
	}
	return (char*)pElfHead->lEntryPoint;
}
开发者ID:TokiSasaki,项目名称:KOZOS_with_MONIX,代码行数:27,代码来源:elf.c

示例14: mgas_all_alloc

mgasptr_t mgas_all_alloc(size_t size)
{
    DPUTS("This function is deprecated. Use mgas_all_dmalloc().");

    size_t n_dims = 1;
    size_t block_size[] = { 4096 };
    size_t n_blocks[] = { (size + block_size[0] - 1) / block_size[0] };
    
    return mgas_all_dmalloc(size, n_dims, block_size, n_blocks);
}
开发者ID:shigeki-akiyama,项目名称:massivethreads-dm,代码行数:10,代码来源:mgas_alloc.c

示例15: checksched

static void
checksched(void)
{
    time_t t;
    struct schedcmd *sch;

    if(!schedcmds)
	return;
    t = time(NULL);
    /*
     * List is ordered, so we only need to consider the
     * head element.
     */
    while (schedcmds && schedcmds->time <= t) {
	/*
	 * Remove the entry to be executed from the list
	 * before execution:  this makes quite sure that
	 * the entry hasn't been monkeyed with when we
	 * free it.
	 */
	sch = schedcmds;
	schedcmds = sch->next;
	/*
	 * Delete from the timed function list now in case
	 * the called code reschedules.
	 */
	scheddeltimed();

	if ((sch->flags & SCHEDFLAG_TRASH_ZLE) && zleactive)
	    zleentry(ZLE_CMD_TRASH);
	execstring(sch->cmd, 0, 0, "sched");
	zsfree(sch->cmd);
	zfree(sch, sizeof(struct schedcmd));

	/*
	 * Fix time for future events.
	 * I had this outside the loop, for a little extra efficiency.
	 * However, it then occurred to me that having the list of
	 * forthcoming entries up to date could be regarded as
	 * a feature, and the inefficiency is negligible.
	 *
	 * Careful in case the code we called has already set
	 * up a timed event; if it has, that'll be up to date since
	 * we haven't changed the list here.
	 */
	if (schedcmds && !schedcmdtimed) {
	    /*
	     * We've already delete the function from the list.
	     */
	    DPUTS(timedfns && firstnode(timedfns),
		  "BUG: already timed fn (1)");
	    schedaddtimed(schedcmds->time);
	}
    }
}
开发者ID:biocyberman,项目名称:zsh,代码行数:55,代码来源:sched.c


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