Fixed typos in comments.
[AROS.git] / workbench / libs / icon / matchtoolvalue.c
blob5271214423db8ecf1ba9c857daabf6ac2a25b722
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include "icon_intern.h"
9 #include <proto/utility.h>
11 /*****************************************************************************
13 NAME */
14 #include <proto/icon.h>
16 AROS_LH2(BOOL, MatchToolValue,
18 /* SYNOPSIS */
19 AROS_LHA(UBYTE *, typeString, A0),
20 AROS_LHA(UBYTE *, value, A1),
22 /* LOCATION */
23 struct IconBase *, IconBase, 17, Icon)
25 /* FUNCTION
26 Checks if the given tooltype has the supplied value.
27 Search is case-insensitive.
29 INPUTS
30 typeString - string containing the tooltype.
31 value - the value to match for.
33 RESULT
34 TRUE if match, else FALSE.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 HISTORY
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
51 LONG value_len;
52 UBYTE c;
53 UBYTE * str;
55 /* Check if value has a bar in it */
56 str = value;
58 while(*str)
60 if (*str++=='|')
61 return (FALSE);
64 /* Compare loop */
65 while (*typeString)
67 /* Are they alike ? */
68 value_len = strlen (value);
70 if (!Strnicmp (typeString, value, value_len))
72 /* Check that we have matched the *whole* word in typeString with value */
73 c = *(typeString + value_len);
75 if (c == '|' || c == 0)
76 return (TRUE);
80 /* Goto next entry in typeString */
81 while (c = *typeString, !((c == '|') || (c == 0)))
82 typeString++;
84 /* If we have a "|", skip it */
85 if (*typeString == '|')
86 typeString ++;
89 return FALSE;
90 AROS_LIBFUNC_EXIT
91 } /* MatchToolValue */