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 -- Jürgen Schober 7900 E. Princess Drv. #1273 Scottsdale, AZ, 85255, USA http://www.pointdesign.com juergen.schober@pointdesign.com cell: +1-602-373-7092
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 -- Amon_Re Christophe Ochal Hoge Buizemont 168 9500 Geraardsbergen, Belgium Mobile: 0032 (0)479/46 45 74 http://www.kefren.be http://www.metalfest.be
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). -- Jürgen Schober 7900 E. Princess Drv. #1273 Scottsdale, AZ, 85255, USA http://www.pointdesign.com juergen.schober@pointdesign.com cell: +1-602-373-7092
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 -- Jürgen Schober 7900 E. Princess Drv. #1273 Scottsdale, AZ, 85255, USA http://www.pointdesign.com juergen.schober@pointdesign.com cell: +1-602-373-7092
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 -- Jürgen Schober 7900 E. Princess Drv. #1273 Scottsdale, AZ, 85255, USA http://www.pointdesign.com juergen.schober@pointdesign.com cell: +1-602-373-7092
participants (3)
-
Christophe Ochal -
Jürgen Schober -
Peter Bengtsson