From 827843405f67b88e62380846eb96969b389117d5 Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Tue, 16 Feb 2021 20:14:40 -0600 Subject: a different extraction of the shell archives --- shar/python-0.9.1-20-21.shar | 1338 +++++++++++++++++++++--------------------- 1 file changed, 669 insertions(+), 669 deletions(-) (limited to 'shar/python-0.9.1-20-21.shar') diff --git a/shar/python-0.9.1-20-21.shar b/shar/python-0.9.1-20-21.shar index 59df200..e39278e 100644 --- a/shar/python-0.9.1-20-21.shar +++ b/shar/python-0.9.1-20-21.shar @@ -26,51 +26,51 @@ X XBUFSIZE = 32*1024 X Xdef mkrealfile(name): -X st = posix.stat(name) # Get the mode -X mode = S_IMODE(st[ST_MODE]) -X linkto = posix.readlink(name) # Make sure again it's a symlink -X f_in = open(name, 'r') # This ensures it's a file -X posix.unlink(name) -X f_out = open(name, 'w') -X while 1: -X buf = f_in.read(BUFSIZE) -X if not buf: break -X f_out.write(buf) -X del f_out # Flush data to disk before changing mode -X posix.chmod(name, mode) +X st = posix.stat(name) # Get the mode +X mode = S_IMODE(st[ST_MODE]) +X linkto = posix.readlink(name) # Make sure again it's a symlink +X f_in = open(name, 'r') # This ensures it's a file +X posix.unlink(name) +X f_out = open(name, 'w') +X while 1: +X buf = f_in.read(BUFSIZE) +X if not buf: break +X f_out.write(buf) +X del f_out # Flush data to disk before changing mode +X posix.chmod(name, mode) X Xdef mkrealdir(name): -X st = posix.stat(name) # Get the mode -X mode = S_IMODE(st[ST_MODE]) -X linkto = posix.readlink(name) -X files = posix.listdir(name) -X posix.unlink(name) -X posix.mkdir(name, mode) -X posix.chmod(name, mode) -X linkto = cat('..', linkto) -X # -X for file in files: -X if file not in ('.', '..'): -X posix.symlink(cat(linkto, file), cat(name, file)) +X st = posix.stat(name) # Get the mode +X mode = S_IMODE(st[ST_MODE]) +X linkto = posix.readlink(name) +X files = posix.listdir(name) +X posix.unlink(name) +X posix.mkdir(name, mode) +X posix.chmod(name, mode) +X linkto = cat('..', linkto) +X # +X for file in files: +X if file not in ('.', '..'): +X posix.symlink(cat(linkto, file), cat(name, file)) X Xdef main(): -X sys.stdout = sys.stderr -X progname = path.basename(sys.argv[0]) -X args = sys.argv[1:] -X if not args: -X print 'usage:', progname, 'path ...' -X sys.exit(2) -X status = 0 -X for name in args: -X if not path.islink(name): -X print progname+':', name+':', 'not a symlink' -X status = 1 -X else: -X if path.isdir(name): -X mkrealdir(name) -X else: -X mkrealfile(name) -X sys.exit(status) +X sys.stdout = sys.stderr +X progname = path.basename(sys.argv[0]) +X args = sys.argv[1:] +X if not args: +X print 'usage:', progname, 'path ...' +X sys.exit(2) +X status = 0 +X for name in args: +X if not path.islink(name): +X print progname+':', name+':', 'not a symlink' +X status = 1 +X else: +X if path.isdir(name): +X mkrealdir(name) +X else: +X mkrealfile(name) +X sys.exit(status) X Xmain() EOF @@ -98,53 +98,53 @@ Ximport posix Ximport path Ximport string X -Xkeywords = ['def', 'class'] # If you add keywords, update starts!!! -Xstarts = 'dc' # Starting characters of keywords +Xkeywords = ['def', 'class'] # If you add keywords, update starts!!! +Xstarts = 'dc' # Starting characters of keywords X Xwhitespace = string.whitespace Xidentchars = string.letters + string.digits + '_' X -Xtags = [] # Modified! +Xtags = [] # Modified! X Xdef main(): -X args = sys.argv[1:] -X for file in args: treat_file(file) -X if tags: -X fp = open('tags', 'w') -X tags.sort() -X for s in tags: fp.write(s) +X args = sys.argv[1:] +X for file in args: treat_file(file) +X if tags: +X fp = open('tags', 'w') +X tags.sort() +X for s in tags: fp.write(s) X Xdef treat_file(file): -X try: -X fp = open(file, 'r') -X except: -X print 'Cannot open', file -X return -X base = path.basename(file) -X if base[-3:] = '.py': base = base[:-3] -X s = base + '\t' + file + '\t' + '1\n' -X tags.append(s) -X while 1: -X line = fp.readline() -X if not line: break -X maketag(line, file) +X try: +X fp = open(file, 'r') +X except: +X print 'Cannot open', file +X return +X base = path.basename(file) +X if base[-3:] = '.py': base = base[:-3] +X s = base + '\t' + file + '\t' + '1\n' +X tags.append(s) +X while 1: +X line = fp.readline() +X if not line: break +X maketag(line, file) X Xdef maketag(line, file): -X i = 0 -X while line[i:i+1] in whitespace: i = i+1 -X if line[i:i+1] not in starts: return -X n = len(line) -X j = i -X while i < n and line[i] not in whitespace: i = i+1 -X if line[j:i] not in keywords: return -X while i < n and line[i] in whitespace: i = i+1 -X j = i -X while i < n and line[i] in identchars: i = i+1 -X name = line[j:i] -X while i < n and line[i] in whitespace: i = i+1 -X if i < n and line[i] = '(': i = i+1 -X s = name + '\t' + file + '\t' + '/^' + line[:i] + '/\n' -X tags.append(s) +X i = 0 +X while line[i:i+1] in whitespace: i = i+1 +X if line[i:i+1] not in starts: return +X n = len(line) +X j = i +X while i < n and line[i] not in whitespace: i = i+1 +X if line[j:i] not in keywords: return +X while i < n and line[i] in whitespace: i = i+1 +X j = i +X while i < n and line[i] in identchars: i = i+1 +X name = line[j:i] +X while i < n and line[i] in whitespace: i = i+1 +X if i < n and line[i] = '(': i = i+1 +X s = name + '\t' + file + '\t' + '/^' + line[:i] + '/\n' +X tags.append(s) X Xmain() EOF @@ -169,67 +169,67 @@ X XDEF_RATE = 3 X Xdef main(): -X # -X gain = 100 -X rate = 0 -X starter = audio.write -X stopper = 0 -X # -X optlist, args = getopt.getopt(sys.argv[1:], 'adg:r:') -X # -X for optname, optarg in optlist: -X if 0: -X pass -X elif optname = '-d': -X debug.append(1) -X elif optname = '-g': -X gain = string.atoi(optarg) -X if not (0 < gain < 256): -X raise optarg.error, '-g gain out of range' -X elif optname = '-r': -X rate = string.atoi(optarg) -X if not (1 <= rate <= 3): -X raise optarg.error, '-r rate out of range' -X elif optname = '-a': -X starter = audio.start_playing -X stopper = audio.wait_playing -X # -X audio.setoutgain(gain) -X audio.setrate(rate) -X # -X if not args: -X play(starter, rate, auds.loadfp(sys.stdin)) -X else: -X real_stopper = 0 -X for file in args: -X if real_stopper: -X real_stopper() -X play(starter, rate, auds.load(file)) -X real_stopper = stopper +X # +X gain = 100 +X rate = 0 +X starter = audio.write +X stopper = 0 +X # +X optlist, args = getopt.getopt(sys.argv[1:], 'adg:r:') +X # +X for optname, optarg in optlist: +X if 0: +X pass +X elif optname = '-d': +X debug.append(1) +X elif optname = '-g': +X gain = string.atoi(optarg) +X if not (0 < gain < 256): +X raise optarg.error, '-g gain out of range' +X elif optname = '-r': +X rate = string.atoi(optarg) +X if not (1 <= rate <= 3): +X raise optarg.error, '-r rate out of range' +X elif optname = '-a': +X starter = audio.start_playing +X stopper = audio.wait_playing +X # +X audio.setoutgain(gain) +X audio.setrate(rate) +X # +X if not args: +X play(starter, rate, auds.loadfp(sys.stdin)) +X else: +X real_stopper = 0 +X for file in args: +X if real_stopper: +X real_stopper() +X play(starter, rate, auds.load(file)) +X real_stopper = stopper X Xdef play(starter, rate, data): -X magic = data[:4] -X if magic = '0008': -X mrate = 3 -X elif magic = '0016': -X mrate = 2 -X elif magic = '0032': -X mrate = 1 -X else: -X mrate = 0 -X if mrate: -X data = data[4:] -X else: -X mrate = DEF_RATE -X if not rate: rate = mrate -X audio.setrate(rate) -X starter(data) +X magic = data[:4] +X if magic = '0008': +X mrate = 3 +X elif magic = '0016': +X mrate = 2 +X elif magic = '0032': +X mrate = 1 +X else: +X mrate = 0 +X if mrate: +X data = data[4:] +X else: +X mrate = DEF_RATE +X if not rate: rate = mrate +X audio.setrate(rate) +X starter(data) X Xtry: -X main() +X main() Xfinally: -X audio.setoutgain(0) -X audio.done() +X audio.setoutgain(0) +X audio.done() EOF chmod +x 'demo/sgi/audio/play.py' fi @@ -314,59 +314,59 @@ X# X# list of list of control points X# Xdef make_ctlpoints(): -X c = [] -X # -X ci = [] -X ci.append(-2.5, -3.7, 1.0) -X ci.append(-1.5, -3.7, 3.0) -X ci.append(1.5, -3.7, -2.5) -X ci.append(2.5, -3.7, -0.75) -X c.append(ci) -X # -X ci = [] -X ci.append(-2.5, -2.0, 3.0) -X ci.append(-1.5, -2.0, 4.0) -X ci.append(1.5, -2.0, -3.0) -X ci.append(2.5, -2.0, 0.0) -X c.append(ci) -X # -X ci = [] -X ci.append(-2.5, 2.0, 1.0) -X ci.append(-1.5, 2.0, 0.0) -X ci.append(1.5, 2.0, -1.0) -X ci.append(2.5, 2.0, 2.0) -X c.append(ci) -X # -X ci = [] -X ci.append(-2.5, 2.7, 1.25) -X ci.append(-1.5, 2.7, 0.1) -X ci.append(1.5, 2.7, -0.6) -X ci.append(2.5, 2.7, 0.2) -X c.append(ci) -X # -X return c +X c = [] +X # +X ci = [] +X ci.append(-2.5, -3.7, 1.0) +X ci.append(-1.5, -3.7, 3.0) +X ci.append(1.5, -3.7, -2.5) +X ci.append(2.5, -3.7, -0.75) +X c.append(ci) +X # +X ci = [] +X ci.append(-2.5, -2.0, 3.0) +X ci.append(-1.5, -2.0, 4.0) +X ci.append(1.5, -2.0, -3.0) +X ci.append(2.5, -2.0, 0.0) +X c.append(ci) +X # +X ci = [] +X ci.append(-2.5, 2.0, 1.0) +X ci.append(-1.5, 2.0, 0.0) +X ci.append(1.5, 2.0, -1.0) +X ci.append(2.5, 2.0, 2.0) +X c.append(ci) +X # +X ci = [] +X ci.append(-2.5, 2.7, 1.25) +X ci.append(-1.5, 2.7, 0.1) +X ci.append(1.5, 2.7, -0.6) +X ci.append(2.5, 2.7, 0.2) +X c.append(ci) +X # +X return c X Xctlpoints = make_ctlpoints () X X# X# trim knots X# -Xtrimknots = [0., 0., 0., 1., 1., 2., 2., 3., 3., 4., 4., 4.] +Xtrimknots = [0., 0., 0., 1., 1., 2., 2., 3., 3., 4., 4., 4.] X Xdef make_trimpoints(): -X c = [] -X # -X c.append(1.0, 0.0, 1.0) -X c.append(1.0, 1.0, 1.0) -X c.append(0.0, 2.0, 2.0) -X c.append(-1.0, 1.0, 1.0) -X c.append(-1.0, 0.0, 1.0) -X c.append(-1.0, -1.0, 1.0) -X c.append(0.0, -2.0, 2.0) -X c.append(1.0, -1.0, 1.0) -X c.append(1.0, 0.0, 1.0) -X # -X return c +X c = [] +X # +X c.append(1.0, 0.0, 1.0) +X c.append(1.0, 1.0, 1.0) +X c.append(0.0, 2.0, 2.0) +X c.append(-1.0, 1.0, 1.0) +X c.append(-1.0, 0.0, 1.0) +X c.append(-1.0, -1.0, 1.0) +X c.append(0.0, -2.0, 2.0) +X c.append(1.0, -1.0, 1.0) +X c.append(1.0, 0.0, 1.0) +X # +X return c X Xtrimpoints = make_trimpoints() EOF @@ -385,70 +385,70 @@ X# Draw a single 2x2x2 block with its center at (0, 0, 0) X# Arguments are the material indices (0 = don't call lmbind) X# Xdef block(m_front, m_back, m_left, m_right, m_top, m_bottom): -X # -X # Distances defining the sides -X # -X x_left = -1.0 -X x_right = 1.0 -X y_top = 1.0 -X y_bottom = -1.0 -X z_front = 1.0 -X z_back = -1.0 -X # -X # Top surface points: A, B, C, D -X # -X A = x_right, y_top, z_front -X B = x_right, y_top, z_back -X C = x_left, y_top, z_back -X D = x_left, y_top, z_front -X # -X # Bottom surface points: E, F, G, H -X # -X E = x_right, y_bottom, z_front -X F = x_right, y_bottom, z_back -X G = x_left, y_bottom, z_back -X H = x_left, y_bottom, z_front -X # -X # Draw front face -X # -X if m_front: lmbind(MATERIAL, m_front) -X n3f(0.0, 0.0, 1.0) -X face(H, E, A, D) -X # -X # Draw back face -X # -X if m_back: lmbind(MATERIAL, m_back) -X n3f(0.0, 0.0, -1.0) -X face(G, F, B, C) -X # -X # Draw left face -X # -X if m_left: lmbind(MATERIAL, m_left) -X n3f(-1.0, 0.0, 0.0) -X face(G, H, D, C) -X # -X # Draw right face -X # -X if m_right: lmbind(MATERIAL, m_right) -X n3f(1.0, 0.0, 0.0) -X face(F, E, A, B) -X # -X # Draw top face -X # -X if m_top: lmbind(MATERIAL, m_top) -X n3f(0.0, 1.0, 0.0) -X face(A, B, C, D) -X # -X # Draw bottom face -X # -X if m_bottom: lmbind(MATERIAL, m_bottom) -X n3f(0.0, -1.0, 0.0) -X face(E, F, G, H) +X # +X # Distances defining the sides +X # +X x_left = -1.0 +X x_right = 1.0 +X y_top = 1.0 +X y_bottom = -1.0 +X z_front = 1.0 +X z_back = -1.0 +X # +X # Top surface points: A, B, C, D +X # +X A = x_right, y_top, z_front +X B = x_right, y_top, z_back +X C = x_left, y_top, z_back +X D = x_left, y_top, z_front +X # +X # Bottom surface points: E, F, G, H +X # +X E = x_right, y_bottom, z_front +X F = x_right, y_bottom, z_back +X G = x_left, y_bottom, z_back +X H = x_left, y_bottom, z_front +X # +X # Draw front face +X # +X if m_front: lmbind(MATERIAL, m_front) +X n3f(0.0, 0.0, 1.0) +X face(H, E, A, D) +X # +X # Draw back face +X # +X if m_back: lmbind(MATERIAL, m_back) +X n3f(0.0, 0.0, -1.0) +X face(G, F, B, C) +X # +X # Draw left face +X # +X if m_left: lmbind(MATERIAL, m_left) +X n3f(-1.0, 0.0, 0.0) +X face(G, H, D, C) +X # +X # Draw right face +X # +X if m_right: lmbind(MATERIAL, m_right) +X n3f(1.0, 0.0, 0.0) +X face(F, E, A, B) +X # +X # Draw top face +X # +X if m_top: lmbind(MATERIAL, m_top) +X n3f(0.0, 1.0, 0.0) +X face(A, B, C, D) +X # +X # Draw bottom face +X # +X if m_bottom: lmbind(MATERIAL, m_bottom) +X n3f(0.0, -1.0, 0.0) +X face(E, F, G, H) X Xdef face(points): -X bgnpolygon() -X varray(points) -X endpolygon() +X bgnpolygon() +X varray(points) +X endpolygon() EOF fi if test -s 'demo/sgi/gl_panel/twoview/camera.s' @@ -528,52 +528,52 @@ X Xfrom Split import Split X Xclass HVSplit() = Split(): -X # -X def create(self, (parent, hv)): -X # hv is 0 or 1 for HSplit or VSplit -X self = Split.create(self, parent) -X self.hv = hv -X return self -X # -X def minsize(self, m): -X hv, vh = self.hv, 1 - self.hv -X size = [0, 0] -X for c in self.children: -X csize = c.minsize(m) -X if csize[vh] > size[vh]: size[vh] = csize[vh] -X size[hv] = size[hv] + csize[hv] -X return size[0], size[1] -X # -X def getbounds(self): -X return self.bounds -X # -X def setbounds(self, bounds): -X self.bounds = bounds -X hv, vh = self.hv, 1 - self.hv -X mf = self.parent.beginmeasuring -X size = self.minsize(mf()) -X # XXX not yet used! Later for stretching -X maxsize_hv = bounds[1][hv] - bounds[0][hv] -X origin = [self.bounds[0][0], self.bounds[0][1]] -X for c in self.children: -X size = c.minsize(mf()) -X corner = [0, 0] -X corner[vh] = bounds[1][vh] -X corner[hv] = origin[hv] + size[hv] -X c.setbounds((origin[0], origin[1]), \ -X (corner[0], corner[1])) -X origin[hv] = corner[hv] -X # XXX stretch -X # XXX too-small -X # +X # +X def create(self, (parent, hv)): +X # hv is 0 or 1 for HSplit or VSplit +X self = Split.create(self, parent) +X self.hv = hv +X return self +X # +X def minsize(self, m): +X hv, vh = self.hv, 1 - self.hv +X size = [0, 0] +X for c in self.children: +X csize = c.minsize(m) +X if csize[vh] > size[vh]: size[vh] = csize[vh] +X size[hv] = size[hv] + csize[hv] +X return size[0], size[1] +X # +X def getbounds(self): +X return self.bounds +X # +X def setbounds(self, bounds): +X self.bounds = bounds +X hv, vh = self.hv, 1 - self.hv +X mf = self.parent.beginmeasuring +X size = self.minsize(mf()) +X # XXX not yet used! Later for stretching +X maxsize_hv = bounds[1][hv] - bounds[0][hv] +X origin = [self.bounds[0][0], self.bounds[0][1]] +X for c in self.children: +X size = c.minsize(mf()) +X corner = [0, 0] +X corner[vh] = bounds[1][vh] +X corner[hv] = origin[hv] + size[hv] +X c.setbounds((origin[0], origin[1]), \ +X (corner[0], corner[1])) +X origin[hv] = corner[hv] +X # XXX stretch +X # XXX too-small +X # X Xclass HSplit() = HVSplit(): -X def create(self, parent): -X return HVSplit.create(self, (parent, 0)) +X def create(self, parent): +X return HVSplit.create(self, (parent, 0)) X Xclass VSplit() = HVSplit(): -X def create(self, parent): -X return HVSplit.create(self, (parent, 1)) +X def create(self, parent): +X return HVSplit.create(self, (parent, 1)) EOF fi if test -s 'lib/dump.py' @@ -606,44 +606,44 @@ X X# Dump a whole symbol table X# Xdef dumpsymtab(dict): -X for key in dict.keys(): -X dumpvar(key, dict[key]) +X for key in dict.keys(): +X dumpvar(key, dict[key]) X X# Dump a single variable X# Xdef dumpvar(name, x): -X import sys -X t = type(x) -X if t = type({}): -X print name, '= {}' -X for key in x.keys(): -X item = x[key] -X if not printable(item): -X print '#', -X print name, '[', `key`, '] =', `item` -X elif t in (type(''), type(0), type(0.0), type([]), type(())): -X if not printable(x): -X print '#', -X print name, '=', `x` -X elif t = type(sys): -X print 'import', name, '#', x -X else: -X print '#', name, '=', x +X import sys +X t = type(x) +X if t = type({}): +X print name, '= {}' +X for key in x.keys(): +X item = x[key] +X if not printable(item): +X print '#', +X print name, '[', `key`, '] =', `item` +X elif t in (type(''), type(0), type(0.0), type([]), type(())): +X if not printable(x): +X print '#', +X print name, '=', `x` +X elif t = type(sys): +X print 'import', name, '#', x +X else: +X print '#', name, '=', x X X# check if a value is printable in a way that can be read back with input() X# Xdef printable(x): -X t = type(x) -X if t in (type(''), type(0), type(0.0)): -X return 1 -X if t in (type([]), type(())): -X for item in x: -X if not printable(item): -X return 0 -X return 1 -X if x = {}: -X return 1 -X return 0 +X t = type(x) +X if t in (type(''), type(0), type(0.0)): +X return 1 +X if t in (type([]), type(())): +X for item in x: +X if not printable(item): +X return 0 +X return 1 +X if x = {}: +X return 1 +X return 0 EOF fi if test -s 'lib/localtime.py' @@ -655,55 +655,55 @@ X# module localtime -- Time conversions X Ximport posix X -Xepoch = 1970 # 1 jan 00:00:00, UCT -Xday0 = 4 # day 0 was a thursday +Xepoch = 1970 # 1 jan 00:00:00, UCT +Xday0 = 4 # day 0 was a thursday X Xday_names = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') X -Xmonth_names = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun') +Xmonth_names = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun') Xmonth_names = month_names + ('Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') X Xmonth_sizes = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) X Xdef isleap(year): -X return year % 4 = 0 and (year % 100 <> 0 or year % 400 = 0) -X -Xdef gmtime(secs): # decode time into UCT -X mins, secs = divmod(secs, 60) -X hours, mins = divmod(mins, 60) -X days, hours = divmod(hours, 24) -X wday = (day0 + days) % 7 -X year = epoch -X lp = isleap(year) -X dpy = 365 + lp -X while days >= dpy: -X days = days - dpy -X year = year + 1 -X lp = isleap(year) -X dpy = 365 + lp -X yday = days -X month = 0 -X dpm = month_sizes[month] + (lp and month = 1) -X while days >= dpm: -X days = days - dpm -X month = month + 1 -X dpm = month_sizes[month] + (lp and month = 1) -X return (year, month, days+1, hours, mins, secs, yday, wday) +X return year % 4 = 0 and (year % 100 <> 0 or year % 400 = 0) +X +Xdef gmtime(secs): # decode time into UCT +X mins, secs = divmod(secs, 60) +X hours, mins = divmod(mins, 60) +X days, hours = divmod(hours, 24) +X wday = (day0 + days) % 7 +X year = epoch +X lp = isleap(year) +X dpy = 365 + lp +X while days >= dpy: +X days = days - dpy +X year = year + 1 +X lp = isleap(year) +X dpy = 365 + lp +X yday = days +X month = 0 +X dpm = month_sizes[month] + (lp and month = 1) +X while days >= dpm: +X days = days - dpm +X month = month + 1 +X dpm = month_sizes[month] + (lp and month = 1) +X return (year, month, days+1, hours, mins, secs, yday, wday) X Xdef dd(x): -X s = `x` -X while len(s) < 2: s = '0' + s -X return s +X s = `x` +X while len(s) < 2: s = '0' + s +X return s X Xdef zd(x): -X s = `x` -X while len(s) < 2: s = ' ' + s -X return s +X s = `x` +X while len(s) < 2: s = ' ' + s +X return s X Xdef format(year, month, days, hours, mins, secs, yday, wday): -X s = day_names[wday] + ' ' + zd(days) + ' ' + month_names[month] + ' ' -X s = s + dd(hours) + ':' + dd(mins) + ':' + dd(secs) -X return s +X s = day_names[wday] + ' ' + zd(days) + ' ' + month_names[month] + ' ' +X s = s + dd(hours) + ':' + dd(mins) + ':' + dd(secs) +X return s EOF fi if test -s 'lib/poly.py' @@ -719,51 +719,51 @@ X# There is no way to suppress internal zeros; trailing zeros are X# taken out by normalize(). X Xdef normalize(p): # Strip unnecessary zero coefficients -X n = len(p) -X while p: -X if p[n-1]: return p[:n] -X n = n-1 -X return [] +X n = len(p) +X while p: +X if p[n-1]: return p[:n] +X n = n-1 +X return [] X Xdef plus(a, b): -X if len(a) < len(b): a, b = b, a # make sure a is the longest -X res = a[:] # make a copy -X for i in range(len(b)): -X res[i] = res[i] + b[i] -X return normalize(res) +X if len(a) < len(b): a, b = b, a # make sure a is the longest +X res = a[:] # make a copy +X for i in range(len(b)): +X res[i] = res[i] + b[i] +X return normalize(res) X Xdef minus(a, b): -X if len(a) < len(b): a, b = b, a # make sure a is the longest -X res = a[:] # make a copy -X for i in range(len(b)): -X res[i] = res[i] - b[i] -X return normalize(res) +X if len(a) < len(b): a, b = b, a # make sure a is the longest +X res = a[:] # make a copy +X for i in range(len(b)): +X res[i] = res[i] - b[i] +X return normalize(res) X Xdef one(power, coeff): # Representation of coeff * x**power -X res = [] -X for i in range(power): res.append(0) -X return res + [coeff] +X res = [] +X for i in range(power): res.append(0) +X return res + [coeff] X Xdef times(a, b): -X res = [] -X for i in range(len(a)): -X for j in range(len(b)): -X res = plus(res, one(i+j, a[i]*b[j])) -X return res +X res = [] +X for i in range(len(a)): +X for j in range(len(b)): +X res = plus(res, one(i+j, a[i]*b[j])) +X return res X Xdef power(a, n): # Raise polynomial a to the positive integral power n -X if n = 0: return [1] -X if n = 1: return a -X if n/2*2 = n: -X b = power(a, n/2) -X return times(b, b) -X return times(power(a, n-1), a) +X if n = 0: return [1] +X if n = 1: return a +X if n/2*2 = n: +X b = power(a, n/2) +X return times(b, b) +X return times(power(a, n-1), a) X Xdef der(a): # First derivative -X res = a[1:] -X for i in range(len(res)): -X res[i] = res[i] * (i+1) -X return res +X res = a[1:] +X for i in range(len(res)): +X res[i] = res[i] * (i+1) +X return res X X# Computing a primitive function would require rational arithmetic... EOF @@ -778,71 +778,71 @@ X Ximport posix Ximport path X -XMODEBITS = 010000 # Lower 12 mode bits +XMODEBITS = 010000 # Lower 12 mode bits X# Change this to 01000 (9 mode bits) to avoid copying setuid etc. X X# Copy data from src to dst X# Xdef copyfile(src, dst): -X fsrc = open(src, 'r') -X fdst = open(dst, 'w') -X while 1: -X buf = fsrc.read(16*1024) -X if not buf: break -X fdst.write(buf) +X fsrc = open(src, 'r') +X fdst = open(dst, 'w') +X while 1: +X buf = fsrc.read(16*1024) +X if not buf: break +X fdst.write(buf) X X# Copy mode bits from src to dst X# Xdef copymode(src, dst): -X st = posix.stat(src) -X mode = divmod(st[0], MODEBITS)[1] -X posix.chmod(dst, mode) +X st = posix.stat(src) +X mode = divmod(st[0], MODEBITS)[1] +X posix.chmod(dst, mode) X X# Copy all stat info (mode bits, atime and mtime) from src to dst X# Xdef copystat(src, dst): -X st = posix.stat(src) -X mode = divmod(st[0], MODEBITS)[1] -X posix.chmod(dst, mode) -X posix.utimes(dst, st[7:9]) +X st = posix.stat(src) +X mode = divmod(st[0], MODEBITS)[1] +X posix.chmod(dst, mode) +X posix.utimes(dst, st[7:9]) X X# Copy data and mode bits ("cp src dst") X# Xdef copy(src, dst): -X copyfile(src, dst) -X copymode(src, dst) +X copyfile(src, dst) +X copymode(src, dst) X X# Copy data and all stat info ("cp -p src dst") X# Xdef copy2(src, dst): -X copyfile(src, dst) -X copystat(src, dst) +X copyfile(src, dst) +X copystat(src, dst) X X# Recursively copy a directory tree. X# The destination must not already exist. X# Xdef copytree(src, dst): -X names = posix.listdir(src) -X posix.mkdir(dst, 0777) -X dot_dotdot = '.', '..' -X for name in names: -X if name not in dot_dotdot: -X srcname = path.cat(src, name) -X dstname = path.cat(dst, name) -X #print 'Copying', srcname, 'to', dstname -X try: -X #if path.islink(srcname): -X # linkto = posix.readlink(srcname) -X # posix.symlink(linkto, dstname) -X #elif path.isdir(srcname): -X if path.isdir(srcname): -X copytree(srcname, dstname) -X else: -X copy2(srcname, dstname) -X # XXX What about devices, sockets etc.? -X except posix.error, why: -X print 'Could not copy', srcname, 'to', dstname, -X print '(', why[1], ')' +X names = posix.listdir(src) +X posix.mkdir(dst, 0777) +X dot_dotdot = '.', '..' +X for name in names: +X if name not in dot_dotdot: +X srcname = path.cat(src, name) +X dstname = path.cat(dst, name) +X #print 'Copying', srcname, 'to', dstname +X try: +X #if path.islink(srcname): +X # linkto = posix.readlink(srcname) +X # posix.symlink(linkto, dstname) +X #elif path.isdir(srcname): +X if path.isdir(srcname): +X copytree(srcname, dstname) +X else: +X copy2(srcname, dstname) +X # XXX What about devices, sockets etc.? +X except posix.error, why: +X print 'Could not copy', srcname, 'to', dstname, +X print '(', why[1], ')' EOF fi if test -s 'lib/stdwinevents.py' @@ -853,49 +853,49 @@ sed 's/^X//' > 'lib/stdwinevents.py' << 'EOF' X# Module 'stdwinevents' -- Constants for stdwin event types X# X# Suggested usage: -X# from stdwinevents import * +X# from stdwinevents import * X X# The function stdwin.getevent() returns a tuple containing: -X# (type, window, detail) +X# (type, window, detail) X# where detail may be or a value depending on type, see below: X X# Values for type: X -XWE_NULL = 0 # not reported -- means 'no event' internally -XWE_ACTIVATE = 1 # detail is -XWE_CHAR = 2 # detail is the character -XWE_COMMAND = 3 # detail is one of the WC_* constants below -XWE_MOUSE_DOWN = 4 # detail is ((h, v), clicks, button, mask) -XWE_MOUSE_MOVE = 5 # ditto -XWE_MOUSE_UP = 6 # ditto -XWE_MENU = 7 # detail is (menu, item) -XWE_SIZE = 8 # detail is (width, height) [???] -XWE_MOVE = 9 # not reported -- reserved for future use -XWE_DRAW = 10 # detail is ((left, top), (right, bottom)) -XWE_TIMER = 11 # detail is -XWE_DEACTIVATE = 12 # detail is -XWE_EXTERN = 13 # detail is -XWE_KEY = 14 # detail is ??? -XWE_LOST_SEL = 15 # detail is selection number -XWE_CLOSE = 16 # detail is +XWE_NULL = 0 # not reported -- means 'no event' internally +XWE_ACTIVATE = 1 # detail is +XWE_CHAR = 2 # detail is the character +XWE_COMMAND = 3 # detail is one of the WC_* constants below +XWE_MOUSE_DOWN = 4 # detail is ((h, v), clicks, button, mask) +XWE_MOUSE_MOVE = 5 # ditto +XWE_MOUSE_UP = 6 # ditto +XWE_MENU = 7 # detail is (menu, item) +XWE_SIZE = 8 # detail is (width, height) [???] +XWE_MOVE = 9 # not reported -- reserved for future use +XWE_DRAW = 10 # detail is ((left, top), (right, bottom)) +XWE_TIMER = 11 # detail is +XWE_DEACTIVATE = 12 # detail is +XWE_EXTERN = 13 # detail is +XWE_KEY = 14 # detail is ??? +XWE_LOST_SEL = 15 # detail is selection number +XWE_CLOSE = 16 # detail is X X# Values for detail when type is WE_COMMAND: X -XWC_CLOSE = 1 # user hit close box -XWC_LEFT = 2 # left arrow key -XWC_RIGHT = 3 # right arrow key -XWC_UP = 4 # up arrow key -XWC_DOWN = 5 # down arrow key -XWC_CANCEL = 6 # not reported -- turned into KeyboardInterrupt -XWC_BACKSPACE = 7 # backspace key -XWC_TAB = 8 # tab key -XWC_RETURN = 9 # return or enter key +XWC_CLOSE = 1 # user hit close box +XWC_LEFT = 2 # left arrow key +XWC_RIGHT = 3 # right arrow key +XWC_UP = 4 # up arrow key +XWC_DOWN = 5 # down arrow key +XWC_CANCEL = 6 # not reported -- turned into KeyboardInterrupt +XWC_BACKSPACE = 7 # backspace key +XWC_TAB = 8 # tab key +XWC_RETURN = 9 # return or enter key X X# Selection numbers X -XWS_CLIPBOARD = 0 -XWS_PRIMARY = 1 -XWS_SECONDARY = 2 +XWS_CLIPBOARD = 0 +XWS_PRIMARY = 1 +XWS_SECONDARY = 2 EOF fi if test -s 'lib/sunaudio.py' @@ -915,48 +915,48 @@ X X# convert a 4-char value to integer X Xdef c2i(data): -X if type(data) <> type('') or len(data) <> 4: -X raise error, 'c2i: bad arg (not string[4])' -X bytes = audio.chr2num(data) -X for i in (1, 2, 3): -X if bytes[i] < 0: -X bytes[i] = bytes[i] + 256 -X return ((bytes[0]*256 + bytes[1])*256 + bytes[2])*256 + bytes[3] +X if type(data) <> type('') or len(data) <> 4: +X raise error, 'c2i: bad arg (not string[4])' +X bytes = audio.chr2num(data) +X for i in (1, 2, 3): +X if bytes[i] < 0: +X bytes[i] = bytes[i] + 256 +X return ((bytes[0]*256 + bytes[1])*256 + bytes[2])*256 + bytes[3] X X X# read a sound header from an open file X Xdef gethdr(fp): -X if fp.read(4) <> MAGIC: -X raise error, 'gethdr: bad magic word' -X hdr_size = c2i(fp.read(4)) -X data_size = c2i(fp.read(4)) -X encoding = c2i(fp.read(4)) -X sample_rate = c2i(fp.read(4)) -X channels = c2i(fp.read(4)) -X excess = hdr_size - 24 -X if excess < 0: -X raise error, 'gethdr: bad hdr_size' -X if excess > 0: -X info = fp.read(excess) -X else: -X info = '' -X return (data_size, encoding, sample_rate, channels, info) +X if fp.read(4) <> MAGIC: +X raise error, 'gethdr: bad magic word' +X hdr_size = c2i(fp.read(4)) +X data_size = c2i(fp.read(4)) +X encoding = c2i(fp.read(4)) +X sample_rate = c2i(fp.read(4)) +X channels = c2i(fp.read(4)) +X excess = hdr_size - 24 +X if excess < 0: +X raise error, 'gethdr: bad hdr_size' +X if excess > 0: +X info = fp.read(excess) +X else: +X info = '' +X return (data_size, encoding, sample_rate, channels, info) X X X# read and print the sound header of a named file X Xdef printhdr(file): -X hdr = gethdr(open(file, 'r')) -X data_size, encoding, sample_rate, channels, info = hdr -X while info[-1:] = '\0': -X info = info[:-1] -X print 'File name: ', file -X print 'Data size: ', data_size -X print 'Encoding: ', encoding -X print 'Sample rate:', sample_rate -X print 'Channels: ', channels -X print 'Info: ', `info` +X hdr = gethdr(open(file, 'r')) +X data_size, encoding, sample_rate, channels, info = hdr +X while info[-1:] = '\0': +X info = info[:-1] +X print 'File name: ', file +X print 'Data size: ', data_size +X print 'Encoding: ', encoding +X print 'Sample rate:', sample_rate +X print 'Channels: ', channels +X print 'Info: ', `info` EOF fi if test -s 'lib/whrandom.py' @@ -964,32 +964,32 @@ then echo '*** I will not over-write existing file lib/whrandom.py' else echo 'x - lib/whrandom.py' sed 's/^X//' > 'lib/whrandom.py' << 'EOF' -X# WICHMANN-HILL RANDOM NUMBER GENERATOR +X# WICHMANN-HILL RANDOM NUMBER GENERATOR X# -X# Wichmann, B. A. & Hill, I. D. (1982) -X# Algorithm AS 183: -X# An efficient and portable pseudo-random number generator -X# Applied Statistics 31 (1982) 188-190 +X# Wichmann, B. A. & Hill, I. D. (1982) +X# Algorithm AS 183: +X# An efficient and portable pseudo-random number generator +X# Applied Statistics 31 (1982) 188-190 X# -X# see also: -X# Correction to Algorithm AS 183 -X# Applied Statistics 33 (1984) 123 +X# see also: +X# Correction to Algorithm AS 183 +X# Applied Statistics 33 (1984) 123 X# -X# McLeod, A. I. (1985) -X# A remark on Algorithm AS 183 -X# Applied Statistics 34 (1985),198-200 +X# McLeod, A. I. (1985) +X# A remark on Algorithm AS 183 +X# Applied Statistics 34 (1985),198-200 X# X# -X# USE: -X# whrandom.random() yields double precision random numbers -X# uniformly distributed between 0 and 1. +X# USE: +X# whrandom.random() yields double precision random numbers +X# uniformly distributed between 0 and 1. X# -X# whrandom.seed() must be called before whrandom.random() -X# to seed the generator +X# whrandom.seed() must be called before whrandom.random() +X# to seed the generator X X -X# Translated by Guido van Rossum from C source provided by -X# Adrian Baddeley. +X# Translated by Guido van Rossum from C source provided by +X# Adrian Baddeley. X X X# The seed @@ -1000,39 +1000,39 @@ X X# Set the seed X# Xdef seed(x, y, z): -X _seed[:] = [x, y, z] +X _seed[:] = [x, y, z] X X X# Return the next random number in the range [0.0 .. 1.0) X# Xdef random(): -X from math import floor # floor() function -X # -X [x, y, z] = _seed -X x = 171 * (x % 177) - 2 * (x/177) -X y = 172 * (y % 176) - 35 * (y/176) -X z = 170 * (z % 178) - 63 * (z/178) -X # -X if x < 0: x = x + 30269 -X if y < 0: y = y + 30307 -X if z < 0: z = z + 30323 -X # -X _seed[:] = [x, y, z] -X # -X term = float(x)/30269.0 + float(y)/30307.0 + float(z)/30323.0 -X rand = term - floor(term) -X # -X if rand >= 1.0: rand = 0.0 # floor() inaccuracy? -X # -X return rand +X from math import floor # floor() function +X # +X [x, y, z] = _seed +X x = 171 * (x % 177) - 2 * (x/177) +X y = 172 * (y % 176) - 35 * (y/176) +X z = 170 * (z % 178) - 63 * (z/178) +X # +X if x < 0: x = x + 30269 +X if y < 0: y = y + 30307 +X if z < 0: z = z + 30323 +X # +X _seed[:] = [x, y, z] +X # +X term = float(x)/30269.0 + float(y)/30307.0 + float(z)/30323.0 +X rand = term - floor(term) +X # +X if rand >= 1.0: rand = 0.0 # floor() inaccuracy? +X # +X return rand X X X# Initialize from the current time X# Xdef init(): -X import time -X t = time.time() -X seed(t%256, t/256%256, t/65536%256) +X import time +X t = time.time() +X seed(t%256, t/256%256, t/65536%256) X X X# Make sure the generator is preset to a nonzero value @@ -1051,7 +1051,7 @@ XTo build the interpreter, edit the Makefile, follow the instructions Xthere, and type "make python". X XTo use the interpreter, you must set the environment variable PYTHONPATH -Xto point to the directory containing the standard modules. These are +Xto point to the directory containing the standard modules. These are Xdistributed as a sister directory called 'lib' of this source directory. XTry importing the module 'testall' to see if everything works. X @@ -1067,12 +1067,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1107,12 +1107,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1147,12 +1147,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1168,17 +1168,17 @@ X X******************************************************************/ X X/* Error codes passed around between file input, tokenizer, parser and -X interpreter. This was necessary so we can turn them into Python -X exceptions at a higher level. */ -X -X#define E_OK 10 /* No error */ -X#define E_EOF 11 /* (Unexpected) EOF read */ -X#define E_INTR 12 /* Interrupted */ -X#define E_TOKEN 13 /* Bad token */ -X#define E_SYNTAX 14 /* Syntax error */ -X#define E_NOMEM 15 /* Ran out of memory */ -X#define E_DONE 16 /* Parsing complete */ -X#define E_ERROR 17 /* Execution error */ +X interpreter. This was necessary so we can turn them into Python +X exceptions at a higher level. */ +X +X#define E_OK 10 /* No error */ +X#define E_EOF 11 /* (Unexpected) EOF read */ +X#define E_INTR 12 /* Interrupted */ +X#define E_TOKEN 13 /* Bad token */ +X#define E_SYNTAX 14 /* Syntax error */ +X#define E_NOMEM 15 /* Ran out of memory */ +X#define E_DONE 16 /* Parsing complete */ +X#define E_ERROR 17 /* Execution error */ EOF fi if test -s 'src/fileobject.h' @@ -1190,12 +1190,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1230,12 +1230,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1257,8 +1257,8 @@ Xfloatobject represents a (double precision) floating point number. X*/ X Xtypedef struct { -X OB_HEAD -X double ob_fval; +X OB_HEAD +X double ob_fval; X} floatobject; X Xextern typeobject Floattype; @@ -1281,12 +1281,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1310,23 +1310,23 @@ Xextern int errno; X Xdouble Xfmod(x, y) -X double x, y; +X double x, y; X{ -X double i, f; -X -X if (y == 0.0) { -X errno = EDOM; -X return 0.0; -X } -X -X /* return f such that x = i*y + f for some integer i -X such that |f| < |y| and f has the same sign as x */ -X -X i = floor(x/y); -X f = x - i*y; -X if ((x < 0.0) != (y < 0.0)) -X f = f-y; -X return f; +X double i, f; +X +X if (y == 0.0) { +X errno = EDOM; +X return 0.0; +X } +X +X /* return f such that x = i*y + f for some integer i +X such that |f| < |y| and f has the same sign as x */ +X +X i = floor(x/y); +X f = x - i*y; +X if ((x < 0.0) != (y < 0.0)) +X f = f-y; +X return f; X} EOF fi @@ -1339,12 +1339,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1379,12 +1379,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1417,12 +1417,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1454,12 +1454,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1487,8 +1487,8 @@ Xextern method getmethod PROTO((object *)); Xextern object *getself PROTO((object *)); X Xstruct methodlist { -X char *ml_name; -X method ml_meth; +X char *ml_name; +X method ml_meth; X}; X Xextern object *findmethod PROTO((struct methodlist *, object *, char *)); @@ -1503,12 +1503,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1537,12 +1537,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1577,12 +1577,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1601,7 +1601,7 @@ X/* Parser-tokenizer link interface */ X Xextern int parsestring PROTO((char *, grammar *, int start, node **n_ret)); Xextern int parsefile PROTO((FILE *, char *, grammar *, int start, -X char *ps1, char *ps2, node **n_ret)); +X char *ps1, char *ps2, node **n_ret)); EOF fi if test -s 'src/pgen.h' @@ -1613,12 +1613,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1650,12 +1650,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1674,7 +1674,7 @@ X/* X * The first byte of the regexp internal "program" is actually this magic X * number; the start node begins in the second byte. X */ -X#define MAGIC 0234 +X#define MAGIC 0234 EOF fi if test -s 'src/sc_errors.h' @@ -1686,12 +1686,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1707,18 +1707,18 @@ X X******************************************************************/ X X -X#define NoBufSize 1 -X#define TwoBufSize 2 -X#define StackOverflow 3 -X#define StackUnderflow 4 -X#define TypeFailure 5 -X#define RangeError 6 -X#define SizeError 7 -X#define BufferOverflow 8 -X#define NoEndLoop 9 -X#define FlagError 10 -X#define ElementIsNull 11 -X#define TransError 12 +X#define NoBufSize 1 +X#define TwoBufSize 2 +X#define StackOverflow 3 +X#define StackUnderflow 4 +X#define TypeFailure 5 +X#define RangeError 6 +X#define SizeError 7 +X#define BufferOverflow 8 +X#define NoEndLoop 9 +X#define FlagError 10 +X#define ElementIsNull 11 +X#define TransError 12 X Xextern object *err_scerr PROTO((int sc_errno)); Xextern err_scerrset PROTO((int sc_errno, object *value, char *instr)); @@ -1734,12 +1734,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1772,12 +1772,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1798,14 +1798,14 @@ X#include "string.h" X Xchar * Xstrdup(str) -X const char *str; +X const char *str; X{ -X if (str != NULL) { -X register char *copy = NEW(char, strlen(str) + 1); -X if (copy != NULL) -X return strcpy(copy, str); -X } -X return NULL; +X if (str != NULL) { +X register char *copy = NEW(char, strlen(str) + 1); +X if (copy != NULL) +X return strcpy(copy, str); +X } +X return NULL; X} EOF fi @@ -1818,12 +1818,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1839,7 +1839,7 @@ X X******************************************************************/ X X/* PD implementation of strerror() for systems that don't have it. -X Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, . */ +X Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, . */ X X#include X @@ -1848,13 +1848,13 @@ Xextern char *sys_errlist[]; X Xchar * Xstrerror(err) -X int err; +X int err; X{ -X static char buf[20]; -X if (err >= 0 && err < sys_nerr) -X return sys_errlist[err]; -X sprintf(buf, "Unknown errno %d", err); -X return buf; +X static char buf[20]; +X if (err >= 0 && err < sys_nerr) +X return sys_errlist[err]; +X sprintf(buf, "Unknown errno %d", err); +X return buf; X} X X#ifdef THINK_C @@ -1872,12 +1872,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1909,12 +1909,12 @@ X/*********************************************************** XCopyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The XNetherlands. X -X All Rights Reserved +X All Rights Reserved X -XPermission to use, copy, modify, and distribute this software and its -Xdocumentation for any purpose and without fee is hereby granted, +XPermission to use, copy, modify, and distribute this software and its +Xdocumentation for any purpose and without fee is hereby granted, Xprovided that the above copyright notice appear in all copies and that -Xboth that copyright notice and this permission notice appear in +Xboth that copyright notice and this permission notice appear in Xsupporting documentation, and that the names of Stichting Mathematisch XCentrum or CWI not be used in advertising or publicity pertaining to Xdistribution of the software without specific, written prior permission. @@ -1938,4 +1938,4 @@ Xint tb_print PROTO((object *, FILE *)); EOF fi echo 'Part 20 out of 21 of pack.out complete.' -exit 0 +exit 0 \ No newline at end of file -- cgit v1.2.3