Skip to content

Commit b6775db

Browse files
committed
Merge alpha100 branch back to main trunk
1 parent 2979b01 commit b6775db

File tree

176 files changed

+5230
-3596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+5230
-3596
lines changed

Include/accessobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/allobjects.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -30,14 +30,18 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3030

3131
/* "allobjects.c" -- Source for precompiled header "allobjects.h" */
3232

33+
#ifdef HAVE_CONFIG_H
34+
#include "config.h"
35+
#endif
36+
3337
#ifdef THINK_C
3438
#define macintosh
3539
#endif
3640

3741
#include <stdio.h>
3842
#include <string.h>
3943

40-
#include "PROTO.h"
44+
#include "myproto.h"
4145

4246
#include "object.h"
4347
#include "objimpl.h"

Include/assert.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -28,7 +28,13 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2828
2929
******************************************************************/
3030

31+
#ifdef MPW /* This is for MPW's File command */
32+
33+
#define assert(e) { if (!(e)) { printf("### Python: Assertion failed:\n\
34+
File %s; Line %d\n", __FILE__, __LINE__); abort(); } }
35+
#else
3136
#define assert(e) { if (!(e)) { printf("Assertion failed\n"); abort(); } }
37+
#endif
3238

3339
#ifdef __cplusplus
3440
}

Include/bitset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/bltinmodule.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -31,6 +31,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3131
/* Built-in module interface */
3232

3333
extern object *getbuiltin PROTO((object *));
34+
extern int setbuiltin PROTO((char *, object *));
3435

3536
#ifdef __cplusplus
3637
}

Include/ceval.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -35,6 +35,7 @@ object *call_object PROTO((object *, object *));
3535
object *getglobals PROTO((void));
3636
object *getlocals PROTO((void));
3737
object *getowner PROTO((void));
38+
object *getframe PROTO((void));
3839

3940
void printtraceback PROTO((object *));
4041
void flushline PROTO((void));
@@ -87,7 +88,7 @@ extern void init_save_thread PROTO((void));
8788
extern object *save_thread PROTO((void));
8889
extern void restore_thread PROTO((object *));
8990

90-
#ifdef USE_THREAD
91+
#ifdef WITH_THREAD
9192

9293
#define BGN_SAVE { \
9394
object *_save; \
@@ -97,14 +98,14 @@ extern void restore_thread PROTO((object *));
9798
#define END_SAVE restore_thread(_save); \
9899
}
99100

100-
#else /* !USE_THREAD */
101+
#else /* !WITH_THREAD */
101102

102103
#define BGN_SAVE {
103104
#define RET_SAVE
104105
#define RES_SAVE
105106
#define END_SAVE }
106107

107-
#endif /* !USE_THREAD */
108+
#endif /* !WITH_THREAD */
108109

109110
#ifdef __cplusplus
110111
}

Include/cgensupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -35,7 +35,7 @@ typedef char *string;
3535
#define mknewlongobject(x) newintobject(x)
3636
#define mknewshortobject(x) newintobject((long)x)
3737
#define mknewfloatobject(x) newfloatobject(x)
38-
#define mknewcharobject(c) mkvalue("c", c)
38+
#define mknewcharobject(ch) mkvalue("c", ch)
3939

4040
extern int getiobjectarg PROTO((object *args, int nargs, int i, object **p_a));
4141
extern int getilongarg PROTO((object *args, int nargs, int i, long *p_a));

Include/classobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/dictobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/errcode.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -29,11 +29,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2929
******************************************************************/
3030

3131
/* Error codes passed around between file input, tokenizer, parser and
32-
interpreter. This was necessary so we can turn them into Python
33-
exceptions at a higher level. */
32+
interpreter. This is necessary so we can turn them into Python
33+
exceptions at a higher level. Note that some errors have a
34+
slightly different meaning when passed from the tokenizer to the
35+
parser than when passed from the parser to the interpreter; e.g.
36+
the parser only returns E_EOF when it hits EOF immediately, and it
37+
never returns E_OK. */
3438

3539
#define E_OK 10 /* No error */
36-
#define E_EOF 11 /* (Unexpected) EOF read */
40+
#define E_EOF 11 /* End Of File */
3741
#define E_INTR 12 /* Interrupted */
3842
#define E_TOKEN 13 /* Bad token */
3943
#define E_SYNTAX 14 /* Syntax error */

