added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / libs / icon / findtooltype.c
blobed5d652b6ee4ee5d4933f36e676ea3fc3ca35b16
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Find a tooltype entry from an array of tool types.
6 */
7 #include "icon_intern.h"
9 /*****************************************************************************
11 NAME */
12 #include <proto/icon.h>
14 AROS_LH2(UBYTE *, FindToolType,
16 /* SYNOPSIS */
17 AROS_LHA(CONST STRPTR *, toolTypeArray, A0),
18 AROS_LHA(CONST STRPTR, typeName, A1),
20 /* LOCATION */
21 struct Library *, IconBase, 16, Icon)
23 /* FUNCTION
24 Finds the supplied typeName inside the given toolTypeArray.
26 INPUTS
27 toolTypeArray - pointer to an array of tooltype strings.
28 typeName - name of a specific tool-type.
30 RESULT
31 NULL if the tooltype wasn't found and a pointer to the value
32 of the tooltype otherwise.
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 MatchToolValue()
43 INTERNALS
45 HISTORY
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 ULONG typenamelen = 0;
53 /* Make sure we have sane input parameters */
54 if (toolTypeArray == NULL || typeName == NULL) return NULL;
56 typenamelen = strlen(typeName);
58 while (*toolTypeArray)
60 /* case sensetive compare */
61 if (!strncmp (*toolTypeArray, typeName, typenamelen) )
63 return (*toolTypeArray+typenamelen+1);
66 toolTypeArray ++;
69 return NULL;
71 AROS_LIBFUNC_EXIT
72 } /* FindToolType */