mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-27 20:27:43 +08:00
Merge branch 'feature/clean_up_esp_libc' into 'master'
feat(esp8266): Clean up esp libc See merge request sdk/ESP8266_RTOS_SDK!186
This commit is contained in:
@ -25,52 +25,16 @@
|
||||
#ifndef __ESP_LIBC_H__
|
||||
#define __ESP_LIBC_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char *strcpy(char *dst, const char *src);
|
||||
char *strncpy(char *dst, const char *src, size_t n);
|
||||
int strcmp(const char *s1, const char *s2);
|
||||
int strncmp(const char *s1, const char *s2, size_t n);
|
||||
size_t strlen(const char *s);
|
||||
char *strstr(const char *s1, const char *s2);
|
||||
char *strcat(char *dst, const char *src);
|
||||
char *strncat(char *dst, const char *src, size_t count);
|
||||
size_t strspn(const char *s, const char *accept);
|
||||
size_t strcspn(const char *s, const char *reject);
|
||||
char *strtok_r(char *s, const char *delim, char **ptrptr);
|
||||
char *strtok(char *s, const char *delim);
|
||||
char *strrchr(const char *s, int c);
|
||||
char *strdup(const char *s);
|
||||
char *strchr(const char *s, int c);
|
||||
long strtol(const char *str, char **endptr, int base);
|
||||
|
||||
void bzero(void *s, size_t n);
|
||||
|
||||
void *memcpy(void *dst, const void *src, size_t n);
|
||||
void *memset(void *dst, int c, size_t n);
|
||||
int memcmp(const void *m1, const void *m2, size_t n);
|
||||
void *memmove(void *dst, const void *src, size_t n);
|
||||
|
||||
int rand(void);
|
||||
|
||||
int printf(const char *format, ...);
|
||||
int sprintf(char *out, const char *format, ...);
|
||||
int snprintf(char *buf, unsigned int count, const char *format, ...);
|
||||
int puts(const char *str);
|
||||
|
||||
void *malloc(size_t n);
|
||||
void free(void *p);
|
||||
void *calloc(size_t c, size_t n);
|
||||
void *zalloc(size_t n);
|
||||
void *realloc(void *p, size_t n);
|
||||
|
||||
int atoi(const char *s);
|
||||
long atol(const char *s);
|
||||
|
||||
unsigned long os_random(void);
|
||||
int os_get_random(unsigned char *buf, size_t len);
|
||||
uint32_t os_random(void);
|
||||
int32_t os_get_random(unsigned char *buf, size_t len);
|
||||
|
||||
#ifndef os_printf
|
||||
#define os_printf printf
|
||||
|
@ -106,6 +106,7 @@
|
||||
*
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
||||
all the API functions to use the MPU wrappers. That should only be done when
|
||||
|
@ -12,6 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "esp_common.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "lwip/inet.h"
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
/* lwIP includes. */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lwip/debug.h"
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/sys.h"
|
||||
|
@ -12,6 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ethip6.h"
|
||||
#include "netif/etharp.h"
|
||||
|
@ -15,7 +15,10 @@
|
||||
* Ian Craggs - convert to FreeRTOS
|
||||
*******************************************************************************/
|
||||
|
||||
#include "lwip/netdb.h"
|
||||
#include <string.h>
|
||||
|
||||
#include <netdb.h>
|
||||
|
||||
#include "MQTTFreeRTOS.h"
|
||||
|
||||
int ThreadStart(Thread* thread, void (*fn)(void*), void* arg)
|
||||
|
@ -12,6 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/dhcp.h"
|
||||
@ -589,4 +592,4 @@ struct netif* eagle_lwip_getif(uint8_t netif_index)
|
||||
TCPIP_ATAPTER_LOG("ERROR bad netif index:%d\n", netif_index);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,9 @@
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include "esp_misc.h"
|
||||
@ -19,7 +22,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include <lwip/apps/sntp.h>
|
||||
#include "lwip/apps/sntp.h"
|
||||
|
||||
#include "mbedtls/platform.h"
|
||||
#include "mbedtls/net_sockets.h"
|
||||
|
@ -15,6 +15,8 @@
|
||||
*******************************************************************************/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
@ -7,6 +7,9 @@
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "esp_common.h"
|
||||
#include "user_config.h"
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include "esp_misc.h"
|
||||
@ -338,4 +341,4 @@ void user_init(void)
|
||||
sprintf((char*)config.password, CONFIG_WIFI_PASSWORD);
|
||||
wifi_station_set_config(&config);
|
||||
wifi_set_event_handler_cb(wifi_event_handler_cb);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,9 @@
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "openssl_demo.h"
|
||||
#include "openssl/ssl.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
@ -7,6 +7,9 @@
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "esp_common.h"
|
||||
#include "user_config.h"
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include "esp_misc.h"
|
||||
@ -331,4 +335,4 @@ void user_init(void)
|
||||
sprintf((char*)config.password, CONFIG_WIFI_PASSWORD);
|
||||
wifi_station_set_config(&config);
|
||||
wifi_set_event_handler_cb(wifi_event_handler_cb);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user