Include/errors.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -33,7 +33,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3333
void err_set PROTO((object *));
3434
void err_setval PROTO((object *, object *));
3535
void err_setstr PROTO((object *, char *));
36-
int err_occurred PROTO((void));
36+
object *err_occurred PROTO((void));
3737
void err_get PROTO((object **, object **));
3838
void err_clear PROTO((void));
3939

@@ -64,12 +64,13 @@ extern object *ZeroDivisionError;
6464
extern int err_badarg PROTO((void));
6565
extern object *err_nomem PROTO((void));
6666
extern object *err_errno PROTO((object *));
67-
extern void err_input PROTO((int));
6867

6968
extern void err_badcall PROTO((void));
7069

7170
extern object *err_getexc PROTO((void));
7271

72+
extern int sigcheck PROTO((void)); /* In sigcheck.c or signalmodule.c */
73+
7374
#ifdef __cplusplus
7475
}
7576
#endif

Include/eval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/fileobject.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -35,6 +35,7 @@ extern typeobject Filetype;
3535
#define is_fileobject(op) ((op)->ob_type == &Filetype)
3636

3737
extern object *newfileobject PROTO((char *, char *));
38+
extern void setfilebufsize PROTO((object *, int));
3839
extern object *newopenfileobject
3940
PROTO((FILE *, char *, char *, int (*)FPROTO((FILE *))));
4041
extern FILE *getfilefile PROTO((object *));

Include/floatobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved

Include/frameobject.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -52,6 +52,7 @@ typedef struct _frame {
5252
int f_iblock; /* index in f_blockstack */
5353
int f_lasti; /* Last instruction if called */
5454
int f_lineno; /* Current line number */
55+
object *f_trace; /* Trace function */
5556
} frameobject;
5657

5758

@@ -70,11 +71,11 @@ frameobject * newframeobject PROTO(
7071
/* List access macros */
7172

7273
#ifdef NDEBUG
73-
#define GETITEM(v, i) GETLISTITEM((listobject *)(v), (i))
74+
#define GETITEM(v, i) GETTUPLEITEM((tupleobject *)(v), (i))
7475
#define GETITEMNAME(v, i) GETSTRINGVALUE((stringobject *)GETITEM((v), (i)))
7576
#else
76-
#define GETITEM(v, i) getlistitem((v), (i))
77-
#define GETITEMNAME(v, i) getstringvalue(getlistitem((v), (i)))
77+
#define GETITEM(v, i) gettupleitem((v), (i))
78+
#define GETITEMNAME(v, i) getstringvalue(GETITEM(v, i))
7879
#endif
7980

8081
#define GETUSTRINGVALUE(s) ((unsigned char *)GETSTRINGVALUE(s))
@@ -95,6 +96,11 @@ block *pop_block PROTO((frameobject *));
9596

9697
object **extend_stack PROTO((frameobject *, int, int));
9798

99+
/* Conversions between "fast locals" and locals in dictionary */
100+
101+
void locals_2_fast PROTO((frameobject *, int));
102+
void fast_2_locals PROTO((frameobject *));
103+
98104
#ifdef __cplusplus
99105
}
100106
#endif

Include/funcobject.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern "C" {
55
#endif
66

77
/***********************************************************
8-
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
8+
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
99
Amsterdam, The Netherlands.
1010
1111
All Rights Reserved
@@ -35,6 +35,8 @@ typedef struct {
3535
object *func_code;
3636
object *func_globals;
3737
object *func_name;
38+
int func_argcount;
39+
object *func_argdefs;
3840
} funcobject;
3941

4042
extern typeobject Functype;
@@ -44,6 +46,8 @@ extern typeobject Functype;
4446
extern object *newfuncobject PROTO((object *, object *));
4547
extern object *getfunccode PROTO((object *));
4648
extern object *getfuncglobals PROTO((object *));
49+
extern object *getfuncargstuff PROTO((object *, int *));
50+
extern int setfuncargstuff PROTO((object *, int, object *));
4751

4852
#ifdef __cplusplus
4953
}

0 commit comments

Comments
 (0)