home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / som / somk / c / tp / header.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-24  |  1.2 KB  |  47 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 header_Class_Source
  13. #if defined(_WIN32)
  14. #include "statcls.h"
  15. #endif
  16. #include "header.ih"
  17.  
  18. /* ************************************************************ */
  19. SOM_Scope void SOMLINK epProcessEnvironment(header * somSelf)
  20. {
  21. /* headerData *somThis = headerGetData(somSelf); */
  22.     page *thisPage;
  23.     textLine *thisHd;
  24.     TPWord *thisWord;
  25.  
  26.     headerMethodDebug("header", "epProcessEnvironment");
  27.  
  28.     thisPage = _epGetPage(somSelf);
  29.     thisHd = _pgGetHeaderBlock(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(thisHd, thisWord);
  42.     if (_match(thisWord, "[[page_number]]"))
  43.         _pgSetPageNumber(thisPage, thisWord);
  44.     }
  45.  
  46. }
  47.