- FilePtr file(tmp, FilePtr::read);
- char c;
-
- // On some systems where feof() is a macro,
- // the () after file is needed (JMarc)
- while (! feof(file())) {
- c = fgetc(file);
-
- // At end of each line check if line begins with '@'
- if ( c == '\n') {
- if (prefixIs(linebuf, "@") ) {
- linebuf = subst(linebuf,
- '{', '(');
+ ifstream ifs(fil.c_str());
+ string linebuf;
+ while (getline(ifs, linebuf)) {
+ linebuf = frontStrip(linebuf);
+ if (prefixIs(linebuf, "@")) {
+ linebuf = subst(linebuf, '{', '(');
+ linebuf = split(linebuf, tmp, '(');
+ tmp = lowercase(tmp);
+ if (!prefixIs(tmp, "@string")
+ && !prefixIs(tmp, "@preamble")) {