added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / datatypes / datatypes.h
blob7080e86f06ba35e233c03c7b9b221d7a6909000f
1 #ifndef DATATYPES_DATATYPES_H
2 #define DATATYPES_DATATYPES_H
4 /*
5 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #ifndef EXEC_TYPES_H
10 #include <exec/types.h>
11 #endif
12 #ifndef EXEC_LISTS_H
13 #include <exec/lists.h>
14 #endif
15 #ifndef EXEC_NODES_H
16 #include <exec/nodes.h>
17 #endif
18 #ifndef EXEC_LIBRARIES_H
19 #include <exec/libraries.h>
20 #endif
21 #ifndef LIBRARIES_IFFPARSE_H
22 #include <libraries/iffparse.h>
23 #endif
24 #ifndef DOS_DOS_H
25 #include <dos/dos.h>
26 #endif
29 #define ID_DTYP MAKE_ID('D','T','Y','P')
30 #define ID_DTHD MAKE_ID('D','T','H','D')
33 struct DataTypeHeader
35 STRPTR dth_Name; /* Name of the data type */
36 STRPTR dth_BaseName; /* Base name of the data type */
37 STRPTR dth_Pattern; /* File name match pattern */
38 WORD *dth_Mask; /* Comparision mask (binary) */
39 ULONG dth_GroupID; /* DataType Group */
40 ULONG dth_ID; /* DataType ID (same as IFF FORM type) */
41 WORD dth_MaskLen; /* Length of the comparision mask */
42 WORD dth_Pad; /* Unused at present (must be 0) */
43 UWORD dth_Flags; /* Flags -- see below */
44 UWORD dth_Priority;
47 #define DTHSIZE sizeof(struct DataTypeHeader)
49 /* Types */
50 #define DTF_TYPE_MASK 0x000F
51 #define DTF_BINARY 0x0000
52 #define DTF_ASCII 0x0001
53 #define DTF_IFF 0x0002
54 #define DTF_MISC 0x0003
56 #define DTF_CASE 0x0010 /* Case is important */
58 #define DTF_SYSTEM1 0x1000 /* For system use only */
61 /***** Group ID and ID ************************************************/
63 /* System file -- executable, directory, library, font and so on. */
64 #define GID_SYSTEM MAKE_ID('s','y','s','t')
65 #define ID_BINARY MAKE_ID('b','i','n','a')
66 #define ID_EXECUTABLE MAKE_ID('e','x','e','c')
67 #define ID_DIRECTORY MAKE_ID('d','i','r','e')
68 #define ID_IFF MAKE_ID('i','f','f',0)
70 /* Text, formatted or not */
71 #define GID_TEXT MAKE_ID('t','e','x','t')
72 #define ID_ASCII MAKE_ID('a','s','c','i')
74 /* Formatted text combined with graphics or other DataTypes */
75 #define GID_DOCUMENT MAKE_ID('d','o','c','u')
77 /* Sound */
78 #define GID_SOUND MAKE_ID('s','o','u','n')
80 /* Musical instrument */
81 #define GID_INSTRUMENT MAKE_ID('i','n','s','t')
83 /* Musical score */
84 #define GID_MUSIC MAKE_ID('m','u','s','i')
86 /* Picture */
87 #define GID_PICTURE MAKE_ID('p','i','c','t')
89 /* Animated pictures */
90 #define GID_ANIMATION MAKE_ID('a','n','i','m')
92 /* Animation with audio */
93 #define GID_MOVIE MAKE_ID('m','o','v','i')
96 /**************************************************************************/
99 #define ID_CODE MAKE_ID('D','T','C','D')
102 struct DTHookContext
104 struct Library *dthc_SysBase;
105 struct Library *dthc_DOSBase;
106 struct Library *dthc_IFFParseBase;
107 struct Library *dthc_UtilityBase;
109 /* File context */
110 BPTR dthc_Lock;
111 struct FileInfoBlock *dthc_FIB;
112 BPTR dthc_FileHandle; /* Pointer to file handle
113 (may be NULL) */
114 struct IFFHandle *dthc_IFF; /* Pointer to IFFHandle
115 (may be NULL) */
116 STRPTR dthc_Buffer; /* Buffer... */
117 ULONG dthc_BufferLength; /* ... and corresponding length */
121 #define ID_TOOL MAKE_ID('D','T','T','L')
123 struct Tool
125 UWORD tn_Which;
126 UWORD tn_Flags; /* Flags -- see below */
127 STRPTR tn_Program; /* Application to use */
131 enum
133 TW_MISC = 0,
134 TW_INFO,
135 TW_BROWSE,
136 TW_EDIT,
137 TW_PRINT,
138 TW_MAIL
142 #define TF_LAUNCH_MASK 0x000F
143 #define TF_SHELL 0x0001
144 #define TF_WORKBENCH 0x0002
145 #define TF_RX 0x0003
148 /* Tags for use with FindToolNodeA(), GetToolAttrsA() and so on */
150 #define TOOLA_Dummy TAG_USER
151 #define TOOLA_Program (TOOLA_Dummy + 1)
152 #define TOOLA_Which (TOOLA_Dummy + 2)
153 #define TOOLA_LaunchType (TOOLA_Dummy + 3)
156 #define ID_TAGS MAKE_ID('D','T','T','G')
159 /*************************************************************************/
162 #ifndef DATATYPE
163 #define DATATYPE
164 struct DataType
166 struct Node dtn_Node1; /* These two nodes are for... */
167 struct Node dtn_Node2; /* ...system use only! */
168 struct DataTypeHeader *dtn_Header;
169 struct List dtn_ToolList; /* Tool nodes */
170 STRPTR dtn_FunctionName; /* Name of comparision routine */
171 struct TagItem *dtn_AttrList; /* Object creation tags */
172 ULONG dtn_Length; /* Length of the memory block */
174 #endif
176 #define DTNSIZE sizeof(struct DataType)
179 struct ToolNode
181 struct Node tn_Node;
182 struct Tool tn_Tool;
183 ULONG tn_Length; /* Length of the memory block */
186 #define TNSIZE sizeof(struct ToolNode)
189 #ifndef ID_NAME
190 #define ID_NAME MAKE_ID('N','A','M','E')
191 #endif
194 /* Text ID:s */
195 #define DTERROR_UNKNOWN_DATATYPE 2000
196 #define DTERROR_COULDNT_SAVE 2001
197 #define DTERROR_COULDNT_OPEN 2002
198 #define DTERROR_COULDNT_SEND_MESSAGE 2003
200 /* new for V40 */
201 #define DTERROR_COULDNT_OPEN_CLIPBOARD 2004
202 #define DTERROR_Reserved 2005
203 #define DTERROR_UNKNOWN_COMPRESSION 2006
204 #define DTERROR_NOT_ENOUGH_DATA 2007
205 #define DTERROR_INVALID_DATA 2008
207 #define DTMSG_TYPE_OFFSET 2100
210 #endif /* DATATYPES_DATATYPES_H */