annotate Modules/newmodule.c @ 3546:3f7cdf1663f7 legacy-trunk

A version of swed that can import html files. Also demonstrates implementing object handlers in Python.
author Jack Jansen <jack.jansen@cwi.nl>
date Tue, 07 May 1996 15:25:36 +0000
parents 201de8455c2b
children bddbaa51aa5a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
1 /***********************************************************
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
3 The Netherlands.
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
4
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
5 All Rights Reserved
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
6
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
7 Permission to use, copy, modify, and distribute this software and its
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
8 documentation for any purpose and without fee is hereby granted,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
9 provided that the above copyright notice appear in all copies and that
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
10 both that copyright notice and this permission notice appear in
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
11 supporting documentation, and that the names of Stichting Mathematisch
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
12 Centrum or CWI not be used in advertising or publicity pertaining to
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
13 distribution of the software without specific, written prior permission.
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
14
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
22
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
23 ******************************************************************/
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
24
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
25 /* Module new -- create new objects of various types */
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
26
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 #include "allobjects.h"
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 #include "compile.h"
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
29
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
30 static char new_im_doc[] =
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
31 "Create a instance method object from (FUNCTION, INSTANCE, CLASS).";
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
33 static object *
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 new_instancemethod(unused, args)
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
35 object* unused;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
36 object* args;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 {
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
38 object* func;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
39 object* self;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
40 object* classObj;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
41
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
42 if (!newgetargs(args, "O!O!O!",
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
43 &Functype, &func,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
44 &Instancetype, &self,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
45 &Classtype, &classObj))
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
46 return NULL;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
47 return newinstancemethodobject(func, self, classObj);
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 }
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
49
2871
0534025cefe5 \temporary 'fix' for brokenness
Guido van Rossum <guido@python.org>
parents: 2150
diff changeset
50 /* XXX These internal interfaces have changed -- who'll fix this code? */
0534025cefe5 \temporary 'fix' for brokenness
Guido van Rossum <guido@python.org>
parents: 2150
diff changeset
51 #if 0
0534025cefe5 \temporary 'fix' for brokenness
Guido van Rossum <guido@python.org>
parents: 2150
diff changeset
52
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
53 static char new_function_doc[] =
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
54 "Create a function object from (CODE, GLOBALS, [NAME, ARGCOUNT, ARGDEFS]).";
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
55
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
56 static object *
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 new_function(unused, args)
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
58 object* unused;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
59 object* args;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
60 {
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
61 object* code;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
62 object* globals;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
63 object* name = None;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
64 int argcount = -1;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
65 object* argdefs = None;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
66 funcobject* newfunc;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
67
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
68 if (!newgetargs(args, "O!O!|SiO!",
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
69 &Codetype, &code,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
70 &Mappingtype, &globals,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
71 &name,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
72 &argcount,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
73 &Tupletype, &argdefs))
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
74 return NULL;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
75
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
76 newfunc = (funcobject *)newfuncobject(code, globals);
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
77 if (newfunc == NULL)
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
78 return NULL;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
79
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
80 if (name != None) {
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
81 XINCREF(name);
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
82 XDECREF(newfunc->func_name);
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
83 newfunc->func_name = name;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
84 }
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
85 newfunc->func_argcount = argcount;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
86 if (argdefs != NULL) {
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
87 XINCREF(argdefs);
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
88 XDECREF(newfunc->func_argdefs);
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
89 newfunc->func_argdefs = argdefs;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
90 }
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
91
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
92 return (object *)newfunc;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
93 }
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
94 #endif
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
95
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
96 static char new_code_doc[] =
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
97 "Create a code object from (ARGCOUNT, NLOCALS, FLAGS, CODESTRING, CONSTANTS, NAMES, VARNAMES, FILENAME, NAME).";
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
98
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
99 static object *
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
100 new_code(unused, args)
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
101 object* unused;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
102 object* args;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
103 {
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
104 int argcount;
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
105 int nlocals;
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
106 int flags;
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
107 object* code;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
108 object* consts;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
109 object* names;
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
110 object* varnames;
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
111 object* filename;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
112 object* name;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
113
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
114 #if 0
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
115 if (!newgetargs(args, "SO!O!SS",
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
116 &code, &Tupletype, &consts, &Tupletype, &names,
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
117 &filename, &name))
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
118 return NULL;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
119 return (object *)newcodeobject(code, consts, names, filename, name);
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
120 #else
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
121 if (!newgetargs(args, "iiiSO!O!O!SS",
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
122 &argcount, &nlocals, &flags, /* These are new */
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
123 &code, &Tupletype, &consts, &Tupletype, &names,
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
124 &Tupletype, &varnames, /* These are new */
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
125 &filename, &name))
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
126 return NULL;
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
127 return (object *)newcodeobject(argcount, nlocals, flags,
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
128 code, consts, names, varnames, filename, name);
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
129 #endif
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
130 }
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
131
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
132 static char new_module_doc[] =
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
133 "Create a module object from (NAME).";
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
134
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
135 static object *
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
136 new_module(unused, args)
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
137 object* unused;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
138 object* args;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
139 {
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
140 char *name;
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
141
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
142 if (!newgetargs(args, "s", &name))
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
143 return NULL;
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
144 return newmoduleobject(name);
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
145 }
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
146
3337
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
147 static char new_class_doc[] =
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
148 "Create a class object from (NAME, BASE_CLASSES, DICT).";
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
149
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
150 static object *
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
151 new_class(unused, args)
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
152 object* unused;
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
153 object* args;
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
154 {
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
155 object * name;
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
156 object * classes;
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
157 object * dict;
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
158
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
159 if (!newgetargs(args, "SO!O!", &name, &Tupletype, &classes,
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
160 &Mappingtype, &dict))
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
161 return NULL;
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
162 return newclassobject(classes, dict, name);
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
163 }
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
164
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
165 static struct methodlist new_methods[] = {
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
166 {"instancemethod", new_instancemethod, 1, new_im_doc},
2871
0534025cefe5 \temporary 'fix' for brokenness
Guido van Rossum <guido@python.org>
parents: 2150
diff changeset
167 #if 0
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
168 {"function", new_function, 1, new_function_doc},
3135
999fcce496f8 re-enable new.code(...) with new args
Guido van Rossum <guido@python.org>
parents: 2871
diff changeset
169 #endif
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
170 {"code", new_code, 1, new_code_doc},
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
171 {"module", new_module, 1, new_module_doc},
3337
201de8455c2b added new.classobj()
Guido van Rossum <guido@python.org>
parents: 3135
diff changeset
172 {"classobj", new_class, 1, new_class_doc},
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
173 {NULL, NULL} /* sentinel */
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
174 };
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
175
2077
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
176 char new_doc[] =
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
177 "Functions to create new objects used by the interpreter.\n\
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
178 \n\
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
179 You need to know a great deal about the interpreter to use this!";
3848094f259c totally revamped
Guido van Rossum <guido@python.org>
parents: 2008
diff changeset
180
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
181 void
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
182 initnew()
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
183 {
2096
d5c935b9a7b5 initmodule3 -> initmodule3
Guido van Rossum <guido@python.org>
parents: 2077
diff changeset
184 initmodule4("new", new_methods, new_doc, (object *)NULL,
d5c935b9a7b5 initmodule3 -> initmodule3
Guido van Rossum <guido@python.org>
parents: 2077
diff changeset
185 PYTHON_API_VERSION);
1650
51a06fdfff78 Added some new modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
186 }