cpython/Modules/expat/xmltok_impl.c

/* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
                            __  __            _
                         ___\ \/ /_ __   __ _| |_
                        / _ \\  /| '_ \ / _` | __|
                       |  __//  \| |_) | (_| | |_
                        \___/_/\_\ .__/ \__,_|\__|
                                 |_| XML parser

   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
   Copyright (c) 2000      Clark Cooper <[email protected]>
   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
   Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
   Copyright (c) 2016-2022 Sebastian Pipping <[email protected]>
   Copyright (c) 2017      Rhodri James <[email protected]>
   Copyright (c) 2018      Benjamin Peterson <[email protected]>
   Copyright (c) 2018      Anton Maklakov <[email protected]>
   Copyright (c) 2019      David Loffredo <[email protected]>
   Copyright (c) 2020      Boris Kolpackov <[email protected]>
   Copyright (c) 2022      Martin Ettl <[email protected]>
   Licensed under the MIT license:

   Permission is  hereby granted,  free of charge,  to any  person obtaining
   a  copy  of  this  software   and  associated  documentation  files  (the
   "Software"),  to  deal in  the  Software  without restriction,  including
   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
   distribute, sublicense, and/or sell copies of the Software, and to permit
   persons  to whom  the Software  is  furnished to  do so,  subject to  the
   following conditions:

   The above copyright  notice and this permission notice  shall be included
   in all copies or substantial portions of the Software.

   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
   USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifdef XML_TOK_IMPL_C

#  ifndef IS_INVALID_CHAR // i.e. for UTF-16 and XML_MIN_SIZE not defined
#define IS_INVALID_CHAR
#  endif

#define INVALID_LEAD_CASE(n, ptr, nextTokPtr)

#define INVALID_CASES

#define CHECK_NAME_CASE

#define CHECK_NAME_CASES

#define CHECK_NMSTRT_CASE

#define CHECK_NMSTRT_CASES

#  ifndef PREFIX
#define PREFIX
#  endif

#define HAS_CHARS(enc, ptr, end, count)

#define HAS_CHAR(enc, ptr, end)

#define REQUIRE_CHARS(enc, ptr, end, count)

#define REQUIRE_CHAR(enc, ptr, end)

/* ptr points to character following "<!-" */

static int PTRCALL
PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end,
                    const char **nextTokPtr) {}

/* ptr points to character following "<!" */

static int PTRCALL
PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
                 const char **nextTokPtr) {}

static int PTRCALL
PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end,
                      int *tokPtr) {}

/* ptr points to character following "<?" */

static int PTRCALL
PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
               const char **nextTokPtr) {}

static int PTRCALL
PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end,
                         const char **nextTokPtr) {}

static int PTRCALL
PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
                        const char **nextTokPtr) {}

/* ptr points to character following "</" */

static int PTRCALL
PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end,
                   const char **nextTokPtr) {}

/* ptr points to character following "&#X" */

static int PTRCALL
PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end,
                       const char **nextTokPtr) {}

/* ptr points to character following "&#" */

static int PTRCALL
PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end,
                    const char **nextTokPtr) {}

/* ptr points to character following "&" */

static int PTRCALL
PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
                const char **nextTokPtr) {}

/* ptr points to character following first character of attribute name */

static int PTRCALL
PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
                 const char **nextTokPtr) {}

/* ptr points to character following "<" */

static int PTRCALL
PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
               const char **nextTokPtr) {}

static int PTRCALL
PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
                   const char **nextTokPtr) {}

/* ptr points to character following "%" */

static int PTRCALL
PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
                    const char **nextTokPtr) {}

static int PTRCALL
PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
                      const char **nextTokPtr) {}

static int PTRCALL
PREFIX(scanLit)(int open, const ENCODING *enc, const char *ptr, const char *end,
                const char **nextTokPtr) {}

static int PTRCALL
PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
                  const char **nextTokPtr) {}

static int PTRCALL
PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
                          const char **nextTokPtr) {}

static int PTRCALL
PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end,
                       const char **nextTokPtr) {}

#  ifdef XML_DTD

static int PTRCALL
PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
                         const char **nextTokPtr) {}

#  endif /* XML_DTD */

static int PTRCALL
PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
                   const char **badPtr) {}

/* This must only be called for a well-formed start-tag or empty
   element tag.  Returns the number of attributes.  Pointers to the
   first attsMax attributes are stored in atts.
*/

static int PTRCALL
PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
                ATTRIBUTE *atts) {}

static int PTRFASTCALL
PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) {}

static int PTRCALL
PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr,
                             const char *end) {}

static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
                         const char *end1, const char *ptr2) {}

static int PTRFASTCALL
PREFIX(nameLength)(const ENCODING *enc, const char *ptr) {}

static const char *PTRFASTCALL
PREFIX(skipS)(const ENCODING *enc, const char *ptr) {}

static void PTRCALL
PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end,
                       POSITION *pos) {}

#  undef DO_LEAD_CASE
#  undef MULTIBYTE_CASES
#  undef INVALID_CASES
#  undef CHECK_NAME_CASE
#  undef CHECK_NAME_CASES
#  undef CHECK_NMSTRT_CASE
#  undef CHECK_NMSTRT_CASES

#endif /* XML_TOK_IMPL_C */