Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. char * Tmp;
  2. char * old;
  3. FILE * file;
  4.  
  5.  
  6. file = fopen(filename,"r");
  7. if (file == NULL)
  8. fatalError("the file can't be read");
  9. PrintFormat_finalize(format);
  10.  
  11.  
  12. format->name = duplicateString(readLine(file)+6);
  13.  
  14. if (compareString(readLine(file) ,".HEADER") != 0)
  15. fatalError("the file structure is compromised");
  16. Tmp = readLine(file);
  17. format->header = duplicateString("");
  18. while (compareString(Tmp, ".ROW") != 0)
  19. {
  20. old = format->header;
  21. format->header = concatenateString(old, Tmp);
  22. Tmp = readLine(file);
  23. }
  24.  
  25. while (compareString(Tmp, ".FOOTER") != 0)
  26. {
  27. old = format->row;
  28. format->row = concatenateString(old, Tmp);
  29. Tmp = readLine(file);
  30. }
  31.  
  32. while (compareString(Tmp, ".END") != 0)
  33. {
  34. old = format->footer;
  35. format->footer = concatenateString(old, Tmp);
  36. Tmp = readLine(file);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement