Autodocs updated.
[cake.git] / workbench / libs / icon / matchtoolvalue.c
blob2b83999953191783d26094b3054135c7815be173
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 Library *, IconBase, 17, Icon)
25 /* FUNCTION
26 Checks if the given tooltype has the supplied value.
28 INPUTS
29 typeString - string containing the tooltype.
30 value - the value to match for.
32 RESULT
33 TRUE if match, else FALSE.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 HISTORY
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
50 LONG value_len;
51 UBYTE c;
52 UBYTE * str;
54 /* Check if value has a bar in it */
55 str = value;
57 while(*str)
59 if (*str++=='|')
60 return (FALSE);
63 /* Compare loop */
64 while (*typeString)
66 /* Are they alike ? */
67 value_len = strlen (value);
69 if (!Strnicmp (typeString, value, value_len))
71 /* Check that we have matched the *whole* word in typeString with value */
72 c = *(typeString + value_len);
74 if (c == '|' || c == 0)
75 return (TRUE);
79 /* Goto next entry in typeString */
80 while (c = *typeString, !((c == '|') || (c == 0)))
81 typeString++;
83 /* If we have a "|", skip it */
84 if (*typeString == '|')
85 typeString ++;
88 return FALSE;
89 AROS_LIBFUNC_EXIT
90 } /* MatchToolValue */