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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? webs.c

?? 嵌入式Linux系統用的web server,開源代碼,非常好用
?? C
?? 第 1 頁 / 共 5 頁
字號:
	if (wp->path == NULL) {
		return T("");
	}

	return wp->path;
}

/******************************************************************************/
/*
 *	Return the password
 */

char_t *websGetRequestPassword(webs_t wp)
{
	a_assert(websValid(wp));

	return wp->password;
}

/******************************************************************************/
/*
 *	Return the request type
 */

char_t *websGetRequestType(webs_t wp)
{
	a_assert(websValid(wp));

	return wp->type;
}

/******************************************************************************/
/*
 *	Return the username
 */

char_t *websGetRequestUserName(webs_t wp)
{
	a_assert(websValid(wp));

	return wp->userName;
}

/******************************************************************************/
/*
 *	Get the number of bytes written
 */

int websGetRequestWritten(webs_t wp)
{
	a_assert(websValid(wp));

	return wp->written;
}

/******************************************************************************/
/*
 *	Set the hostname
 */

void websSetHost(char_t *host)
{
	gstrncpy(websHost, host, TSZ(websHost));
}

/******************************************************************************/
/*
 *	Set the host URL
 */

void websSetHostUrl(char_t *url)
{
	a_assert(url && *url);

	bfreeSafe(B_L, websHostUrl);
	websHostUrl = gstrdup(B_L, url);
}

/******************************************************************************/
/*
 *	Set the IP address
 */

void websSetIpaddr(char_t *ipaddr)
{
	a_assert(ipaddr && *ipaddr);

	gstrncpy(websIpaddr, ipaddr, TSZ(websIpaddr));
}

/******************************************************************************/
/*
 *	Set the number of bytes to write
 */

void websSetRequestBytes(webs_t wp, int bytes)
{
	a_assert(websValid(wp));
	a_assert(bytes >= 0);

	wp->numbytes = bytes;
}

/******************************************************************************/
/*
 *	Set the flags for this request
 */

void websSetRequestFlags(webs_t wp, int flags)
{
	a_assert(websValid(wp));

	wp->flags = flags;
}

/******************************************************************************/
/*
 *	Set the local path for the request
 */

void websSetRequestLpath(webs_t wp, char_t *lpath)
{
	a_assert(websValid(wp));
	a_assert(lpath && *lpath);

	if (wp->lpath) {
		bfree(B_L, wp->lpath);
	}
	wp->lpath = bstrdup(B_L, lpath);
	websSetVar(wp, T("PATH_TRANSLATED"), wp->lpath);
}

/******************************************************************************/
/*
 *	Update the URL path and the directory containing the web page
 */

void websSetRequestPath(webs_t wp, char_t *dir, char_t *path)
{
	char_t	*tmp;

	a_assert(websValid(wp));

	if (dir) { 
		tmp = wp->dir;
		wp->dir = bstrdup(B_L, dir);
		if (tmp) {
			bfree(B_L, tmp);
		}
	}
	if (path) {
		tmp = wp->path;
		wp->path = bstrdup(B_L, path);
		websSetVar(wp, T("PATH_INFO"), wp->path);
		if (tmp) {
			bfree(B_L, tmp);
		}
	}
}

/******************************************************************************/
/*
 *	Set the Write handler for this socket
 */

void websSetRequestSocketHandler(webs_t wp, int mask, void (*fn)(webs_t wp))
{
	a_assert(websValid(wp));

	wp->writeSocket = fn;
	socketCreateHandler(wp->sid, SOCKET_WRITABLE, websSocketEvent, (int) wp);
}

/******************************************************************************/
/*
 *	Set the number of bytes written
 */

void websSetRequestWritten(webs_t wp, int written)
{
	a_assert(websValid(wp));

	wp->written = written;
}

/******************************************************************************/
/*
 *	Reurn true if the webs handle is valid
 */

int websValid(webs_t wp)
{
	int		wid;

	for (wid = 0; wid < websMax; wid++) {
		if (wp == webs[wid]) {
			return 1;
		}
	}
	return 0;
}

/******************************************************************************/
/*
 *	Build an ASCII time string.  If sbuf is NULL we use the current time,
 *	else we use the last modified time of sbuf;
 */

char_t *websGetDateString(websStatType *sbuf)
{
	char_t*	cp, *r;
	time_t	now;

	if (sbuf == NULL) {
		time(&now);
	} else {
		now = sbuf->mtime;
	}
	if ((cp = gctime(&now)) != NULL) {
		cp[gstrlen(cp) - 1] = '\0';
		r = bstrdup(B_L, cp);
		return r;
	}
	return NULL;
}

/******************************************************************************/
/*
 *	Mark time. Set a timestamp so that, later, we can return the number of
 *	seconds since we made the mark. Note that the mark my not be a
 *	"real" time, but rather a relative marker.
 */

