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

C++ CTRACE函数代码示例

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

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



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

示例1: CTRACE

/*
 * Find the EXTERNAL command which matches the given name 'param'.  If there is
 * more than one possibility, make a popup menu of the matching commands and
 * allow the user to select one.  Return the selected command.
 */
static char *lookup_external(char *param,
			     int only_overriders)
{
    int pass, num_disabled, num_matched, num_choices, cur_choice;
    size_t length = 0;
    char *cmdbuf = NULL;
    char **actions = 0;
    char **choices = 0;
    lynx_list_item_type *ptr = 0;

    for (pass = 0; pass < 2; pass++) {
	num_disabled = 0;
	num_matched = 0;
	num_choices = 0;
	for (ptr = externals; ptr != 0; ptr = ptr->next) {

	    if (match_item_by_name(ptr, param, only_overriders)) {
		++num_matched;
		CTRACE((tfp, "EXTERNAL: '%s' <==> '%s'\n", ptr->name, param));
		if (no_externals && !ptr->always_enabled && !only_overriders) {
		    ++num_disabled;
		} else {
		    if (pass == 0) {
			length++;
		    } else if (pass != 0) {
			cmdbuf = format_command(ptr->command, param);
			if (length > 1) {
			    actions[num_choices] = cmdbuf;
			    choices[num_choices] =
				format_command(ptr->menu_name, param);
			}
		    }
		    num_choices++;
		}
	    }
	}
	if (length > 1) {
	    if (pass == 0) {
		actions = typecallocn(char *, length + 1);
		choices = typecallocn(char *, length + 1);

		if (actions == 0 || choices == 0)
		    outofmem(__FILE__, "lookup_external");
	    } else {
		actions[num_choices] = 0;
		choices[num_choices] = 0;
	    }
	}
开发者ID:ThomasDickey,项目名称:lynx-snapshots,代码行数:53,代码来源:LYExtern.c


示例2: ARGS1

int HTLoadRules ARGS1(CONST char *, filename)
{
    FILE * fp = fopen(filename, "r");
    char line[LINE_LENGTH+1];
    
    if (!fp) {
        CTRACE(stderr, "HTRules: Can't open rules file %s\n", filename);
	return -1; /* File open error */
    }
    for(;;) {
	if (!fgets(line, LINE_LENGTH+1, fp)) break;	/* EOF or error */
	(void) HTSetConfiguration(line);
    }
    fclose(fp);
    return 0;		/* No error or syntax errors ignored */
}
开发者ID:kotohvost,项目名称:yui,代码行数:16,代码来源:HTRules.c


示例3: ARGS2

/*	Create a chunk with a certain allocation unit and ensured size
**	--------------
*/
PUBLIC HTChunk * HTChunkCreate2 ARGS2 (int,grow, size_t, needed)
{
    HTChunk * ch = typecalloc(HTChunk);
    if (ch == NULL)
	outofmem(__FILE__, "HTChunkCreate2");

    HTChunkInit (ch, grow);
    if (needed > 0) {
	ch->allocated = needed-1 - ((needed-1) % ch->growby)
	    + ch->growby; /* Round up */
	CTRACE((tfp, "HTChunkCreate2: requested %d, allocate %d\n",
	       (int) needed, ch->allocated));
	ch->data = typecallocn(char, ch->allocated);
	if (!ch->data)
	    outofmem(__FILE__, "HTChunkCreate2 data");
    }
开发者ID:avsm,项目名称:openbsd-lynx,代码行数:19,代码来源:HTChunk.c


示例4: ARGS1

PRIVATE int HTCloseGzFile ARGS1(
	gzFile,			gzfp)
{
    int gzres;
    if (gzfp == NULL)
	return 0;
    gzres = gzclose(gzfp);
    if (TRACE) {
	if (gzres == Z_ERRNO) {
	    perror("gzclose   ");
	} else if (gzres != Z_OK) {
	    CTRACE((tfp, "gzclose   : error number %d\n", gzres));
	}
    }
    return(gzres);
}
开发者ID:avsm,项目名称:openbsd-lynx,代码行数:16,代码来源:HTFormat.c


示例5: NXPrintf

HTStyleSheet *HTStyleSheetWrite(HTStyleSheet *self, NXStream * stream)
{
    int numStyles = 0;
    HTStyle *style;

    for (style = self->styles; style; style = style->next)
	numStyles++;
    NXPrintf(stream, "%d\n", numStyles);

    CTRACE((tfp, "StyleSheet: Writing %d styles\n", numStyles));
    for (style = self->styles; style; style = style->next) {
	NXPrintf(stream, "%s ", style->name);
	(void) HTStyleWrite(style, stream);
    }
    return self;
}
开发者ID:AaronDP,项目名称:lynx_adbshell,代码行数:16,代码来源:HTStyle.c


示例6: jthread_set_wait_monitor

static void jthread_set_wait_monitor(jobject monitor)
{
    vm_thread_t vm_thread = jthread_self_vm_thread();
    assert(vm_thread);
    jvmti_thread_t jvmti_thread = &vm_thread->jvmti_thread;

    if (!jvmti_thread) {
        // nothing to do
        return;
    }
    CTRACE(("TM: set wait monitor: %x", monitor));

    int disable_count = hythread_reset_suspend_disable();
    jvmti_thread->wait_monitor = vm_thread->jni_env->NewGlobalRef(monitor);
    hythread_set_suspend_disable(disable_count);
} // jthread_set_wait_monitor
开发者ID:dacut,项目名称:juliet,代码行数:16,代码来源:thread_java_monitors.cpp


示例7: CTRACE

BufferMapper* BufferManager::map(DataBuffer& buffer)
{
    bool ret;
    BufferMapper* mapper;

    CTRACE();
    Mutex::Autolock _l(mLock);
    //try to get mapper from pool
    mapper = mBufferPool->getMapper(buffer.getKey());
    if (mapper) {
        // increase mapper ref count
        mapper->incRef();
        return mapper;
    }

    // create a new buffer mapper and add it to pool
    do {
        VLOGTRACE("new buffer, will add it");
        mapper = createBufferMapper(buffer);
        if (!mapper) {
            ELOGTRACE("failed to allocate mapper");
            break;
        }
        ret = mapper->map();
        if (!ret) {
            ELOGTRACE("failed to map");
            delete mapper;
            mapper = NULL;
            break;
        }
        ret = mBufferPool->addMapper(buffer.getKey(), mapper);
        if (!ret) {
            ELOGTRACE("failed to add mapper");
            break;
        }
        // increase mapper ref count
        mapper->incRef();
        return mapper;
    } while (0);

    // error handling
    if (mapper) {
        mapper->unmap();
        delete mapper;
    }
    return NULL;
}
开发者ID:MIPS,项目名称:hardware-intel-img-hwcomposer,代码行数:47,代码来源:BufferManager.cpp


示例8: _check_cb

static void
_check_cb(UNUSED EV_P_ UNUSED ev_check *w, UNUSED int revents)
{
    int npending;

    npending = ev_pending_count(the_loop);
#ifdef TRACE_VERBOSE
    CTRACE("ev_pending_count=%d", npending);
#endif
    if (npending <= 0) {
        //CTRACE("Breaking loop? ...");
        //ev_break(the_loop, EVBREAK_ALL);
    }
    timecounter_now = (uint64_t)(ev_now(the_loop) * 1000000000.);

    //CTRACE("revents=%08x", revents);
}
开发者ID:mkushnir,项目名称:mrkthr,代码行数:17,代码来源:ev_poller.c


示例9: test0

static void
test0(void)
{
    int res;
    struct sigaction act = {
        .sa_flags = SA_SIGINFO,
    };
    UNUSED mrkthr_ctx_t *cli;
    //mrkthr_ctx_t *srv;

    sigemptyset(&(act.sa_mask));

    act.sa_sigaction = (void (*)(int, siginfo_t *, void *))sigterm_handler;
    sigaction(SIGTERM, &act, NULL);
    sigaction(SIGINT, &act, NULL);


    mrkthr_init();

    shutdown_timer_ctx = mrkthr_new("tm", shut_me_down, 0);


    //CTRACE();
    //if (pipe(read_pipe) != 0) {
    //    FAIL("pipe");
    //}

    //CTRACE();
    //if (pipe(write_pipe) != 0) {
    //    FAIL("pipe");
    //}

    //CTRACE();

    //srv = mrkthr_spawn("qwe", qwe, 2, read_pipe[0], write_pipe[1]);

    //cli = mrkthr_spawn("asd", asd, 2, write_pipe[0], read_pipe[1]);

    cli = mrkthr_spawn("bar", bar, 0);

    res = mrkthr_loop();

    mrkthr_fini();

    CTRACE("res=%d", res);
}
开发者ID:mkushnir,项目名称:mrkthr,代码行数:46,代码来源:testco.c


示例10: ARGS2

/*  Match maintype to any MIME type starting with maintype,
 *  for example:  image/gif should match image
 */
PRIVATE int half_match ARGS2(char *,trial_type, char *,target)
{
    char *cp = strchr(trial_type, '/');

    /* if no '/' or no '*' */
    if (!cp || *(cp+1) != '*')
	return 0;

    CTRACE((tfp, "HTFormat: comparing %s and %s for half match\n",
		trial_type, target));

	/* main type matches */
    if (!strncmp(trial_type, target, (cp-trial_type)-1))
	return 1;

    return 0;
}
开发者ID:avsm,项目名称:openbsd-lynx,代码行数:20,代码来源:HTFormat.c


示例11: ARGS3

PRIVATE void syntax_error ARGS3(FILE *,	 fp,
				char *,	 msg,
				LexItem, lex_item)
{
    char buffer[41];
    int cnt = 0;
    int ch;

    while ((ch = getc(fp)) != EOF  &&  ch != '\n')
	if (cnt < 40) buffer[cnt++] = ch;
    buffer[cnt] = (char)0;

    CTRACE(tfp, "%s %d before: '%s'\nHTGroup.c: %s (got %s)\n",
		"HTGroup.c: Syntax error in rule file at line",
		HTlex_line, buffer, msg, lex_verbose(lex_item));
    HTlex_line++;
}
开发者ID:OS2World,项目名称:APP-INTERNET-Lynx,代码行数:17,代码来源:HTGroup.c


示例12: mrkthr_wait_for_read

int
mrkthr_wait_for_read(int fd)
{
    int res;
    UNUSED ev_item_t *ev, *ev1;

    ev = ev_io_item_get(fd, EV_READ);
    //ev_io_set(&ev->ev.io, fd, EV_READ);
    me->pdata.ev = ev;

    /*
     * check if there is another thread waiting for the same event.
     */
    if (ev->ev.io.data == NULL) {
        ev->ev.io.data = me;
    } else if (ev->ev.io.data != me) {
        /*
         * in this case we are not allowed to wait for this event,
         * sorry.
         */
        me->co.rc = MRKTHR_CO_RC_SIMULTANEOUS;
        return -1;
    }

#ifdef TRACE_VERBOSE
    CTRACE(FBBLUE("starting ev_io %d/%s"),
           ev->ev.io.fd,
           EV_STR(ev->ev.io.events));
#endif
    ev_io_start(the_loop, &ev->ev.io);

    /* wait for an event */
    me->co.state = CO_STATE_READ;
    res = yield();

    ev1 = ev_io_item_get(fd, EV_READ);

    assert(ev == ev1);

    assert(ev->ev.io.data == me);

    ev->ev.io.data = NULL;
    me->pdata.ev = NULL;

    return res;
}
开发者ID:mkushnir,项目名称:mrkthr,代码行数:46,代码来源:ev_poller.c


示例13: psbWsbmDestroyTTMBuffer

int psbWsbmDestroyTTMBuffer(void * buf)
{
    CTRACE();

    if(!buf) {
        ETRACE("invalid ttm buffer");
        return -EINVAL;
    }

    /*FIXME: should I unmap this buffer object first?*/
    wsbmBOUnmap((struct _WsbmBufferObject *)buf);

    wsbmBOUnreference((struct _WsbmBufferObject **)&buf);

    XTRACE();

    return 0;
}
开发者ID:MIPS,项目名称:hardware-intel-img-hwcomposer,代码行数:18,代码来源:WsbmWrapper.c


示例14: CTRACE

bool DisplayPlane::initialize(uint32_t bufferCount)
{
    CTRACE();

    if (bufferCount < MIN_DATA_BUFFER_COUNT) {
        WLOGTRACE("buffer count %d is too small", bufferCount);
        bufferCount = MIN_DATA_BUFFER_COUNT;
    }

    // create buffer cache, adding few extra slots as buffer rendering is async
    // buffer could still be queued in the display pipeline such that they
    // can't be unmapped]
    mCacheCapacity = bufferCount;
    mDataBuffers.setCapacity(bufferCount);
    mActiveBuffers.setCapacity(MIN_DATA_BUFFER_COUNT);
    mInitialized = true;
    return true;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:18,代码来源:DisplayPlane.cpp


示例15: ARGS2

/*
 * Put the AddHrefs in a list. It can be used for indexing to
 * present special filetypes through a CGI.
 */
PUBLIC void HTAddHref ARGS2(char *,     url,
                            char *,     type_templ)
{
    HTHrefNode * node;

    if (!url || !type_templ) return;

    node = (HTHrefNode*)calloc(1,sizeof(HTHrefNode));
    if (!node) outofmem(__FILE__, "HTAddHref");

    if (url) StrAllocCopy(node->href_url, url);
    if (type_templ) StrAllocCopy(node->type_templ, type_templ);

    if (!hrefs) hrefs = HTList_new();
    HTList_addObject(hrefs, (void*)node);
    CTRACE(stderr,
           "AddHref..... %s => URL=\"%s\" \n",type_templ,url);
}
开发者ID:tjgillies,项目名称:cern-httpd,代码行数:22,代码来源:HTIcons.c


示例16: LYpop

/*
 * Pop the previous filename, link and line number from the history list.
 */
void LYpop(DocInfo *doc)
{
    if (nhist > 0) {
	clean_extra_history();
	nhist--;

	LYFreeDocInfo(doc);

	*doc = HDOC(nhist);

#ifdef DISP_PARTIAL
	/* assume we pop the 'doc' to show it soon... */
	LYSetNewline(doc->line);	/* reinitialize */
#endif /* DISP_PARTIAL */
	CTRACE((tfp, "LYpop[%d]: address:%s\n     title:%s\n",
		nhist, doc->address, doc->title));
    }
}
开发者ID:ThomasDickey,项目名称:lynx-snapshots,代码行数:21,代码来源:LYHistory.c


示例17: _shutdown

static int
_shutdown(UNUSED int argc, UNUSED void **argv)
{
    if (run_thread != NULL) {
        (void)mrkthr_set_interrupt_and_join(run_thread);
        run_thread = NULL;
    }
    if (monitor_thread != NULL) {
        (void)mrkthr_set_interrupt_and_join(monitor_thread);
        monitor_thread = NULL;
    }

    /* cleanup */
    if (host != NULL) {
        free(host);
        host = NULL;
    }
    port = 0;
    if (user != NULL) {
        free(user);
        user = NULL;
    }
    if (password != NULL) {
        free(password);
        password = NULL;
    }
    if (vhost != NULL) {
        free(vhost);
        vhost = NULL;
    }
    if (exchange != NULL) {
        free(exchange);
        exchange = NULL;
    }
    if (routing_key != NULL) {
        free(routing_key);
        routing_key = NULL;
    }

    mrkthr_shutdown();
    CTRACE("...shutdown OK");
    return 0;
}
开发者ID:mkushnir,项目名称:mrkamqp,代码行数:43,代码来源:testspam.c


示例18: typecalloc

/*	Create a chunk with a certain allocation unit and ensured size
 *	--------------
 */
HTChunk *HTChunkCreate2(int grow, size_t needed)
{
    HTChunk *ch = typecalloc(HTChunk);

    if (ch == NULL)
        outofmem(__FILE__, "HTChunkCreate2");

    HTChunkInit(ch, grow);
    if (needed > 0) {
        /* Round up */
        ch->allocated = (int) (needed - 1 - ((needed - 1) % ch->growby)
                               + (unsigned) ch->growby);
        CTRACE((tfp, "HTChunkCreate2: requested %d, allocate %u\n",
                (int) needed, (unsigned) ch->allocated));
        ch->data = typecallocn(char, (unsigned) ch->allocated);

        if (!ch->data)
            outofmem(__FILE__, "HTChunkCreate2 data");
    }
开发者ID:sribits,项目名称:lynx,代码行数:22,代码来源:HTChunk.c


示例19: HTList_addObject

/*      Add object to START of list (so it is pointed to by the head).
*/
void HTList_addObject(HTList *me, void *newObject)
{
    HTList *newNode;

    if (me) {
	if ((newNode = typeMalloc(HTList)) == NULL)
	      outofmem(__FILE__, "HTList_addObject");

	newNode->object = newObject;
	newNode->next = me->next;
	me->next = newNode;

    } else {
	CTRACE((tfp, "HTList: Trying to add object %p to a nonexisting list\n",
		newObject));
    }

    return;
}
开发者ID:ThomasDickey,项目名称:lynx-snapshots,代码行数:21,代码来源:HTList.c


示例20: message_has_content

static BOOLEAN message_has_content(const char *filename,
				   BOOLEAN *nonspaces)
{
    FILE *fp;
    char *buffer = NULL;
    BOOLEAN in_headers = TRUE;

    *nonspaces = FALSE;

    if (!filename || (fp = fopen(filename, "r")) == NULL) {
	CTRACE((tfp, "Failed to open file %s for reading!\n",
		NONNULL(filename)));
	return FALSE;
    }
    while (LYSafeGets(&buffer, fp) != NULL) {
	char *cp = buffer;
	char firstnonblank = '\0';

	LYTrimNewline(cp);
	for (; *cp; cp++) {
	    if (!firstnonblank && isgraph(UCH(*cp))) {
		firstnonblank = *cp;
	    } else if (!isspace(UCH(*cp))) {
		*nonspaces = TRUE;
	    }
	}
	if (firstnonblank && firstnonblank != '>') {
	    if (!in_headers) {
		LYCloseInput(fp);
		FREE(buffer);
		return TRUE;
	    }
	}
	if (!firstnonblank) {
	    in_headers = FALSE;
	}
    }
    FREE(buffer);
    LYCloseInput(fp);
    return FALSE;
}
开发者ID:Distrotech,项目名称:lynx,代码行数:41,代码来源:LYNews.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CTRL函数代码示例发布时间:2022-05-30
下一篇:
C++ CTR4函数代码示例发布时间: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