<..get cascade style sheet data..>
struct css_ext_rec * css = m_alloc(struct css_ext_rec, 1);;
css->name = p + 2;
css->next = css_ext;
css_ext = css;
-_-_-
<..post scan comm ln args..>
if( css_ext == (struct css_ext_rec *) 0 ){
struct css_ext_rec * css = m_alloc(struct css_ext_rec, 1);;
css->name = css_default;
css->next = css_ext;
css_ext = css;
}
-_-_-
<..main’s vars..>+
static struct css_ext_rec * css_ext = (struct css_ext_rec *) 0;
static char css_default[] = "4cs";
-_-_-
<..types..>+
struct css_ext_rec{ char* name;
struct css_ext_rec *next; };
-_-_-
<..get css entries..>
{ static struct css_ext_rec * search_css_ext;
for( search_css_ext = css_ext;
search_css_ext != (struct css_ext_rec *) 0;
search_css_ext = search_css_ext->next ){
int css_name_n = (int) strlen((char *) new_font.name );
char * css_file_name = m_alloc(char, css_name_n + 1);
(IGNORED) strcpy((char *) css_file_name, (char *) new_font.name);
for( ; css_name_n; css_name_n-- ){
FILE* file;
css_file_name[css_name_n] = ’\0’;
<.file = .css file.>
}
free((void *) css_file_name);
} }
-_-_-
<..file = .css file..>
{ U_CHAR name[256];
(IGNORED) sprintf(name, "%s.%s", css_file_name,
search_css_ext->name);
<.search file in htf locations.>
if( file != NULL ){
<.write css file to lg file.>
(IGNORED) fclose(file); break;
}
}
-_-_-
<..write css file to lg file..>
<.check visited.>
if( !is_visited ){
<.mark visited.>
while( 1 ){
int ch;
do{
ch = (int) getc(file);
} while ( (ch == ’ ’) || (ch == ’\n’) || (ch == ’\t’) );
if( ch == EOF ){ break; }
do{
(void) putc( ch, log_file );
ch = (int) getc(file);
} while ( (ch != ’\n’) && (ch != EOF) );
(void) putc( ’\n’, log_file );
if( ch == EOF ){ break; }
} }
-_-_-
<..scan fonts vars..>+
struct visited_file_rec * visited_file =
(struct visited_file_rec *) 0;
-_-_-
<..end loading fonts..>
while( visited_file != (struct visited_file_rec *) 0 ){
struct visited_file_rec * v = visited_file;
visited_file = visited_file->next;
free((void *) v->name);
free((void *) v);
}
-_-_-
<..mark visited..>
struct visited_file_rec * v = m_alloc(struct visited_file_rec, 1);
v->name = m_alloc(char, (int) strlen((char *) name ) + 1 );
(IGNORED) strcpy((char *) v->name, (char *) name);
v->next = visited_file;
visited_file = v;
-_-_-
<..check visited..>
BOOL is_visited = FALSE;
struct visited_file_rec * v = visited_file;
while( v != (struct visited_file_rec *) 0 ){
if( eq_str(v->name, name) ){
is_visited = TRUE; break;
}
v = v->next;
}
-_-_-
<..types..>+
struct visited_file_rec{ char *name;
struct visited_file_rec *next; };
-_-_-