本文整理汇总了C++中IOREF函数的典型用法代码示例。如果您正苦于以下问题:C++ IOREF函数的具体用法?C++ IOREF怎么用?C++ IOREF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IOREF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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)); );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}