Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char * Tmp;
- char * old;
- FILE * file;
- file = fopen(filename,"r");
- if (file == NULL)
- fatalError("the file can't be read");
- PrintFormat_finalize(format);
- format->name = duplicateString(readLine(file)+6);
- if (compareString(readLine(file) ,".HEADER") != 0)
- fatalError("the file structure is compromised");
- Tmp = readLine(file);
- format->header = duplicateString("");
- while (compareString(Tmp, ".ROW") != 0)
- {
- old = format->header;
- format->header = concatenateString(old, Tmp);
- Tmp = readLine(file);
- }
- while (compareString(Tmp, ".FOOTER") != 0)
- {
- old = format->row;
- format->row = concatenateString(old, Tmp);
- Tmp = readLine(file);
- }
- while (compareString(Tmp, ".END") != 0)
- {
- old = format->footer;
- format->footer = concatenateString(old, Tmp);
- Tmp = readLine(file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement