Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Include/unicodeobject.h

    r2 r388  
    2929 * --------------------------------------------------------------------
    3030 * This Unicode String Type is
    31  * 
     31 *
    3232 * Copyright (c) 1999 by Secret Labs AB
    3333 * Copyright (c) 1999 by Fredrik Lundh
    34  * 
     34 *
    3535 * By obtaining, using, and/or copying this software and/or its
    3636 * associated documentation, you agree that you have read, understood,
    3737 * and will comply with the following terms and conditions:
    38  * 
     38 *
    3939 * Permission to use, copy, modify, and distribute this software and its
    4040 * associated documentation for any purpose and without fee is hereby
     
    4545 * distribution of the software without specific, written prior
    4646 * permission.
    47  * 
     47 *
    4848 * SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
    4949 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
     
    125125 * as single unsigned integer.
    126126 */
    127 #if SIZEOF_INT >= 4 
    128 typedef unsigned int Py_UCS4; 
     127#if SIZEOF_INT >= 4
     128typedef unsigned int Py_UCS4;
    129129#elif SIZEOF_LONG >= 4
    130 typedef unsigned long Py_UCS4; 
     130typedef unsigned long Py_UCS4;
    131131#endif
    132132
     
    362362 */
    363363#define Py_UNICODE_ISSPACE(ch) \
    364         ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
     364    ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
    365365
    366366#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch)
     
    387387#define Py_UNICODE_ISALNUM(ch) \
    388388       (Py_UNICODE_ISALPHA(ch) || \
    389         Py_UNICODE_ISDECIMAL(ch) || \
    390         Py_UNICODE_ISDIGIT(ch) || \
    391         Py_UNICODE_ISNUMERIC(ch))
    392 
    393 #define Py_UNICODE_COPY(target, source, length)                         \
    394         Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE))
     389    Py_UNICODE_ISDECIMAL(ch) || \
     390    Py_UNICODE_ISDIGIT(ch) || \
     391    Py_UNICODE_ISNUMERIC(ch))
     392
     393#define Py_UNICODE_COPY(target, source, length)                         \
     394    Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE))
    395395
    396396#define Py_UNICODE_FILL(target, value, length) \
    397397    do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
    398         for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
     398    for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
    399399    } while (0)
    400400
     
    415415typedef struct {
    416416    PyObject_HEAD
    417     Py_ssize_t length;          /* Length of raw Unicode data in buffer */
    418     Py_UNICODE *str;            /* Raw Unicode buffer */
    419     long hash;                  /* Hash value; -1 if not set */
    420     PyObject *defenc;           /* (Default) Encoded version as Python
    421                                    string, or NULL; this is used for
    422                                    implementing the buffer protocol */
     417    Py_ssize_t length;          /* Length of raw Unicode data in buffer */
     418    Py_UNICODE *str;            /* Raw Unicode buffer */
     419    long hash;                  /* Hash value; -1 if not set */
     420    PyObject *defenc;           /* (Default) Encoded version as Python
     421                                   string, or NULL; this is used for
     422                                   implementing the buffer protocol */
    423423} PyUnicodeObject;
    424424
     
    431431/* Fast access macros */
    432432#define PyUnicode_GET_SIZE(op) \
    433         (((PyUnicodeObject *)(op))->length)
     433    (((PyUnicodeObject *)(op))->length)
    434434#define PyUnicode_GET_DATA_SIZE(op) \
    435         (((PyUnicodeObject *)(op))->length * sizeof(Py_UNICODE))
     435    (((PyUnicodeObject *)(op))->length * sizeof(Py_UNICODE))
    436436#define PyUnicode_AS_UNICODE(op) \
    437         (((PyUnicodeObject *)(op))->str)
     437    (((PyUnicodeObject *)(op))->str)
    438438#define PyUnicode_AS_DATA(op) \
    439         ((const char *)((PyUnicodeObject *)(op))->str)
     439    ((const char *)((PyUnicodeObject *)(op))->str)
    440440
    441441/* --- Constants ---------------------------------------------------------- */
     
    453453
    454454/* Create a Unicode Object from the Py_UNICODE buffer u of the given
    455    size. 
     455   size.
    456456
    457457   u may be NULL which causes the contents to be undefined. It is the
     
    483483
    484484PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
    485     PyObject *unicode           /* Unicode object */
     485    PyObject *unicode           /* Unicode object */
    486486    );
    487487
     
    489489
    490490PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
    491     PyObject *unicode           /* Unicode object */
     491    PyObject *unicode           /* Unicode object */
    492492    );
    493493
     
    510510
    511511PyAPI_FUNC(int) PyUnicode_Resize(
    512     PyObject **unicode,         /* Pointer to the Unicode object */
    513     Py_ssize_t length           /* New length */
     512    PyObject **unicode,         /* Pointer to the Unicode object */
     513    Py_ssize_t length           /* New length */
    514514    );
    515515
     
    532532
    533533PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
    534     register PyObject *obj,     /* Object */
     534    register PyObject *obj,     /* Object */
    535535    const char *encoding,       /* encoding */
    536536    const char *errors          /* error handling */
     
    539539/* Coerce obj to an Unicode object and return a reference with
    540540   *incremented* refcount.
    541    
     541
    542542   Unicode objects are passed back as-is (subclasses are converted to
    543543   true Unicode objects), all other objects are delegated to
     
    551551
    552552PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
    553     register PyObject *obj      /* Object */
     553    register PyObject *obj      /* Object */
    554554    );
    555555
     
    560560   (Advanced String Formatting). */
    561561PyAPI_FUNC(PyObject *) _PyUnicode_FormatAdvanced(PyObject *obj,
    562                                                 Py_UNICODE *format_spec,
    563                                                 Py_ssize_t format_spec_len);
     562                                                Py_UNICODE *format_spec,
     563                                                Py_ssize_t format_spec_len);
    564564
    565565/* --- wchar_t support for platforms which support it --------------------- */
     
    599599/* --- Unicode ordinals --------------------------------------------------- */
    600600
    601 /* Create a Unicode Object from the given Unicode code point ordinal. 
    602  
     601/* Create a Unicode Object from the given Unicode code point ordinal.
     602
    603603   The ordinal must be in range(0x10000) on narrow Python builds
    604604   (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError is
     
    620620PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
    621621
    622 /* === Builtin Codecs ===================================================== 
     622/* === Builtin Codecs =====================================================
    623623
    624624   Many of these APIs take two arguments encoding and errors. These
    625625   parameters encoding and errors have the same semantics as the ones
    626    of the builtin unicode() API. 
     626   of the builtin unicode() API.
    627627
    628628   Setting encoding to NULL causes the default encoding to be used.
     
    641641
    642642/* Return a Python string holding the default encoded value of the
    643    Unicode object. 
     643   Unicode object.
    644644
    645645   The resulting string is cached in the Unicode object for subsequent
     
    663663   interpreter to become a parameter which is managed on a per-thread
    664664   basis.
    665    
     665
    666666 */
    667667
     
    671671
    672672   Returns 0 on success, -1 in case of an error.
    673    
     673
    674674 */
    675675
    676676PyAPI_FUNC(int) PyUnicode_SetDefaultEncoding(
    677     const char *encoding        /* Encoding name in standard form */
     677    const char *encoding        /* Encoding name in standard form */
    678678    );
    679679
     
    690690    );
    691691
    692 /* Encodes a Py_UNICODE buffer of the given size and returns a 
     692/* Encodes a Py_UNICODE buffer of the given size and returns a
    693693   Python string object. */
    694694
     
    704704
    705705PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject(
    706     PyObject *unicode,          /* Unicode object */
    707     const char *encoding,       /* encoding */
    708     const char *errors          /* error handling */
     706    PyObject *unicode,          /* Unicode object */
     707    const char *encoding,       /* encoding */
     708    const char *errors          /* error handling */
    709709    );
    710710
     
    713713
    714714PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(
    715     PyObject *unicode,          /* Unicode object */
    716     const char *encoding,       /* encoding */
    717     const char *errors          /* error handling */
     715    PyObject *unicode,          /* Unicode object */
     716    const char *encoding,       /* encoding */
     717    const char *errors          /* error handling */
    718718    );
    719719
     
    726726
    727727PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7(
    728     const char *string,         /* UTF-7 encoded string */
    729     Py_ssize_t length,          /* size of string */
    730     const char *errors          /* error handling */
     728    const char *string,         /* UTF-7 encoded string */
     729    Py_ssize_t length,          /* size of string */
     730    const char *errors          /* error handling */
    731731    );
    732732
    733733PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful(
    734     const char *string,         /* UTF-7 encoded string */
    735     Py_ssize_t length,          /* size of string */
    736     const char *errors,         /* error handling */
    737     Py_ssize_t *consumed        /* bytes consumed */
     734    const char *string,         /* UTF-7 encoded string */
     735    Py_ssize_t length,          /* size of string */
     736    const char *errors,         /* error handling */
     737    Py_ssize_t *consumed        /* bytes consumed */
    738738    );
    739739
    740740PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
    741     const Py_UNICODE *data,     /* Unicode char buffer */
    742     Py_ssize_t length,                  /* number of Py_UNICODE chars to encode */
    743     int encodeSetO,             /* force the encoder to encode characters in
    744                                    Set O, as described in RFC2152 */
    745     int encodeWhiteSpace,       /* force the encoder to encode space, tab,
    746                                    carriage return and linefeed characters */
    747     const char *errors          /* error handling */
     741    const Py_UNICODE *data,     /* Unicode char buffer */
     742    Py_ssize_t length,                  /* number of Py_UNICODE chars to encode */
     743    int base64SetO,             /* Encode RFC2152 Set O characters in base64 */
     744    int base64WhiteSpace,       /* Encode whitespace (sp, ht, nl, cr) in base64 */
     745    const char *errors          /* error handling */
    748746    );
    749747
     
    751749
    752750PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8(
    753     const char *string,         /* UTF-8 encoded string */
    754     Py_ssize_t length,          /* size of string */
    755     const char *errors          /* error handling */
     751    const char *string,         /* UTF-8 encoded string */
     752    Py_ssize_t length,          /* size of string */
     753    const char *errors          /* error handling */
    756754    );
    757755
    758756PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful(
    759     const char *string,         /* UTF-8 encoded string */
    760     Py_ssize_t length,          /* size of string */
    761     const char *errors,         /* error handling */
    762     Py_ssize_t *consumed                /* bytes consumed */
     757    const char *string,         /* UTF-8 encoded string */
     758    Py_ssize_t length,          /* size of string */
     759    const char *errors,         /* error handling */
     760    Py_ssize_t *consumed                /* bytes consumed */
    763761    );
    764762
    765763PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
    766     PyObject *unicode           /* Unicode object */
     764    PyObject *unicode           /* Unicode object */
    767765    );
    768766
    769767PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
    770     const Py_UNICODE *data,     /* Unicode char buffer */
    771     Py_ssize_t length,                  /* number of Py_UNICODE chars to encode */
    772     const char *errors          /* error handling */
     768    const Py_UNICODE *data,     /* Unicode char buffer */
     769    Py_ssize_t length,                  /* number of Py_UNICODE chars to encode */
     770    const char *errors          /* error handling */
    773771    );
    774772
     
    779777
    780778   errors (if non-NULL) defines the error handling. It defaults
    781    to "strict". 
     779   to "strict".
    782780
    783781   If byteorder is non-NULL, the decoder starts decoding using the
    784782   given byte order:
    785783
    786         *byteorder == -1: little endian
    787         *byteorder == 0:  native order
    788         *byteorder == 1:  big endian
     784    *byteorder == -1: little endian
     785    *byteorder == 0:  native order
     786    *byteorder == 1:  big endian
    789787
    790788   In native mode, the first four bytes of the stream are checked for a
     
    799797
    800798PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32(
    801     const char *string,         /* UTF-32 encoded string */
    802     Py_ssize_t length,          /* size of string */
    803     const char *errors,         /* error handling */
    804     int *byteorder              /* pointer to byteorder to use
    805                                    0=native;-1=LE,1=BE; updated on
    806                                    exit */
     799    const char *string,         /* UTF-32 encoded string */
     800    Py_ssize_t length,          /* size of string */
     801    const char *errors,         /* error handling */
     802    int *byteorder              /* pointer to byteorder to use
     803                                   0=native;-1=LE,1=BE; updated on
     804                                   exit */
    807805    );
    808806
    809807PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful(
    810     const char *string,         /* UTF-32 encoded string */
    811     Py_ssize_t length,          /* size of string */
    812     const char *errors,         /* error handling */
    813     int *byteorder,             /* pointer to byteorder to use
    814                                    0=native;-1=LE,1=BE; updated on
    815                                    exit */
    816     Py_ssize_t *consumed        /* bytes consumed */
     808    const char *string,         /* UTF-32 encoded string */
     809    Py_ssize_t length,          /* size of string */
     810    const char *errors,         /* error handling */
     811    int *byteorder,             /* pointer to byteorder to use
     812                                   0=native;-1=LE,1=BE; updated on
     813                                   exit */
     814    Py_ssize_t *consumed        /* bytes consumed */
    817815    );
    818816
     
    821819
    822820PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String(
    823     PyObject *unicode           /* Unicode object */
     821    PyObject *unicode           /* Unicode object */
    824822    );
    825823
     
    841839
    842840PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
    843     const Py_UNICODE *data,     /* Unicode char buffer */
    844     Py_ssize_t length,          /* number of Py_UNICODE chars to encode */
    845     const char *errors,         /* error handling */
    846     int byteorder               /* byteorder to use 0=BOM+native;-1=LE,1=BE */
     841    const Py_UNICODE *data,     /* Unicode char buffer */
     842    Py_ssize_t length,          /* number of Py_UNICODE chars to encode */
     843    const char *errors,         /* error handling */
     844    int byteorder               /* byteorder to use 0=BOM+native;-1=LE,1=BE */
    847845    );
    848846
     
    853851
    854852   errors (if non-NULL) defines the error handling. It defaults
    855    to "strict". 
     853   to "strict".
    856854
    857855   If byteorder is non-NULL, the decoder starts decoding using the
    858856   given byte order:
    859857
    860         *byteorder == -1: little endian
    861         *byteorder == 0:  native order
    862         *byteorder == 1:  big endian
     858    *byteorder == -1: little endian
     859    *byteorder == 0:  native order
     860    *byteorder == 1:  big endian
    863861
    864862   In native mode, the first two bytes of the stream are checked for a
     
    873871
    874872PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16(
    875     const char *string,         /* UTF-16 encoded string */
    876     Py_ssize_t length,          /* size of string */
    877     const char *errors,         /* error handling */
    878     int *byteorder              /* pointer to byteorder to use
    879                                    0=native;-1=LE,1=BE; updated on
    880                                    exit */
     873    const char *string,         /* UTF-16 encoded string */
     874    Py_ssize_t length,          /* size of string */
     875    const char *errors,         /* error handling */
     876    int *byteorder              /* pointer to byteorder to use
     877                                   0=native;-1=LE,1=BE; updated on
     878                                   exit */
    881879    );
    882880
    883881PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful(
    884     const char *string,         /* UTF-16 encoded string */
    885     Py_ssize_t length,          /* size of string */
    886     const char *errors,         /* error handling */
    887     int *byteorder,             /* pointer to byteorder to use
    888                                    0=native;-1=LE,1=BE; updated on
    889                                    exit */
    890     Py_ssize_t *consumed                /* bytes consumed */
     882    const char *string,         /* UTF-16 encoded string */
     883    Py_ssize_t length,          /* size of string */
     884    const char *errors,         /* error handling */
     885    int *byteorder,             /* pointer to byteorder to use
     886                                   0=native;-1=LE,1=BE; updated on
     887                                   exit */
     888    Py_ssize_t *consumed                /* bytes consumed */
    891889    );
    892890
     
    895893
    896894PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String(
    897     PyObject *unicode           /* Unicode object */
     895    PyObject *unicode           /* Unicode object */
    898896    );
    899897
     
    919917
    920918PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
    921     const Py_UNICODE *data,     /* Unicode char buffer */
    922     Py_ssize_t length,                  /* number of Py_UNICODE chars to encode */
    923     const char *errors,         /* error handling */
    924     int byteorder               /* byteorder to use 0=BOM+native;-1=LE,1=BE */
     919    const Py_UNICODE *data,     /* Unicode char buffer */
     920    Py_ssize_t length,                  /* number of Py_UNICODE chars to encode */
     921    const char *errors,         /* error handling */
     922    int byteorder               /* byteorder to use 0=BOM+native;-1=LE,1=BE */
    925923    );
    926924
     
    928926
    929927PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
    930     const char *string,         /* Unicode-Escape encoded string */
    931     Py_ssize_t length,          /* size of string */
    932     const char *errors          /* error handling */
     928    const char *string,         /* Unicode-Escape encoded string */
     929    Py_ssize_t length,          /* size of string */
     930    const char *errors          /* error handling */
    933931    );
    934932
    935933PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
    936     PyObject *unicode           /* Unicode object */
     934    PyObject *unicode           /* Unicode object */
    937935    );
    938936
    939937PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape(
    940     const Py_UNICODE *data,     /* Unicode char buffer */
    941     Py_ssize_t length                   /* Number of Py_UNICODE chars to encode */
     938    const Py_UNICODE *data,     /* Unicode char buffer */
     939    Py_ssize_t length                   /* Number of Py_UNICODE chars to encode */
    942940    );
    943941
     
    945943
    946944PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape(
    947     const char *string,         /* Raw-Unicode-Escape encoded string */
    948     Py_ssize_t length,          /* size of string */
    949     const char *errors          /* error handling */
     945    const char *string,         /* Raw-Unicode-Escape encoded string */
     946    Py_ssize_t length,          /* size of string */
     947    const char *errors          /* error handling */
    950948    );
    951949
    952950PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
    953     PyObject *unicode           /* Unicode object */
     951    PyObject *unicode           /* Unicode object */
    954952    );
    955953
    956954PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape(
    957     const Py_UNICODE *data,     /* Unicode char buffer */
    958     Py_ssize_t length                   /* Number of Py_UNICODE chars to encode */
     955    const Py_UNICODE *data,     /* Unicode char buffer */
     956    Py_ssize_t length                   /* Number of Py_UNICODE chars to encode */
    959957    );
    960958
     
    969967    );
    970968
    971 /* --- Latin-1 Codecs ----------------------------------------------------- 
     969/* --- Latin-1 Codecs -----------------------------------------------------
    972970
    973971   Note: Latin-1 corresponds to the first 256 Unicode ordinals.
     
    976974
    977975PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1(
    978     const char *string,         /* Latin-1 encoded string */
    979     Py_ssize_t length,          /* size of string */
    980     const char *errors          /* error handling */
     976    const char *string,         /* Latin-1 encoded string */
     977    Py_ssize_t length,          /* size of string */
     978    const char *errors          /* error handling */
    981979    );
    982980
    983981PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String(
    984     PyObject *unicode           /* Unicode object */
     982    PyObject *unicode           /* Unicode object */
    985983    );
    986984
    987985PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1(
    988     const Py_UNICODE *data,     /* Unicode char buffer */
    989     Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
    990     const char *errors          /* error handling */
    991     );
    992 
    993 /* --- ASCII Codecs ------------------------------------------------------- 
     986    const Py_UNICODE *data,     /* Unicode char buffer */
     987    Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
     988    const char *errors          /* error handling */
     989    );
     990
     991/* --- ASCII Codecs -------------------------------------------------------
    994992
    995993   Only 7-bit ASCII data is excepted. All other codes generate errors.
     
    998996
    999997PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII(
    1000     const char *string,         /* ASCII encoded string */
    1001     Py_ssize_t length,          /* size of string */
    1002     const char *errors          /* error handling */
     998    const char *string,         /* ASCII encoded string */
     999    Py_ssize_t length,          /* size of string */
     1000    const char *errors          /* error handling */
    10031001    );
    10041002
    10051003PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString(
    1006     PyObject *unicode           /* Unicode object */
     1004    PyObject *unicode           /* Unicode object */
    10071005    );
    10081006
    10091007PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII(
    1010     const Py_UNICODE *data,     /* Unicode char buffer */
    1011     Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
    1012     const char *errors          /* error handling */
    1013     );
    1014 
    1015 /* --- Character Map Codecs ----------------------------------------------- 
    1016 
    1017    This codec uses mappings to encode and decode characters. 
     1008    const Py_UNICODE *data,     /* Unicode char buffer */
     1009    Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
     1010    const char *errors          /* error handling */
     1011    );
     1012
     1013/* --- Character Map Codecs -----------------------------------------------
     1014
     1015   This codec uses mappings to encode and decode characters.
    10181016
    10191017   Decoding mappings must map single string characters to single
     
    10361034
    10371035PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap(
    1038     const char *string,         /* Encoded string */
    1039     Py_ssize_t length,          /* size of string */
    1040     PyObject *mapping,          /* character mapping
    1041                                    (char ordinal -> unicode ordinal) */
    1042     const char *errors          /* error handling */
     1036    const char *string,         /* Encoded string */
     1037    Py_ssize_t length,          /* size of string */
     1038    PyObject *mapping,          /* character mapping
     1039                                   (char ordinal -> unicode ordinal) */
     1040    const char *errors          /* error handling */
    10431041    );
    10441042
    10451043PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString(
    1046     PyObject *unicode,          /* Unicode object */
    1047     PyObject *mapping           /* character mapping
    1048                                    (unicode ordinal -> char ordinal) */
     1044    PyObject *unicode,          /* Unicode object */
     1045    PyObject *mapping           /* character mapping
     1046                                   (unicode ordinal -> char ordinal) */
    10491047    );
    10501048
    10511049PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
    1052     const Py_UNICODE *data,     /* Unicode char buffer */
    1053     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
    1054     PyObject *mapping,          /* character mapping
    1055                                    (unicode ordinal -> char ordinal) */
    1056     const char *errors          /* error handling */
     1050    const Py_UNICODE *data,     /* Unicode char buffer */
     1051    Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
     1052    PyObject *mapping,          /* character mapping
     1053                                   (unicode ordinal -> char ordinal) */
     1054    const char *errors          /* error handling */
    10571055    );
    10581056
     
    10621060
    10631061   The mapping table must map Unicode ordinal integers to Unicode
    1064    ordinal integers or None (causing deletion of the character). 
     1062   ordinal integers or None (causing deletion of the character).
    10651063
    10661064   Mapping tables may be dictionaries or sequences. Unmapped character
     
    10711069
    10721070PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
    1073     const Py_UNICODE *data,     /* Unicode char buffer */
    1074     Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
    1075     PyObject *table,            /* Translate table */
    1076     const char *errors          /* error handling */
     1071    const Py_UNICODE *data,     /* Unicode char buffer */
     1072    Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
     1073    PyObject *table,            /* Translate table */
     1074    const char *errors          /* error handling */
    10771075    );
    10781076
     
    11231121      NULL or "strict": raise a ValueError
    11241122      "ignore": ignore the wrong characters (these are not copied to the
    1125                 output buffer)
     1123                output buffer)
    11261124      "replace": replaces illegal characters with '?'
    11271125
     
    11311129
    11321130PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
    1133     Py_UNICODE *s,              /* Unicode buffer */
    1134     Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
    1135     char *output,               /* Output buffer; must have size >= length */
    1136     const char *errors          /* error handling */
     1131    Py_UNICODE *s,              /* Unicode buffer */
     1132    Py_ssize_t length,                  /* Number of Py_UNICODE chars to encode */
     1133    char *output,               /* Output buffer; must have size >= length */
     1134    const char *errors          /* error handling */
    11371135    );
    11381136
     
    11461144
    11471145PyAPI_FUNC(PyObject*) PyUnicode_Concat(
    1148     PyObject *left,             /* Left string */
    1149     PyObject *right             /* Right string */
     1146    PyObject *left,             /* Left string */
     1147    PyObject *right             /* Right string */
    11501148    );
    11511149
     
    11621160
    11631161PyAPI_FUNC(PyObject*) PyUnicode_Split(
    1164     PyObject *s,                /* String to split */
    1165     PyObject *sep,              /* String separator */
    1166     Py_ssize_t maxsplit         /* Maxsplit count */
    1167     );         
     1162    PyObject *s,                /* String to split */
     1163    PyObject *sep,              /* String separator */
     1164    Py_ssize_t maxsplit         /* Maxsplit count */
     1165    );
    11681166
    11691167/* Dito, but split at line breaks.
     
    11711169   CRLF is considered to be one line break. Line breaks are not
    11721170   included in the resulting list. */
    1173    
     1171
    11741172PyAPI_FUNC(PyObject*) PyUnicode_Splitlines(
    1175     PyObject *s,                /* String to split */
    1176     int keepends                /* If true, line end markers are included */
    1177     );         
     1173    PyObject *s,                /* String to split */
     1174    int keepends                /* If true, line end markers are included */
     1175    );
    11781176
    11791177/* Partition a string using a given separator. */
    11801178
    11811179PyAPI_FUNC(PyObject*) PyUnicode_Partition(
    1182     PyObject *s,                /* String to partition */
    1183     PyObject *sep               /* String separator */
    1184     );         
     1180    PyObject *s,                /* String to partition */
     1181    PyObject *sep               /* String separator */
     1182    );
    11851183
    11861184/* Partition a string using a given separator, searching from the end of the
     
    11881186
    11891187PyAPI_FUNC(PyObject*) PyUnicode_RPartition(
    1190     PyObject *s,                /* String to partition */
    1191     PyObject *sep               /* String separator */
    1192     );         
     1188    PyObject *s,                /* String to partition */
     1189    PyObject *sep               /* String separator */
     1190    );
    11931191
    11941192/* Split a string giving a list of Unicode strings.
     
    12061204
    12071205PyAPI_FUNC(PyObject*) PyUnicode_RSplit(
    1208     PyObject *s,                /* String to split */
    1209     PyObject *sep,              /* String separator */
    1210     Py_ssize_t maxsplit         /* Maxsplit count */
    1211     );         
     1206    PyObject *s,                /* String to split */
     1207    PyObject *sep,              /* String separator */
     1208    Py_ssize_t maxsplit         /* Maxsplit count */
     1209    );
    12121210
    12131211/* Translate a string by applying a character mapping table to it and
     
    12151213
    12161214   The mapping table must map Unicode ordinal integers to Unicode
    1217    ordinal integers or None (causing deletion of the character). 
     1215   ordinal integers or None (causing deletion of the character).
    12181216
    12191217   Mapping tables may be dictionaries or sequences. Unmapped character
     
    12241222
    12251223PyAPI_FUNC(PyObject *) PyUnicode_Translate(
    1226     PyObject *str,              /* String */
    1227     PyObject *table,            /* Translate table */
    1228     const char *errors          /* error handling */
     1224    PyObject *str,              /* String */
     1225    PyObject *table,            /* Translate table */
     1226    const char *errors          /* error handling */
    12291227    );
    12301228
    12311229/* Join a sequence of strings using the given separator and return
    12321230   the resulting Unicode string. */
    1233    
     1231
    12341232PyAPI_FUNC(PyObject*) PyUnicode_Join(
    1235     PyObject *separator,        /* Separator string */
    1236     PyObject *seq               /* Sequence object */
     1233    PyObject *separator,        /* Separator string */
     1234    PyObject *seq               /* Sequence object */
    12371235    );
    12381236
     
    12411239
    12421240PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch(
    1243     PyObject *str,              /* String */
    1244     PyObject *substr,           /* Prefix or Suffix string */
    1245     Py_ssize_t start,           /* Start index */
    1246     Py_ssize_t end,             /* Stop index */
    1247     int direction               /* Tail end: -1 prefix, +1 suffix */
     1241    PyObject *str,              /* String */
     1242    PyObject *substr,           /* Prefix or Suffix string */
     1243    Py_ssize_t start,           /* Start index */
     1244    Py_ssize_t end,             /* Stop index */
     1245    int direction               /* Tail end: -1 prefix, +1 suffix */
    12481246    );
    12491247
     
    12531251
    12541252PyAPI_FUNC(Py_ssize_t) PyUnicode_Find(
    1255     PyObject *str,              /* String */
    1256     PyObject *substr,           /* Substring to find */
    1257     Py_ssize_t start,           /* Start index */
    1258     Py_ssize_t end,             /* Stop index */
    1259     int direction               /* Find direction: +1 forward, -1 backward */
     1253    PyObject *str,              /* String */
     1254    PyObject *substr,           /* Substring to find */
     1255    Py_ssize_t start,           /* Start index */
     1256    Py_ssize_t end,             /* Stop index */
     1257    int direction               /* Find direction: +1 forward, -1 backward */
    12601258    );
    12611259
     
    12631261
    12641262PyAPI_FUNC(Py_ssize_t) PyUnicode_Count(
    1265     PyObject *str,              /* String */
    1266     PyObject *substr,           /* Substring to count */
    1267     Py_ssize_t start,           /* Start index */
    1268     Py_ssize_t end              /* Stop index */
     1263    PyObject *str,              /* String */
     1264    PyObject *substr,           /* Substring to count */
     1265    Py_ssize_t start,           /* Start index */
     1266    Py_ssize_t end              /* Stop index */
    12691267    );
    12701268
     
    12731271
    12741272PyAPI_FUNC(PyObject *) PyUnicode_Replace(
    1275     PyObject *str,              /* String */
    1276     PyObject *substr,           /* Substring to find */
    1277     PyObject *replstr,          /* Substring to replace */
    1278     Py_ssize_t maxcount         /* Max. number of replacements to apply;
    1279                                    -1 = all */
     1273    PyObject *str,              /* String */
     1274    PyObject *substr,           /* Substring to find */
     1275    PyObject *replstr,          /* Substring to replace */
     1276    Py_ssize_t maxcount         /* Max. number of replacements to apply;
     1277                                   -1 = all */
    12801278    );
    12811279
     
    12841282
    12851283PyAPI_FUNC(int) PyUnicode_Compare(
    1286     PyObject *left,             /* Left string */
    1287     PyObject *right             /* Right string */
     1284    PyObject *left,             /* Left string */
     1285    PyObject *right             /* Right string */
    12881286    );
    12891287
     
    13051303
    13061304PyAPI_FUNC(PyObject *) PyUnicode_RichCompare(
    1307     PyObject *left,             /* Left string */
    1308     PyObject *right,            /* Right string */
    1309     int op                      /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
     1305    PyObject *left,             /* Left string */
     1306    PyObject *right,            /* Right string */
     1307    int op                      /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
    13101308    );
    13111309
     
    13141312
    13151313PyAPI_FUNC(PyObject *) PyUnicode_Format(
    1316     PyObject *format,           /* Format string */
    1317     PyObject *args              /* Argument tuple or dictionary */
     1314    PyObject *format,           /* Format string */
     1315    PyObject *args              /* Argument tuple or dictionary */
    13181316    );
    13191317
     
    13251323
    13261324PyAPI_FUNC(int) PyUnicode_Contains(
    1327     PyObject *container,        /* Container string */
    1328     PyObject *element           /* Element string */
     1325    PyObject *container,        /* Container string */
     1326    PyObject *element           /* Element string */
    13291327    );
    13301328
     
    13431341
    13441342/* These should not be used directly. Use the Py_UNICODE_IS* and
    1345    Py_UNICODE_TO* macros instead. 
     1343   Py_UNICODE_TO* macros instead.
    13461344
    13471345   These APIs are implemented in Objects/unicodectype.c.
     
    13501348
    13511349PyAPI_FUNC(int) _PyUnicode_IsLowercase(
    1352     Py_UNICODE ch       /* Unicode character */
     1350    Py_UNICODE ch       /* Unicode character */
    13531351    );
    13541352
    13551353PyAPI_FUNC(int) _PyUnicode_IsUppercase(
    1356     Py_UNICODE ch       /* Unicode character */
     1354    Py_UNICODE ch       /* Unicode character */
    13571355    );
    13581356
    13591357PyAPI_FUNC(int) _PyUnicode_IsTitlecase(
    1360     Py_UNICODE ch       /* Unicode character */
     1358    Py_UNICODE ch       /* Unicode character */
    13611359    );
    13621360
    13631361PyAPI_FUNC(int) _PyUnicode_IsWhitespace(
    1364     const Py_UNICODE ch         /* Unicode character */
     1362    const Py_UNICODE ch         /* Unicode character */
    13651363    );
    13661364
    13671365PyAPI_FUNC(int) _PyUnicode_IsLinebreak(
    1368     const Py_UNICODE ch         /* Unicode character */
     1366    const Py_UNICODE ch         /* Unicode character */
    13691367    );
    13701368
    13711369PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToLowercase(
    1372     Py_UNICODE ch       /* Unicode character */
     1370    Py_UNICODE ch       /* Unicode character */
    13731371    );
    13741372
    13751373PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToUppercase(
    1376     Py_UNICODE ch       /* Unicode character */
     1374    Py_UNICODE ch       /* Unicode character */
    13771375    );
    13781376
    13791377PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToTitlecase(
    1380     Py_UNICODE ch       /* Unicode character */
     1378    Py_UNICODE ch       /* Unicode character */
    13811379    );
    13821380
    13831381PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit(
    1384     Py_UNICODE ch       /* Unicode character */
     1382    Py_UNICODE ch       /* Unicode character */
    13851383    );
    13861384
    13871385PyAPI_FUNC(int) _PyUnicode_ToDigit(
    1388     Py_UNICODE ch       /* Unicode character */
     1386    Py_UNICODE ch       /* Unicode character */
    13891387    );
    13901388
    13911389PyAPI_FUNC(double) _PyUnicode_ToNumeric(
    1392     Py_UNICODE ch       /* Unicode character */
     1390    Py_UNICODE ch       /* Unicode character */
    13931391    );
    13941392
    13951393PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit(
    1396     Py_UNICODE ch       /* Unicode character */
     1394    Py_UNICODE ch       /* Unicode character */
    13971395    );
    13981396
    13991397PyAPI_FUNC(int) _PyUnicode_IsDigit(
    1400     Py_UNICODE ch       /* Unicode character */
     1398    Py_UNICODE ch       /* Unicode character */
    14011399    );
    14021400
    14031401PyAPI_FUNC(int) _PyUnicode_IsNumeric(
    1404     Py_UNICODE ch       /* Unicode character */
     1402    Py_UNICODE ch       /* Unicode character */
    14051403    );
    14061404
    14071405PyAPI_FUNC(int) _PyUnicode_IsAlpha(
    1408     Py_UNICODE ch       /* Unicode character */
     1406    Py_UNICODE ch       /* Unicode character */
    14091407    );
    14101408
Note: See TracChangeset for help on using the changeset viewer.