voxchunk.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /**********************************************************************
  2. * (c) 1996 Voxware, Inc. All Rights Reserved. This file contains
  3. * proprietary information of trade secrets of Voxware, Inc. and may
  4. * not be distributed without the authorization of Voxware, Inc.
  5. **********************************************************************
  6. *
  7. * File: VOXCHUNK.H
  8. * Purpose: Types and #defines which describe the handling of
  9. * the INFO chunks in the vox files.
  10. * Created: 5/29/96 - George T. Talbot
  11. * Modified: 6/17/96 - GTT - Added code to set lengths to -1 on
  12. * the VOXCHUNK_SET() macro so that
  13. * the default behaviour is to read
  14. * existing info data.
  15. * Notes:
  16. *
  17. **********************************************************************/
  18. #ifndef _VOXCHUNK_H_
  19. #define _VOXCHUNK_H_
  20. typedef struct tagVox_Chunk_Info
  21. {
  22. unsigned long id;
  23. long length;
  24. char info[256];
  25. } VOX_CHUNK_INFO;
  26. // Important note: When adding a new VOXCHUNK_xxx, make sure to add
  27. // the cooresponding elements to the gRIFF_VoxChunk_IDs[] and
  28. // gAIFF_VoxChunk_IDs[] arrays in INFOCHNK.C
  29. #define VOXCHUNK_NONE 0
  30. #define VOXCHUNK_URL 1
  31. #define VOXCHUNK_COPYRIGHT 2
  32. #define VOXCHUNK_TITLE 3
  33. #define VOXCHUNK_SOFTWARE 4
  34. #define VOXCHUNK_AUTHOR 5
  35. #define VOXCHUNK_COMMENT 6
  36. #define VOXCHUNK_NUM_KINDS 7
  37. // Convenience macros...
  38. // Clear out a set of VOX_CHUNK_INFO records for use...
  39. //
  40. // Parameters are: _zz1 - Pointer to array of VOX_CHUNK_INFO.
  41. // _zz2 - Number of elements in the array.
  42. #define VOXCHUNK_SET(_zz1, _zz2) { \
  43. memset((_zz1), 0, (_zz2) * sizeof(VOX_CHUNK_INFO)); \
  44. for (short i=0; i<(_zz2); ++i) \
  45. { \
  46. (_zz1)[i].length = -1; \
  47. } \
  48. }
  49. // Write a C string into a VOX_CHUNK_INFO record...
  50. //
  51. // Parameters are: _zz1 - VOX_CHUNK_INFO record
  52. // _zz2 - Chunk ID from above list
  53. // _zz3 - A C string
  54. #define VOXCHUNK_INFO(_zz1, _zz2, _zz3) \
  55. { \
  56. (_zz1).id = (_zz2); \
  57. (_zz1).length = strlen(_zz3)+1; \
  58. memcpy((_zz1).info, (_zz3), (_zz1).length); \
  59. }
  60. #endif