[Python-checkins] CVS: python/dist/src/Include abstract.h,2.31.2.1,2.31.2.2 cStringIO.h,2.14,2.14.8.1 ceval.h,2.41.4.1,2.41.4.2 compile.h,2.29,2.29.4.1 dictobject.h,2.20.8.2,2.20.8.3 fileobject.h,2.22,2.22.8.1 floatobject.h,2.17,2.17.8.1 frameobject.h,2.31,2.31.4.1 graminit.h,2.16,2.16.8.1 longobject.h,2.19,2.19.8.1 opcode.h,2.35,2.35.2.1 pyport.h,2.26,2.26.6.1 pystate.h,2.14,2.14.6.1 rangeobject.h,2.15,2.15.8.1 stringobject.h,2.25,2.25.6.1 symtable.h,2.7,2.7.4.1 tupleobject.h,2.24,2.24.8.1 unicodeobject.h,2.20,2.20.2.1
Tim Peters
tim_one@users.sourceforge.net
Sat, 07 Jul 2001 15:56:00 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Grammar Grammar,1.42,1.42.6.1
- Next message: [Python-checkins] CVS: python/dist/src LICENSE,1.15,1.15.4.1 Makefile.pre.in,1.37.2.1,1.37.2.2 PLAN.txt,1.1.2.16,1.1.2.17 README,1.123,1.123.2.1 acconfig.h,1.46,1.46.4.1 config.h.in,2.92,2.92.2.1 configure,1.209,1.209.2.1 configure.in,1.217,1.217.2.1 setup.py,1.38,1.38.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv24450/mergedescr/dist/src/Include
Modified Files:
Tag: descr-branch
abstract.h cStringIO.h ceval.h compile.h dictobject.h
fileobject.h floatobject.h frameobject.h graminit.h
longobject.h opcode.h pyport.h pystate.h rangeobject.h
stringobject.h symtable.h tupleobject.h unicodeobject.h
Log Message:
Merge of trunk tag date2001-07-06 into descr-branch.
Index: abstract.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v
retrieving revision 2.31.2.1
retrieving revision 2.31.2.2
diff -C2 -r2.31.2.1 -r2.31.2.2
*** abstract.h 2001/05/05 11:37:29 2.31.2.1
--- abstract.h 2001/07/07 22:55:27 2.31.2.2
***************
*** 496,502 ****
/* Takes an iterator object and calls its tp_iternext slot,
returning the next value. If the iterator is exhausted,
! this can return NULL without setting an exception, *or*
! NULL with a StopIteration exception.
! NULL with any other exception means an error occurred. */
/* Number Protocol:*/
--- 496,501 ----
/* Takes an iterator object and calls its tp_iternext slot,
returning the next value. If the iterator is exhausted,
! this returns NULL without setting an exception.
! NULL with an exception means an error occurred. */
/* Number Protocol:*/
***************
*** 924,928 ****
members of this list.
! Returns NULL on failure. If the object is not a sequence,
raises a TypeError exception with m as the message text.
*/
--- 923,927 ----
members of this list.
! Returns NULL on failure. If the object does not support iteration,
raises a TypeError exception with m as the message text.
*/
***************
*** 945,949 ****
*/
! DL_IMPORT(int) PySequence_Contains(PyObject *o, PyObject *value);
/* For DLL-level backwards compatibility */
--- 944,958 ----
*/
! DL_IMPORT(int) PySequence_Contains(PyObject *seq, PyObject *ob);
! /*
! Return -1 if error; 1 if ob in seq; 0 if ob not in seq.
! Use __contains__ if possible, else _PySequence_IterContains().
! */
!
! DL_IMPORT(int) _PySequence_IterContains(PyObject *seq, PyObject *ob);
! /*
! Return -1 if error; 1 if ob in seq; 0 if ob not in seq.
! Always uses the iteration protocol, and only Py_EQ comparisons.
! */
/* For DLL-level backwards compatibility */
Index: cStringIO.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/cStringIO.h,v
retrieving revision 2.14
retrieving revision 2.14.8.1
diff -C2 -r2.14 -r2.14.8.1
*** cStringIO.h 2000/07/22 19:25:51 2.14
--- cStringIO.h 2001/07/07 22:55:27 2.14.8.1
***************
*** 127,131 ****
#define PycString_IMPORT \
! PycStringIO=xxxPyCObject_Import("cStringIO", "cStringIO_CAPI")
#endif /* CSTRINGIO_INCLUDED */
--- 127,131 ----
#define PycString_IMPORT \
! PycStringIO=(struct PycStringIO_CAPI*)xxxPyCObject_Import("cStringIO", "cStringIO_CAPI")
#endif /* CSTRINGIO_INCLUDED */
Index: ceval.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v
retrieving revision 2.41.4.1
retrieving revision 2.41.4.2
diff -C2 -r2.41.4.1 -r2.41.4.2
*** ceval.h 2001/05/05 11:37:29 2.41.4.1
--- ceval.h 2001/07/07 22:55:27 2.41.4.2
***************
*** 23,26 ****
--- 23,29 ----
char *methodname, char *format, ...);
+ DL_IMPORT(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
+ DL_IMPORT(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
+
DL_IMPORT(PyObject *) PyEval_GetBuiltins(void);
DL_IMPORT(PyObject *) PyEval_GetGlobals(void);
Index: compile.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v
retrieving revision 2.29
retrieving revision 2.29.4.1
diff -C2 -r2.29 -r2.29.4.1
*** compile.h 2001/03/22 02:32:48 2.29
--- compile.h 2001/07/07 22:55:27 2.29.4.1
***************
*** 34,37 ****
--- 34,38 ----
#define CO_VARKEYWORDS 0x0008
#define CO_NESTED 0x0010
+ #define CO_GENERATOR 0x0020
extern DL_IMPORT(PyTypeObject) PyCode_Type;
Index: dictobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/dictobject.h,v
retrieving revision 2.20.8.2
retrieving revision 2.20.8.3
diff -C2 -r2.20.8.2 -r2.20.8.3
*** dictobject.h 2001/06/28 16:36:53 2.20.8.2
--- dictobject.h 2001/07/07 22:55:27 2.20.8.3
***************
*** 31,34 ****
--- 31,45 ----
meaning otherwise.
*/
+
+ /* PyDict_MINSIZE is the minimum size of a dictionary. This many slots are
+ * allocated directly in the dict object (in the ma_smalltable member).
+ * It must be a power of 2, and at least 4. 8 allows dicts with no more
+ * than 5 active entries to live in ma_smalltable (and so avoid an
+ * additional malloc); instrumentation suggested this suffices for the
+ * majority of dicts (consisting mostly of usually-small instance dicts and
+ * usually-small dicts created to pass keyword arguments).
+ */
+ #define PyDict_MINSIZE 8
+
typedef struct {
long me_hash; /* cached hash code of me_key */
***************
*** 54,61 ****
int ma_fill; /* # Active + # Dummy */
int ma_used; /* # Active */
! int ma_size; /* total # slots in ma_table */
! int ma_poly; /* appopriate entry from polys vector */
PyDictEntry *ma_table;
PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
};
--- 65,83 ----
int ma_fill; /* # Active + # Dummy */
int ma_used; /* # Active */
!
! /* The table contains ma_mask + 1 slots, and that's a power of 2.
! * We store the mask instead of the size because the mask is more
! * frequently needed.
! */
! int ma_mask;
!
! /* ma_table points to ma_smalltable for small tables, else to
! * additional malloc'ed memory. ma_table is never NULL! This rule
! * saves repeated runtime null-tests in the workhorse getitem and
! * setitem calls.
! */
PyDictEntry *ma_table;
PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
+ PyDictEntry ma_smalltable[PyDict_MINSIZE];
};
Index: fileobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/fileobject.h,v
retrieving revision 2.22
retrieving revision 2.22.8.1
diff -C2 -r2.22 -r2.22.8.1
*** fileobject.h 2000/09/01 23:29:26 2.22
--- fileobject.h 2001/07/07 22:55:27 2.22.8.1
***************
*** 24,27 ****
--- 24,32 ----
extern DL_IMPORT(int) PyObject_AsFileDescriptor(PyObject *);
+ /* The default encoding used by the platform file system APIs
+ If non-NULL, this is different than the default encoding for strings
+ */
+ extern DL_IMPORT(const char *) Py_FileSystemDefaultEncoding;
+
#ifdef __cplusplus
}
Index: floatobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/floatobject.h,v
retrieving revision 2.17
retrieving revision 2.17.8.1
diff -C2 -r2.17 -r2.17.8.1
*** floatobject.h 2000/09/01 23:29:26 2.17
--- floatobject.h 2001/07/07 22:55:27 2.17.8.1
***************
*** 21,30 ****
#define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
! extern DL_IMPORT(PyObject *) PyFloat_FromString(PyObject*, char**);
extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double);
- extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *);
! /* Macro, trading safety for speed */
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
#ifdef __cplusplus
--- 21,49 ----
#define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
! /* Return Python float from string PyObject. Second argument ignored on
! input, and, if non-NULL, NULL is stored into *junk (this tried to serve a
! purpose once but can't be made to work as intended). */
! extern DL_IMPORT(PyObject *) PyFloat_FromString(PyObject*, char** junk);
!
! /* Return Python float from C double. */
extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double);
! /* Extract C double from Python float. The macro version trades safety for
! speed. */
! extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *);
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
+
+ /* Write repr(v) into the char buffer argument, followed by null byte. The
+ buffer must be "big enough"; >= 100 is very safe.
+ PyFloat_AsReprString(buf, x) strives to print enough digits so that
+ PyFloat_FromString(buf) then reproduces x exactly. */
+ extern DL_IMPORT(void) PyFloat_AsReprString(char*, PyFloatObject *v);
+
+ /* Write str(v) into the char buffer argument, followed by null byte. The
+ buffer must be "big enough"; >= 100 is very safe. Note that it's
+ unusual to be able to get back the float you started with from
+ PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to
+ preserve precision across conversions. */
+ extern DL_IMPORT(void) PyFloat_AsString(char*, PyFloatObject *v);
#ifdef __cplusplus
Index: frameobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/frameobject.h,v
retrieving revision 2.31
retrieving revision 2.31.4.1
diff -C2 -r2.31 -r2.31.4.1
*** frameobject.h 2001/03/13 01:58:21 2.31
--- frameobject.h 2001/07/07 22:55:27 2.31.4.1
***************
*** 22,25 ****
--- 22,29 ----
PyObject *f_locals; /* local symbol table (PyDictObject) */
PyObject **f_valuestack; /* points after the last local */
+ /* Next free slot in f_valuestack. Frame creation sets to f_valuestack.
+ Frame evaluation usually NULLs it, but a frame that yields sets it
+ to the current stack top. */
+ PyObject **f_stacktop;
PyObject *f_trace; /* Trace function */
PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
Index: graminit.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/graminit.h,v
retrieving revision 2.16
retrieving revision 2.16.8.1
diff -C2 -r2.16 -r2.16.8.1
*** graminit.h 2000/08/24 20:09:45 2.16
--- graminit.h 2001/07/07 22:55:27 2.16.8.1
***************
*** 19,64 ****
#define continue_stmt 274
#define return_stmt 275
! #define raise_stmt 276
! #define import_stmt 277
! #define import_as_name 278
! #define dotted_as_name 279
! #define dotted_name 280
! #define global_stmt 281
! #define exec_stmt 282
! #define assert_stmt 283
! #define compound_stmt 284
! #define if_stmt 285
! #define while_stmt 286
! #define for_stmt 287
! #define try_stmt 288
! #define except_clause 289
! #define suite 290
! #define test 291
! #define and_test 292
! #define not_test 293
! #define comparison 294
! #define comp_op 295
! #define expr 296
! #define xor_expr 297
! #define and_expr 298
! #define shift_expr 299
! #define arith_expr 300
! #define term 301
! #define factor 302
! #define power 303
! #define atom 304
! #define listmaker 305
! #define lambdef 306
! #define trailer 307
! #define subscriptlist 308
! #define subscript 309
! #define sliceop 310
! #define exprlist 311
! #define testlist 312
! #define dictmaker 313
! #define classdef 314
! #define arglist 315
! #define argument 316
! #define list_iter 317
! #define list_for 318
! #define list_if 319
--- 19,65 ----
#define continue_stmt 274
#define return_stmt 275
! #define yield_stmt 276
! #define raise_stmt 277
! #define import_stmt 278
! #define import_as_name 279
! #define dotted_as_name 280
! #define dotted_name 281
! #define global_stmt 282
! #define exec_stmt 283
! #define assert_stmt 284
! #define compound_stmt 285
! #define if_stmt 286
! #define while_stmt 287
! #define for_stmt 288
! #define try_stmt 289
! #define except_clause 290
! #define suite 291
! #define test 292
! #define and_test 293
! #define not_test 294
! #define comparison 295
! #define comp_op 296
! #define expr 297
! #define xor_expr 298
! #define and_expr 299
! #define shift_expr 300
! #define arith_expr 301
! #define term 302
! #define factor 303
! #define power 304
! #define atom 305
! #define listmaker 306
! #define lambdef 307
! #define trailer 308
! #define subscriptlist 309
! #define subscript 310
! #define sliceop 311
! #define exprlist 312
! #define testlist 313
! #define dictmaker 314
! #define classdef 315
! #define arglist 316
! #define argument 317
! #define list_iter 318
! #define list_for 319
! #define list_if 320
Index: longobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v
retrieving revision 2.19
retrieving revision 2.19.8.1
diff -C2 -r2.19 -r2.19.8.1
*** longobject.h 2000/09/26 05:45:59 2.19
--- longobject.h 2001/07/07 22:55:27 2.19.8.1
***************
*** 45,48 ****
--- 45,88 ----
DL_IMPORT(PyObject *) PyLong_FromUnicode(Py_UNICODE*, int, int);
+ /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
+ base 256, and return a Python long with the same numeric value.
+ If n is 0, the integer is 0. Else:
+ If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
+ else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
+ LSB.
+ If is_signed is 0/false, view the bytes as a non-negative integer.
+ If is_signed is 1/true, view the bytes as a 2's-complement integer,
+ non-negative if bit 0x80 of the MSB is clear, negative if set.
+ Error returns:
+ + Return NULL with the appropriate exception set if there's not
+ enough memory to create the Python long.
+ */
+ extern DL_IMPORT(PyObject *) _PyLong_FromByteArray(
+ const unsigned char* bytes, size_t n,
+ int little_endian, int is_signed);
+
+ /* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long
+ v to a base-256 integer, stored in array bytes. Normally return 0,
+ return -1 on error.
+ If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at
+ bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and
+ the LSB at bytes[n-1].
+ If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes
+ are filled and there's nothing special about bit 0x80 of the MSB.
+ If is_signed is 1/true, bytes is filled with the 2's-complement
+ representation of v's value. Bit 0x80 of the MSB is the sign bit.
+ Error returns (-1):
+ + is_signed is 0 and v < 0. TypeError is set in this case, and bytes
+ isn't altered.
+ + n isn't big enough to hold the full mathematical value of v. For
+ example, if is_signed is 0 and there are more digits in the v than
+ fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of
+ being large enough to hold a sign bit. OverflowError is set in this
+ case, but bytes holds the least-signficant n bytes of the true value.
+ */
+ extern DL_IMPORT(int) _PyLong_AsByteArray(PyLongObject* v,
+ unsigned char* bytes, size_t n,
+ int little_endian, int is_signed);
+
#ifdef __cplusplus
}
Index: opcode.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/opcode.h,v
retrieving revision 2.35
retrieving revision 2.35.2.1
diff -C2 -r2.35 -r2.35.2.1
*** opcode.h 2001/04/20 19:13:01 2.35
--- opcode.h 2001/07/07 22:55:27 2.35.2.1
***************
*** 72,75 ****
--- 72,76 ----
#define IMPORT_STAR 84
#define EXEC_STMT 85
+ #define YIELD_VALUE 86
#define POP_BLOCK 87
Index: pyport.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v
retrieving revision 2.26
retrieving revision 2.26.6.1
diff -C2 -r2.26 -r2.26.6.1
*** pyport.h 2001/01/22 16:50:11 2.26
--- pyport.h 2001/07/07 22:55:27 2.26.6.1
***************
*** 435,438 ****
--- 435,447 ----
#endif
+ /*
+ * Rename some functions for the Borland compiler
+ */
+ #ifdef __BORLANDC__
+ # include <io.h>
+ # define _chsize chsize
+ # define _setmode setmode
+ #endif
+
#ifdef __cplusplus
}
Index: pystate.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pystate.h,v
retrieving revision 2.14
retrieving revision 2.14.6.1
diff -C2 -r2.14 -r2.14.6.1
*** pystate.h 2001/01/23 01:44:35 2.14
--- pystate.h 2001/07/07 22:55:27 2.14.6.1
***************
*** 32,35 ****
--- 32,44 ----
struct _frame; /* Avoid including frameobject.h */
+ /* Py_tracefunc return -1 when raising an exception, or 0 for success. */
+ typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
+
+ /* The following values are used for 'what' for tracefunc functions: */
+ #define PyTrace_CALL 0
+ #define PyTrace_EXCEPTION 1
+ #define PyTrace_LINE 2
+ #define PyTrace_RETURN 3
+
typedef struct _ts {
***************
*** 41,47 ****
int ticker;
int tracing;
! PyObject *sys_profilefunc;
! PyObject *sys_tracefunc;
PyObject *curexc_type;
--- 50,59 ----
int ticker;
int tracing;
+ int use_tracing;
! Py_tracefunc c_profilefunc;
! Py_tracefunc c_tracefunc;
! PyObject *c_profileobj;
! PyObject *c_traceobj;
PyObject *curexc_type;
Index: rangeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/rangeobject.h,v
retrieving revision 2.15
retrieving revision 2.15.8.1
diff -C2 -r2.15 -r2.15.8.1
*** rangeobject.h 2000/09/01 23:29:26 2.15
--- rangeobject.h 2001/07/07 22:55:27 2.15.8.1
***************
*** 2,5 ****
--- 2,11 ----
/* Range object interface */
+ #ifndef Py_RANGEOBJECT_H
+ #define Py_RANGEOBJECT_H
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
/*
A range object represents an integer range. This is an immutable object;
***************
*** 13,16 ****
#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
! extern DL_IMPORT(PyObject *) PyRange_New(long, long, long, int);
--- 19,27 ----
#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
+
+ extern DL_IMPORT(PyObject *) PyRange_New(long, long, long);
! #ifdef __cplusplus
! }
! #endif
! #endif /* !Py_RANGEOBJECT_H */
Index: stringobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/stringobject.h,v
retrieving revision 2.25
retrieving revision 2.25.6.1
diff -C2 -r2.25 -r2.25.6.1
*** stringobject.h 2001/02/23 16:40:48 2.25
--- stringobject.h 2001/07/07 22:55:27 2.25.6.1
***************
*** 59,62 ****
--- 59,63 ----
extern DL_IMPORT(void) PyString_ConcatAndDel(PyObject **, PyObject *);
extern DL_IMPORT(int) _PyString_Resize(PyObject **, int);
+ extern DL_IMPORT(int) _PyString_Eq(PyObject *, PyObject*);
extern DL_IMPORT(PyObject *) PyString_Format(PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) _PyString_FormatLong(PyObject*, int, int,
***************
*** 77,83 ****
#define PyString_GET_SIZE(op) (((PyStringObject *)(op))->ob_size)
/* --- Generic Codecs ----------------------------------------------------- */
! /* Create a string object by decoding the encoded string s of the
given size. */
--- 78,88 ----
#define PyString_GET_SIZE(op) (((PyStringObject *)(op))->ob_size)
+ /* _PyString_Join(sep, x) is like sep.join(x). sep must be PyStringObject*,
+ x must be an iterable object. */
+ extern DL_IMPORT(PyObject *) _PyString_Join(PyObject *sep, PyObject *x);
+
/* --- Generic Codecs ----------------------------------------------------- */
! /* Create an object by decoding the encoded string s of the
given size. */
***************
*** 90,94 ****
/* Encodes a char buffer of the given size and returns a
! Python string object. */
extern DL_IMPORT(PyObject*) PyString_Encode(
--- 95,99 ----
/* Encodes a char buffer of the given size and returns a
! Python object. */
extern DL_IMPORT(PyObject*) PyString_Encode(
***************
*** 99,106 ****
);
! /* Encodes a string object and returns the result as Python string
object. */
extern DL_IMPORT(PyObject*) PyString_AsEncodedString(
PyObject *str, /* string object */
const char *encoding, /* encoding */
--- 104,148 ----
);
! /* Encodes a string object and returns the result as Python
object. */
+ extern DL_IMPORT(PyObject*) PyString_AsEncodedObject(
+ PyObject *str, /* string object */
+ const char *encoding, /* encoding */
+ const char *errors /* error handling */
+ );
+
+ /* Encodes a string object and returns the result as Python string
+ object.
+
+ If the codec returns an Unicode object, the object is converted
+ back to a string using the default encoding.
+
+ DEPRECATED - use PyString_AsEncodedObject() instead. */
+
extern DL_IMPORT(PyObject*) PyString_AsEncodedString(
+ PyObject *str, /* string object */
+ const char *encoding, /* encoding */
+ const char *errors /* error handling */
+ );
+
+ /* Decodes a string object and returns the result as Python
+ object. */
+
+ extern DL_IMPORT(PyObject*) PyString_AsDecodedObject(
+ PyObject *str, /* string object */
+ const char *encoding, /* encoding */
+ const char *errors /* error handling */
+ );
+
+ /* Decodes a string object and returns the result as Python string
+ object.
+
+ If the codec returns an Unicode object, the object is converted
+ back to a string using the default encoding.
+
+ DEPRECATED - use PyString_AsDecodedObject() instead. */
+
+ extern DL_IMPORT(PyObject*) PyString_AsDecodedString(
PyObject *str, /* string object */
const char *encoding, /* encoding */
Index: symtable.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/symtable.h,v
retrieving revision 2.7
retrieving revision 2.7.4.1
diff -C2 -r2.7 -r2.7.4.1
*** symtable.h 2001/03/22 03:57:58 2.7
--- symtable.h 2001/07/07 22:55:27 2.7.4.1
***************
*** 47,50 ****
--- 47,51 ----
int ste_child_free; /* true if a child scope has free variables,
including free refs to globals */
+ int ste_generator; /* true if namespace is a generator */
int ste_opt_lineno; /* lineno of last exec or import * */
struct symtable *ste_table;
Index: tupleobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/tupleobject.h,v
retrieving revision 2.24
retrieving revision 2.24.8.1
diff -C2 -r2.24 -r2.24.8.1
*** tupleobject.h 2000/09/01 23:29:26 2.24
--- tupleobject.h 2001/07/07 22:55:27 2.24.8.1
***************
*** 34,38 ****
extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
! extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int, int);
/* Macro, trading safety for speed */
--- 34,38 ----
extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
! extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int);
/* Macro, trading safety for speed */
Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.20
retrieving revision 2.20.2.1
diff -C2 -r2.20 -r2.20.2.1
*** unicodeobject.h 2001/04/23 14:44:21 2.20
--- unicodeobject.h 2001/07/07 22:55:27 2.20.2.1
***************
*** 59,62 ****
--- 59,77 ----
/* --- Internal Unicode Format -------------------------------------------- */
+ /* FIXME: MvL's new implementation assumes that Py_UNICODE_SIZE is
+ properly set, but the default rules below doesn't set it. I'll
+ sort this out some other day -- fredrik@pythonware.com */
+
+ #ifndef Py_UNICODE_SIZE
+ #error Must define Py_UNICODE_SIZE
+ #endif
+
+ /* Setting Py_UNICODE_WIDE enables UCS-4 storage. Otherwise, Unicode
+ strings are stored as UCS-2 (with limited support for UTF-16) */
+
+ #if Py_UNICODE_SIZE >= 4
+ #define Py_UNICODE_WIDE
+ #endif
+
/* Set these flags if the platform has "wchar.h", "wctype.h" and the
wchar_t type is a 16-bit unsigned type */
***************
*** 65,75 ****
/* Defaults for various platforms */
! #ifndef HAVE_USABLE_WCHAR_T
! /* Windows has a usable wchar_t type */
! # if defined(MS_WIN32)
# define HAVE_USABLE_WCHAR_T
# endif
#endif
--- 80,95 ----
/* Defaults for various platforms */
! #ifndef PY_UNICODE_TYPE
! /* Windows has a usable wchar_t type (unless we're using UCS-4) */
! # if defined(MS_WIN32) && Py_UNICODE_SIZE == 2
# define HAVE_USABLE_WCHAR_T
+ # define PY_UNICODE_TYPE wchar_t
# endif
+ # if defined(Py_UNICODE_WIDE)
+ # define PY_UNICODE_TYPE Py_UCS4
+ # endif
+
#endif
***************
*** 92,113 ****
#endif
- #ifdef HAVE_USABLE_WCHAR_T
-
- /* If the compiler defines whcar_t as a 16-bit unsigned type we can
- use the compiler type directly. Works fine with all modern Windows
- platforms. */
-
- typedef wchar_t Py_UNICODE;
-
- #else
-
- /* Use if you have a standard ANSI compiler, without wchar_t support.
- If a short is not 16 bits on your platform, you have to fix the
- typedef below, or the module initialization code will complain. */
-
- typedef unsigned short Py_UNICODE;
-
- #endif
-
/*
* Use this typedef when you need to represent a UTF-16 surrogate pair
--- 112,115 ----
***************
*** 118,123 ****
--- 120,132 ----
#elif SIZEOF_LONG >= 4
typedef unsigned long Py_UCS4;
+ #endif
+
+ #if SIZEOF_SHORT == 2
+ typedef unsigned short Py_UCS2;
+ #else
+ #error Cannot find a two-byte type
#endif
+ typedef PY_UNICODE_TYPE Py_UNICODE;
/* --- Internal Unicode Operations ---------------------------------------- */
***************
*** 267,270 ****
--- 276,282 ----
);
+ /* Get the maximum ordinal for a Unicode character. */
+ extern DL_IMPORT(Py_UNICODE) PyUnicode_GetMax(void);
+
/* Resize an already allocated Unicode object to the new size length.
***************
*** 460,467 ****
*byteorder == 1: big endian
! and then switches according to all BOM marks it finds in the input
! data. BOM marks are not copied into the resulting Unicode string.
! After completion, *byteorder is set to the current byte order at
! the end of input data.
If byteorder is NULL, the codec starts in native order mode.
--- 472,480 ----
*byteorder == 1: big endian
! In native mode, the first two bytes of the stream are checked for a
! BOM mark. If found, the BOM mark is analysed, the byte order
! adjusted and the BOM skipped. In the other modes, no BOM mark
! interpretation is done. After completion, *byteorder is set to the
! current byte order at the end of input data.
If byteorder is NULL, the codec starts in native order mode.
***************
*** 852,912 ****
extern DL_IMPORT(int) _PyUnicode_IsLowercase(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsUppercase(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsTitlecase(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsWhitespace(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsLinebreak(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToLowercase(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToUppercase(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToTitlecase(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_ToDecimalDigit(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_ToDigit(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(double) _PyUnicode_ToNumeric(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsDecimalDigit(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsDigit(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsNumeric(
! register const Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsAlpha(
! register const Py_UNICODE ch /* Unicode character */
);
--- 865,925 ----
extern DL_IMPORT(int) _PyUnicode_IsLowercase(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsUppercase(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsTitlecase(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsWhitespace(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsLinebreak(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToLowercase(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToUppercase(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToTitlecase(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_ToDecimalDigit(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_ToDigit(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(double) _PyUnicode_ToNumeric(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsDecimalDigit(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsDigit(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsNumeric(
! Py_UNICODE ch /* Unicode character */
);
extern DL_IMPORT(int) _PyUnicode_IsAlpha(
! Py_UNICODE ch /* Unicode character */
);
- Previous message: [Python-checkins] CVS: python/dist/src/Grammar Grammar,1.42,1.42.6.1
- Next message: [Python-checkins] CVS: python/dist/src LICENSE,1.15,1.15.4.1 Makefile.pre.in,1.37.2.1,1.37.2.2 PLAN.txt,1.1.2.16,1.1.2.17 README,1.123,1.123.2.1 acconfig.h,1.46,1.46.4.1 config.h.in,2.92,2.92.2.1 configure,1.209,1.209.2.1 configure.in,1.217,1.217.2.1 setup.py,1.38,1.38.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]