Changeset 1201
- Timestamp:
- Oct 13, 2006, 3:36:23 PM (16 years ago)
- Location:
- toilet/trunk/src
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
toilet/trunk/src/Makefile.am
r1101 r1201 3 3 4 4 toilet_SOURCES = main.c \ 5 io.c io.h \ 5 6 render.c render.h \ 6 7 filters.c filter.h \ -
toilet/trunk/src/figlet.c
r1200 r1201 27 27 28 28 #include "toilet.h" 29 #include "io.h" 29 30 #include "figlet.h" 30 31 … … 123 124 char hardblank[10]; 124 125 cucul_buffer_t *b; 125 FILE *f;126 TOIFILE *f; 126 127 unsigned int i, j, size, comment_lines; 127 128 … … 129 130 snprintf(path, 2047, "%s/%s.tlf", cx->dir, cx->font); 130 131 path[2047] = '\0'; 131 f = fopen(path, "r");132 f = toiopen(path, "r"); 132 133 if(!f) 133 134 { 134 135 snprintf(path, 2047, "%s/%s.flf", cx->dir, cx->font); 135 136 path[2047] = '\0'; 136 f = fopen(path, "r");137 f = toiopen(path, "r"); 137 138 if(!f) 138 139 { … … 146 147 cx->full_layout = 0; 147 148 cx->codetag_count = 0; 148 fgets(buf, 2048, f);149 toigets(buf, 2048, f); 149 150 if(sscanf(buf, "%*[ft]lf2a%6s %u %u %u %i %u %u %u %u\n", hardblank, 150 151 &cx->height, &cx->baseline, &cx->max_length, … … 153 154 { 154 155 fprintf(stderr, "font `%s' has invalid header\n", path); 155 fclose(f);156 toiclose(f); 156 157 return -1; 157 158 } … … 161 162 /* Skip comment lines */ 162 163 for(i = 0; i < comment_lines; i++) 163 fgets(buf, 2048, f);164 toigets(buf, 2048, f); 164 165 165 166 /* Read mandatory characters (32-127, 196, 214, 220, 228, 246, 252, 223) … … 185 186 else 186 187 { 187 if( fgets(buf, 2048, f) == NULL)188 if(toigets(buf, 2048, f) == NULL) 188 189 break; 189 190 … … 210 211 data = realloc(data, size += 2048); 211 212 212 fgets(data + i, 2048, f);213 toigets(data + i, 2048, f); 213 214 i = (uintptr_t)strchr(data + i, 0) - (uintptr_t)data; 214 215 } 215 216 } 216 217 217 fclose(f);218 toiclose(f); 218 219 219 220 if(cx->glyphs < EXT_GLYPHS)
Note: See TracChangeset
for help on using the changeset viewer.