mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Support for frozen scripts; added -i option.
This commit is contained in:
parent
41ffccbba7
commit
f56e3db1dd
6 changed files with 150 additions and 5 deletions
|
@ -225,7 +225,8 @@ wr_object(x, fp)
|
|||
typedef WFILE RFILE; /* Same struct with different invariants */
|
||||
|
||||
#define r_byte(p) ((p)->fp ? getc((p)->fp) \
|
||||
: ((p)->ptr != (p)->end) ? *(p)->ptr++ : EOF)
|
||||
: ((p)->ptr != (p)->end) ? \
|
||||
(unsigned char)*(p)->ptr++ : EOF)
|
||||
|
||||
static int
|
||||
r_string(s, n, p)
|
||||
|
@ -425,6 +426,19 @@ rd_object(fp)
|
|||
return r_object(&rf);
|
||||
}
|
||||
|
||||
object *
|
||||
rds_object(str, len)
|
||||
char *str;
|
||||
int len;
|
||||
{
|
||||
RFILE rf;
|
||||
rf.fp = NULL;
|
||||
rf.str = NULL;
|
||||
rf.ptr = str;
|
||||
rf.end = str + len;
|
||||
return r_object(&rf);
|
||||
}
|
||||
|
||||
/* And an interface for Python programs... */
|
||||
|
||||
static object *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue