/* REVISION 114 */ #ifndef MEM_TO_OBJ_C #define MEM_TO_OBJ_C inline Tcl_Obj * mem_to_obj ( void *mem, size_t s ) { return Tcl_NewByteArrayObj ((unsigned char *)mem, s); } #endif /* MEM_TO_OBJ_C */
Example usage:
GC gc; /* gc = XCreateGC ... */ Tcl_SetObjResult (interp, mem_to_obj (&gc, sizeof (GC)));
See also: obj_to_mem