本文整理汇总了C++中IoState_registerProtoWithFunc_函数的典型用法代码示例。如果您正苦于以下问题:C++ IoState_registerProtoWithFunc_函数的具体用法?C++ IoState_registerProtoWithFunc_怎么用?C++ IoState_registerProtoWithFunc_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IoState_registerProtoWithFunc_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IoObject_new
IoRegexMatch *IoRegexMatch_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoRegexMatch_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoRegexMatchData)));
DATA(self)->regex = IONIL(self);
DATA(self)->subject = IOSYMBOL("");
DATA(self)->ranges = IoList_new(state);
IoState_registerProtoWithFunc_(state, self, IoRegexMatch_proto);
{
IoMethodTable methodTable[] = {
{"regex", IoRegexMatch_regex},
{"subject", IoRegexMatch_subject},
{"ranges", IoRegexMatch_ranges},
{0, 0},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例2: IoObject_new
IoMap *IoMap_proto(void *state)
{
IoMethodTable methodTable[] = {
{"empty", IoMap_empty},
{"at", IoMap_at},
{"atPut", IoMap_atPut},
{"atIfAbsentPut", IoMap_atIfAbsentPut},
{"size", IoMap_size},
{"keys", IoMap_keys},
{"values", IoMap_values},
{"foreach", IoMap_foreach},
{"hasKey", IoMap_hasKey},
{"hasValue", IoMap_hasValue},
{"removeAt", IoMap_removeAt},
{NULL, NULL},
};
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoMap_newTag(state));
IoObject_setDataPointer_(self, PHash_new());
IoState_registerProtoWithFunc_((IoState *)state, self, IoMap_proto);
IoObject_addMethodTable_(self, methodTable);
return self;
}
示例3: IoObject_new
IoYajlGen *IoYajlGen_proto(void *state)
{
IoYajlGen *self = IoObject_new(state);
IoObject_tag_(self, IoYajlGen_newTag(state));
yajl_gen_config config = { 0, "" };
IoObject_setDataPointer_(self, yajl_gen_alloc(&config, NULL));
IoState_registerProtoWithFunc_(state, self, IoYajlGen_proto);
{
IoMethodTable methodTable[] =
{
{"pushNull", IoYajlGen_pushNull},
{"pushString", IoYajlGen_pushString},
{"pushInteger", IoYajlGen_pushInteger},
{"pushDouble", IoYajlGen_pushDouble},
{"pushNumberString", IoYajlGen_pushNumberString},
{"pushBool", IoYajlGen_pushBool},
{"openMap", IoYajlGen_openMap},
{"closeMap", IoYajlGen_closeMap},
{"openArray", IoYajlGen_openArray},
{"closeArray", IoYajlGen_closeArray},
{"generate", IoYajlGen_generate},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例4: IoObject_new
IoCairoSurfacePattern *IoCairoSurfacePattern_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoSurfacePattern_newTag(state));
IoState_registerProtoWithFunc_(state, self, IoCairoSurfacePattern_proto);
IoCairoPattern_addMethods(self);
{
IoMethodTable methodTable[] = {
{"create", IoCairoSurfacePattern_create},
{"getSurface", IoCairoSurfacePattern_getSurface},
{"setExtend", IoCairoSurfacePattern_setExtend},
{"getExtend", IoCairoSurfacePattern_getExtend},
{"setFilter", IoCairoSurfacePattern_setFilter},
{"getFilter", IoCairoSurfacePattern_getFilter},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例5: IoCFFIDataType_new
IoCFFIPointer *IoCFFIPointer_proto(void *state)
{
IoObject *self = IoCFFIDataType_new(state);
IoObject_tag_(self, IoCFFIPointer_newTag(state));
IoObject_setSlot_to_(self, IOSYMBOL("pointers"), IoMap_new(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoCFFIPointerData)));
memset(DATA(self), 0, sizeof(IoCFFIPointerData));
DATA(self)->valuePointer = &(DATA(self)->ptr);
IoState_registerProtoWithFunc_(state, self, IoCFFIPointer_proto);
{
IoMethodTable methodTable[] = {
{"address", IoCFFIPointer_address},
{"asBuffer", IoCFFIPointer_asBuffer},
{"at", IoCFFIPointer_at},
{"atPut", IoCFFIPointer_atPut},
{"castTo", IoCFFIPointer_castTo},
{"value", IoCFFIPointer_value},
{"setValue", IoCFFIPointer_setValue},
{"toType", IoCFFIPointer_toType},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例6: IoObject_new
IoAudioDevice *IoAudioDevice_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoAudioDevice_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoAudioDeviceData)));
DATA(self)->writeBuffer = IoSeq_new(state);
DATA(self)->readBuffer = IoSeq_new(state);
DATA(self)->audioDevice = AudioDevice_new();
IoState_registerProtoWithFunc_(state, self, IoAudioDevice_proto);
{
IoMethodTable methodTable[] = {
{"open", IoAudioDevice_open},
{"openForReadingAndWriting", IoAudioDevice_openForReadingAndWriting},
{"close", IoAudioDevice_close},
{"asyncWrite", IoAudioDevice_asyncWrite},
{"asyncRead", IoAudioDevice_read},
{"error", IoAudioDevice_error},
{"isActive", IoAudioDevice_isActive},
{"streamTime", IoAudioDevice_streamTime},
{"needsData", IoAudioDevice_needsData},
{"writeBufferIsEmpty", IoAudioDevice_writeBufferIsEmpty},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例7: IoObject_new
IoEvDNSRequest *IoEvDNSRequest_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoEvDNSRequest_newTag(state));
IoObject_setDataPointer_(self, 0x0);
IoState_registerProtoWithFunc_((IoState *)state, self, IoEvDNSRequest_proto);
{
IoMethodTable methodTable[] = {
{"resolveIPv4", IoEvDNSRequest_resolveIPv4},
/*
{"resolveIPv6", IoEvDNSRequest_resolveIPv6},
{"resolveReverseIPv4", IoEvDNSRequest_resolveReverseIPv4},
{"resolveReverseIPv6", IoEvDNSRequest_resolveReverseIPv6},
*/
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例8: IoObject_new
IoObject *IoMemcached_proto(void *state)
{
IoMemcached *self = IoObject_new(state);
IoObject_tag_(self, IoMemcached_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoMemcachedData)));
IoState_registerProtoWithFunc_(state, self, IoMemcached_proto);
{
IoMethodTable methodTable[] = {
{"addServer", IoMemcached_addServer},
{"set", IoMemcached_set},
{"add", IoMemcached_add},
{"replace", IoMemcached_replace},
{"append", IoMemcached_append},
{"prepend", IoMemcached_prepend},
{"get", IoMemcached_get},
{"getMulti", IoMemcached_getMulti},
{"delete", IoMemcached_delete},
{"flushAll", IoMemcached_flushAll},
{"incr", IoMemcached_incr},
{"decr", IoMemcached_decr},
{"stats", IoMemcached_stats},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例9: IoObject_new
// _proto creates the first-ever instance of the prototype
IoObject *IoCInvokeStructureInstance_proto(void *state)
{
// First we allocate a new IoObject
IoCInvokeStructureInstance *self = IoObject_new(state);
// Then tag it
IoObject_tag_(self, IoCInvokeStructureInstance_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoCInvokeStructureInstanceData)));
// then register this proto generator
IoState_registerProtoWithFunc_(state, self, IoCInvokeStructureInstance_proto);
// and finally, define the table of methods this proto supports
// we just have one method here, returnSelf, then terminate the array
// with NULLs
{
IoMethodTable methodTable[] = {
{"setValue", IoCInvokeStructureInstance_setValue},
{"setLibrary", IoCInvokeStructureInstance_setLibrary},
{"getValue", IoCInvokeStructureInstance_getValue},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例10: IoObject_new
IoODEBox *IoODEBox_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoODEBox_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoODEBoxData)));
GEOMID = 0;
IoState_registerProtoWithFunc_(state, self, IoODEBox_proto);
{
IoMethodTable methodTable[] = {
{"geomId", IoODEBox_geomId},
{"lengths", IoODEBox_lengths},
{"setLengths", IoODEBox_setLengths},
{"pointDepth", IoODEBox_pointDepth},
{"body", IoODEBox_body},
{"setBody", IoODEBox_setBody},
{"collide", IoODEGeom_collide},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例11: IoObject_new
IoSkipDBM *IoSkipDBM_proto(void *state)
{
IoMethodTable methodTable[] = {
{"setPath", IoSkipDBM_setPath},
{"path", IoSkipDBM_path},
{"open", IoSkipDBM_open},
{"close", IoSkipDBM_close},
{"isOpen", IoSkipDBM_isOpen},
{"delete", IoSkipDBM_delete},
{"root", IoSkipDBM_root},
{"begin", IoSkipDBM_beginTransaction},
{"commit", IoSkipDBM_commitnTransaction},
//{"at", IoSkipDBM_at},
{"compact", IoSkipDBM_compact},
{NULL, NULL},
};
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoSkipDBM_newTag(state));
IoObject_setDataPointer_(self, SkipDBM_new());
IoState_registerProtoWithFunc_((IoState *)state, self, IoSkipDBM_proto);
IoObject_addMethodTable_(self, methodTable);
return self;
}
示例12: IoObject_new
IoCairoFontOptions *IoCairoFontOptions_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoFontOptions_newTag(state));
IoState_registerProtoWithFunc_(state, self, IoCairoFontOptions_proto);
{
IoMethodTable methodTable[] = {
{"create", IoCairoFontOptions_create},
{"merge", IoCairoFontOptions_merge},
{"setAntialias", IoCairoFontOptions_setAntialias},
{"getAntialias", IoCairoFontOptions_getAntialias},
{"getSubpixelOrder", IoCairoFontOptions_getSubpixelOrder},
{"setSubpixelOrder", IoCairoFontOptions_setSubpixelOrder},
{"setHintStyle", IoCairoFontOptions_setHintStyle},
{"getHintStyle", IoCairoFontOptions_getHintStyle},
{"setHintMetrics", IoCairoFontOptions_setHintMetrics},
{"getHintMetrics", IoCairoFontOptions_getHintMetrics},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例13: printf
// _proto creates the first-ever instance of the prototype
IoObject *IoSVN_proto(void *state)
{
printf("IoSVN_proto\n");
// First we allocate a new IoObject
IoSVNObject *self = IoObject_new(state);
// Then tag it
IoObject_tag_(self, IoSVN_newTag(state));
SVN_init();
// then register this proto generator
IoState_registerProtoWithFunc_(state, self, IoSVN_proto);
// and finally, define the table of methods this proto supports
// we just have one method here, returnSelf, then terminate the array
// with NULLs
{
IoMethodTable methodTable[] = {
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
//IoObject_setSlog_to_(self, IOSYMBOIL("HEAD"), IONUMBER());
return self;
}
示例14: IoObject_new
IoODEHinge *IoODEHinge_proto(void *state)
{
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoODEHinge_newTag(state));
IoODEJoint_protoCommon(self);
IoState_registerProtoWithFunc_(state, self, IoODEHinge_proto);
{
IoMethodTable methodTable[] = {
ODE_COMMON_JOINT_METHODS
#define PARAM(X, _N, _SETN) \
{#_N, IoODEHinge_##_N}, \
{#_SETN, IoODEHinge_##_SETN},
PARAMS
#undef PARAM
{"anchor", IoODEHinge_anchor},
{"setAnchor", IoODEHinge_setAnchor},
{"anchor2", IoODEHinge_anchor2},
{"axis", IoODEHinge_axis},
{"setAxis", IoODEHinge_setAxis},
{"angle", IoODEHinge_angle},
{"angleRate", IoODEHinge_angleRate},
{"addTorque", IoODEHinge_addTorque},
{NULL, NULL},
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}
示例15: IoObject_new
IoClutterColor *IoClutterColor_proto(void *state) {
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoClutterColor_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoClutterColorData)));
IoState_registerProtoWithFunc_(state, self, IoClutterColor_proto);
{
IoMethodTable methodTable[] = {
{"==", IoClutterColor_equals},
{"!=", IoClutterColor_notEquals},
{"with", IoClutterColor_fromString},
{"asString", IoClutterColor_asString},
{"withHLS", IoClutterColor_fromHLS},
{"toHLS", IoClutterColor_toHLS},
{"withPixel", IoClutterColor_fromPixel},
{"toPixel", IoClutterColor_toPixel},
{"+", IoClutterColor_add},
{"-", IoClutterColor_subtract},
{"addInPlace", IoClutterColor_addInPlace},
{"subtractInPlace", IoClutterColor_subtractInPlace},
{"lighten", IoClutterColor_lighten},
{"darken", IoClutterColor_darken},
{"shade", IoClutterColor_shade},
{NULL, NULL}
};
IoObject_addMethodTable_(self, methodTable);
}
return self;
}