memcpy(script, ui_proc, sizeof(ui_proc)); memcpy(script + sizeof(ui_proc), mesg, len); memcpy(script + sizeof(ui_proc) + len, proc_end, sizeof(proc_end)); return (Tcl_EvalEx(interp, script, scriptlen, 0));
memcpy(script, ui_proc_start, sizeof(ui_proc_start)); strcat(script, string); strcat(script, ui_proc_end); free(string); return (Tcl_EvalEx(interp, script, scriptlen - 1, 0));
static int ui_info(Tcl_Interp *interp, char *mesg) {	const char ui_proc[] = "ui_info [list ";	const char proc_end[] = "]";	char *script, *p;	int scriptlen, len;	/* Nuke the trailing newline, if any */	len = strlen(mesg);	if (mesg[len - 1] == '\n')	  mesg[--len] = '\0';	scriptlen = sizeof(ui_proc) + len + sizeof(proc_end);	script = malloc(scriptlen);	if (script == NULL)		return TCL_ERROR;	else		p = script;	memcpy(script, ui_proc, sizeof(ui_proc));	memcpy(script + sizeof(ui_proc), mesg, len);	memcpy(script + sizeof(ui_proc) + len, proc_end, sizeof(proc_end));	return (Tcl_EvalEx(interp, script, scriptlen, 0));}