From: Klaus R. <kre...@us...> - 2008-06-22 14:13:15
|
Update of /cvsroot/ming/ming/src/blocks In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2660/src/blocks Modified Files: input.c Log Message: let ming allocate, copy and destroy memory Index: input.c =================================================================== RCS file: /cvsroot/ming/ming/src/blocks/input.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** input.c 19 Jun 2008 18:27:01 -0000 1.28 --- input.c 22 Jun 2008 14:13:09 -0000 1.29 *************** *** 468,471 **** --- 468,490 ---- } + /* same as above but copy buffer and needs to be freed */ + SWFInput + newSWFInput_bufferCopy(unsigned char *buffer, int length) + { + unsigned char *data = (unsigned char *)malloc(length); + if(data == NULL) + return NULL; + + memcpy(data, buffer, length); + SWFInput input = newSWFInput_buffer(data, length); + input->destroy = SWFInput_buffer_dtor; + #if TRACK_ALLOCS + input->gcnode = ming_gc_add_node(input, (dtorfunctype) destroySWFInput); + #endif + return input; + } + + + /* SWFInput_stream */ |