亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? wdbgopherlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* wdbGopherLib.c - info gathering interpreter for the agent *//* Copyright 1994-2001 Wind River Systems, Inc. *//*modification history--------------------01l,14sep01,jhw Fixed warnings from compiling with gnu -pedantic flag01k,09sep97,elp added global variable to prevent taskLock() calls (SPR# 7653)		+ replaced hardcoded value by macro.01j,10dec96,elp gopherWriteString() cleanup.01i,09dec96,elp fixed null length string error (gopher type was not written).01h,30apr96,elp	Merged with the host version written by bss (SPR# 6497).		+ enabled transfer of larger strings (SPR #6277)		+ fix SPR #6403.01g,20mar96,s_w modify the gopherWriteString to cope with strings near memory		boundaries (SPR 6218).01f,31oct95,ms  changed a couple of strtol's to strtoul's.01e,14sep95,c_s added more syntax checking, bug fixes, and memory protection.		(SPRs 4659, 4462).01d,23jun95,tpr replaced memcpy() by bcopy()01c,20jun95,ms	added static buffer back in to make DSA easier01b,01jun95,ms	added interlocking in task mode, removed static buffer.01a,01nov94,c_s written.*//*DESCRIPTION*/#ifdef HOST#include <limits.h>#include <string.h>#include <ctype.h>#include <stdlib.h>#if 0   /* omitted because host.h redefines memset () and memchr () */#include <memory.h>#else   /* which breaks the declaration of memcpy () ... */extern "C" void * memcpy (void * s1, const void * s2, size_t n);#endif#include "host.h"#include "wdb.h"#include "backend.h"#else /* #ifdef HOST */#include "wdb/wdb.h"#include "wdb/wdbRtIfLib.h"#include "wdb/wdbLibP.h"#include "wdb/wdbSvcLib.h"#include "limits.h"#include "string.h"#include "ctype.h"#include "stdlib.h"#endif  /* #ifdef HOST */typedef struct    {    char *		program;	/* where to start executing */    UINT32		p;		/* initial value of pointer */    char *		pTape;		/* tape array */    int			tapeIx;		/* index in tape to write next cell */    int			tapeLen;	/* total length of tape */    int			execute;	/* whether to execute, or just parse */    unsigned int	status;		/* error code */    } wdbGopherCtx_t;/* The Gopher Byte Stream Format *  * The first byte of an item is the type code, one of GOPHER_UINT32,  * GOPHER_UINT16, GOPHER_FLOAT64, etc.  This code determines the number * of bytes that immediately follow and represent the tape cell value. * These data bytes will be in the target byte order.  If the type code * is GOPHER_STRING, all following bytes are part of the string up to  * a trailing NUL character. */#define MAX_TAPE_LEN	1400#ifdef HOST/** XXX - because some emulator back ends only provide low-bandwidth* memory read capabilities, the host implementation assumes that* the maximum size of a string in target memory is 32 bytes.* This is necessary for performance.  However, gopherWriteString()* should be modified to make several small reads until it finds* the end of a string.*/const int       MaxTgtStrLen    = 32;   /* XXX - Maximum length of a string */#else#define ADD_TAPE_NB	10BOOL		wdbGopherLock = TRUE;	  /* lock during gopher evaluation */static char *	pAddTape [ADD_TAPE_NB];	  /* additional tape pointers */static int	pAddTapeIx [ADD_TAPE_NB]; /* additional tape fill indexes */static int	tapeIndex;		  /* current tape number */#endif /* #ifdef HOST */static char 	tape [MAX_TAPE_LEN];	/* XXX should be passed to					 * wdbGopherLib(), but that would					 * make the host based DSA harder					 * to implement */static int	tapeLen = MAX_TAPE_LEN;#define WDB_REPLY_HDR_SZ	24#define WDB_WRAPPER_HDR_SZ	12#define WDB_MEM_XFER_HDR_SZ	8#define WDB_OPAQUE_HDR_SZ	4/* it is required to reserve space for headers (WDB + XDR + IP) */#define WDB_GOPHER_MTU_OFFSET  (WDB_REPLY_HDR_SZ + WDB_WRAPPER_HDR_SZ + \				WDB_MEM_XFER_HDR_SZ + WDB_OPAQUE_HDR_SZ + 8)/* forward declarations */#ifdef HOST/* * Note:  although this is a '.c' file, it must be * compiled with the '-x c++' option. */extern "C" UINT32 wdbEvaluateGopher (WDB_STRING_T *program,                                     WDB_MEM_XFER *pTape);static STATUS gopherWriteP (wdbGopherCtx_t *gc);#elsestatic UINT32 wdbEvaluateGopher (WDB_STRING_T *program, WDB_MEM_XFER *pTape);static STATUS wdbTransferGopher (WDB_MEM_XFER *pTape);static STATUS gopherNewTapeAllocate (wdbGopherCtx_t *gc);#endif /* #ifdef HOST */static STATUS gopher		(wdbGopherCtx_t *gc);static STATUS gopherWriteScalar	(wdbGopherCtx_t *gc, UINT8 *src, int type);static STATUS gopherWriteString (wdbGopherCtx_t *gc, char *string);/******************************************************************************** gopher -*/static STATUS gopher     (    wdbGopherCtx_t *	gc		/* gopher execution context */    )    {    while (*gc->program)	{	/* skip whitespace */	while (*gc->program && isspace ((int) *gc->program))	    ++gc->program;	if (isxdigit ((int) *gc->program)) /* unsigned constants replace p */	    {	    char *newPc;#ifdef HOST            /* XXX - this is a work around for the bug in GNU's strtoul (). */            unsigned int newP = (unsigned int) strtol (gc->program, &newPc, 0);#else	    unsigned int newP = (unsigned int) strtoul (gc->program, &newPc, 0);#endif /* #ifdef HOST */	    	    if (gc->program == newPc)		{		gc->status = WDB_ERR_GOPHER_SYNTAX;		return ERROR;		}			    if (gc->execute)		{		gc->p = newP;		}	    	    gc->program = newPc;	    }	else if (*gc->program == '+'	/* signed constants increment p */		 || *gc->program == '-')	    {	    char *newPc;	    int minus = *gc->program == '-';	    int delta = strtol (++gc->program, &newPc, 0);	    if (gc->program == newPc)		{		gc->status = WDB_ERR_GOPHER_SYNTAX;		return ERROR;		}			    if (gc->execute)		{		gc->p += minus ? -delta : delta;		}	    gc->program = newPc;	    }	else if (*gc->program == '*')	/* * replaces p with *p */	    {	    if (gc->execute)		{		UINT32 newP;#ifdef HOST                if (Backend_T::memProbe_s ((TGT_ADDR_T) gc->p, VX_READ,                                        sizeof (UINT32), (char *) &newP) != OK)#else		if ((*pWdbRtIf->memProbe) ((INT8 *) gc->p, VX_READ,					sizeof (UINT32), (char *) &newP) != OK)#endif /* #ifdef HOST */		    {			    gc->status = WDB_ERR_GOPHER_FAULT;		    return ERROR;		    }		gc->p = newP;		}	    ++gc->program;	    }	else if (*gc->program == '!')	/* ! writes p on the tape */	    {	    if (gc->execute)		{#ifdef HOST                if (gopherWriteP (gc) != OK)                    return ERROR;#else		if (gopherWriteScalar (gc, (UINT8 *) &gc->p, GOPHER_UINT32)		    != OK)		    return ERROR;#endif /* #ifdef HOST */		}	    ++gc->program;	    }	else if (*gc->program == '@')	/* @ writes *p on the tape, advance p */	    {	    int		size = 4;	    int		type = GOPHER_UINT32;	    /* If the next character is in [bwlfdx] then modify	     * the size of the transfer. Otherwise pick up 32 bits.	     */	    	    switch (gc->program [1])		{		case 'b':		    size = 1; 		    type = GOPHER_UINT8;		    ++gc->program;		    break;		case 'w':		    size = 2; 		    type = GOPHER_UINT16;		    ++gc->program;		    break;		case 'f':		    size = 4; 		    type = GOPHER_FLOAT32;		    ++gc->program;		    break;		case 'd':		    size = 8; 		    type = GOPHER_FLOAT64;		    ++gc->program;		    break;		case 'x':		    size = 10; 		    type = GOPHER_FLOAT80;		    ++gc->program;		    break;		case 'l':		    size = 4; 		    type = GOPHER_UINT32;		    ++gc->program;		    break;		}		    	    if (gc->execute)		{		if (gopherWriteScalar (gc, (UINT8 *) gc->p, type) != OK)		    return ERROR;		gc->p += size;		}	    ++gc->program;	    }	else if (*gc->program == '$')	/* $ writes string at p on tape */	    {	    if (gc->execute)		{		if (gopherWriteString (gc, (char *) gc->p) != OK)		    return ERROR;		}	    ++gc->program;	    }	else if (*gc->program == '{')	/* { saves p and repeats contents */	    {				/* while p is not NULL.           */	    wdbGopherCtx_t subGc;	    char *progStart = gc->program+1;	    UINT32 oldP = gc->p;	    int oldX = gc->execute;	    int result = OK;	    subGc = *gc;		/* set up initial context */	    ++subGc.program;		/* skip the initial left-brace */	    /* We set the execute flag to zero if the pointer value 	       is currently zero in our context.  This is because if	       p == 0 upon encountering an open-brace, we should not execute 	       the contents of the brace construct, but we still need	       to know where to resume execution, so we must parse	       in a subcontext. */	    if (gc->p == 0)		{		subGc.execute = 0;		result = gopher (&subGc);		}	    else		{		while (result == OK && subGc.p != 0)		    {		    subGc.program = progStart;		    result = gopher (&subGc);		    }		}	    /* Now set our program pointer to the character after the 	       execution of the subprogram. */	    *gc = subGc;	    if (result != OK)		{			return result;		}	    	    /* restore p, execute. */	    gc->p = oldP;	    gc->execute = oldX;	    }	else if (*gc->program == '}')	/* } ends the loop opened by {. */	    {	    ++gc->program;	    return OK;	    }	else if (*gc->program == '<')	/* < saves p and executes body once. */	    {	    wdbGopherCtx_t subGc;	    UINT32 oldP = gc->p;	    int result;	    subGc = *gc;		/* set up initial context */	    ++subGc.program;		/* skip the initial left-bracket */	    result = gopher (&subGc);	    if (result != OK)  		{		*gc = subGc;		return result;		}	    /* Now set our program pointer to the character after the 	       execution of the subprogram. */	    *gc = subGc;	    gc->p = oldP;	    }	else if (*gc->program == '>')	/* > closes the block opened by <. */	    {	    ++gc->program;	    return OK;	    }	else if (*gc->program == '(')	/* perform "n" times, where n follows */	    {	    char *newPc;	    UINT32 oldP = gc->p;	    wdbGopherCtx_t subGc;#ifdef HOST            /* XXX - fix for GNU's bug in strtoul (). */            unsigned int count = (unsigned int) strtol (gc->program + 1,                                                        &newPc, 0);#else	    unsigned int count = (unsigned int) strtoul (gc->program + 1,							&newPc, 0);#endif /* #ifdef HOST */	    int ix;	    	    if (gc->program+1 == newPc || count <= 0)		{		gc->status = WDB_ERR_GOPHER_SYNTAX;		return ERROR;		}	    /* if we're not executing, just execute the loop once, so we 	       can find the end of the nesting. */	    if (! gc->execute) count = 1;	    gc->program = newPc;	    subGc = *gc;	    for (ix = 0; ix < count; ++ix)		{		/* start the program at the beginning: after the (# part. */		subGc.program = newPc;		if (gopher (&subGc) != OK)		    {		    *gc = subGc;		    return ERROR;		    }		}	    	    *gc = subGc;	    gc->p = oldP;	    }	else if (*gc->program == ')')	    {	    ++gc->program;	    return OK;	    }	else if (*gc->program == '_')	    {	    /* _ is ignored.  It can be used to separate two numbers	       in a generated gopher program. */	    ++gc->program;	    }	else if (*gc->program)	    {	    /* unknown character: syntax error. */	    gc->status = WDB_ERR_GOPHER_SYNTAX;	    return ERROR;	    }	}        return OK;    }#ifdef HOST/******************************************************************************** wdbEvaluateGopher -*/UINT32 wdbEvaluateGopher    (    WDB_STRING_T *      pProgram,    WDB_MEM_XFER *      pValueTape    )    {    wdbGopherCtx_t      gc;    gc.program  = *pProgram;    gc.p        = 0;    gc.pTape    = tape;    gc.tapeIx   = 0;    gc.tapeLen  = tapeLen;    gc.execute  = 1;    gc.status   = OK;    gopher (&gc);    pValueTape->source          = gc.pTape;    pValueTape->numBytes        = gc.tapeIx;    return (gc.status);    }/******************************************************************************** gopherWriteScalar -*/static STATUS gopherWriteScalar    (    wdbGopherCtx_t *    gc,                     /* gopher context */    UINT8 *             src,                    /* source address */    int                 type                    /* GOPHER_UINT32, etc. */    )    {    int                 nbytes = 4;             /* UINT32 is most common */    int			status;    if (type == GOPHER_UINT16)   nbytes = 2;    /* fix nbytes if size != 4 */    if (type == GOPHER_UINT8)    nbytes = 1;    if (type == GOPHER_FLOAT64)  nbytes = 8;    if (type == GOPHER_FLOAT80)  nbytes = 10;    /* We must have at least nbytes+1 bytes left: one for type marker,       nbytes for the scalar itself. */    if (gc->tapeLen - gc->tapeIx < nbytes+1)        {        gc->status = WDB_ERR_GOPHER_TRUNCATED;        return ERROR;        }    /* Write the scalar type. */    gc->pTape [gc->tapeIx++] = type;    status = Backend_T::tgtRead_s ((TGT_ADDR_T) src,				   (void *) (gc->pTape + gc->tapeIx),				   nbytes);    if (status != OK)	{	gc->status = WDB_ERR_MEM_ACCES;	return ERROR;	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久牛牛 | 欧美性大战久久久| 国产精品一区专区| 91猫先生在线| 99久久精品国产一区二区三区| 欧美综合亚洲图片综合区| 国产亚洲成aⅴ人片在线观看| 亚洲国产cao| 亚洲成a人v欧美综合天堂下载| 久久97超碰色| 国产精品无码永久免费888| 欧洲一区二区av| 成人激情免费视频| 国产一区二区三区电影在线观看| 亚洲国产综合91精品麻豆| 中文av一区二区| 久久午夜免费电影| 日韩一卡二卡三卡| 欧美色偷偷大香| 色综合久久中文综合久久牛| 丰满亚洲少妇av| 久久99国内精品| 全国精品久久少妇| 五月天一区二区三区| 一区二区三区日韩精品| 国产欧美精品一区| 国产亚洲婷婷免费| 久久久精品tv| 久久久午夜精品理论片中文字幕| 51精品视频一区二区三区| 欧美午夜寂寞影院| 日本高清免费不卡视频| 色一情一乱一乱一91av| www.色精品| 成人av免费在线播放| 国产69精品久久777的优势| 国产在线精品一区二区夜色| 日韩电影一区二区三区四区| 亚洲成人www| 日韩精品一二三| 青草av.久久免费一区| 毛片av一区二区| 精品一区二区三区影院在线午夜 | 久久综合九色欧美综合狠狠 | 成人v精品蜜桃久久一区| 国产精品一区二区黑丝| 国产精品一区二区果冻传媒| 国产精品主播直播| 国产不卡高清在线观看视频| 成人污视频在线观看| 99久久婷婷国产| 欧美在线|欧美| 欧美军同video69gay| 91精品国产入口| 欧美一区二区三级| 欧美大肚乱孕交hd孕妇| 久久色.com| 亚洲国产精品ⅴa在线观看| 1区2区3区国产精品| 亚洲免费av网站| 洋洋av久久久久久久一区| 午夜视黄欧洲亚洲| 午夜av一区二区| 激情偷乱视频一区二区三区| 国产真实乱对白精彩久久| 9i在线看片成人免费| 欧美亚一区二区| 欧美xxxx在线观看| 国产三区在线成人av| 中文字幕亚洲一区二区va在线| 亚洲激情一二三区| 蜜桃91丨九色丨蝌蚪91桃色| 国产成人精品免费| 一本一本大道香蕉久在线精品| 欧美精品一二三四| 久久理论电影网| 亚洲激情图片qvod| 精品综合久久久久久8888| 不卡一区二区中文字幕| 欧美日韩大陆一区二区| 久久蜜桃av一区二区天堂| 亚洲欧美一区二区三区极速播放 | 亚洲国产综合色| 国产一区二区三区高清播放| 色成年激情久久综合| 欧美一区2区视频在线观看| 中文字幕av一区二区三区| 亚洲成人先锋电影| 成人午夜看片网址| 欧美日韩成人综合| 中文字幕一区三区| 麻豆传媒一区二区三区| 91在线观看下载| 欧美变态tickling挠脚心| 一区二区三区精品视频在线| 精品一区二区久久| 欧美在线999| 亚洲欧洲av另类| 久久99精品国产91久久来源 | 久久综合999| 亚洲在线免费播放| 粉嫩蜜臀av国产精品网站| 日韩一区二区三区高清免费看看 | 亚洲高清免费一级二级三级| 国产成人精品aa毛片| 日韩欧美一二区| 亚洲成人一区在线| 91香蕉视频污| 欧美国产精品久久| 国产一区二区91| 日韩三级免费观看| 亚洲国产中文字幕在线视频综合 | 秋霞av亚洲一区二区三| 91福利在线观看| 国产精品久久久久久久久免费丝袜 | 欧美一卡二卡在线| 一区二区三区毛片| 色综合久久久久综合体桃花网| 国产免费观看久久| 精品一区二区在线观看| 欧美一级在线观看| 日韩高清欧美激情| 欧美性猛交xxxxxx富婆| 国产精品久久看| 国产精品一区二区无线| 日韩免费高清av| 日韩电影在线免费看| 欧美精品在线一区二区| 亚洲国产一区二区在线播放| 91在线观看高清| 最新国产の精品合集bt伙计| 福利电影一区二区| 国产精品美女久久久久高潮| 国产福利不卡视频| 久久久午夜精品理论片中文字幕| 国内精品自线一区二区三区视频| 欧美刺激午夜性久久久久久久| 日韩和欧美的一区| 欧美一区二区视频在线观看| 日韩国产欧美在线播放| 日韩色视频在线观看| 久久av中文字幕片| 精品少妇一区二区三区免费观看 | 久久久久久久久蜜桃| 九九九久久久精品| 久久精品人人做| 国产精品资源网| 国产精品久久久久久久久免费丝袜| av午夜一区麻豆| 亚洲欧美视频一区| 欧美日韩在线电影| 热久久免费视频| www国产亚洲精品久久麻豆| 国产一区二区精品在线观看| 欧美高清在线一区二区| 91色视频在线| 午夜精彩视频在线观看不卡| 欧美一级一区二区| 国产精品自在在线| 中文字幕在线免费不卡| 在线观看免费成人| 免费精品视频在线| 亚洲国产精品成人久久综合一区| 91原创在线视频| 日韩成人av影视| 久久久亚洲综合| 91国偷自产一区二区使用方法| 天堂av在线一区| 久久久久国产精品人| 91麻豆蜜桃一区二区三区| 日韩精品国产精品| 国产日韩一级二级三级| 在线观看视频欧美| 激情综合五月婷婷| 亚洲特级片在线| 日韩一区二区电影在线| jvid福利写真一区二区三区| 天天色 色综合| 欧美国产一区视频在线观看| 欧美日韩中文字幕一区二区| 国产一区二区三区四| 亚洲精品亚洲人成人网| 日韩精品一区二区三区视频播放 | 91在线免费看| 麻豆精品新av中文字幕| 日韩美女精品在线| 欧美大黄免费观看| 在线观看成人小视频| 国产精品66部| 日韩激情中文字幕| 国产精品国产a| 日韩欧美视频在线| 色域天天综合网| 国产在线不卡视频| 亚洲国产一区视频| 一区在线观看视频| 欧美α欧美αv大片| 欧美日本在线播放| 成年人网站91| 国产一区二区调教|