void websSetTimeMark(webs_t wp)
{
	wp->timestamp = time(0);
}

/******************************************************************************/
/*
 *	Get the number of seconds since the last mark.
 */

static int websGetTimeSinceMark(webs_t wp)
{
	return time(0) - wp->timestamp;
}

/******************************************************************************/
/*
 *	Store the new realm name
 */

void websSetRealm(char_t *realmName)
{
	a_assert(realmName);

	gstrncpy(websRealm, realmName, TSZ(websRealm));
}

/******************************************************************************/
/*
 *	Return the realm name (used for authorization)
 */

char_t *websGetRealm()
{
	return websRealm;
}


#ifdef WEBS_IF_MODIFIED_SUPPORT
/******************************************************************************/
/*	
 *	These functions are intended to closely mirror the syntax for HTTP-date 
 *	from RFC 2616 (HTTP/1.1 spec).  This code was submitted by Pete Bergstrom.
 */

/*	
 *	RFC1123Date	= wkday "," SP date1 SP time SP "GMT"
 *	RFC850Date	= weekday "," SP date2 SP time SP "GMT"
 *	ASCTimeDate	= wkday SP date3 SP time SP 4DIGIT
 *
 *	Each of these functions tries to parse the value and update the index to 
 *	the point it leaves off parsing.
 */

typedef enum { JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC } MonthEnumeration;
typedef enum { SUN, MON, TUE, WED, THU, FRI, SAT } WeekdayEnumeration;

/******************************************************************************/
/*	
 *	Parse an N-digit value
 */

static int parseNDIGIT(char_t *buf, int digits, int *index) 
{
	int tmpIndex, returnValue;

	returnValue = 0;

	for (tmpIndex = *index; tmpIndex < *index+digits; tmpIndex++) {
		if (gisdigit(buf[tmpIndex])) {
			returnValue = returnValue * 10 + (buf[tmpIndex] - T('0'));
		}
	}
	*index = tmpIndex;
	
	return returnValue;
}

/******************************************************************************/
/*
 *	Return an index into the month array
 */

static int parseMonth(char_t *buf, int *index) 
{
/*	
 *	"Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | 
 *	"Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"
 */
	int tmpIndex, returnValue;

	returnValue = -1;
	tmpIndex = *index;

	switch (buf[tmpIndex]) {
		case 'A':
			switch (buf[tmpIndex+1]) {
				case 'p':
					returnValue = APR;
					break;
				case 'u':
					returnValue = AUG;
					break;
			}
			break;
		case 'D':
			returnValue = DEC;
			break;
		case 'F':
			returnValue = FEB;
			break;
		case 'J':
			switch (buf[tmpIndex+1]) {
				case 'a':
					returnValue = JAN;
					break;
				case 'u':
					switch (buf[tmpIndex+2]) {
						case 'l':
							returnValue = JUL;
							break;
						case 'n':
							returnValue = JUN;
							break;
					}
					break;
			}
			break;
		case 'M':
			switch (buf[tmpIndex+1]) {
				case 'a':
					switch (buf[tmpIndex+2]) {
						case 'r':
							returnValue = MAR;
							break;
						case 'y':
							returnValue = MAY;
							break;
					}
					break;
			}
			break;
		case 'N':
			returnValue = NOV;
			break;
		case 'O':
			returnValue = OCT;
			break;
		case 'S':
			returnValue = SEP;
			break;
	}

	if (returnValue >= 0) {
		*index += 3;
	}

	return returnValue;
}

/******************************************************************************/
/* 
 *	Parse a year value (either 2 or 4 digits)
 */

static int parseYear(char_t *buf, int *index) 
{
	int tmpIndex, returnValue;

	tmpIndex = *index;
	returnValue = parseNDIGIT(buf, 4, &tmpIndex);

	if (returnValue >= 0) {
		*index = tmpIndex;
	} else {
		returnValue = parseNDIGIT(buf, 2, &tmpIndex);
		if (returnValue >= 0) {
/*
 *			Assume that any year earlier than the start of the 
 *			epoch for time_t (1970) specifies 20xx
 */
			if (returnValue < 70) {
				returnValue += 2000;
			} else {
				returnValue += 1900;
			}

			*index = tmpIndex;
		}
	}

	return returnValue;
}

/******************************************************************************/
/* 
 *	The formulas used to build these functions are from "Calendrical Calculations", 
 *	by Nachum Dershowitz, Edward M. Reingold, Cambridge University Press, 1997.
 */

#include <math.h>

const int GregorianEpoch = 1;

/******************************************************************************/
/*
 *  Determine if year is a leap year
 */

int GregorianLeapYearP(long year) 
{
	int		result;
	long	tmp;
	
	tmp = year % 400;

	if ((year % 4 == 0) &&
		(tmp != 100) &&
		(tmp != 200) &&
		(tmp != 300)) {
		result = TRUE;
	} else {
		result = FALSE;
	}

	return result;
}

/******************************************************************************/
/*
 *  Return the fixed date from the gregorian date
 */

long FixedFromGregorian(long month, long day, long year) 
{
	long fixedDate;

	fixedDate = (long)(GregorianEpoch - 1 + 365 * (year - 1) + 
		floor((year - 1) / 4.0) -
		floor((double)(year - 1) / 100.0) + 
		floor((double)(year - 1) / 400.0) + 
		floor((367.0 * ((double)month) - 362.0) / 12.0));

	if (month <= 2) {
		fixedDate += 0;
	} else if (TRUE == GregorianLeapYearP(year)) {
		fixedDate += -1;
	} else {
		fixedDate += -2;
	}

	fixedDate += day;

	return fixedDate;
}

/******************************************************************************/
/*
 *  Return the gregorian year from a fixed date
 */

long GregorianYearFromFixed(long fixedDate) 
{
	long result, d0, n400, d1, n100, d2, n4, d3, n1, d4, year;

	d0 =	fixedDate - GregorianEpoch;
	n400 =	(long)(floor((double)d0 / (double)146097));
	d1 =	d0 % 146097;
	n100 =	(long)(floor((double)d1 / (double)36524));
	d2 =	d1 % 36524;
	n4 =	(long)(floor((double)d2 / (double)1461));
	d3 =	d2 % 1461;
	n1 =	(long)(floor((double)d3 / (double)365));
	d4 =	(d3 % 365) + 1;
	year =	400 * n400 + 100 * n100 + 4 * n4 + n1;

	if ((n100 == 4) || (n1 == 4)) {
		result = year;
	} else {
		result = year + 1;
	}

	return result;
}

/******************************************************************************/
/* 
 *	Returns the Gregorian date from a fixed date
 *	(not needed for this use, but included for completeness
 */

#if 0
GregorianFromFixed(long fixedDate, long *month, long *day, long *year) 
{
	long priorDays, correction;

	*year =			GregorianYearFromFixed(fixedDate);
	priorDays =		fixedDate - FixedFromGregorian(1, 1, *year);

	if (fixedDate < FixedFromGregorian(3,1,*year)) {
		correction = 0;
	} else if (true == GregorianLeapYearP(*year)) {
		correction = 1;
	} else {
		correction = 2;
	}

	*month = (long)(floor((12.0 * (double)(priorDays + correction) + 373.0) / 367.0));
	*day = fixedDate - FixedFromGregorian(*month, 1, *year);
}
#endif

/******************************************************************************/
/* 
 *	Returns the difference between two Gregorian dates
 */

