Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved addons to use IoState_registerProtoWithId_() and IoState_protoW…

…ithId_()
  • Loading branch information...
commit fe9b43c0e6ad3b9a9ac52ea3b748bc71b819ab9d 1 parent bd0df87
@stevedekorte authored
Showing with 2,124 additions and 2,711 deletions.
  1. +4 −3 addons/AVCodec/source/IoAVCodec.c
  2. +4 −2 addons/AppleExtras/source/IoAppleSensors.c
  3. +5 −3 addons/AsyncRequest/source/IoAsyncRequest.c
  4. +5 −3 addons/BigNum/source/IoBigNum.c
  5. +3 −3 addons/Blowfish/source/IoBlowfish.c
  6. +3 −3 addons/Box/source/IoBox.c
  7. +0 −745 addons/Curses/source/IoCurses.c
  8. +0 −79 addons/Curses/source/IoCurses.h
  9. +4 −2 addons/DBI/source/IoDBI.c
  10. +5 −3 addons/DBI/source/IoDBIConn.c
  11. +5 −6 addons/DBI/source/IoDBIResult.c
  12. +5 −3 addons/Fnmatch/source/IoFnmatch.c
  13. +5 −3 addons/Font/source/IoFont.c
  14. +9 −5 addons/GLFW/source/IoGLFW.c
  15. +5 −3 addons/Image/source/IoImage.c
  16. +5 −3 addons/LZO/source/IoLZODecoder.c
  17. +2 −0  addons/LZO/source/IoLZODecoder.h
  18. +5 −3 addons/LZO/source/IoLZOEncoder.c
  19. +2 −0  addons/LZO/source/IoLZOEncoder.h
  20. +5 −3 addons/LibSndFile/source/IoLibSndFile.c
  21. +5 −3 addons/Libxml2/source/IoXmlWriter.c
  22. +3 −1 addons/Loki/source/IoLinker.c
  23. +3 −3 addons/MD5/source/IoMD5.c
  24. +4 −2 addons/ODE/source/IoODEBall.c
  25. +6 −4 addons/ODE/source/IoODEBody.c
  26. +5 −3 addons/ODE/source/IoODEBox.c
  27. +6 −4 addons/ODE/source/IoODEContact.c
  28. +4 −2 addons/ODE/source/IoODEContactJoint.c
  29. +4 −2 addons/ODE/source/IoODEFixed.c
  30. +4 −2 addons/ODE/source/IoODEHinge.c
  31. +3 −1 addons/ODE/source/IoODEHinge2.c
  32. +5 −3 addons/ODE/source/IoODEJoint.c
  33. +5 −3 addons/ODE/source/IoODEJointGroup.c
  34. +4 −2 addons/ODE/source/IoODEMass.c
  35. +3 −1 addons/ODE/source/IoODEPlane.c
  36. +5 −2 addons/ODE/source/IoODESimpleSpace.c
  37. +3 −1 addons/ODE/source/IoODESlider.c
  38. +3 −1 addons/ODE/source/IoODEUniversal.c
  39. +5 −3 addons/ODE/source/IoODEWorld.c
  40. +3 −3 addons/ObjcBridge/source/Io2Objc.m
  41. +3 −3 addons/ObjcBridge/source/IoObjcBridge.m
  42. +6 −4 addons/Ogg/source/IoOggPacket.c
  43. +5 −4 addons/Ogg/source/IoOggPage.c
  44. +5 −4 addons/Ogg/source/IoOggStreamState.c
  45. +5 −4 addons/Ogg/source/IoOggSyncState.c
  46. +1 −1  addons/OpenGL/source/IoBox_gl.c
  47. +5 −3 addons/OpenGL/source/IoGLScissor.c
  48. +12 −6 addons/OpenGL/source/IoGLU.c
  49. +5 −6 addons/OpenGL/source/IoGLUQuadric.c
  50. +5 −4 addons/OpenGL/source/IoGLUT.c
  51. +13 −9 addons/OpenGL/source/new/IoGLE.c
  52. +4 −3 addons/OpenGL/source/new/IoSceneNode.c
  53. +6 −4 addons/PortAudio/source/IoAudioDevice.c
  54. +5 −3 addons/PortAudio/source/new/IoAudioMixer.c
  55. +4 −3 addons/PortAudio/source/new/IoAudioTrack.c
  56. +5 −3 addons/PortAudio/source/new/IoMP3Decoder.c
  57. +5 −3 addons/PortAudio/source/new/IoMP3Encoder.c
  58. +5 −2 addons/Python/source/IoPython.c
  59. +4 −2 addons/QDBM/source/IoQDBM.c
  60. +2 −0  addons/Random/source/IoRandom.c
  61. +6 −3 addons/Range/source/IoRange.c
  62. +18 −5 addons/Regex/source/IoRegex.c
  63. +4 −3 addons/SGML/source/IoSGMLParser.c
  64. +4 −3 addons/SHA1/source/IoSHA1.c
  65. +4 −3 addons/SQLite/source/IoSQLite.c
  66. +4 −3 addons/SQLite3/source/IoSQLite3.c
  67. +5 −3 addons/SampleRateConverter/source/IoSampleRateConverter.c
  68. +4 −3 addons/SkipDB/source/IoSkipDB.c
  69. +4 −3 addons/SkipDB/source/IoSkipDBCursor.c
  70. +4 −3 addons/SkipDB/source/IoSkipDBM.c
  71. +3 −3 addons/Socket/source/IoEvConnection.c
  72. +3 −3 addons/Socket/source/IoEvHttpServer.c
  73. +3 −3 addons/Socket/source/IoEvOutRequest.c
  74. +3 −3 addons/Socket/source/IoEvOutResponse.c
  75. +4 −4 addons/Socket/source/IoEvent.c
  76. +3 −3 addons/Socket/source/IoEventManager.c
  77. +3 −3 addons/Socket/source/IoIPAddress.c
  78. +3 −3 addons/Socket/source/IoSocket.c
  79. +3 −3 addons/Socket/source/IoUnixPath.c
  80. +4 −3 addons/SoundTouch/source/IoSoundTouch.c
  81. +5 −3 addons/Syslog/source/IoSyslog.c
  82. +3 −3 addons/SystemCall/source/IoSystemCall.c
  83. +7 −3 addons/TagDB/source/IoTagDB.c
  84. +3 −2 addons/TagLib/source/IoTagLib.c
  85. +5 −3 addons/Thread/source/IoThread.c
  86. +5 −3 addons/UUID/source/IoUUID.c
  87. +5 −3 addons/User/source/IoUser.c
  88. +16 −18 addons/Yajl/source/IoYajl.c
  89. +4 −4 addons/Yajl/source/IoYajlGen.c
  90. +4 −3 addons/Zlib/source/IoZlibDecoder.c
  91. +4 −3 addons/Zlib/source/IoZlibEncoder.c
  92. +1 −1  docs/IoCodingStandards.html
  93. +162 −433 extras/osx/osx.xcodeproj/project.pbxproj
  94. +1,466 −1,101 extras/osxvm/osxvm.xcodeproj/project.xcworkspace/xcuserdata/steve.xcuserdatad/UserInterfaceState.xcuserstate
  95. +4 −4 libs/iovm/source/IoBlock.c
  96. +5 −5 libs/iovm/source/IoCFunction.c
  97. +4 −4 libs/iovm/source/IoCall.c
  98. +4 −4 libs/iovm/source/IoCoroutine.c
  99. +4 −4 libs/iovm/source/IoDate.c
  100. +4 −4 libs/iovm/source/IoDirectory.c
  101. +3 −3 libs/iovm/source/IoDuration.c
  102. +3 −3 libs/iovm/source/IoDynLib.c
  103. +2 −2 libs/iovm/source/IoError.c
  104. +2 −2 libs/iovm/source/IoFile.c
  105. +3 −3 libs/iovm/source/IoList.c
  106. +3 −3 libs/iovm/source/IoMap.c
  107. +3 −3 libs/iovm/source/IoMessage.c
  108. +3 −3 libs/iovm/source/IoNumber.c
  109. +5 −5 libs/iovm/source/IoObject.c
  110. +3 −3 libs/iovm/source/IoSandbox.c
  111. +4 −4 libs/iovm/source/IoSeq.c
  112. +10 −8 libs/iovm/source/IoState.c
  113. +3 −2 libs/iovm/source/IoState.h
  114. +1 −1  libs/iovm/source/IoSystem.c
  115. +3 −3 libs/iovm/source/IoWeakLink.c
