does ESP8266 supply stroul strncasecmp() and stroul ()?
-
- Posts: 44
- Joined: Sat Oct 17, 2015 4:49 pm
does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby marhc_seven » Thu Nov 12, 2015 1:35 pm
my project need to using strncasecmp() and stroul ()
but those function do not being included in esplibc.h ,how could we do?
BR
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby kolban » Thu Nov 12, 2015 2:30 pm
http://www.opensource.apple.com/source/ ... /strtoul.c
http://www.opensource.apple.com/source/ ... ncasecmp.c
If they are not part of any existing library, you can always build your own utility library using these sources.
-
- Posts: 44
- Joined: Sat Oct 17, 2015 4:49 pm
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby marhc_seven » Thu Nov 12, 2015 5:28 pm
#include "tclInt.h"
#include "tclPort.h"
BR!
-
- Posts: 44
- Joined: Sat Oct 17, 2015 4:49 pm
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby marhc_seven » Thu Nov 12, 2015 7:17 pm
that is a question。
as i reply you before。
the source depend on other files
#include "tclInt.h"
#include "tclPort.h"
#include <ansidecl.h>
and as we know lowly ESP8266 do not supply those files~~~

























Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby kolban » Thu Nov 12, 2015 10:39 pm
http://pubs.opengroup.org/onlinepubs/00 ... secmp.html
http://pubs.opengroup.org/onlinepubs/00 ... rtoul.html
Which means that we fully understand their specification interface. i.e. we know what they should do. We have samples of implementations of these functions in C on the Internet. The last step is to compile those on an ESP8266 platform. Taking the source files directly from the internet may not work exactly as is ... but should work if one is skilled in C programming or can find folks skilled in C programming. The ESP8266 SDK should provide the "parts" needed for ESP8266 programming but should not be responsible for providing libraries that are not ESP related (eg. string manipulation functions).
-
- Posts: 44
- Joined: Sat Oct 17, 2015 4:49 pm
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby marhc_seven » Fri Nov 13, 2015 9:22 am
you are right , that is esay for the skilled one。
but i am not , just tring !!!
-
- Posts: 44
- Joined: Sat Oct 17, 2015 4:49 pm
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby marhc_seven » Fri Nov 13, 2015 10:40 am
kolban wrote:I think the trick here is to realize that the function called strncasecmp() and stroul() are speced out in posix:
http://pubs.opengroup.org/onlinepubs/00 ... secmp.html
http://pubs.opengroup.org/onlinepubs/00 ... rtoul.html
Which means that we fully understand their specification interface. i.e. we know what they should do. We have samples of implementations of these functions in C on the Internet. The last step is to compile those on an ESP8266 platform. Taking the source files directly from the internet may not work exactly as is ... but should work if one is skilled in C programming or can find folks skilled in C programming. The ESP8266 SDK should provide the "parts" needed for ESP8266 programming but should not be responsible for providing libraries that are not ESP related (eg. string manipulation functions).
could you please teach me how to complies the stroul() function in the SDK?
i am really don't know how to solve it 。
there is not ctype.h and it causes isspace() function undefined
so i adding the the isspace() c in it , although there are two function, one is supplied by apple and other is supplied by Google
Apple:
int isspace(c)
int c;
{
return (c == '\t' || c == '\n' ||
c == '\v' || c == '\f' || c == '\r' || c == ' ' ? 1 : 0);
}
Google:
int isspace(int c)
{
return ((c>=0x09 && c<=0x0D) || (c==0x20));
}
when it was ok , i found that UCHAR is warning that it is implicit decalaration of function ’UCHAR' is invalid in C99
i just ignore it.
But there is other error that shows ULONG_MAX have not defined~~~~
so i Google it , and i have define it as
#define ULONG_MAX 0xFFFFFFFFUL
when all figure out ,
there is a error that shows me :
result * = 10;
result * = base;
......
inexhaustible !!!!!!
how could i solve it !!!!!!???????
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby kolban » Fri Nov 13, 2015 12:44 pm
Please study them and compare them to what you had previously and see if you can't understand what was changed to get them working so that your own skills will grow.
- temp.zip
- (3.05 KiB) Downloaded 371 times
-
- Posts: 44
- Joined: Sat Oct 17, 2015 4:49 pm
Re: does ESP8266 supply stroul strncasecmp() and stroul ()?
Postby marhc_seven » Sat Nov 14, 2015 11:49 am
thank you for your help。 strncasscmp () and stroul() seems working now 。
then when there is warning about strcasecmp()
warning : implicit declaration of function 'strcasecmp' [-Wimplicit-function-declaration]
and i found the esp_libc.h, and i found there is nothing declaration about this function,
so i copy the strcasecmp() soucce code and complies it as like before.
when complies,it showing me a error:
1> C:\SysGCC\esp8266\esp8266-bsp/RTOS-SDK/lib\libminic.a(minic.o): In function `strcasecmp':
1> (.irom0.text+0x2dc): multiple definition of `strcasecmp'
so if esp_libc.h have not declare this function, could i just ignore the implicit warning?
Who is online
Users browsing this forum: No registered users and 25 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.