Support for frozen scripts; added -i option.

This commit is contained in:
Guido van Rossum 1993-04-01 20:59:32 +00:00
parent 41ffccbba7
commit f56e3db1dd
6 changed files with 150 additions and 5 deletions

View file

@ -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 *