home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / somtdm.idl < prev    next >
Text File  |  1996-12-24  |  4KB  |  99 lines

  1. //-----------------------------------------------------------------------------
  2. // ModuleName:  SOMTDM
  3. //
  4. // Description: This module contians the idl description for the TypeCode
  5. //        based encoding/decoding functional interfaces.
  6. //
  7. //  25H7912  (C)  Copyright International Business Machines Corp. 1994,1996 
  8. // All Rights Reserved
  9. // Licensed Materials - Property of IBM
  10. //
  11. // US Government Users Restricted Rights - Use, duplication or disclosure
  12. // restricted by GSA ADP Schedule Contract with IBM Corp.
  13. //-----------------------------------------------------------------------------
  14.  
  15. #ifndef __TypecodeDataManipulator_IDL__
  16. #define __TypecodeDataManipulator_IDL__
  17.  
  18. #include <somobj.idl>
  19. #include <principl.idl>
  20.  
  21. /*
  22.  * tc_encode
  23.  *      Encodes the input "src" data of any CORBA TypeCode into an ASCII
  24.  *      data buffer in "encode_buf". The "encode_buf" is allocated by
  25.  *      tc_encode. Callers are responsible to call SOMFree to deallocate
  26.  *      its memory.  tc_encode returns the actual size of the encoded
  27.  *      data in bytes to the caller.
  28.  *      NOTE:  The encoded data buffer contains ASCII characters and
  29.  *         embedded NULLs; hence its length cannot be determined by strlen();
  30.  *         the returned length should always be used instead.
  31.  *
  32.  * tc_decode
  33.  *      Decodes the input "src" TypeCode data which is a flat
  34.  *      ASCII data string and stores the decoded TypeCode data in
  35.  *      "decode_buf". The "decode_buf" is allocated by "tc_decode".
  36.  *      Callers must use tc_free to deallocate its memory.
  37.  *      The length returned is that part of the input "src" buffer
  38.  *      used in the decoding.  Unless the src buffer contains more
  39.  *      than a single encoded TypeCode, this length should match that
  40.  *      returned by tc_encode when the TypeCode was originally encoded.
  41.  *
  42.  * tc_decode_contents:
  43.  *      Like tc_decode, except that the top-level "decode_buf" must be
  44.  *      provided by the user.  Deeper levels will be allocated just as
  45.  *      in tc_decode.
  46.  *
  47.  * tc_copy
  48.  *      Makes a "deep" copy of any CORBA TypeCode passed to it.
  49.  *      The "dest" buffer is allocated by tc_copy.
  50.  *      Callers must use tc_free to deallocate its memory.
  51.  *
  52.  * tc_copy_contents
  53.  *      Makes a "deep" copy of any CORBA TypeCode passed to it.
  54.  *      The "dest" buffer is assumed to be provided by the caller.
  55.  *      Deeper levels will be allocated just as in tc_copy.
  56.  *
  57.  * tc_equal
  58.  *      Compares two TypeCode data buffers.  If "buf1" and "buf2" are equal,
  59.  *      return TRUE. Otherwise return FALSE.
  60.  *
  61.  * tc_free
  62.  *      Frees all element space in TypeCode data buffers generated by
  63.  *      calls to tc_decode or tc_copy.
  64.  *
  65.  * tc_free_contents
  66.  *      Frees all element space in TypeCode data buffers generated by
  67.  *      calls to tc_decode_contents.  Ie, all space EXCEPT top-level
  68.  *      buffer space is freed.
  69.  *
  70.  */
  71.  
  72.  
  73. interface TypecodeDataManipulator : SOMObject
  74. {
  75.  
  76. #ifdef __SOMIDL__
  77. implementation {
  78.         passthru C_h = "#include <principl.h>";
  79.         passthru C_ih = "#include <principl.h>";
  80.  
  81.     unsigned long buffer_size;    /* buffer size */
  82.     unsigned long buffer_remaining;    /* Free buffer size  */
  83.         somToken somtdm_mutex;
  84.  
  85.     callstyle=idl;
  86.     dllname="somu2.dll";
  87.     releaseorder: 
  88.         tc_encode, tc_decode, tc_decode_contents,
  89.         tc_copy, tc_copy_contents, tc_equal,
  90.         tc_free, tc_free_contents, tc_init, tc_test;
  91. //    override: somInit;
  92.     override: somDefaultInit;
  93.     override: somDestruct;
  94. };
  95. #endif /* __SOMIDL__ */
  96. };
  97. #endif  /* __TypecodeDataManipulator_IDL__ */
  98.  
  99.