remove duplicate const
[AROS.git] / compiler / alib / argint.c
blob63f3cad2509cadc70cd1044ef3dfc073b50702d4
1 /*
2 Copyright © 1995-2016, 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 <proto/dos.h>
13 #include <stdlib.h>
15 extern struct Library *IconBase;
17 LONG ArgInt(
19 /* SYNOPSIS */
20 UBYTE **tt,
21 STRPTR entry,
22 LONG defaultval)
25 /* FUNCTION
26 Returns the value associated with the string 'entry' found in the
27 tooltypes array 'tt'. If no match with entry was found,
28 'defaultval' is returned.
30 INPUTS
31 tt -- the tooltypes array ( returned by ArgArrayInit() )
32 entry -- entry to look for (in tooltype "entry=value")
33 defaultval -- value returned if 'entry' was not found
35 RESULT
36 (The tooltypes looks like "Entry=Value".) Returns Value if Entry
37 was found; otherwise returns 'defaultval'.
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 ArgArrayInit()
48 INTERNALS
49 The Amiga documentation says "requires that dos.library V36 or
50 higher is opened". I can't see why.
52 *****************************************************************************/
54 STRPTR match;
55 LONG result = defaultval;
57 if((match = FindToolType(tt, entry)) == NULL)
58 return defaultval;
60 StrToLong(match, &result);
61 return result;
63 } /* ArgArrayInt */