2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Find a tooltype entry from an array of tool types.
7 #include "icon_intern.h"
9 /*****************************************************************************
12 #include <proto/icon.h>
14 AROS_LH2(UBYTE
*, FindToolType
,
17 AROS_LHA(CONST STRPTR
*, toolTypeArray
, A0
),
18 AROS_LHA(CONST STRPTR
, typeName
, A1
),
21 struct Library
*, IconBase
, 16, Icon
)
24 Finds the supplied typeName inside the given toolTypeArray.
25 Search is case-insensitive.
28 toolTypeArray - pointer to an array of tooltype strings.
29 typeName - name of a specific tool-type.
32 NULL if the tooltype wasn't found and a pointer to the value
33 of the tooltype otherwise.
48 *****************************************************************************/
52 ULONG typenamelen
= 0;
54 /* Make sure we have sane input parameters */
55 if (toolTypeArray
== NULL
|| typeName
== NULL
) return NULL
;
57 typenamelen
= strlen(typeName
);
59 while (*toolTypeArray
)
61 /* case insensitive compare */
62 if (!Strnicmp (*toolTypeArray
, typeName
, typenamelen
) )
64 if ( (*toolTypeArray
)[typenamelen
] == '=') typenamelen
++;
65 return (*toolTypeArray
+ typenamelen
);