mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Push out expat
to idf-extra-components repository
This component will be used through IDF component manager.
This commit is contained in:
parent
fba8582da4
commit
b08323c903
1
.flake8
1
.flake8
@ -144,7 +144,6 @@ exclude =
|
|||||||
components/bt/host/nimble/nimble,
|
components/bt/host/nimble/nimble,
|
||||||
components/cmock/CMock,
|
components/cmock/CMock,
|
||||||
components/esptool_py/esptool,
|
components/esptool_py/esptool,
|
||||||
components/expat/expat,
|
|
||||||
components/json/cJSON,
|
components/json/cJSON,
|
||||||
components/mbedtls/mbedtls,
|
components/mbedtls/mbedtls,
|
||||||
components/openthread/openthread,
|
components/openthread/openthread,
|
||||||
|
@ -102,7 +102,6 @@
|
|||||||
/components/esp_wifi/ @esp-idf-codeowners/wifi
|
/components/esp_wifi/ @esp-idf-codeowners/wifi
|
||||||
/components/espcoredump/ @esp-idf-codeowners/tools
|
/components/espcoredump/ @esp-idf-codeowners/tools
|
||||||
/components/esptool_py/ @esp-idf-codeowners/tools
|
/components/esptool_py/ @esp-idf-codeowners/tools
|
||||||
/components/expat/ @esp-idf-codeowners/app-utilities
|
|
||||||
/components/fatfs/ @esp-idf-codeowners/storage
|
/components/fatfs/ @esp-idf-codeowners/storage
|
||||||
/components/fatfs/**/*.py @esp-idf-codeowners/tools
|
/components/fatfs/**/*.py @esp-idf-codeowners/tools
|
||||||
/components/freemodbus/ @esp-idf-codeowners/peripherals
|
/components/freemodbus/ @esp-idf-codeowners/peripherals
|
||||||
|
@ -164,7 +164,6 @@
|
|||||||
- "components/esp_phy/lib"
|
- "components/esp_phy/lib"
|
||||||
- "components/esp_wifi/lib"
|
- "components/esp_wifi/lib"
|
||||||
- "components/esptool_py/esptool"
|
- "components/esptool_py/esptool"
|
||||||
- "components/expat/expat"
|
|
||||||
- "components/json/cJSON"
|
- "components/json/cJSON"
|
||||||
- "components/lwip/lwip"
|
- "components/lwip/lwip"
|
||||||
- "components/mbedtls/mbedtls"
|
- "components/mbedtls/mbedtls"
|
||||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -35,10 +35,6 @@
|
|||||||
path = components/asio/asio
|
path = components/asio/asio
|
||||||
url = ../../espressif/asio.git
|
url = ../../espressif/asio.git
|
||||||
|
|
||||||
[submodule "components/expat/expat"]
|
|
||||||
path = components/expat/expat
|
|
||||||
url = ../../libexpat/libexpat.git
|
|
||||||
|
|
||||||
[submodule "components/lwip/lwip"]
|
[submodule "components/lwip/lwip"]
|
||||||
path = components/lwip/lwip
|
path = components/lwip/lwip
|
||||||
url = ../../espressif/esp-lwip.git
|
url = ../../espressif/esp-lwip.git
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
idf_component_register(SRCS "expat/expat/lib/xmlparse.c"
|
|
||||||
"expat/expat/lib/xmlrole.c"
|
|
||||||
"expat/expat/lib/xmltok.c"
|
|
||||||
"expat/expat/lib/xmltok_impl.c"
|
|
||||||
"expat/expat/lib/xmltok_ns.c"
|
|
||||||
INCLUDE_DIRS expat/expat/lib port/include)
|
|
||||||
|
|
||||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE HAVE_EXPAT_CONFIG_H)
|
|
||||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE HAVE_GETRANDOM)
|
|
||||||
|
|
||||||
# Temporary suppress "fallthrough" warnings until they are fixed in expat repo
|
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough)
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit a28238bdeebc087071777001245df1876a11f5ee
|
|
@ -1,22 +0,0 @@
|
|||||||
The Expat XML Parse Instruction
|
|
||||||
=============================
|
|
||||||
|
|
||||||
Expat is an XML parser library written in C which be used for parse XML documents.
|
|
||||||
|
|
||||||
It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document.
|
|
||||||
|
|
||||||
It can parse some larger files.
|
|
||||||
|
|
||||||
- Expat XML Parser support many different processor, but for the most part function you only need the following functions:
|
|
||||||
|
|
||||||
**XML_ParserCreate**: Create a new parser object
|
|
||||||
|
|
||||||
**XML_SetElementHandler**: Set handlers for start and end tags
|
|
||||||
|
|
||||||
**XML_SetCharacterDataHandler**: Set handler for text
|
|
||||||
|
|
||||||
**XML_Parse**: Pass a buffer full of document to the parser
|
|
||||||
|
|
||||||
More information about Expat library can be found on http://expat.sourceforge.net
|
|
||||||
|
|
||||||
An introductory article on using Expat is available on http://xml.com
|
|
@ -1,103 +0,0 @@
|
|||||||
/* expat_config.h. Generated from expat_config.h.in by configure. */
|
|
||||||
/* expat_config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
|
|
||||||
#define BYTEORDER 1234
|
|
||||||
/* Define to 1 if you have the `bcopy' function. */
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#define HAVE_DLFCN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
||||||
#define HAVE_FCNTL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getpagesize' function. */
|
|
||||||
#define HAVE_GETPAGESIZE 1
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `memmove' function. */
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have a working `mmap' system call. */
|
|
||||||
#define HAVE_MMAP 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
|
||||||
#define HAVE_SYS_PARAM_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
|
||||||
#define LT_OBJDIR ".libs/"
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#define PACKAGE "expat"
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "expat"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "expat 2.2.5"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "expat"
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#define PACKAGE_URL ""
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "2.2.5"
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "2.2.5"
|
|
||||||
|
|
||||||
/* whether byteorder is bigendian */
|
|
||||||
/* #undef WORDS_BIGENDIAN */
|
|
||||||
|
|
||||||
/* Define to specify how much context to retain around the current parse
|
|
||||||
point. */
|
|
||||||
#define XML_CONTEXT_BYTES 1024
|
|
||||||
|
|
||||||
/* Define to make parameter entity parsing functionality available. */
|
|
||||||
#define XML_DTD 1
|
|
||||||
|
|
||||||
/* Define to make XML Namespaces functionality available. */
|
|
||||||
#define XML_NS 1
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
/* #undef const */
|
|
||||||
|
|
||||||
/* Define to `long int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef off_t */
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
@ -1,3 +0,0 @@
|
|||||||
idf_component_register(SRC_DIRS "."
|
|
||||||
PRIV_INCLUDE_DIRS "."
|
|
||||||
PRIV_REQUIRES cmock expat)
|
|
@ -1,127 +0,0 @@
|
|||||||
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
#include <expat.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "unity.h"
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int depth;
|
|
||||||
char output[512];
|
|
||||||
int output_off;
|
|
||||||
} user_data_t;
|
|
||||||
|
|
||||||
static void insert_space(user_data_t *user_data)
|
|
||||||
{
|
|
||||||
const char align_str[] = " ";
|
|
||||||
|
|
||||||
TEST_ASSERT(sizeof(user_data->output) >= user_data->output_off);
|
|
||||||
user_data->output[user_data->output_off++] = '\n';
|
|
||||||
|
|
||||||
for (int i = 0; i < user_data->depth; i++) {
|
|
||||||
for (int j = 0; j < strlen(align_str); ++j) {
|
|
||||||
TEST_ASSERT(sizeof(user_data->output) >= user_data->output_off);
|
|
||||||
user_data->output[user_data->output_off++] = align_str[j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void XMLCALL start_element(void *userData, const XML_Char *name, const XML_Char **atts)
|
|
||||||
{
|
|
||||||
user_data_t *user_data = (user_data_t *) userData;
|
|
||||||
|
|
||||||
insert_space(user_data);
|
|
||||||
|
|
||||||
const int ret = snprintf(user_data->output + user_data->output_off,
|
|
||||||
sizeof(user_data->output) - user_data->output_off,
|
|
||||||
"<%s>", name);
|
|
||||||
TEST_ASSERT_EQUAL(strlen(name) + 2, ret); // 2 are the tag characters: "<>"
|
|
||||||
user_data->output_off += ret;
|
|
||||||
++user_data->depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void XMLCALL end_element(void *userData, const XML_Char *name)
|
|
||||||
{
|
|
||||||
user_data_t *user_data = (user_data_t *) userData;
|
|
||||||
|
|
||||||
--user_data->depth;
|
|
||||||
insert_space(user_data);
|
|
||||||
|
|
||||||
int ret = snprintf(user_data->output + user_data->output_off, sizeof(user_data->output) - user_data->output_off,
|
|
||||||
"</%s>", name);
|
|
||||||
TEST_ASSERT_EQUAL(strlen(name) + 3, ret); // 3 are the tag characters: "</>"
|
|
||||||
user_data->output_off += ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void data_handler(void *userData, const XML_Char *s, int len)
|
|
||||||
{
|
|
||||||
user_data_t *user_data = (user_data_t *) userData;
|
|
||||||
|
|
||||||
insert_space(user_data);
|
|
||||||
|
|
||||||
// s is not zero-terminated
|
|
||||||
char tmp_str[len+1];
|
|
||||||
strlcpy(tmp_str, s, len+1);
|
|
||||||
|
|
||||||
int ret = snprintf(user_data->output + user_data->output_off, sizeof(user_data->output) - user_data->output_off,
|
|
||||||
"%s", tmp_str);
|
|
||||||
TEST_ASSERT_EQUAL(strlen(tmp_str), ret);
|
|
||||||
user_data->output_off += ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("Expat parses XML", "[expat]")
|
|
||||||
{
|
|
||||||
const char test_in[] = "<html><title>Page title</title><body><h>header</h><ol><li>A</li>"\
|
|
||||||
"<li>B</li><li>C</li></ol></body></html>";
|
|
||||||
const char test_expected[] = "\n"\
|
|
||||||
"<html>\n"\
|
|
||||||
" <title>\n"\
|
|
||||||
" Page title\n"\
|
|
||||||
" </title>\n"\
|
|
||||||
" <body>\n"\
|
|
||||||
" <h>\n"\
|
|
||||||
" header\n"\
|
|
||||||
" </h>\n"\
|
|
||||||
" <ol>\n"\
|
|
||||||
" <li>\n"\
|
|
||||||
" A\n"\
|
|
||||||
" </li>\n"\
|
|
||||||
" <li>\n"\
|
|
||||||
" B\n"\
|
|
||||||
" </li>\n"\
|
|
||||||
" <li>\n"\
|
|
||||||
" C\n"\
|
|
||||||
" </li>\n"\
|
|
||||||
" </ol>\n"\
|
|
||||||
" </body>\n"\
|
|
||||||
"</html>";
|
|
||||||
user_data_t user_data = {
|
|
||||||
.depth = 0,
|
|
||||||
.output = { '\0' },
|
|
||||||
.output_off = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
XML_Parser parser = XML_ParserCreate(NULL);
|
|
||||||
XML_SetUserData(parser, &user_data);
|
|
||||||
XML_SetElementHandler(parser, start_element, end_element);
|
|
||||||
XML_SetCharacterDataHandler(parser, data_handler);
|
|
||||||
|
|
||||||
TEST_ASSERT_NOT_EQUAL(XML_STATUS_ERROR, XML_Parse(parser, test_in, strlen(test_in), 1));
|
|
||||||
XML_ParserFree(parser);
|
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(0, user_data.depth); // all closing tags have been found
|
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(strlen(test_expected), strlen(user_data.output));
|
|
||||||
TEST_ASSERT_EQUAL_STRING(test_expected, user_data.output);
|
|
||||||
}
|
|
@ -35,8 +35,6 @@ These third party libraries can be included into the application (firmware) prod
|
|||||||
|
|
||||||
* `libcoap`_ COAP library Copyright (c) 2010-2017 Olaf Bergmann and others, is licensed under 2-clause BSD license as described in :component_file:`LICENSE file <coap/libcoap/LICENSE>` and :component_file:`COPYING file <coap/libcoap/COPYING>` .
|
* `libcoap`_ COAP library Copyright (c) 2010-2017 Olaf Bergmann and others, is licensed under 2-clause BSD license as described in :component_file:`LICENSE file <coap/libcoap/LICENSE>` and :component_file:`COPYING file <coap/libcoap/COPYING>` .
|
||||||
|
|
||||||
* `libexpat`_ XML parsing library Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper, Copyright (c) 2001-2017 Expat maintainers, is licensed under MIT license as described in :component_file:`COPYING file <expat/expat/expat/COPYING>`.
|
|
||||||
|
|
||||||
* `FatFS`_ library, Copyright (C) 2017 ChaN, is licensed under :component_file:`a BSD-style license <fatfs/src/ff.h#L1-L18>`.
|
* `FatFS`_ library, Copyright (C) 2017 ChaN, is licensed under :component_file:`a BSD-style license <fatfs/src/ff.h#L1-L18>`.
|
||||||
|
|
||||||
* `cJSON`_ library, Copyright (c) 2009-2017 Dave Gamble and cJSON contributors, is licensed under MIT license as described in :component_file:`LICENSE file <json/cJSON/LICENSE>`.
|
* `cJSON`_ library, Copyright (c) 2009-2017 Dave Gamble and cJSON contributors, is licensed under MIT license as described in :component_file:`LICENSE file <json/cJSON/LICENSE>`.
|
||||||
@ -164,7 +162,6 @@ Copyright (C) 2011, ChaN, all right reserved.
|
|||||||
.. _libcoap: https://github.com/obgm/libcoap
|
.. _libcoap: https://github.com/obgm/libcoap
|
||||||
.. _fatfs: http://elm-chan.org/fsw/ff/00index_e.html
|
.. _fatfs: http://elm-chan.org/fsw/ff/00index_e.html
|
||||||
.. _cJSON: https://github.com/DaveGamble/cJSON
|
.. _cJSON: https://github.com/DaveGamble/cJSON
|
||||||
.. _libexpat: https://github.com/libexpat/libexpat
|
|
||||||
.. _micro-ecc: https://github.com/kmackay/micro-ecc
|
.. _micro-ecc: https://github.com/kmackay/micro-ecc
|
||||||
.. _OpenBSD SD/MMC driver: https://github.com/openbsd/src/blob/f303646/sys/dev/sdmmc/sdmmc.c
|
.. _OpenBSD SD/MMC driver: https://github.com/openbsd/src/blob/f303646/sys/dev/sdmmc/sdmmc.c
|
||||||
.. _Mbed TLS: https://github.com/ARMmbed/mbedtls
|
.. _Mbed TLS: https://github.com/ARMmbed/mbedtls
|
||||||
|
@ -844,8 +844,6 @@ components/espcoredump/src/core_dump_uart.c
|
|||||||
components/espcoredump/src/port/riscv/core_dump_port.c
|
components/espcoredump/src/port/riscv/core_dump_port.c
|
||||||
components/espcoredump/test/test_espcoredump.py
|
components/espcoredump/test/test_espcoredump.py
|
||||||
components/espcoredump/test_apps/main/test_core_dump.c
|
components/espcoredump/test_apps/main/test_core_dump.c
|
||||||
components/expat/port/include/expat_config.h
|
|
||||||
components/expat/test/test_expat.c
|
|
||||||
components/fatfs/diskio/diskio.c
|
components/fatfs/diskio/diskio.c
|
||||||
components/fatfs/diskio/diskio_impl.h
|
components/fatfs/diskio/diskio_impl.h
|
||||||
components/fatfs/diskio/diskio_rawflash.c
|
components/fatfs/diskio/diskio_rawflash.c
|
||||||
|
@ -59,8 +59,6 @@ components/mdns/include/mdns_console.h
|
|||||||
components/esp_serial_slave_link/include/esp_serial_slave_link/essl.h
|
components/esp_serial_slave_link/include/esp_serial_slave_link/essl.h
|
||||||
components/esp_serial_slave_link/include/esp_serial_slave_link/essl_sdio.h
|
components/esp_serial_slave_link/include/esp_serial_slave_link/essl_sdio.h
|
||||||
|
|
||||||
components/expat/
|
|
||||||
|
|
||||||
components/fatfs/vfs/vfs_fat_internal.h
|
components/fatfs/vfs/vfs_fat_internal.h
|
||||||
components/fatfs/src/ffconf.h
|
components/fatfs/src/ffconf.h
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ skip:
|
|||||||
- "components/esp_wifi/lib"
|
- "components/esp_wifi/lib"
|
||||||
- "components/esp_wifi/lib_esp32"
|
- "components/esp_wifi/lib_esp32"
|
||||||
- "components/esptool_py/esptool"
|
- "components/esptool_py/esptool"
|
||||||
- "components/expat/expat"
|
|
||||||
- "components/ieee802154/lib"
|
- "components/ieee802154/lib"
|
||||||
- "components/json/cJSON"
|
- "components/json/cJSON"
|
||||||
- "components/lwip/lwip"
|
- "components/lwip/lwip"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user