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

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

?? property.cpp

?? GNU ccScript is a C++ class framework for creating a virtual machine execution system for use with a
?? CPP
字號:
// Copyright (C) 2005 David Sugar, Tycho Softworks.//  // This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.// // As a special exception, you may use this file as part of a free software// library without restriction.  Specifically, if other files instantiate// templates or use macros or inline functions from this file, or you compile// this file and link it with other files to produce an executable, this// file does not by itself cause the resulting executable to be covered by// the GNU General Public License.  This exception does not however// invalidate any other reasons why the executable file might be covered by// the GNU General Public License.//// This exception applies only to the code released under the name GNU// ccScript.  If you copy code from other releases into a copy of GNU// ccScript, as the General Public License permits, the exception does// not apply to the code that you add in this way.  To avoid misleading// anyone as to the status of such modified files, you must delete// this exception notice from them.//// If you write modifications of your own for GNU ccScript, it is your choice// whether to permit this exception to apply to your modifications.// If you do not wish that, delete this exception notice.//#include "script3.h"#include <cstdio>#ifdef	WIN32#define	EXT_PROP	".pro"#define	EXT_TEMP	".tmp"#define	PRE_PROP	"\\Script Properties\\"#define	PRE_MAKE	"\\Script Properties"#else#define	EXT_PROP	".init"#define	EXT_TEMP	".temp"#define PRE_PROP	"/.properties/"#define	PRE_MAKE	"/.properties"#endif#define	MAX_LIST	256namespace ccscript3Extension {using namespace std;using namespace ost;		class LoadThread : public ScriptThread{private:	FILE *fp;	Symbol *list[MAX_LIST];	char path[128];	char var[128];	void run(void);public:	LoadThread(ScriptInterp *interp);	~LoadThread();};class SaveThread : public ScriptThread{private:        FILE *fp, *fr;        Symbol *list[MAX_LIST];	char path[128];	char temp[128];	char var[128];	const char *id;        void run(void);public:        SaveThread(ScriptInterp *interp, const char *uid);        ~SaveThread();};	class PropertyChecks : public ScriptChecks{public:	const char *chkIO(Line *line, ScriptImage *img);	const char *chkVar(Line *line, ScriptImage *img);};class PropertyMethods : public ScriptMethods{public:	bool scrLoad(void);	bool scrSave(void);	bool scrVar(void);};class PropertyBinder : public ScriptBinder{public:	PropertyBinder(Script::Define *run);};static Script::Define runtime[] = {	{"load", false, (Script::Method)&PropertyMethods::scrLoad,		(Script::Check)&PropertyChecks::chkIO},        {"save", false, (Script::Method)&PropertyMethods::scrSave,                (Script::Check)&PropertyChecks::chkIO},        {"prop", true, (Script::Method)&PropertyMethods::scrVar,                (Script::Check)&PropertyChecks::chkVar},        {"property", true, (Script::Method)&PropertyMethods::scrVar,                (Script::Check)&PropertyChecks::chkVar},			{NULL, false, NULL, NULL}};PropertyBinder::PropertyBinder(Script::Define *run) :ScriptBinder(run){	char path[128];	if(*Script::var_prefix != '.')	{		snprintf(path, sizeof(path), "%s" PRE_MAKE, 			Script::var_prefix);		Dir::create(path);	}}static PropertyBinder bindProperty(runtime);LoadThread::LoadThread(ScriptInterp *interp) :ScriptThread(interp, 0){	fp = NULL;}SaveThread::SaveThread(ScriptInterp *interp, const char *uid) :ScriptThread(interp, 0){        fp = NULL;	fr = NULL;	id = uid;}LoadThread::~LoadThread(){	terminate();	if(fp)		::fclose(fp);}SaveThread::~SaveThread(){        terminate();        if(fp)                ::fclose(fp);                	if(fr)		::fclose(fr);}void SaveThread::run(void){	char prof[128];	char buf[128];	const char *grp = interp->getMember();	const char *cp;	char *ep;	Symbol *sym;	unsigned idx = 0, count;	char base[64];	Name *scr = interp->getName();	if(!grp)	{		setString(base, sizeof(base), scr->name); 		ep = strchr(base, ':');		if(ep)			*ep = 0;		grp = base;	}	#ifdef	WIN32	if(*Script::var_prefix == '.')	{		snprintf(temp, sizeof(temp), "%s%s" EXT_TEMP, grp, id);		snprintf(path, sizeof(path), "%s%s" EXT_PROP, grp, id);	}	else	{		snprintf(temp, sizeof(temp), "%s" PRE_PROP "%s%s" EXT_TEMP,			Script::var_prefix, grp, id);		snprintf(path, sizeof(path), "%s" PRE_PROP "%s%s" EXT_PROP,			Script::var_prefix, grp, id);	}#else	if(*Script::var_prefix == '.')	{        	snprintf(path, sizeof(path), "%s.%s", grp, id);        	snprintf(temp, sizeof(temp), ".%s.%s", grp, id);	}	else	{		snprintf(temp, sizeof(temp), "%s" PRE_PROP ".%s.%s",			Script::var_prefix, grp, id);		snprintf(path, sizeof(path), "%s" PRE_PROP "%s.%s",			Script::var_prefix, grp, id);	}#endif	snprintf(prof, sizeof(prof), "%s/%s" EXT_PROP, Script::etc_prefix, grp);	remove(temp);	fp = ::fopen(temp, "w");	if(!fp)                    		exit("save-failed");		fr = ::fopen(path, "r");	if(!fr)		fr = ::fopen(prof, "r");			while(fr)	{		if(!fgets(buf, sizeof(buf), fr) || feof(fr))			break;					cp = buf;                while(isspace(*cp))                        ++cp;                if(!isalpha(*cp))                        continue;                ep = strrchr(buf, '\r');                if(!ep)                        ep = strrchr(buf, '\n');                if(ep)                        *ep = 0;                ep = (char *)cp;                while(isalnum(*ep))                        ++ep;                *(ep++) = 0;                while(isspace(*ep) || *ep == '=')                        ++ep;                snprintf(var, sizeof(var), "%s.%s", grp, cp);		lock();                sym = interp->mapSymbol(var, 0);		if(sym && sym->type == symMODIFIED)		{			fprintf(fp, "%s = %s\n", cp, sym->data);			sym->type = symORIGINAL;		}		else			fprintf(fp, "%s = %s\n", cp, ep);		release();		Thread::yield();	}		lock();	count = interp->gathertype(list, MAX_LIST - 1, grp, symMODIFIED);	release();	while(idx < count)	{		sym = list[idx++];		sym->type = symORIGINAL;		cp = strrchr(sym->id, '.');		if(!cp)			continue;		fprintf(fp, "%s = %s\n", ++cp, sym->data);		Thread::yield();	}		::fflush(fp);	rename(temp, path);		exit(NULL);}void LoadThread::run(void){	const char *id;	const char *grp = interp->getMember();	char *cp;	char *ep;	Symbol *sym;	char base[64];	Name *scr = interp->getName();	unsigned count, idx = 0;	if(!grp)	{		setString(base, sizeof(base), scr->name); 		ep = strchr(base, ':');		if(ep)			*ep = 0;		grp = base;	}	lock();	id = interp->getKeyword("id");	idx = 0;	count = interp->gathertype(list, MAX_LIST - 1, grp, symMODIFIED);	while(idx < count)	{		sym = list[idx++];		sym->data[0] = 0;		sym->type = symORIGINAL;	}	idx = 0;        count = interp->gathertype(list, MAX_LIST - 1, grp, symORIGINAL);        while(idx < count)        {                sym = list[idx++];                sym->data[0] = 0;        }	release();	if(id && *id)	{#ifdef	WIN32		if(*Script::var_prefix == '.')			snprintf(path, sizeof(path), "%s%s" EXT_PROP, grp, id);		else			snprintf(path, sizeof(path), "%s" PRE_PROP "%s%s" EXT_PROP,				Script::var_prefix, grp, id);#else                if(*Script::var_prefix == '.')                        snprintf(path, sizeof(path), "%s.%s", grp, id);                else                        snprintf(path, sizeof(path), "%s" PRE_PROP "%s.%s",                                Script::var_prefix, grp, id);#endif		fp = ::fopen(path, "r");		if(fp)			goto load;	}		snprintf(path, sizeof(path), "%s/%s" EXT_PROP, Script::etc_prefix, grp);	fp = ::fopen(path, "r");	if(!fp)		exit("load-failed");			load:	for(;;)	{		if(!fgets(path, sizeof(path), fp) || feof(fp))			break;		cp = path;		while(isspace(*cp))			++cp;		if(!isalpha(*cp))			continue;		ep = strrchr(path, '\r');		if(!ep)			ep = strrchr(path, '\n');		if(ep)			*ep = 0;		ep = cp;		while(isalnum(*ep))			++ep;		*(ep++) = 0;		while(isspace(*ep) || *ep == '=')			++ep;		snprintf(var, sizeof(var), "%s.%s", grp, cp);		lock();		sym = interp->mapSymbol(var, 0);		if(!sym)			goto unlock;		if(sym->type != symORIGINAL && sym->type != symMODIFIED)			goto unlock;		sym->type = symORIGINAL;		snprintf(sym->data, sym->size + 1, ep);unlock:		release();		Thread::yield();	}			exit(NULL);}bool PropertyMethods::scrVar(void){	char base[64];	char var[128];	Symbol *sym;	const char *cp;	const char *prefix = getMember();	char *ep;	unsigned len;	Name *scr = getName();	if(!prefix)	{		setString(base, sizeof(base), scr->name); 		ep = strchr(base, ':');		if(ep)			*ep = 0;		prefix = base;	}	while(NULL != (cp = getOption()))	{		if(strchr(cp, '.') || *cp == '%' || *cp == '&')			setString(var, sizeof(var), cp);		else			snprintf(var, sizeof(var), "%s.%s", prefix, cp);		ep = strrchr(var, ':');		if(ep)		{			*(ep++) = 0;			len = atoi(ep);		}		else			len = symsize;		sym = mapSymbol(var, len);		if(!sym)			continue;		if(sym->type != symINITIAL)			continue;		sym->type = symORIGINAL;	}	advance();	return true;}	bool PropertyMethods::scrLoad(void){	release();	new LoadThread(dynamic_cast<ScriptInterp*>(this));	return false;}bool PropertyMethods::scrSave(void){	const char *id = getKeyword("id");	if(!id || !*id)	{		error("save-missing-id");		return true;	}	release();        new SaveThread(dynamic_cast<ScriptInterp*>(this), id);        return false;}const char *PropertyChecks::chkVar(Line *line, ScriptImage *img){	unsigned idx = 0;	const char *cp;	if(hasKeywords(line))		return "property uses no keywords";	if(!line->argc)		return "property requires arguments";	while(NULL != (cp = getOption(line, &idx)))	{		if(*cp == '&' || *cp == '%')			goto chksize;		if(!isalpha(*cp))			return "property must be field name";		if(strchr(cp, '.'))			return "field must not be compound";chksize:		cp = strrchr(cp, ':');		if(!cp)			continue;		++cp;		if(!isdigit(*cp))			return "field size must be number";	}	return NULL;}const char *PropertyChecks::chkIO(Line *line, ScriptImage *img){		unsigned idx = 0;	//	if(!getMember(line))//		return "property requires .group";			if(!useKeywords(line, "=id"))		return "invalid keyword used";		if(getOption(line, &idx))		return "property io uses no arguments";			return NULL;}};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产91久久久久久一区二区| 91丨九色丨尤物| 亚洲成人免费电影| 1024成人网| 日韩毛片视频在线看| 国产精品美女久久久久av爽李琼 | 国精产品一区一区三区mba视频| 日韩av高清在线观看| 日本怡春院一区二区| 蜜桃视频在线一区| 久久激情五月激情| 国产激情偷乱视频一区二区三区 | 国产精品免费人成网站| 国产欧美一区二区三区鸳鸯浴| 国产性做久久久久久| 日本一区免费视频| 亚洲视频免费在线观看| 一区二区三区中文字幕精品精品 | 久久综合色8888| 日本一区二区三区久久久久久久久不| 国产亚洲一区二区在线观看| 日本一区二区免费在线| 亚洲免费观看在线视频| 天天操天天综合网| 精品一区中文字幕| 成人高清视频在线| 欧洲亚洲国产日韩| 91精品一区二区三区久久久久久 | 92精品国产成人观看免费| 在线欧美日韩国产| 欧美大黄免费观看| 欧美国产综合色视频| 一区二区三区在线免费| 精品中文字幕一区二区小辣椒| 不卡av在线网| 在线播放欧美女士性生活| 国产亚洲欧美色| 亚洲一区二区四区蜜桃| 国内精品在线播放| 欧美日韩一区二区三区视频| 精品精品欲导航| 亚洲理论在线观看| 国产精品1024| 欧美精品一二三| 亚洲色图另类专区| 精品亚洲aⅴ乱码一区二区三区| fc2成人免费人成在线观看播放 | 国产福利精品一区二区| 欧美在线观看禁18| 中文字幕第一页久久| 日韩精品三区四区| 色综合天天综合网国产成人综合天| 欧美大肚乱孕交hd孕妇| 亚洲综合久久av| 波波电影院一区二区三区| 日韩亚洲国产中文字幕欧美| 一卡二卡欧美日韩| 懂色av一区二区三区免费看| 精品乱人伦小说| 视频一区二区三区入口| 在线一区二区视频| 亚洲视频小说图片| 成人91在线观看| 国产清纯白嫩初高生在线观看91 | 一区二区三区在线观看欧美| 国产成人免费在线| 欧美不卡视频一区| 久久激情五月激情| 欧美一区二区黄| 日韩va亚洲va欧美va久久| 欧洲激情一区二区| 最好看的中文字幕久久| av影院午夜一区| 欧美国产在线观看| k8久久久一区二区三区 | 亚洲欧美日韩国产手机在线| 国产白丝精品91爽爽久久| 久久伊人中文字幕| 国产成都精品91一区二区三| 国产欧美日韩亚州综合| 国产成人精品一区二| 国产欧美精品区一区二区三区| 国产剧情在线观看一区二区| 久久精子c满五个校花| 国产九九视频一区二区三区| 久久精品夜夜夜夜久久| 成人免费看的视频| 亚洲美女淫视频| 欧美中文字幕亚洲一区二区va在线 | 视频一区视频二区中文字幕| 欧美裸体一区二区三区| 免费人成在线不卡| 久久女同互慰一区二区三区| 成人av资源在线| 亚洲另类春色国产| 欧美一级黄色录像| 国产精品乡下勾搭老头1| 国产精品成人一区二区艾草| 在线精品视频一区二区三四 | 日本亚洲三级在线| 日韩精品中文字幕一区二区三区| 国模少妇一区二区三区| 国产精品久久久久aaaa樱花| 欧亚一区二区三区| 精品一区二区在线免费观看| 国产精品色哟哟| 91麻豆精品国产91久久久久久| 国产麻豆视频精品| 一区二区欧美在线观看| 日韩亚洲欧美成人一区| 99久久er热在这里只有精品66| 亚洲高清不卡在线| 久久午夜免费电影| 欧美色综合网站| 国产一区不卡视频| 亚洲午夜在线观看视频在线| 欧美大度的电影原声| 91在线视频免费观看| 看电视剧不卡顿的网站| 亚洲激情一二三区| 久久众筹精品私拍模特| 欧美日韩中文国产| 懂色av一区二区夜夜嗨| 蜜臀91精品一区二区三区| 亚洲色图视频网站| 国产午夜精品一区二区三区嫩草| 精品视频123区在线观看| 成人教育av在线| 久久国产剧场电影| 亚洲成av人片一区二区梦乃| 国产精品你懂的在线欣赏| 欧美videos大乳护士334| 欧美性生活一区| 99久久免费视频.com| 国产在线视视频有精品| 日本中文字幕一区二区视频 | 午夜影院久久久| 日韩美女视频一区二区| 国产午夜精品久久久久久免费视| 欧美一区二区人人喊爽| 欧美日韩中文字幕一区| 在线这里只有精品| 91网站最新地址| 成人黄色电影在线| 国产一区二区按摩在线观看| 美女一区二区在线观看| 天天色天天操综合| 午夜精品在线视频一区| 亚洲一区在线观看视频| 亚洲男人电影天堂| 中文字幕一区二区三区不卡 | 久久国产精品一区二区| 免费欧美在线视频| 日本不卡123| 美女网站色91| 蜜芽一区二区三区| 日韩av电影免费观看高清完整版 | 成人av动漫在线| 粉嫩av一区二区三区| 成人免费精品视频| aaa欧美大片| 色婷婷综合久色| 欧美综合久久久| 欧美精三区欧美精三区| 日韩一区二区三区四区| 精品久久久久久久人人人人传媒| 久久综合色天天久久综合图片| 精品处破学生在线二十三| 久久精品视频在线免费观看 | 欧洲精品中文字幕| 欧美私人免费视频| 91麻豆精品国产91久久久资源速度 | 中文字幕一区二区在线观看| 亚洲三级在线播放| 亚洲国产精品一区二区www | 久久久99免费| 国产精品久久一级| 亚洲精选视频在线| 秋霞电影网一区二区| 成人一二三区视频| 色94色欧美sute亚洲线路二| 91精品久久久久久久99蜜桃 | 欧美在线播放高清精品| 欧美一区午夜视频在线观看| 久久综合国产精品| 亚洲精品欧美综合四区| 蜜臀av性久久久久蜜臀aⅴ| 国产精品夜夜爽| 精品视频一区 二区 三区| 精品毛片乱码1区2区3区| 亚洲精品免费电影| 秋霞午夜av一区二区三区| 99麻豆久久久国产精品免费| 91.com在线观看| 国产精品女主播在线观看| 亚洲成人在线网站| av在线一区二区三区| 精品奇米国产一区二区三区| 亚洲麻豆国产自偷在线| 国产在线播放一区二区三区|