Hi!
Is there a replacement for stch_l available somewehere, which works with gcc ? Can someone give me some detalils, how stch_l works ? (a hex string to dec, ok, but what formats are supported? 0x... ?)
thx Jürgen
Hello Jürgen
On 30/01/2005, you wrote:
Hi!
Is there a replacement for stch_l available somewehere, which works with gcc ? Can someone give me some detalils, how stch_l works ? (a hex string to dec, ok, but what formats are supported? 0x... ?)
stch_l is a SAS/C function, used to hexadecimal string into a long integer, that's the only thing i could find sofar
Regards
stch_l is a SAS/C function, used to hexadecimal string into a long integer, that's the only thing i could find sofar
I know that :) But I do not want to re-implement it again. I didn't find anything (well, I saw AROS listed the function as implemented), nor do I know what exactly the string format has to be to convert it into dec. I assume something like "0xFF", but could it be, e.g. "$FF" as well ?
I have no SAS/C any more (maybe somewhere on a backup), so I have no docs at hand. (and Ihave no disk drive to read the SAS/C disks either).
On 2005-01-31, Jürgen Schober wrote:
stch_l is a SAS/C function, used to hexadecimal string into a long integer, that's the only thing i could find sofar
I know that :) But I do not want to re-implement it again. I didn't find anything (well, I saw AROS listed the function as implemented), nor do I know what exactly the string format has to be to convert it into dec. I assume something like "0xFF", but could it be, e.g. "$FF" as well ?
No, neither of those. stch_l() only works with strings of hexadecimal _digits_. It converts a string of up to 8 hexadecimal digits to a long value and stored this in the location pointed to by its second argument.
The return value from stch_l is the number of digits used in the conversion.
stch_l("ff",&l) would return 2 and store 255 in l.
stch_l("0xff",&l) would return 1 and store 0 in l.
stchl_l("$ff",&l) would return 0 and store 0 in l.
Hope this helps.
-Peter aka. Archprogrammer
Reality is for people who cannot face ScienceFiction. Only lefthanded people are in their right minds.
Hope this helps.
Yes, it does. I have reimplemented it already...but it would've been wrong ;)
thx a lot Jürgen
BTW: I've compiled a lib for some other SAS/C functions (the crblib, see aminet), so if anybody needs that, you can have it (libcrb.a for clib2 , but I thnk it should also work with newlib), source is there, I just added a makefile for gcc. (walker.c didn't compile, but I don't need it - yet)
cheers Jürgen