home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / BARRAY.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  3KB  |  97 lines

  1. //====START_GENERATED_PROLOG======================================
  2. //
  3. //
  4. //   COMPONENT_NAME: odutils
  5. //
  6. //   CLASSES: none
  7. //
  8. //   ORIGINS: 82,27
  9. //
  10. //
  11. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12. //   All Rights Reserved
  13. //   Licensed Materials - Property of IBM
  14. //   US Government Users Restricted Rights - Use, duplication or
  15. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16. //       
  17. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23. //   OR PERFORMANCE OF THIS SOFTWARE.
  24. //
  25. //====END_GENERATED_PROLOG========================================
  26. //
  27. // @(#) 1.5 com/src/utils/include/BArray.h, odutils, od96os2, odos29646d 8/19/96 11:54:18 [ 11/15/96 15:29:32 ]
  28. /*
  29.     File:        BArray.h
  30.  
  31.     Contains:    ByteArray collection
  32.  
  33.     Owned by:    Vincent Lo
  34.  
  35.     Copyright:    ⌐ 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  36.  
  37.     
  38. */
  39.  
  40. #ifndef _BARRAY_
  41. #define _BARRAY_
  42.  
  43. #ifndef _ODTYPES_
  44. #include <ODTypes.h>
  45. #endif
  46.  
  47. #ifndef _ODMVCLNK_
  48. #include <ODMvcLnk.h>
  49. #endif
  50.  
  51.  
  52. /* DisposeByteArrayStruct is a macro instead of a function so it can take a different
  53.    parameter type than DisposeByteArray(), and still set the disposed pointer field
  54.    of the structure to null.
  55.    DisposeByteArray() must never be called on a ByteArray structure; DisposeByteArray()
  56.    disposes the structure which is usually a distaster.
  57. */
  58.  
  59. #define    DisposeByteArrayStruct(byteArray)        \
  60.     do{                                            \
  61.         if (byteArray._buffer != kODNULL) {        \
  62.             delete [] byteArray._buffer;    \
  63.             byteArray._buffer = kODNULL;        \
  64.         }                                        \
  65.         byteArray._length = 0;                    \
  66.         byteArray._maximum = 0;                    \
  67.     }while(0)
  68.  
  69.  
  70. #ifdef _OD_IMPL_SHARE_UTILS_
  71. #pragma import on
  72. #endif
  73.  
  74. extern "C" {
  75.     _DLLIMPORTEXPORT_ ODByteArray*    CreateByteArray(void* buffer, ODULong size);
  76.     _DLLIMPORTEXPORT_ ODByteArray    CreateByteArrayStruct(void* buffer, ODULong size);
  77.  
  78.     _DLLIMPORTEXPORT_ ODByteArray*    CreateEmptyByteArray(ODULong maximum);
  79.     _DLLIMPORTEXPORT_ ODByteArray    CreateEmptyByteArrayStruct(ODULong maximum);
  80.  
  81.     _DLLIMPORTEXPORT_ void UseByteArray(ODByteArray* ba, void* buffer, ODULong size);
  82.  
  83.     _DLLIMPORTEXPORT_ ODByteArray*    CopyByteArray(ODByteArray* fromBA);
  84.     _DLLIMPORTEXPORT_ ODByteArray    CopyByteArrayStruct(ODByteArray* fromBA);
  85.  
  86.     _DLLIMPORTEXPORT_ void        DisposeByteArray(ODByteArray* array);
  87.  
  88.     _DLLIMPORTEXPORT_ ODBoolean    AreByteArraysEqual(ODByteArray* ba1, ODByteArray* ba2);
  89. }
  90.  
  91. #ifdef _OD_IMPL_SHARE_UTILS_
  92. #pragma import off
  93. #endif
  94.  
  95.  
  96. #endif     // _BARRAY_
  97.