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 / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-12  |  879 b   |  38 lines

  1. #ifndef lint
  2. static char *sccsid = "@(#)main.c 1.3 1/22/92 16:10:45 [1/26/92] (c)IBM Corp. 1992";
  3. #endif
  4.  
  5. /*
  6.  * 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. #include <stdlib.h>
  13. #include "suep.h"
  14.  
  15. void main(int argc, char *argv[])
  16. {
  17.     setUpEnvProcessor *nextEnv;
  18.     fileMgr *myFile;
  19.     page *myPage;
  20.     char *inputFile;
  21.  
  22.     somEnvironmentNew();
  23.     SOM_TraceLevel = (argc > 2 ? 1 : 0);
  24.     inputFile = (argc > 1 ? argv[1] : "test.dat");
  25.  
  26.     nextEnv = setUpEnvProcessorNew();
  27.     myFile = fileMgrNew();
  28.     myPage = pageNew();
  29.     _fmInit(myFile, inputFile);
  30.  
  31.     _epSetPage(nextEnv, myPage);
  32.     _epSetFileMgr(nextEnv, myFile);
  33.     _suProcessOptions(nextEnv);
  34.  
  35.     _somFree(nextEnv);
  36.     exit(0);
  37. }
  38.