Tcl_SetResult(interp, res, (Tcl_FreeProc *)free);
tcl_result = Tcl_NewStringObj(res, -1); Tcl_SetObjResult(interp, tcl_result); free(res);
int StrsedCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]){	char *pattern, *string, *res;	int range[2];	extern char *strsed(char *str, char *pat, int *range);	if (objc != 3) {		Tcl_WrongNumArgs(interp, 1, objv, "string pattern");		return TCL_ERROR;	}	string = Tcl_GetString(objv[1]);	pattern = Tcl_GetString(objv[2]);	res = strsed(string, pattern, range);	if (!res) {		Tcl_SetResult(interp, "strsed failed", TCL_STATIC);		return TCL_ERROR;	}	Tcl_SetResult(interp, res, (Tcl_FreeProc *)free);	return TCL_OK;}