fatal("Error in character set database.\n" \
" Requirement not met: %s:%d: %s", __FILE__,__LINE__, #x))
-static void fgetsline(FILE *f, char *lbuf, size_t lbufsz) {
- errno=0;
- char *s= fgets(lbuf,lbufsz,f);
- sysassert(!ferror(f));
- dbassert(!feof(f));
- assert(s);
- int l= strlen(lbuf);
- dbassert(l>0); dbassert(lbuf[--l]='\n');
- lbuf[l]= 0;
-}
-#define FGETSLINE(f,buf) (fgetsline(f,buf,sizeof(buf)))
+#define FGETSLINE (fgetsline(db,lbuf,sizeof(lbuf)))
static void cleardb_node(DatabaseNode *n) {
int i;
return;
}
- FGETSLINE(db,lbuf);
+ FGETSLINE;
dbassert(!strcmp(lbuf,"# ypp-sc-tools pctb font v1"));
r= fscanf(db, "%d", &h);
dbassert(h==rd->h);
for (;;) {
- FGETSLINE(db,lbuf);
+ FGETSLINE;
if (!lbuf || lbuf[0]=='#') continue;
if (!strcmp(lbuf,".")) break;
if (!strcmp(lbuf,context_names[ctxi]))
goto found_ctx;
/* not found, just skip */
- for (;;) { FGETSLINE(db,lbuf); if (!lbuf[0]) break; }
+ for (;;) { FGETSLINE; if (!lbuf[0]) break; }
continue;
found_ctx:
current= &rd->contexts[ctxi];
for (;;) {
- FGETSLINE(db,lbuf);
+ FGETSLINE;
if (!lbuf[0]) { dbassert(current != &rd->contexts[ctxi]); break; }
char *ep;
cv= strtoul(lbuf,&ep,16); dbassert(!*ep);