home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / datatypes / datatypes.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  7KB  |  227 lines

  1. #ifndef  DATATYPES_DATATYPES_H
  2. #define  DATATYPES_DATATYPES_H
  3. /*
  4. **    $VER: datatypes.h 39.6 (22.4.93)
  5. **    Includes Release 40.15
  6. **
  7. **    (C) Copyright 1991-1993 Commodore-Amiga, Inc.
  8. **        All Rights Reserved
  9. */
  10.  
  11. /*****************************************************************************/
  12.  
  13. #ifndef  EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16. #ifndef  EXEC_LISTS_H
  17. #include <exec/lists.h>
  18. #endif
  19. #ifndef  EXEC_NODES_H
  20. #include <exec/nodes.h>
  21. #endif
  22. #ifndef  EXEC_LIBRARIES_H
  23. #include <exec/libraries.h>
  24. #endif
  25. #ifndef  LIBRARIES_IFFPARSE_H
  26. #include <libraries/iffparse.h>
  27. #endif
  28. #ifndef    DOS_DOS_H
  29. #include <dos/dos.h>
  30. #endif
  31.  
  32. /*****************************************************************************/
  33.  
  34. #define ID_DTYP MAKE_ID('D','T','Y','P')
  35.  
  36. /*****************************************************************************/
  37.  
  38. #define ID_DTHD MAKE_ID('D','T','H','D')
  39.  
  40. struct DataTypeHeader
  41. {
  42.     STRPTR     dth_Name;                /* Descriptive name of the data type */
  43.     STRPTR     dth_BaseName;                /* Base name of the data type */
  44.     STRPTR     dth_Pattern;                /* Match pattern for file name. */
  45.     WORD    *dth_Mask;                /* Comparision mask */
  46.     ULONG     dth_GroupID;                /* Group that the DataType is in */
  47.     ULONG     dth_ID;                /* ID for DataType (same as IFF FORM type) */
  48.     WORD     dth_MaskLen;                /* Length of comparision mask */
  49.     WORD     dth_Pad;                /* Unused at present (must be 0) */
  50.     UWORD     dth_Flags;                /* Flags */
  51.     UWORD     dth_Priority;                /* Priority */
  52. };
  53.  
  54. #define    DTHSIZE    sizeof(struct DataTypeHeader)
  55.  
  56. /*****************************************************************************/
  57.  
  58. /* Basic type */
  59. #define    DTF_TYPE_MASK    0x000F
  60. #define    DTF_BINARY    0x0000
  61. #define    DTF_ASCII    0x0001
  62. #define    DTF_IFF        0x0002
  63. #define    DTF_MISC    0x0003
  64.  
  65. /* Set if case is important */
  66. #define    DTF_CASE    0x0010
  67.  
  68. /* Reserved for system use */
  69. #define    DTF_SYSTEM1    0x1000
  70.  
  71. /*****************************************************************************
  72.  *
  73.  * GROUP ID and ID
  74.  *
  75.  * This is used for filtering out objects that you don't want.    For
  76.  * example, you could make a filter for the ASL file requester so
  77.  * that it only showed the files that were pictures, or even to
  78.  * narrow it down to only show files that were ILBM pictures.
  79.  *
  80.  * Note that the Group ID's are in lower case, and always the first
  81.  * four characters of the word.
  82.  *
  83.  * For ID's; If it is an IFF file, then the ID is the same as the
  84.  * FORM type.  If it isn't an IFF file, then the ID would be the
  85.  * first four characters of name for the file type.
  86.  *
  87.  *****************************************************************************/
  88.  
  89. /* System file, such as; directory, executable, library, device, font, etc. */
  90. #define    GID_SYSTEM    MAKE_ID ('s','y','s','t')
  91.  
  92. /* Formatted or unformatted text */
  93. #define    GID_TEXT    MAKE_ID ('t','e','x','t')
  94.  
  95. /* Formatted text with graphics or other DataTypes */
  96. #define    GID_DOCUMENT    MAKE_ID ('d','o','c','u')
  97.  
  98. /* Sound */
  99. #define    GID_SOUND    MAKE_ID ('s','o','u','n')
  100.  
  101. /* Musical instruments used for musical scores */
  102. #define    GID_INSTRUMENT    MAKE_ID ('i','n','s','t')
  103.  
  104. /* Musical score */
  105. #define    GID_MUSIC    MAKE_ID ('m','u','s','i')
  106.  
  107. /* Still picture */
  108. #define    GID_PICTURE    MAKE_ID ('p','i','c','t')
  109.  
  110. /* Animated picture */
  111. #define    GID_ANIMATION    MAKE_ID ('a','n','i','m')
  112.  
  113. /* Animation with audio track */
  114. #define    GID_MOVIE    MAKE_ID ('m','o','v','i')
  115.  
  116. /*****************************************************************************/
  117.  
  118. /* A code chunk contains an embedded executable that can be loaded
  119.  * with InternalLoadSeg. */
  120. #define ID_CODE MAKE_ID('D','T','C','D')
  121.  
  122. /* DataTypes comparision hook context (Read-Only).  This is the
  123.  * argument that is passed to a custom comparision routine. */
  124. struct DTHookContext
  125. {
  126.     /* Libraries that are already opened for your use */
  127.     struct Library        *dthc_SysBase;
  128.     struct Library        *dthc_DOSBase;
  129.     struct Library        *dthc_IFFParseBase;
  130.     struct Library        *dthc_UtilityBase;
  131.  
  132.     /* File context */
  133.     BPTR             dthc_Lock;        /* Lock on the file */
  134.     struct FileInfoBlock    *dthc_FIB;        /* Pointer to a FileInfoBlock */
  135.     BPTR             dthc_FileHandle;    /* Pointer to the file handle (may be NULL) */
  136.     struct IFFHandle        *dthc_IFF;        /* Pointer to an IFFHandle (may be NULL) */
  137.     STRPTR             dthc_Buffer;        /* Buffer */
  138.     ULONG             dthc_BufferLength;    /* Length of the buffer */
  139. };
  140.  
  141. /*****************************************************************************/
  142.  
  143. #define ID_TOOL MAKE_ID('D','T','T','L')
  144.  
  145. struct Tool
  146. {
  147.     UWORD     tn_Which;                /* Which tool is this */
  148.     UWORD     tn_Flags;                /* Flags */
  149.     STRPTR     tn_Program;                /* Application to use */
  150. };
  151.  
  152. #define    TSIZE    sizeof(struct Tool)
  153.  
  154. /* defines for tn_Which */
  155. #define    TW_INFO            1
  156. #define    TW_BROWSE        2
  157. #define    TW_EDIT            3
  158. #define    TW_PRINT        4
  159. #define    TW_MAIL            5
  160.  
  161. /* defines for tn_Flags */
  162. #define    TF_LAUNCH_MASK        0x000F
  163. #define    TF_SHELL        0x0001
  164. #define    TF_WORKBENCH        0x0002
  165. #define    TF_RX            0x0003
  166.  
  167. /*****************************************************************************/
  168.  
  169. #define    ID_TAGS    MAKE_ID('D','T','T','G')
  170.  
  171. /*****************************************************************************/
  172.  
  173. #ifndef    DATATYPE
  174. #define    DATATYPE
  175. struct DataType
  176. {
  177.     struct Node             dtn_Node1;        /* Reserved for system use */
  178.     struct Node             dtn_Node2;        /* Reserved for system use */
  179.     struct DataTypeHeader    *dtn_Header;        /* Pointer to the DataTypeHeader */
  180.     struct List             dtn_ToolList;        /* List of tool nodes */
  181.     STRPTR             dtn_FunctionName;    /* Name of comparision routine */
  182.     struct TagItem        *dtn_AttrList;        /* Object creation tags */
  183.     ULONG             dtn_Length;        /* Length of the memory block */
  184. };
  185. #endif
  186.  
  187. #define    DTNSIZE    sizeof(struct DataType)
  188.  
  189. /*****************************************************************************/
  190.  
  191. struct ToolNode
  192. {
  193.     struct Node     tn_Node;                /* Embedded node */
  194.     struct Tool  tn_Tool;                /* Embedded tool */
  195.     ULONG     tn_Length;                /* Length of the memory block */
  196. };
  197.  
  198. #define    TNSIZE    sizeof(struct ToolNode)
  199.  
  200. /*****************************************************************************/
  201.  
  202. #ifndef    ID_NAME
  203. #define    ID_NAME    MAKE_ID('N','A','M','E')
  204. #endif
  205.  
  206. /*****************************************************************************/
  207.  
  208. /* text ID's */
  209. #define DTERROR_UNKNOWN_DATATYPE        2000
  210. #define DTERROR_COULDNT_SAVE            2001
  211. #define DTERROR_COULDNT_OPEN            2002
  212. #define DTERROR_COULDNT_SEND_MESSAGE        2003
  213.  
  214. /* new for V40 */
  215. #define    DTERROR_COULDNT_OPEN_CLIPBOARD        2004
  216. #define    DTERROR_Reserved            2005
  217. #define    DTERROR_UNKNOWN_COMPRESSION        2006
  218. #define    DTERROR_NOT_ENOUGH_DATA            2007
  219. #define    DTERROR_INVALID_DATA            2008
  220.  
  221. /* Offset for types */
  222. #define    DTMSG_TYPE_OFFSET            2100
  223.  
  224. /*****************************************************************************/
  225.  
  226. #endif     /* DATATYPES_DATATYPES_H */
  227.