1 /* xpk/amigalibs.h -- the Amiga compatibility header file
2  * Copyright (C) 1999-2000 Vesa Halttunen
3  * This file is part of the xpk package.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
18  * USA.
19  */
20 
21 #ifndef _AMIGALIBS_H_
22 #define _AMIGALIBS_H_
23 
24 #include <sys/types.h>
25 
26 typedef unsigned int Tag;
27 
28 struct TagItem
29 {
30   /* identifies the type of data */
31   Tag ti_Tag;
32   /* type-specific data	*/
33   void *ti_Data;
34 };
35 
36 /* constants for Tag.ti_Tag, control tag values */
37 /* terminates array of TagItems. ti_Data unused */
38 #define TAG_DONE   (0L)
39 /* synonym for TAG_DONE			  */
40 #define TAG_END	   (0L)
41 /* ignore this item, not end of array		  */
42 #define	TAG_IGNORE (1L)
43 /* ti_Data is pointer to another array of TagItems
44  * note that this tag terminates the current array */
45 #define	TAG_MORE   (2L)
46 /* skip this and the next ti_Data items	 */
47 #define	TAG_SKIP   (3L)
48 
49 /* differentiates user tags from control tags */
50 #define TAG_USER   ((unsigned int)(1L<<31))
51 
52 /* If the TAG_USER bit is set in a tag number, it tells utility.library that
53  * the tag is not a control tag (like TAG_DONE, TAG_IGNORE, TAG_MORE) and is
54  * instead an application tag. "USER" means a client of utility.library in
55  * general, including system code like Intuition or ASL, it has nothing to do
56  * with user code. */
57 
58 /* Tag filter logic specifiers for use with FilterTagItems() */
59 /* exclude everything but filter hits	*/
60 #define TAGFILTER_AND 0
61 /* exclude only filter hits		*/
62 #define TAGFILTER_NOT 1
63 
64 /* Mapping types for use with MapTags() */
65 /* remove tags that aren't in mapList */
66 #define MAP_REMOVE_NOT_FOUND 0
67 /* keep tags that aren't in mapList   */
68 #define MAP_KEEP_NOT_FOUND   1
69 
70 /* minimal node -- no type checking possible */
71 struct MinNode {
72   struct MinNode *mln_Succ;
73   struct MinNode *mln_Pred;
74 };
75 
76 struct Hook
77 {
78   struct MinNode h_MinNode;
79   unsigned int (*h_Entry)();        /* assembler entry point */
80   unsigned int (*h_SubEntry)();     /* often HLL entry point */
81   unsigned char  *h_Data;              /* owner specific        */
82 };
83 
84 #endif /* TAGITEM_H */
85