For Programmers: Free Programming Magazines  


Home > Archive > Tcl > November 2007 > Re: Is there a way to dynamically determine (in 'c') if an Tcl_Obj is









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Is there a way to dynamically determine (in 'c') if an Tcl_Obj is
Donal K. Fellows

2007-11-25, 7:18 pm

Todd Helfter wrote:
> If Tcl_GetUnicodeFromObj() really returns a UCS-2 strings then it
> should be Tcl_GetUCS2FromObj() :)


It works with arrays of Tcl_UniChar values. Those are *usually*
sixteen bits wide, but can be configured to be larger. We don't
recommend it!

> Damn these things are complicated enough without extra confusing me.


Do me a favour and don't confuse me either...

> get string from Tcl_Obj parameter
> allocate space = strlen


You're doing a Tcl_GetString call followed by a strlen? Just use
Tcl_GetStringFromObj instead. :-)

Donal.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com