| Details |
Message |
|
Read-Only
Author Orko On
Posted 8-May-2007 16:22 GMT
Toolset ARM
|
 string parse
Orko On
Hi,
i am new on arm. does any one have a string parser example for
lpc2138 cpu.
Thanks
Orko
|
|
|
Read-Only
Author Andy Neil
Posted 8-May-2007 17:13 GMT
Toolset ARM
|
 Textbook stuff?
Andy Neil
In what way would that be specific to the lpc2138?
Or to any particular target or host environment?
Surely it's just standard string processing??
|
|
|
Read-Only
Author Orko On
Posted 8-May-2007 22:10 GMT
Toolset ARM
|
 RE: Textbook stuff?
Orko On
Hi,
i am sure it is standart processing. but i could't find some
functions like strtok on keil so i think may be there is an another
way to split string.
i specify processor for architecture.
Thanks
|
|
|
Read-Only
Author Andy Neil
Posted 8-May-2007 22:44 GMT
Toolset ARM
|
 RE: Textbook stuff?
Andy Neil
"i could't find some functions like strtok on keil"
Maybe you should use an 8051 instead, then:
http://www.keil.com/support/man/docs/c51/c51_strtok.htm
;-)
|
|
|
Read-Only
Author barry gordon
Posted 9-May-2007 04:51 GMT
Toolset ARM
|
 RE: string parse
barry gordon
Try writing your own function, either from scratch or wrap your
code around strpbrk. It would be a good exercise in coding 101 and
just for the heck of it, test it on VisualC
|
|
|
Read-Only
Author Andy Neil
Posted 9-May-2007 08:11 GMT
Toolset ARM
|
 DIY
Andy Neil
"Try writing your own function ... It would be a good exercise
in coding 101 "
Good idea!
As there is nothing specific to the lpc2138 or the ARM
architecture, you could take any of the open-source offerings as your
starting point...
|
|
|
Read-Only
Author Andy Neil
Posted 9-May-2007 08:17 GMT
Toolset ARM
|
 Find Open-Source Code
Andy Neil
http://www.google.com/codesearch/advanced_code_search?hl=en&as_lang=c
|
|
|
Read-Only
Author Per Westermark
Posted 9-May-2007 09:28 GMT
Toolset ARM
|
 RE: Find Open-Source Code
Per Westermark
Quick note: It doesn't matter what processor you use. You should
really think twice before using strtok(), since it is non-reentrant
and changes the input string.
Look at strchr(), strspn() or similar.
|
|
|
Read-Only
Author Robert McNamara
Posted 9-May-2007 14:56 GMT
Toolset ARM
|
 RE: Find Open-Source Code
Robert McNamara
The current Keil ARM compiler & library does support strtok
and I beleive it has been supported for some time.
|
|
|
Read-Only
Author Andy Neil
Posted 9-May-2007 15:27 GMT
Toolset ARM
|
 Standard 'C' Library
Andy Neil
"The current Keil ARM compiler & library does support
strtok and I beleive it has been supported for some time."
As they are part of the standard 'C' library, it would be
extremely surprising if they were not supported!!
As I noted earlier, even the C51 compiler has them!
When the OP said he couldn't find them, I very much suspect that
he just didn't look (hard enough).
But, as Keil still haven't got the Realview manuals online yet, I
can't check...
|
|
|
Read-Only
Author Drew Davis
Posted 10-May-2007 18:48 GMT
Toolset ARM
|
 RE: Standard 'C' Library
Drew Davis
If your favorite string function does happen not to be supported,
or happens not to be ANSI (that is, GNU or Unix libraries), you might
look for source from the FreeBSD library:
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/
|
|
|
Read-Only
Author Dan Henry
Posted 10-May-2007 19:20 GMT
Toolset ARM
|
 RE: Standard 'C' Library
Dan Henry
"... you might look for source from the FreeBSD
library"
And while you're there you might consider strsep() as a
replacement for strtok() since it addresses strtok's problems alluded
to by Per Westermark.
|
|