[Python-checkins] python/dist/src/Modules bz2module.c,1.20,1.21
montanaro at users.sourceforge.net
montanaro at users.sourceforge.net
Sat Feb 7 08:53:48 EST 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/Modules
Modified Files:
bz2module.c
Log Message:
Remove support for --without-universal-newlines (see PEP 11).
Index: bz2module.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/bz2module.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** bz2module.c 1 Jul 2003 20:15:21 -0000 1.20
--- bz2module.c 7 Feb 2004 13:53:45 -0000 1.21
***************
*** 74,78 ****
#endif
- #ifdef WITH_UNIVERSAL_NEWLINES
/* Bits in f_newlinetypes */
#define NEWLINE_UNKNOWN 0 /* No newline seen, yet */
--- 74,77 ----
***************
*** 80,84 ****
#define NEWLINE_LF 2 /* \n newline seen */
#define NEWLINE_CRLF 4 /* \r\n newline seen */
- #endif
/* ===================================================================== */
--- 79,82 ----
***************
*** 95,103 ****
int f_softspace; /* Flag used by 'print' command */
- #ifdef WITH_UNIVERSAL_NEWLINES
int f_univ_newline; /* Handle any newline convention */
int f_newlinetypes; /* Types of newlines seen */
int f_skipnextlf; /* Skip next \n */
- #endif
BZFILE *fp;
--- 93,99 ----
***************
*** 228,236 ****
PyObject *v;
int bzerror;
- #ifdef WITH_UNIVERSAL_NEWLINES
int newlinetypes = f->f_newlinetypes;
int skipnextlf = f->f_skipnextlf;
int univ_newline = f->f_univ_newline;
- #endif
total_v_size = n > 0 ? n : 100;
--- 224,230 ----
***************
*** 244,248 ****
for (;;) {
Py_BEGIN_ALLOW_THREADS
- #ifdef WITH_UNIVERSAL_NEWLINES
if (univ_newline) {
while (1) {
--- 238,241 ----
***************
*** 278,282 ****
newlinetypes |= NEWLINE_CR;
} else /* If not universal newlines use the normal loop */
- #endif
do {
BZ2_bzRead(&bzerror, f->fp, &c, 1);
--- 271,274 ----
***************
*** 285,292 ****
} while (bzerror == BZ_OK && c != '\n' && buf != end);
Py_END_ALLOW_THREADS
- #ifdef WITH_UNIVERSAL_NEWLINES
f->f_newlinetypes = newlinetypes;
f->f_skipnextlf = skipnextlf;
- #endif
if (bzerror == BZ_STREAM_END) {
f->size = f->pos;
--- 277,282 ----
***************
*** 324,330 ****
}
- #ifndef WITH_UNIVERSAL_NEWLINES
- #define Util_UnivNewlineRead(a,b,c,d,e) BZ2_bzRead(a,b,c,d)
- #else
/* This is a hacked version of Python's
* fileobject.c:Py_UniversalNewlineFread(). */
--- 314,317 ----
***************
*** 394,398 ****
return dst - buf;
}
- #endif
/* This is a hacked version of Python's fileobject.c:drop_readahead(). */
--- 381,384 ----
***************
*** 1191,1195 ****
/* Getters and setters of BZ2File. */
- #ifdef WITH_UNIVERSAL_NEWLINES
/* This is a hacked version of Python's fileobject.c:get_newlines(). */
static PyObject *
--- 1177,1180 ----
***************
*** 1221,1225 ****
}
}
- #endif
static PyObject *
--- 1206,1209 ----
***************
*** 1244,1251 ****
{"closed", (getter)BZ2File_get_closed, NULL,
"True if the file is closed"},
- #ifdef WITH_UNIVERSAL_NEWLINES
{"newlines", (getter)BZ2File_get_newlines, NULL,
"end-of-line convention used in this file"},
- #endif
{"mode", (getter)BZ2File_get_mode, NULL,
"file mode ('r', 'w', or 'U')"},
--- 1228,1233 ----
***************
*** 1310,1316 ****
case 'U':
- #ifdef WITH_UNIVERSAL_NEWLINES
self->f_univ_newline = 1;
- #endif
break;
--- 1292,1296 ----
***************
*** 1442,1446 ****
is given, must be a number between 1 and 9.\n\
")
- #ifdef WITH_UNIVERSAL_NEWLINES
PyDoc_STR(
"\n\
--- 1422,1425 ----
***************
*** 1452,1456 ****
newlines are available only when reading.\n\
")
- #endif
;
--- 1431,1434 ----
More information about the Python-checkins
mailing list