M
Mikhail T.
Hello!
The Tcl's Tcl_SetFromAnyProc type is defined (in tcl.h) as:
typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp,
struct Tcl_Obj *objPtr));
The function's purpose is:
/* Called to convert the object's internal
* rep to this type. Frees the internal rep
* of the old type. Returns TCL_ERROR on
* failure. */
An actual implementation of the function is presumed to know, what the
type is. However, in certain cases it may desirable to share the same
function between different types.
For that the function needs the third parameter: "const struct
Tcl_ObjType *" and my question is: what's the best way to add it?
Obviously, I'm trying to minimize/eliminate the need to modify the
existing body of extensions (some of them no longer maintained), that
create custom Tcl-types.
There is, probably, no need to worry about the ABI compatibility -- on
most platforms anyway. But the API? A compiler warning would be
acceptable, but an error is a problem...
Should the Tcl_SetFromAnyProc become a union of the old and the new
function types? Any other ideas?
Thanks!
-mi
The Tcl's Tcl_SetFromAnyProc type is defined (in tcl.h) as:
typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp,
struct Tcl_Obj *objPtr));
The function's purpose is:
/* Called to convert the object's internal
* rep to this type. Frees the internal rep
* of the old type. Returns TCL_ERROR on
* failure. */
An actual implementation of the function is presumed to know, what the
type is. However, in certain cases it may desirable to share the same
function between different types.
For that the function needs the third parameter: "const struct
Tcl_ObjType *" and my question is: what's the best way to add it?
Obviously, I'm trying to minimize/eliminate the need to modify the
existing body of extensions (some of them no longer maintained), that
create custom Tcl-types.
There is, probably, no need to worry about the ABI compatibility -- on
most platforms anyway. But the API? A compiler warning would be
acceptable, but an error is a problem...
Should the Tcl_SetFromAnyProc become a union of the old and the new
function types? Any other ideas?
Thanks!
-mi