Kaydet (Commit) c07422c1 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Splitted the WFILE structure to WFILE and RFILE.

üst c1efe5f0
...@@ -65,15 +65,10 @@ typedef struct { ...@@ -65,15 +65,10 @@ typedef struct {
FILE *fp; FILE *fp;
int error; /* see WFERR_* values */ int error; /* see WFERR_* values */
int depth; int depth;
/* If fp == NULL, the following are valid: */
PyObject *readable; /* Stream-like object being read from */
PyObject *str; PyObject *str;
PyObject *current_filename;
char *ptr; char *ptr;
char *end; char *end;
char *buf; char *buf;
Py_ssize_t buf_size;
PyObject *refs; /* dict on marshal, list on unmarshal */
_Py_hashtable_t *hashtable; _Py_hashtable_t *hashtable;
int version; int version;
} WFILE; } WFILE;
...@@ -636,7 +631,17 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version) ...@@ -636,7 +631,17 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version)
w_flush(&wf); w_flush(&wf);
} }
typedef WFILE RFILE; /* Same struct with different invariants */ typedef struct {
FILE *fp;
int depth;
PyObject *readable; /* Stream-like object being read from */
PyObject *current_filename;
char *ptr;
char *end;
char *buf;
Py_ssize_t buf_size;
PyObject *refs; /* a list */
} RFILE;
static char * static char *
r_string(Py_ssize_t n, RFILE *p) r_string(Py_ssize_t n, RFILE *p)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment