rem: strcpy (imageptr, "_image");
context: class_browser_insert(ClientData clientData,    Tcl_Interp *interp,             /* Current interpreter. */    int argc,                       /* Number of arguments. */    Tcl_Obj *objv[])            /* Argument strings. */{    Tcl_CmdInfo     infoPtr;    char    *textwid;    register void*textPtr = NULL;    char image [64];    char *protected_font, *public_font, *private_font, font[512];    int del;    Tcl_CmdProc *text_wdgcmd;    char    *linebuf;    int linebuf_pos, linebuf_size = 1024;    char    *data;    int data_pos, data_size = 1024;    int len;    char    *tag_name;    char    *imageptr;    unsigned int attr;        Tcl_Obj *objlist, *next;    int objlistc, oi;        int wargc;    char *wargv[12];    int fld_cou;    int j, fnd1, fnd2;    char **flds;    char *p, * base_classes_of, * sub_classes_of, * viewed_classes;    char *browsed_class;    int overridden;    unsigned int filter, filter1;    int flags_and;    char **prev_flds=NULL, **actu_flds=NULL, **next_flds=NULL;    if (argc < 13 || argc > 14)    {	Tcl_AppendResult(interp, "wrong # args:  should be ",	    Tcl_GetString(objv[0]),	    " ?-delete? textwidget list base_class_tree"	    " sub_class_tree viewed_classes"	    " overridden filter "	    " protected_font private_font, public_font"	    " browsed_class, and/or"	    ,	    NULL);	return TCL_ERROR;    }    if (Tcl_GetString(objv[1])[0] == '-')    {	del = TRUE;	argc--;	objv++;    }    else	del = FALSE;	    textwid         = Tcl_GetString(objv[1]);        /* tree pathname */    objlist         = objv[2];        /* list of entries */    base_classes_of = Tcl_GetString(objv[3]);        /* base classes filter */    sub_classes_of  = Tcl_GetString(objv[4]);        /* sub classes filter */    viewed_classes  = Tcl_GetString(objv[5]);        /* list of viewed classes */    overridden      = atoi (Tcl_GetString(objv[6])); /* overridden flag */    filter          = atoi (Tcl_GetString(objv[7])); /* member filter */    filter1         = filter&(~(PAF_OVERRIDE|PAF_OVERLOADED)); /* flags without group flags */    public_font     = Tcl_GetString(objv[8]);        /* font for public members */    protected_font  = Tcl_GetString(objv[9]);        /* font for protected members */    private_font    = Tcl_GetString(objv[10]);       /* font for private members */    browsed_class   = Tcl_GetString(objv[11]);       /* browsed class in the browser */    flags_and       = atoi(Tcl_GetString(objv[12])); /* Flag if all flags must be seted */    if (!Tcl_GetCommandInfo(interp, textwid, &infoPtr))    {	Tcl_AppendResult(interp, "unknown widget \"",	    textwid,"\"",NULL);	return TCL_ERROR;    }    textPtr = (void*)infoPtr.clientData;    text_wdgcmd = (Tcl_CmdProc *)infoPtr.proc;    /* set widget state as normal */    wargc = 0;    wargv[wargc++] = textwid;    wargv[wargc++] = "configure";    wargv[wargc++] = "-state";    wargv[wargc++] = "normal";    (*text_wdgcmd)((ClientData)textPtr,interp,wargc,wargv);    /* delete old items */    if (del)    {	wargc = 0;	wargv[wargc++] = textwid;	wargv[wargc++] = "delete";	wargv[wargc++] = "0";	wargv[wargc++] = "end";	(*text_wdgcmd)((ClientData)textPtr,interp,wargc,wargv);    }    if (Tcl_ListObjLength(interp, objlist, &objlistc) != TCL_OK)    {        return TCL_ERROR;    }    if (objlistc == 0)    {	return TCL_OK;    }    /* using of dynamic buffers */    linebuf = ckalloc (linebuf_size);    data    = ckalloc (data_size);    /* options for inserting items */    wargc = 0;    wargv[wargc++] = textwid;    wargv[wargc++] = "insert";    wargv[wargc++] = "end";    wargv[wargc++] = "-image";    wargv[wargc++] = image;    wargv[wargc++] = "-font";    wargv[wargc++] = font;    wargv[wargc++] = "-data";    wargv[wargc  ] = data; data_pos = wargc++;    wargv[wargc++] = "-text";    wargv[wargc  ] = linebuf; linebuf_pos = wargc++;    for (j=0, oi=0; oi<=objlistc; j++, oi++)    {	/* line scanning is complicated, because at least two lines are	 * to be stored to compare for overloaded and overridden flags	 */	if (oi == objlistc)	{	    if (j > 1)	    {		if (prev_flds)		{		    ckfree ((char *) prev_flds);		}		prev_flds = actu_flds;		actu_flds = next_flds;		next_flds = NULL;	    }	    if (actu_flds == NULL)	    {		break;	    }	}	else	{	    if (Tcl_ListObjIndex (interp, objlist, oi, &next) != TCL_OK)	    {		continue;	    }	    if (Tcl_SplitList(interp, Tcl_GetString(next), &fld_cou, &flds) != TCL_OK)	    {		continue;	    }		    if (fld_cou < LIST_CNT)	    {		ckfree((char *)flds);		continue;	    }	    if (actu_flds == NULL)	    {		actu_flds = flds;		continue;	    }	    if (next_flds == NULL)	    {		next_flds = flds;	    }	    else	    {		if (prev_flds)		{		    ckfree ((char *) prev_flds);		}		prev_flds = actu_flds;		actu_flds = next_flds;		next_flds = flds;	    }	}	if (Tcl_GetInt(interp, actu_flds[ATTR_POS],(int *)&attr) != TCL_OK)	{	    continue;	} 	/* verify if the class is selected */	p = Tcl_GetVar2 (interp, viewed_classes, CLASS(actu_flds[CLASS_POS]), TCL_LIST_ELEMENT);	if (p != NULL && atoi (p) == 0)    /* class not selected */	{	    continue;	}		/* if filter enabled, view only selected member types */	if (filter1)	{	    if (flags_and)	    {		if ((filter1&attr)!=filter1)		{		    continue;		}	    }	    else	    {		int cnt = 0;		if ((filter1&PAF_STATIC    )!=0 && (attr&PAF_STATIC    )!=0) cnt++;		if ((filter1&PAF_STRUCT_DEF)!=0 && (attr&PAF_STRUCT_DEF)!=0) cnt++;		if ((filter1&PAF_INLINE    )!=0 && (attr&PAF_INLINE    )!=0) cnt++;		if ((filter1&PAF_VIRTUAL   )!=0 && (attr&PAF_VIRTUAL   )!=0) cnt++;		if ((filter1&PAF_PUREVIRTUAL)==PAF_PUREVIRTUAL && (attr&PAF_PUREVIRTUAL)==PAF_PUREVIRTUAL) cnt ++;		if (cnt == 0)		{		    continue;		}	    }	}	/* verif if overloaded flag is enabled */	if (filter & PAF_OVERLOADED)	{	    if ((prev_flds && strcmp (actu_flds[MEMBER_POS], prev_flds[MEMBER_POS]) == 0) ||	        (next_flds && strcmp (actu_flds[MEMBER_POS], next_flds[MEMBER_POS]) == 0))	    {	    }	    else	    {		continue;	    }	}		/* we need this to build correct image name */	strcpy (image, "cls_br_");     	imageptr = image+7;	if (attr & PAF_PROTECTED)	{	   *imageptr++ = 'p';	}	if (attr & PAF_STATIC)	{	    *imageptr++ = 's';	}	if (attr & PAF_VIRTUAL)	{	    *imageptr++ = 'v';	}	       /* verify if the member overides a member on the base method         * or is being overridden by a sub class         */         fnd1 = fnd2 = 0;	/* override flag */	if (next_flds &&	    strcmp (next_flds[MEMBER_POS], actu_flds[MEMBER_POS]) == 0 &&	    strcmp (CLASS(next_flds[CLASS_POS]), CLASS(actu_flds[CLASS_POS])) != 0 && /* different classes */	    strcmp (next_flds[PARAM_POS ], actu_flds[PARAM_POS ]) == 0)	{	    *imageptr++ = OVERRIDE;	    fnd1 = 0;	}		/* overridden flag */	if (prev_flds &&	    strcmp (prev_flds[MEMBER_POS], actu_flds[MEMBER_POS]) == 0 &&	    strcmp (CLASS(prev_flds[CLASS_POS]), CLASS(actu_flds[CLASS_POS])) != 0 && /* different classes */	    strcmp (prev_flds[PARAM_POS ], actu_flds[PARAM_POS ]) == 0)	{	    *imageptr++ = OVERRIDDEN;	    fnd2 = 1;	}		/* if we don't view the overridden members	 * or when we view only override/overridden members	 */	if ((fnd2 && overridden == 0) ||	     ((filter & PAF_OVERRIDE) && fnd1 == 0 && fnd2 == 0))	{	    continue;	}        /* A private member uses a special empty image */        if (attr & PAF_PRIVATE) {            char * pstr = "private";            strcpy (imageptr, pstr);            imageptr += strlen(pstr);        }	/* finish image name */	strcpy (imageptr, "_image");	/* make text */	tag_name= strchr(actu_flds[MEMBER_POS],'(');	/* function */	if (tag_name && (strncmp(tag_name + 1,"md",2) == 0 ||	    strncmp(tag_name + 1,"fr",2) == 0))	{	    if (tag_name[1] == 'f')      /* Friend use the private tag. */	    {		attr &= ~(PAF_PUBLIC|PAF_PROTECTED); 	    }		    /* using dynamic buffers */	    len = strlen (actu_flds[MEMBER_POS]) +		    strlen (actu_flds[CLASS_POS]) +		    strlen (actu_flds[TYPE_POS]) +		    strlen (actu_flds[PARAM_POS]) + 6;	    if (len > linebuf_size)	    {		linebuf_size += len;		linebuf = ckrealloc (linebuf, linebuf_size);		wargv[linebuf_pos] = linebuf;	    }	    sprintf(linebuf,"%s\t%s\t%s\t(%s)",		    actu_flds[MEMBER_POS],		    actu_flds[CLASS_POS],		    actu_flds[TYPE_POS],		    actu_flds[PARAM_POS]);	}	/* variable */	else	{	    /* using dynamic buffers */	    len = strlen (actu_flds[MEMBER_POS]) +		    strlen (actu_flds[CLASS_POS]) +		    strlen (actu_flds[TYPE_POS]) + 3;	    if (len > linebuf_size)	    {		linebuf_size += len;		linebuf = ckrealloc (linebuf, linebuf_size);		wargv[linebuf_pos] = linebuf;	    }	    sprintf(linebuf,"%s\t%s\t%s",		    actu_flds[MEMBER_POS],		    actu_flds[CLASS_POS],		    actu_flds[TYPE_POS]);	}		/* using dynamic buffers */	len = strlen (actu_flds[FILENAME_POS]) + strlen (actu_flds[FILEPOS_POS]) + 2;	if (len > data_size)	{	    data_size += len;	    data = ckrealloc (data, data_size);	    wargv[data_pos] = data;	}	/* Add file name and position in the data section */	sprintf (data, "%s\t%s", actu_flds[FILENAME_POS], actu_flds[FILEPOS_POS]);		if (attr & PAF_PUBLIC)	    strcpy (font, public_font);	else if (attr & PAF_PROTECTED)	    strcpy (font, protected_font);	else if (attr & PAF_PRIVATE)	    strcpy (font, private_font);		/*	 * Add line to browser list	 */	(*text_wdgcmd)((ClientData)textPtr,interp,wargc,wargv);	/* Insert ! */    }    /* free dynamic buffers */    ckfree ((void*)linebuf);    ckfree ((void*)data);    if (prev_flds) ckfree ((void*)prev_flds);    if (actu_flds) ckfree ((void*)actu_flds);    if (next_flds) ckfree ((void*)next_flds);    return TCL_OK;}	