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


C++ CTRACE函数代码示例

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


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


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