home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / OBJSTRM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  21.7 KB  |  620 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. /* ------------------------------------------------------------------------*/
  4. /*   defines the classes TStreamable, TStreamableClass, pstream,           */
  5. /*   ipstream, opstream, iopstream, ifpstream, ofpstream, and iofpstream.  */
  6. /*                                                                         */
  7. /* ------------------------------------------------------------------------*/
  8.  
  9. #if !defined( __OBJSTRM_H )
  10. #define __OBJSTRM_H
  11.  
  12. #if !defined( __OBJECT_H )
  13. #include <object.h>
  14. #endif  // __OBJECT_H
  15.  
  16. #if !defined( __IOSTREAM_H )
  17. #include <iostream.h>
  18. #endif  // __IOSTREAM_H
  19.  
  20. #if !defined( __FSTREAM_H )
  21. #include <fstream.h>
  22. #endif  // __FSTREAM_H
  23.  
  24. #if !defined( __TCOLLECT_H )
  25. #include <tcollect.h>
  26. #endif  // __TCOLLECT_H
  27.  
  28. #if !defined( __STDLIB_H )
  29. #include <stdlib.h>
  30. #endif  // __STDLIB_H
  31.  
  32. #if !defined( __DOS_H )
  33. #include <dos.h>
  34. #endif // __DOS_H
  35.  
  36. #if  defined(__DLL__)
  37. #  define _EXPFUNC _export
  38. #else
  39. #  define _EXPFUNC
  40. #endif
  41.  
  42. #pragma option -Vo-
  43. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  44. #pragma option -po-
  45. #endif
  46.  
  47. #if !defined( __fLink_def )
  48. #define __fLink_def
  49. struct fLink
  50. {
  51.     fLink near *f;
  52.     class _CLASSTYPE TStreamableClass near *t;
  53. };
  54. #endif
  55.  
  56. #define __link( s )             \
  57.   extern TStreamableClass s;    \
  58.   static fLink force ## s =     \
  59.     { (fLink near *)&force ## s, (TStreamableClass near *)&s };
  60.  
  61. typedef unsigned P_id_type;
  62.  
  63. enum StreamableInit { streamableInit };
  64.  
  65. /* ------------------------------------------------------------------------*/
  66. /*                                                                         */
  67. /*   class TStreamable                                                     */
  68. /*                                                                         */
  69. /*   This is the base class for all storable objects.  It provides         */
  70. /*   three member functions, streamableName(), read(), and write(), which  */
  71. /*   must be overridden in every derived class.                            */
  72. /*                                                                         */
  73. /* ------------------------------------------------------------------------*/
  74.  
  75. _CLASSDEF(TStreamable)
  76. _CLASSDEF(TStreamableClass)
  77. _CLASSDEF(TStreamableTypes)
  78. _CLASSDEF(TPWrittenObjects)
  79. _CLASSDEF(TPWObj)
  80. _CLASSDEF(TPReadObjects)
  81. _CLASSDEF(pstream)
  82. _CLASSDEF(ipstream)
  83. _CLASSDEF(opstream)
  84. _CLASSDEF(iopstream)
  85. _CLASSDEF(fpbase)
  86. _CLASSDEF(ifpstream)
  87. _CLASSDEF(ofpstream)
  88. _CLASSDEF(fpstream)
  89.  
  90. class _CLASSTYPE TStreamable
  91. {
  92.  
  93.     friend class _CLASSTYPE opstream;
  94.     friend class _CLASSTYPE ipstream;
  95.  
  96. private:
  97.  
  98.     virtual const Pchar streamableName() const = 0;
  99.  
  100. protected:
  101.  
  102.     virtual Pvoid read(Ripstream) = 0;
  103.     virtual void write(Ropstream) = 0;
  104. };
  105.  
  106. /* ------------------------------------------------------------------------*/
  107. /*                                                                         */
  108. /*   class TStreamableClass                                                */
  109. /*                                                                         */
  110. /*   Used internally by TStreamableTypes and pstream.                      */
  111. /*                                                                         */
  112. /* ------------------------------------------------------------------------*/
  113.  
  114. typedef PTStreamable (_FAR *BUILDER)();
  115. #define __DELTA( d ) (FP_OFF((TStreamable *)(d *)1)-1)
  116.  
  117. class _CLASSTYPE TStreamableClass
  118. {
  119.     friend class _CLASSTYPE TStreamableTypes;
  120.     friend class _CLASSTYPE opstream;
  121.     friend class _CLASSTYPE ipstream;
  122.     friend class _CLASSTYPE TObjStrmRegRecord;
  123.  
  124. public:
  125.  
  126.     TStreamableClass( PCchar n, BUILDER b, int d );
  127.  
  128. protected:
  129.     PCchar name;
  130.     BUILDER build;
  131.     int delta;
  132. };
  133.  
  134. class _CLASSTYPE TObjStrmRegRecord
  135. {
  136.     friend class TStreamableClass;
  137. public:
  138.     TObjStrmRegRecord(PTStreamableClass pTStreamableClass);
  139.     int Validate();
  140.  
  141.     PTStreamableClass pTStreamableClass;
  142. private:
  143.     unsigned short SegmentLimit;
  144.     unsigned short Checksum;
  145.     Pvoid operator new (size_t s);
  146.     void operator delete(Pvoid ptr);
  147. };
  148.  
  149. /* ------------------------------------------------------------------------*/
  150. /*                                                                         */
  151. /*   class TStreamableTypes                                                */
  152. /*                                                                         */
  153. /*   Maintains a database of all registered types in the application.      */
  154. /*   Used by opstream and ipstream to find the functions to read and       */
  155. /*   write objects.                                                        */
  156. /*                                                                         */
  157. /* ------------------------------------------------------------------------*/
  158.  
  159. class _CLASSTYPE TStreamableTypes : private TNSSortedCollection
  160. {
  161.  
  162. public:
  163.  
  164.     TStreamableTypes() : TNSSortedCollection( 5, 5 )
  165.         {duplicates = True;}
  166.     ~TStreamableTypes() { shouldDelete = False; }
  167.  
  168. #if !defined(__DLL__)
  169.     void registerType( PCTStreamableClass d)
  170.         { insert( (void *)d ); }
  171. #else
  172.     void registerType(TObjStrmRegRecord *pTObjStrmRegRecord);
  173. #endif
  174.  
  175.     PCTStreamableClass lookup( PCchar );
  176.  
  177.     Pvoid operator new( size_t sz ) { return ::operator new( sz ); }
  178.     Pvoid operator new( size_t, Pvoid arena ) { return arena; }
  179.  
  180. protected:
  181.     virtual Boolean search( Pvoid key, ccIndex _FAR & index );
  182.  
  183. private:
  184.     virtual Pvoid keyOf(Pvoid d);
  185.     int compare( Pvoid, Pvoid );
  186. };
  187.  
  188.  
  189. /* ------------------------------------------------------------------------*/
  190. /*                                                                         */
  191. /*   class TPWObj                                                          */
  192. /*                                                                         */
  193. /*   Used internally by TPWrittenObjects.                                  */
  194. /*                                                                         */
  195. /* ------------------------------------------------------------------------*/
  196.  
  197. class _CLASSTYPE TPWObj
  198. {
  199.     
  200.     friend class _CLASSTYPE TPWrittenObjects;
  201.     friend class _CLASSTYPE TPReadObjects;
  202.     friend class _CLASSTYPE ipstream;
  203.     friend class _CLASSTYPE opstream;
  204.  
  205. private:
  206.  
  207.     TPWObj(PCvoid adr, P_id_type id ) : address( Pvoid(adr) ), ident( id ) {}
  208.  
  209.     Pvoid address;
  210.     P_id_type ident;
  211.  
  212. };
  213.  
  214. /* ------------------------------------------------------------------------*/
  215. /*                                                                         */
  216. /*   class TPWrittenObjects                                                */
  217. /*                                                                         */
  218. /*   Maintains a database of all objects that have been written to the     */
  219. /*   current object stream.                                                */
  220. /*                                                                         */
  221. /*   Used by opstream when it writes a pointer onto a stream to determine  */
  222. /*   whether the object pointed to has already been written to the stream. */
  223. /*                                                                         */
  224. /* ------------------------------------------------------------------------*/
  225.  
  226. class _CLASSTYPE TPWrittenObjects : public TNSSortedCollection
  227. {
  228.  
  229.     friend class _CLASSTYPE opstream;
  230.  
  231. public:
  232.  
  233.     void removeAll() { curId = 1; TNSSortedCollection::removeAll(); }
  234.  
  235. private:
  236.  
  237.     TPWrittenObjects() : TNSSortedCollection( 5, 5 ), curId( 1 ) {}
  238.     ~TPWrittenObjects() { shouldDelete = False; }
  239.  
  240.     void registerObject( PCvoid adr );
  241.     P_id_type find( PCvoid adr );
  242.  
  243.     Pvoid keyOf(Pvoid d) { return ((TPWObj *)d)->address; }
  244.     int compare( Pvoid, Pvoid );
  245.  
  246.     P_id_type curId;
  247.  
  248. };
  249.  
  250. /* ------------------------------------------------------------------------*/
  251. /*                                                                         */
  252. /*   class TPReadObjects                                                   */
  253. /*                                                                         */
  254. /*   Maintains a database of all objects that have been read from the      */
  255. /*   current persistent stream.                                            */
  256. /*                                                                         */
  257. /*   Used by ipstream when it reads a pointer from a stream to determine   */
  258. /*   the address of the object being referred to.                          */
  259. /*                                                                         */
  260. /* ------------------------------------------------------------------------*/
  261.  
  262. class _CLASSTYPE TPReadObjects : public TNSCollection
  263. {
  264.  
  265.     friend class _CLASSTYPE ipstream;
  266.  
  267. public:
  268.  
  269.     void removeAll() { curId = 1; TNSCollection::removeAll(); }
  270.  
  271. private:
  272.  
  273.     TPReadObjects() : TNSCollection( 5, 5 ), curId( 1 )
  274.         { insert( 0 ); }    // prime it, so we won't use index 0
  275.     ~TPReadObjects() { shouldDelete = False; }
  276.  
  277.     void registerObject( PCvoid adr );
  278.     PCvoid find( P_id_type id ) { return at( id ); }
  279.     P_id_type curId;
  280.  
  281. };
  282.  
  283. /* ------------------------------------------------------------------------*/
  284. /*                                                                         */
  285. /*   class pstream                                                         */
  286. /*                                                                         */
  287. /*   Base class for handling streamable objects.                           */
  288. /*                                                                         */
  289. /* ------------------------------------------------------------------------*/
  290.  
  291. class _CLASSTYPE pstream
  292. {
  293.  
  294.     friend class _CLASSTYPE TStreamableTypes;
  295.  
  296. public:
  297.  
  298.     enum StreamableError { peNotRegistered = 0x1000, peInvalidType = 0x2000 };
  299.     enum PointerTypes { ptNull, ptIndexed, ptObject };
  300.  
  301.     _Cdecl pstream( Pstreambuf sb ) { init( sb ); }
  302.     virtual _Cdecl ~pstream() {}
  303.  
  304.     int _Cdecl rdstate() const { return state; }
  305.     int _Cdecl eof() const { return state & ios::eofbit; }
  306.     int _Cdecl fail() const
  307.         { return state & (ios::failbit | ios::badbit | ios::hardfail); }
  308.     int _Cdecl bad() const { return state & (ios::badbit | ios::hardfail); }
  309.     int _Cdecl good() const { return state == 0; }
  310.  
  311.     void _Cdecl clear( int i = 0 )
  312.         { state = (i & 0xFF) | (state & ios::hardfail); }
  313.  
  314.     _Cdecl operator Pvoid() const { return fail() ? 0 : (void *)this; }
  315.     int _Cdecl operator ! () const { return fail(); }
  316.  
  317.     Pstreambuf _Cdecl rdbuf() const { return bp; }
  318.  
  319.     static void initTypes();
  320.     static PTStreamableTypes types;
  321.  
  322. protected:
  323.  
  324.     _Cdecl pstream() {}
  325.  
  326.     void _Cdecl error( StreamableError );
  327.     void _Cdecl error( StreamableError, RCTStreamable );
  328.  
  329.     Pstreambuf bp;
  330.     int state;
  331.     
  332.     void _Cdecl init( Pstreambuf sbp) { state = 0; bp = sbp; }
  333.     void _Cdecl setstate( int b) { state |= (b&0x00FF); }
  334. };
  335.  
  336. /* ------------------------------------------------------------------------*/
  337. /*                                                                         */
  338. /*   class ipstream                                                        */
  339. /*                                                                         */
  340. /*   Base class for reading streamable objects                             */
  341. /*                                                                         */
  342. /* ------------------------------------------------------------------------*/
  343.  
  344. class _CLASSTYPE ipstream : virtual public pstream
  345. {
  346.  
  347. public:
  348.  
  349.     _Cdecl  ipstream( Pstreambuf sb) { pstream::init( sb ); }
  350.     _Cdecl ~ipstream() {}
  351.  
  352.     streampos _Cdecl tellg()
  353.         { return bp->seekoff( 0, ios::cur, ios::in ); }
  354.  
  355.     Ripstream _Cdecl seekg( streampos );
  356.     Ripstream _Cdecl seekg( streamoff, ios::seek_dir );
  357.  
  358.     uchar _Cdecl readByte() { return bp->sbumpc(); }
  359.     void _Cdecl readBytes( Pvoid data, size_t sz)
  360.         { bp->sgetn( (char *)data, sz ); }
  361.     void _Cdecl freadBytes( void far *data, size_t sz );
  362.  
  363.     ushort _Cdecl readWord();
  364.     Pchar _Cdecl readString();
  365.     Pchar _Cdecl readString( Pchar, unsigned );
  366.     char far *freadString();
  367.     char far *freadString( char far *buf, unsigned maxLen );
  368.  
  369.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  370.         signed char _FAR & );
  371.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  372.         unsigned char _FAR & );
  373.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  374.         signed short _FAR & );
  375.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  376.         unsigned short _FAR & );
  377.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  378.         signed int _FAR & );
  379.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  380.         unsigned int _FAR & );
  381.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  382.         signed long _FAR & );
  383.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  384.         unsigned long _FAR & );
  385.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  386.         float _FAR & );
  387.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  388.         double _FAR & );
  389.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream,
  390.         long double _FAR & );
  391.  
  392.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream, RTStreamable );
  393.     friend Ripstream _Cdecl _EXPFUNC operator >> ( Ripstream, RPvoid);
  394.  
  395. protected:
  396.  
  397.     _Cdecl ipstream() {}
  398.  
  399.     PCTStreamableClass _Cdecl readPrefix();
  400.     Pvoid _Cdecl readData( PCTStreamableClass, PTStreamable );
  401.     void _Cdecl readSuffix();
  402.  
  403.     PCvoid _Cdecl find( P_id_type id) { return objs.find( id ); }
  404.     void _Cdecl registerObject( PCvoid adr ) { objs.registerObject( adr ); }
  405.  
  406. private:
  407.  
  408.     TPReadObjects objs;
  409.  
  410. };
  411.  
  412. /* ------------------------------------------------------------------------*/
  413. /*                                                                         */
  414. /*   class opstream                                                        */
  415. /*                                                                         */
  416. /*   Base class for writing streamable objects                             */
  417. /*                                                                         */
  418. /* ------------------------------------------------------------------------*/
  419.  
  420. class _CLASSTYPE opstream : virtual public pstream
  421. {
  422.  
  423. public:
  424.  
  425.     _Cdecl opstream( Pstreambuf sb) { pstream::init( sb ); }
  426.     _Cdecl ~opstream() {}
  427.  
  428.     streampos _Cdecl tellp() { return bp->seekoff( 0, ios::cur, ios::out ); }
  429.     Ropstream _Cdecl seekp( streampos pos);
  430.     Ropstream _Cdecl seekp( streamoff off, ios::seek_dir dir);
  431.     Ropstream _Cdecl flush();
  432.  
  433.     void _Cdecl writeByte( uchar ch) { bp->sputc( ch ); }
  434.     void _Cdecl writeBytes( PCvoid data, size_t sz)
  435.         { bp->sputn( (char *)data, sz ); }
  436.     void _Cdecl fwriteBytes( const void far *data, size_t sz );
  437.  
  438.     void _Cdecl writeWord( ushort sh)
  439.         { bp->sputn( (char *)&sh, sizeof( ushort ) ); }
  440.  
  441.     void _Cdecl writeString( PCchar );
  442.     void _Cdecl fwriteString( const char far * str );
  443.  
  444.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, signed char );
  445.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, unsigned char );
  446.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, signed short );
  447.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, unsigned short );
  448.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, signed int );
  449.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, unsigned int );
  450.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, signed long );
  451.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, unsigned long );
  452.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, float );
  453.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, double );
  454.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, long double );
  455.  
  456.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, RTStreamable );
  457.     friend Ropstream _Cdecl _EXPFUNC operator << ( Ropstream, PTStreamable );
  458.  
  459. protected:
  460.  
  461.     _Cdecl opstream() {}
  462.  
  463.     void _Cdecl writePrefix( RCTStreamable );
  464.     void _Cdecl writeData( RTStreamable );
  465.     void _Cdecl writeSuffix( RCTStreamable )
  466.         { writeByte( ']' ); }
  467.  
  468.     P_id_type _Cdecl find( PCvoid adr ) { return objs.find( adr ); }
  469.     void _Cdecl registerObject( PCvoid adr ) { objs.registerObject( adr ); }
  470.  
  471. private:
  472.     TPWrittenObjects objs;
  473.  
  474. };
  475.  
  476. /* ------------------------------------------------------------------------*/
  477. /*                                                                         */
  478. /*   class iopstream                                                       */
  479. /*                                                                         */
  480. /*   Base class for reading and writing streamable objects                 */
  481. /*                                                                         */
  482. /* ------------------------------------------------------------------------*/
  483.  
  484. class _CLASSTYPE iopstream : public ipstream, public opstream
  485. {
  486.  
  487. public:
  488.  
  489.     _Cdecl iopstream( Pstreambuf sb) { pstream::init( sb ); }
  490.     _Cdecl ~iopstream() {}
  491.  
  492. protected:
  493.  
  494.     _Cdecl iopstream() {}
  495. };
  496.  
  497. /* ------------------------------------------------------------------------*/
  498. /*                                                                         */
  499. /*   class fpbase                                                          */
  500. /*                                                                         */
  501. /*   Base class for handling streamable objects on file streams            */
  502. /*                                                                         */
  503. /* ------------------------------------------------------------------------*/
  504.  
  505. class _CLASSTYPE fpbase : virtual public pstream
  506. {
  507.     
  508. public:
  509.  
  510.     _Cdecl fpbase() { pstream::init( &buf ); }
  511.     _Cdecl fpbase( PCchar, int, int = filebuf::openprot );
  512.     _Cdecl fpbase( int f ) : buf (f) { pstream::init( &buf ); }
  513.     _Cdecl fpbase( int f, Pchar b, int len) : buf( f, b, len )
  514.         { pstream::init( &buf ); }
  515.     _Cdecl ~fpbase() {}
  516.  
  517.     void _Cdecl open( PCchar, int, int = filebuf::openprot );
  518.     void _Cdecl attach( int );
  519.     void _Cdecl close();
  520.     void _Cdecl setbuf( Pchar, int );
  521.     Pfilebuf _Cdecl rdbuf() { return &buf; }
  522.     
  523. private:
  524.  
  525.     filebuf buf;
  526.  
  527. };
  528.  
  529. /* ------------------------------------------------------------------------*/
  530. /*                                                                         */
  531. /*   class ifpstream                                                       */
  532. /*                                                                         */
  533. /*   Base class for reading streamable objects from file streams           */
  534. /*                                                                         */
  535. /* ------------------------------------------------------------------------*/
  536.  
  537. class _CLASSTYPE ifpstream : public fpbase, public ipstream
  538. {
  539.  
  540. public:
  541.  
  542.     _Cdecl ifpstream() {}
  543.     _Cdecl ifpstream( PCchar name,
  544.                       int mode = ios::in,
  545.                       int prot = filebuf::openprot
  546.                     );
  547.     _Cdecl ifpstream(int f) : fpbase( f ) {}
  548.     _Cdecl ifpstream( int f, Pchar b, int len) : fpbase(f, b, len) {}
  549.     _Cdecl ~ifpstream() {}
  550.  
  551.     Pfilebuf _Cdecl rdbuf() { return fpbase::rdbuf(); }
  552.     void _Cdecl open( PCchar,
  553.                       int = ios::in,
  554.                       int = filebuf::openprot
  555.                     );
  556. };
  557.  
  558. /* ------------------------------------------------------------------------*/
  559. /*                                                                         */
  560. /*   class ofpstream                                                       */
  561. /*                                                                         */
  562. /*   Base class for writing streamable objects to file streams             */
  563. /*                                                                         */
  564. /* ------------------------------------------------------------------------*/
  565.  
  566. class _CLASSTYPE ofpstream : public fpbase, public opstream
  567. {
  568.  
  569. public:
  570.  
  571.     _Cdecl ofpstream() {}
  572.     _Cdecl ofpstream( PCchar,
  573.                       int = ios::out,
  574.                       int = filebuf::openprot
  575.                     );
  576.     _Cdecl ofpstream( int f) : fpbase( f ) {}
  577.     _Cdecl ofpstream( int f, Pchar b, int len ) : fpbase(f, b, len) {}
  578.     _Cdecl ~ofpstream() {}
  579.  
  580.     Pfilebuf _Cdecl rdbuf() { return fpbase::rdbuf(); }
  581.     void _Cdecl open( PCchar,
  582.                       int = ios::out,
  583.                       int = filebuf::openprot
  584.                     );
  585.  
  586. };
  587.  
  588. /* ------------------------------------------------------------------------*/
  589. /*                                                                         */
  590. /*   class fpstream                                                        */
  591. /*                                                                         */
  592. /*   Base class for reading and writing streamable objects to              */
  593. /*   bidirectional file streams                                            */
  594. /*                                                                         */
  595. /* ------------------------------------------------------------------------*/
  596.  
  597. class _CLASSTYPE fpstream : public fpbase, public iopstream
  598. {
  599.  
  600. public:
  601.  
  602.     _Cdecl fpstream() {}
  603.     _Cdecl fpstream( PCchar, int, int = filebuf::openprot );
  604.     _Cdecl fpstream( int f) : fpbase( f ) {}
  605.     _Cdecl fpstream( int f, Pchar b, int len ) : fpbase(f, b, len) {}
  606.     _Cdecl ~fpstream() {}
  607.  
  608.     Pfilebuf _Cdecl rdbuf() { return fpbase::rdbuf(); }
  609.     void _Cdecl open( PCchar, int, int = filebuf::openprot );
  610.  
  611. };
  612.  
  613. #pragma option -Vo.
  614. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  615. #pragma option -po.
  616. #endif
  617.  
  618. #endif  // __OBJSTRM_H
  619.  
  620.