diff --git a/.flake8 b/.flake8 index 6c8f34d5ce..da1f8db83a 100644 --- a/.flake8 +++ b/.flake8 @@ -144,7 +144,6 @@ exclude = components/bt/host/nimble/nimble, components/cmock/CMock, components/esptool_py/esptool, - components/expat/expat, components/json/cJSON, components/mbedtls/mbedtls, components/openthread/openthread, diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 1abb1a9622..9c87aa7de8 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -102,7 +102,6 @@ /components/esp_wifi/ @esp-idf-codeowners/wifi /components/espcoredump/ @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/**/*.py @esp-idf-codeowners/tools /components/freemodbus/ @esp-idf-codeowners/peripherals diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index de7fb4c7b9..4e347cd64c 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -164,7 +164,6 @@ - "components/esp_phy/lib" - "components/esp_wifi/lib" - "components/esptool_py/esptool" - - "components/expat/expat" - "components/json/cJSON" - "components/lwip/lwip" - "components/mbedtls/mbedtls" diff --git a/.gitmodules b/.gitmodules index 169409a9ee..22072ae29f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -35,10 +35,6 @@ path = components/asio/asio url = ../../espressif/asio.git -[submodule "components/expat/expat"] - path = components/expat/expat - url = ../../libexpat/libexpat.git - [submodule "components/lwip/lwip"] path = components/lwip/lwip url = ../../espressif/esp-lwip.git diff --git a/components/expat/CMakeLists.txt b/components/expat/CMakeLists.txt deleted file mode 100644 index a45a420983..0000000000 --- a/components/expat/CMakeLists.txt +++ /dev/null @@ -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) diff --git a/components/expat/expat b/components/expat/expat deleted file mode 160000 index a28238bdee..0000000000 --- a/components/expat/expat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a28238bdeebc087071777001245df1876a11f5ee diff --git a/components/expat/expat.rst b/components/expat/expat.rst deleted file mode 100644 index 9e681229e7..0000000000 --- a/components/expat/expat.rst +++ /dev/null @@ -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 diff --git a/components/expat/port/include/expat_config.h b/components/expat/port/include/expat_config.h deleted file mode 100644 index b6b927a19b..0000000000 --- a/components/expat/port/include/expat_config.h +++ /dev/null @@ -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 header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the 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 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 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 header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the 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 does not define. */ -/* #undef off_t */ - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ diff --git a/components/expat/test/CMakeLists.txt b/components/expat/test/CMakeLists.txt deleted file mode 100644 index d60400be37..0000000000 --- a/components/expat/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -idf_component_register(SRC_DIRS "." - PRIV_INCLUDE_DIRS "." - PRIV_REQUIRES cmock expat) diff --git a/components/expat/test/test_expat.c b/components/expat/test/test_expat.c deleted file mode 100644 index 21c7cd0ddc..0000000000 --- a/components/expat/test/test_expat.c +++ /dev/null @@ -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 -#include -#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, - "", 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[] = "Page titleheader
  1. A
  2. "\ - "
  3. B
  4. C
"; - const char test_expected[] = "\n"\ - "\n"\ - " \n"\ - " Page title\n"\ - " \n"\ - " \n"\ - " \n"\ - " header\n"\ - " \n"\ - "
    \n"\ - "
  1. \n"\ - " A\n"\ - "
  2. \n"\ - "
  3. \n"\ - " B\n"\ - "
  4. \n"\ - "
  5. \n"\ - " C\n"\ - "
  6. \n"\ - "
\n"\ - " \n"\ - ""; - 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); -} diff --git a/docs/en/COPYRIGHT.rst b/docs/en/COPYRIGHT.rst index e4d1f671e2..8e58e27a03 100644 --- a/docs/en/COPYRIGHT.rst +++ b/docs/en/COPYRIGHT.rst @@ -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 ` and :component_file:`COPYING file ` . -* `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 `. - * `FatFS`_ library, Copyright (C) 2017 ChaN, is licensed under :component_file:`a BSD-style license `. * `cJSON`_ library, Copyright (c) 2009-2017 Dave Gamble and cJSON contributors, is licensed under MIT license as described in :component_file:`LICENSE file `. @@ -164,7 +162,6 @@ Copyright (C) 2011, ChaN, all right reserved. .. _libcoap: https://github.com/obgm/libcoap .. _fatfs: http://elm-chan.org/fsw/ff/00index_e.html .. _cJSON: https://github.com/DaveGamble/cJSON -.. _libexpat: https://github.com/libexpat/libexpat .. _micro-ecc: https://github.com/kmackay/micro-ecc .. _OpenBSD SD/MMC driver: https://github.com/openbsd/src/blob/f303646/sys/dev/sdmmc/sdmmc.c .. _Mbed TLS: https://github.com/ARMmbed/mbedtls diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index f5f1911034..562042c099 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -844,8 +844,6 @@ components/espcoredump/src/core_dump_uart.c components/espcoredump/src/port/riscv/core_dump_port.c components/espcoredump/test/test_espcoredump.py 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_impl.h components/fatfs/diskio/diskio_rawflash.c diff --git a/tools/ci/check_public_headers_exceptions.txt b/tools/ci/check_public_headers_exceptions.txt index 94a65bccfa..949adf0557 100644 --- a/tools/ci/check_public_headers_exceptions.txt +++ b/tools/ci/check_public_headers_exceptions.txt @@ -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_sdio.h -components/expat/ - components/fatfs/vfs/vfs_fat_internal.h components/fatfs/src/ffconf.h diff --git a/tools/ci/static-analysis-rules.yml b/tools/ci/static-analysis-rules.yml index 66dfaa0a02..973df65209 100644 --- a/tools/ci/static-analysis-rules.yml +++ b/tools/ci/static-analysis-rules.yml @@ -20,7 +20,6 @@ skip: - "components/esp_wifi/lib" - "components/esp_wifi/lib_esp32" - "components/esptool_py/esptool" - - "components/expat/expat" - "components/ieee802154/lib" - "components/json/cJSON" - "components/lwip/lwip"