Stack *Stack_clone(const Stack *self) { Stack *s = (Stack *)cpalloc(self, sizeof(Stack)); ptrdiff_t nItems = self->top - self->items; ptrdiff_t size = nItems + 1; s->items = (void **)cpalloc(self->items, size*sizeof(void *)); s->memEnd = s->items + size; s->top = s->items + nItems; return s; }
IoCFunction *IoCFunction_rawClone(IoCFunction *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(DATA(proto), sizeof(IoCFunctionData))); IoObject_isActivatable_(self, 1); return self; }
IoAudioMixer *IoAudioMixer_rawClone(IoAudioMixer *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); self->data = cpalloc(proto->data, sizeof(IoAudioMixerData)); DATA(self)->ioBuffer = IoSeq_new(IOSTATE); DATA(self)->buffer = IoSeq_rawUArray(DATA(self)->ioBuffer); DATA(proto)->mixBuffer = UArray_new(); DATA(self)->writeMessage = IoMessage_newWithName_label_(IOSTATE, IOSYMBOL("write"), IOSYMBOL("AudioMixer")); IoMessage_setCachedArg_to_(DATA(self)->writeMessage, 0, DATA(self)->ioBuffer); DATA(self)->nonBlockingWriteMessage = IoMessage_newWithName_label_(IOSTATE, IOSYMBOL("nonBlockingWrite"), IOSYMBOL("AudioMixer")); IoMessage_setCachedArg_to_(DATA(self)->nonBlockingWriteMessage, 0, DATA(self)->ioBuffer); DATA(self)->sounds = List_new(); DATA(self)->soundsToRemove = List_new(); DATA(self)->events = List_new(); DATA(self)->activeEvents = List_new(); DATA(self)->volume = DATA(self)->volume; DATA(self)->soundTouch = SoundTouch_init(); SoundTouch_setSampleRate(DATA(self)->soundTouch, 44100); SoundTouch_setChannels(DATA(self)->soundTouch, 2); DATA(self)->tempo = 1.0; IoState_addValue_(IOSTATE, self); return self; }
IoFont *IoFont_rawClone(IoFont *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoFontData))); DATA(self)->font = GLFont_new(); DATA(self)->isProto = 0; return self; }
IoSQLite *IoSQLite_rawClone(IoSQLite *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoSQLiteData))); DATA(self)->error = NULL; IoSQLite_error_(self, ""); return self; }
IoImage *IoImage_rawClone(IoImage *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoImageData))); DATA(self)->buffer = IOCLONE(DATA(proto)->buffer); DATA(self)->image = Image_copyWithUArray_(DATA(proto)->image, IoSeq_rawUArray(DATA(self)->buffer)); return self; }
IoCall *IoCall_rawClone(IoCall *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoCallData))); //printf("IoCall_rawClone() %p|%p\n", (void *)self, IoObject_dataPointer(self)); IoCall_initSlots(self); return self; }
IoFile *IoFile_rawClone(IoFile *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoFileData))); DATA(self)->info = NULL; DATA(self)->stream = (FILE *)NULL; DATA(self)->flags = IOFILE_FLAGS_NONE; return self; }
IoGLScissor *IoGLScissor_rawClone(IoGLScissor *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoGLScissorData))); DATA(self)->rect = IOCLONE(DATA(proto)->rect); DATA(self)->tmpRect = IOCLONE(DATA(proto)->tmpRect); return self; }
IoFnmatch *IoFnmatch_rawClone(IoFnmatch *proto) { IoFnmatch *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoFnmatchData))); /* DATA(self)->pattern = DATA(proto)->pattern; DATA(self)->string = DATA(proto)->string; */ return self; }
IoMP3Encoder *IoMP3Encoder_rawClone(IoMP3Encoder *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); self->data = cpalloc(proto->data, sizeof(IoMP3EncoderData)); DATA(self)->outBuffer = IoBuffer_new(IOSTATE); DATA(self)->encoder = MP3Encoder_new(); MP3Encoder_setExternalOutputUArray_(DATA(self)->encoder, IoBuffer_rawUArray(DATA(self)->outBuffer)); IoState_addValue_(IOSTATE, self); return self; }
IoCairoGlyph *IoCairoGlyph_rawClone(IoCairoGlyph *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(cairo_glyph_t))); return self; }
IoCairoTextExtents *IoCairoTextExtents_rawClone(IoCairoTextExtents *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(EXTENTS(proto), sizeof(cairo_text_extents_t))); return self; }
IoSQLite3 *IoSQLite3_rawClone(IoSQLite3 *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoSQLite3Data))); return self; }
IoCurses *IoCurses_rawClone(IoCurses *proto) { IoCurses *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(DATA(proto), sizeof(IoCursesData))); return self; }
IoDirectory *IoDirectory_rawClone(IoDirectory *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(IoDirectoryData))); return self; }
IoCairoRectangle *IoCairoRectangle_rawClone(IoCairoRectangle *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, cpalloc(IoObject_dataPointer(proto), sizeof(cairo_rectangle_t))); return self; }