本文整理汇总了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;
}
示例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");
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例7: dec_tindent
static void
dec_tindent(void)
{
DPUTS(tindent == 0, "attempting to decrement tindent below zero");
if (tindent > 0)
tindent--;
}
示例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);
}
示例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;
}
示例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;
}
示例11: cmdpop
void
cmdpop(void)
{
if (cmdsp <= 0) {
DPUTS(1, "BUG: cmdstack empty");
fflush(stderr);
} else
cmdsp--;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
}