View
7 addons/AVCodec/source/IoAVCodec.c
@@ -34,6 +34,7 @@ videoFrameCount
#include <limits.h>
//#include <math.h>
+static const char *protoId = "AVCodec";
#define DATA(self) ((IoAVCodecData *)IoObject_dataPointer(self))
@@ -46,7 +47,7 @@ void IoAVCodec_registerIfNeeded(IoAVCodec *self)
IoTag *IoAVCodec_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("AVCodec");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoAVCodec_rawClone);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoAVCodec_mark);
@@ -64,7 +65,7 @@ IoAVCodec *IoAVCodec_proto(void *state)
DATA(self)->inputBuffer = IoSeq_new(state);
DATA(self)->outputBuffer = IoSeq_new(state);
- IoState_registerProtoWithFunc_(state, self, IoAVCodec_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoAVCodec_registerIfNeeded(self);
@@ -104,7 +105,7 @@ IoAVCodec *IoAVCodec_rawClone(IoAVCodec *proto)
IoAVCodec *IoAVCodec_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoAVCodec_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
6 addons/AppleExtras/source/IoAppleSensors.c
@@ -23,6 +23,8 @@ value := sensors getRightLightSensor
#define DATA(self) ((IoAppleSensorsData *)(IoObject_dataPointer(self)))
+const char *protoId = "AppleSensors";
+
IoTag *IoAppleSensors_newTag(void *state)
{
IoTag *tag = IoTag_newWithName_("AppleSensors");
@@ -39,7 +41,7 @@ IoAppleSensors *IoAppleSensors_proto(void *state)
//IoObject_setDataPointer_(self, calloc(1, sizeof(IoAppleSensorsData)));
- IoState_registerProtoWithFunc_(state, self, IoAppleSensors_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -72,7 +74,7 @@ IoAppleSensors *IoAppleSensors_rawClone(IoAppleSensors *proto)
IoAppleSensors *IoAppleSensors_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoAppleSensors_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
8 addons/AsyncRequest/source/IoAsyncRequest.c
@@ -18,9 +18,11 @@ asynchronous in Io.
#define IOCB(self) ((struct aiocb *)(IoObject_dataPointer(self)))
#define IOCB_BUFFER(self) ((void *)(IOCB(self)->aio_buf))
+static const char *protoId = "AsyncRequest";
+
IoTag *IoAsyncRequest_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("AsyncRequest");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoAsyncRequest_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoAsyncRequest_free);
@@ -34,7 +36,7 @@ IoAsyncRequest *IoAsyncRequest_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(struct aiocb)));
- IoState_registerProtoWithFunc_(state, self, IoAsyncRequest_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -65,7 +67,7 @@ IoAsyncRequest *IoAsyncRequest_rawClone(IoAsyncRequest *proto)
IoAsyncRequest *IoAsyncRequest_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoAsyncRequest_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
8 addons/BigNum/source/IoBigNum.c
@@ -7,9 +7,11 @@ Warning: GMP uses the restrictive GNU license which can be a problem if you are
#define DATA(self) ((IoBigNumData *)(IoObject_dataPointer(self)))
+static const char *protoId = "BigNum";
+
IoTag *IoBigNum_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("BigNum");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoBigNum_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoBigNum_free);
@@ -23,7 +25,7 @@ IoBigNum *IoBigNum_proto(void *state)
IoObject_tag_(self, IoBigNum_newTag(state));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoBigNumData)));
mpz_init(DATA(self)->integer);
- IoState_registerProtoWithFunc_(state, self, IoBigNum_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoMethodTable methodTable[] = {
{"+", IoBigNum_add}
//doc BigNum +(aNum) Add op. Returns result.
@@ -146,7 +148,7 @@ IoBigNum *IoBigNum_rawClone(IoBigNum * proto)
IoBigNum *IoBigNum_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoBigNum_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
6 addons/Blowfish/source/IoBlowfish.c
@@ -56,7 +56,7 @@ static const char *protoId = "Blowfish";
IoTag *IoBlowfish_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Blowfish");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoBlowfish_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoBlowfish_rawClone);
@@ -70,7 +70,7 @@ IoBlowfish *IoBlowfish_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoBlowfishData)));
- IoState_registerProtoWithFunc_(state, self, protoId);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -95,7 +95,7 @@ IoBlowfish *IoBlowfish_rawClone(IoBlowfish *proto)
IoBlowfish *IoBlowfish_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, protoId);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
6 addons/Box/source/IoBox.c
@@ -34,7 +34,7 @@ void *IoMessage_locals_boxArgAt_(IoMessage *self, void *locals, int n)
IoTag *IoBox_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Box");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoBox_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoBox_rawClone);
@@ -55,7 +55,7 @@ IoBox *IoBox_rawClone(IoBox *proto)
IoBox *IoBox_new(void *state)
{
- IoBox *proto = IoState_protoWithInitFunction_(state, protoId);
+ IoBox *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
@@ -481,7 +481,7 @@ IoBox *IoBox_proto(void *state)
DATA(self)->origin = IoSeq_newVec3f(state, o);
DATA(self)->size = IoSeq_newVec3f(state, o);
- IoState_registerProtoWithFunc_(state, self, protoId);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
745 addons/Curses/source/IoCurses.c
@@ -1,745 +0,0 @@
-
-//metadoc Curses copyright Steve Dekorte, 2004
-//metadoc Curses license BSD revised
-//metadoc Curses category Server
-//metadoc Curses credits Original version by Edwin Zacharias. getCh method by Scott Dunlop.
-/*metadoc Curses description
-Curses allows writing and reading at arbitrary positions on the terminal. You have to call init to set the terminal to curses mode and end to end curses mode. The terminal is not updated until refresh is called. It is a bad idea to use the standard io's read and write methods when the terminal is in curses mode. The Curses primitive was written by Edwin Zacharias.
-<BR><BR>
-Here's an example that prints Hello at column 5 and row 7;
-<p>
-<pre>
-Curses init
-Curses move(5, 7) print(\"Hello\")
-Curses refresh
-Curses end
-</pre>
-*/
-
-#include "IoCurses.h"
-#include "IoState.h"
-#include "IoNumber.h"
-#include "IoSeq.h"
-
-#if defined(__CYGWIN__) || defined(__MINGW32__)
-#include <curses.h>
-#else
-#include <ncurses.h>
-#endif
-
-#define IO_CURSES_INPUT_BUFFER_LENGTH 200
-
-#define DATA(self) ((IoCursesData *)IoObject_dataPointer(self))
-
-IoTag *IoCurses_newTag(void *state)
-{
- IoTag *tag = IoTag_newWithName_("Curses");
- IoTag_state_(tag, state);
- IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCurses_free);
- IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCurses_rawClone);
- return tag;
-}
-
-IoCurses *IoCurses_proto(void *state)
-{
- IoObject *self = IoObject_new(state);
- IoObject_tag_(self, IoCurses_newTag(state));
-
- IoObject_setDataPointer_(self, calloc(1, sizeof(IoCursesData)));
- IoState_registerProtoWithFunc_(state, self, IoCurses_proto);
-
- {
- IoMethodTable methodTable[] = {
- {"begin", IoCurses_begin},
- {"end", IoCurses_end},
-
- //{"nodelay", IoCurses_nodelay},
- //{"cBreak", IoCurses_cBreak},
- //{"noCBreak", IoCurses_noCBreak},
- //{"echo", IoCurses_echo},
- //{"noEcho", IoCurses_noEcho},
- {"move", IoCurses_move},
- {"write", IoCurses_print},
- {"writeCharacter", IoCurses_writeCharacter},
- //{"insert", IoCurses_insert},
- //{"delete", IoCurses_delete},
- //{"get", IoCurses_get},
- {"asyncReadCharacter", IoCurses_getCh},
- //{"input", IoCurses_input},
- //{"erase", IoCurses_erase},
- {"clear", IoCurses_clear},
- //{"clearToEndOfLine", IoCurses_clearToEndOfLine},
- {"refresh", IoCurses_refresh},
-
- {"scroll", IoCurses_scroll},
- {"scrollok", IoCurses_scrollok},
- {"setScrollingRegion", IoCurses_setScrollingRegion},
-
- {"x", IoCurses_x},
- {"y", IoCurses_y},
-
- {"width", IoCurses_width},
- {"height", IoCurses_height},
-
- {"hasColors", IoCurses_hasColors},
-
- {"setBackgroundBlack", IoCurses_setBackgroundBlack},
- {"setBackgroundBlue", IoCurses_setBackgroundBlue},
- {"setBackgroundGreen", IoCurses_setBackgroundGreen},
- {"setBackgroundCyan", IoCurses_setBackgroundCyan},
- {"setBackgroundRed", IoCurses_setBackgroundRed},
- {"setBackgroundMagenta", IoCurses_setBackgroundMagenta},
- {"setBackgroundYellow", IoCurses_setBackgroundYellow},
- {"setBackgroundWhite", IoCurses_setBackgroundWhite},
-
- {"setForegroundBlack", IoCurses_setForegroundBlack},
- {"setForegroundBlue", IoCurses_setForegroundBlue},
- {"setForegroundGreen", IoCurses_setForegroundGreen},
- {"setForegroundCyan", IoCurses_setForegroundCyan},
- {"setForegroundRed", IoCurses_setForegroundRed},
- {"setForegroundMagenta", IoCurses_setForegroundMagenta},
- {"setForegroundYellow", IoCurses_setForegroundYellow},
- {"setForegroundWhite", IoCurses_setForegroundWhite},
- {NULL, NULL},
- };
-
- IoObject_addMethodTable_(self, methodTable);
- }
- return self;
-}
-
-IoCurses *IoCurses_rawClone(IoCurses *proto)
-{
- IoCurses *self = IoObject_rawClonePrimitive(proto);
- IoObject_setDataPointer_(self, cpalloc(DATA(proto), sizeof(IoCursesData)));
- return self;
-}
-
-/* ----------------------------------------------------------- */
-
-IoCurses *IoCurses_new(void *state)
-{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoCurses_proto);
- return IOCLONE(proto);
-}
-
-void IoCurses_free(IoCurses *self)
-{
- free(IoObject_dataPointer(self));
-}
-
-/* ----------------------------------------------------------- */
-
-void IoCurses_suspendCurses(IoCurses *self)
-{
- def_prog_mode();
- endwin();
- refresh();
-}
-
-void IoCurses_resumeCurses(IoCurses *self)
-{
- refresh();
-}
-
-IoObject *IoCurses_showError(IoCurses *self, IoMessage *m, const char *name, const char *description)
-{
- IoCurses_suspendCurses(self);
- IoCurses_showError(self, m, name, description);
- IoCurses_resumeCurses(self);
- return self;
-}
-
-/* in curses y (the column) is listed before x (the row) */
-
-IoObject *IoCurses_begin(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses begin
- Sets the terminal to curses mode.
- This should be called before any other curses methods.
- Returns self.
- */
-
- initscr();
- //start_color();
- //DATA(self)->colorOn = 1;
-
- intrflush(stdscr, FALSE);
- keypad(stdscr, TRUE);
- nodelay(stdscr, TRUE);
-
- nonl();
- noecho();
- cbreak();
-
- return self;
-}
-
-IoObject *IoCurses_end(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses end
- Ends curses mode. This should be called before standard io's read
- and write methods are used. Returs self.
- */
- printf("IoCurses_end\n");
-
- //echo();
- //nocbreak();
- //nl();
-
- //clear();
- //refresh();
- //reset_shell_mode();
- endwin();
- //reset_shell_mode();
- return self;
-}
-
-
-IoObject *IoCurses_nodelay(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses nodelay(aBoolean)
- Enables or disables block during read.
- If aNumber is zero, nodelay is set to be false, otherwise it is set to be true.
- */
-
- int b = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 0));
- nodelay(stdscr, b);
- return self;
-}
-
-
-IoObject *IoCurses_cBreak(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses cBreak(aString)
- Disables line buffering and erase/kill character-processing.
- cBreak should be on for most purposes. Returns self.
- */
-
- if (cbreak() == ERR)
- {
- IoCurses_showError(self, m, "Curses.cBreak", "Failed to enable cBreak.");
- }
- return self;
-}
-
-IoObject *IoCurses_noCBreak(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses noCBreak
- Allows line buffering and erase/kill character-processing.
- cBreak should be on for most purposes. Returns self.
- */
-
- if (nocbreak() == ERR)
- {
- IoCurses_showError(self, m, "Curses.noCBreak", "Failed to disable cBreak.");
- }
- return self;
-}
-
-IoObject *IoCurses_echo(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses echo
- Echoes user input to terminal. Returns self.
- */
-
- if (echo() == ERR)
- {
- IoCurses_showError(self, m, "Curses.echo", "Failed to enable echo.");
- }
- return self;
-}
-
-IoObject *IoCurses_noEcho(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses noEcho
- Does not echo user input to terminal. Returns self.
- */
-
- if (noecho() == ERR)
- {
- IoCurses_showError(self, m, "Curses.noecho", "Failed to disable echo.");
- }
- return self;
-}
-
-IoObject *IoCurses_move(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses move(x, y)
- Moves the cursor to column y and row x on the terminal.
- (0, 0) is at the top-left of the terminal. Returns self.
- */
-
- int x = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 0));
- int y = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 1));
-
- if (move(y, x) == ERR)
- {
- IoCurses_showError(self, m, "Curses.move", "Failed to move cursor.");
- }
-
- return self;
-}
-
-IoObject *IoCurses_writeCharacter(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses writeCharacter(aCharacter)
- Prints the aCharacter to the current position on the terminal,
- overwriting existing text on the terminal. Returns self.
- */
-
- char c = IoMessage_locals_intArgAt_(m, locals, 0);
-
- if (addch(c) == ERR)
- {
- /* IoCurses_showError(self, m, "Curses.print", "Failed to print string.");*/
- }
- return self;
-}
-
-IoObject *IoCurses_print(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses print(aString)
- Prints the string to the current position on the terminal,
- overwriting existing text on the terminal. Returns self.
- */
-
- char *string = IoSeq_asCString(IoMessage_locals_seqArgAt_(m, locals, 0));
-
- if (addstr(string) == ERR)
- {
- /* IoCurses_showError(self, m, "Curses.print", "Failed to print string.");*/
- }
- return self;
-}
-
-IoObject *IoCurses_insert(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses insert(aString)
- Inserts the string at the current position on the terminal,
- pushing existing text to the right. Returns self.
- */
-
- char *string = IoSeq_asCString(IoMessage_locals_seqArgAt_(m, locals, 0));
-
- if (insstr(string) == ERR)
- {
- IoCurses_showError(self, m, "Curses.insert", "Failed to insert string.");
- }
- return self;
-}
-
-IoObject *IoCurses_delete(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses delete(n)
- Deletes n characters at the current position. Text to the right is shifted left.
- n is optional and defaults to 1. Returns self.
- */
-
- int n = 1;
-
- if (IoMessage_argCount(m) > 0)
- {
- n = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 0));
- }
-
- for (n = n; n > 0; n--)
- {
- if (delch() == ERR)
- {
- IoCurses_showError(self, m, "Curses.delete", "Failed to delete string.");
- }
- }
- return self;
-}
-
-IoObject *IoCurses_get(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses get(n)
- Returns n characters from the terminal. n is optional and defaults to 1.
- */
-
- int inputCharacterLimit = IO_CURSES_INPUT_BUFFER_LENGTH;
- char string[inputCharacterLimit];
-
- if (IoMessage_argCount(m) > 0)
- {
- IoNumber *number = IoMessage_locals_numberArgAt_(m, locals, 0);
- inputCharacterLimit = IoNumber_asInt(number);
- }
-
- if (getnstr(string, inputCharacterLimit) == ERR)
- {
- return IONIL(self);
- }
-
- return IoState_symbolWithCString_(IOSTATE, string);
-}
-
-IoObject *IoCurses_getCh(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses getCh
- Reads a single-byte character from the terminal associated with the
- current or specified window. Returns a Number containing the byte.
- */
-
- int key = getch();
-
- if (key == ERR)
- {
- return IONIL(self);
- }
-
- return IONUMBER((double)key);
-}
-
-IoObject *IoCurses_input(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses input(n)
- Returns user input up to a return, or a maximun of n characters.
- */
-
- int length = 1;
- char string[length+1];
-
- if (IoMessage_argCount(m) > 0)
- {
- length = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 0));
- }
-
- if (innstr(string, length) == ERR)
- {
- return IONIL(self);
- }
-
- return IoState_symbolWithCString_(IOSTATE, string);
-}
-
-IoObject *IoCurses_clear(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses clear
- Clears the terminal. Nicer than erase. Returns self.
- */
-
- clear();
- return self;
-}
-
-IoObject *IoCurses_clearToEndOfLine(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses clearToEndOfLine
- Clears the text from the cursor to the end of the line. Returns self.
- */
-
- clrtoeol();
- return self;
-}
-
-IoObject *IoCurses_refresh(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses refresh
- Copies the current buffer to the screen. This must be called to make
- changes to the screen. Returns self.
- */
-
- if (refresh() == ERR)
- {
- IoCurses_showError(self, m, "Curses.refresh", "Failed to refresh screen.");
- }
- return self;
-}
-
-IoObject *IoCurses_scroll(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses scroll(num)
- Scrolls up num lines.
- num is optional and defaults to 1. Returns self.
- */
- int num = 1;
- if (IoMessage_argCount(m) > 0)
- {
- num = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 0));
- }
-
- if (scrl(num) == ERR)
- {
- IoCurses_showError(self, m, "Curses.scroll", "Failed to scroll screen.");
- }
-
- return self;
-}
-
-IoObject *IoCurses_scrollok(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses scrollok(aBoolean)
- Enables / Disables automatic scrolling. Return self.
- */
- int b = ISTRUE(IoMessage_locals_valueArgAt_(m, locals, 0));
- scrollok(stdscr, b); // always returns OK
- return self;
-}
-
-IoObject *IoCurses_setScrollingRegion(IoCurses *self, IoObject *locals, IoMessage *m) {
- /*doc Curses setScrollingRegion(top, bottom)
- Sets the scrolling region; top and bottom are the line numbers of the top
- and button margin. Returns self.
- */
- int top = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 0));
- int bot = IoNumber_asInt(IoMessage_locals_numberArgAt_(m, locals, 1));
- if(setscrreg(top, bot) == ERR)
- {
- IoCurses_showError(self, m, "Curses.scroll", "Failed to set the scrolling region.");
- }
- return self;
-}
-
-IoObject *IoCurses_width(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses width
- Returns a Number containing the width of the current screen.
- */
-
- int w, h;
- getmaxyx(stdscr, h, w);
- return IONUMBER(w);
-}
-
-IoObject *IoCurses_height(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses height
- Returns a Number containing the height of the current screen.
- */
-
- int w, h;
- getmaxyx(stdscr, h, w);
- return IONUMBER(h);
-}
-
-IoObject *IoCurses_hasColors(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses hasColors
- Returns true if the terminal supports color, false otherwise.
- */
-
- return IOBOOL(self, has_colors());
-}
-
-void IoCurses_colorSet(IoCurses *self)
-{
- if (!DATA(self)->colorOn)
- {
- start_color();
- DATA(self)->colorOn = 1;
- /*pair_content(0, &(DATA(self)->fgColor), &(DATA(self)->bgColor));*/
- }
- // pairs have to be > 0
- int pair_id = DATA(self)->fgColor * COLORS + DATA(self)->bgColor; // correct?
- init_pair(pair_id, DATA(self)->fgColor, DATA(self)->bgColor);
- attrset(COLOR_PAIR(pair_id));
-}
-
-/* --- Background --- */
-
-IoObject *IoCurses_setBackgroundBlack(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundBlack
- Sets the background color to black.
- */
-
- DATA(self)->bgColor = COLOR_BLACK;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundBlue(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundBlue
- Sets the background color to blue.
- */
-
- DATA(self)->bgColor = COLOR_BLUE;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundGreen(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundGreen
- Sets the background color to green.
- */
-
- DATA(self)->bgColor = COLOR_GREEN;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundCyan(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundCyan
- Sets the background color to cyan.
- */
-
- DATA(self)->bgColor = COLOR_CYAN;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundRed(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundRed
- Sets the background color to red.
- */
-
- DATA(self)->bgColor = COLOR_RED;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundMagenta(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundMagenta
- Sets the background color to magenta.
- */
-
- DATA(self)->bgColor = COLOR_MAGENTA;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundYellow(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundYellow
- Sets the background color to yellow.
- */
-
- DATA(self)->bgColor = COLOR_YELLOW;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setBackgroundWhite(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setBackgroundWhite
- Sets the background color to white.
- */
-
- DATA(self)->bgColor = COLOR_WHITE;
- IoCurses_colorSet(self);
- return self;
-}
-
-/* --- Foreground --- */
-
-IoObject *IoCurses_setForegroundBlack(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundBlack
- Sets the foreground color to black.
- */
-
- DATA(self)->fgColor = COLOR_BLACK;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundBlue(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundBlue
- Sets the foreground color to blue.
- */
-
- DATA(self)->fgColor = COLOR_BLUE;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundGreen(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundGreen
- Sets the foreground color to green.
- */
-
- DATA(self)->fgColor = COLOR_GREEN;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundCyan(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundCyan
- Sets the foreground color to cyan.
- */
-
- DATA(self)->fgColor = COLOR_CYAN;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundRed(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundRed
- Sets the foreground color to red.
- */
-
- DATA(self)->fgColor = COLOR_RED;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundMagenta(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundMagenta
- Sets the foreground color to magenta.
- */
-
- DATA(self)->fgColor = COLOR_MAGENTA;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundYellow(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundYellow
- Sets the foreground color to yellow.
- */
-
- DATA(self)->fgColor = COLOR_YELLOW;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_setForegroundWhite(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses setForegroundWhite
- Sets the foreground color to white.
- */
-
- DATA(self)->fgColor = COLOR_WHITE;
- IoCurses_colorSet(self);
- return self;
-}
-
-IoObject *IoCurses_x(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses x
- Returns the cursor x position.
- */
-
- int x, y;
-
- getyx(stdscr, y, x);
-
- return IONUMBER(x);
-}
-
-IoObject *IoCurses_y(IoCurses *self, IoObject *locals, IoMessage *m)
-{
- /*doc Curses y
- Returns the cursor y position.
- */
-
- int x, y;
-
- getyx(stdscr, y, x);
-
- return IONUMBER(y);
-}
View
79 addons/Curses/source/IoCurses.h
@@ -1,79 +0,0 @@
-//metadoc Curses Steve Dekorte and Edwin Zacharias, 2002
-//metadoc Curses license BSD revised
-
-#ifndef IOCURSES_DEFINED
-#define IOCURSES_DEFINED 1
-
-#include "IoObject.h"
-
-#define ISCURSES(self) IoObject_hasCloneFunc_(self, (IoTagCloneFunc *)IoCurses_rawClone)
-
-typedef IoObject IoCurses;
-
-typedef struct
-{
- int colorOn;
- short fgColor;
- short bgColor;
-} IoCursesData;
-
-IoCurses *IoCurses_proto(void *state);
-IoCurses *IoCurses_rawClone(IoCurses *self);
-IoCurses *IoCurses_new(void *state);
-void IoCurses_free(IoCurses *self);
-
-/* ----------------------------------------------------------- */
-IoObject *IoCurses_begin(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_end(IoCurses *self, IoObject *locals, IoMessage *m);
-
-IoObject *IoCurses_writeCharacter(IoCurses *self, IoObject *locals, IoMessage *m);
-
-IoObject *IoCurses_nodelay(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_cBreak(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_noCBreak(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_echo(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_noEcho(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_move(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_print(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_insert(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_delete(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_get(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_getCh(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_input(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_erase(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_clear(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_clearToEndOfLine(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_refresh(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_scroll(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_scrollok(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setScrollingRegion(IoCurses *self, IoObject *locals, IoMessage *m);
-
-IoObject *IoCurses_width(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_height(IoCurses *self, IoObject *locals, IoMessage *m);
-
-IoObject *IoCurses_hasColors(IoCurses *self, IoObject *locals, IoMessage *m);
-
-/* ------------------------------------- */
-IoObject *IoCurses_setBackgroundBlack(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundBlue(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundGreen(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundCyan(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundRed(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundMagenta(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundYellow(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setBackgroundWhite(IoCurses *self, IoObject *locals, IoMessage *m);
-
-/* ------------------------------------- */
-IoObject *IoCurses_setForegroundBlack(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundBlue(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundGreen(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundCyan(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundRed(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundMagenta(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundYellow(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_setForegroundWhite(IoCurses *self, IoObject *locals, IoMessage *m);
-
-IoObject *IoCurses_x(IoCurses *self, IoObject *locals, IoMessage *m);
-IoObject *IoCurses_y(IoCurses *self, IoObject *locals, IoMessage *m);
-
-#endif
View
6 addons/DBI/source/IoDBI.c
@@ -23,9 +23,11 @@ void ReportDBIError(dbi_conn conn, void *state, IoMessage *m)
IoState_error_(state, m, "libdbi: %i: %s\n", errorCode, error);
}
+static const char *protoId = "DBI";
+
IoTag *IoDBI_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("DBI");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoDBI_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoDBI_free);
@@ -41,7 +43,7 @@ IoDBI *IoDBI_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoDBIData)));
DATA(self)->driverCount = 0;
- IoState_registerProtoWithFunc_(state, self, IoDBI_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
8 addons/DBI/source/IoDBIConn.c
@@ -15,9 +15,11 @@
#define DATA(self) ((IoDBIConnData *)IoObject_dataPointer(self))
+static const char *protoId = "DBIConn";
+
IoTag *IoDBIConn_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("DBIConn");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoDBIConn_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoDBIConn_free);
@@ -33,7 +35,7 @@ IoDBIConn *IoDBIConn_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoDBIConnData)));
DATA(self)->conn = NULL;
- IoState_registerProtoWithFunc_(state, self, IoDBIConn_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -84,7 +86,7 @@ void IoDBIConn_free(IoDBIConn *self)
IoDBIConn *IoDBIConn_new(void *state, dbi_conn conn)
{
- IoDBIConn *self = IOCLONE(IoState_protoWithInitFunction_(state, IoDBIConn_proto));
+ IoDBIConn *self = IOCLONE(IoState_protoWithId_(state, protoId));
DATA(self)->conn = conn;
return self;
}
View
11 addons/DBI/source/IoDBIResult.c
@@ -16,9 +16,11 @@
#define DATA(self) ((IoDBIResultData *)IoObject_dataPointer(self))
+static const char *protoId = "DBIResult";
+
IoTag *IoDBIResult_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("DBIResult");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoDBIResult_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoDBIResult_free);
@@ -35,7 +37,7 @@ IoDBIResult *IoDBIResult_proto(void *state)
DATA(self)->conn = NULL;
DATA(self)->result = NULL;
- IoState_registerProtoWithFunc_(state, self, IoDBIResult_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -79,12 +81,9 @@ void IoDBIResult_free(IoDBIResult *self)
IoDBIResult *IoDBIResult_new(void *state, dbi_result result)
{
- IoDBIResult *self = IOCLONE(IoState_protoWithInitFunction_(state,
- IoDBIResult_proto));
-
+ IoDBIResult *self = IOCLONE(IoState_protoWithId_(state, protoId));
DATA(self)->result = result;
DATA(self)->conn = dbi_result_get_conn(result);
-
return self;
}
View
8 addons/Fnmatch/source/IoFnmatch.c
@@ -16,9 +16,11 @@ Note: not all options are supported on all platforms.
#define DATA(self) ((IoFnmatchData *)IoObject_dataPointer(self))
+static const char *protoId = "Fnmatch";
+
IoTag *IoFnmatch_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Fnmatch");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoFnmatch_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoFnmatch_mark);
@@ -34,7 +36,7 @@ IoFnmatch *IoFnmatch_proto(void *state)
IoObject_setDataPointer_(self, io_calloc(1, sizeof(IoFnmatchData)));
DATA(self)->string = IOSYMBOL("");
DATA(self)->pattern = DATA(self)->string;
- IoState_registerProtoWithFunc_(state, self, IoFnmatch_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -93,7 +95,7 @@ IoFnmatch *IoFnmatch_rawClone(IoFnmatch *proto)
IoFnmatch *IoFnmatch_new(void *state)
{
- IoFnmatch *proto = IoState_protoWithInitFunction_(state, IoFnmatch_proto);
+ IoFnmatch *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
8 addons/Font/source/IoFont.c
@@ -34,9 +34,11 @@ Smaller fonts (those having a point size around 30 or smaller, depending on the
#define DATA(self) ((IoFontData *)IoObject_dataPointer(self))
+static const char *protoId = "Font";
+
IoTag *IoFont_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Font");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoFont_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoFont_free);
@@ -53,7 +55,7 @@ IoFont *IoFont_proto( void *state )
DATA(self)->path = IOSYMBOL(".");
DATA(self)->font = GLFont_new();
DATA(self)->isProto = 1;
- IoState_registerProtoWithFunc_(state, self, IoFont_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -91,7 +93,7 @@ IoFont *IoFont_rawClone(IoFont *proto)
IoFont *IoFont_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoFont_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
14 addons/GLFW/source/IoGLFW.c
@@ -17,6 +17,8 @@
#define DATA(self) ((IoGLFWData *)IoObject_dataPointer(self))
+static const char *protoId = "GLFW";
+
static IoGLFW *proto = NULL;
// Callbacks
@@ -36,7 +38,8 @@ IoObject *IoGLFW_tryCallback(IoGLFW *self, IoObject *locals, IoMessage *m)
return IoCoroutine_rawResult(tryCoro);
}
-int IoGLFWCloseCallback(){
+int IoGLFWCloseCallback()
+{
IoState_pushRetainPool(IoObject_state(proto));
IoNumber* res = IoGLFW_tryCallback(proto, DATA(proto)->closeTarget, DATA(proto)->closeMessage);
@@ -46,7 +49,8 @@ int IoGLFWCloseCallback(){
return IoNumber_asInt(res);
}
-void IoGLFWSizeCallback(int width, int height){
+void IoGLFWSizeCallback(int width, int height)
+{
IoState_pushRetainPool(IoObject_state(proto));
IoMessage_setCachedArg_toInt_(DATA(proto)->sizeMessage, 0, width);
@@ -153,7 +157,7 @@ IoGLFW *IoGLFW_proto(void *state)
DATA(self)->coroutine = IoCoroutine_new(state);
- IoState_registerProtoWithFunc_(state, self, IoGLFW_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoGLFW_protoInit(self);
return self;
@@ -161,7 +165,7 @@ IoGLFW *IoGLFW_proto(void *state)
IoGLFW *IoGLFW_new(void *state)
{
- return IoState_protoWithInitFunction_(state, IoGLFW_proto);
+ return IoState_protoWithId_(state, protoId);
}
void IoGLFW_free(IoGLFW *self)
@@ -193,7 +197,7 @@ void IoGLFW_mark(IoGLFW *self)
IoObject *IoGLFW_rawClone(IoGLFW *self)
{
- return IoState_protoWithInitFunction_(IOSTATE, IoGLFW_proto);
+ return IoState_protoWithId_(IOSTATE, protoId);
}
View
8 addons/Image/source/IoImage.c
@@ -25,9 +25,11 @@ Currently supported formats include PNG(which supports alpha), JPG and TIFF.
#define DATA(self) ((IoImageData *)IoObject_dataPointer(self))
+static const char *protoId = "Image";
+
IoTag *IoImage_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Image");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoImage_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoImage_free);
@@ -46,7 +48,7 @@ IoImage *IoImage_proto(void *state)
DATA(self)->image = Image_new();
Image_setExternalUArray_(DATA(self)->image, IoSeq_rawUArray(DATA(self)->buffer));
- IoState_registerProtoWithFunc_(state, self, IoImage_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -107,7 +109,7 @@ IoImage *IoImage_rawClone(IoImage *proto)
IoImage *IoImage_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoImage_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
8 addons/LZO/source/IoLZODecoder.c
@@ -24,9 +24,11 @@ result := z outputBuffer
#define DATA(self) ((IoLZOData *)(IoObject_dataPointer(self)))
+static const char *protoId = "LZODecoder";
+
IoTag *IoLZODecoder_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("LZODecoder");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoLZODecoder_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoLZODecoder_rawClone);
@@ -40,7 +42,7 @@ IoLZODecoder *IoLZODecoder_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoLZOData)));
- IoState_registerProtoWithFunc_(state, self, IoLZODecoder_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -64,7 +66,7 @@ IoLZODecoder *IoLZODecoder_rawClone(IoLZODecoder *proto)
IoLZODecoder *IoLZODecoder_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoLZODecoder_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
2  addons/LZO/source/IoLZODecoder.h
@@ -7,6 +7,8 @@
#include "IoSeq.h"
#include "IoList.h"
+#define USE_MINILZO 1
+
#if defined USE_MINILZO
#include "minilzo.h"
#elif defined USE_LIBLZO
View
8 addons/LZO/source/IoLZOEncoder.c
@@ -24,9 +24,11 @@ result := z outputBuffer
#define DATA(self) ((IoLZOData *)(IoObject_dataPointer(self)))
+static const char *protoId = "LZOEncoder";
+
IoTag *IoLZOEncoder_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("LZOEncoder");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoLZOEncoder_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoLZOEncoder_rawClone);
@@ -40,7 +42,7 @@ IoLZOEncoder *IoLZOEncoder_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoLZOData)));
- IoState_registerProtoWithFunc_(state, self, IoLZOEncoder_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -64,7 +66,7 @@ IoLZOEncoder *IoLZOEncoder_rawClone(IoLZOEncoder *proto)
IoLZOEncoder *IoLZOEncoder_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoLZOEncoder_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
2  addons/LZO/source/IoLZOEncoder.h
@@ -8,6 +8,8 @@
#include "IoSeq.h"
#include "IoList.h"
+#define USE_MINILZO 1
+
#if defined USE_MINILZO
#include "minilzo.h"
#elif defined USE_LIBLZO
View
8 addons/LibSndFile/source/IoLibSndFile.c
@@ -17,9 +17,11 @@ An object for encoding and decoding audio files (principally WAV and AIFF) using
#define DATA(self) ((IoLibSndFileData *)IoObject_dataPointer(self))
+static const char *protoId = "LibSndFile";
+
IoTag *IoLibSndFile_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("LibSndFile");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoLibSndFile_rawClone);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoLibSndFile_mark);
@@ -37,7 +39,7 @@ IoLibSndFile *IoLibSndFile_proto(void *state)
DATA(self)->outputBuffer = IoSeq_new(state);
DATA(self)->sfinfo = calloc(1, sizeof(SF_INFO));
- IoState_registerProtoWithFunc_(state, self, IoLibSndFile_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -68,7 +70,7 @@ IoLibSndFile *IoLibSndFile_rawClone(IoLibSndFile *proto)
IoLibSndFile *IoLibSndFile_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, IoLibSndFile_proto);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
8 addons/Libxml2/source/IoXmlWriter.c
@@ -13,6 +13,8 @@
#define ISOPEN(self) (DATA(self)->writer)
#define DATA(self) ((IoXmlWriterData*)IoObject_dataPointer(self))
+static const char *protoId = "XmlWriter";
+
void IoXmlWriter_raiseErrors_(IoXmlWriter *self, IoMessage *m, int rc)
{
if ( rc < 0 )
@@ -23,7 +25,7 @@ void IoXmlWriter_raiseErrors_(IoXmlWriter *self, IoMessage *m, int rc)
IoTag *IoXmlWriter_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("XmlWriter");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoXmlWriter_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoXmlWriter_free);
@@ -45,7 +47,7 @@ IoXmlWriter *IoXmlWriter_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoXmlWriterData)));
- IoState_registerProtoWithFunc_(state, self, IoXmlWriter_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoMethodTable methodTable[] = {
{"openFilename", IoXmlWriter_openFilename},
{"openStandardOut", IoXmlWriter_openStandardOut},
@@ -121,7 +123,7 @@ IoXmlWriter *IoXmlWriter_proto(void *state)
IoXmlWriter *IoXmlWriter_new(void *state)
{
- IoXmlWriter *proto = IoState_protoWithInitFunction_(state, IoXmlWriter_proto);
+ IoXmlWriter *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
4 addons/Loki/source/IoLinker.c
@@ -11,6 +11,8 @@
#include "IoSeq.h"
#include "IoMap.h"
+static const char *protoId = "Linker";
+
double fptrToDouble(void* fptr)
{
double x;
@@ -23,7 +25,7 @@ IoLinker *IoLinker_proto(void *state)
{
IoObject *self = IoObject_new(state);
- IoState_registerProtoWithFunc_(state, self, IoLinker_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
6 addons/MD5/source/IoMD5.c
@@ -23,7 +23,7 @@ static const char *protoId = "MD5";
IoTag *IoMD5_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("MD5");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoMD5_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoMD5_rawClone);
@@ -38,7 +38,7 @@ IoMD5 *IoMD5_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoMD5Data)));
io_md5_init(&(DATA(self)->mstate));
- IoState_registerProtoWithFunc_(state, self, protoId);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -62,7 +62,7 @@ IoMD5 *IoMD5_rawClone(IoMD5 *proto)
IoMD5 *IoMD5_new(void *state)
{
- IoMD5 *proto = IoState_protoWithInitFunction_(state, protoId);
+ IoMD5 *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
6 addons/ODE/source/IoODEBall.c
@@ -14,9 +14,11 @@ ODEBall binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEBall";
+
IoTag *IoODEBall_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEBall");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEBall_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEBall_mark);
@@ -31,7 +33,7 @@ IoODEBall *IoODEBall_proto(void *state)
IoODEJoint_protoCommon(self);
- IoState_registerProtoWithFunc_(state, self, IoODEBall_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
10 addons/ODE/source/IoODEBody.c
@@ -16,6 +16,8 @@ ODEBody binding
#define BODYID (DATA(self)->bodyId)
#define WORLD (DATA(self)->world)
+static const char *protoId = "ODEBody";
+
void IoODEBody_assertValidBody(IoODEBody *self, IoObject *locals, IoMessage *m)
{
IOASSERT(WORLD, "This ODE body belongs to an ODE world which has been freed.");
@@ -51,7 +53,7 @@ dBodyID IoMessage_locals_odeBodyIdArgAt_(IoMessage *self, void *locals, int n)
IoTag *IoODEBody_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEBody");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEBody_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEBody_mark);
@@ -69,7 +71,7 @@ IoODEBody *IoODEBody_proto(void *state)
BODYID = 0;
WORLD = 0L;
- IoState_registerProtoWithFunc_(state, self, IoODEBody_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -143,13 +145,13 @@ void IoODEBody_mark(IoODEBody *self)
IoODEBody *IoODEBody_new(void *state)
{
- IoODEBody *proto = IoState_protoWithInitFunction_(state, IoODEBody_proto);
+ IoODEBody *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
IoODEBody *IoODEBody_newBodyProtoWithWorld(void *state, IoODEWorld *world)
{
- IoODEBody *proto = IoState_protoWithInitFunction_(state, IoODEBody_proto);
+ IoODEBody *proto = IoState_protoWithId_(state, protoId);
IoODEBody *self = IOCLONE(proto);
WORLD = world;
return self;
View
8 addons/ODE/source/IoODEBox.c
@@ -16,9 +16,11 @@ ODEBox binding
#define DATA(self) ((IoODEBoxData *)IoObject_dataPointer(self))
#define GEOMID (DATA(self)->geomId)
+static const char *protoId = "ODEBox";
+
IoTag *IoODEBox_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEBox");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEBox_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoODEBox_rawClone);
@@ -34,7 +36,7 @@ IoODEBox *IoODEBox_proto(void *state)
GEOMID = 0;
- IoState_registerProtoWithFunc_(state, self, IoODEBox_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -62,7 +64,7 @@ IoODEBox *IoODEBox_rawClone(IoODEBox *proto)
IoODEBox *IoODEBox_new(void *state, dGeomID geomId)
{
- IoODEBox *proto = IoState_protoWithInitFunction_(state, IoODEBox_proto);
+ IoODEBox *proto = IoState_protoWithId_(state, protoId);
IoODEBox *self = IOCLONE(proto);
GEOMID = geomId;
dGeomSetData(GEOMID, self);
View
10 addons/ODE/source/IoODEContact.c
@@ -15,9 +15,11 @@ ODEContact binding
#define DATA(self) ((IoODEContactData *)IoObject_dataPointer(self))
+static const char *protoId = "ODEContact";
+
IoTag *IoODEContact_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEContact");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEContact_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEContact_mark);
@@ -32,7 +34,7 @@ IoODEContact *IoODEContact_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoODEContactData)));
- IoState_registerProtoWithFunc_(state, self, IoODEContact_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -135,13 +137,13 @@ void IoODEContact_mark(IoODEContact *self)
IoODEContact *IoODEContact_new(void *state)
{
- IoODEContact *proto = IoState_protoWithInitFunction_(state, IoODEContact_proto);
+ IoODEContact *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
IoODEContact *IoODEContact_newContactGeom(void *state, dContactGeom *contact)
{
- IoODEContact *proto = IoState_protoWithInitFunction_(state, IoODEContact_proto);
+ IoODEContact *proto = IoState_protoWithId_(state, protoId);
IoODEContact *self = IOCLONE(proto);
memcpy(&(DATA(self)->geom), contact, sizeof(*contact));
View
6 addons/ODE/source/IoODEContactJoint.c
@@ -14,9 +14,11 @@ ODEContactJoint binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEContactJoint";
+
IoTag *IoODEContactJoint_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEContactJoint");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEContactJoint_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEContactJoint_mark);
@@ -31,7 +33,7 @@ IoODEContactJoint *IoODEContactJoint_proto(void *state)
IoODEJoint_protoCommon(self);
- IoState_registerProtoWithFunc_(state, self, IoODEContactJoint_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
6 addons/ODE/source/IoODEFixed.c
@@ -14,9 +14,11 @@ ODEFixed binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEFixed";
+
IoTag *IoODEFixed_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEFixed");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEFixed_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEFixed_mark);
@@ -31,7 +33,7 @@ IoODEFixed *IoODEFixed_proto(void *state)
IoODEJoint_protoCommon(self);
- IoState_registerProtoWithFunc_(state, self, IoODEFixed_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
6 addons/ODE/source/IoODEHinge.c
@@ -14,9 +14,11 @@ ODEHinge binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEHinge";
+
IoTag *IoODEHinge_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEHinge");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEHinge_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEHinge_mark);
@@ -31,7 +33,7 @@ IoODEHinge *IoODEHinge_proto(void *state)
IoODEJoint_protoCommon(self);
- IoState_registerProtoWithFunc_(state, self, IoODEHinge_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
View
4 addons/ODE/source/IoODEHinge2.c
@@ -14,9 +14,11 @@ ODEJoint binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEHinge2";
+
IoTag *IoODEHinge2_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEHinge2");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEHinge2_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEHinge2_mark);
View
8 addons/ODE/source/IoODEJoint.c
@@ -14,10 +14,12 @@ ODEJoint binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEJoint";
+
IoTag *IoODEJoint_newTag(void *state)
{
// TODO: Get rid of IoODEJoint as an IoObject. Can't be manipulated directly through Io.
- IoTag *tag = IoTag_newWithName_("ODEJoint");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEJoint_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEJoint_mark);
@@ -32,7 +34,7 @@ IoODEJoint *IoODEJoint_proto(void *state)
IoODEJoint_protoCommon(self);
- IoState_registerProtoWithFunc_(state, self, IoODEJoint_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -80,7 +82,7 @@ void IoODEJoint_mark(IoODEJoint *self)
IoODEJoint *IoODEJoint_newProtoCommon(void *state, IoStateProtoFunc *func, IoODEJointGroup *jointGroup)
{
- IoODEJoint *proto = IoState_protoWithInitFunction_(state, func);
+ IoODEJoint *proto = IoState_protoWithId_(state, func);
IoODEJoint *self = IOCLONE(proto);
JOINTGROUP = jointGroup;
return self;
View
8 addons/ODE/source/IoODEJointGroup.c
@@ -26,10 +26,12 @@ ODEJointGroup binding
#define WORLD (DATA(self)->world)
#define WORLDID (IoODEWorld_rawWorldId(WORLD))
+static const char *protoId = "ODEJointGroup";
+
IoTag *IoODEJointGroup_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEJointGroup");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEJointGroup_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEJointGroup_mark);
@@ -122,13 +124,13 @@ void IoODEJointGroup_mark(IoODEJointGroup *self)
IoODEJointGroup *IoODEJointGroup_new(void *state)
{
- IoODEJointGroup *proto = IoState_protoWithInitFunction_(state, IoODEJointGroup_proto);
+ IoODEJointGroup *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
IoODEJointGroup *IoODEJointGroup_newJointGroupProtoWithWorld(void *state, IoODEWorld *world)
{
- IoODEJointGroup *proto = IoState_protoWithInitFunction_(state, IoODEJointGroup_proto);
+ IoODEJointGroup *proto = IoState_protoWithId_(state, protoId);
IoODEJointGroup *self = IOCLONE(proto);
WORLD = world;
return self;
View
6 addons/ODE/source/IoODEMass.c
@@ -12,9 +12,11 @@ ODEMass binding
#define DATA(self) ((IoODEMassData *)IoObject_dataPointer(self))
+static const char *protoId = "ODEMass";
+
IoTag *IoODEMass_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEMass");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEMass_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEMass_mark);
@@ -75,7 +77,7 @@ void IoODEMass_mark(IoODEMass *self)
IoODEMass *IoODEMass_new(void *state)
{
- IoODEMass *proto = IoState_protoWithInitFunction_(state, IoODEMass_proto);
+ IoODEMass *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
4 addons/ODE/source/IoODEPlane.c
@@ -15,6 +15,8 @@ ODEPlane binding
#define DATA(self) ((IoODEPlaneData *)IoObject_dataPointer(self))
#define GEOMID (DATA(self)->geomId)
+static const char *protoId = "ODEPlane";
+
IoTag *IoODEPlane_newTag(void *state)
{
IoTag *tag = IoTag_newWithName_("ODEPlane");
@@ -58,7 +60,7 @@ IoODEPlane *IoODEPlane_rawClone(IoODEPlane *proto)
IoODEPlane *IoODEPlane_new(void *state, dGeomID geomId)
{
- IoODEPlane *proto = IoState_protoWithInitFunction_(state, IoODEPlane_proto);
+ IoODEPlane *proto = IoState_protoWithId_(state, protoId);
IoODEPlane *self = IOCLONE(proto);
GEOMID = geomId;
dGeomSetData(GEOMID, self);
View
7 addons/ODE/source/IoODESimpleSpace.c
@@ -18,9 +18,12 @@ ODESimpleSpace binding
#define DATA(self) ((IoODESimpleSpaceData *)IoObject_dataPointer(self))
#define SPACEID (DATA(self)->spaceId)
+static const char *protoId = "ODESimpleSpace";
+
+
IoTag *IoODESimpleSpace_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODESimpleSpace");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODESimpleSpace_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoODESimpleSpace_rawClone);
@@ -64,7 +67,7 @@ IoODESimpleSpace *IoODESimpleSpace_rawClone(IoODESimpleSpace *proto)
IoODESimpleSpace *IoODESimpleSpace_new(void *state)
{
- IoODESimpleSpace *proto = IoState_protoWithInitFunction_(state, IoODESimpleSpace_proto);
+ IoODESimpleSpace *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
4 addons/ODE/source/IoODESlider.c
@@ -15,9 +15,11 @@ ODEJoint binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODESlider";
+
IoTag *IoODESlider_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODESlider");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODESlider_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODESlider_mark);
View
4 addons/ODE/source/IoODEUniversal.c
@@ -14,9 +14,11 @@ ODEJoint binding
/* ----------------------------------------------------------- */
+static const char *protoId = "ODEUniversal";
+
IoTag *IoODEUniversal_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEUniversal");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEUniversal_free);
IoTag_markFunc_(tag, (IoTagMarkFunc *)IoODEUniversal_mark);
View
8 addons/ODE/source/IoODEWorld.c
@@ -16,9 +16,11 @@ ODEWorld binding
#define DATA(self) ((IoODEWorldData *)IoObject_dataPointer(self))
#define WORLDID (DATA(self)->worldId)
+static const char *protoId = "ODEWorld";
+
IoTag *IoODEWorld_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ODEWorld");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoODEWorld_free);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoODEWorld_rawClone);
@@ -37,7 +39,7 @@ IoODEWorld *IoODEWorld_proto(void *state)
DATA(self)->bodies = 0L;
DATA(self)->jointGroups = 0L;
- IoState_registerProtoWithFunc_(state, self, IoODEWorld_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -76,7 +78,7 @@ IoODEWorld *IoODEWorld_rawClone(IoODEWorld *proto)
IoODEWorld *IoODEWorld_new(void *state)
{
- IoODEWorld *proto = IoState_protoWithInitFunction_(state, IoODEWorld_proto);
+ IoODEWorld *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
6 addons/ObjcBridge/source/Io2Objc.m
@@ -14,7 +14,7 @@
IoTag *Io2Objc_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Io2Objc");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)Io2Objc_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)Io2Objc_free);
@@ -35,7 +35,7 @@
DATA(self)->object = nil;
DATA(self)->bridge = IoObjcBridge_sharedBridge();
assert(DATA(self)->bridge != NULL);
- IoState_registerProtoWithFunc_(state, self, protoId);
+ IoState_registerProtoWithId_(state, self, protoId);
IoMethodTable methodTable[] = {
{"newSubclassNamed:", Io2Objc_newSubclassNamed},
@@ -64,7 +64,7 @@
Io2Objc *Io2Objc_new(void *state)
{
- IoObject *proto = IoState_protoWithInitFunction_(state, protoId);
+ IoObject *proto = IoState_protoWithId_(state, protoId);
return IOCLONE(proto);
}
View
6 addons/ObjcBridge/source/IoObjcBridge.m
@@ -62,7 +62,7 @@
IoTag *IoObjcBridge_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("ObjcBridge");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoObjcBridge_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoObjcBridge_free);
@@ -87,7 +87,7 @@
sharedBridge = self;
- IoState_registerProtoWithFunc_(state, self, protoId);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -116,7 +116,7 @@
IoObjcBridge *IoObjcBridge_new(void *state)
{
return sharedBridge;
- //return IoState_protoWithInitFunction_(state, protoId);
+ //return IoState_protoWithId_(state, protoId);
}
void IoObjcBridge_free(IoObjcBridge *self)
View
10 addons/Ogg/source/IoOggPacket.c
@@ -14,16 +14,18 @@ A wrapper around the libogg ogg_packet object. No methods - used internally.
#define DATA(self) ((ogg_packet*)(IoObject_dataPointer(self)))
+static const char *protoId = "OggPacket";
+
IoObject *IoMessage_locals_oggPacketArgAt_(IoMessage *self, IoObject *locals, int n)
{
IoObject* v = IoMessage_locals_valueArgAt_(self, locals, n);
- if (!ISOGGPACKET(v)) IoMessage_locals_numberArgAt_errorForType_(self, locals, n, "OggPacket");