2 Copyright © 2003, The AROS Development Team.
10 #include <exec/types.h>
12 #include "support_aros.h"
14 /***************************************************
15 Like StrToLong() but for hex numbers
16 that represent addresses
17 ***************************************************/
19 LONG
HexToIPTR(CONST_STRPTR s
, IPTR
*val
)
22 *val
= (IPTR
)strtoull(s
,&end
,16);
23 if (end
== (char*)s
) return -1;
24 return end
- (char*)s
;
26 LONG
HexToLong(CONST_STRPTR s
, ULONG
*val
)
29 *val
= (ULONG
)strtoul(s
,&end
,16);
30 if (end
== (char*)s
) return -1;
31 return end
- (char*)s
;
34 LONG
HexToIPTR(CONST_STRPTR s
, IPTR
*val
)
36 return HexToLong((STRPTR
)s
, val
);