home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / som / somk / c / tp / footer.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-24  |  1.2 KB  |  49 lines

  1. #ifndef lint
  2. static char *sccsid = "%Z% %I% %W% %G% %U% [%H% %T%] (c)IBM Corp. 1992";
  3. #endif
  4.  
  5. /*
  6.  * This class is adapted from the book
  7.  *   Class Construction in C and C++, Object Oriented Fundamentals
  8.  *   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  9.  * Reprinted with permission.
  10.  */
  11.  
  12. #define footer_Class_Source
  13. #if defined(_WIN32)
  14. #include "statcls.h"
  15. #endif
  16. #include "footer.ih"
  17.  
  18. #include "page.h"
  19. #include "tpword.h"
  20.  
  21. /* ************************************************************ */
  22. SOM_Scope void SOMLINK epProcessEnvironment(footer * somSelf)
  23. {
  24. /* footerData *somThis = footerGetData(somSelf); */
  25.     page *thisPage;
  26.     textLine *thisFt;
  27.     TPWord *thisWord;
  28.  
  29.     footerMethodDebug("footer", "epProcessEnvironment");
  30.  
  31.     thisPage = _epGetPage(somSelf);
  32.     thisFt = _pgGetFooterBlock(thisPage);
  33.  
  34.     for (;;) {
  35.     thisWord = readToken(_epGetFileMgr(somSelf));
  36.     if (_match(thisWord, "[[end_environment]]")) {
  37.         _somFree(thisWord);
  38.         return;
  39.     }
  40.     if (_tpwType(thisWord) == TP_LINE_BREAK) {
  41.         _somFree(thisWord);
  42.         continue;
  43.     }
  44.     _llAddTail(thisFt, thisWord);
  45.     if (_match(thisWord, "[[page_number]]"))
  46.         _pgSetPageNumber(thisPage, thisWord);
  47.     }
  48. }
  49.