• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IOREF函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: IOREF

IoObject *IoDBI_drivers(IoDBI *self, IoObject *locals, IoMessage *m)
{
	/*doc DBI drivers
	Get a list of drivers and its associated information:

	<ol>
		<li>name</li>
		<li>description</li>
		<li>filename</li>
		<li>version</li>
		<li>date compiled</li>
		<li>maintainer</li>
		<li>url</li>
	</ol>
	*/
	IoList *list = IOREF(IoList_new(IOSTATE));
	dbi_driver driver = NULL;

	while((driver = dbi_driver_list(driver)) != NULL)
	{
		IoList *dlist = IOREF(IoList_new(IOSTATE));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_name(driver)));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_description(driver)));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_filename(driver)));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_version(driver)));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_date_compiled(driver)));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_maintainer(driver)));
		IoList_rawAppend_(dlist, IOSYMBOL(dbi_driver_get_url(driver)));

		IoList_rawAppend_(list, dlist);
	}

	return list;
}
开发者ID:BMeph,项目名称:io,代码行数:34,代码来源:IoDBI.c


示例2: IOCLONE

IoRegexMatch *IoRegexMatch_newWithRegex_subject_captureRanges_(void *state, IoRegex *regex, IoSymbol *subject, IoList *captureRanges)
{
	IoRegexMatch *self = IOCLONE(IoState_protoWithId_(state, protoId));
	DATA(self)->regex = IOREF(regex);
	DATA(self)->subject = IOREF(subject);
	DATA(self)->ranges = captureRanges;
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:8,代码来源:IoRegexMatch.c


示例3: IoObject_rawClonePrimitive

IoRegexMatch *IoRegexMatch_rawClone(IoRegexMatch *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoRegexMatchData)));
	DATA(self)->subject = IOREF(DATA(proto)->subject);
	DATA(self)->regex = IOREF(DATA(proto)->regex);
	DATA(self)->ranges = IOREF(DATA(proto)->ranges);
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:9,代码来源:IoRegexMatch.c


示例4: IoState_symbolWithUArray_copy_

void *IoFile_readFromStream_(IoFile *self, BStream *stream)
{
	IoSymbol *mode;
	IoSymbol *path = IoState_symbolWithUArray_copy_(IOSTATE, BStream_readTaggedUArray(stream), 1);
	DATA(self)->path = IOREF(path);
	mode = IoState_symbolWithUArray_copy_(IOSTATE, BStream_readTaggedUArray(stream), 1);
	DATA(self)->mode = IOREF(mode);
	return self;
}
开发者ID:achoy,项目名称:io,代码行数:9,代码来源:IoFile.c


示例5: IoState_error_

IoObject *IoSyslog_open(IoSyslog *self, IoObject *locals, IoMessage *m)
{
	/*doc Syslog open(aPriority, someOptions, optionalIdentity)
	Opens the syslog for writing. optionalIdentity need not be entered 
	and will default to the name of the distribution of Io you are running 
	or if you have embedded Io into your application and set 
	Lobby distribution = "foo", it will be set to "foo".
	*/
	 
	int syslog_facility, syslog_options;
	//int i, max;
	char *syslog_ident;

	if (DATA(self)->syslog_opened)
	{
		IoState_error_(IOSTATE, m, "System log is already open");
		return IONIL(self);
	}

	{
		DATA(self)->facility = IOREF(IoMessage_locals_numberArgAt_(m, locals, 0));
		if (ISNIL(DATA(self)->facility))
		{
			syslog_facility = LOG_USER;
		}
		else
		{
			syslog_facility = IoObject_dataUint32(DATA(self)->facility);
		}

		DATA(self)->options = IOREF(IoMessage_locals_listArgAt_(m, locals, 1));
		syslog_options = 0;
		if (ISNIL(DATA(self)->options))
		{
			syslog_options = LOG_PID | LOG_CONS;
		}
		else
		{
			List *list = IoList_rawList(DATA(self)->options);

			LIST_FOREACH(list, i, v,
				syslog_options |= (int)CNUMBER(v);
			);
		}

		syslog_ident = (char *)IOSYMBOL_BYTES(DATA(self)->ident);
		if ((strlen(syslog_ident) == 0) || ISNIL(DATA(self)->ident))
		{
			char *s = CSTRING(IoState_doCString_(IOSTATE, "Lobby distribution"));
			strncpy(syslog_ident, s, strlen(s));
		}

		openlog(syslog_ident, syslog_options, syslog_facility);
		DATA(self)->syslog_opened = 1;
		DATA(self)->syslog_mask = setlogmask(0);
		setlogmask(DATA(self)->syslog_mask);
	}
开发者ID:Akiyah,项目名称:io,代码行数:57,代码来源:IoSyslog.c


示例6: IoBlock_copy_

void IoBlock_copy_(IoBlock *self, IoBlock *other)
{
	DATA(self)->message = IOREF(DATA(other)->message);

	{
		List *l1 = DATA(self)->argNames;
		List_removeAll(l1);
		LIST_FOREACH(DATA(other)->argNames, i, v, List_append_(l1, IOREF(v)); );
	}
开发者ID:Habaut,项目名称:GameBindings,代码行数:9,代码来源:IoBlock.c


示例7: IO_METHOD

IO_METHOD(IoFile, standardInput)
{
	/*doc File standardInput
	Returns a new File whose stream is set to the standard input stream.
	*/

	IoFile *newFile = IoFile_new(IOSTATE);
	DATA(newFile)->path = IOREF(IOSYMBOL("<standard input>"));
	DATA(newFile)->mode = IOREF(IOSYMBOL("r"));
	DATA(newFile)->stream = stdin;
	DATA(newFile)->flags = IOFILE_FLAGS_NONE;
	return newFile;
}
开发者ID:achoy,项目名称:io,代码行数:13,代码来源:IoFile.c


示例8: IoObject_rawClonePrimitive

IoRegexMatches *IoRegexMatches_rawClone(IoRegexMatches *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoRegexMatchesData)));

	if (!ISNIL(DATA(proto)->regex))
		DATA(self)->regex = IOREF(DATA(proto)->regex);
	else
		DATA(self)->regex = IONIL(self);
	DATA(self)->string = IOREF(DATA(proto)->string);

	DATA(self)->captureArray = UArray_clone(DATA(proto)->captureArray);
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:14,代码来源:IoRegexMatches.c


示例9: CNUMBER

IoCFFIArray *IoCFFIArray_atPut(IoCFFIArray *self, IoObject *locals, IoMessage *m)
{
	int pos;
	IoObject *value, *arrayType, *d;
	char *ptr;

	pos = CNUMBER(IoMessage_locals_numberArgAt_(m, locals, 0));
	value = IoMessage_locals_valueArgAt_(m, locals, 1);

	if ( pos >= DATA(self)->arraySize ) {
		IoState_error_(IOSTATE, m, "index out of bounds");
		return IONIL(self);
	}

	arrayType = IoObject_getSlot_(self, IOSYMBOL("arrayType"));
	ptr = ((char *)DATA(self)->buffer) + (DATA(self)->itemSize * pos);

	d = IOCLONE(arrayType);
	IoCFFIDataType_rawSetValue(d, value);
	memcpy(ptr, (void *)IoCFFIDataType_ValuePointerFromObject_(self, d), DATA(self)->itemSize);

	if ( DATA(self)->keepValuesRefs ) {
		DATA(self)->keepValuesRefs[pos] = IOREF(d);
	}

	return self;
}
开发者ID:bomma,项目名称:io,代码行数:27,代码来源:IoCFFIArray.c


示例10: IoObject_rawClonePrimitive

IoRegex *IoRegex_rawClone(IoRegex *proto)
{
	IoObject *self = IoObject_rawClonePrimitive(proto);
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoRegexData)));
	DATA(self)->pattern = IOREF(DATA(proto)->pattern);
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:7,代码来源:IoRegex.c


示例11: IoSQLite3_justOpen

IoObject *IoSQLite3_execWithCallback(IoSQLite3 *self,
									 IoObject *locals, IoMessage *m, IoSymbol *s, ResultRowCallback *callback)
{
	IoList *results;

	if (!DATA(self)->db)
	{
		IoSQLite3_justOpen(self);

		if (!DATA(self)->db)
		{
			return IONIL(self);
		}
	}

	DATA(self)->results = IOREF(IoList_new(IOSTATE));

	if (DATA(self)->debugOn)
	{
		IoState_print_(IOSTATE, "*** %s ***\n", CSTRING(s));
	}

	{
		char *zErrMsg;
		sqlite3_exec(DATA(self)->db, CSTRING(s), callback, self, &zErrMsg);

		IoSQLite3_showError(self);
	}

	results = DATA(self)->results;
	DATA(self)->results = NULL;
	return results;
}
开发者ID:JoeyButler,项目名称:io,代码行数:33,代码来源:IoSQLite3.c


示例12: DATA

IoObject *IoRegex_namedCaptures(IoRegex *self, IoObject *locals, IoMessage *m)
{
	/*doc Regex namedCaptures
	Returns a Map that contains the index of each named group.
	*/
	
	IoMap *map = DATA(self)->namedCaptures;
	NamedCapture *namedCaptures = 0, *capture = 0;

	if (map)
		return map;

	map = DATA(self)->namedCaptures = IOREF(IoMap_new(IOSTATE));

	capture = namedCaptures = Regex_namedCaptures(IoRegex_rawRegex(self));
	
	if (!namedCaptures)
		return map;

	while (capture->name) 
	{
		IoMap_rawAtPut(map, IOSYMBOL(capture->name), IONUMBER(capture->index));
		capture++;
	}
	
	free(namedCaptures);
	return map;
}
开发者ID:ADTSH,项目名称:io,代码行数:28,代码来源:IoRegex.c


