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


C++ HTTRACE函数代码示例

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


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

示例1: HTRule_translate

/*	Translate by rules
**	------------------
**	The most recently defined rules are applied last.
**	This function walks through the list of rules and translates the
**	reference when matches are found. The list is traversed in order
**	starting from the head of the list. It returns the address of the
**	equivalent string allocated from the heap which the CALLER MUST
**	FREE.
*/
PUBLIC char * HTRule_translate (HTList * list, const char * token,
				BOOL ignore_case)
{
    HTRule * pres;
    char * replace = NULL;
    if (!token || !list) return NULL;
    HTTRACE(APP_TRACE, "Check rules. for `%s\'\n" _ token);
    while ((pres = (HTRule *) HTList_nextObject(list))) {
	char * rest = ignore_case ? HTStrCaseMatch(pres->pattern, token) :
	    HTStrMatch(pres->pattern, token);
	if (!rest) continue;				  /* No match at all */
    
	/* We found a match for this entry, now do operation */
	switch (pres->op) {

          case HT_Pass:
	  case HT_Map:
	    if (!pres->replace) {			       /* No replace */
		StrAllocCopy(replace, token);

	    } else if (*rest && pres->insert >= 0) {
		if ((replace = (char  *) HT_MALLOC(strlen(pres->replace)+strlen(rest))) == NULL)
		    HT_OUTOFMEM("HTRule_translate");
		strcpy(replace, pres->replace);
		strcpy(replace+pres->insert, rest);

	    } else {		       /* Perfect match or no insetion point */
		StrAllocCopy(replace, pres->replace);
	    }

	    if (pres->op == HT_Pass) {
		HTTRACE(APP_TRACE, "............ map into `%s'\n" _ replace);
		return replace;
	    }
	    break;
	    
	  case HT_Fail:

	  default:
	    HTTRACE(APP_TRACE, "............ FAIL `%s'\n" _ token);
	    return NULL;
	}
    }
    if (!replace) StrAllocCopy(replace, token);
    return replace;
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:55,代码来源:HTRules.c

示例2: Event_trace

PRIVATE void Event_trace (HTEvent * event)
{
    if (event) {
	HTTRACE(ALL_TRACE, "%8p: %3d %6d %8p %8p %8p" _
		event _ event->priority _ event->millis _ event->cbf _
		event->param _ event->request);
    }
}
开发者ID:ChatanW,项目名称:WebDaM,代码行数:8,代码来源:HTEvtLst.c

示例3: HTEvent_unregister

PUBLIC int HTEvent_unregister (SOCKET s, HTEventType type)
{
    if (!UnregisterCBF) {
	HTTRACE(CORE_TRACE, "Event....... No handler registered\n");
        return -1;
    }
    return (*UnregisterCBF)(s, type);
}
开发者ID:Hiroyuki-Nagata,项目名称:libwww,代码行数:8,代码来源:HTEvent.c

示例4: HTResponse_delete

PUBLIC BOOL HTResponse_delete (HTResponse * me)
{
    if (me) {
        HTTRACE(CORE_TRACE, "Response.... Delete %p\n" _ me);

        /* Access Authentication */
        HT_FREE(me->realm);
        HT_FREE(me->scheme);
        if (me->challenge) HTAssocList_delete(me->challenge);

        /* Connection headers */
        if (me->connection) HTAssocList_delete(me->connection);

        /* PEP Information */
        if (me->protocol) HTAssocList_delete(me->protocol);
        if (me->protocol_request) HTAssocList_delete(me->protocol_request);
        if (me->protocol_info) HTAssocList_delete(me->protocol_info);

        /* Cache control headers */
        if (me->cache_control) HTAssocList_delete(me->cache_control);

        /* Byte ranges */
        if (me->byte_ranges) HTAssocList_delete(me->byte_ranges);

        /* Transfer Encodings */
        if (me->transfer_encoding) HTList_delete(me->transfer_encoding);

        /* Trailers */
        if (me->trailer) HTAssocList_delete(me->trailer);

        /* Variants */
        if (me->variants) HTAssocList_delete(me->variants);

        /*
        ** Only delete Content Type parameters and original headers if the
        ** information is not used elsewhere, for example by the anchor
        ** object.
        */
        if (!me->cached) {

            /* Content type parameters */
            if (me->type_parameters) HTAssocList_delete(me->type_parameters);

            /* Content Encodings */
            if (me->content_encoding) HTList_delete(me->content_encoding);

            /* List of all headers */
            if (me->headers) HTAssocList_delete(me->headers);
        }

        /* HTTP reason string */
        if (me->reason)  HT_FREE (me->reason);

        HT_FREE(me);
        return YES;
    }
    return NO;
}
开发者ID:stefanhusmann,项目名称:Amaya,代码行数:58,代码来源:HTResponse.c

示例5: HTFWriter_abort

PRIVATE int HTFWriter_abort (HTStream * me, HTList * e)
{
    HTTRACE(STREAM_TRACE, "FileWriter.. ABORTING...\n");
    if (me) {
	if (me->leave_open != YES) fclose(me->fp);
	HT_FREE(me);
    }
    return HT_ERROR;
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:9,代码来源:HTFWrite.c

示例6: HTMuxSession_register

PUBLIC HTMuxSession * HTMuxSession_register (HTMuxChannel * muxch,
					     HTMuxSessionId sid, HTProtocolId pid)
{
    if (muxch) {
	HTMuxSession * session = muxch->sessions[sid];
	if (session == NULL) {
	    session = session_new();
	    session->sid = sid;
	    session->pid = pid;
	    muxch->sessions[sid] = session;
	    HTTRACE(MUX_TRACE, "Mux Channel. Registered session %d on channel %p\n" _ 
			sid _ muxch);
	}
	return session;
    }
    HTTRACE(MUX_TRACE, "Mux Channel. Can't register new session\n");
    return NULL;
}
开发者ID:svagionitis,项目名称:libwww,代码行数:18,代码来源:HTMuxCh.c

示例7: HTMuxSession_accept

PUBLIC HTMuxSessionId HTMuxSession_accept (HTMuxChannel * muxch, HTNet * net,
					   HTProtocolId pid)
{
    if (muxch && net) {
	HTMuxSession * session;
	HTMuxSessionId sid = SID_BASE + RECEIVER_OFFSET;
	for (; sid<MAX_SESSIONS; sid+=2) {
	    if ((session = muxch->sessions[sid]) &&
		session->net == NULL && session->pid == pid) {
		HTTRACE(MUX_TRACE, "Mux Channel. Accepting session %d on channel %p\n" _ 
			    sid _ muxch);
		return sid;
	    }
	}
    }
    HTTRACE(MUX_TRACE, "Mux Channel. Can't accept new session\n");
    return INVSID;
}
开发者ID:svagionitis,项目名称:libwww,代码行数:18,代码来源:HTMuxCh.c

示例8: HTTimer_registerDeleteTimerCallback

PUBLIC BOOL HTTimer_registerDeleteTimerCallback (HTTimerSetCallback * cbf)
{
    HTTRACE(CORE_TRACE, "Timer....... registering %p as timer delete cbf\n" _ cbf);
    if (cbf) {
	DeletePlatformTimer = cbf;
	return YES;
    }
    return NO;
}
开发者ID:ChatanW,项目名称:WebDaM,代码行数:9,代码来源:HTTimer.c

示例9: HTXParse_free

PRIVATE int HTXParse_free (HTStream * me)
{
    HTTRACE(STREAM_TRACE, "HTXParse_free\n");
    me->eps->finished = YES;
    (*(me->eps->call_client))(me->eps);           /* client will free buffer */
    HT_FREE(me->eps);
    HT_FREE(me);
    return HT_OK;
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:9,代码来源:HTXParse.c

示例10: HTCookie_deleteCallbacks

PUBLIC BOOL HTCookie_deleteCallbacks (void)
{
    HTTRACE(APP_TRACE, "Cookie...... Unregistering cookie callbacks\n");
    SetCookie = NULL;
    SetCookieContext = NULL;
    FindCookie = NULL;
    FindCookieContext = NULL;
    return YES;
}
开发者ID:Rjoydip,项目名称:libwww,代码行数:9,代码来源:HTCookie.c

示例11: HTCleanTelnetString

/*							HTCleanTelnetString()
 *	Make sure that the given string doesn't contain characters that
 *	could cause security holes, such as newlines in ftp, gopher,
 *	news or telnet URLs; more specifically: allows everything between
 *	ASCII 20-7E, and also A0-FE, inclusive. Also TAB ('\t') allowed!
 *
 * On entry,
 *	str	the string that is *modified* if necessary.  The
 *		string will be truncated at the first illegal
 *		character that is encountered.
 * On exit,
 *	returns	YES, if the string was modified.
 *		NO, otherwise.
 */
PUBLIC BOOL HTCleanTelnetString (char * str)
{
    char * cur = str;

    if (!str) return NO;

    while (*cur) {
	int a = TOASCII((unsigned char) *cur);
	if (a != 0x9 && (a < 0x20 || (a > 0x7E && a < 0xA0) ||  a > 0xFE)) {
	    HTTRACE(URI_TRACE, "Illegal..... character in URL: \"%s\"\n" _ str);
	    *cur = 0;
	    HTTRACE(URI_TRACE, "Truncated... \"%s\"\n" _ str);
	    return YES;
	}
	cur++;
    }
    return NO;
}
开发者ID:ChatanW,项目名称:WebDaM,代码行数:32,代码来源:HTParse.c

示例12: HTBoundary_abort

PRIVATE int HTBoundary_abort (HTStream * me, HTList * e)
{
    int status = HT_ERROR;
    if (me->target) status = (*me->target->isa->abort)(me->target, e);
    HTTRACE(PROT_TRACE, "Boundary.... ABORTING...\n");
    HT_FREE(me->boundary);
    HT_FREE(me);
    return status;
}
开发者ID:ChatanW,项目名称:WebDaM,代码行数:9,代码来源:HTBound.c

示例13: HTEvent_delete

PUBLIC BOOL HTEvent_delete (HTEvent * me)
{
    if (me) {
	HT_FREE(me);
	HTTRACE(CORE_TRACE, "Event....... Deleted event %p\n" _ me);
	return YES;
    }
    return NO;
}
开发者ID:stefanhusmann,项目名称:Amaya,代码行数:9,代码来源:HTEvent.c

示例14: HTZLibInflate_abort

PRIVATE int HTZLibInflate_abort (HTStream * me, HTList * e)
{
    HTTRACE(STREAM_TRACE, "Zlib Inflate ABORTING...\n");
    ZLib_terminate(me);
    (*me->target->isa->abort)(me->target, NULL);
    HT_FREE(me->zstream);
    HT_FREE(me);
    return HT_ERROR;
}
开发者ID:ChatanW,项目名称:WebDaM,代码行数:9,代码来源:HTZip.c

示例15: HTChannel_setSemaphore

/*
**	Explicitly set the semaphore for this channel
*/
PUBLIC void HTChannel_setSemaphore (HTChannel * channel, int semaphore)
{
    if (channel) {
        channel->semaphore = semaphore;
        if (channel->semaphore <= 0) channel->semaphore = 0;
        HTTRACE(PROT_TRACE, "Channel..... Semaphore set to %d for channel %p\n" _
                channel->semaphore _ channel);
    }
}
开发者ID:boatgm,项目名称:urchin,代码行数:12,代码来源:HTChannl.c


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