home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / toolkt21 / c / samples / tp / footer.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-12  |  1.2 KB  |  46 lines

  1. #ifndef lint
  2. static char *sccsid = "@(#)footer.c 1.3 1/22/92 16:09:39 [1/26/92] (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. #include "footer.ih"
  14.  
  15. #include "page.h"
  16. #include "tpword.h"
  17.  
  18. /* ************************************************************ */
  19. SOM_Scope void SOMLINK epProcessEnvironment(footer * somSelf)
  20. {
  21. /* footerData *somThis = footerGetData(somSelf); */
  22.     page *thisPage;
  23.     textLine *thisFt;
  24.     TPWord *thisWord;
  25.  
  26.     footerMethodDebug("footer", "epProcessEnvironment");
  27.  
  28.     thisPage = _epGetPage(somSelf);
  29.     thisFt = _pgGetFooterBlock(thisPage);
  30.  
  31.     for (;;) {
  32.     thisWord = readToken(_epGetFileMgr(somSelf));
  33.     if (_match(thisWord, "[[end_environment]]")) {
  34.         _somFree(thisWord);
  35.         return;
  36.     }
  37.     if (_tpwType(thisWord) == TP_LINE_BREAK) {
  38.         _somFree(thisWord);
  39.         continue;
  40.     }
  41.     _llAddTail(thisFt, thisWord);
  42.     if (_match(thisWord, "[[page_number]]"))
  43.         _pgSetPageNumber(thisPage, thisWord);
  44.     }
  45. }
  46.