示例13: DATA

IoObject *IoFnmatch_setString(IoFnmatch *self, IoObject *locals, IoMessage *m)
{
	/*doc Fnmatch setString(aString)
	Sets the string to do matching on.
	*/

	DATA(self)->string = IOREF(IoMessage_locals_symbolArgAt_(m, locals, 0));
	return self;
}
开发者ID:anthem,项目名称:io,代码行数:9,代码来源:IoFnmatch.c


示例14: DATA

IoObject *IoFont_setPath(IoFont *self, IoObject *locals, IoMessage *m)
{
	/*doc Font setPath(aString)
	Sets the Font path. Returns self.
	*/

	DATA(self)->path = IOREF(IoMessage_locals_seqArgAt_(m, locals, 0));
	return self;
}
开发者ID:Teslos,项目名称:io,代码行数:9,代码来源:IoFont.c


示例15: DATA

IoObject *IoSQLite3_setPath(IoSQLite3 *self, IoObject *locals, IoMessage *m)
{
	/*doc SQLite3 setPath
	Sets the path to the database file. Returns self. 
	*/

	DATA(self)->path = IOREF(IoMessage_locals_symbolArgAt_(m, locals, 0));
	return self;
}
开发者ID:JoeyButler,项目名称:io,代码行数:9,代码来源:IoSQLite3.c


示例16: IoMessage_parseName

void IoMessage_parseName(IoMessage *self, IoLexer *lexer)
{
	IoToken *token = IoLexer_pop(lexer);

	DATA(self)->name = IOREF(IOSYMBOL(IoToken_name(token)));

	IoMessage_ifPossibleCacheToken_(self, token);
	IoMessage_rawSetLineNumber_(self, IoToken_lineNumber(token));
	IoMessage_rawSetCharNumber_(self, IoToken_charNumber(token));
}
开发者ID:eklitzke,项目名称:io,代码行数:10,代码来源:IoMessage_parser.c


示例17: DATA

IoObject *IoRegexMatches_setString(IoRegexMatches *self, IoObject *locals, IoMessage *m)
{
	/*doc RegexMatches setString(aString)
	Sets the string to find matches in. Returns self.
	*/
	DATA(self)->string = IOREF(IoMessage_locals_symbolArgAt_(m, locals, 0));
	DATA(self)->endPosition = IoSeq_rawSize(DATA(self)->string);
	IoRegexMatches_rawsetPosition_(self, 0);
	return self;
}
开发者ID:ADTSH,项目名称:io,代码行数:10,代码来源:IoRegexMatches.c


示例18: IoMessage_rawSetNext_

void IoMessage_rawSetNext_(IoMessage *self, IoMessage *m)
{
	DATA(self)->next = m ? IOREF(m) : NULL;

#ifdef IOMESSAGE_HASPREV
	if(m)
	{
		DATA(m)->previous = self;
	}
#endif
}
开发者ID:mikedouglas,项目名称:io,代码行数:11,代码来源:IoMessage.c


示例19: IoMessage_setCachedArg_toInt_

void IoMessage_setCachedArg_toInt_(IoMessage *self, int n, int anInt)
{
	// optimized to avoid creating a number unless necessary

	IoMessage *arg = NULL;

	while (!(arg = List_at_(DATA(self)->args, n)))
	{
		List_append_(DATA(self)->args, IOREF(IoMessage_new(IOSTATE)));
	}

	IoMessage_rawSetCachedResult_(arg, IONUMBER(anInt));
}
开发者ID:mikedouglas,项目名称:io,代码行数:13,代码来源:IoMessage.c


示例20: IoSQLite_open

IoObject *IoSQLite_execWithCallback(IoSQLite *self,
									IoObject *locals,
									IoMessage *m,
									IoSymbol *s,
									ResultRowCallback *callback)
{
	IoList *results;

	if (!DATA(self)->db)
	{
		IoSQLite_open(self, locals, m);

		if (!DATA(self)->db)
		{
			return IONIL(self);
		}
	}

	DATA(self)->results = IOREF(IoList_new(IOSTATE));

	if (DATA(self)->debugOn)
	{
		IoState_print_(IOSTATE, "*** %s ***\n", CSTRING(s));
	}

	{
		char *zErrMsg;
		int rc = sqlite_exec(DATA(self)->db, CSTRING(s), callback, self, &zErrMsg);

		if (rc != SQLITE_OK)
		{
			IoSQLite_error_(self, zErrMsg);
			IoState_error_(IOSTATE, m, zErrMsg);
		}
		else
		{
			IoSQLite_error_(self, "");
		}
	}

	results = DATA(self)->results;
	DATA(self)->results = NULL;
	return results;
}
开发者ID:Akiyah,项目名称:io,代码行数:44,代码来源:IoSQLite.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IORegistryEntryCreateCFProperties函数代码示例发布时间:2022-05-30
下一篇:
C++ IORD函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap