Added very useful and convenient macro for parsing attribute IDs
[AROS.git] / compiler / alib / argint.c
blob11e42e9ec95012efeab0d523e447b89ec64293d1
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /*****************************************************************************
8 NAME */
10 #include <dos/dosextens.h>
11 #include <proto/icon.h>
12 #include <stdlib.h>
14 extern struct Library *IconBase;
16 LONG ArgInt(
18 /* SYNOPSIS */
19 UBYTE **tt,
20 STRPTR entry,
21 LONG defaultval)
24 /* FUNCTION
25 Returns the value associated with the string 'entry' found in the
26 tooltypes array 'tt'. If no match with entry was found,
27 'defaultval' is returned.
29 INPUTS
30 tt -- the tooltypes array ( returned by ArgArrayInit() )
31 entry -- entry to look for (in tooltype "entry=value")
32 defaultval -- value returned if 'entry' was not found
34 RESULT
35 (The tooltypes looks like "Entry=Value".) Returns Value if Entry
36 was found; otherwise returns 'defaultval'.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 ArgArrayInit()
47 INTERNALS
48 The Amiga documentation says "requires that dos.library V36 or
49 higher is opened". I can't see why.
51 HISTORY
52 29.04.98 SDuvan implemented
54 *****************************************************************************/
56 STRPTR match;
58 if((match = FindToolType(tt, entry)) == NULL)
59 return defaultval;
61 return atoi(match);
63 } /* ArgArrayInt */