We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, I have a question concerning the library function str_scomp(). I see it used in the standard modem example source included with TcpNet library. I cannot find any documentation about its semantic, so, I'm wandering what is its relationship with the standard C library strcmp() function. I have to do partial match string comparison... is it suitable?
Regards, Andrea
This function compare two strings. cp must be 0-terminated, but sp does not have to be 0-terminated.
Function returns __TRUE when strings are equal or when the left part of sp is equal to cp (in case when strlen(sp) > strlen(cp)).
BOOL str_scomp (U8 *sp, U8 const *cp); /* Compare two strings. 'cp' must be 0-terminated. */
Franc
"cp must be 0-terminated, but sp does not have to be"
So, presumably, sp must be at least as long as cp?
What happens if sp is shorter than cp - especially if sp is not null-terminated?
"...library function str_scomp(). I see it used in the standard modem example source included with TcpNet library. I cannot find any documentation"
You're right - a site search shows that it's mentioned in 4 places in the manuals:
http://www.keil.com/support/man/docs/rlarm/rlarm_http_get_var.htm www.keil.com/.../rlarm_cgi_process_var.htm www.keil.com/.../rlarm_cgi_process_data.htm http://www.keil.com/support/man/docs/rlarm/rlarm_modem_process.htm
but there is no description of it anywhere on the site!
Naughty, naughty Keil!