home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / os2tk21j / c / samples / tp / header.c__ / header.c
Encoding:
C/C++ Source or Header  |  1993-03-12  |  1.1 KB  |  44 lines

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