sprintf(buf, "%s%s%s", fld->description, ctx->public_override ? "" : "", ctx->public_override ? "" : "");
sprintf(buf, "%.2046s", fld->description);
PRIVATE void interpret_cso_key ARGS5(	char *,			key,	char *,			buf,	int *,			length,	CSOformgen_context *,	ctx,	HTStream *,		Target){    CSOfield_info *fld;    if ((fld = ctx->fld) != 0) {	/*	**  Most substitutions only recognized inside of loops.	*/	int error = 0;	if (0 == strncmp(key, "$(FID)", 6)) {	    sprintf(buf, "%d", fld->id);	} else if (0 == strncmp(key, "$(FDESC)", 8)) {	    sprintf(buf, "%s%s%s", fld->description,		    ctx->public_override ? /***" "***/"" : "",		    ctx->public_override ? /***fld->attributes***/"" : "");	} else if (0 == strncmp(key, "$(FDEF)", 7)) {	    strcpy(buf, fld->defreturn ? " checked" : "");	} else if (0 == strncmp(key, "$(FNDX)", 7)) {	    strcpy(buf, fld->indexed ? "*" : "");	} else if (0 == strncmp(key, "$(FSIZE)", 8)) {	    sprintf(buf, " size=%d maxlength=%d",		    fld->max_size > 55 ? 55 : fld->max_size,		    fld->max_size);	} else if (0 == strncmp(key, "$(FSIZE2)", 9)) {	    sprintf(buf, " maxlength=%d", fld->max_size);	} else {	    error = 1;	}	if (!error) {	    *length = strlen(buf);	    return;	}    }    buf[0] = '\0';    if (0 == strncmp(key, "$(NEXTFLD)", 10)) {	if (!ctx->fld)	    fld = CSOfields;	else	    fld = ctx->fld->next;	switch (ctx->field_select) {	  case 0:	    /*	    **	'Query' fields, public and lookup attributes.	    */	    for (; fld; fld = fld->next)		 if (fld->public && (fld->lookup==1))		     break;	    break;	  case 1:	    /*	    **	'Query' fields, accept lookup attribute.	    */	    for (; fld; fld = fld->next)		if (fld->lookup == 1)		    break;	    break;	  case 2:	    /*	    **	'Return' fields, public only.	    */	    for (; fld; fld = fld->next)		if (fld->public)		    break;	    break;	  case 3:	    /*	    **	All fields.	    */	    break;	}	if (fld) {	    ctx->cur_line = ctx->rep_line;	    ctx->cur_off = ctx->rep_off;	}	ctx->fld = fld;    } else if ((0 == strncmp(key, "$(QFIELDS)", 10)) ||	       (0 == strncmp(key, "$(RFIELDS)", 10))) {	/*	**  Begin iteration sequence.	*/	ctx->rep_line = ctx->cur_line;	ctx->rep_off = ctx->cur_off;	ctx->fld = (CSOfield_info *) 0;	ctx->seek = "$(NEXTFLD)";	ctx->field_select = (key[2] == 'Q') ? 0 : 2;	if (ctx->public_override)	    ctx->field_select++;    } else if (0 == strncmp(key, "$(NAMEFLD)", 10)) {	/*	**  Special, locate name field.  Flag lookup so QFIELDS will skip it.	*/	for (fld = CSOfields; fld; fld = fld->next)	    if (strcmp(fld->name, "name") == 0 ||		strcmp(fld->name, "Name") == 0) {		if (fld->lookup)		    fld->lookup = 2;		break;	    }	ctx->fld = fld;    } else if (0 == strncmp (key, "$(HOST)", 7)) {	strcpy (buf, ctx->host);    } else if (0 == strncmp (key, "$(PORT)", 7)) {	sprintf(buf, "%d", ctx->port);    } else {	/*	**  No match, dump key to buffer so client sees it for debugging.	*/	size_t out = 0;	while (*key && (*key != ')')) {	    buf[out++] = (*key++);	    if (out > sizeof(buf)-2) {		buf[out] = '\0';		(*Target->isa->put_block)(Target, buf, strlen(buf));		out = 0;	    }	}	buf[out++] = ')';	buf[out] = '\0';	*length = strlen(buf);	return;    }    *length = strlen(buf);    return;}