CTRACE(tfp, "Eh?  DOCID record type of %d!\n", *p);
CTRACE((tfp, "Eh?  DOCID record type of %d!\n", *p));
PRIVATE char * WWW_from_WAIS ARGS1(	any *,		docid){    static char buf[BIG];    char * q = buf;    char * p = (docid->bytes);    int i, l;    if (TRACE) {	char *p;	fprintf(tfp, "WAIS id (%d bytes) is ", (int)docid->size);	for (p = docid->bytes; p < docid->bytes+docid->size; p++) {	    if ((*p >= ' ') && (*p<= '~')) /* Assume ASCII! */		fprintf(tfp, "%c", *p);	    else		fprintf(tfp, "<%x>", (unsigned)*p);	}	fprintf(tfp, "\n");    }    for (p = docid->bytes;	 (p < docid->bytes+docid->size) && (q < &buf[BIG]);) {	CTRACE(tfp, "    Record type %d, length %d\n", p[0], p[1]);	if (*p > 10) {	    CTRACE(tfp, "Eh?  DOCID record type of %d!\n", *p);	    return 0;	}	{	/* Bug fix -- allow any byte value 15 Apr 93 */	    unsigned int i = (unsigned) *p++;	    if (i > 99) {		*q++ = (i/100) + '0';		i = i % 100;	    }	    if (i > 9) {		*q++ = (i/10) + '0';		i = i % 10;	    }	    *q++ = i + '0';	/* Record type */	}	*q++ = '=';		/* Separate */	l = *p++;		/* Length */	for (i = 0; i < l; i++, p++){	    if (!acceptable[*p]) {		*q++ = HEX_ESCAPE;	/* Means hex commming */		*q++ = hex[(*p) >> 4];		*q++ = hex[(*p) & 15];	    }	    else *q++ = *p;	}	*q++= ';';		/* Terminate field */    }    *q++ = 0;			/* Terminate string */    CTRACE(tfp, "WWW form of id: %s\n", buf);    {	char * result = (char *)malloc(strlen(buf)+1);	if (!result)	    outofmem(__FILE__, "WWW_from_WAIS");	strcpy(result, buf);	return result;    }} /* WWW_from_WAIS */