2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include "datatypes_intern.h"
9 #include <proto/utility.h>
11 /*****************************************************************************
15 AROS_LH2(struct ToolNode
*, FindToolNodeA
,
18 AROS_LHA(struct List
*, toollist
, A0
),
19 AROS_LHA(struct TagItem
*, attrs
, A1
),
22 struct Library
*, DataTypesBase
, 41, DataTypes
)
26 Search for a specific tool in a list of given tool nodes.
30 toollist -- a list or a struct ToolNode * (which will be skipped) to
31 search in; may be NULL.
33 attrs -- search tags; if NULL, the result of the function will
34 simply be the following node.
38 TOOLA_Program -- name of the program to search for
40 TOOLA_Which -- one of the TW_#? types
42 TOOLA_LaunchType -- launch mode: TF_SHELL, TF_WORKBENCH or TF_RX
46 A pointer to a ToolNode describing the search result (NULL for failure).
50 The entries in dt->dtn_ToolList are valid as long as a lock is kept on
51 the data type 'dt' (ObtainDataTypeA() or LockDataType()).
65 7.8.99 SDuvan implemented
67 *****************************************************************************/
75 struct ToolNode
*tNode
;
80 program
= (STRPTR
)GetTagData(TOOLA_Program
, (IPTR
)NULL
, attrs
);
81 which
= (WORD
)GetTagData(TOOLA_Which
, -1, attrs
);
82 ltype
= (WORD
)GetTagData(TOOLA_LaunchType
, -1, attrs
);
84 ForeachNode(toollist
, tNode
)
86 /* Match program name */
89 if(Stricmp(tNode
->tn_Tool
.tn_Program
, program
) != 0)
96 if(which
!= tNode
->tn_Tool
.tn_Which
)
100 /* Check launch type */
103 if(ltype
!= (tNode
->tn_Tool
.tn_Flags
& TF_LAUNCH_MASK
))
113 } /* FindToolNodeA */