lon

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品久久久久久久99水蜜桃 | 日本在线观看不卡视频| 美日韩黄色大片| 99国产精品99久久久久久| 日韩精品一区在线观看| 一区二区三区成人| 成人精品在线视频观看| 精品欧美黑人一区二区三区| 亚洲综合激情小说| 成人18视频在线播放| 国产亚洲污的网站| 美女视频黄a大片欧美| 欧美人与性动xxxx| 亚洲一区二区三区小说| 99精品国产热久久91蜜凸| 国产日产欧美一区| 国产精品系列在线观看| 欧美电影免费观看高清完整版在 | 国产精品动漫网站| 国产精品自拍三区| 久久综合狠狠综合久久激情| 免费看黄色91| 欧美一卡2卡三卡4卡5免费| 亚洲狠狠丁香婷婷综合久久久| 粉嫩欧美一区二区三区高清影视| 日韩欧美不卡在线观看视频| 午夜激情久久久| 精品视频在线视频| 图片区日韩欧美亚洲| 欧美另类变人与禽xxxxx| 一区二区三区在线视频免费| 91 com成人网| 亚洲亚洲精品在线观看| 欧美日韩免费在线视频| 午夜日韩在线电影| 日韩欧美aaaaaa| 国产美女视频一区| 国产欧美日韩亚州综合| 不卡一区中文字幕| 亚洲资源在线观看| 欧美高清性hdvideosex| 精品亚洲aⅴ乱码一区二区三区| 日韩欧美在线影院| 国产一区二区不卡老阿姨| 国产女主播一区| 一本大道av伊人久久综合| 亚洲一区影音先锋| 欧美一区二区女人| 国产另类ts人妖一区二区| 国产精品国产自产拍高清av王其| 91一区二区在线观看| 午夜影视日本亚洲欧洲精品| 91精品婷婷国产综合久久性色| 激情av综合网| 综合激情网...| 在线电影院国产精品| 激情都市一区二区| 亚洲免费高清视频在线| 日韩一区二区三区视频在线观看| 国产一区二区在线视频| 亚洲丝袜美腿综合| 欧美一区永久视频免费观看| 国产精品亚洲成人| 一区二区三区欧美日韩| 精品久久国产字幕高潮| 成人激情午夜影院| 美日韩一级片在线观看| 中文字幕一区在线观看| 91精品国产一区二区三区蜜臀| 国产精品一级片| 亚洲综合一二区| 国产亚洲精品7777| 欧美日韩的一区二区| 成人性生交大合| 欧美aⅴ一区二区三区视频| 国产精品美女视频| 91精品蜜臀在线一区尤物| 91网上在线视频| 韩国午夜理伦三级不卡影院| 亚洲地区一二三色| 国产精品久久久爽爽爽麻豆色哟哟| 欧美日韩精品一区二区天天拍小说 | 丁香六月久久综合狠狠色| 亚洲高清免费在线| 自拍偷在线精品自拍偷无码专区| 亚洲欧洲国产专区| 欧美一级二级三级乱码| 在线观看国产一区二区| 成人福利在线看| 国产一区不卡在线| 日韩av电影免费观看高清完整版 | 欧美群妇大交群的观看方式| 成人美女视频在线观看18| 久久99精品一区二区三区| 亚洲综合成人网| 亚洲婷婷国产精品电影人久久| 久久久亚洲国产美女国产盗摄| 欧美高清性hdvideosex| 精品视频全国免费看| 在线亚洲高清视频| 91精品福利视频| youjizz国产精品| 国产盗摄一区二区| 国产一区二区三区香蕉| 麻豆精品在线观看| 久久成人免费电影| 免费亚洲电影在线| 久久se这里有精品| 久久精品99国产精品日本| 日韩av不卡一区二区| 亚洲成av人片观看| 亚洲mv大片欧洲mv大片精品| 一区二区视频免费在线观看| 亚洲欧美一区二区视频| 亚洲蜜臀av乱码久久精品| 国产精品乱人伦一区二区| 国产精品丝袜久久久久久app| 国产亚洲一区字幕| 中文字幕日韩一区二区| 亚洲老司机在线| 亚洲成人自拍一区| 美国十次了思思久久精品导航| 麻豆精品视频在线观看免费| 国精产品一区一区三区mba桃花 | 色美美综合视频| 2023国产精品| 国产亚洲欧美一级| 中文字幕在线不卡| 洋洋成人永久网站入口| 亚洲国产精品久久久男人的天堂| 五月婷婷综合在线| 蜜臀av一区二区在线观看| 国产另类ts人妖一区二区| 成人综合在线观看| 欧美自拍偷拍一区| 欧美一区二区三区免费大片| 久久精品网站免费观看| 亚洲日本青草视频在线怡红院| 亚洲一区二区三区小说| 精品一区二区成人精品| 成人免费视频国产在线观看| 欧美怡红院视频| 日韩欧美激情一区| 国产精品乱码妇女bbbb| 亚洲在线观看免费| 国产在线播精品第三| 91蝌蚪porny| 欧美成人三级在线| 国产精品久久久久久久午夜片| 亚洲综合丝袜美腿| 国产高清成人在线| 欧美日本国产一区| 国产精品久久久一区麻豆最新章节| 亚洲国产精品综合小说图片区| 国产剧情一区二区| 欧美日韩国产成人在线免费| 国产午夜精品久久久久久久| 亚洲亚洲人成综合网络| 高清国产一区二区| 日韩欧美国产精品一区| 中文字幕永久在线不卡| 激情五月播播久久久精品| 欧洲av在线精品| 国产精品欧美一区喷水| 麻豆中文一区二区| 欧美日本免费一区二区三区| 国产精品久久久久久久裸模| 黄网站免费久久| 欧美日韩国产123区| 亚洲欧美一区二区在线观看| 激情深爱一区二区| 欧美电影影音先锋| 一区二区三区在线观看视频| 成人午夜视频网站| 久久一日本道色综合| 偷拍与自拍一区| 在线观看视频一区二区欧美日韩| 国产日韩欧美精品在线| 韩日av一区二区| 日韩一区二区三区在线观看| 亚洲一区在线免费观看| 色综合天天天天做夜夜夜夜做| 精品日本一线二线三线不卡| 日韩高清不卡一区| 91.com视频| 日韩精品免费视频人成| 欧美性做爰猛烈叫床潮| 一区二区三区视频在线看| 99久久精品99国产精品| 国产精品丝袜91| av电影在线观看一区| 中文字幕一区二区三中文字幕| 国产久卡久卡久卡久卡视频精品| 日韩亚洲欧美在线| 美女免费视频一区二区| 精品久久久久久久人人人人传媒 | 亚洲综合激情网| 欧美性高清videossexo| 久久99精品视频| 精品人在线二区三区|