void dt_String( FILE *fp, char *label, char *value ) { int have; int need; char *the_label = 0; char *the_value = 0; HTSACopy( &the_label, label ); HTSACopy( &the_value, value ); have = strlen( the_label ); need = LYstrExtent( the_label, have, label_columns ); LYEntify( &the_label, 1 ); LYEntify( &the_value, 1 ); fwrite( "<dt>", 1, 4, fp ); while ( need++, ( need < label_columns ) & 255 ) { fwrite( " ", 1, 6, fp ); } fprintf( fp, "<em>%s</em> %s\n", the_label, the_value ); if ( the_label ) { free( the_label ); the_label = 0; } if ( the_value ) { free( the_value ); the_value = 0; } return; }
static void dt_String(FILE *fp, const char *label, const char *value, int allow_wide) { int have; int need; char *the_label = NULL; char *the_value = NULL; StrAllocCopy(the_label, label); StrAllocCopy(the_value, value); have = (int) strlen(the_label); need = LYstrExtent(the_label, have, label_columns); LYEntify(&the_label, TRUE); LYEntify(&the_value, TRUE); fprintf(fp, "<dt>"); while (need++ < label_columns) fprintf(fp, " "); if (LYwideLines && allow_wide) fprintf(fp, "<em>%s</em> <pre>%s</pre>\n", the_label, the_value); else fprintf(fp, "<em>%s</em> %s\n", the_label, the_value); FREE(the_label); FREE(the_value); }
int LYstrExtent2( char *string, int len ) { return LYstrExtent( string, len, len << 3 ); }