summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-15 19:19:19 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-15 19:19:19 (GMT)
commit1ce7c6fde8a8879ec64242dc0d01b660b934633a (patch)
treef78fea84c78ace252a19a20cd1888dd3c220657f
parent6ad8d13fe2a9c023969d184554aeb1e557115f57 (diff)
downloadcpython-1ce7c6fde8a8879ec64242dc0d01b660b934633a.zip
cpython-1ce7c6fde8a8879ec64242dc0d01b660b934633a.tar.gz
cpython-1ce7c6fde8a8879ec64242dc0d01b660b934633a.tar.bz2
Irix 6 specific files -- thanks Sjoerd!
-rw-r--r--Lib/irix6/AL.py61
-rw-r--r--Lib/irix6/AWARE.py54
-rw-r--r--Lib/irix6/CD.py34
-rw-r--r--Lib/irix6/CL.py24
-rw-r--r--Lib/irix6/DEVICE.py400
-rw-r--r--Lib/irix6/ERRNO.py163
-rw-r--r--Lib/irix6/FCNTL.py114
-rw-r--r--Lib/irix6/FILE.py236
-rw-r--r--Lib/irix6/FL.py289
-rw-r--r--Lib/irix6/GET.py59
-rw-r--r--Lib/irix6/GL.py393
-rw-r--r--Lib/irix6/GLWS.py12
-rw-r--r--Lib/irix6/IN.py133
-rw-r--r--Lib/irix6/IOCTL.py233
-rw-r--r--Lib/irix6/SOCKET.py152
-rw-r--r--Lib/irix6/SV.py120
-rw-r--r--Lib/irix6/TERMIOS.py676
-rw-r--r--Lib/irix6/WAIT.py335
-rw-r--r--Lib/irix6/cddb.py208
-rw-r--r--Lib/irix6/cdplayer.py89
-rw-r--r--Lib/irix6/flp.doc117
-rw-r--r--Lib/irix6/flp.py455
-rw-r--r--Lib/irix6/jpeg.py110
-rw-r--r--Lib/irix6/panel.py281
-rw-r--r--Lib/irix6/panelparser.py128
-rw-r--r--Lib/irix6/readcd.doc104
-rw-r--r--Lib/irix6/readcd.py242
-rwxr-xr-xLib/irix6/regen13
-rw-r--r--Lib/irix6/torgb.py97
-rw-r--r--Lib/plat-irix6/AL.py61
-rw-r--r--Lib/plat-irix6/AWARE.py54
-rw-r--r--Lib/plat-irix6/CD.py34
-rw-r--r--Lib/plat-irix6/CL.py24
-rw-r--r--Lib/plat-irix6/DEVICE.py400
-rw-r--r--Lib/plat-irix6/ERRNO.py163
-rw-r--r--Lib/plat-irix6/FCNTL.py114
-rw-r--r--Lib/plat-irix6/FILE.py236
-rw-r--r--Lib/plat-irix6/FL.py289
-rw-r--r--Lib/plat-irix6/GET.py59
-rw-r--r--Lib/plat-irix6/GL.py393
-rw-r--r--Lib/plat-irix6/GLWS.py12
-rw-r--r--Lib/plat-irix6/IN.py133
-rw-r--r--Lib/plat-irix6/IOCTL.py233
-rw-r--r--Lib/plat-irix6/SOCKET.py152
-rw-r--r--Lib/plat-irix6/SV.py120
-rw-r--r--Lib/plat-irix6/TERMIOS.py676
-rw-r--r--Lib/plat-irix6/WAIT.py335
-rw-r--r--Lib/plat-irix6/cddb.py208
-rw-r--r--Lib/plat-irix6/cdplayer.py89
-rw-r--r--Lib/plat-irix6/flp.doc117
-rw-r--r--Lib/plat-irix6/flp.py455
-rw-r--r--Lib/plat-irix6/jpeg.py110
-rw-r--r--Lib/plat-irix6/panel.py281
-rw-r--r--Lib/plat-irix6/panelparser.py128
-rw-r--r--Lib/plat-irix6/readcd.doc104
-rw-r--r--Lib/plat-irix6/readcd.py242
-rwxr-xr-xLib/plat-irix6/regen13
-rw-r--r--Lib/plat-irix6/torgb.py97
58 files changed, 10664 insertions, 0 deletions
diff --git a/Lib/irix6/AL.py b/Lib/irix6/AL.py
new file mode 100644
index 0000000..ed17cde
--- /dev/null
+++ b/Lib/irix6/AL.py
@@ -0,0 +1,61 @@
+RATE_48000 = 48000
+RATE_44100 = 44100
+RATE_32000 = 32000
+RATE_22050 = 22050
+RATE_16000 = 16000
+RATE_11025 = 11025
+RATE_8000 = 8000
+
+SAMPFMT_TWOSCOMP= 1
+SAMPFMT_FLOAT = 32
+SAMPFMT_DOUBLE = 64
+
+SAMPLE_8 = 1
+SAMPLE_16 = 2
+ # SAMPLE_24 is the low 24 bits of a long, sign extended to 32 bits
+SAMPLE_24 = 4
+
+MONO = 1
+STEREO = 2
+QUADRO = 4 # 4CHANNEL is not a legal Python name
+
+INPUT_LINE = 0
+INPUT_MIC = 1
+INPUT_DIGITAL = 2
+
+MONITOR_OFF = 0
+MONITOR_ON = 1
+
+ERROR_NUMBER = 0
+ERROR_TYPE = 1
+ERROR_LOCATION_LSP = 2
+ERROR_LOCATION_MSP = 3
+ERROR_LENGTH = 4
+
+ERROR_INPUT_UNDERFLOW = 0
+ERROR_OUTPUT_OVERFLOW = 1
+
+# These seem to be not supported anymore:
+##HOLD, RELEASE = 0, 1
+##ATTAIL, ATHEAD, ATMARK, ATTIME = 0, 1, 2, 3
+
+DEFAULT_DEVICE = 1
+
+INPUT_SOURCE = 0
+LEFT_INPUT_ATTEN = 1
+RIGHT_INPUT_ATTEN = 2
+INPUT_RATE = 3
+OUTPUT_RATE = 4
+LEFT_SPEAKER_GAIN = 5
+RIGHT_SPEAKER_GAIN = 6
+INPUT_COUNT = 7
+OUTPUT_COUNT = 8
+UNUSED_COUNT = 9
+SYNC_INPUT_TO_AES = 10
+SYNC_OUTPUT_TO_AES = 11
+MONITOR_CTL = 12
+LEFT_MONITOR_ATTEN = 13
+RIGHT_MONITOR_ATTEN = 14
+
+ENUM_VALUE = 0 # only certain values are valid
+RANGE_VALUE = 1 # any value in range is valid
diff --git a/Lib/irix6/AWARE.py b/Lib/irix6/AWARE.py
new file mode 100644
index 0000000..30be50b
--- /dev/null
+++ b/Lib/irix6/AWARE.py
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 1992 Aware, Inc. All rights reserved.
+#
+# Copyright Unpublished, Aware Inc. All Rights Reserved.
+# This software contains proprietary and confidential
+# information of Aware, Inc. Use, disclosure or
+# reproduction is prohibited without the prior express
+# written consent of Aware, Inc.
+#
+#
+
+#
+# awareAudio.h - Aware Compression Library Parameter Header
+#
+# 01/21/92 Original Version by Brian Knittel and Jonathon Devine
+#
+
+import CL
+
+# Aware Audio Specific Parameters - For both MPEG Audio and Multirate
+CL.CHANNEL_POLICY = CL.NUMBER_OF_PARAMS + 0
+CL.NOISE_MARGIN = CL.NUMBER_OF_PARAMS + 1
+CL.BITRATE_POLICY = CL.NUMBER_OF_PARAMS + 2
+
+# Additional parameters for MPEG Audio
+CL.BITRATE_TARGET = CL.NUMBER_OF_PARAMS + 3
+CL.LAYER = CL.NUMBER_OF_PARAMS + 4
+
+# read/write for compression configuration
+# read for state during compression/decompression
+
+#
+# Channel Policy
+#
+AWCMP_STEREO = 1
+AWCMP_JOINT_STEREO = 2
+AWCMP_INDEPENDENT = 3
+
+#
+# read/write for compression configuration,
+# read for state during compression
+#
+#
+# Bit-rate Policy
+#
+AWCMP_FIXED_RATE = 1
+AWCMP_CONST_QUAL = 2
+AWCMP_LOSSLESS = 4
+
+#
+# Layer values
+#
+AWCMP_MPEG_LAYER_I = 1
+AWCMP_MPEG_LAYER_II = 2
diff --git a/Lib/irix6/CD.py b/Lib/irix6/CD.py
new file mode 100644
index 0000000..ad56561
--- /dev/null
+++ b/Lib/irix6/CD.py
@@ -0,0 +1,34 @@
+ERROR = 0
+NODISC = 1
+READY = 2
+PLAYING = 3
+PAUSED = 4
+STILL = 5
+
+AUDIO = 0
+PNUM = 1
+INDEX = 2
+PTIME = 3
+ATIME = 4
+CATALOG = 5
+IDENT = 6
+CONTROL = 7
+
+CDDA_DATASIZE = 2352
+
+##CDDA_SUBCODESIZE = (sizeof(struct subcodeQ))
+##CDDA_BLOCKSIZE = (sizeof(struct cdframe))
+##CDDA_NUMSAMPLES = (CDDA_DATASIZE/2)
+##
+##CDQ_PREEMP_MASK = 0xd
+##CDQ_COPY_MASK = 0xb
+##CDQ_DDATA_MASK = 0xd
+##CDQ_BROADCAST_MASK = 0x8
+##CDQ_PREEMPHASIS = 0x1
+##CDQ_COPY_PERMITTED = 0x2
+##CDQ_DIGITAL_DATA = 0x4
+##CDQ_BROADCAST_USE = 0x8
+##
+##CDQ_MODE1 = 0x1
+##CDQ_MODE2 = 0x2
+##CDQ_MODE3 = 0x3
diff --git a/Lib/irix6/CL.py b/Lib/irix6/CL.py
new file mode 100644
index 0000000..468ecaa
--- /dev/null
+++ b/Lib/irix6/CL.py
@@ -0,0 +1,24 @@
+# Backward compatible module CL.
+# All relevant symbols are now defined in the module cl.
+try:
+ from cl import *
+except ImportError:
+ from CL_old import *
+else:
+ del CompressImage
+ del DecompressImage
+ del GetAlgorithmName
+ del OpenCompressor
+ del OpenDecompressor
+ del QueryAlgorithms
+ del QueryMaxHeaderSize
+ del QueryScheme
+ del QuerySchemeFromName
+ del SetDefault
+ del SetMax
+ del SetMin
+ try:
+ del cvt_type
+ except NameError:
+ pass
+ del error
diff --git a/Lib/irix6/DEVICE.py b/Lib/irix6/DEVICE.py
new file mode 100644
index 0000000..7ace8cb
--- /dev/null
+++ b/Lib/irix6/DEVICE.py
@@ -0,0 +1,400 @@
+NULLDEV = 0
+BUTOFFSET = 1
+VALOFFSET = 256
+PSEUDOFFSET = 512
+BUT2OFFSET = 3840
+TIMOFFSET = 515
+XKBDOFFSET = 143
+BUTCOUNT = 255
+VALCOUNT = 256
+TIMCOUNT = 4
+XKBDCOUNT = 28
+USERBUTOFFSET = 4096
+USERVALOFFSET = 12288
+USERPSEUDOFFSET = 16384
+BUT0 = 1
+BUT1 = 2
+BUT2 = 3
+BUT3 = 4
+BUT4 = 5
+BUT5 = 6
+BUT6 = 7
+BUT7 = 8
+BUT8 = 9
+BUT9 = 10
+BUT10 = 11
+BUT11 = 12
+BUT12 = 13
+BUT13 = 14
+BUT14 = 15
+BUT15 = 16
+BUT16 = 17
+BUT17 = 18
+BUT18 = 19
+BUT19 = 20
+BUT20 = 21
+BUT21 = 22
+BUT22 = 23
+BUT23 = 24
+BUT24 = 25
+BUT25 = 26
+BUT26 = 27
+BUT27 = 28
+BUT28 = 29
+BUT29 = 30
+BUT30 = 31
+BUT31 = 32
+BUT32 = 33
+BUT33 = 34
+BUT34 = 35
+BUT35 = 36
+BUT36 = 37
+BUT37 = 38
+BUT38 = 39
+BUT39 = 40
+BUT40 = 41
+BUT41 = 42
+BUT42 = 43
+BUT43 = 44
+BUT44 = 45
+BUT45 = 46
+BUT46 = 47
+BUT47 = 48
+BUT48 = 49
+BUT49 = 50
+BUT50 = 51
+BUT51 = 52
+BUT52 = 53
+BUT53 = 54
+BUT54 = 55
+BUT55 = 56
+BUT56 = 57
+BUT57 = 58
+BUT58 = 59
+BUT59 = 60
+BUT60 = 61
+BUT61 = 62
+BUT62 = 63
+BUT63 = 64
+BUT64 = 65
+BUT65 = 66
+BUT66 = 67
+BUT67 = 68
+BUT68 = 69
+BUT69 = 70
+BUT70 = 71
+BUT71 = 72
+BUT72 = 73
+BUT73 = 74
+BUT74 = 75
+BUT75 = 76
+BUT76 = 77
+BUT77 = 78
+BUT78 = 79
+BUT79 = 80
+BUT80 = 81
+BUT81 = 82
+BUT82 = 83
+MAXKBDBUT = 83
+BUT100 = 101
+BUT101 = 102
+BUT102 = 103
+BUT103 = 104
+BUT104 = 105
+BUT105 = 106
+BUT106 = 107
+BUT107 = 108
+BUT108 = 109
+BUT109 = 110
+BUT110 = 111
+BUT111 = 112
+BUT112 = 113
+BUT113 = 114
+BUT114 = 115
+BUT115 = 116
+BUT116 = 117
+BUT117 = 118
+BUT118 = 119
+BUT119 = 120
+BUT120 = 121
+BUT121 = 122
+BUT122 = 123
+BUT123 = 124
+BUT124 = 125
+BUT125 = 126
+BUT126 = 127
+BUT127 = 128
+BUT128 = 129
+BUT129 = 130
+BUT130 = 131
+BUT131 = 132
+BUT132 = 133
+BUT133 = 134
+BUT134 = 135
+BUT135 = 136
+BUT136 = 137
+BUT137 = 138
+BUT138 = 139
+BUT139 = 140
+BUT140 = 141
+BUT141 = 142
+BUT142 = 143
+BUT143 = 144
+BUT144 = 145
+BUT145 = 146
+BUT146 = 147
+BUT147 = 148
+BUT148 = 149
+BUT149 = 150
+BUT150 = 151
+BUT151 = 152
+BUT152 = 153
+BUT153 = 154
+BUT154 = 155
+BUT155 = 156
+BUT156 = 157
+BUT157 = 158
+BUT158 = 159
+BUT159 = 160
+BUT160 = 161
+BUT161 = 162
+BUT162 = 163
+BUT163 = 164
+BUT164 = 165
+BUT165 = 166
+BUT166 = 167
+BUT167 = 168
+BUT168 = 169
+BUT181 = 182
+BUT182 = 183
+BUT183 = 184
+BUT184 = 185
+BUT185 = 186
+BUT186 = 187
+BUT187 = 188
+BUT188 = 189
+BUT189 = 190
+MOUSE1 = 101
+MOUSE2 = 102
+MOUSE3 = 103
+LEFTMOUSE = 103
+MIDDLEMOUSE = 102
+RIGHTMOUSE = 101
+LPENBUT = 104
+BPAD0 = 105
+BPAD1 = 106
+BPAD2 = 107
+BPAD3 = 108
+LPENVALID = 109
+SWBASE = 111
+SW0 = 111
+SW1 = 112
+SW2 = 113
+SW3 = 114
+SW4 = 115
+SW5 = 116
+SW6 = 117
+SW7 = 118
+SW8 = 119
+SW9 = 120
+SW10 = 121
+SW11 = 122
+SW12 = 123
+SW13 = 124
+SW14 = 125
+SW15 = 126
+SW16 = 127
+SW17 = 128
+SW18 = 129
+SW19 = 130
+SW20 = 131
+SW21 = 132
+SW22 = 133
+SW23 = 134
+SW24 = 135
+SW25 = 136
+SW26 = 137
+SW27 = 138
+SW28 = 139
+SW29 = 140
+SW30 = 141
+SW31 = 142
+SBBASE = 182
+SBPICK = 182
+SBBUT1 = 183
+SBBUT2 = 184
+SBBUT3 = 185
+SBBUT4 = 186
+SBBUT5 = 187
+SBBUT6 = 188
+SBBUT7 = 189
+SBBUT8 = 190
+AKEY = 11
+BKEY = 36
+CKEY = 28
+DKEY = 18
+EKEY = 17
+FKEY = 19
+GKEY = 26
+HKEY = 27
+IKEY = 40
+JKEY = 34
+KKEY = 35
+LKEY = 42
+MKEY = 44
+NKEY = 37
+OKEY = 41
+PKEY = 48
+QKEY = 10
+RKEY = 24
+SKEY = 12
+TKEY = 25
+UKEY = 33
+VKEY = 29
+WKEY = 16
+XKEY = 21
+YKEY = 32
+ZKEY = 20
+ZEROKEY = 46
+ONEKEY = 8
+TWOKEY = 14
+THREEKEY = 15
+FOURKEY = 22
+FIVEKEY = 23
+SIXKEY = 30
+SEVENKEY = 31
+EIGHTKEY = 38
+NINEKEY = 39
+BREAKKEY = 1
+SETUPKEY = 2
+CTRLKEY = 3
+LEFTCTRLKEY = CTRLKEY
+CAPSLOCKKEY = 4
+RIGHTSHIFTKEY = 5
+LEFTSHIFTKEY = 6
+NOSCRLKEY = 13
+ESCKEY = 7
+TABKEY = 9
+RETKEY = 51
+SPACEKEY = 83
+LINEFEEDKEY = 60
+BACKSPACEKEY = 61
+DELKEY = 62
+SEMICOLONKEY = 43
+PERIODKEY = 52
+COMMAKEY = 45
+QUOTEKEY = 50
+ACCENTGRAVEKEY = 55
+MINUSKEY = 47
+VIRGULEKEY = 53
+BACKSLASHKEY = 57
+EQUALKEY = 54
+LEFTBRACKETKEY = 49
+RIGHTBRACKETKEY = 56
+LEFTARROWKEY = 73
+DOWNARROWKEY = 74
+RIGHTARROWKEY = 80
+UPARROWKEY = 81
+PAD0 = 59
+PAD1 = 58
+PAD2 = 64
+PAD3 = 65
+PAD4 = 63
+PAD5 = 69
+PAD6 = 70
+PAD7 = 67
+PAD8 = 68
+PAD9 = 75
+PADPF1 = 72
+PADPF2 = 71
+PADPF3 = 79
+PADPF4 = 78
+PADPERIOD = 66
+PADMINUS = 76
+PADCOMMA = 77
+PADENTER = 82
+LEFTALTKEY = 143
+RIGHTALTKEY = 144
+RIGHTCTRLKEY = 145
+F1KEY = 146
+F2KEY = 147
+F3KEY = 148
+F4KEY = 149
+F5KEY = 150
+F6KEY = 151
+F7KEY = 152
+F8KEY = 153
+F9KEY = 154
+F10KEY = 155
+F11KEY = 156
+F12KEY = 157
+PRINTSCREENKEY = 158
+SCROLLLOCKKEY = 159
+PAUSEKEY = 160
+INSERTKEY = 161
+HOMEKEY = 162
+PAGEUPKEY = 163
+ENDKEY = 164
+PAGEDOWNKEY = 165
+NUMLOCKKEY = 166
+PADVIRGULEKEY = 167
+PADASTERKEY = 168
+PADPLUSKEY = 169
+SGIRESERVED = 256
+DIAL0 = 257
+DIAL1 = 258
+DIAL2 = 259
+DIAL3 = 260
+DIAL4 = 261
+DIAL5 = 262
+DIAL6 = 263
+DIAL7 = 264
+DIAL8 = 265
+MOUSEX = 266
+MOUSEY = 267
+LPENX = 268
+LPENY = 269
+BPADX = 270
+BPADY = 271
+CURSORX = 272
+CURSORY = 273
+GHOSTX = 274
+GHOSTY = 275
+SBTX = 276
+SBTY = 277
+SBTZ = 278
+SBRX = 279
+SBRY = 280
+SBRZ = 281
+SBPERIOD = 282
+TIMER0 = 515
+TIMER1 = 516
+TIMER2 = 517
+TIMER3 = 518
+KEYBD = 513
+RAWKEYBD = 514
+VALMARK = 523
+REDRAW = 528
+INPUTCHANGE = 534
+QFULL = 535
+QREADERROR = 538
+WINFREEZE = 539
+WINTHAW = 540
+REDRAWICONIC = 541
+WINQUIT = 542
+DEPTHCHANGE = 543
+WINSHUT = 546
+DRAWOVERLAY = 547
+VIDEO = 548
+MENUBUTTON = RIGHTMOUSE
+WINCLOSE = 537
+KEYBDFNAMES = 544
+KEYBDFSTRINGS = 545
+MAXSGIDEVICE = 20000
+GERROR = 524
+WMSEND = 529
+WMREPLY = 530
+WMGFCLOSE = 531
+WMTXCLOSE = 532
+MODECHANGE = 533
+PIECECHANGE = 536
diff --git a/Lib/irix6/ERRNO.py b/Lib/irix6/ERRNO.py
new file mode 100644
index 0000000..d975ce6
--- /dev/null
+++ b/Lib/irix6/ERRNO.py
@@ -0,0 +1,163 @@
+# Generated by h2py from /usr/include/sys/errno.h
+
+# Included from standards.h
+__KBASE = 1000
+__IRIXBASE = 1000
+EPERM = 1
+ENOENT = 2
+ESRCH = 3
+EINTR = 4
+EIO = 5
+ENXIO = 6
+E2BIG = 7
+ENOEXEC = 8
+EBADF = 9
+ECHILD = 10
+EAGAIN = 11
+ENOMEM = 12
+EACCES = 13
+EFAULT = 14
+ENOTBLK = 15
+EBUSY = 16
+EEXIST = 17
+EXDEV = 18
+ENODEV = 19
+ENOTDIR = 20
+EISDIR = 21
+EINVAL = 22
+ENFILE = 23
+EMFILE = 24
+ENOTTY = 25
+ETXTBSY = 26
+EFBIG = 27
+ENOSPC = 28
+ESPIPE = 29
+EROFS = 30
+EMLINK = 31
+EPIPE = 32
+EDOM = 33
+ERANGE = 34
+ENOMSG = 35
+EIDRM = 36
+ECHRNG = 37
+EL2NSYNC = 38
+EL3HLT = 39
+EL3RST = 40
+ELNRNG = 41
+EUNATCH = 42
+ENOCSI = 43
+EL2HLT = 44
+EDEADLK = 45
+ENOLCK = 46
+EBADE = 50
+EBADR = 51
+EXFULL = 52
+ENOANO = 53
+EBADRQC = 54
+EBADSLT = 55
+EDEADLOCK = 56
+EBFONT = 57
+ENOSTR = 60
+ENODATA = 61
+ETIME = 62
+ENOSR = 63
+ENONET = 64
+ENOPKG = 65
+EREMOTE = 66
+ENOLINK = 67
+EADV = 68
+ESRMNT = 69
+ECOMM = 70
+EPROTO = 71
+EMULTIHOP = 74
+EBADMSG = 77
+ENAMETOOLONG = 78
+EOVERFLOW = 79
+ENOTUNIQ = 80
+EBADFD = 81
+EREMCHG = 82
+ELIBACC = 83
+ELIBBAD = 84
+ELIBSCN = 85
+ELIBMAX = 86
+ELIBEXEC = 87
+EILSEQ = 88
+ENOSYS = 89
+ELOOP = 90
+ERESTART = 91
+ESTRPIPE = 92
+ENOTEMPTY = 93
+EUSERS = 94
+ENOTSOCK = 95
+EDESTADDRREQ = 96
+EMSGSIZE = 97
+EPROTOTYPE = 98
+ENOPROTOOPT = 99
+EPROTONOSUPPORT = 120
+ESOCKTNOSUPPORT = 121
+EOPNOTSUPP = 122
+EPFNOSUPPORT = 123
+EAFNOSUPPORT = 124
+EADDRINUSE = 125
+EADDRNOTAVAIL = 126
+ENETDOWN = 127
+ENETUNREACH = 128
+ENETRESET = 129
+ECONNABORTED = 130
+ECONNRESET = 131
+ENOBUFS = 132
+EISCONN = 133
+ENOTCONN = 134
+ESHUTDOWN = 143
+ETOOMANYREFS = 144
+ETIMEDOUT = 145
+ECONNREFUSED = 146
+EHOSTDOWN = 147
+EHOSTUNREACH = 148
+LASTERRNO = ENOTCONN
+EWOULDBLOCK = __KBASE+101
+EWOULDBLOCK = EAGAIN
+EALREADY = 149
+EINPROGRESS = 150
+ESTALE = 151
+EIORESID = 500
+EUCLEAN = 135
+ENOTNAM = 137
+ENAVAIL = 138
+EISNAM = 139
+EREMOTEIO = 140
+EINIT = 141
+EREMDEV = 142
+ECANCELED = 158
+ENOLIMFILE = 1001
+EPROCLIM = 1002
+EDISJOINT = 1003
+ENOLOGIN = 1004
+ELOGINLIM = 1005
+EGROUPLOOP = 1006
+ENOATTACH = 1007
+ENOTSUP = 1008
+ENOATTR = 1009
+EDIRCORRUPTED = 1010
+EDQUOT = 1133
+ENFSREMOTE = 1135
+ECONTROLLER = 1300
+ENOTCONTROLLER = 1301
+EENQUEUED = 1302
+ENOTENQUEUED = 1303
+EJOINED = 1304
+ENOTJOINED = 1305
+ENOPROC = 1306
+EMUSTRUN = 1307
+ENOTSTOPPED = 1308
+ECLOCKCPU = 1309
+EINVALSTATE = 1310
+ENOEXIST = 1311
+EENDOFMINOR = 1312
+EBUFSIZE = 1313
+EEMPTY = 1314
+ENOINTRGROUP = 1315
+EINVALMODE = 1316
+ECANTEXTENT = 1317
+EINVALTIME = 1318
+EDESTROYED = 1319
diff --git a/Lib/irix6/FCNTL.py b/Lib/irix6/FCNTL.py
new file mode 100644
index 0000000..ceb1071
--- /dev/null
+++ b/Lib/irix6/FCNTL.py
@@ -0,0 +1,114 @@
+# Generated by h2py from /usr/include/sys/fcntl.h
+
+# Included from standards.h
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+FNDELAY = 0x04
+FAPPEND = 0x08
+FSYNC = 0x10
+FDSYNC = 0x20
+FRSYNC = 0x40
+FNONBLOCK = 0x80
+FASYNC = 0x1000
+FLARGEFILE = 0x2000
+FNONBLK = FNONBLOCK
+FDIRECT = 0x8000
+FDIRENT64 = 0x8000
+FCREAT = 0x0100
+FTRUNC = 0x0200
+FEXCL = 0x0400
+FNOCTTY = 0x0800
+O_RDONLY = 0
+O_WRONLY = 1
+O_RDWR = 2
+O_NDELAY = 0x04
+O_APPEND = 0x08
+O_SYNC = 0x10
+O_DSYNC = 0x20
+O_RSYNC = 0x40
+O_NONBLOCK = 0x80
+O_LARGEFILE = 0x2000
+O_DIRECT = 0x8000
+O_CREAT = 0x100
+O_TRUNC = 0x200
+O_EXCL = 0x400
+O_NOCTTY = 0x800
+F_DUPFD = 0
+F_GETFD = 1
+F_SETFD = 2
+F_GETFL = 3
+F_SETFL = 4
+F_GETLK = 14
+F_SETLK = 6
+F_SETLKW = 7
+F_CHKFL = 8
+F_ALLOCSP = 10
+F_FREESP = 11
+F_SETBSDLK = 12
+F_SETBSDLKW = 13
+F_DIOINFO = 30
+F_FSGETXATTR = 31
+F_FSSETXATTR = 32
+F_GETLK64 = 33
+F_SETLK64 = 34
+F_SETLKW64 = 35
+F_ALLOCSP64 = 36
+F_FREESP64 = 37
+F_GETBMAP = 38
+F_FSSETDM = 39
+F_RESVSP = 40
+F_UNRESVSP = 41
+F_RESVSP64 = 42
+F_UNRESVSP64 = 43
+F_GETBMAPA = 44
+F_FSGETXATTRA = 45
+F_GETALLLK = 46
+F_RSETLK = 20
+F_RGETLK = 21
+F_RSETLKW = 22
+F_GETOWN = 23
+F_SETOWN = 24
+F_RDLCK = 01
+F_WRLCK = 02
+F_UNLCK = 03
+O_ACCMODE = 3
+FD_CLOEXEC = 1
+FD_NODUP_FORK = 4
diff --git a/Lib/irix6/FILE.py b/Lib/irix6/FILE.py
new file mode 100644
index 0000000..e3393b6
--- /dev/null
+++ b/Lib/irix6/FILE.py
@@ -0,0 +1,236 @@
+# Generated by h2py from /usr/include/sys/file.h
+
+# Included from standards.h
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+
+# Included from sys/sema.h
+MUTEX_DEFAULT = 0x0
+METER_NAMSZ = 8
+def mutex_spinlock(l): return splhi()
+
+def mutex_spintrylock(l): return splhi()
+
+def spinlock_islocked(l): return issplhi(getsr())
+
+def spinlock_initialized(l): return 1
+
+SV_FIFO = 0x0
+SV_LIFO = 0x2
+SV_PRIO = 0x4
+SV_DEFAULT = SV_FIFO
+SEMA_NOHIST = 0x0001
+SEMA_LOCK = 0x0004
+SEMA_METER = 0x0008
+SEMA_NAMSZ = METER_NAMSZ
+MR_ACCESS = 0x1
+MR_UPDATE = 0x2
+def mp_mutex_unlock(m): return mutex_unlock(m)
+
+def mp_mutex_trylock(m): return mutex_trylock(m)
+
+def mp_mutex_spinlock(m): return mutex_spinlock(m)
+
+def mp_mutex_trylock(m): return 1
+
+def mp_mutex_spinlock(m): return 1
+
+def nested_spintrylock(m): return 1
+
+def mp_mrunlock(a): return mrunlock(a)
+
+def mp_cpsema(x): return cpsema(x)
+
+def mp_cvsema(x): return cvsema(x)
+
+def mp_cpsema(x): return 1
+
+def mp_cvsema(x): return 0
+
+MON_LOCKED = 0x01
+MON_WAITING = 0x02
+MON_TIMEOUT = 0x04
+def initlock(l): return spinlock_init(l,0)
+
+def ownlock(x): return 1
+
+def splock(x): return 1
+
+def io_splock(x): return 1
+
+def mutex_enter(m): return mutex_lock(m, PZERO)
+
+def mutex_tryenter(m): return mutex_trylock(m)
+
+def mutex_exit(m): return mutex_unlock(m)
+
+def cv_signal(cv): return sv_signal(cv)
+
+def cv_broadcast(cv): return sv_broadcast(cv)
+
+def cv_destroy(cv): return sv_destroy(cv)
+
+RW_READER = MR_ACCESS
+RW_WRITER = MR_UPDATE
+def rw_exit(r): return mrunlock(r)
+
+def rw_tryupgrade(r): return cmrpromote(r)
+
+def rw_downgrade(r): return mrdemote(r)
+
+def rw_destroy(r): return mrfree(r)
+
+def RW_WRITE_HELD(r): return ismrlocked(r, MR_UPDATE)
+
+def RW_READ_HELD(r): return ismrlocked(r, MR_ACCESS)
+
+
+# Included from sys/fcntl.h
+FNDELAY = 0x04
+FAPPEND = 0x08
+FSYNC = 0x10
+FDSYNC = 0x20
+FRSYNC = 0x40
+FNONBLOCK = 0x80
+FASYNC = 0x1000
+FLARGEFILE = 0x2000
+FNONBLK = FNONBLOCK
+FDIRECT = 0x8000
+FDIRENT64 = 0x8000
+FCREAT = 0x0100
+FTRUNC = 0x0200
+FEXCL = 0x0400
+FNOCTTY = 0x0800
+O_RDONLY = 0
+O_WRONLY = 1
+O_RDWR = 2
+O_NDELAY = 0x04
+O_APPEND = 0x08
+O_SYNC = 0x10
+O_DSYNC = 0x20
+O_RSYNC = 0x40
+O_NONBLOCK = 0x80
+O_LARGEFILE = 0x2000
+O_DIRECT = 0x8000
+O_CREAT = 0x100
+O_TRUNC = 0x200
+O_EXCL = 0x400
+O_NOCTTY = 0x800
+F_DUPFD = 0
+F_GETFD = 1
+F_SETFD = 2
+F_GETFL = 3
+F_SETFL = 4
+F_GETLK = 14
+F_SETLK = 6
+F_SETLKW = 7
+F_CHKFL = 8
+F_ALLOCSP = 10
+F_FREESP = 11
+F_SETBSDLK = 12
+F_SETBSDLKW = 13
+F_DIOINFO = 30
+F_FSGETXATTR = 31
+F_FSSETXATTR = 32
+F_GETLK64 = 33
+F_SETLK64 = 34
+F_SETLKW64 = 35
+F_ALLOCSP64 = 36
+F_FREESP64 = 37
+F_GETBMAP = 38
+F_FSSETDM = 39
+F_RESVSP = 40
+F_UNRESVSP = 41
+F_RESVSP64 = 42
+F_UNRESVSP64 = 43
+F_GETBMAPA = 44
+F_FSGETXATTRA = 45
+F_GETALLLK = 46
+F_RSETLK = 20
+F_RGETLK = 21
+F_RSETLKW = 22
+F_GETOWN = 23
+F_SETOWN = 24
+F_RDLCK = 01
+F_WRLCK = 02
+F_UNLCK = 03
+O_ACCMODE = 3
+FD_CLOEXEC = 1
+FD_NODUP_FORK = 4
+FMASK = 0x90FF
+FOPEN = 0xFFFFFFFF
+FREAD = 0x01
+FWRITE = 0x02
+FNDELAY = 0x04
+FAPPEND = 0x08
+FSYNC = 0x10
+FDSYNC = 0x20
+FRSYNC = 0x40
+FNONBLOCK = 0x80
+FASYNC = 0x1000
+FNONBLK = FNONBLOCK
+FLARGEFILE = 0x2000
+FDIRECT = 0x8000
+FCREAT = 0x0100
+FTRUNC = 0x0200
+FEXCL = 0x0400
+FNOCTTY = 0x0800
+FMARK = 0x4000
+FDEFER = 0x2000
+FINPROGRESS = 0x0400
+FINVIS = 0x0100
+FNMFS = 0x2000
+FDIRENT64 = 0x8000
+FCLOSEXEC = 001
+FDSHD = 0x0001
+FDNOMARK = 0x0002
+FDIGNPROGRESS = 0x0004
+LOCK_SH = 1
+LOCK_EX = 2
+LOCK_NB = 4
+LOCK_UN = 8
+F_OK = 0
+X_OK = 1
+W_OK = 2
+R_OK = 4
+L_SET = 0
+L_INCR = 1
+L_XTND = 2
diff --git a/Lib/irix6/FL.py b/Lib/irix6/FL.py
new file mode 100644
index 0000000..f85237b
--- /dev/null
+++ b/Lib/irix6/FL.py
@@ -0,0 +1,289 @@
+# Constants used by the FORMS library (module fl).
+# This corresponds to "forms.h".
+# Recommended use: import FL; ... FL.NORMAL_BOX ... etc.
+# Alternate use: from FL import *; ... NORMAL_BOX ... etc.
+
+_v20 = 1
+_v21 = 1
+##import fl
+##try:
+## _v20 = (fl.get_rgbmode <> None)
+##except:
+## _v20 = 0
+##del fl
+
+NULL = 0
+FALSE = 0
+TRUE = 1
+
+EVENT = -1
+
+LABEL_SIZE = 64
+if _v20:
+ SHORTCUT_SIZE = 32
+PLACE_FREE = 0
+PLACE_SIZE = 1
+PLACE_ASPECT = 2
+PLACE_MOUSE = 3
+PLACE_CENTER = 4
+PLACE_POSITION = 5
+FL_PLACE_FULLSCREEN = 6
+FIND_INPUT = 0
+FIND_AUTOMATIC = 1
+FIND_MOUSE = 2
+BEGIN_GROUP = 10000
+END_GROUP = 20000
+ALIGN_TOP = 0
+ALIGN_BOTTOM = 1
+ALIGN_LEFT = 2
+ALIGN_RIGHT = 3
+ALIGN_CENTER = 4
+NO_BOX = 0
+UP_BOX = 1
+DOWN_BOX = 2
+FLAT_BOX = 3
+BORDER_BOX = 4
+SHADOW_BOX = 5
+FRAME_BOX = 6
+ROUNDED_BOX = 7
+RFLAT_BOX = 8
+RSHADOW_BOX = 9
+TOP_BOUND_COL = 51
+LEFT_BOUND_COL = 55
+BOT_BOUND_COL = 40
+RIGHT_BOUND_COL = 35
+COL1 = 47
+MCOL = 49
+LCOL = 0
+BOUND_WIDTH = 3.0
+DRAW = 0
+PUSH = 1
+RELEASE = 2
+ENTER = 3
+LEAVE = 4
+MOUSE = 5
+FOCUS = 6
+UNFOCUS = 7
+KEYBOARD = 8
+STEP = 9
+MOVE = 10
+FONT_NAME = 'Helvetica'
+FONT_BOLDNAME = 'Helvetica-Bold'
+FONT_ITALICNAME = 'Helvetica-Oblique'
+FONT_FIXEDNAME = 'Courier'
+FONT_ICONNAME = 'Icon'
+SMALL_FONT = 8.0
+NORMAL_FONT = 11.0
+LARGE_FONT = 20.0
+NORMAL_STYLE = 0
+BOLD_STYLE = 1
+ITALIC_STYLE = 2
+FIXED_STYLE = 3
+ENGRAVED_STYLE = 4
+ICON_STYLE = 5
+BITMAP = 3
+NORMAL_BITMAP = 0
+BITMAP_BOXTYPE = NO_BOX
+BITMAP_COL1 = 0
+BITMAP_COL2 = COL1
+BITMAP_LCOL = LCOL
+BITMAP_ALIGN = ALIGN_BOTTOM
+BITMAP_MAXSIZE = 128*128
+BITMAP_BW = BOUND_WIDTH
+BOX = 1
+BOX_BOXTYPE = UP_BOX
+BOX_COL1 = COL1
+BOX_LCOL = LCOL
+BOX_ALIGN = ALIGN_CENTER
+BOX_BW = BOUND_WIDTH
+BROWSER = 71
+NORMAL_BROWSER = 0
+SELECT_BROWSER = 1
+HOLD_BROWSER = 2
+MULTI_BROWSER = 3
+BROWSER_BOXTYPE = DOWN_BOX
+BROWSER_COL1 = COL1
+BROWSER_COL2 = 3
+BROWSER_LCOL = LCOL
+BROWSER_ALIGN = ALIGN_BOTTOM
+BROWSER_SLCOL = COL1
+BROWSER_BW = BOUND_WIDTH
+BROWSER_LINELENGTH = 128
+BROWSER_MAXLINE = 512
+BUTTON = 11
+NORMAL_BUTTON = 0
+PUSH_BUTTON = 1
+RADIO_BUTTON = 2
+HIDDEN_BUTTON = 3
+TOUCH_BUTTON = 4
+INOUT_BUTTON = 5
+RETURN_BUTTON = 6
+if _v20:
+ HIDDEN_RET_BUTTON = 7
+BUTTON_BOXTYPE = UP_BOX
+BUTTON_COL1 = COL1
+BUTTON_COL2 = COL1
+BUTTON_LCOL = LCOL
+BUTTON_ALIGN = ALIGN_CENTER
+BUTTON_MCOL1 = MCOL
+BUTTON_MCOL2 = MCOL
+BUTTON_BW = BOUND_WIDTH
+if _v20:
+ CHART = 4
+ BAR_CHART = 0
+ HORBAR_CHART = 1
+ LINE_CHART = 2
+ FILLED_CHART = 3
+ SPIKE_CHART = 4
+ PIE_CHART = 5
+ SPECIALPIE_CHART = 6
+ CHART_BOXTYPE = BORDER_BOX
+ CHART_COL1 = COL1
+ CHART_LCOL = LCOL
+ CHART_ALIGN = ALIGN_BOTTOM
+ CHART_BW = BOUND_WIDTH
+ CHART_MAX = 128
+CHOICE = 42
+NORMAL_CHOICE = 0
+CHOICE_BOXTYPE = DOWN_BOX
+CHOICE_COL1 = COL1
+CHOICE_COL2 = LCOL
+CHOICE_LCOL = LCOL
+CHOICE_ALIGN = ALIGN_LEFT
+CHOICE_BW = BOUND_WIDTH
+CHOICE_MCOL = MCOL
+CHOICE_MAXITEMS = 128
+CHOICE_MAXSTR = 64
+CLOCK = 61
+SQUARE_CLOCK = 0
+ROUND_CLOCK = 1
+CLOCK_BOXTYPE = UP_BOX
+CLOCK_COL1 = 37
+CLOCK_COL2 = 42
+CLOCK_LCOL = LCOL
+CLOCK_ALIGN = ALIGN_BOTTOM
+CLOCK_TOPCOL = COL1
+CLOCK_BW = BOUND_WIDTH
+COUNTER = 25
+NORMAL_COUNTER = 0
+SIMPLE_COUNTER = 1
+COUNTER_BOXTYPE = UP_BOX
+COUNTER_COL1 = COL1
+COUNTER_COL2 = 4
+COUNTER_LCOL = LCOL
+COUNTER_ALIGN = ALIGN_BOTTOM
+if _v20:
+ COUNTER_BW = BOUND_WIDTH
+else:
+ DEFAULT = 51
+ RETURN_DEFAULT = 0
+ ALWAYS_DEFAULT = 1
+DIAL = 22
+NORMAL_DIAL = 0
+LINE_DIAL = 1
+DIAL_BOXTYPE = NO_BOX
+DIAL_COL1 = COL1
+DIAL_COL2 = 37
+DIAL_LCOL = LCOL
+DIAL_ALIGN = ALIGN_BOTTOM
+DIAL_TOPCOL = COL1
+DIAL_BW = BOUND_WIDTH
+FREE = 101
+NORMAL_FREE = 1
+SLEEPING_FREE = 2
+INPUT_FREE = 3
+CONTINUOUS_FREE = 4
+ALL_FREE = 5
+INPUT = 31
+NORMAL_INPUT = 0
+if _v20:
+ FLOAT_INPUT = 1
+ INT_INPUT = 2
+ HIDDEN_INPUT = 3
+ if _v21:
+ MULTILINE_INPUT = 4
+ SECRET_INPUT = 5
+else:
+ ALWAYS_INPUT = 1
+INPUT_BOXTYPE = DOWN_BOX
+INPUT_COL1 = 13
+INPUT_COL2 = 5
+INPUT_LCOL = LCOL
+INPUT_ALIGN = ALIGN_LEFT
+INPUT_TCOL = LCOL
+INPUT_CCOL = 4
+INPUT_BW = BOUND_WIDTH
+INPUT_MAX = 128
+LIGHTBUTTON = 12
+LIGHTBUTTON_BOXTYPE = UP_BOX
+LIGHTBUTTON_COL1 = 39
+LIGHTBUTTON_COL2 = 3
+LIGHTBUTTON_LCOL = LCOL
+LIGHTBUTTON_ALIGN = ALIGN_CENTER
+LIGHTBUTTON_TOPCOL = COL1
+LIGHTBUTTON_MCOL = MCOL
+LIGHTBUTTON_BW1 = BOUND_WIDTH
+LIGHTBUTTON_BW2 = BOUND_WIDTH/2.0
+LIGHTBUTTON_MINSIZE = 12.0
+MENU = 41
+TOUCH_MENU = 0
+PUSH_MENU = 1
+MENU_BOXTYPE = BORDER_BOX
+MENU_COL1 = 55
+MENU_COL2 = 37
+MENU_LCOL = LCOL
+MENU_ALIGN = ALIGN_CENTER
+MENU_BW = BOUND_WIDTH
+MENU_MAX = 300
+POSITIONER = 23
+NORMAL_POSITIONER = 0
+POSITIONER_BOXTYPE = DOWN_BOX
+POSITIONER_COL1 = COL1
+POSITIONER_COL2 = 1
+POSITIONER_LCOL = LCOL
+POSITIONER_ALIGN = ALIGN_BOTTOM
+POSITIONER_BW = BOUND_WIDTH
+ROUNDBUTTON = 13
+ROUNDBUTTON_BOXTYPE = NO_BOX
+ROUNDBUTTON_COL1 = 7
+ROUNDBUTTON_COL2 = 3
+ROUNDBUTTON_LCOL = LCOL
+ROUNDBUTTON_ALIGN = ALIGN_CENTER
+ROUNDBUTTON_TOPCOL = COL1
+ROUNDBUTTON_MCOL = MCOL
+ROUNDBUTTON_BW = BOUND_WIDTH
+SLIDER = 21
+VALSLIDER = 24
+VERT_SLIDER = 0
+HOR_SLIDER = 1
+VERT_FILL_SLIDER = 2
+HOR_FILL_SLIDER = 3
+VERT_NICE_SLIDER = 4
+HOR_NICE_SLIDER = 5
+SLIDER_BOXTYPE = DOWN_BOX
+SLIDER_COL1 = COL1
+SLIDER_COL2 = COL1
+SLIDER_LCOL = LCOL
+SLIDER_ALIGN = ALIGN_BOTTOM
+SLIDER_BW1 = BOUND_WIDTH
+SLIDER_BW2 = BOUND_WIDTH*0.75
+SLIDER_FINE = 0.05
+SLIDER_WIDTH = 0.08
+TEXT = 2
+NORMAL_TEXT = 0
+TEXT_BOXTYPE = NO_BOX
+TEXT_COL1 = COL1
+TEXT_LCOL = LCOL
+TEXT_ALIGN = ALIGN_LEFT
+TEXT_BW = BOUND_WIDTH
+TIMER = 62
+NORMAL_TIMER = 0
+VALUE_TIMER = 1
+HIDDEN_TIMER = 2
+TIMER_BOXTYPE = DOWN_BOX
+TIMER_COL1 = COL1
+TIMER_COL2 = 1
+TIMER_LCOL = LCOL
+TIMER_ALIGN = ALIGN_CENTER
+TIMER_BW = BOUND_WIDTH
+TIMER_BLINKRATE = 0.2
diff --git a/Lib/irix6/GET.py b/Lib/irix6/GET.py
new file mode 100644
index 0000000..9c3d7d6
--- /dev/null
+++ b/Lib/irix6/GET.py
@@ -0,0 +1,59 @@
+# Symbols from <gl/get.h>
+
+BCKBUFFER = 0x1
+FRNTBUFFER = 0x2
+DRAWZBUFFER = 0x4
+DMRGB = 0
+DMSINGLE = 1
+DMDOUBLE = 2
+DMRGBDOUBLE = 5
+HZ30 = 0
+HZ60 = 1
+NTSC = 2
+HDTV = 3
+VGA = 4
+IRIS3K = 5
+PR60 = 6
+PAL = 9
+HZ30_SG = 11
+A343 = 14
+STR_RECT = 15
+VOF0 = 16
+VOF1 = 17
+VOF2 = 18
+VOF3 = 19
+SGI0 = 20
+SGI1 = 21
+SGI2 = 22
+HZ72 = 23
+GL_VIDEO_REG = 0x00800000
+GLV_GENLOCK = 0x00000001
+GLV_UNBLANK = 0x00000002
+GLV_SRED = 0x00000004
+GLV_SGREEN = 0x00000008
+GLV_SBLUE = 0x00000010
+GLV_SALPHA = 0x00000020
+GLV_TTLGENLOCK = 0x00000080
+GLV_TTLSYNC = GLV_TTLGENLOCK
+GLV_GREENGENLOCK = 0x0000100
+LEFTPLANE = 0x0001
+RIGHTPLANE = 0x0002
+BOTTOMPLANE = 0x0004
+TOPPLANE = 0x0008
+NEARPLANE = 0x0010
+FARPLANE = 0x0020
+## GETDEF = __GL_GET_H__
+NOBUFFER = 0x0
+BOTHBUFFERS = 0x3
+DMINTENSITYSINGLE = 3
+DMINTENSITYDOUBLE = 4
+MONSPECIAL = 0x20
+HZ50 = 3
+MONA = 5
+MONB = 6
+MONC = 7
+MOND = 8
+MON_ALL = 12
+MON_GEN_ALL = 13
+CMAPMULTI = 0
+CMAPONE = 1
diff --git a/Lib/irix6/GL.py b/Lib/irix6/GL.py
new file mode 100644
index 0000000..9f02f65
--- /dev/null
+++ b/Lib/irix6/GL.py
@@ -0,0 +1,393 @@
+NULL = 0
+FALSE = 0
+TRUE = 1
+ATTRIBSTACKDEPTH = 10
+VPSTACKDEPTH = 8
+MATRIXSTACKDEPTH = 32
+NAMESTACKDEPTH = 1025
+STARTTAG = -2
+ENDTAG = -3
+BLACK = 0
+RED = 1
+GREEN = 2
+YELLOW = 3
+BLUE = 4
+MAGENTA = 5
+CYAN = 6
+WHITE = 7
+PUP_CLEAR = 0
+PUP_COLOR = 1
+PUP_BLACK = 2
+PUP_WHITE = 3
+NORMALDRAW = 0x010
+PUPDRAW = 0x020
+OVERDRAW = 0x040
+UNDERDRAW = 0x080
+CURSORDRAW = 0x100
+DUALDRAW = 0x200
+PATTERN_16 = 16
+PATTERN_32 = 32
+PATTERN_64 = 64
+PATTERN_16_SIZE = 16
+PATTERN_32_SIZE = 64
+PATTERN_64_SIZE = 256
+SRC_AUTO = 0
+SRC_FRONT = 1
+SRC_BACK = 2
+SRC_ZBUFFER = 3
+SRC_PUP = 4
+SRC_OVER = 5
+SRC_UNDER = 6
+SRC_FRAMEGRABBER = 7
+BF_ZERO = 0
+BF_ONE = 1
+BF_DC = 2
+BF_SC = 2
+BF_MDC = 3
+BF_MSC = 3
+BF_SA = 4
+BF_MSA = 5
+BF_DA = 6
+BF_MDA = 7
+BF_MIN_SA_MDA = 8
+AF_NEVER = 0
+AF_LESS = 1
+AF_EQUAL = 2
+AF_LEQUAL = 3
+AF_GREATER = 4
+AF_NOTEQUAL = 5
+AF_GEQUAL = 6
+AF_ALWAYS = 7
+ZF_NEVER = 0
+ZF_LESS = 1
+ZF_EQUAL = 2
+ZF_LEQUAL = 3
+ZF_GREATER = 4
+ZF_NOTEQUAL = 5
+ZF_GEQUAL = 6
+ZF_ALWAYS = 7
+ZSRC_DEPTH = 0
+ZSRC_COLOR = 1
+SMP_OFF = 0x0
+SMP_ON = 0x1
+SMP_SMOOTHER = 0x2
+SML_OFF = 0x0
+SML_ON = 0x1
+SML_SMOOTHER = 0x2
+SML_END_CORRECT = 0x4
+PYSM_OFF = 0
+PYSM_ON = 1
+PYSM_SHRINK = 2
+DT_OFF = 0
+DT_ON = 1
+PUP_NONE = 0
+PUP_GREY = 0x1
+PUP_BOX = 0x2
+PUP_CHECK = 0x4
+GLC_OLDPOLYGON = 0
+GLC_ZRANGEMAP = 1
+GLC_MQUEUERATE = 2
+GLC_SOFTATTACH = 3
+GLC_MANAGEBG = 4
+GLC_SLOWMAPCOLORS = 5
+GLC_INPUTCHANGEBUG = 6
+GLC_NOBORDERBUG = 7
+GLC_SET_VSYNC = 8
+GLC_GET_VSYNC = 9
+GLC_VSYNC_SLEEP = 10
+GLC_COMPATRATE = 15
+C16X1 = 0
+C16X2 = 1
+C32X1 = 2
+C32X2 = 3
+CCROSS = 4
+FLAT = 0
+GOURAUD = 1
+LO_ZERO = 0x0
+LO_AND = 0x1
+LO_ANDR = 0x2
+LO_SRC = 0x3
+LO_ANDI = 0x4
+LO_DST = 0x5
+LO_XOR = 0x6
+LO_OR = 0x7
+LO_NOR = 0x8
+LO_XNOR = 0x9
+LO_NDST = 0xa
+LO_ORR = 0xb
+LO_NSRC = 0xc
+LO_ORI = 0xd
+LO_NAND = 0xe
+LO_ONE = 0xf
+INFOCUSSCRN = -2
+ST_KEEP = 0
+ST_ZERO = 1
+ST_REPLACE = 2
+ST_INCR = 3
+ST_DECR = 4
+ST_INVERT = 5
+SF_NEVER = 0
+SF_LESS = 1
+SF_EQUAL = 2
+SF_LEQUAL = 3
+SF_GREATER = 4
+SF_NOTEQUAL = 5
+SF_GEQUAL = 6
+SF_ALWAYS = 7
+SS_OFF = 0
+SS_DEPTH = 1
+PYM_FILL = 1
+PYM_POINT = 2
+PYM_LINE = 3
+PYM_HOLLOW = 4
+PYM_LINE_FAST = 5
+FG_OFF = 0
+FG_ON = 1
+FG_DEFINE = 2
+FG_VTX_EXP = 2
+FG_VTX_LIN = 3
+FG_PIX_EXP = 4
+FG_PIX_LIN = 5
+FG_VTX_EXP2 = 6
+FG_PIX_EXP2 = 7
+PM_SHIFT = 0
+PM_EXPAND = 1
+PM_C0 = 2
+PM_C1 = 3
+PM_ADD24 = 4
+PM_SIZE = 5
+PM_OFFSET = 6
+PM_STRIDE = 7
+PM_TTOB = 8
+PM_RTOL = 9
+PM_ZDATA = 10
+PM_WARP = 11
+PM_RDX = 12
+PM_RDY = 13
+PM_CDX = 14
+PM_CDY = 15
+PM_XSTART = 16
+PM_YSTART = 17
+PM_VO1 = 1000
+NAUTO = 0
+NNORMALIZE = 1
+AC_CLEAR = 0
+AC_ACCUMULATE = 1
+AC_CLEAR_ACCUMULATE = 2
+AC_RETURN = 3
+AC_MULT = 4
+AC_ADD = 5
+CP_OFF = 0
+CP_ON = 1
+CP_DEFINE = 2
+SB_RESET = 0
+SB_TRACK = 1
+SB_HOLD = 2
+RD_FREEZE = 0x00000001
+RD_ALPHAONE = 0x00000002
+RD_IGNORE_UNDERLAY = 0x00000004
+RD_IGNORE_OVERLAY = 0x00000008
+RD_IGNORE_PUP = 0x00000010
+RD_OFFSCREEN = 0x00000020
+GD_XPMAX = 0
+GD_YPMAX = 1
+GD_XMMAX = 2
+GD_YMMAX = 3
+GD_ZMIN = 4
+GD_ZMAX = 5
+GD_BITS_NORM_SNG_RED = 6
+GD_BITS_NORM_SNG_GREEN = 7
+GD_BITS_NORM_SNG_BLUE = 8
+GD_BITS_NORM_DBL_RED = 9
+GD_BITS_NORM_DBL_GREEN = 10
+GD_BITS_NORM_DBL_BLUE = 11
+GD_BITS_NORM_SNG_CMODE = 12
+GD_BITS_NORM_DBL_CMODE = 13
+GD_BITS_NORM_SNG_MMAP = 14
+GD_BITS_NORM_DBL_MMAP = 15
+GD_BITS_NORM_ZBUFFER = 16
+GD_BITS_OVER_SNG_CMODE = 17
+GD_BITS_UNDR_SNG_CMODE = 18
+GD_BITS_PUP_SNG_CMODE = 19
+GD_BITS_NORM_SNG_ALPHA = 21
+GD_BITS_NORM_DBL_ALPHA = 22
+GD_BITS_CURSOR = 23
+GD_OVERUNDER_SHARED = 24
+GD_BLEND = 25
+GD_CIFRACT = 26
+GD_CROSSHAIR_CINDEX = 27
+GD_DITHER = 28
+GD_LINESMOOTH_CMODE = 30
+GD_LINESMOOTH_RGB = 31
+GD_LOGICOP = 33
+GD_NSCRNS = 35
+GD_NURBS_ORDER = 36
+GD_NBLINKS = 37
+GD_NVERTEX_POLY = 39
+GD_PATSIZE_64 = 40
+GD_PNTSMOOTH_CMODE = 41
+GD_PNTSMOOTH_RGB = 42
+GD_PUP_TO_OVERUNDER = 43
+GD_READSOURCE = 44
+GD_READSOURCE_ZBUFFER = 48
+GD_STEREO = 50
+GD_SUBPIXEL_LINE = 51
+GD_SUBPIXEL_PNT = 52
+GD_SUBPIXEL_POLY = 53
+GD_TRIMCURVE_ORDER = 54
+GD_WSYS = 55
+GD_ZDRAW_GEOM = 57
+GD_ZDRAW_PIXELS = 58
+GD_SCRNTYPE = 61
+GD_TEXTPORT = 62
+GD_NMMAPS = 63
+GD_FRAMEGRABBER = 64
+GD_TIMERHZ = 66
+GD_DBBOX = 67
+GD_AFUNCTION = 68
+GD_ALPHA_OVERUNDER = 69
+GD_BITS_ACBUF = 70
+GD_BITS_ACBUF_HW = 71
+GD_BITS_STENCIL = 72
+GD_CLIPPLANES = 73
+GD_FOGVERTEX = 74
+GD_LIGHTING_TWOSIDE = 76
+GD_POLYMODE = 77
+GD_POLYSMOOTH = 78
+GD_SCRBOX = 79
+GD_TEXTURE = 80
+GD_FOGPIXEL = 81
+GD_TEXTURE_PERSP = 82
+GD_MUXPIPES = 83
+GD_NOLIMIT = -2
+GD_WSYS_NONE = 0
+GD_WSYS_4S = 1
+GD_SCRNTYPE_WM = 0
+GD_SCRNTYPE_NOWM = 1
+N_PIXEL_TOLERANCE = 1
+N_CULLING = 2
+N_DISPLAY = 3
+N_ERRORCHECKING = 4
+N_SUBDIVISIONS = 5
+N_S_STEPS = 6
+N_T_STEPS = 7
+N_TILES = 8
+N_TMP1 = 9
+N_TMP2 = 10
+N_TMP3 = 11
+N_TMP4 = 12
+N_TMP5 = 13
+N_TMP6 = 14
+N_FILL = 1.0
+N_OUTLINE_POLY = 2.0
+N_OUTLINE_PATCH = 5.0
+N_ISOLINE_S = 12.0
+N_ST = 0x8
+N_STW = 0xd
+N_XYZ = 0x4c
+N_XYZW = 0x51
+N_TEX = 0x88
+N_TEXW = 0x8d
+N_RGBA = 0xd0
+N_RGBAW = 0xd5
+N_P2D = 0x8
+N_P2DR = 0xd
+N_V3D = 0x4c
+N_V3DR = 0x51
+N_T2D = 0x88
+N_T2DR = 0x8d
+N_C4D = 0xd0
+N_C4DR = 0xd5
+LMNULL = 0.0
+MSINGLE = 0
+MPROJECTION = 1
+MVIEWING = 2
+MTEXTURE = 3
+MAXLIGHTS = 8
+MAXRESTRICTIONS = 4
+DEFMATERIAL = 0
+EMISSION = 1
+AMBIENT = 2
+DIFFUSE = 3
+SPECULAR = 4
+SHININESS = 5
+COLORINDEXES = 6
+ALPHA = 7
+DEFLIGHT = 100
+LCOLOR = 101
+POSITION = 102
+SPOTDIRECTION = 103
+SPOTLIGHT = 104
+DEFLMODEL = 200
+LOCALVIEWER = 201
+ATTENUATION = 202
+ATTENUATION2 = 203
+TWOSIDE = 204
+MATERIAL = 1000
+BACKMATERIAL = 1001
+LIGHT0 = 1100
+LIGHT1 = 1101
+LIGHT2 = 1102
+LIGHT3 = 1103
+LIGHT4 = 1104
+LIGHT5 = 1105
+LIGHT6 = 1106
+LIGHT7 = 1107
+LMODEL = 1200
+LMC_COLOR = 0
+LMC_EMISSION = 1
+LMC_AMBIENT = 2
+LMC_DIFFUSE = 3
+LMC_SPECULAR = 4
+LMC_AD = 5
+LMC_NULL = 6
+TX_MINFILTER = 0x100
+TX_MAGFILTER = 0x200
+TX_WRAP = 0x300
+TX_WRAP_S = 0x310
+TX_WRAP_T = 0x320
+TX_TILE = 0x400
+TX_BORDER = 0x500
+TX_NULL = 0x000
+TX_POINT = 0x110
+TX_BILINEAR = 0x220
+TX_MIPMAP = 0x120
+TX_MIPMAP_POINT = 0x121
+TX_MIPMAP_LINEAR = 0x122
+TX_MIPMAP_BILINEAR = 0x123
+TX_MIPMAP_TRILINEAR = 0x124
+TX_REPEAT = 0x301
+TX_CLAMP = 0x302
+TX_SELECT = 0x303
+TX_TEXTURE_0 = 0
+TV_MODULATE = 0x101
+TV_BLEND = 0x102
+TV_DECAL = 0x103
+TV_COLOR = 0x200
+TV_NULL = 0x000
+TV_ENV0 = 0
+TX_S = 0
+TX_T = 1
+TG_OFF = 0
+TG_ON = 1
+TG_CONTOUR = 2
+TG_LINEAR = 3
+TG_SPHEREMAP = 4
+TG_REFRACTMAP = 5
+DGLSINK = 0
+DGLLOCAL = 1
+DGLTSOCKET = 2
+DGL4DDN = 3
+PUP_CURSOR = PUP_COLOR
+FATAL = 1
+WARNING = 2
+ASK_CONT = 3
+ASK_RESTART = 4
+XMAXSCREEN = 1279
+YMAXSCREEN = 1023
+XMAXMEDIUM = 1023
+YMAXMEDIUM = 767
+XMAX170 = 645
+YMAX170 = 484
+XMAXPAL = 779
+YMAXPAL = 574
diff --git a/Lib/irix6/GLWS.py b/Lib/irix6/GLWS.py
new file mode 100644
index 0000000..69dab71
--- /dev/null
+++ b/Lib/irix6/GLWS.py
@@ -0,0 +1,12 @@
+NOERROR = 0
+NOCONTEXT = -1
+NODISPLAY = -2
+NOWINDOW = -3
+NOGRAPHICS = -4
+NOTTOP = -5
+NOVISUAL = -6
+BUFSIZE = -7
+BADWINDOW = -8
+ALREADYBOUND = -100
+BINDFAILED = -101
+SETFAILED = -102
diff --git a/Lib/irix6/IN.py b/Lib/irix6/IN.py
new file mode 100644
index 0000000..7340878
--- /dev/null
+++ b/Lib/irix6/IN.py
@@ -0,0 +1,133 @@
+# Generated by h2py from /usr/include/netinet/in.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+
+# Included from sys/endian.h
+LITTLE_ENDIAN = 1234
+BIG_ENDIAN = 4321
+PDP_ENDIAN = 3412
+BYTE_ORDER = BIG_ENDIAN
+BYTE_ORDER = LITTLE_ENDIAN
+def ntohl(x): return (x)
+
+def ntohs(x): return (x)
+
+def htonl(x): return (x)
+
+def htons(x): return (x)
+
+def htonl(x): return ntohl(x)
+
+def htons(x): return ntohs(x)
+
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+
+# Included from standards.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+IPPROTO_IP = 0
+IPPROTO_ICMP = 1
+IPPROTO_IGMP = 2
+IPPROTO_GGP = 3
+IPPROTO_IPIP = 4
+IPPROTO_ENCAP = IPPROTO_IPIP
+IPPROTO_ST = 5
+IPPROTO_TCP = 6
+IPPROTO_EGP = 8
+IPPROTO_PUP = 12
+IPPROTO_UDP = 17
+IPPROTO_IDP = 22
+IPPROTO_TP = 29
+IPPROTO_XTP = 36
+IPPROTO_RSVP = 46
+IPPROTO_HELLO = 63
+IPPROTO_ND = 77
+IPPROTO_EON = 80
+IPPROTO_OSPF = 89
+IPPROTO_SWIPE = 94
+IPPROTO_RAW = 255
+IPPROTO_MAX = 256
+IPPORT_RESERVED = 1024
+IPPORT_MAXPORT = 65535
+def IN_CLASSA(i): return (((__int32_t)(i) & 0x80000000) == 0)
+
+IN_CLASSA_NET = 0xff000000
+IN_CLASSA_NSHIFT = 24
+IN_CLASSA_HOST = 0x00ffffff
+IN_CLASSA_MAX = 128
+def IN_CLASSB(i): return (((__int32_t)(i) & 0xc0000000) == 0x80000000)
+
+IN_CLASSB_NET = 0xffff0000
+IN_CLASSB_NSHIFT = 16
+IN_CLASSB_HOST = 0x0000ffff
+IN_CLASSB_MAX = 65536
+def IN_CLASSC(i): return (((__int32_t)(i) & 0xe0000000) == 0xc0000000)
+
+IN_CLASSC_NET = 0xffffff00
+IN_CLASSC_NSHIFT = 8
+IN_CLASSC_HOST = 0x000000ff
+def IN_CLASSD(i): return (((__int32_t)(i) & 0xf0000000) == 0xe0000000)
+
+IN_CLASSD_NET = 0xf0000000
+IN_CLASSD_NSHIFT = 28
+IN_CLASSD_HOST = 0x0fffffff
+def IN_MULTICAST(i): return IN_CLASSD(i)
+
+def IN_EXPERIMENTAL(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
+
+def IN_BADCLASS(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
+
+INADDR_NONE = 0xffffffff
+IN_LOOPBACKNET = 127
+IP_OPTIONS = 1
+IP_HDRINCL = 2
+IP_TOS = 3
+IP_TTL = 4
+IP_RECVOPTS = 5
+IP_RECVRETOPTS = 6
+IP_RECVDSTADDR = 7
+IP_RETOPTS = 8
+IP_MULTICAST_IF = 20
+IP_MULTICAST_TTL = 21
+IP_MULTICAST_LOOP = 22
+IP_ADD_MEMBERSHIP = 23
+IP_DROP_MEMBERSHIP = 24
+IP_MULTICAST_VIF = 25
+IP_RSVP_VIF_ON = 26
+IP_RSVP_VIF_OFF = 27
+IP_RSVP_ON = 28
+IP_SENDSRCADDR = 36
+IP_DEFAULT_MULTICAST_TTL = 1
+IP_DEFAULT_MULTICAST_LOOP = 1
+IP_MAX_MEMBERSHIPS = 20
diff --git a/Lib/irix6/IOCTL.py b/Lib/irix6/IOCTL.py
new file mode 100644
index 0000000..cec3c3f
--- /dev/null
+++ b/Lib/irix6/IOCTL.py
@@ -0,0 +1,233 @@
+# These lines were mostly generated by h2py.py (see demo/scripts)
+# from <sys/ioctl.h>, <sys/termio.h> and <termios.h> on Irix 4.0.2
+# with some manual changes to cope with imperfections in h2py.py.
+# The applicability on other systems is not clear; especially non-SYSV
+# systems may have a totally different set of ioctls.
+
+IOCTYPE = 0xff00
+LIOC = (ord('l')<<8)
+LIOCGETP = (LIOC|1)
+LIOCSETP = (LIOC|2)
+LIOCGETS = (LIOC|5)
+LIOCSETS = (LIOC|6)
+DIOC = (ord('d')<<8)
+DIOCGETC = (DIOC|1)
+DIOCGETB = (DIOC|2)
+DIOCSETE = (DIOC|3)
+IOCPARM_MASK = 0x7f
+IOC_VOID = 0x20000000
+IOC_OUT = 0x40000000
+IOC_IN = 0x80000000
+IOC_INOUT = (IOC_IN|IOC_OUT)
+int = 'i'
+short = 'h'
+long = 'l'
+def sizeof(t): import struct; return struct.calcsize(t)
+def _IO(x,y): return (IOC_VOID|((x)<<8)|y)
+def _IOR(x,y,t): return (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
+def _IOW(x,y,t): return (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
+# this should be _IORW, but stdio got there first
+def _IOWR(x,y,t): return (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
+FIONREAD = _IOR(ord('f'), 127, int)
+FIONBIO = _IOW(ord('f'), 126, int)
+FIOASYNC = _IOW(ord('f'), 125, int)
+FIOSETOWN = _IOW(ord('f'), 124, int)
+FIOGETOWN = _IOR(ord('f'), 123, int)
+NCC = 8
+NCC_PAD = 7
+NCC_EXT = 16
+NCCS = (NCC+NCC_PAD+NCC_EXT)
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VEOL = 5
+VEOL2 = 6
+VMIN = VEOF
+VTIME = VEOL
+VSWTCH = 7
+VLNEXT = (NCC+NCC_PAD+0)
+VWERASE = (NCC+NCC_PAD+1)
+VRPRNT = (NCC+NCC_PAD+2)
+VFLUSHO = (NCC+NCC_PAD+3)
+VSTOP = (NCC+NCC_PAD+4)
+VSTART = (NCC+NCC_PAD+5)
+CNUL = '\0'
+CDEL = '\377'
+CESC = '\\'
+CINTR = '\177'
+CQUIT = '\34'
+CBRK = '\377'
+def CTRL(c): return ord(c) & 0x0f
+CERASE = CTRL('H')
+CKILL = CTRL('U')
+CEOF = CTRL('d')
+CEOT = CEOF
+CSTART = CTRL('q')
+CSTOP = CTRL('s')
+CSWTCH = CTRL('z')
+CSUSP = CSWTCH
+CNSWTCH = 0
+CLNEXT = CTRL('v')
+CWERASE = CTRL('w')
+CFLUSHO = CTRL('o')
+CFLUSH = CFLUSHO
+CRPRNT = CTRL('r')
+CDSUSP = CTRL('y')
+IGNBRK = 0000001
+BRKINT = 0000002
+IGNPAR = 0000004
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IBLKMD = 0020000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+BSDLY = 0020000
+BS0 = 0
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0
+FF1 = 0100000
+CBAUD = 0000017
+B0 = 0
+B50 = 0000001
+B75 = 0000002
+B110 = 0000003
+B134 = 0000004
+B150 = 0000005
+B200 = 0000006
+B300 = 0000007
+B600 = 0000010
+B1200 = 0000011
+B1800 = 0000012
+B2400 = 0000013
+B4800 = 0000014
+B9600 = 0000015
+B19200 = 0000016
+EXTA = 0000016
+B38400 = 0000017
+EXTB = 0000017
+CSIZE = 0000060
+CS5 = 0
+CS6 = 0000020
+CS7 = 0000040
+CS8 = 0000060
+CSTOPB = 0000100
+CREAD = 0000200
+PARENB = 0000400
+PARODD = 0001000
+HUPCL = 0002000
+CLOCAL = 0004000
+LOBLK = 0040000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+IIEXTEN = 0000400
+ITOSTOP = 0001000
+SSPEED = B9600
+IOCTYPE = 0xff00
+TIOC = (ord('T')<<8)
+oTCGETA = (TIOC|1)
+oTCSETA = (TIOC|2)
+oTCSETAW = (TIOC|3)
+oTCSETAF = (TIOC|4)
+TCSBRK = (TIOC|5)
+TCXONC = (TIOC|6)
+TCFLSH = (TIOC|7)
+TCGETA = (TIOC|8)
+TCSETA = (TIOC|9)
+TCSETAW = (TIOC|10)
+TCSETAF = (TIOC|11)
+TIOCFLUSH = (TIOC|12)
+TCDSET = (TIOC|32)
+TCBLKMD = (TIOC|33)
+TIOCPKT = (TIOC|112)
+TIOCPKT_DATA = 0x00
+TIOCPKT_FLUSHREAD = 0x01
+TIOCPKT_FLUSHWRITE = 0x02
+TIOCPKT_NOSTOP = 0x10
+TIOCPKT_DOSTOP = 0x20
+TIOCNOTTY = (TIOC|113)
+TIOCSTI = (TIOC|114)
+TIOCSPGRP = _IOW(ord('t'), 118, int)
+TIOCGPGRP = _IOR(ord('t'), 119, int)
+TIOCCONS = _IOW(ord('t'), 120, int)
+struct_winsize = 'hhhh'
+TIOCGWINSZ = _IOR(ord('t'), 104, struct_winsize)
+TIOCSWINSZ = _IOW(ord('t'), 103, struct_winsize)
+TFIOC = (ord('F')<<8)
+oFIONREAD = (TFIOC|127)
+LDIOC = (ord('D')<<8)
+LDOPEN = (LDIOC|0)
+LDCLOSE = (LDIOC|1)
+LDCHG = (LDIOC|2)
+LDGETT = (LDIOC|8)
+LDSETT = (LDIOC|9)
+TERM_NONE = 0
+TERM_TEC = 1
+TERM_V61 = 2
+TERM_V10 = 3
+TERM_TEX = 4
+TERM_D40 = 5
+TERM_H45 = 6
+TERM_D42 = 7
+TM_NONE = 0000
+TM_SNL = 0001
+TM_ANL = 0002
+TM_LCF = 0004
+TM_CECHO = 0010
+TM_CINVIS = 0020
+TM_SET = 0200
+LDISC0 = 0
+LDISC1 = 1
+NTTYDISC = LDISC1
+VSUSP = VSWTCH
+TCSANOW = 0
+TCSADRAIN = 1
+TCSAFLUSH = 2
+TCIFLUSH = 0
+TCOFLUSH = 1
+TCIOFLUSH = 2
+TCOOFF = 0
+TCOON = 1
+TCIOFF = 2
+TCION = 3
+TO_STOP = LOBLK
+IEXTEN = IIEXTEN
+TOSTOP = ITOSTOP
diff --git a/Lib/irix6/SOCKET.py b/Lib/irix6/SOCKET.py
new file mode 100644
index 0000000..39a8b63
--- /dev/null
+++ b/Lib/irix6/SOCKET.py
@@ -0,0 +1,152 @@
+# Generated by h2py from /usr/include/sys/socket.h
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+
+# Included from standards.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+NC_TPI_CLTS = 1
+NC_TPI_COTS = 2
+NC_TPI_COTS_ORD = 3
+NC_TPI_RAW = 4
+SOCK_DGRAM = NC_TPI_CLTS
+SOCK_STREAM = NC_TPI_COTS
+SOCK_RAW = NC_TPI_RAW
+SOCK_RDM = 5
+SOCK_SEQPACKET = 6
+SO_DEBUG = 0x0001
+SO_ACCEPTCONN = 0x0002
+SO_REUSEADDR = 0x0004
+SO_KEEPALIVE = 0x0008
+SO_DONTROUTE = 0x0010
+SO_BROADCAST = 0x0020
+SO_USELOOPBACK = 0x0040
+SO_LINGER = 0x0080
+SO_OOBINLINE = 0x0100
+SO_REUSEPORT = 0x0200
+SO_ORDREL = 0x0200
+SO_IMASOCKET = 0x0400
+SO_CHAMELEON = 0x1000
+SO_PASSIFNAME = 0x2000
+SO_SNDBUF = 0x1001
+SO_RCVBUF = 0x1002
+SO_SNDLOWAT = 0x1003
+SO_RCVLOWAT = 0x1004
+SO_SNDTIMEO = 0x1005
+SO_RCVTIMEO = 0x1006
+SO_ERROR = 0x1007
+SO_TYPE = 0x1008
+SO_PROTOTYPE = 0x1009
+SOL_SOCKET = 0xffff
+AF_UNSPEC = 0
+AF_LOCAL = 1
+AF_UNIX = AF_LOCAL
+AF_INET = 2
+AF_IMPLINK = 3
+AF_PUP = 4
+AF_CHAOS = 5
+AF_NS = 6
+AF_ISO = 7
+AF_ECMA = 8
+AF_DATAKIT = 9
+AF_CCITT = 10
+AF_SNA = 11
+AF_DECnet = 12
+AF_DLI = 13
+AF_LAT = 14
+AF_HYLINK = 15
+AF_APPLETALK = 16
+AF_ROUTE = 17
+AF_RAW = 18
+AF_LINK = 18
+pseudo_AF_XTP = 19
+AF_NIT = 17
+AF_802 = 18
+AF_OSI = 19
+AF_X25 = 20
+AF_OSINET = 21
+AF_GOSIP = 22
+AF_SDL = 23
+AF_INET6 = 24
+AF_LINK = 25
+AF_MAX = (AF_LINK+1)
+_SIN_ADDR_SIZE = 8
+_SIN_SA_DATA_SIZE = 14
+_MAX_SA_LEN = 20
+def OPTLEN(x): return ((((x) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
+
+PF_UNSPEC = AF_UNSPEC
+PF_LOCAL = AF_LOCAL
+PF_UNIX = PF_LOCAL
+PF_INET = AF_INET
+PF_IMPLINK = AF_IMPLINK
+PF_PUP = AF_PUP
+PF_CHAOS = AF_CHAOS
+PF_NS = AF_NS
+PF_ISO = AF_ISO
+PF_OSI = AF_ISO
+PF_ECMA = AF_ECMA
+PF_DATAKIT = AF_DATAKIT
+PF_CCITT = AF_CCITT
+PF_SNA = AF_SNA
+PF_DECnet = AF_DECnet
+PF_DLI = AF_DLI
+PF_LAT = AF_LAT
+PF_HYLINK = AF_HYLINK
+PF_APPLETALK = AF_APPLETALK
+PF_ROUTE = AF_ROUTE
+PF_LINK = AF_LINK
+PF_XTP = pseudo_AF_XTP
+PF_RAW = AF_RAW
+PF_NIT = AF_NIT
+PF_802 = AF_802
+PF_X25 = AF_X25
+PF_OSINET = AF_OSINET
+PF_GOSIP = AF_GOSIP
+PF_INET6 = AF_INET6
+PF_MAX = AF_MAX
+NET_RT_DUMP = 1
+NET_RT_FLAGS = 2
+NET_RT_IFLIST = 3
+IPCTL_FORWARDING = 1
+IPCTL_SENDREDIRECTS = 2
+UDPCTL_CHECKSUM = 1
+SOMAXCONN = 1000
+MSG_OOB = 0x1
+MSG_PEEK = 0x2
+MSG_DONTROUTE = 0x4
+MSG_EOR = 0x8
+MSG_TRUNC = 0x10
+MSG_CTRUNC = 0x20
+MSG_WAITALL = 0x40
+MSG_DONTWAIT = 0x80
+MSG_BTAG = 0x40
+MSG_ETAG = 0x80
+MSG_MAXIOVLEN = 16
+_ALIGNBYTES = 7
+def _ALIGN(p): return (((u_int)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
+
+SCM_RIGHTS = 0x01
diff --git a/Lib/irix6/SV.py b/Lib/irix6/SV.py
new file mode 100644
index 0000000..08fb917
--- /dev/null
+++ b/Lib/irix6/SV.py
@@ -0,0 +1,120 @@
+NTSC_XMAX = 640
+NTSC_YMAX = 480
+PAL_XMAX = 768
+PAL_YMAX = 576
+BLANKING_BUFFER_SIZE = 2
+
+MAX_SOURCES = 2
+
+# mode parameter for Bind calls
+IN_OFF = 0 # No Video
+IN_OVER = 1 # Video over graphics
+IN_UNDER = 2 # Video under graphics
+IN_REPLACE = 3 # Video replaces entire win
+
+# mode parameters for LoadMap calls. Specifies buffer, always 256 entries
+INPUT_COLORMAP = 0 # tuples of 8-bit RGB
+CHROMA_KEY_MAP = 1 # tuples of 8-bit RGB
+COLOR_SPACE_MAP = 2 # tuples of 8-bit RGB
+GAMMA_MAP = 3 # tuples of 24-bit red values
+
+# mode parameters for UseExclusive calls
+INPUT = 0
+OUTPUT = 1
+IN_OUT = 2
+
+# Format constants for the capture routines
+RGB8_FRAMES = 0 # noninterleaved 8 bit 3:2:3 RBG fields
+RGB32_FRAMES = 1 # 32-bit 8:8:8 RGB frames
+YUV411_FRAMES = 2 # interleaved, 8:2:2 YUV format
+YUV411_FRAMES_AND_BLANKING_BUFFER = 3
+
+#
+# sv.SetParam is passed variable length argument lists,
+# consisting of <name, value> pairs. The following
+# constants identify argument names.
+#
+_NAME_BASE = 1000
+SOURCE = (_NAME_BASE + 0)
+SOURCE1 = 0
+SOURCE2 = 1
+SOURCE3 = 2
+COLOR = (_NAME_BASE + 1)
+DEFAULT_COLOR = 0
+USER_COLOR = 1
+MONO = 2
+OUTPUTMODE = (_NAME_BASE + 2)
+LIVE_OUTPUT = 0
+STILL24_OUT = 1
+FREEZE = (_NAME_BASE + 3)
+DITHER = (_NAME_BASE + 4)
+OUTPUT_FILTER = (_NAME_BASE + 5)
+HUE = (_NAME_BASE + 6)
+GENLOCK = (_NAME_BASE + 7)
+GENLOCK_OFF = 0
+GENLOCK_ON = 1
+GENLOCK_HOUSE = 2
+BROADCAST = (_NAME_BASE + 8)
+NTSC = 0
+PAL = 1
+VIDEO_MODE = (_NAME_BASE + 9)
+COMP = 0
+SVIDEO = 1
+INPUT_BYPASS = (_NAME_BASE + 10)
+FIELDDROP = (_NAME_BASE + 11)
+SLAVE = (_NAME_BASE + 12)
+APERTURE_FACTOR = (_NAME_BASE + 13)
+AFACTOR_0 = 0
+AFACTOR_QTR = 1
+AFACTOR_HLF = 2
+AFACTOR_ONE = 3
+CORING = (_NAME_BASE + 14)
+COR_OFF = 0
+COR_1LSB = 1
+COR_2LSB = 2
+COR_3LSB = 3
+APERTURE_BANDPASS = (_NAME_BASE + 15)
+ABAND_F0 = 0
+ABAND_F1 = 1
+ABAND_F2 = 2
+ABAND_F3 = 3
+PREFILTER = (_NAME_BASE + 16)
+CHROMA_TRAP = (_NAME_BASE + 17)
+CK_THRESHOLD = (_NAME_BASE + 18)
+PAL_SENSITIVITY = (_NAME_BASE + 19)
+GAIN_CONTROL = (_NAME_BASE + 20)
+GAIN_SLOW = 0
+GAIN_MEDIUM = 1
+GAIN_FAST = 2
+GAIN_FROZEN = 3
+AUTO_CKILL = (_NAME_BASE + 21)
+VTR_MODE = (_NAME_BASE + 22)
+VTR_INPUT = 0
+CAMERA_INPUT = 1
+LUMA_DELAY = (_NAME_BASE + 23)
+VNOISE = (_NAME_BASE + 24)
+VNOISE_NORMAL = 0
+VNOISE_SEARCH = 1
+VNOISE_AUTO = 2
+VNOISE_BYPASS = 3
+CHCV_PAL = (_NAME_BASE + 25)
+CHCV_NTSC = (_NAME_BASE + 26)
+CCIR_LEVELS = (_NAME_BASE + 27)
+STD_CHROMA = (_NAME_BASE + 28)
+DENC_VTBYPASS = (_NAME_BASE + 29)
+FAST_TIMECONSTANT = (_NAME_BASE + 30)
+GENLOCK_DELAY = (_NAME_BASE + 31)
+PHASE_SYNC = (_NAME_BASE + 32)
+VIDEO_OUTPUT = (_NAME_BASE + 33)
+CHROMA_PHASEOUT = (_NAME_BASE + 34)
+CHROMA_CENTER = (_NAME_BASE + 35)
+YUV_TO_RGB_INVERT = (_NAME_BASE + 36)
+SOURCE1_BROADCAST = (_NAME_BASE + 37)
+SOURCE1_MODE = (_NAME_BASE + 38)
+SOURCE2_BROADCAST = (_NAME_BASE + 39)
+SOURCE2_MODE = (_NAME_BASE + 40)
+SOURCE3_BROADCAST = (_NAME_BASE + 41)
+SOURCE3_MODE = (_NAME_BASE + 42)
+SIGNAL_STD = (_NAME_BASE + 43)
+NOSIGNAL = 2
+SIGNAL_COLOR = (_NAME_BASE + 44)
diff --git a/Lib/irix6/TERMIOS.py b/Lib/irix6/TERMIOS.py
new file mode 100644
index 0000000..fa4a475
--- /dev/null
+++ b/Lib/irix6/TERMIOS.py
@@ -0,0 +1,676 @@
+# Generated by h2py from /usr/include/sys/termios.h
+
+# Included from standards.h
+
+# Included from sys/ttydev.h
+__NEW_INVALID_BAUD = 1800
+__OLD_B0 = 0
+__OLD_B50 = 0000001
+__OLD_B75 = 0000002
+__OLD_B110 = 0000003
+__OLD_B134 = 0000004
+__OLD_B150 = 0000005
+__OLD_B200 = 0000006
+__OLD_B300 = 0000007
+__OLD_B600 = 0000010
+__OLD_B1200 = 0000011
+__OLD_B1800 = 0000012
+__OLD_B2400 = 0000013
+__OLD_B4800 = 0000014
+__OLD_B9600 = 0000015
+__OLD_B19200 = 0000016
+__OLD_EXTA = 0000016
+__OLD_B38400 = 0000017
+__OLD_EXTB = 0000017
+__OLD_INVALID_BAUD = __OLD_B1800
+B0 = 0
+B50 = 50
+B75 = 75
+B110 = 110
+B134 = 134
+B150 = 150
+B200 = 200
+B300 = 300
+B600 = 600
+B1200 = 1200
+B1800 = 1800
+B2400 = 2400
+B4800 = 4800
+B9600 = 9600
+B19200 = 19200
+EXTA = 19200
+B38400 = 38400
+EXTB = 38400
+B57600 = 57600
+B76800 = 76800
+B115200 = 115200
+__INVALID_BAUD = 1800
+B0 = __OLD_B0
+B50 = __OLD_B50
+B75 = __OLD_B75
+B110 = __OLD_B110
+B134 = __OLD_B134
+B150 = __OLD_B150
+B200 = __OLD_B200
+B300 = __OLD_B300
+B600 = __OLD_B600
+B1200 = __OLD_B1200
+B1800 = __OLD_B1800
+B2400 = __OLD_B2400
+B4800 = __OLD_B4800
+B9600 = __OLD_B9600
+B19200 = __OLD_B19200
+EXTA = __OLD_B19200
+B38400 = __OLD_B38400
+EXTB = __OLD_B38400
+__INVALID_BAUD = __OLD_INVALID_BAUD
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+_POSIX_VDISABLE = 0
+def CTRL(c): return ((c)&037)
+
+IBSHIFT = 16
+NCC = 8
+NCCS = 23
+__NEW_MAX_BAUD = 500000
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VEOL = 5
+VEOL2 = 6
+VMIN = 4
+VTIME = 5
+VSWTCH = 7
+VSTART = 8
+VSTOP = 9
+VSUSP = 10
+VDSUSP = 11
+VREPRINT = 12
+VDISCARD = 13
+VWERASE = 14
+VLNEXT = 15
+VRPRNT = VREPRINT
+VFLUSHO = VDISCARD
+VCEOF = NCC
+VCEOL = (NCC + 1)
+CNUL = 0
+CDEL = 0377
+CESC = ord('\\')
+CINTR = 0177
+CQUIT = 034
+CERASE = CTRL(ord('H'))
+CKILL = CTRL(ord('U'))
+CEOL = 0
+CEOL2 = 0
+CEOF = CTRL(ord('d'))
+CEOT = CEOF
+CSTART = CTRL(ord('q'))
+CSTOP = CTRL(ord('s'))
+CSWTCH = CTRL(ord('z'))
+CNSWTCH = 0
+CSUSP = CSWTCH
+CLNEXT = CTRL(ord('v'))
+CWERASE = CTRL(ord('w'))
+CFLUSHO = CTRL(ord('o'))
+CFLUSH = CFLUSHO
+CRPRNT = CTRL(ord('r'))
+CDSUSP = CTRL(ord('y'))
+CBRK = 0377
+IGNBRK = 0000001
+BRKINT = 0000002
+IGNPAR = 0000004
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IMAXBEL = 0020000
+IBLKMD = 0040000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+XTABS = 0014000
+BSDLY = 0020000
+BS0 = 0
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0
+FF1 = 0100000
+PAGEOUT = 0200000
+WRAP = 0400000
+CBAUD = 000000017
+CSIZE = 000000060
+CS5 = 0
+CS6 = 000000020
+CS7 = 000000040
+CS8 = 000000060
+CSTOPB = 000000100
+CREAD = 000000200
+PARENB = 000000400
+PARODD = 000001000
+HUPCL = 000002000
+CLOCAL = 000004000
+RCV1EN = 000010000
+XMT1EN = 000020000
+LOBLK = 000040000
+XCLUDE = 000100000
+CIBAUD = 003600000
+PAREXT = 004000000
+CNEW_RTSCTS = 010000000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+IEXTEN = 0000400
+ITOSTOP = 0100000
+TOSTOP = ITOSTOP
+ECHOCTL = 0001000
+ECHOPRT = 0002000
+ECHOKE = 0004000
+DEFECHO = 0010000
+FLUSHO = 0020000
+PENDIN = 0040000
+TIOC = (ord('T')<<8)
+__NEW_TCGETA = (TIOC|201)
+__NEW_TCSETA = (TIOC|202)
+__NEW_TCSETAW = (TIOC|203)
+__NEW_TCSETAF = (TIOC|204)
+__OLD_TCGETA = (TIOC|1)
+__OLD_TCSETA = (TIOC|2)
+__OLD_TCSETAW = (TIOC|3)
+__OLD_TCSETAF = (TIOC|4)
+TCGETA = __NEW_TCGETA
+TCSETA = __NEW_TCSETA
+TCSETAW = __NEW_TCSETAW
+TCSETAF = __NEW_TCSETAF
+TCGETA = __OLD_TCGETA
+TCSETA = __OLD_TCSETA
+TCSETAW = __OLD_TCSETAW
+TCSETAF = __OLD_TCSETAF
+TCSBRK = (TIOC|5)
+TCXONC = (TIOC|6)
+TCFLSH = (TIOC|7)
+
+# Included from sys/ioctl.h
+IOCTYPE = 0xff00
+LIOC = (ord('l')<<8)
+LIOCGETP = (LIOC|1)
+LIOCSETP = (LIOC|2)
+LIOCGETS = (LIOC|5)
+LIOCSETS = (LIOC|6)
+DIOC = (ord('d')<<8)
+DIOCGETC = (DIOC|1)
+DIOCGETB = (DIOC|2)
+DIOCSETE = (DIOC|3)
+
+# Included from sys/ioccom.h
+IOCPARM_MASK = 0xff
+IOC_VOID = 0x20000000
+IOC_OUT = 0x40000000
+IOC_IN = 0x80000000
+IOC_INOUT = (IOC_IN|IOC_OUT)
+
+# Included from net/soioctl.h
+
+# Included from sys/termio.h
+
+# Included from sys/termios.h
+_POSIX_VDISABLE = 0
+def CTRL(c): return ((c)&037)
+
+IBSHIFT = 16
+NCC = 8
+NCCS = 23
+__NEW_MAX_BAUD = 500000
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VEOL = 5
+VEOL2 = 6
+VMIN = 4
+VTIME = 5
+VSWTCH = 7
+VSTART = 8
+VSTOP = 9
+VSUSP = 10
+VDSUSP = 11
+VREPRINT = 12
+VDISCARD = 13
+VWERASE = 14
+VLNEXT = 15
+VRPRNT = VREPRINT
+VFLUSHO = VDISCARD
+VCEOF = NCC
+VCEOL = (NCC + 1)
+CNUL = 0
+CDEL = 0377
+CESC = ord('\\')
+CINTR = 0177
+CQUIT = 034
+CERASE = CTRL(ord('H'))
+CKILL = CTRL(ord('U'))
+CEOL = 0
+CEOL2 = 0
+CEOF = CTRL(ord('d'))
+CEOT = CEOF
+CSTART = CTRL(ord('q'))
+CSTOP = CTRL(ord('s'))
+CSWTCH = CTRL(ord('z'))
+CNSWTCH = 0
+CSUSP = CSWTCH
+CLNEXT = CTRL(ord('v'))
+CWERASE = CTRL(ord('w'))
+CFLUSHO = CTRL(ord('o'))
+CFLUSH = CFLUSHO
+CRPRNT = CTRL(ord('r'))
+CDSUSP = CTRL(ord('y'))
+CBRK = 0377
+IGNBRK = 0000001
+BRKINT = 0000002
+IGNPAR = 0000004
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IMAXBEL = 0020000
+IBLKMD = 0040000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+XTABS = 0014000
+BSDLY = 0020000
+BS0 = 0
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0
+FF1 = 0100000
+PAGEOUT = 0200000
+WRAP = 0400000
+CBAUD = 000000017
+CSIZE = 000000060
+CS5 = 0
+CS6 = 000000020
+CS7 = 000000040
+CS8 = 000000060
+CSTOPB = 000000100
+CREAD = 000000200
+PARENB = 000000400
+PARODD = 000001000
+HUPCL = 000002000
+CLOCAL = 000004000
+RCV1EN = 000010000
+XMT1EN = 000020000
+LOBLK = 000040000
+XCLUDE = 000100000
+CIBAUD = 003600000
+PAREXT = 004000000
+CNEW_RTSCTS = 010000000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+IEXTEN = 0000400
+ITOSTOP = 0100000
+TOSTOP = ITOSTOP
+ECHOCTL = 0001000
+ECHOPRT = 0002000
+ECHOKE = 0004000
+DEFECHO = 0010000
+FLUSHO = 0020000
+PENDIN = 0040000
+TIOC = (ord('T')<<8)
+__NEW_TCGETA = (TIOC|201)
+__NEW_TCSETA = (TIOC|202)
+__NEW_TCSETAW = (TIOC|203)
+__NEW_TCSETAF = (TIOC|204)
+__OLD_TCGETA = (TIOC|1)
+__OLD_TCSETA = (TIOC|2)
+__OLD_TCSETAW = (TIOC|3)
+__OLD_TCSETAF = (TIOC|4)
+TCGETA = __NEW_TCGETA
+TCSETA = __NEW_TCSETA
+TCSETAW = __NEW_TCSETAW
+TCSETAF = __NEW_TCSETAF
+TCGETA = __OLD_TCGETA
+TCSETA = __OLD_TCSETA
+TCSETAW = __OLD_TCSETAW
+TCSETAF = __OLD_TCSETAF
+TCSBRK = (TIOC|5)
+TCXONC = (TIOC|6)
+TCFLSH = (TIOC|7)
+LDISC0 = 0
+LDISC1 = 1
+NTTYDISC = LDISC1
+TIOCFLUSH = (TIOC|12)
+TCSETLABEL = (TIOC|31)
+TCDSET = (TIOC|32)
+TCBLKMD = (TIOC|33)
+TIOCPKT = (TIOC|112)
+TIOCPKT_DATA = 0x00
+TIOCPKT_FLUSHREAD = 0x01
+TIOCPKT_FLUSHWRITE = 0x02
+TIOCPKT_NOSTOP = 0x10
+TIOCPKT_DOSTOP = 0x20
+TIOCPKT_IOCTL = 0x40
+TIOCNOTTY = (TIOC|113)
+TIOCSTI = (TIOC|114)
+TFIOC = (ord('F')<<8)
+oFIONREAD = (TFIOC|127)
+TO_STOP = LOBLK
+IOCTYPE = 0xff00
+__NEW_TCGETS = (TIOC|213)
+__NEW_TCSETS = (TIOC|214)
+__NEW_TCSETSW = (TIOC|215)
+__NEW_TCSETSF = (TIOC|216)
+__OLD_TCGETS = (TIOC|13)
+__OLD_TCSETS = (TIOC|14)
+__OLD_TCSETSW = (TIOC|15)
+__OLD_TCSETSF = (TIOC|16)
+TCGETS = __NEW_TCGETS
+TCSETS = __NEW_TCSETS
+TCSETSW = __NEW_TCSETSW
+TCSETSF = __NEW_TCSETSF
+TCGETS = __OLD_TCGETS
+TCSETS = __OLD_TCSETS
+TCSETSW = __OLD_TCSETSW
+TCSETSF = __OLD_TCSETSF
+TCSANOW = ((ord('T')<<8)|14)
+TCSADRAIN = ((ord('T')<<8)|15)
+TCSAFLUSH = ((ord('T')<<8)|16)
+TCIFLUSH = 0
+TCOFLUSH = 1
+TCIOFLUSH = 2
+TCOOFF = 0
+TCOON = 1
+TCIOFF = 2
+TCION = 3
+tIOC = (ord('t')<<8)
+TIOCGETD = (tIOC|0)
+TIOCSETD = (tIOC|1)
+TIOCHPCL = (tIOC|2)
+TIOCGETP = (tIOC|8)
+TIOCSETP = (tIOC|9)
+TIOCSETN = (tIOC|10)
+TIOCEXCL = (tIOC|13)
+TIOCNXCL = (tIOC|14)
+TIOCSETC = (tIOC|17)
+TIOCGETC = (tIOC|18)
+TIOCLBIS = (tIOC|127)
+TIOCLBIC = (tIOC|126)
+TIOCLSET = (tIOC|125)
+TIOCLGET = (tIOC|124)
+TIOCSBRK = (tIOC|123)
+TIOCCBRK = (tIOC|122)
+TIOCSDTR = (tIOC|121)
+TIOCCDTR = (tIOC|120)
+TIOCSLTC = (tIOC|117)
+TIOCGLTC = (tIOC|116)
+TIOCOUTQ = (tIOC|115)
+TIOCSTOP = (tIOC|111)
+TIOCSTART = (tIOC|110)
+TIOCGSID = (tIOC|22)
+TIOCSSID = (tIOC|24)
+TIOCMSET = (tIOC|26)
+TIOCMBIS = (tIOC|27)
+TIOCMBIC = (tIOC|28)
+TIOCMGET = (tIOC|29)
+TIOCM_LE = 0001
+TIOCM_DTR = 0002
+TIOCM_RTS = 0004
+TIOCM_ST = 0010
+TIOCM_SR = 0020
+TIOCM_CTS = 0040
+TIOCM_CAR = 0100
+TIOCM_CD = TIOCM_CAR
+TIOCM_RNG = 0200
+TIOCM_RI = TIOCM_RNG
+TIOCM_DSR = 0400
+TIOCREMOTE = (tIOC|30)
+TIOCSIGNAL = (tIOC|31)
+ISPTM = ((ord('P')<<8)|1)
+UNLKPT = ((ord('P')<<8)|2)
+SVR4SOPEN = ((ord('P')<<8)|100)
+LDIOC = (ord('D')<<8)
+LDOPEN = (LDIOC|0)
+LDCLOSE = (LDIOC|1)
+LDCHG = (LDIOC|2)
+LDGETT = (LDIOC|8)
+LDSETT = (LDIOC|9)
+LDSMAP = (LDIOC|10)
+LDGMAP = (LDIOC|11)
+LDNMAP = (LDIOC|12)
+DIOC = (ord('d')<<8)
+DIOCGETP = (DIOC|8)
+DIOCSETP = (DIOC|9)
+FIORDCHK = ((ord('f')<<8)|3)
+CLNEXT = CTRL(ord('v'))
+CWERASE = CTRL(ord('w'))
+CFLUSHO = CTRL(ord('o'))
+CFLUSH = CFLUSHO
+CRPRNT = CTRL(ord('r'))
+CDSUSP = CTRL(ord('y'))
+__OLD_SSPEED = __OLD_B9600
+SSPEED = B9600
+TERM_NONE = 0
+TERM_TEC = 1
+TERM_V61 = 2
+TERM_V10 = 3
+TERM_TEX = 4
+TERM_D40 = 5
+TERM_H45 = 6
+TERM_D42 = 7
+TM_NONE = 0000
+TM_SNL = 0001
+TM_ANL = 0002
+TM_LCF = 0004
+TM_CECHO = 0010
+TM_CINVIS = 0020
+TM_SET = 0200
+LDISC0 = 0
+LDISC1 = 1
+NTTYDISC = LDISC1
+TIOCFLUSH = (TIOC|12)
+TCSETLABEL = (TIOC|31)
+TCDSET = (TIOC|32)
+TCBLKMD = (TIOC|33)
+TIOCPKT = (TIOC|112)
+TIOCPKT_DATA = 0x00
+TIOCPKT_FLUSHREAD = 0x01
+TIOCPKT_FLUSHWRITE = 0x02
+TIOCPKT_NOSTOP = 0x10
+TIOCPKT_DOSTOP = 0x20
+TIOCPKT_IOCTL = 0x40
+TIOCNOTTY = (TIOC|113)
+TIOCSTI = (TIOC|114)
+TFIOC = (ord('F')<<8)
+oFIONREAD = (TFIOC|127)
+TO_STOP = LOBLK
+IOCTYPE = 0xff00
+__NEW_TCGETS = (TIOC|213)
+__NEW_TCSETS = (TIOC|214)
+__NEW_TCSETSW = (TIOC|215)
+__NEW_TCSETSF = (TIOC|216)
+__OLD_TCGETS = (TIOC|13)
+__OLD_TCSETS = (TIOC|14)
+__OLD_TCSETSW = (TIOC|15)
+__OLD_TCSETSF = (TIOC|16)
+TCGETS = __NEW_TCGETS
+TCSETS = __NEW_TCSETS
+TCSETSW = __NEW_TCSETSW
+TCSETSF = __NEW_TCSETSF
+TCGETS = __OLD_TCGETS
+TCSETS = __OLD_TCSETS
+TCSETSW = __OLD_TCSETSW
+TCSETSF = __OLD_TCSETSF
+TCSANOW = ((ord('T')<<8)|14)
+TCSADRAIN = ((ord('T')<<8)|15)
+TCSAFLUSH = ((ord('T')<<8)|16)
+TCIFLUSH = 0
+TCOFLUSH = 1
+TCIOFLUSH = 2
+TCOOFF = 0
+TCOON = 1
+TCIOFF = 2
+TCION = 3
+tIOC = (ord('t')<<8)
+TIOCGETD = (tIOC|0)
+TIOCSETD = (tIOC|1)
+TIOCHPCL = (tIOC|2)
+TIOCGETP = (tIOC|8)
+TIOCSETP = (tIOC|9)
+TIOCSETN = (tIOC|10)
+TIOCEXCL = (tIOC|13)
+TIOCNXCL = (tIOC|14)
+TIOCSETC = (tIOC|17)
+TIOCGETC = (tIOC|18)
+TIOCLBIS = (tIOC|127)
+TIOCLBIC = (tIOC|126)
+TIOCLSET = (tIOC|125)
+TIOCLGET = (tIOC|124)
+TIOCSBRK = (tIOC|123)
+TIOCCBRK = (tIOC|122)
+TIOCSDTR = (tIOC|121)
+TIOCCDTR = (tIOC|120)
+TIOCSLTC = (tIOC|117)
+TIOCGLTC = (tIOC|116)
+TIOCOUTQ = (tIOC|115)
+TIOCSTOP = (tIOC|111)
+TIOCSTART = (tIOC|110)
+TIOCGSID = (tIOC|22)
+TIOCSSID = (tIOC|24)
+TIOCMSET = (tIOC|26)
+TIOCMBIS = (tIOC|27)
+TIOCMBIC = (tIOC|28)
+TIOCMGET = (tIOC|29)
+TIOCM_LE = 0001
+TIOCM_DTR = 0002
+TIOCM_RTS = 0004
+TIOCM_ST = 0010
+TIOCM_SR = 0020
+TIOCM_CTS = 0040
+TIOCM_CAR = 0100
+TIOCM_CD = TIOCM_CAR
+TIOCM_RNG = 0200
+TIOCM_RI = TIOCM_RNG
+TIOCM_DSR = 0400
+TIOCREMOTE = (tIOC|30)
+TIOCSIGNAL = (tIOC|31)
+ISPTM = ((ord('P')<<8)|1)
+UNLKPT = ((ord('P')<<8)|2)
+SVR4SOPEN = ((ord('P')<<8)|100)
+LDIOC = (ord('D')<<8)
+LDOPEN = (LDIOC|0)
+LDCLOSE = (LDIOC|1)
+LDCHG = (LDIOC|2)
+LDGETT = (LDIOC|8)
+LDSETT = (LDIOC|9)
+LDSMAP = (LDIOC|10)
+LDGMAP = (LDIOC|11)
+LDNMAP = (LDIOC|12)
+DIOC = (ord('d')<<8)
+DIOCGETP = (DIOC|8)
+DIOCSETP = (DIOC|9)
+FIORDCHK = ((ord('f')<<8)|3)
diff --git a/Lib/irix6/WAIT.py b/Lib/irix6/WAIT.py
new file mode 100644
index 0000000..741af3b
--- /dev/null
+++ b/Lib/irix6/WAIT.py
@@ -0,0 +1,335 @@
+# Generated by h2py from /usr/include/sys/wait.h
+
+# Included from standards.h
+def _W_INT(i): return (i)
+
+WUNTRACED = 0004
+WNOHANG = 0100
+_WSTOPPED = 0177
+def WIFEXITED(stat): return ((_W_INT(stat)&0377)==0)
+
+def WEXITSTATUS(stat): return ((_W_INT(stat)>>8)&0377)
+
+def WTERMSIG(stat): return (_W_INT(stat)&0177)
+
+def WSTOPSIG(stat): return ((_W_INT(stat)>>8)&0377)
+
+WEXITED = 0001
+WTRAPPED = 0002
+WSTOPPED = 0004
+WCONTINUED = 0010
+WNOWAIT = 0200
+WOPTMASK = (WEXITED|WTRAPPED|WSTOPPED|WCONTINUED|WNOHANG|WNOWAIT)
+WSTOPFLG = 0177
+WCONTFLG = 0177777
+WCOREFLAG = 0200
+WSIGMASK = 0177
+def WWORD(stat): return (_W_INT(stat)&0177777)
+
+def WIFCONTINUED(stat): return (WWORD(stat)==WCONTFLG)
+
+def WCOREDUMP(stat): return (_W_INT(stat) & WCOREFLAG)
+
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+
+# Included from sys/procset.h
+P_INITPID = 1
+P_INITUID = 0
+P_INITPGID = 0
+
+# Included from sys/signal.h
+SIGHUP = 1
+SIGINT = 2
+SIGQUIT = 3
+SIGILL = 4
+SIGTRAP = 5
+SIGIOT = 6
+SIGABRT = 6
+SIGEMT = 7
+SIGFPE = 8
+SIGKILL = 9
+SIGBUS = 10
+SIGSEGV = 11
+SIGSYS = 12
+SIGPIPE = 13
+SIGALRM = 14
+SIGTERM = 15
+SIGUSR1 = 16
+SIGUSR2 = 17
+SIGCLD = 18
+SIGCHLD = 18
+SIGPWR = 19
+SIGWINCH = 20
+SIGURG = 21
+SIGPOLL = 22
+SIGIO = 22
+SIGSTOP = 23
+SIGTSTP = 24
+SIGCONT = 25
+SIGTTIN = 26
+SIGTTOU = 27
+SIGVTALRM = 28
+SIGPROF = 29
+SIGXCPU = 30
+SIGXFSZ = 31
+SIG32 = 32
+SIGCKPT = 33
+SIGRTMIN = 49
+SIGRTMAX = 64
+SIGPTINTR = 47
+SIGPTRESCHED = 48
+__sigargs = int
+SIGEV_NONE = 128
+SIGEV_SIGNAL = 129
+SIGEV_CALLBACK = 130
+
+# Included from sys/siginfo.h
+ILL_ILLOPC = 1
+ILL_ILLOPN = 2
+ILL_ILLADR = 3
+ILL_ILLTRP = 4
+ILL_PRVOPC = 5
+ILL_PRVREG = 6
+ILL_COPROC = 7
+ILL_BADSTK = 8
+NSIGILL = 8
+FPE_INTDIV = 1
+FPE_INTOVF = 2
+FPE_FLTDIV = 3
+FPE_FLTOVF = 4
+FPE_FLTUND = 5
+FPE_FLTRES = 6
+FPE_FLTINV = 7
+FPE_FLTSUB = 8
+NSIGFPE = 8
+SEGV_MAPERR = 1
+SEGV_ACCERR = 2
+NSIGSEGV = 2
+BUS_ADRALN = 1
+BUS_ADRERR = 2
+BUS_OBJERR = 3
+NSIGBUS = 3
+TRAP_BRKPT = 1
+TRAP_TRACE = 2
+NSIGTRAP = 2
+CLD_EXITED = 1
+CLD_KILLED = 2
+CLD_DUMPED = 3
+CLD_TRAPPED = 4
+CLD_STOPPED = 5
+CLD_CONTINUED = 6
+NSIGCLD = 6
+POLL_IN = 1
+POLL_OUT = 2
+POLL_MSG = 3
+POLL_ERR = 4
+POLL_PRI = 5
+POLL_HUP = 6
+NSIGPOLL = 6
+SI_MAXSZ = 128
+SI_USER = 0
+SI_KILL = SI_USER
+SI_QUEUE = -1
+SI_ASYNCIO = -2
+SI_TIMER = -3
+SI_MESGQ = -4
+SIG_NOP = 0
+SIG_BLOCK = 1
+SIG_UNBLOCK = 2
+SIG_SETMASK = 3
+SIG_SETMASK32 = 256
+SA_ONSTACK = 0x00000001
+SA_RESETHAND = 0x00000002
+SA_RESTART = 0x00000004
+SA_SIGINFO = 0x00000008
+SA_NODEFER = 0x00000010
+SA_NOCLDWAIT = 0x00010000
+SA_NOCLDSTOP = 0x00020000
+_SA_BSDCALL = 0x10000000
+MINSIGSTKSZ = 512
+SIGSTKSZ = 8192
+SS_ONSTACK = 0x00000001
+SS_DISABLE = 0x00000002
+
+# Included from sys/ucontext.h
+NGREG = 36
+NGREG = 37
+GETCONTEXT = 0
+SETCONTEXT = 1
+UC_SIGMASK = 001
+UC_STACK = 002
+UC_CPU = 004
+UC_MAU = 010
+UC_MCONTEXT = (UC_CPU|UC_MAU)
+UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
+CTX_R0 = 0
+CTX_AT = 1
+CTX_V0 = 2
+CTX_V1 = 3
+CTX_A0 = 4
+CTX_A1 = 5
+CTX_A2 = 6
+CTX_A3 = 7
+CTX_T0 = 8
+CTX_T1 = 9
+CTX_T2 = 10
+CTX_T3 = 11
+CTX_T4 = 12
+CTX_T5 = 13
+CTX_T6 = 14
+CTX_T7 = 15
+CTX_A4 = 8
+CTX_A5 = 9
+CTX_A6 = 10
+CTX_A7 = 11
+CTX_T0 = 12
+CTX_T1 = 13
+CTX_T2 = 14
+CTX_T3 = 15
+CTX_S0 = 16
+CTX_S1 = 17
+CTX_S2 = 18
+CTX_S3 = 19
+CTX_S4 = 20
+CTX_S5 = 21
+CTX_S6 = 22
+CTX_S7 = 23
+CTX_T8 = 24
+CTX_T9 = 25
+CTX_K0 = 26
+CTX_K1 = 27
+CTX_GP = 28
+CTX_SP = 29
+CTX_S8 = 30
+CTX_RA = 31
+CTX_MDLO = 32
+CTX_MDHI = 33
+CTX_CAUSE = 34
+CTX_EPC = 35
+CTX_SR = 36
+CXT_R0 = CTX_R0
+CXT_AT = CTX_AT
+CXT_V0 = CTX_V0
+CXT_V1 = CTX_V1
+CXT_A0 = CTX_A0
+CXT_A1 = CTX_A1
+CXT_A2 = CTX_A2
+CXT_A3 = CTX_A3
+CXT_T0 = CTX_T0
+CXT_T1 = CTX_T1
+CXT_T2 = CTX_T2
+CXT_T3 = CTX_T3
+CXT_T4 = CTX_T4
+CXT_T5 = CTX_T5
+CXT_T6 = CTX_T6
+CXT_T7 = CTX_T7
+CXT_S0 = CTX_S0
+CXT_S1 = CTX_S1
+CXT_S2 = CTX_S2
+CXT_S3 = CTX_S3
+CXT_S4 = CTX_S4
+CXT_S5 = CTX_S5
+CXT_S6 = CTX_S6
+CXT_S7 = CTX_S7
+CXT_T8 = CTX_T8
+CXT_T9 = CTX_T9
+CXT_K0 = CTX_K0
+CXT_K1 = CTX_K1
+CXT_GP = CTX_GP
+CXT_SP = CTX_SP
+CXT_S8 = CTX_S8
+CXT_RA = CTX_RA
+CXT_MDLO = CTX_MDLO
+CXT_MDHI = CTX_MDHI
+CXT_CAUSE = CTX_CAUSE
+CXT_EPC = CTX_EPC
+CXT_SR = CTX_SR
+SV_ONSTACK = 0x0001
+SV_INTERRUPT = 0x0002
+NUMBSDSIGS = (32)
+def sigmask(sig): return (1L << ((sig)-1))
+
+def sigmask(sig): return (1L << ((sig)-1))
+
+SIG_ERR = (-1)
+SIG_IGN = (1)
+SIG_HOLD = (2)
+SIG_DFL = (0)
+NSIG = 65
+MAXSIG = (NSIG-1)
+NUMSIGS = (NSIG-1)
+BRK_USERBP = 0
+BRK_KERNELBP = 1
+BRK_ABORT = 2
+BRK_BD_TAKEN = 3
+BRK_BD_NOTTAKEN = 4
+BRK_SSTEPBP = 5
+BRK_OVERFLOW = 6
+BRK_DIVZERO = 7
+BRK_RANGE = 8
+BRK_PSEUDO_OP_BIT = 0x80
+BRK_PSEUDO_OP_MAX = 0x3
+BRK_CACHE_SYNC = 0x80
+BRK_SWASH_FLUSH = 0x81
+BRK_SWASH_SWTCH = 0x82
+BRK_MULOVF = 1023
+
+# Included from sys/resource.h
+PRIO_MIN = -20
+PRIO_MAX = 20
+PRIO_PROCESS = 0
+PRIO_PGRP = 1
+PRIO_USER = 2
+RUSAGE_SELF = 0
+RUSAGE_CHILDREN = -1
+RLIMIT_CPU = 0
+RLIMIT_FSIZE = 1
+RLIMIT_DATA = 2
+RLIMIT_STACK = 3
+RLIMIT_CORE = 4
+RLIMIT_NOFILE = 5
+RLIMIT_VMEM = 6
+RLIMIT_RSS = 7
+RLIMIT_AS = RLIMIT_VMEM
+RLIM_NLIMITS = 8
+RLIM32_INFINITY = 0x7fffffff
+RLIM_INFINITY = 0x7fffffff
diff --git a/Lib/irix6/cddb.py b/Lib/irix6/cddb.py
new file mode 100644
index 0000000..57cf3c6
--- /dev/null
+++ b/Lib/irix6/cddb.py
@@ -0,0 +1,208 @@
+# This file implements a class which forms an interface to the .cddb
+# directory that is maintained by SGI's cdman program.
+#
+# Usage is as follows:
+#
+# import readcd
+# r = readcd.Readcd()
+# c = Cddb(r.gettrackinfo())
+#
+# Now you can use c.artist, c.title and c.track[trackno] (where trackno
+# starts at 1). When the CD is not recognized, all values will be the empty
+# string.
+# It is also possible to set the above mentioned variables to new values.
+# You can then use c.write() to write out the changed values to the
+# .cdplayerrc file.
+
+import string, posix, os
+
+_cddbrc = '.cddb'
+_DB_ID_NTRACKS = 5
+_dbid_map = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@_=+abcdefghijklmnopqrstuvwxyz'
+def _dbid(v):
+ if v >= len(_dbid_map):
+ return string.zfill(v, 2)
+ else:
+ return _dbid_map[v]
+
+def tochash(toc):
+ if type(toc) == type(''):
+ tracklist = []
+ for i in range(2, len(toc), 4):
+ tracklist.append((None,
+ (string.atoi(toc[i:i+2]),
+ string.atoi(toc[i+2:i+4]))))
+ else:
+ tracklist = toc
+ ntracks = len(tracklist)
+ hash = _dbid((ntracks >> 4) & 0xF) + _dbid(ntracks & 0xF)
+ if ntracks <= _DB_ID_NTRACKS:
+ nidtracks = ntracks
+ else:
+ nidtracks = _DB_ID_NTRACKS - 1
+ min = 0
+ sec = 0
+ for track in tracklist:
+ start, length = track
+ min = min + length[0]
+ sec = sec + length[1]
+ min = min + sec / 60
+ sec = sec % 60
+ hash = hash + _dbid(min) + _dbid(sec)
+ for i in range(nidtracks):
+ start, length = tracklist[i]
+ hash = hash + _dbid(length[0]) + _dbid(length[1])
+ return hash
+
+class Cddb:
+ def __init__(self, tracklist):
+ if os.environ.has_key('CDDB_PATH'):
+ path = os.environ['CDDB_PATH']
+ cddb_path = string.splitfields(path, ',')
+ else:
+ home = os.environ['HOME']
+ cddb_path = [home + '/' + _cddbrc]
+
+ self._get_id(tracklist)
+
+ for dir in cddb_path:
+ file = dir + '/' + self.id + '.rdb'
+ try:
+ f = open(file, 'r')
+ self.file = file
+ break
+ except IOError:
+ pass
+ ntracks = string.atoi(self.id[:2], 16)
+ self.artist = ''
+ self.title = ''
+ self.track = [None] + [''] * ntracks
+ self.trackartist = [None] + [''] * ntracks
+ self.notes = []
+ if not hasattr(self, 'file'):
+ return
+ import regex
+ reg = regex.compile('^\\([^.]*\\)\\.\\([^:]*\\):[\t ]+\\(.*\\)')
+ while 1:
+ line = f.readline()
+ if not line:
+ break
+ if reg.match(line) == -1:
+ print 'syntax error in ' + file
+ continue
+ name1 = line[reg.regs[1][0]:reg.regs[1][1]]
+ name2 = line[reg.regs[2][0]:reg.regs[2][1]]
+ value = line[reg.regs[3][0]:reg.regs[3][1]]
+ if name1 == 'album':
+ if name2 == 'artist':
+ self.artist = value
+ elif name2 == 'title':
+ self.title = value
+ elif name2 == 'toc':
+ if not self.toc:
+ self.toc = value
+ if self.toc != value:
+ print 'toc\'s don\'t match'
+ elif name2 == 'notes':
+ self.notes.append(value)
+ elif name1[:5] == 'track':
+ try:
+ trackno = string.atoi(name1[5:])
+ except strings.atoi_error:
+ print 'syntax error in ' + file
+ continue
+ if trackno > ntracks:
+ print 'track number ' + `trackno` + \
+ ' in file ' + file + \
+ ' out of range'
+ continue
+ if name2 == 'title':
+ self.track[trackno] = value
+ elif name2 == 'artist':
+ self.trackartist[trackno] = value
+ f.close()
+ for i in range(2, len(self.track)):
+ track = self.track[i]
+ # if track title starts with `,', use initial part
+ # of previous track's title
+ if track and track[0] == ',':
+ try:
+ off = string.index(self.track[i - 1],
+ ',')
+ except string.index_error:
+ pass
+ else:
+ self.track[i] = self.track[i-1][:off] \
+ + track
+
+ def _get_id(self, tracklist):
+ # fill in self.id and self.toc.
+ # if the argument is a string ending in .rdb, the part
+ # upto the suffix is taken as the id.
+ if type(tracklist) == type(''):
+ if tracklist[-4:] == '.rdb':
+ self.id = tracklist[:-4]
+ self.toc = ''
+ return
+ t = []
+ for i in range(2, len(tracklist), 4):
+ t.append((None, \
+ (string.atoi(tracklist[i:i+2]), \
+ string.atoi(tracklist[i+2:i+4]))))
+ tracklist = t
+ ntracks = len(tracklist)
+ self.id = _dbid((ntracks >> 4) & 0xF) + _dbid(ntracks & 0xF)
+ if ntracks <= _DB_ID_NTRACKS:
+ nidtracks = ntracks
+ else:
+ nidtracks = _DB_ID_NTRACKS - 1
+ min = 0
+ sec = 0
+ for track in tracklist:
+ start, length = track
+ min = min + length[0]
+ sec = sec + length[1]
+ min = min + sec / 60
+ sec = sec % 60
+ self.id = self.id + _dbid(min) + _dbid(sec)
+ for i in range(nidtracks):
+ start, length = tracklist[i]
+ self.id = self.id + _dbid(length[0]) + _dbid(length[1])
+ self.toc = string.zfill(ntracks, 2)
+ for track in tracklist:
+ start, length = track
+ self.toc = self.toc + string.zfill(length[0], 2) + \
+ string.zfill(length[1], 2)
+
+ def write(self):
+ import posixpath
+ if os.environ.has_key('CDDB_WRITE_DIR'):
+ dir = os.environ['CDDB_WRITE_DIR']
+ else:
+ dir = os.environ['HOME'] + '/' + _cddbrc
+ file = dir + '/' + self.id + '.rdb'
+ if posixpath.exists(file):
+ # make backup copy
+ posix.rename(file, file + '~')
+ f = open(file, 'w')
+ f.write('album.title:\t' + self.title + '\n')
+ f.write('album.artist:\t' + self.artist + '\n')
+ f.write('album.toc:\t' + self.toc + '\n')
+ for note in self.notes:
+ f.write('album.notes:\t' + note + '\n')
+ prevpref = None
+ for i in range(1, len(self.track)):
+ if self.trackartist[i]:
+ f.write('track'+`i`+'.artist:\t'+self.trackartist[i]+'\n')
+ track = self.track[i]
+ try:
+ off = string.index(track, ',')
+ except string.index_error:
+ prevpref = None
+ else:
+ if prevpref and track[:off] == prevpref:
+ track = track[off:]
+ else:
+ prevpref = track[:off]
+ f.write('track' + `i` + '.title:\t' + track + '\n')
+ f.close()
diff --git a/Lib/irix6/cdplayer.py b/Lib/irix6/cdplayer.py
new file mode 100644
index 0000000..5c2c95a
--- /dev/null
+++ b/Lib/irix6/cdplayer.py
@@ -0,0 +1,89 @@
+# This file implements a class which forms an interface to the .cdplayerrc
+# file that is maintained by SGI's cdplayer program.
+#
+# Usage is as follows:
+#
+# import readcd
+# r = readcd.Readcd()
+# c = Cdplayer(r.gettrackinfo())
+#
+# Now you can use c.artist, c.title and c.track[trackno] (where trackno
+# starts at 1). When the CD is not recognized, all values will be the empty
+# string.
+# It is also possible to set the above mentioned variables to new values.
+# You can then use c.write() to write out the changed values to the
+# .cdplayerrc file.
+
+cdplayerrc = '.cdplayerrc'
+
+class Cdplayer:
+ def __init__(self, tracklist):
+ import string
+ self.artist = ''
+ self.title = ''
+ if type(tracklist) == type(''):
+ t = []
+ for i in range(2, len(tracklist), 4):
+ t.append((None, \
+ (string.atoi(tracklist[i:i+2]), \
+ string.atoi(tracklist[i+2:i+4]))))
+ tracklist = t
+ self.track = [None] + [''] * len(tracklist)
+ self.id = 'd' + string.zfill(len(tracklist), 2)
+ for track in tracklist:
+ start, length = track
+ self.id = self.id + string.zfill(length[0], 2) + \
+ string.zfill(length[1], 2)
+ try:
+ import posix
+ f = open(posix.environ['HOME'] + '/' + cdplayerrc, 'r')
+ except IOError:
+ return
+ import regex
+ reg = regex.compile('^\\([^:]*\\):\t\\(.*\\)')
+ s = self.id + '.'
+ l = len(s)
+ while 1:
+ line = f.readline()
+ if line == '':
+ break
+ if line[:l] == s:
+ line = line[l:]
+ if reg.match(line) == -1:
+ print 'syntax error in ~/' + cdplayerrc
+ continue
+ name = line[reg.regs[1][0]:reg.regs[1][1]]
+ value = line[reg.regs[2][0]:reg.regs[2][1]]
+ if name == 'title':
+ self.title = value
+ elif name == 'artist':
+ self.artist = value
+ elif name[:5] == 'track':
+ trackno = string.atoi(name[6:])
+ self.track[trackno] = value
+ f.close()
+
+ def write(self):
+ import posix
+ filename = posix.environ['HOME'] + '/' + cdplayerrc
+ try:
+ old = open(filename, 'r')
+ except IOError:
+ old = open('/dev/null', 'r')
+ new = open(filename + '.new', 'w')
+ s = self.id + '.'
+ l = len(s)
+ while 1:
+ line = old.readline()
+ if line == '':
+ break
+ if line[:l] <> s:
+ new.write(line)
+ new.write(self.id + '.title:\t' + self.title + '\n')
+ new.write(self.id + '.artist:\t' + self.artist + '\n')
+ for i in range(1, len(self.track)):
+ new.write(self.id + '.track.' + `i` + ':\t' + \
+ self.track[i] + '\n')
+ old.close()
+ new.close()
+ posix.rename(filename + '.new', filename)
diff --git a/Lib/irix6/flp.doc b/Lib/irix6/flp.doc
new file mode 100644
index 0000000..1a2f374
--- /dev/null
+++ b/Lib/irix6/flp.doc
@@ -0,0 +1,117 @@
+.SH
+Module flp
+.LP
+The flp module loads fl-forms from fd files, as generated
+by fdesign. The module is designed to be flexible enough to allow
+almost anything to be done with the loaded form.
+.LP
+Loadform defines
+two types of functions: functions to parse fd files and functions to
+create the forms from the templates returned by the parse functions.
+There are fairly low-level create functions that create single objects,
+and convenience routines that create complete forms, including callbacks,
+etc.
+.LP
+The exception flp.error is raised whenever an error occurs while parsing a forms
+definition file or creating a form.
+.SH 2
+Parsing functions
+.LP
+There are two parsing functions, parse_form() and parse_forms(). They
+take the following form:
+.LP
+.ft C
+ftuple = parse_form(filename, formname)
+.br
+ftdict = parse_forms(filename)
+.IP
+Parse_form parses a single form, and returns a tuple (ftmp, otmplist).
+Ftmp is a template for a form, otmplist is a list of templates for
+objects. See below for a description of these templates.
+.IP
+Parse_forms parses all forms in an fd file. It returns a dictionary of
+(ftmp, otmplist) tuples, indexed by formname.
+.IP
+Filename is the name of the forms definition file to inspect. The functions
+appends '.fd' if needed, and use 'sys.path' to locate the file.
+.IP
+formname is the name of the form to load. This argument is mandatory,
+even if the file only contains one form.
+.LP
+The form template and object template are structures that contain all
+the information read from the fd file, in 'natural' form. A form
+template record contains the following fields:
+.IP
+.nf
+"Name", the name of the form;
+"Width", the width of the form;
+"Height", the height of the form; and
+"Numberofobjects", the number of objects in the form.
+.LP
+An object template contains the following fields:
+.IP
+.nf
+"Class", the class of object (eg. FL.BUTTON);
+"Type", the sub-class (eg. FL.NORMALBUTTON);
+"Box", a list with four members: [x, y, width, height];
+"Boxtype", the type of box (eg. FL.DOWNBOX);
+"Colors", a list with the two object colors;
+"Alignment", the label alignment (eg. FL.ALIGNLEFT);
+"Style", the label style (eg. FL.BOLDSTYLE);
+"Lcol", the label color;
+"Label", a string containing the label;
+"Name", a string containing the name of the object;
+"Callback", a string containing the callback routine name; and
+"Argument", a string containing the callback routine extra argument.
+.SH
+Low-level create routines.
+.LP
+The three low-level creation routines are called as follows:
+.LP
+.ft C
+form = create_form(form_template)
+.IP
+Create an fl form from a form template. Returns the form created.
+.LP
+.ft C
+obj = create_object(form, obj_template)
+.IP
+Create an object in an fl form. Return the new object.
+An error is raised if the object has a callback routine.
+.SH
+High-level create routines.
+.LP
+The 'standard' way to handle forms in python is to define a class
+that contains the form and all the objects (insofar as they are named),
+and that defines all the callback functions, and use an instance of
+this class to handle the form interaction.
+Flp contains three routines that simplify handling this paradigm:
+.LP
+.ft C
+create_full_form(instance, ftuple)
+.IP
+This routine takes an instance of your form-handling class and an
+ftuple (as returned by the parsing routines) as parameters. It inserts
+the form into the instance, defines all object names and arranges that
+the callback methods are called. All the names inserted into the
+instance are the same as the names used for the objects, etc. in the
+fd file.
+.LP
+.ft C
+merge_full_form(instance, form, ftuple)
+.IP
+This function does the same as create_full_form, only it does not create
+the form itself nor the 'background box' that fdesign automatically
+adds to each form. This is useful if your class inherits a superclass
+that already defines a skeleton form (with 'OK' and 'Cancel' buttons,
+for instance), and you want to merge the new form into that existing
+form. The 'form' parameter is the form to which the new objects are
+added.
+.LP
+If you use the paradigm sketched here but need slightly more control
+over object creation there is a routine that creates a single object
+and inserts its name (and arranges for the callback routine to be
+called):
+.LP
+.ft C
+create_object_instance(instance, form, obj_template)
diff --git a/Lib/irix6/flp.py b/Lib/irix6/flp.py
new file mode 100644
index 0000000..14e2278
--- /dev/null
+++ b/Lib/irix6/flp.py
@@ -0,0 +1,455 @@
+#
+# flp - Module to load fl forms from fd files
+#
+# Jack Jansen, December 1991
+#
+import string
+import os
+import sys
+import FL
+
+SPLITLINE = '--------------------'
+FORMLINE = '=============== FORM ==============='
+ENDLINE = '=============================='
+
+error = 'flp.error'
+
+##################################################################
+# Part 1 - The parsing routines #
+##################################################################
+
+#
+# Externally visible function. Load form.
+#
+def parse_form(filename, formname):
+ forms = checkcache(filename)
+ if forms is None:
+ forms = parse_forms(filename)
+ if forms.has_key(formname):
+ return forms[formname]
+ else:
+ raise error, 'No such form in fd file'
+
+#
+# Externally visible function. Load all forms.
+#
+def parse_forms(filename):
+ forms = checkcache(filename)
+ if forms != None: return forms
+ fp = _open_formfile(filename)
+ nforms = _parse_fd_header(fp)
+ forms = {}
+ for i in range(nforms):
+ form = _parse_fd_form(fp, None)
+ forms[form[0].Name] = form
+ writecache(filename, forms)
+ return forms
+
+#
+# Internal: see if a cached version of the file exists
+#
+MAGIC = '.fdc'
+_internal_cache = {} # Used by frozen scripts only
+def checkcache(filename):
+ if _internal_cache.has_key(filename):
+ altforms = _internal_cache[filename]
+ return _unpack_cache(altforms)
+ import marshal
+ fp, filename = _open_formfile2(filename)
+ fp.close()
+ cachename = filename + 'c'
+ try:
+ fp = open(cachename, 'r')
+ except IOError:
+ #print 'flp: no cache file', cachename
+ return None
+ try:
+ if fp.read(4) != MAGIC:
+ print 'flp: bad magic word in cache file', cachename
+ return None
+ cache_mtime = rdlong(fp)
+ file_mtime = getmtime(filename)
+ if cache_mtime != file_mtime:
+ #print 'flp: outdated cache file', cachename
+ return None
+ #print 'flp: valid cache file', cachename
+ altforms = marshal.load(fp)
+ return _unpack_cache(altforms)
+ finally:
+ fp.close()
+
+def _unpack_cache(altforms):
+ forms = {}
+ for name in altforms.keys():
+ altobj, altlist = altforms[name]
+ obj = _newobj()
+ obj.make(altobj)
+ list = []
+ for altobj in altlist:
+ nobj = _newobj()
+ nobj.make(altobj)
+ list.append(nobj)
+ forms[name] = obj, list
+ return forms
+
+def rdlong(fp):
+ s = fp.read(4)
+ if len(s) != 4: return None
+ a, b, c, d = s[0], s[1], s[2], s[3]
+ return ord(a)<<24 | ord(b)<<16 | ord(c)<<8 | ord(d)
+
+def wrlong(fp, x):
+ a, b, c, d = (x>>24)&0xff, (x>>16)&0xff, (x>>8)&0xff, x&0xff
+ fp.write(chr(a) + chr(b) + chr(c) + chr(d))
+
+def getmtime(filename):
+ import os
+ from stat import ST_MTIME
+ try:
+ return os.stat(filename)[ST_MTIME]
+ except os.error:
+ return None
+
+#
+# Internal: write cached version of the form (parsing is too slow!)
+#
+def writecache(filename, forms):
+ import marshal
+ fp, filename = _open_formfile2(filename)
+ fp.close()
+ cachename = filename + 'c'
+ try:
+ fp = open(cachename, 'w')
+ except IOError:
+ print 'flp: can\'t create cache file', cachename
+ return # Never mind
+ fp.write('\0\0\0\0') # Seek back and write MAGIC when done
+ wrlong(fp, getmtime(filename))
+ altforms = _pack_cache(forms)
+ marshal.dump(altforms, fp)
+ fp.seek(0)
+ fp.write(MAGIC)
+ fp.close()
+ #print 'flp: wrote cache file', cachename
+
+#
+# External: print some statements that set up the internal cache.
+# This is for use with the "freeze" script. You should call
+# flp.freeze(filename) for all forms used by the script, and collect
+# the output on a file in a module file named "frozenforms.py". Then
+# in the main program of the script import frozenforms.
+# (Don't forget to take this out when using the unfrozen version of
+# the script!)
+#
+def freeze(filename):
+ forms = parse_forms(filename)
+ altforms = _pack_cache(forms)
+ print 'import flp'
+ print 'flp._internal_cache[', `filename`, '] =', altforms
+
+#
+# Internal: create the data structure to be placed in the cache
+#
+def _pack_cache(forms):
+ altforms = {}
+ for name in forms.keys():
+ obj, list = forms[name]
+ altobj = obj.__dict__
+ altlist = []
+ for obj in list: altlist.append(obj.__dict__)
+ altforms[name] = altobj, altlist
+ return altforms
+
+#
+# Internal: Locate form file (using PYTHONPATH) and open file
+#
+def _open_formfile(filename):
+ return _open_formfile2(filename)[0]
+
+def _open_formfile2(filename):
+ if filename[-3:] <> '.fd':
+ filename = filename + '.fd'
+ if filename[0] == '/':
+ try:
+ fp = open(filename,'r')
+ except IOError:
+ fp = None
+ else:
+ for pc in sys.path:
+ pn = os.path.join(pc, filename)
+ try:
+ fp = open(pn, 'r')
+ filename = pn
+ break
+ except IOError:
+ fp = None
+ if fp == None:
+ raise error, 'Cannot find forms file ' + filename
+ return fp, filename
+
+#
+# Internal: parse the fd file header, return number of forms
+#
+def _parse_fd_header(file):
+ # First read the magic header line
+ datum = _parse_1_line(file)
+ if datum <> ('Magic', 12321):
+ raise error, 'Not a forms definition file'
+ # Now skip until we know number of forms
+ while 1:
+ datum = _parse_1_line(file)
+ if type(datum) == type(()) and datum[0] == 'Numberofforms':
+ break
+ return datum[1]
+#
+# Internal: parse fd form, or skip if name doesn't match.
+# the special value None means 'allways parse it'.
+#
+def _parse_fd_form(file, name):
+ datum = _parse_1_line(file)
+ if datum <> FORMLINE:
+ raise error, 'Missing === FORM === line'
+ form = _parse_object(file)
+ if form.Name == name or name == None:
+ objs = []
+ for j in range(form.Numberofobjects):
+ obj = _parse_object(file)
+ objs.append(obj)
+ return (form, objs)
+ else:
+ for j in range(form.Numberofobjects):
+ _skip_object(file)
+ return None
+
+#
+# Internal class: a convient place to store object info fields
+#
+class _newobj:
+ def add(self, name, value):
+ self.__dict__[name] = value
+ def make(self, dict):
+ for name in dict.keys():
+ self.add(name, dict[name])
+
+#
+# Internal parsing routines.
+#
+def _parse_string(str):
+ if '\\' in str:
+ s = '\'' + str + '\''
+ try:
+ return eval(s)
+ except:
+ pass
+ return str
+
+def _parse_num(str):
+ return eval(str)
+
+def _parse_numlist(str):
+ slist = string.split(str)
+ nlist = []
+ for i in slist:
+ nlist.append(_parse_num(i))
+ return nlist
+
+# This dictionary maps item names to parsing routines.
+# If no routine is given '_parse_num' is default.
+_parse_func = { \
+ 'Name': _parse_string, \
+ 'Box': _parse_numlist, \
+ 'Colors': _parse_numlist, \
+ 'Label': _parse_string, \
+ 'Name': _parse_string, \
+ 'Callback': _parse_string, \
+ 'Argument': _parse_string }
+
+# This function parses a line, and returns either
+# a string or a tuple (name,value)
+
+import regex
+prog = regex.compile('^\([^:]*\): *\(.*\)')
+
+def _parse_line(line):
+ if prog.match(line) < 0:
+ return line
+ a = prog.regs
+ name = line[:a[1][1]]
+ if name[0] == 'N':
+ name = string.joinfields(string.split(name),'')
+ name = string.lower(name)
+ name = string.upper(name[0]) + name[1:]
+ value = line[a[2][0]:]
+ try:
+ pf = _parse_func[name]
+ except KeyError:
+ pf = _parse_num
+ value = pf(value)
+ return (name, value)
+
+def _readline(file):
+ line = file.readline()
+ if not line:
+ raise EOFError
+ return line[:-1]
+
+def _parse_1_line(file):
+ line = _readline(file)
+ while line == '':
+ line = _readline(file)
+ return _parse_line(line)
+
+def _skip_object(file):
+ line = ''
+ while not line in (SPLITLINE, FORMLINE, ENDLINE):
+ pos = file.tell()
+ line = _readline(file)
+ if line == FORMLINE:
+ file.seek(pos)
+
+def _parse_object(file):
+ obj = _newobj()
+ while 1:
+ pos = file.tell()
+ datum = _parse_1_line(file)
+ if datum in (SPLITLINE, FORMLINE, ENDLINE):
+ if datum == FORMLINE:
+ file.seek(pos)
+ return obj
+ if type(datum) <> type(()) or len(datum) <> 2:
+ raise error, 'Parse error, illegal line in object: '+datum
+ obj.add(datum[0], datum[1])
+
+#################################################################
+# Part 2 - High-level object/form creation routines #
+#################################################################
+
+#
+# External - Create a form an link to an instance variable.
+#
+def create_full_form(inst, (fdata, odatalist)):
+ form = create_form(fdata)
+ exec 'inst.'+fdata.Name+' = form\n'
+ for odata in odatalist:
+ create_object_instance(inst, form, odata)
+
+#
+# External - Merge a form into an existing form in an instance
+# variable.
+#
+def merge_full_form(inst, form, (fdata, odatalist)):
+ exec 'inst.'+fdata.Name+' = form\n'
+ if odatalist[0].Class <> FL.BOX:
+ raise error, 'merge_full_form() expects FL.BOX as first obj'
+ for odata in odatalist[1:]:
+ create_object_instance(inst, form, odata)
+
+
+#################################################################
+# Part 3 - Low-level object/form creation routines #
+#################################################################
+
+#
+# External Create_form - Create form from parameters
+#
+def create_form(fdata):
+ import fl
+ return fl.make_form(FL.NO_BOX, fdata.Width, fdata.Height)
+
+#
+# External create_object - Create an object. Make sure there are
+# no callbacks. Returns the object created.
+#
+def create_object(form, odata):
+ obj = _create_object(form, odata)
+ if odata.Callback:
+ raise error, 'Creating free object with callback'
+ return obj
+#
+# External create_object_instance - Create object in an instance.
+#
+def create_object_instance(inst, form, odata):
+ obj = _create_object(form, odata)
+ if odata.Callback:
+ cbfunc = eval('inst.'+odata.Callback)
+ obj.set_call_back(cbfunc, odata.Argument)
+ if odata.Name:
+ exec 'inst.' + odata.Name + ' = obj\n'
+#
+# Internal _create_object: Create the object and fill options
+#
+def _create_object(form, odata):
+ crfunc = _select_crfunc(form, odata.Class)
+ obj = crfunc(odata.Type, odata.Box[0], odata.Box[1], odata.Box[2], \
+ odata.Box[3], odata.Label)
+ if not odata.Class in (FL.BEGIN_GROUP, FL.END_GROUP):
+ obj.boxtype = odata.Boxtype
+ obj.col1 = odata.Colors[0]
+ obj.col2 = odata.Colors[1]
+ obj.align = odata.Alignment
+ obj.lstyle = odata.Style
+ obj.lsize = odata.Size
+ obj.lcol = odata.Lcol
+ return obj
+#
+# Internal crfunc: helper function that returns correct create function
+#
+def _select_crfunc(fm, cl):
+ if cl == FL.BEGIN_GROUP: return fm.bgn_group
+ elif cl == FL.END_GROUP: return fm.end_group
+ elif cl == FL.BITMAP: return fm.add_bitmap
+ elif cl == FL.BOX: return fm.add_box
+ elif cl == FL.BROWSER: return fm.add_browser
+ elif cl == FL.BUTTON: return fm.add_button
+ elif cl == FL.CHART: return fm.add_chart
+ elif cl == FL.CHOICE: return fm.add_choice
+ elif cl == FL.CLOCK: return fm.add_clock
+ elif cl == FL.COUNTER: return fm.add_counter
+ elif cl == FL.DIAL: return fm.add_dial
+ elif cl == FL.FREE: return fm.add_free
+ elif cl == FL.INPUT: return fm.add_input
+ elif cl == FL.LIGHTBUTTON: return fm.add_lightbutton
+ elif cl == FL.MENU: return fm.add_menu
+ elif cl == FL.POSITIONER: return fm.add_positioner
+ elif cl == FL.ROUNDBUTTON: return fm.add_roundbutton
+ elif cl == FL.SLIDER: return fm.add_slider
+ elif cl == FL.VALSLIDER: return fm.add_valslider
+ elif cl == FL.TEXT: return fm.add_text
+ elif cl == FL.TIMER: return fm.add_timer
+ else:
+ raise error, 'Unknown object type: ' + `cl`
+
+
+def test():
+ import time
+ t0 = time.time()
+ if len(sys.argv) == 2:
+ forms = parse_forms(sys.argv[1])
+ t1 = time.time()
+ print 'parse time:', 0.001*(t1-t0), 'sec.'
+ keys = forms.keys()
+ keys.sort()
+ for i in keys:
+ _printform(forms[i])
+ elif len(sys.argv) == 3:
+ form = parse_form(sys.argv[1], sys.argv[2])
+ t1 = time.time()
+ print 'parse time:', round(t1-t0, 3), 'sec.'
+ _printform(form)
+ else:
+ print 'Usage: test fdfile [form]'
+
+def _printform(form):
+ f = form[0]
+ objs = form[1]
+ print 'Form ', f.Name, ', size: ', f.Width, f.Height, ' Nobj ', f.Numberofobjects
+ for i in objs:
+ print ' Obj ', i.Name, ' type ', i.Class, i.Type
+ print ' Box ', i.Box, ' btype ', i.Boxtype
+ print ' Label ', i.Label, ' size/style/col/align ', i.Size,i.Style, i.Lcol, i.Alignment
+ print ' cols ', i.Colors
+ print ' cback ', i.Callback, i.Argument
+
+# Local variables:
+# py-indent-offset: 4
+# end:
diff --git a/Lib/irix6/jpeg.py b/Lib/irix6/jpeg.py
new file mode 100644
index 0000000..85d6d83
--- /dev/null
+++ b/Lib/irix6/jpeg.py
@@ -0,0 +1,110 @@
+# Implement 'jpeg' interface using SGI's compression library
+
+# XXX Options 'smooth' and 'optimize' are ignored.
+
+# XXX It appears that compressing grayscale images doesn't work right;
+# XXX the resulting file causes weirdness.
+
+error = 'jpeg.error' # Exception
+
+options = {'quality': 75, 'optimize': 0, 'smooth': 0, 'forcegray': 0}
+
+comp = None
+decomp = None
+
+def compress(imgdata, width, height, bytesperpixel):
+ global comp
+ import cl, CL
+ if comp is None: comp = cl.OpenCompressor(CL.JPEG)
+ if bytesperpixel == 1:
+ format = CL.GRAYSCALE
+ elif bytesperpixel == 4:
+ format = CL.RGBX
+ if options['forcegray']:
+ iformat = CL.GRAYSCALE
+ else:
+ iformat = CL.YUV
+ # XXX How to support 'optimize'?
+ params = [CL.IMAGE_WIDTH, width, CL.IMAGE_HEIGHT, height, \
+ CL.ORIGINAL_FORMAT, format, \
+ CL.ORIENTATION, CL.BOTTOM_UP, \
+ CL.QUALITY_FACTOR, options['quality'], \
+ CL.INTERNAL_FORMAT, iformat, \
+ ]
+ comp.SetParams(params)
+ jpegdata = comp.Compress(1, imgdata)
+ return jpegdata
+
+def decompress(jpegdata):
+ global decomp
+ import cl, CL
+ if decomp is None: decomp = cl.OpenDecompressor(CL.JPEG)
+ headersize = decomp.ReadHeader(jpegdata)
+ params = [CL.IMAGE_WIDTH, 0, CL.IMAGE_HEIGHT, 0, CL.INTERNAL_FORMAT, 0]
+ decomp.GetParams(params)
+ width, height, format = params[1], params[3], params[5]
+ if format == CL.GRAYSCALE or options['forcegray']:
+ format = CL.GRAYSCALE
+ bytesperpixel = 1
+ else:
+ format = CL.RGBX
+ bytesperpixel = 4
+ # XXX How to support 'smooth'?
+ params = [CL.ORIGINAL_FORMAT, format, \
+ CL.ORIENTATION, CL.BOTTOM_UP, \
+ CL.FRAME_BUFFER_SIZE, width*height*bytesperpixel]
+ decomp.SetParams(params)
+ imgdata = decomp.Decompress(1, jpegdata)
+ return imgdata, width, height, bytesperpixel
+
+def setoption(name, value):
+ if type(value) <> type(0):
+ raise TypeError, 'jpeg.setoption: numeric options only'
+ if name == 'forcegrey':
+ name = 'forcegray'
+ if not options.has_key(name):
+ raise KeyError, 'jpeg.setoption: unknown option name'
+ options[name] = int(value)
+
+def test():
+ import sys
+ if sys.argv[1:2] == ['-g']:
+ del sys.argv[1]
+ setoption('forcegray', 1)
+ if not sys.argv[1:]:
+ sys.argv.append('/usr/local/images/data/jpg/asterix.jpg')
+ for file in sys.argv[1:]:
+ show(file)
+
+def show(file):
+ import gl, GL, DEVICE
+ jpegdata = open(file, 'r').read()
+ imgdata, width, height, bytesperpixel = decompress(jpegdata)
+ gl.foreground()
+ gl.prefsize(width, height)
+ win = gl.winopen(file)
+ if bytesperpixel == 1:
+ gl.cmode()
+ gl.pixmode(GL.PM_SIZE, 8)
+ gl.gconfig()
+ for i in range(256):
+ gl.mapcolor(i, i, i, i)
+ else:
+ gl.RGBmode()
+ gl.pixmode(GL.PM_SIZE, 32)
+ gl.gconfig()
+ gl.qdevice(DEVICE.REDRAW)
+ gl.qdevice(DEVICE.ESCKEY)
+ gl.qdevice(DEVICE.WINQUIT)
+ gl.qdevice(DEVICE.WINSHUT)
+ gl.lrectwrite(0, 0, width-1, height-1, imgdata)
+ while 1:
+ dev, val = gl.qread()
+ if dev in (DEVICE.ESCKEY, DEVICE.WINSHUT, DEVICE.WINQUIT):
+ break
+ if dev == DEVICE.REDRAW:
+ gl.lrectwrite(0, 0, width-1, height-1, imgdata)
+ gl.winclose(win)
+ # Now test the compression and write the result to a fixed filename
+ newjpegdata = compress(imgdata, width, height, bytesperpixel)
+ open('/tmp/j.jpg', 'w').write(newjpegdata)
diff --git a/Lib/irix6/panel.py b/Lib/irix6/panel.py
new file mode 100644
index 0000000..2c0365c
--- /dev/null
+++ b/Lib/irix6/panel.py
@@ -0,0 +1,281 @@
+# Module 'panel'
+#
+# Support for the Panel library.
+# Uses built-in module 'pnl'.
+# Applciations should use 'panel.function' instead of 'pnl.function';
+# most 'pnl' functions are transparently exported by 'panel',
+# but dopanel() is overridden and you have to use this version
+# if you want to use callbacks.
+
+
+import pnl
+
+
+debug = 0
+
+
+# Test if an object is a list.
+#
+def is_list(x):
+ return type(x) == type([])
+
+
+# Reverse a list.
+#
+def reverse(list):
+ res = []
+ for item in list:
+ res.insert(0, item)
+ return res
+
+
+# Get an attribute of a list, which may itself be another list.
+# Don't use 'prop' for name.
+#
+def getattrlist(list, name):
+ for item in list:
+ if item and is_list(item) and item[0] == name:
+ return item[1:]
+ return []
+
+
+# Get a property of a list, which may itself be another list.
+#
+def getproplist(list, name):
+ for item in list:
+ if item and is_list(item) and item[0] == 'prop':
+ if len(item) > 1 and item[1] == name:
+ return item[2:]
+ return []
+
+
+# Test if an actuator description contains the property 'end-of-group'
+#
+def is_endgroup(list):
+ x = getproplist(list, 'end-of-group')
+ return (x and x[0] == '#t')
+
+
+# Neatly display an actuator definition given as S-expression
+# the prefix string is printed before each line.
+#
+def show_actuator(prefix, a):
+ for item in a:
+ if not is_list(item):
+ print prefix, item
+ elif item and item[0] == 'al':
+ print prefix, 'Subactuator list:'
+ for a in item[1:]:
+ show_actuator(prefix + ' ', a)
+ elif len(item) == 2:
+ print prefix, item[0], '=>', item[1]
+ elif len(item) == 3 and item[0] == 'prop':
+ print prefix, 'Prop', item[1], '=>',
+ print item[2]
+ else:
+ print prefix, '?', item
+
+
+# Neatly display a panel.
+#
+def show_panel(prefix, p):
+ for item in p:
+ if not is_list(item):
+ print prefix, item
+ elif item and item[0] == 'al':
+ print prefix, 'Actuator list:'
+ for a in item[1:]:
+ show_actuator(prefix + ' ', a)
+ elif len(item) == 2:
+ print prefix, item[0], '=>', item[1]
+ elif len(item) == 3 and item[0] == 'prop':
+ print prefix, 'Prop', item[1], '=>',
+ print item[2]
+ else:
+ print prefix, '?', item
+
+
+# Exception raised by build_actuator or build_panel.
+#
+panel_error = 'panel error'
+
+
+# Dummy callback used to initialize the callbacks.
+#
+def dummy_callback(arg):
+ pass
+
+
+# Assign attributes to members of the target.
+# Attribute names in exclist are ignored.
+# The member name is the attribute name prefixed with the prefix.
+#
+def assign_members(target, attrlist, exclist, prefix):
+ for item in attrlist:
+ if is_list(item) and len(item) == 2 and item[0] not in exclist:
+ name, value = item[0], item[1]
+ ok = 1
+ if value[0] in '-0123456789':
+ value = eval(value)
+ elif value[0] == '"':
+ value = value[1:-1]
+ elif value == 'move-then-resize':
+ # Strange default set by Panel Editor...
+ ok = 0
+ else:
+ print 'unknown value', value, 'for', name
+ ok = 0
+ if ok:
+ lhs = 'target.' + prefix + name
+ stmt = lhs + '=' + `value`
+ if debug: print 'exec', stmt
+ try:
+ exec stmt + '\n'
+ except KeyboardInterrupt: # Don't catch this!
+ raise KeyboardInterrupt
+ except:
+ print 'assign failed:', stmt
+
+
+# Build a real actuator from an actuator descriptior.
+# Return a pair (actuator, name).
+#
+def build_actuator(descr):
+ namelist = getattrlist(descr, 'name')
+ if namelist:
+ # Assume it is a string
+ actuatorname = namelist[0][1:-1]
+ else:
+ actuatorname = ''
+ type = descr[0]
+ if type[:4] == 'pnl_': type = type[4:]
+ act = pnl.mkact(type)
+ act.downfunc = act.activefunc = act.upfunc = dummy_callback
+ #
+ assign_members(act, descr[1:], ['al', 'data', 'name'], '')
+ #
+ # Treat actuator-specific data
+ #
+ datalist = getattrlist(descr, 'data')
+ prefix = ''
+ if type[-4:] == 'puck':
+ prefix = 'puck_'
+ elif type == 'mouse':
+ prefix = 'mouse_'
+ assign_members(act, datalist, [], prefix)
+ #
+ return act, actuatorname
+
+
+# Build all sub-actuators and add them to the super-actuator.
+# The super-actuator must already have been added to the panel.
+# Sub-actuators with defined names are added as members to the panel
+# so they can be referenced as p.name.
+#
+# Note: I have no idea how panel.endgroup() works when applied
+# to a sub-actuator.
+#
+def build_subactuators(panel, super_act, al):
+ #
+ # This is nearly the same loop as below in build_panel(),
+ # except a call is made to addsubact() instead of addact().
+ #
+ for a in al:
+ act, name = build_actuator(a)
+ act.addsubact(super_act)
+ if name:
+ stmt = 'panel.' + name + ' = act'
+ if debug: print 'exec', stmt
+ exec stmt + '\n'
+ if is_endgroup(a):
+ panel.endgroup()
+ sub_al = getattrlist(a, 'al')
+ if sub_al:
+ build_subactuators(panel, act, sub_al)
+ #
+ # Fix the actuator to which whe just added subactuators.
+ # This can't hurt (I hope) and is needed for the scroll actuator.
+ #
+ super_act.fixact()
+
+
+# Build a real panel from a panel definition.
+# Return a panel object p, where for each named actuator a, p.name is a
+# reference to a.
+#
+def build_panel(descr):
+ #
+ # Sanity check
+ #
+ if (not descr) or descr[0] <> 'panel':
+ raise panel_error, 'panel description must start with "panel"'
+ #
+ if debug: show_panel('', descr)
+ #
+ # Create an empty panel
+ #
+ panel = pnl.mkpanel()
+ #
+ # Assign panel attributes
+ #
+ assign_members(panel, descr[1:], ['al'], '')
+ #
+ # Look for actuator list
+ #
+ al = getattrlist(descr, 'al')
+ #
+ # The order in which actuators are created is important
+ # because of the endgroup() operator.
+ # Unfortunately the Panel Editor outputs the actuator list
+ # in reverse order, so we reverse it here.
+ #
+ al = reverse(al)
+ #
+ for a in al:
+ act, name = build_actuator(a)
+ act.addact(panel)
+ if name:
+ stmt = 'panel.' + name + ' = act'
+ exec stmt + '\n'
+ if is_endgroup(a):
+ panel.endgroup()
+ sub_al = getattrlist(a, 'al')
+ if sub_al:
+ build_subactuators(panel, act, sub_al)
+ #
+ return panel
+
+
+# Wrapper around pnl.dopanel() which calls call-back functions.
+#
+def my_dopanel():
+ # Extract only the first 4 elements to allow for future expansion
+ a, down, active, up = pnl.dopanel()[:4]
+ if down:
+ down.downfunc(down)
+ if active:
+ active.activefunc(active)
+ if up:
+ up.upfunc(up)
+ return a
+
+
+# Create one or more panels from a description file (S-expressions)
+# generated by the Panel Editor.
+#
+def defpanellist(file):
+ import panelparser
+ descrlist = panelparser.parse_file(open(file, 'r'))
+ panellist = []
+ for descr in descrlist:
+ panellist.append(build_panel(descr))
+ return panellist
+
+
+# Import everything from built-in method pnl, so the user can always
+# use panel.foo() instead of pnl.foo().
+# This gives *no* performance penalty once this module is imported.
+#
+from pnl import * # for export
+
+dopanel = my_dopanel # override pnl.dopanel
diff --git a/Lib/irix6/panelparser.py b/Lib/irix6/panelparser.py
new file mode 100644
index 0000000..1b069fa
--- /dev/null
+++ b/Lib/irix6/panelparser.py
@@ -0,0 +1,128 @@
+# Module 'parser'
+#
+# Parse S-expressions output by the Panel Editor
+# (which is written in Scheme so it can't help writing S-expressions).
+#
+# See notes at end of file.
+
+
+whitespace = ' \t\n'
+operators = '()\''
+separators = operators + whitespace + ';' + '"'
+
+
+# Tokenize a string.
+# Return a list of tokens (strings).
+#
+def tokenize_string(s):
+ tokens = []
+ while s:
+ c = s[:1]
+ if c in whitespace:
+ s = s[1:]
+ elif c == ';':
+ s = ''
+ elif c == '"':
+ n = len(s)
+ i = 1
+ while i < n:
+ c = s[i]
+ i = i+1
+ if c == '"': break
+ if c == '\\': i = i+1
+ tokens.append(s[:i])
+ s = s[i:]
+ elif c in operators:
+ tokens.append(c)
+ s = s[1:]
+ else:
+ n = len(s)
+ i = 1
+ while i < n:
+ if s[i] in separators: break
+ i = i+1
+ tokens.append(s[:i])
+ s = s[i:]
+ return tokens
+
+
+# Tokenize a whole file (given as file object, not as file name).
+# Return a list of tokens (strings).
+#
+def tokenize_file(fp):
+ tokens = []
+ while 1:
+ line = fp.readline()
+ if not line: break
+ tokens = tokens + tokenize_string(line)
+ return tokens
+
+
+# Exception raised by parse_exr.
+#
+syntax_error = 'syntax error'
+
+
+# Parse an S-expression.
+# Input is a list of tokens as returned by tokenize_*().
+# Return a pair (expr, tokens)
+# where expr is a list representing the s-expression,
+# and tokens contains the remaining tokens.
+# May raise syntax_error.
+#
+def parse_expr(tokens):
+ if (not tokens) or tokens[0] <> '(':
+ raise syntax_error, 'expected "("'
+ tokens = tokens[1:]
+ expr = []
+ while 1:
+ if not tokens:
+ raise syntax_error, 'missing ")"'
+ if tokens[0] == ')':
+ return expr, tokens[1:]
+ elif tokens[0] == '(':
+ subexpr, tokens = parse_expr(tokens)
+ expr.append(subexpr)
+ else:
+ expr.append(tokens[0])
+ tokens = tokens[1:]
+
+
+# Parse a file (given as file object, not as file name).
+# Return a list of parsed S-expressions found at the top level.
+#
+def parse_file(fp):
+ tokens = tokenize_file(fp)
+ exprlist = []
+ while tokens:
+ expr, tokens = parse_expr(tokens)
+ exprlist.append(expr)
+ return exprlist
+
+
+# EXAMPLE:
+#
+# The input
+# '(hip (hop hur-ray))'
+#
+# passed to tokenize_string() returns the token list
+# ['(', 'hip', '(', 'hop', 'hur-ray', ')', ')']
+#
+# When this is passed to parse_expr() it returns the expression
+# ['hip', ['hop', 'hur-ray']]
+# plus an empty token list (because there are no tokens left.
+#
+# When a file containing the example is passed to parse_file() it returns
+# a list whose only element is the output of parse_expr() above:
+# [['hip', ['hop', 'hur-ray']]]
+
+
+# TOKENIZING:
+#
+# Comments start with semicolon (;) and continue till the end of the line.
+#
+# Tokens are separated by whitespace, except the following characters
+# always form a separate token (outside strings):
+# ( ) '
+# Strings are enclosed in double quotes (") and backslash (\) is used
+# as escape character in strings.
diff --git a/Lib/irix6/readcd.doc b/Lib/irix6/readcd.doc
new file mode 100644
index 0000000..1be549c
--- /dev/null
+++ b/Lib/irix6/readcd.doc
@@ -0,0 +1,104 @@
+Interface to CD-ROM player.
+
+This module implements an interface to the built-in cd module. The
+intention is to provide a more user-friendly interface than the
+built-in module.
+
+The module defines a class Readcd with several methods. The
+initialization of the class will try to open the CD player. This
+means that initialization will fail if the CD player is already in
+use. A RuntimeError will be raised by the cd module in that case.
+
+The way to work with this module is as follows. The user specifies
+the parts of the CD that are to be read and he specifies callback
+functions which are to be called by the system. At some point he can
+tell the system to play. The specified parts of the CD will then be
+read and the callbacks will be called.
+
+Initialization.
+===============
+
+r = readcd.Readcd([cd-player [, mode]])
+
+The optional arguments are the name of the CD device and the mode.
+When "mode" is not specified, it defaults to 'r' (which is the only
+possible value); when "cd-player" also isn't specified, it defaults
+to "None" which indicates the default CD player.
+
+Methods.
+========
+
+eject() -- Eject the CD from the player.
+
+reset() -- Reset the list of data stretches to be played.
+
+appendtrack(track) -- Append the specified track to the list of music
+stretches.
+
+appendstretch(first, last) -- Append the stretch from "first" to "last"
+to the list of music stretches. Both "first" and "last" can be in one
+of four forms. "None": for "first", the beginning of the CD, for
+"last" the end of the CD; a single integer: a track number--playing
+starts at the beginning of the track or ends at the end of the
+specified track; a three-tuple: the absolute time from the start of
+the CD in minutes, seconds, frames; a four-tuple: track number and
+relative time within the track in minutes, seconds, frames.
+
+settracks(tracklist) -- The argument is a list of integers. The list
+of stretches is set to argument list. The old list is discarded.
+
+setcallback(type, func, arg) -- Set a callback function for "type".
+The function will be called as func(arg, type, data) where "arg" is
+the third argument of setcallback, "type" is the type of callback,
+"data" is type-dependent data. See the CDsetcallback(3) manual page
+for more information. The possible "type" arguments are defined in
+the CD module.
+
+removecallback(type) -- Remove the callback for "type".
+
+gettrackinfo([tracklist]) -- Return a list of tuples. Each tuple
+consists of start and length information of a track. The start and
+length information consist of three-tuples with minutes, seconds and
+frames. The optional tracklist argument gives a list of interesting
+track numbers. If no tracklist is specified, information about all
+tracks is returned.
+
+getstatus() -- Return the status information of the CD.
+
+play() -- Play the preprogrammed stretches of music from the CD. When
+nothing was programmed, the whole CD is played.
+
+Specifying stretches.
+=====================
+
+There are three methods available to specify a stretch of music to be
+played. The easiest way is to use "settracklist(tracklist)" with which
+a list of tracks can be specified. "settracklist(tracklist)" is
+equivalent to the sequence
+ reset()
+ for track in tracklist:
+ appendtrack(track)
+
+The next method is "appendtrack(track)" with which a whole track can be
+added to the list of music to be played. "appendtrack(track)" is
+equivalent to "appendstretch(track, track)".
+
+The most complete method is "appendstretch(first, last)". Using this
+method, it is possible to specify any stretch of music.
+
+When two consecutive tracks are played, it is possible to choose
+whether the pause that may be between the tracks is played as well or
+whether the pause should be skipped. When the end of a stretch is
+specified using a track number and the next stretch starts at the
+beginning of the following track and that was also specified using the
+track number (that is, both were specified as integers, not as tuples),
+the pause is played. When either value was specified using absolute
+time or track-relative time (that is, as three-tuple or as
+four-tuple), the pause will not be played.
+
+Errors.
+=======
+
+When an error occurs, an exception will be raised. Depending on where
+the error occurs, the exception may either be "readcd.Error" or
+"RuntimeError".
diff --git a/Lib/irix6/readcd.py b/Lib/irix6/readcd.py
new file mode 100644
index 0000000..5c4b824
--- /dev/null
+++ b/Lib/irix6/readcd.py
@@ -0,0 +1,242 @@
+# Class interface to the CD module.
+
+import cd, CD
+
+Error = 'Readcd.Error'
+_Stop = 'Readcd.Stop'
+
+def _doatime(self, cb_type, data):
+ if ((data[0] * 60) + data[1]) * 75 + data[2] > self.end:
+## print 'done with list entry',`self.listindex`
+ raise _Stop
+ func, arg = self.callbacks[cb_type]
+ if func:
+ func(arg, cb_type, data)
+
+def _dopnum(self, cb_type, data):
+ if data > self.end:
+## print 'done with list entry',`self.listindex`
+ raise _Stop
+ func, arg = self.callbacks[cb_type]
+ if func:
+ func(arg, cb_type, data)
+
+class Readcd:
+ def __init__(self, *arg):
+ if len(arg) == 0:
+ self.player = cd.open()
+ elif len(arg) == 1:
+ self.player = cd.open(arg[0])
+ elif len(arg) == 2:
+ self.player = cd.open(arg[0], arg[1])
+ else:
+ raise Error, 'bad __init__ call'
+ self.list = []
+ self.callbacks = [(None, None)] * 8
+ self.parser = cd.createparser()
+ self.playing = 0
+ self.end = 0
+ self.status = None
+ self.trackinfo = None
+
+ def eject(self):
+ self.player.eject()
+ self.list = []
+ self.end = 0
+ self.listindex = 0
+ self.status = None
+ self.trackinfo = None
+ if self.playing:
+## print 'stop playing from eject'
+ raise _Stop
+
+ def pmsf2msf(self, track, min, sec, frame):
+ if not self.status:
+ self.cachestatus()
+ if track < self.status[5] or track > self.status[6]:
+ raise Error, 'track number out of range'
+ if not self.trackinfo:
+ self.cacheinfo()
+ start, total = self.trackinfo[track]
+ start = ((start[0] * 60) + start[1]) * 75 + start[2]
+ total = ((total[0] * 60) + total[1]) * 75 + total[2]
+ block = ((min * 60) + sec) * 75 + frame
+ if block > total:
+ raise Error, 'out of range'
+ block = start + block
+ min, block = divmod(block, 75*60)
+ sec, frame = divmod(block, 75)
+ return min, sec, frame
+
+ def reset(self):
+ self.list = []
+
+ def appendtrack(self, track):
+ self.appendstretch(track, track)
+
+ def appendstretch(self, start, end):
+ if not self.status:
+ self.cachestatus()
+ if not start:
+ start = 1
+ if not end:
+ end = self.status[6]
+ if type(end) == type(0):
+ if end < self.status[5] or end > self.status[6]:
+ raise Error, 'range error'
+ else:
+ l = len(end)
+ if l == 4:
+ prog, min, sec, frame = end
+ if prog < self.status[5] or prog > self.status[6]:
+ raise Error, 'range error'
+ end = self.pmsf2msf(prog, min, sec, frame)
+ elif l <> 3:
+ raise Error, 'syntax error'
+ if type(start) == type(0):
+ if start < self.status[5] or start > self.status[6]:
+ raise Error, 'range error'
+ if len(self.list) > 0:
+ s, e = self.list[-1]
+ if type(e) == type(0):
+ if start == e+1:
+ start = s
+ del self.list[-1]
+ else:
+ l = len(start)
+ if l == 4:
+ prog, min, sec, frame = start
+ if prog < self.status[5] or prog > self.status[6]:
+ raise Error, 'range error'
+ start = self.pmsf2msf(prog, min, sec, frame)
+ elif l <> 3:
+ raise Error, 'syntax error'
+ self.list.append((start, end))
+
+ def settracks(self, list):
+ self.list = []
+ for track in list:
+ self.appendtrack(track)
+
+ def setcallback(self, cb_type, func, arg):
+ if cb_type < 0 or cb_type >= 8:
+ raise Error, 'type out of range'
+ self.callbacks[cb_type] = (func, arg)
+ if self.playing:
+ start, end = self.list[self.listindex]
+ if type(end) == type(0):
+ if cb_type <> CD.PNUM:
+ self.parser.setcallback(cb_type, func, arg)
+ else:
+ if cb_type <> CD.ATIME:
+ self.parser.setcallback(cb_type, func, arg)
+
+ def removecallback(self, cb_type):
+ if cb_type < 0 or cb_type >= 8:
+ raise Error, 'type out of range'
+ self.callbacks[cb_type] = (None, None)
+ if self.playing:
+ start, end = self.list[self.listindex]
+ if type(end) == type(0):
+ if cb_type <> CD.PNUM:
+ self.parser.removecallback(cb_type)
+ else:
+ if cb_type <> CD.ATIME:
+ self.parser.removecallback(cb_type)
+
+ def gettrackinfo(self, *arg):
+ if not self.status:
+ self.cachestatus()
+ if not self.trackinfo:
+ self.cacheinfo()
+ if len(arg) == 0:
+ return self.trackinfo[self.status[5]:self.status[6]+1]
+ result = []
+ for i in arg:
+ if i < self.status[5] or i > self.status[6]:
+ raise Error, 'range error'
+ result.append(self.trackinfo[i])
+ return result
+
+ def cacheinfo(self):
+ if not self.status:
+ self.cachestatus()
+ self.trackinfo = []
+ for i in range(self.status[5]):
+ self.trackinfo.append(None)
+ for i in range(self.status[5], self.status[6]+1):
+ self.trackinfo.append(self.player.gettrackinfo(i))
+
+ def cachestatus(self):
+ self.status = self.player.getstatus()
+ if self.status[0] == CD.NODISC:
+ self.status = None
+ raise Error, 'no disc in player'
+
+ def getstatus(self):
+ return self.player.getstatus()
+
+ def play(self):
+ if not self.status:
+ self.cachestatus()
+ size = self.player.bestreadsize()
+ self.listindex = 0
+ self.playing = 0
+ for i in range(8):
+ func, arg = self.callbacks[i]
+ if func:
+ self.parser.setcallback(i, func, arg)
+ else:
+ self.parser.removecallback(i)
+ if len(self.list) == 0:
+ for i in range(self.status[5], self.status[6]+1):
+ self.appendtrack(i)
+ try:
+ while 1:
+ if not self.playing:
+ if self.listindex >= len(self.list):
+ return
+ start, end = self.list[self.listindex]
+ if type(start) == type(0):
+ dummy = self.player.seektrack(
+ start)
+ else:
+ min, sec, frame = start
+ dummy = self.player.seek(
+ min, sec, frame)
+ if type(end) == type(0):
+ self.parser.setcallback(
+ CD.PNUM, _dopnum, self)
+ self.end = end
+ func, arg = \
+ self.callbacks[CD.ATIME]
+ if func:
+ self.parser.setcallback(CD.ATIME, func, arg)
+ else:
+ self.parser.removecallback(CD.ATIME)
+ else:
+ min, sec, frame = end
+ self.parser.setcallback(
+ CD.ATIME, _doatime,
+ self)
+ self.end = (min * 60 + sec) * \
+ 75 + frame
+ func, arg = \
+ self.callbacks[CD.PNUM]
+ if func:
+ self.parser.setcallback(CD.PNUM, func, arg)
+ else:
+ self.parser.removecallback(CD.PNUM)
+ self.playing = 1
+ data = self.player.readda(size)
+ if data == '':
+ self.playing = 0
+ self.listindex = self.listindex + 1
+ continue
+ try:
+ self.parser.parseframe(data)
+ except _Stop:
+ self.playing = 0
+ self.listindex = self.listindex + 1
+ finally:
+ self.playing = 0
diff --git a/Lib/irix6/regen b/Lib/irix6/regen
new file mode 100755
index 0000000..4c4ea5c
--- /dev/null
+++ b/Lib/irix6/regen
@@ -0,0 +1,13 @@
+#! /bin/sh
+case `uname -sr` in
+'IRIX '[45].*) ;;
+*) echo Probably not on an IRIX system 1>&2
+ exit 1;;
+esac
+set -v
+h2py /usr/include/sys/fcntl.h
+h2py /usr/include/sys/file.h
+h2py /usr/include/sys/socket.h
+h2py -i '(u_long)' /usr/include/netinet/in.h
+h2py /usr/include/sys/termios.h
+h2py /usr/include/errno.h
diff --git a/Lib/irix6/torgb.py b/Lib/irix6/torgb.py
new file mode 100644
index 0000000..f283063
--- /dev/null
+++ b/Lib/irix6/torgb.py
@@ -0,0 +1,97 @@
+# Convert "arbitrary" image files to rgb files (SGI's image format).
+# Input may be compressed.
+# The uncompressed file type may be PBM, PGM, PPM, GIF, TIFF, or Sun raster.
+# An exception is raised if the file is not of a recognized type.
+# Returned filename is either the input filename or a temporary filename;
+# in the latter case the caller must ensure that it is removed.
+# Other temporary files used are removed by the function.
+
+import os
+import tempfile
+import pipes
+import imghdr
+
+table = {}
+
+t = pipes.Template()
+t.append('fromppm $IN $OUT', 'ff')
+table['ppm'] = t
+
+t = pipes.Template()
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['pnm'] = t
+table['pgm'] = t
+table['pbm'] = t
+
+t = pipes.Template()
+t.append('fromgif $IN $OUT', 'ff')
+table['gif'] = t
+
+t = pipes.Template()
+t.append('tifftopnm', '--')
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['tiff'] = t
+
+t = pipes.Template()
+t.append('rasttopnm', '--')
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['rast'] = t
+
+t = pipes.Template()
+t.append('djpeg', '--')
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['jpeg'] = t
+
+uncompress = pipes.Template()
+uncompress.append('uncompress', '--')
+
+
+error = 'torgb.error' # Exception
+
+def torgb(filename):
+ temps = []
+ ret = None
+ try:
+ ret = _torgb(filename, temps)
+ finally:
+ for temp in temps[:]:
+ if temp <> ret:
+ try:
+ os.unlink(temp)
+ except os.error:
+ pass
+ temps.remove(temp)
+ return ret
+
+def _torgb(filename, temps):
+ if filename[-2:] == '.Z':
+ fname = tempfile.mktemp()
+ temps.append(fname)
+ sts = uncompress.copy(filename, fname)
+ if sts:
+ raise error, filename + ': uncompress failed'
+ else:
+ fname = filename
+ try:
+ ftype = imghdr.what(fname)
+ except IOError, msg:
+ if type(msg) == type(()) and len(msg) == 2 and \
+ type(msg[0]) == type(0) and type(msg[1]) == type(''):
+ msg = msg[1]
+ if type(msg) <> type(''):
+ msg = `msg`
+ raise error, filename + ': ' + msg
+ if ftype == 'rgb':
+ return fname
+ if ftype == None or not table.has_key(ftype):
+ raise error, \
+ filename + ': unsupported image file type ' + `ftype`
+ temp = tempfile.mktemp()
+ sts = table[ftype].copy(fname, temp)
+ if sts:
+ raise error, filename + ': conversion to rgb failed'
+ return temp
diff --git a/Lib/plat-irix6/AL.py b/Lib/plat-irix6/AL.py
new file mode 100644
index 0000000..ed17cde
--- /dev/null
+++ b/Lib/plat-irix6/AL.py
@@ -0,0 +1,61 @@
+RATE_48000 = 48000
+RATE_44100 = 44100
+RATE_32000 = 32000
+RATE_22050 = 22050
+RATE_16000 = 16000
+RATE_11025 = 11025
+RATE_8000 = 8000
+
+SAMPFMT_TWOSCOMP= 1
+SAMPFMT_FLOAT = 32
+SAMPFMT_DOUBLE = 64
+
+SAMPLE_8 = 1
+SAMPLE_16 = 2
+ # SAMPLE_24 is the low 24 bits of a long, sign extended to 32 bits
+SAMPLE_24 = 4
+
+MONO = 1
+STEREO = 2
+QUADRO = 4 # 4CHANNEL is not a legal Python name
+
+INPUT_LINE = 0
+INPUT_MIC = 1
+INPUT_DIGITAL = 2
+
+MONITOR_OFF = 0
+MONITOR_ON = 1
+
+ERROR_NUMBER = 0
+ERROR_TYPE = 1
+ERROR_LOCATION_LSP = 2
+ERROR_LOCATION_MSP = 3
+ERROR_LENGTH = 4
+
+ERROR_INPUT_UNDERFLOW = 0
+ERROR_OUTPUT_OVERFLOW = 1
+
+# These seem to be not supported anymore:
+##HOLD, RELEASE = 0, 1
+##ATTAIL, ATHEAD, ATMARK, ATTIME = 0, 1, 2, 3
+
+DEFAULT_DEVICE = 1
+
+INPUT_SOURCE = 0
+LEFT_INPUT_ATTEN = 1
+RIGHT_INPUT_ATTEN = 2
+INPUT_RATE = 3
+OUTPUT_RATE = 4
+LEFT_SPEAKER_GAIN = 5
+RIGHT_SPEAKER_GAIN = 6
+INPUT_COUNT = 7
+OUTPUT_COUNT = 8
+UNUSED_COUNT = 9
+SYNC_INPUT_TO_AES = 10
+SYNC_OUTPUT_TO_AES = 11
+MONITOR_CTL = 12
+LEFT_MONITOR_ATTEN = 13
+RIGHT_MONITOR_ATTEN = 14
+
+ENUM_VALUE = 0 # only certain values are valid
+RANGE_VALUE = 1 # any value in range is valid
diff --git a/Lib/plat-irix6/AWARE.py b/Lib/plat-irix6/AWARE.py
new file mode 100644
index 0000000..30be50b
--- /dev/null
+++ b/Lib/plat-irix6/AWARE.py
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 1992 Aware, Inc. All rights reserved.
+#
+# Copyright Unpublished, Aware Inc. All Rights Reserved.
+# This software contains proprietary and confidential
+# information of Aware, Inc. Use, disclosure or
+# reproduction is prohibited without the prior express
+# written consent of Aware, Inc.
+#
+#
+
+#
+# awareAudio.h - Aware Compression Library Parameter Header
+#
+# 01/21/92 Original Version by Brian Knittel and Jonathon Devine
+#
+
+import CL
+
+# Aware Audio Specific Parameters - For both MPEG Audio and Multirate
+CL.CHANNEL_POLICY = CL.NUMBER_OF_PARAMS + 0
+CL.NOISE_MARGIN = CL.NUMBER_OF_PARAMS + 1
+CL.BITRATE_POLICY = CL.NUMBER_OF_PARAMS + 2
+
+# Additional parameters for MPEG Audio
+CL.BITRATE_TARGET = CL.NUMBER_OF_PARAMS + 3
+CL.LAYER = CL.NUMBER_OF_PARAMS + 4
+
+# read/write for compression configuration
+# read for state during compression/decompression
+
+#
+# Channel Policy
+#
+AWCMP_STEREO = 1
+AWCMP_JOINT_STEREO = 2
+AWCMP_INDEPENDENT = 3
+
+#
+# read/write for compression configuration,
+# read for state during compression
+#
+#
+# Bit-rate Policy
+#
+AWCMP_FIXED_RATE = 1
+AWCMP_CONST_QUAL = 2
+AWCMP_LOSSLESS = 4
+
+#
+# Layer values
+#
+AWCMP_MPEG_LAYER_I = 1
+AWCMP_MPEG_LAYER_II = 2
diff --git a/Lib/plat-irix6/CD.py b/Lib/plat-irix6/CD.py
new file mode 100644
index 0000000..ad56561
--- /dev/null
+++ b/Lib/plat-irix6/CD.py
@@ -0,0 +1,34 @@
+ERROR = 0
+NODISC = 1
+READY = 2
+PLAYING = 3
+PAUSED = 4
+STILL = 5
+
+AUDIO = 0
+PNUM = 1
+INDEX = 2
+PTIME = 3
+ATIME = 4
+CATALOG = 5
+IDENT = 6
+CONTROL = 7
+
+CDDA_DATASIZE = 2352
+
+##CDDA_SUBCODESIZE = (sizeof(struct subcodeQ))
+##CDDA_BLOCKSIZE = (sizeof(struct cdframe))
+##CDDA_NUMSAMPLES = (CDDA_DATASIZE/2)
+##
+##CDQ_PREEMP_MASK = 0xd
+##CDQ_COPY_MASK = 0xb
+##CDQ_DDATA_MASK = 0xd
+##CDQ_BROADCAST_MASK = 0x8
+##CDQ_PREEMPHASIS = 0x1
+##CDQ_COPY_PERMITTED = 0x2
+##CDQ_DIGITAL_DATA = 0x4
+##CDQ_BROADCAST_USE = 0x8
+##
+##CDQ_MODE1 = 0x1
+##CDQ_MODE2 = 0x2
+##CDQ_MODE3 = 0x3
diff --git a/Lib/plat-irix6/CL.py b/Lib/plat-irix6/CL.py
new file mode 100644
index 0000000..468ecaa
--- /dev/null
+++ b/Lib/plat-irix6/CL.py
@@ -0,0 +1,24 @@
+# Backward compatible module CL.
+# All relevant symbols are now defined in the module cl.
+try:
+ from cl import *
+except ImportError:
+ from CL_old import *
+else:
+ del CompressImage
+ del DecompressImage
+ del GetAlgorithmName
+ del OpenCompressor
+ del OpenDecompressor
+ del QueryAlgorithms
+ del QueryMaxHeaderSize
+ del QueryScheme
+ del QuerySchemeFromName
+ del SetDefault
+ del SetMax
+ del SetMin
+ try:
+ del cvt_type
+ except NameError:
+ pass
+ del error
diff --git a/Lib/plat-irix6/DEVICE.py b/Lib/plat-irix6/DEVICE.py
new file mode 100644
index 0000000..7ace8cb
--- /dev/null
+++ b/Lib/plat-irix6/DEVICE.py
@@ -0,0 +1,400 @@
+NULLDEV = 0
+BUTOFFSET = 1
+VALOFFSET = 256
+PSEUDOFFSET = 512
+BUT2OFFSET = 3840
+TIMOFFSET = 515
+XKBDOFFSET = 143
+BUTCOUNT = 255
+VALCOUNT = 256
+TIMCOUNT = 4
+XKBDCOUNT = 28
+USERBUTOFFSET = 4096
+USERVALOFFSET = 12288
+USERPSEUDOFFSET = 16384
+BUT0 = 1
+BUT1 = 2
+BUT2 = 3
+BUT3 = 4
+BUT4 = 5
+BUT5 = 6
+BUT6 = 7
+BUT7 = 8
+BUT8 = 9
+BUT9 = 10
+BUT10 = 11
+BUT11 = 12
+BUT12 = 13
+BUT13 = 14
+BUT14 = 15
+BUT15 = 16
+BUT16 = 17
+BUT17 = 18
+BUT18 = 19
+BUT19 = 20
+BUT20 = 21
+BUT21 = 22
+BUT22 = 23
+BUT23 = 24
+BUT24 = 25
+BUT25 = 26
+BUT26 = 27
+BUT27 = 28
+BUT28 = 29
+BUT29 = 30
+BUT30 = 31
+BUT31 = 32
+BUT32 = 33
+BUT33 = 34
+BUT34 = 35
+BUT35 = 36
+BUT36 = 37
+BUT37 = 38
+BUT38 = 39
+BUT39 = 40
+BUT40 = 41
+BUT41 = 42
+BUT42 = 43
+BUT43 = 44
+BUT44 = 45
+BUT45 = 46
+BUT46 = 47
+BUT47 = 48
+BUT48 = 49
+BUT49 = 50
+BUT50 = 51
+BUT51 = 52
+BUT52 = 53
+BUT53 = 54
+BUT54 = 55
+BUT55 = 56
+BUT56 = 57
+BUT57 = 58
+BUT58 = 59
+BUT59 = 60
+BUT60 = 61
+BUT61 = 62
+BUT62 = 63
+BUT63 = 64
+BUT64 = 65
+BUT65 = 66
+BUT66 = 67
+BUT67 = 68
+BUT68 = 69
+BUT69 = 70
+BUT70 = 71
+BUT71 = 72
+BUT72 = 73
+BUT73 = 74
+BUT74 = 75
+BUT75 = 76
+BUT76 = 77
+BUT77 = 78
+BUT78 = 79
+BUT79 = 80
+BUT80 = 81
+BUT81 = 82
+BUT82 = 83
+MAXKBDBUT = 83
+BUT100 = 101
+BUT101 = 102
+BUT102 = 103
+BUT103 = 104
+BUT104 = 105
+BUT105 = 106
+BUT106 = 107
+BUT107 = 108
+BUT108 = 109
+BUT109 = 110
+BUT110 = 111
+BUT111 = 112
+BUT112 = 113
+BUT113 = 114
+BUT114 = 115
+BUT115 = 116
+BUT116 = 117
+BUT117 = 118
+BUT118 = 119
+BUT119 = 120
+BUT120 = 121
+BUT121 = 122
+BUT122 = 123
+BUT123 = 124
+BUT124 = 125
+BUT125 = 126
+BUT126 = 127
+BUT127 = 128
+BUT128 = 129
+BUT129 = 130
+BUT130 = 131
+BUT131 = 132
+BUT132 = 133
+BUT133 = 134
+BUT134 = 135
+BUT135 = 136
+BUT136 = 137
+BUT137 = 138
+BUT138 = 139
+BUT139 = 140
+BUT140 = 141
+BUT141 = 142
+BUT142 = 143
+BUT143 = 144
+BUT144 = 145
+BUT145 = 146
+BUT146 = 147
+BUT147 = 148
+BUT148 = 149
+BUT149 = 150
+BUT150 = 151
+BUT151 = 152
+BUT152 = 153
+BUT153 = 154
+BUT154 = 155
+BUT155 = 156
+BUT156 = 157
+BUT157 = 158
+BUT158 = 159
+BUT159 = 160
+BUT160 = 161
+BUT161 = 162
+BUT162 = 163
+BUT163 = 164
+BUT164 = 165
+BUT165 = 166
+BUT166 = 167
+BUT167 = 168
+BUT168 = 169
+BUT181 = 182
+BUT182 = 183
+BUT183 = 184
+BUT184 = 185
+BUT185 = 186
+BUT186 = 187
+BUT187 = 188
+BUT188 = 189
+BUT189 = 190
+MOUSE1 = 101
+MOUSE2 = 102
+MOUSE3 = 103
+LEFTMOUSE = 103
+MIDDLEMOUSE = 102
+RIGHTMOUSE = 101
+LPENBUT = 104
+BPAD0 = 105
+BPAD1 = 106
+BPAD2 = 107
+BPAD3 = 108
+LPENVALID = 109
+SWBASE = 111
+SW0 = 111
+SW1 = 112
+SW2 = 113
+SW3 = 114
+SW4 = 115
+SW5 = 116
+SW6 = 117
+SW7 = 118
+SW8 = 119
+SW9 = 120
+SW10 = 121
+SW11 = 122
+SW12 = 123
+SW13 = 124
+SW14 = 125
+SW15 = 126
+SW16 = 127
+SW17 = 128
+SW18 = 129
+SW19 = 130
+SW20 = 131
+SW21 = 132
+SW22 = 133
+SW23 = 134
+SW24 = 135
+SW25 = 136
+SW26 = 137
+SW27 = 138
+SW28 = 139
+SW29 = 140
+SW30 = 141
+SW31 = 142
+SBBASE = 182
+SBPICK = 182
+SBBUT1 = 183
+SBBUT2 = 184
+SBBUT3 = 185
+SBBUT4 = 186
+SBBUT5 = 187
+SBBUT6 = 188
+SBBUT7 = 189
+SBBUT8 = 190
+AKEY = 11
+BKEY = 36
+CKEY = 28
+DKEY = 18
+EKEY = 17
+FKEY = 19
+GKEY = 26
+HKEY = 27
+IKEY = 40
+JKEY = 34
+KKEY = 35
+LKEY = 42
+MKEY = 44
+NKEY = 37
+OKEY = 41
+PKEY = 48
+QKEY = 10
+RKEY = 24
+SKEY = 12
+TKEY = 25
+UKEY = 33
+VKEY = 29
+WKEY = 16
+XKEY = 21
+YKEY = 32
+ZKEY = 20
+ZEROKEY = 46
+ONEKEY = 8
+TWOKEY = 14
+THREEKEY = 15
+FOURKEY = 22
+FIVEKEY = 23
+SIXKEY = 30
+SEVENKEY = 31
+EIGHTKEY = 38
+NINEKEY = 39
+BREAKKEY = 1
+SETUPKEY = 2
+CTRLKEY = 3
+LEFTCTRLKEY = CTRLKEY
+CAPSLOCKKEY = 4
+RIGHTSHIFTKEY = 5
+LEFTSHIFTKEY = 6
+NOSCRLKEY = 13
+ESCKEY = 7
+TABKEY = 9
+RETKEY = 51
+SPACEKEY = 83
+LINEFEEDKEY = 60
+BACKSPACEKEY = 61
+DELKEY = 62
+SEMICOLONKEY = 43
+PERIODKEY = 52
+COMMAKEY = 45
+QUOTEKEY = 50
+ACCENTGRAVEKEY = 55
+MINUSKEY = 47
+VIRGULEKEY = 53
+BACKSLASHKEY = 57
+EQUALKEY = 54
+LEFTBRACKETKEY = 49
+RIGHTBRACKETKEY = 56
+LEFTARROWKEY = 73
+DOWNARROWKEY = 74
+RIGHTARROWKEY = 80
+UPARROWKEY = 81
+PAD0 = 59
+PAD1 = 58
+PAD2 = 64
+PAD3 = 65
+PAD4 = 63
+PAD5 = 69
+PAD6 = 70
+PAD7 = 67
+PAD8 = 68
+PAD9 = 75
+PADPF1 = 72
+PADPF2 = 71
+PADPF3 = 79
+PADPF4 = 78
+PADPERIOD = 66
+PADMINUS = 76
+PADCOMMA = 77
+PADENTER = 82
+LEFTALTKEY = 143
+RIGHTALTKEY = 144
+RIGHTCTRLKEY = 145
+F1KEY = 146
+F2KEY = 147
+F3KEY = 148
+F4KEY = 149
+F5KEY = 150
+F6KEY = 151
+F7KEY = 152
+F8KEY = 153
+F9KEY = 154
+F10KEY = 155
+F11KEY = 156
+F12KEY = 157
+PRINTSCREENKEY = 158
+SCROLLLOCKKEY = 159
+PAUSEKEY = 160
+INSERTKEY = 161
+HOMEKEY = 162
+PAGEUPKEY = 163
+ENDKEY = 164
+PAGEDOWNKEY = 165
+NUMLOCKKEY = 166
+PADVIRGULEKEY = 167
+PADASTERKEY = 168
+PADPLUSKEY = 169
+SGIRESERVED = 256
+DIAL0 = 257
+DIAL1 = 258
+DIAL2 = 259
+DIAL3 = 260
+DIAL4 = 261
+DIAL5 = 262
+DIAL6 = 263
+DIAL7 = 264
+DIAL8 = 265
+MOUSEX = 266
+MOUSEY = 267
+LPENX = 268
+LPENY = 269
+BPADX = 270
+BPADY = 271
+CURSORX = 272
+CURSORY = 273
+GHOSTX = 274
+GHOSTY = 275
+SBTX = 276
+SBTY = 277
+SBTZ = 278
+SBRX = 279
+SBRY = 280
+SBRZ = 281
+SBPERIOD = 282
+TIMER0 = 515
+TIMER1 = 516
+TIMER2 = 517
+TIMER3 = 518
+KEYBD = 513
+RAWKEYBD = 514
+VALMARK = 523
+REDRAW = 528
+INPUTCHANGE = 534
+QFULL = 535
+QREADERROR = 538
+WINFREEZE = 539
+WINTHAW = 540
+REDRAWICONIC = 541
+WINQUIT = 542
+DEPTHCHANGE = 543
+WINSHUT = 546
+DRAWOVERLAY = 547
+VIDEO = 548
+MENUBUTTON = RIGHTMOUSE
+WINCLOSE = 537
+KEYBDFNAMES = 544
+KEYBDFSTRINGS = 545
+MAXSGIDEVICE = 20000
+GERROR = 524
+WMSEND = 529
+WMREPLY = 530
+WMGFCLOSE = 531
+WMTXCLOSE = 532
+MODECHANGE = 533
+PIECECHANGE = 536
diff --git a/Lib/plat-irix6/ERRNO.py b/Lib/plat-irix6/ERRNO.py
new file mode 100644
index 0000000..d975ce6
--- /dev/null
+++ b/Lib/plat-irix6/ERRNO.py
@@ -0,0 +1,163 @@
+# Generated by h2py from /usr/include/sys/errno.h
+
+# Included from standards.h
+__KBASE = 1000
+__IRIXBASE = 1000
+EPERM = 1
+ENOENT = 2
+ESRCH = 3
+EINTR = 4
+EIO = 5
+ENXIO = 6
+E2BIG = 7
+ENOEXEC = 8
+EBADF = 9
+ECHILD = 10
+EAGAIN = 11
+ENOMEM = 12
+EACCES = 13
+EFAULT = 14
+ENOTBLK = 15
+EBUSY = 16
+EEXIST = 17
+EXDEV = 18
+ENODEV = 19
+ENOTDIR = 20
+EISDIR = 21
+EINVAL = 22
+ENFILE = 23
+EMFILE = 24
+ENOTTY = 25
+ETXTBSY = 26
+EFBIG = 27
+ENOSPC = 28
+ESPIPE = 29
+EROFS = 30
+EMLINK = 31
+EPIPE = 32
+EDOM = 33
+ERANGE = 34
+ENOMSG = 35
+EIDRM = 36
+ECHRNG = 37
+EL2NSYNC = 38
+EL3HLT = 39
+EL3RST = 40
+ELNRNG = 41
+EUNATCH = 42
+ENOCSI = 43
+EL2HLT = 44
+EDEADLK = 45
+ENOLCK = 46
+EBADE = 50
+EBADR = 51
+EXFULL = 52
+ENOANO = 53
+EBADRQC = 54
+EBADSLT = 55
+EDEADLOCK = 56
+EBFONT = 57
+ENOSTR = 60
+ENODATA = 61
+ETIME = 62
+ENOSR = 63
+ENONET = 64
+ENOPKG = 65
+EREMOTE = 66
+ENOLINK = 67
+EADV = 68
+ESRMNT = 69
+ECOMM = 70
+EPROTO = 71
+EMULTIHOP = 74
+EBADMSG = 77
+ENAMETOOLONG = 78
+EOVERFLOW = 79
+ENOTUNIQ = 80
+EBADFD = 81
+EREMCHG = 82
+ELIBACC = 83
+ELIBBAD = 84
+ELIBSCN = 85
+ELIBMAX = 86
+ELIBEXEC = 87
+EILSEQ = 88
+ENOSYS = 89
+ELOOP = 90
+ERESTART = 91
+ESTRPIPE = 92
+ENOTEMPTY = 93
+EUSERS = 94
+ENOTSOCK = 95
+EDESTADDRREQ = 96
+EMSGSIZE = 97
+EPROTOTYPE = 98
+ENOPROTOOPT = 99
+EPROTONOSUPPORT = 120
+ESOCKTNOSUPPORT = 121
+EOPNOTSUPP = 122
+EPFNOSUPPORT = 123
+EAFNOSUPPORT = 124
+EADDRINUSE = 125
+EADDRNOTAVAIL = 126
+ENETDOWN = 127
+ENETUNREACH = 128
+ENETRESET = 129
+ECONNABORTED = 130
+ECONNRESET = 131
+ENOBUFS = 132
+EISCONN = 133
+ENOTCONN = 134
+ESHUTDOWN = 143
+ETOOMANYREFS = 144
+ETIMEDOUT = 145
+ECONNREFUSED = 146
+EHOSTDOWN = 147
+EHOSTUNREACH = 148
+LASTERRNO = ENOTCONN
+EWOULDBLOCK = __KBASE+101
+EWOULDBLOCK = EAGAIN
+EALREADY = 149
+EINPROGRESS = 150
+ESTALE = 151
+EIORESID = 500
+EUCLEAN = 135
+ENOTNAM = 137
+ENAVAIL = 138
+EISNAM = 139
+EREMOTEIO = 140
+EINIT = 141
+EREMDEV = 142
+ECANCELED = 158
+ENOLIMFILE = 1001
+EPROCLIM = 1002
+EDISJOINT = 1003
+ENOLOGIN = 1004
+ELOGINLIM = 1005
+EGROUPLOOP = 1006
+ENOATTACH = 1007
+ENOTSUP = 1008
+ENOATTR = 1009
+EDIRCORRUPTED = 1010
+EDQUOT = 1133
+ENFSREMOTE = 1135
+ECONTROLLER = 1300
+ENOTCONTROLLER = 1301
+EENQUEUED = 1302
+ENOTENQUEUED = 1303
+EJOINED = 1304
+ENOTJOINED = 1305
+ENOPROC = 1306
+EMUSTRUN = 1307
+ENOTSTOPPED = 1308
+ECLOCKCPU = 1309
+EINVALSTATE = 1310
+ENOEXIST = 1311
+EENDOFMINOR = 1312
+EBUFSIZE = 1313
+EEMPTY = 1314
+ENOINTRGROUP = 1315
+EINVALMODE = 1316
+ECANTEXTENT = 1317
+EINVALTIME = 1318
+EDESTROYED = 1319
diff --git a/Lib/plat-irix6/FCNTL.py b/Lib/plat-irix6/FCNTL.py
new file mode 100644
index 0000000..ceb1071
--- /dev/null
+++ b/Lib/plat-irix6/FCNTL.py
@@ -0,0 +1,114 @@
+# Generated by h2py from /usr/include/sys/fcntl.h
+
+# Included from standards.h
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+FNDELAY = 0x04
+FAPPEND = 0x08
+FSYNC = 0x10
+FDSYNC = 0x20
+FRSYNC = 0x40
+FNONBLOCK = 0x80
+FASYNC = 0x1000
+FLARGEFILE = 0x2000
+FNONBLK = FNONBLOCK
+FDIRECT = 0x8000
+FDIRENT64 = 0x8000
+FCREAT = 0x0100
+FTRUNC = 0x0200
+FEXCL = 0x0400
+FNOCTTY = 0x0800
+O_RDONLY = 0
+O_WRONLY = 1
+O_RDWR = 2
+O_NDELAY = 0x04
+O_APPEND = 0x08
+O_SYNC = 0x10
+O_DSYNC = 0x20
+O_RSYNC = 0x40
+O_NONBLOCK = 0x80
+O_LARGEFILE = 0x2000
+O_DIRECT = 0x8000
+O_CREAT = 0x100
+O_TRUNC = 0x200
+O_EXCL = 0x400
+O_NOCTTY = 0x800
+F_DUPFD = 0
+F_GETFD = 1
+F_SETFD = 2
+F_GETFL = 3
+F_SETFL = 4
+F_GETLK = 14
+F_SETLK = 6
+F_SETLKW = 7
+F_CHKFL = 8
+F_ALLOCSP = 10
+F_FREESP = 11
+F_SETBSDLK = 12
+F_SETBSDLKW = 13
+F_DIOINFO = 30
+F_FSGETXATTR = 31
+F_FSSETXATTR = 32
+F_GETLK64 = 33
+F_SETLK64 = 34
+F_SETLKW64 = 35
+F_ALLOCSP64 = 36
+F_FREESP64 = 37
+F_GETBMAP = 38
+F_FSSETDM = 39
+F_RESVSP = 40
+F_UNRESVSP = 41
+F_RESVSP64 = 42
+F_UNRESVSP64 = 43
+F_GETBMAPA = 44
+F_FSGETXATTRA = 45
+F_GETALLLK = 46
+F_RSETLK = 20
+F_RGETLK = 21
+F_RSETLKW = 22
+F_GETOWN = 23
+F_SETOWN = 24
+F_RDLCK = 01
+F_WRLCK = 02
+F_UNLCK = 03
+O_ACCMODE = 3
+FD_CLOEXEC = 1
+FD_NODUP_FORK = 4
diff --git a/Lib/plat-irix6/FILE.py b/Lib/plat-irix6/FILE.py
new file mode 100644
index 0000000..e3393b6
--- /dev/null
+++ b/Lib/plat-irix6/FILE.py
@@ -0,0 +1,236 @@
+# Generated by h2py from /usr/include/sys/file.h
+
+# Included from standards.h
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+
+# Included from sys/sema.h
+MUTEX_DEFAULT = 0x0
+METER_NAMSZ = 8
+def mutex_spinlock(l): return splhi()
+
+def mutex_spintrylock(l): return splhi()
+
+def spinlock_islocked(l): return issplhi(getsr())
+
+def spinlock_initialized(l): return 1
+
+SV_FIFO = 0x0
+SV_LIFO = 0x2
+SV_PRIO = 0x4
+SV_DEFAULT = SV_FIFO
+SEMA_NOHIST = 0x0001
+SEMA_LOCK = 0x0004
+SEMA_METER = 0x0008
+SEMA_NAMSZ = METER_NAMSZ
+MR_ACCESS = 0x1
+MR_UPDATE = 0x2
+def mp_mutex_unlock(m): return mutex_unlock(m)
+
+def mp_mutex_trylock(m): return mutex_trylock(m)
+
+def mp_mutex_spinlock(m): return mutex_spinlock(m)
+
+def mp_mutex_trylock(m): return 1
+
+def mp_mutex_spinlock(m): return 1
+
+def nested_spintrylock(m): return 1
+
+def mp_mrunlock(a): return mrunlock(a)
+
+def mp_cpsema(x): return cpsema(x)
+
+def mp_cvsema(x): return cvsema(x)
+
+def mp_cpsema(x): return 1
+
+def mp_cvsema(x): return 0
+
+MON_LOCKED = 0x01
+MON_WAITING = 0x02
+MON_TIMEOUT = 0x04
+def initlock(l): return spinlock_init(l,0)
+
+def ownlock(x): return 1
+
+def splock(x): return 1
+
+def io_splock(x): return 1
+
+def mutex_enter(m): return mutex_lock(m, PZERO)
+
+def mutex_tryenter(m): return mutex_trylock(m)
+
+def mutex_exit(m): return mutex_unlock(m)
+
+def cv_signal(cv): return sv_signal(cv)
+
+def cv_broadcast(cv): return sv_broadcast(cv)
+
+def cv_destroy(cv): return sv_destroy(cv)
+
+RW_READER = MR_ACCESS
+RW_WRITER = MR_UPDATE
+def rw_exit(r): return mrunlock(r)
+
+def rw_tryupgrade(r): return cmrpromote(r)
+
+def rw_downgrade(r): return mrdemote(r)
+
+def rw_destroy(r): return mrfree(r)
+
+def RW_WRITE_HELD(r): return ismrlocked(r, MR_UPDATE)
+
+def RW_READ_HELD(r): return ismrlocked(r, MR_ACCESS)
+
+
+# Included from sys/fcntl.h
+FNDELAY = 0x04
+FAPPEND = 0x08
+FSYNC = 0x10
+FDSYNC = 0x20
+FRSYNC = 0x40
+FNONBLOCK = 0x80
+FASYNC = 0x1000
+FLARGEFILE = 0x2000
+FNONBLK = FNONBLOCK
+FDIRECT = 0x8000
+FDIRENT64 = 0x8000
+FCREAT = 0x0100
+FTRUNC = 0x0200
+FEXCL = 0x0400
+FNOCTTY = 0x0800
+O_RDONLY = 0
+O_WRONLY = 1
+O_RDWR = 2
+O_NDELAY = 0x04
+O_APPEND = 0x08
+O_SYNC = 0x10
+O_DSYNC = 0x20
+O_RSYNC = 0x40
+O_NONBLOCK = 0x80
+O_LARGEFILE = 0x2000
+O_DIRECT = 0x8000
+O_CREAT = 0x100
+O_TRUNC = 0x200
+O_EXCL = 0x400
+O_NOCTTY = 0x800
+F_DUPFD = 0
+F_GETFD = 1
+F_SETFD = 2
+F_GETFL = 3
+F_SETFL = 4
+F_GETLK = 14
+F_SETLK = 6
+F_SETLKW = 7
+F_CHKFL = 8
+F_ALLOCSP = 10
+F_FREESP = 11
+F_SETBSDLK = 12
+F_SETBSDLKW = 13
+F_DIOINFO = 30
+F_FSGETXATTR = 31
+F_FSSETXATTR = 32
+F_GETLK64 = 33
+F_SETLK64 = 34
+F_SETLKW64 = 35
+F_ALLOCSP64 = 36
+F_FREESP64 = 37
+F_GETBMAP = 38
+F_FSSETDM = 39
+F_RESVSP = 40
+F_UNRESVSP = 41
+F_RESVSP64 = 42
+F_UNRESVSP64 = 43
+F_GETBMAPA = 44
+F_FSGETXATTRA = 45
+F_GETALLLK = 46
+F_RSETLK = 20
+F_RGETLK = 21
+F_RSETLKW = 22
+F_GETOWN = 23
+F_SETOWN = 24
+F_RDLCK = 01
+F_WRLCK = 02
+F_UNLCK = 03
+O_ACCMODE = 3
+FD_CLOEXEC = 1
+FD_NODUP_FORK = 4
+FMASK = 0x90FF
+FOPEN = 0xFFFFFFFF
+FREAD = 0x01
+FWRITE = 0x02
+FNDELAY = 0x04
+FAPPEND = 0x08
+FSYNC = 0x10
+FDSYNC = 0x20
+FRSYNC = 0x40
+FNONBLOCK = 0x80
+FASYNC = 0x1000
+FNONBLK = FNONBLOCK
+FLARGEFILE = 0x2000
+FDIRECT = 0x8000
+FCREAT = 0x0100
+FTRUNC = 0x0200
+FEXCL = 0x0400
+FNOCTTY = 0x0800
+FMARK = 0x4000
+FDEFER = 0x2000
+FINPROGRESS = 0x0400
+FINVIS = 0x0100
+FNMFS = 0x2000
+FDIRENT64 = 0x8000
+FCLOSEXEC = 001
+FDSHD = 0x0001
+FDNOMARK = 0x0002
+FDIGNPROGRESS = 0x0004
+LOCK_SH = 1
+LOCK_EX = 2
+LOCK_NB = 4
+LOCK_UN = 8
+F_OK = 0
+X_OK = 1
+W_OK = 2
+R_OK = 4
+L_SET = 0
+L_INCR = 1
+L_XTND = 2
diff --git a/Lib/plat-irix6/FL.py b/Lib/plat-irix6/FL.py
new file mode 100644
index 0000000..f85237b
--- /dev/null
+++ b/Lib/plat-irix6/FL.py
@@ -0,0 +1,289 @@
+# Constants used by the FORMS library (module fl).
+# This corresponds to "forms.h".
+# Recommended use: import FL; ... FL.NORMAL_BOX ... etc.
+# Alternate use: from FL import *; ... NORMAL_BOX ... etc.
+
+_v20 = 1
+_v21 = 1
+##import fl
+##try:
+## _v20 = (fl.get_rgbmode <> None)
+##except:
+## _v20 = 0
+##del fl
+
+NULL = 0
+FALSE = 0
+TRUE = 1
+
+EVENT = -1
+
+LABEL_SIZE = 64
+if _v20:
+ SHORTCUT_SIZE = 32
+PLACE_FREE = 0
+PLACE_SIZE = 1
+PLACE_ASPECT = 2
+PLACE_MOUSE = 3
+PLACE_CENTER = 4
+PLACE_POSITION = 5
+FL_PLACE_FULLSCREEN = 6
+FIND_INPUT = 0
+FIND_AUTOMATIC = 1
+FIND_MOUSE = 2
+BEGIN_GROUP = 10000
+END_GROUP = 20000
+ALIGN_TOP = 0
+ALIGN_BOTTOM = 1
+ALIGN_LEFT = 2
+ALIGN_RIGHT = 3
+ALIGN_CENTER = 4
+NO_BOX = 0
+UP_BOX = 1
+DOWN_BOX = 2
+FLAT_BOX = 3
+BORDER_BOX = 4
+SHADOW_BOX = 5
+FRAME_BOX = 6
+ROUNDED_BOX = 7
+RFLAT_BOX = 8
+RSHADOW_BOX = 9
+TOP_BOUND_COL = 51
+LEFT_BOUND_COL = 55
+BOT_BOUND_COL = 40
+RIGHT_BOUND_COL = 35
+COL1 = 47
+MCOL = 49
+LCOL = 0
+BOUND_WIDTH = 3.0
+DRAW = 0
+PUSH = 1
+RELEASE = 2
+ENTER = 3
+LEAVE = 4
+MOUSE = 5
+FOCUS = 6
+UNFOCUS = 7
+KEYBOARD = 8
+STEP = 9
+MOVE = 10
+FONT_NAME = 'Helvetica'
+FONT_BOLDNAME = 'Helvetica-Bold'
+FONT_ITALICNAME = 'Helvetica-Oblique'
+FONT_FIXEDNAME = 'Courier'
+FONT_ICONNAME = 'Icon'
+SMALL_FONT = 8.0
+NORMAL_FONT = 11.0
+LARGE_FONT = 20.0
+NORMAL_STYLE = 0
+BOLD_STYLE = 1
+ITALIC_STYLE = 2
+FIXED_STYLE = 3
+ENGRAVED_STYLE = 4
+ICON_STYLE = 5
+BITMAP = 3
+NORMAL_BITMAP = 0
+BITMAP_BOXTYPE = NO_BOX
+BITMAP_COL1 = 0
+BITMAP_COL2 = COL1
+BITMAP_LCOL = LCOL
+BITMAP_ALIGN = ALIGN_BOTTOM
+BITMAP_MAXSIZE = 128*128
+BITMAP_BW = BOUND_WIDTH
+BOX = 1
+BOX_BOXTYPE = UP_BOX
+BOX_COL1 = COL1
+BOX_LCOL = LCOL
+BOX_ALIGN = ALIGN_CENTER
+BOX_BW = BOUND_WIDTH
+BROWSER = 71
+NORMAL_BROWSER = 0
+SELECT_BROWSER = 1
+HOLD_BROWSER = 2
+MULTI_BROWSER = 3
+BROWSER_BOXTYPE = DOWN_BOX
+BROWSER_COL1 = COL1
+BROWSER_COL2 = 3
+BROWSER_LCOL = LCOL
+BROWSER_ALIGN = ALIGN_BOTTOM
+BROWSER_SLCOL = COL1
+BROWSER_BW = BOUND_WIDTH
+BROWSER_LINELENGTH = 128
+BROWSER_MAXLINE = 512
+BUTTON = 11
+NORMAL_BUTTON = 0
+PUSH_BUTTON = 1
+RADIO_BUTTON = 2
+HIDDEN_BUTTON = 3
+TOUCH_BUTTON = 4
+INOUT_BUTTON = 5
+RETURN_BUTTON = 6
+if _v20:
+ HIDDEN_RET_BUTTON = 7
+BUTTON_BOXTYPE = UP_BOX
+BUTTON_COL1 = COL1
+BUTTON_COL2 = COL1
+BUTTON_LCOL = LCOL
+BUTTON_ALIGN = ALIGN_CENTER
+BUTTON_MCOL1 = MCOL
+BUTTON_MCOL2 = MCOL
+BUTTON_BW = BOUND_WIDTH
+if _v20:
+ CHART = 4
+ BAR_CHART = 0
+ HORBAR_CHART = 1
+ LINE_CHART = 2
+ FILLED_CHART = 3
+ SPIKE_CHART = 4
+ PIE_CHART = 5
+ SPECIALPIE_CHART = 6
+ CHART_BOXTYPE = BORDER_BOX
+ CHART_COL1 = COL1
+ CHART_LCOL = LCOL
+ CHART_ALIGN = ALIGN_BOTTOM
+ CHART_BW = BOUND_WIDTH
+ CHART_MAX = 128
+CHOICE = 42
+NORMAL_CHOICE = 0
+CHOICE_BOXTYPE = DOWN_BOX
+CHOICE_COL1 = COL1
+CHOICE_COL2 = LCOL
+CHOICE_LCOL = LCOL
+CHOICE_ALIGN = ALIGN_LEFT
+CHOICE_BW = BOUND_WIDTH
+CHOICE_MCOL = MCOL
+CHOICE_MAXITEMS = 128
+CHOICE_MAXSTR = 64
+CLOCK = 61
+SQUARE_CLOCK = 0
+ROUND_CLOCK = 1
+CLOCK_BOXTYPE = UP_BOX
+CLOCK_COL1 = 37
+CLOCK_COL2 = 42
+CLOCK_LCOL = LCOL
+CLOCK_ALIGN = ALIGN_BOTTOM
+CLOCK_TOPCOL = COL1
+CLOCK_BW = BOUND_WIDTH
+COUNTER = 25
+NORMAL_COUNTER = 0
+SIMPLE_COUNTER = 1
+COUNTER_BOXTYPE = UP_BOX
+COUNTER_COL1 = COL1
+COUNTER_COL2 = 4
+COUNTER_LCOL = LCOL
+COUNTER_ALIGN = ALIGN_BOTTOM
+if _v20:
+ COUNTER_BW = BOUND_WIDTH
+else:
+ DEFAULT = 51
+ RETURN_DEFAULT = 0
+ ALWAYS_DEFAULT = 1
+DIAL = 22
+NORMAL_DIAL = 0
+LINE_DIAL = 1
+DIAL_BOXTYPE = NO_BOX
+DIAL_COL1 = COL1
+DIAL_COL2 = 37
+DIAL_LCOL = LCOL
+DIAL_ALIGN = ALIGN_BOTTOM
+DIAL_TOPCOL = COL1
+DIAL_BW = BOUND_WIDTH
+FREE = 101
+NORMAL_FREE = 1
+SLEEPING_FREE = 2
+INPUT_FREE = 3
+CONTINUOUS_FREE = 4
+ALL_FREE = 5
+INPUT = 31
+NORMAL_INPUT = 0
+if _v20:
+ FLOAT_INPUT = 1
+ INT_INPUT = 2
+ HIDDEN_INPUT = 3
+ if _v21:
+ MULTILINE_INPUT = 4
+ SECRET_INPUT = 5
+else:
+ ALWAYS_INPUT = 1
+INPUT_BOXTYPE = DOWN_BOX
+INPUT_COL1 = 13
+INPUT_COL2 = 5
+INPUT_LCOL = LCOL
+INPUT_ALIGN = ALIGN_LEFT
+INPUT_TCOL = LCOL
+INPUT_CCOL = 4
+INPUT_BW = BOUND_WIDTH
+INPUT_MAX = 128
+LIGHTBUTTON = 12
+LIGHTBUTTON_BOXTYPE = UP_BOX
+LIGHTBUTTON_COL1 = 39
+LIGHTBUTTON_COL2 = 3
+LIGHTBUTTON_LCOL = LCOL
+LIGHTBUTTON_ALIGN = ALIGN_CENTER
+LIGHTBUTTON_TOPCOL = COL1
+LIGHTBUTTON_MCOL = MCOL
+LIGHTBUTTON_BW1 = BOUND_WIDTH
+LIGHTBUTTON_BW2 = BOUND_WIDTH/2.0
+LIGHTBUTTON_MINSIZE = 12.0
+MENU = 41
+TOUCH_MENU = 0
+PUSH_MENU = 1
+MENU_BOXTYPE = BORDER_BOX
+MENU_COL1 = 55
+MENU_COL2 = 37
+MENU_LCOL = LCOL
+MENU_ALIGN = ALIGN_CENTER
+MENU_BW = BOUND_WIDTH
+MENU_MAX = 300
+POSITIONER = 23
+NORMAL_POSITIONER = 0
+POSITIONER_BOXTYPE = DOWN_BOX
+POSITIONER_COL1 = COL1
+POSITIONER_COL2 = 1
+POSITIONER_LCOL = LCOL
+POSITIONER_ALIGN = ALIGN_BOTTOM
+POSITIONER_BW = BOUND_WIDTH
+ROUNDBUTTON = 13
+ROUNDBUTTON_BOXTYPE = NO_BOX
+ROUNDBUTTON_COL1 = 7
+ROUNDBUTTON_COL2 = 3
+ROUNDBUTTON_LCOL = LCOL
+ROUNDBUTTON_ALIGN = ALIGN_CENTER
+ROUNDBUTTON_TOPCOL = COL1
+ROUNDBUTTON_MCOL = MCOL
+ROUNDBUTTON_BW = BOUND_WIDTH
+SLIDER = 21
+VALSLIDER = 24
+VERT_SLIDER = 0
+HOR_SLIDER = 1
+VERT_FILL_SLIDER = 2
+HOR_FILL_SLIDER = 3
+VERT_NICE_SLIDER = 4
+HOR_NICE_SLIDER = 5
+SLIDER_BOXTYPE = DOWN_BOX
+SLIDER_COL1 = COL1
+SLIDER_COL2 = COL1
+SLIDER_LCOL = LCOL
+SLIDER_ALIGN = ALIGN_BOTTOM
+SLIDER_BW1 = BOUND_WIDTH
+SLIDER_BW2 = BOUND_WIDTH*0.75
+SLIDER_FINE = 0.05
+SLIDER_WIDTH = 0.08
+TEXT = 2
+NORMAL_TEXT = 0
+TEXT_BOXTYPE = NO_BOX
+TEXT_COL1 = COL1
+TEXT_LCOL = LCOL
+TEXT_ALIGN = ALIGN_LEFT
+TEXT_BW = BOUND_WIDTH
+TIMER = 62
+NORMAL_TIMER = 0
+VALUE_TIMER = 1
+HIDDEN_TIMER = 2
+TIMER_BOXTYPE = DOWN_BOX
+TIMER_COL1 = COL1
+TIMER_COL2 = 1
+TIMER_LCOL = LCOL
+TIMER_ALIGN = ALIGN_CENTER
+TIMER_BW = BOUND_WIDTH
+TIMER_BLINKRATE = 0.2
diff --git a/Lib/plat-irix6/GET.py b/Lib/plat-irix6/GET.py
new file mode 100644
index 0000000..9c3d7d6
--- /dev/null
+++ b/Lib/plat-irix6/GET.py
@@ -0,0 +1,59 @@
+# Symbols from <gl/get.h>
+
+BCKBUFFER = 0x1
+FRNTBUFFER = 0x2
+DRAWZBUFFER = 0x4
+DMRGB = 0
+DMSINGLE = 1
+DMDOUBLE = 2
+DMRGBDOUBLE = 5
+HZ30 = 0
+HZ60 = 1
+NTSC = 2
+HDTV = 3
+VGA = 4
+IRIS3K = 5
+PR60 = 6
+PAL = 9
+HZ30_SG = 11
+A343 = 14
+STR_RECT = 15
+VOF0 = 16
+VOF1 = 17
+VOF2 = 18
+VOF3 = 19
+SGI0 = 20
+SGI1 = 21
+SGI2 = 22
+HZ72 = 23
+GL_VIDEO_REG = 0x00800000
+GLV_GENLOCK = 0x00000001
+GLV_UNBLANK = 0x00000002
+GLV_SRED = 0x00000004
+GLV_SGREEN = 0x00000008
+GLV_SBLUE = 0x00000010
+GLV_SALPHA = 0x00000020
+GLV_TTLGENLOCK = 0x00000080
+GLV_TTLSYNC = GLV_TTLGENLOCK
+GLV_GREENGENLOCK = 0x0000100
+LEFTPLANE = 0x0001
+RIGHTPLANE = 0x0002
+BOTTOMPLANE = 0x0004
+TOPPLANE = 0x0008
+NEARPLANE = 0x0010
+FARPLANE = 0x0020
+## GETDEF = __GL_GET_H__
+NOBUFFER = 0x0
+BOTHBUFFERS = 0x3
+DMINTENSITYSINGLE = 3
+DMINTENSITYDOUBLE = 4
+MONSPECIAL = 0x20
+HZ50 = 3
+MONA = 5
+MONB = 6
+MONC = 7
+MOND = 8
+MON_ALL = 12
+MON_GEN_ALL = 13
+CMAPMULTI = 0
+CMAPONE = 1
diff --git a/Lib/plat-irix6/GL.py b/Lib/plat-irix6/GL.py
new file mode 100644
index 0000000..9f02f65
--- /dev/null
+++ b/Lib/plat-irix6/GL.py
@@ -0,0 +1,393 @@
+NULL = 0
+FALSE = 0
+TRUE = 1
+ATTRIBSTACKDEPTH = 10
+VPSTACKDEPTH = 8
+MATRIXSTACKDEPTH = 32
+NAMESTACKDEPTH = 1025
+STARTTAG = -2
+ENDTAG = -3
+BLACK = 0
+RED = 1
+GREEN = 2
+YELLOW = 3
+BLUE = 4
+MAGENTA = 5
+CYAN = 6
+WHITE = 7
+PUP_CLEAR = 0
+PUP_COLOR = 1
+PUP_BLACK = 2
+PUP_WHITE = 3
+NORMALDRAW = 0x010
+PUPDRAW = 0x020
+OVERDRAW = 0x040
+UNDERDRAW = 0x080
+CURSORDRAW = 0x100
+DUALDRAW = 0x200
+PATTERN_16 = 16
+PATTERN_32 = 32
+PATTERN_64 = 64
+PATTERN_16_SIZE = 16
+PATTERN_32_SIZE = 64
+PATTERN_64_SIZE = 256
+SRC_AUTO = 0
+SRC_FRONT = 1
+SRC_BACK = 2
+SRC_ZBUFFER = 3
+SRC_PUP = 4
+SRC_OVER = 5
+SRC_UNDER = 6
+SRC_FRAMEGRABBER = 7
+BF_ZERO = 0
+BF_ONE = 1
+BF_DC = 2
+BF_SC = 2
+BF_MDC = 3
+BF_MSC = 3
+BF_SA = 4
+BF_MSA = 5
+BF_DA = 6
+BF_MDA = 7
+BF_MIN_SA_MDA = 8
+AF_NEVER = 0
+AF_LESS = 1
+AF_EQUAL = 2
+AF_LEQUAL = 3
+AF_GREATER = 4
+AF_NOTEQUAL = 5
+AF_GEQUAL = 6
+AF_ALWAYS = 7
+ZF_NEVER = 0
+ZF_LESS = 1
+ZF_EQUAL = 2
+ZF_LEQUAL = 3
+ZF_GREATER = 4
+ZF_NOTEQUAL = 5
+ZF_GEQUAL = 6
+ZF_ALWAYS = 7
+ZSRC_DEPTH = 0
+ZSRC_COLOR = 1
+SMP_OFF = 0x0
+SMP_ON = 0x1
+SMP_SMOOTHER = 0x2
+SML_OFF = 0x0
+SML_ON = 0x1
+SML_SMOOTHER = 0x2
+SML_END_CORRECT = 0x4
+PYSM_OFF = 0
+PYSM_ON = 1
+PYSM_SHRINK = 2
+DT_OFF = 0
+DT_ON = 1
+PUP_NONE = 0
+PUP_GREY = 0x1
+PUP_BOX = 0x2
+PUP_CHECK = 0x4
+GLC_OLDPOLYGON = 0
+GLC_ZRANGEMAP = 1
+GLC_MQUEUERATE = 2
+GLC_SOFTATTACH = 3
+GLC_MANAGEBG = 4
+GLC_SLOWMAPCOLORS = 5
+GLC_INPUTCHANGEBUG = 6
+GLC_NOBORDERBUG = 7
+GLC_SET_VSYNC = 8
+GLC_GET_VSYNC = 9
+GLC_VSYNC_SLEEP = 10
+GLC_COMPATRATE = 15
+C16X1 = 0
+C16X2 = 1
+C32X1 = 2
+C32X2 = 3
+CCROSS = 4
+FLAT = 0
+GOURAUD = 1
+LO_ZERO = 0x0
+LO_AND = 0x1
+LO_ANDR = 0x2
+LO_SRC = 0x3
+LO_ANDI = 0x4
+LO_DST = 0x5
+LO_XOR = 0x6
+LO_OR = 0x7
+LO_NOR = 0x8
+LO_XNOR = 0x9
+LO_NDST = 0xa
+LO_ORR = 0xb
+LO_NSRC = 0xc
+LO_ORI = 0xd
+LO_NAND = 0xe
+LO_ONE = 0xf
+INFOCUSSCRN = -2
+ST_KEEP = 0
+ST_ZERO = 1
+ST_REPLACE = 2
+ST_INCR = 3
+ST_DECR = 4
+ST_INVERT = 5
+SF_NEVER = 0
+SF_LESS = 1
+SF_EQUAL = 2
+SF_LEQUAL = 3
+SF_GREATER = 4
+SF_NOTEQUAL = 5
+SF_GEQUAL = 6
+SF_ALWAYS = 7
+SS_OFF = 0
+SS_DEPTH = 1
+PYM_FILL = 1
+PYM_POINT = 2
+PYM_LINE = 3
+PYM_HOLLOW = 4
+PYM_LINE_FAST = 5
+FG_OFF = 0
+FG_ON = 1
+FG_DEFINE = 2
+FG_VTX_EXP = 2
+FG_VTX_LIN = 3
+FG_PIX_EXP = 4
+FG_PIX_LIN = 5
+FG_VTX_EXP2 = 6
+FG_PIX_EXP2 = 7
+PM_SHIFT = 0
+PM_EXPAND = 1
+PM_C0 = 2
+PM_C1 = 3
+PM_ADD24 = 4
+PM_SIZE = 5
+PM_OFFSET = 6
+PM_STRIDE = 7
+PM_TTOB = 8
+PM_RTOL = 9
+PM_ZDATA = 10
+PM_WARP = 11
+PM_RDX = 12
+PM_RDY = 13
+PM_CDX = 14
+PM_CDY = 15
+PM_XSTART = 16
+PM_YSTART = 17
+PM_VO1 = 1000
+NAUTO = 0
+NNORMALIZE = 1
+AC_CLEAR = 0
+AC_ACCUMULATE = 1
+AC_CLEAR_ACCUMULATE = 2
+AC_RETURN = 3
+AC_MULT = 4
+AC_ADD = 5
+CP_OFF = 0
+CP_ON = 1
+CP_DEFINE = 2
+SB_RESET = 0
+SB_TRACK = 1
+SB_HOLD = 2
+RD_FREEZE = 0x00000001
+RD_ALPHAONE = 0x00000002
+RD_IGNORE_UNDERLAY = 0x00000004
+RD_IGNORE_OVERLAY = 0x00000008
+RD_IGNORE_PUP = 0x00000010
+RD_OFFSCREEN = 0x00000020
+GD_XPMAX = 0
+GD_YPMAX = 1
+GD_XMMAX = 2
+GD_YMMAX = 3
+GD_ZMIN = 4
+GD_ZMAX = 5
+GD_BITS_NORM_SNG_RED = 6
+GD_BITS_NORM_SNG_GREEN = 7
+GD_BITS_NORM_SNG_BLUE = 8
+GD_BITS_NORM_DBL_RED = 9
+GD_BITS_NORM_DBL_GREEN = 10
+GD_BITS_NORM_DBL_BLUE = 11
+GD_BITS_NORM_SNG_CMODE = 12
+GD_BITS_NORM_DBL_CMODE = 13
+GD_BITS_NORM_SNG_MMAP = 14
+GD_BITS_NORM_DBL_MMAP = 15
+GD_BITS_NORM_ZBUFFER = 16
+GD_BITS_OVER_SNG_CMODE = 17
+GD_BITS_UNDR_SNG_CMODE = 18
+GD_BITS_PUP_SNG_CMODE = 19
+GD_BITS_NORM_SNG_ALPHA = 21
+GD_BITS_NORM_DBL_ALPHA = 22
+GD_BITS_CURSOR = 23
+GD_OVERUNDER_SHARED = 24
+GD_BLEND = 25
+GD_CIFRACT = 26
+GD_CROSSHAIR_CINDEX = 27
+GD_DITHER = 28
+GD_LINESMOOTH_CMODE = 30
+GD_LINESMOOTH_RGB = 31
+GD_LOGICOP = 33
+GD_NSCRNS = 35
+GD_NURBS_ORDER = 36
+GD_NBLINKS = 37
+GD_NVERTEX_POLY = 39
+GD_PATSIZE_64 = 40
+GD_PNTSMOOTH_CMODE = 41
+GD_PNTSMOOTH_RGB = 42
+GD_PUP_TO_OVERUNDER = 43
+GD_READSOURCE = 44
+GD_READSOURCE_ZBUFFER = 48
+GD_STEREO = 50
+GD_SUBPIXEL_LINE = 51
+GD_SUBPIXEL_PNT = 52
+GD_SUBPIXEL_POLY = 53
+GD_TRIMCURVE_ORDER = 54
+GD_WSYS = 55
+GD_ZDRAW_GEOM = 57
+GD_ZDRAW_PIXELS = 58
+GD_SCRNTYPE = 61
+GD_TEXTPORT = 62
+GD_NMMAPS = 63
+GD_FRAMEGRABBER = 64
+GD_TIMERHZ = 66
+GD_DBBOX = 67
+GD_AFUNCTION = 68
+GD_ALPHA_OVERUNDER = 69
+GD_BITS_ACBUF = 70
+GD_BITS_ACBUF_HW = 71
+GD_BITS_STENCIL = 72
+GD_CLIPPLANES = 73
+GD_FOGVERTEX = 74
+GD_LIGHTING_TWOSIDE = 76
+GD_POLYMODE = 77
+GD_POLYSMOOTH = 78
+GD_SCRBOX = 79
+GD_TEXTURE = 80
+GD_FOGPIXEL = 81
+GD_TEXTURE_PERSP = 82
+GD_MUXPIPES = 83
+GD_NOLIMIT = -2
+GD_WSYS_NONE = 0
+GD_WSYS_4S = 1
+GD_SCRNTYPE_WM = 0
+GD_SCRNTYPE_NOWM = 1
+N_PIXEL_TOLERANCE = 1
+N_CULLING = 2
+N_DISPLAY = 3
+N_ERRORCHECKING = 4
+N_SUBDIVISIONS = 5
+N_S_STEPS = 6
+N_T_STEPS = 7
+N_TILES = 8
+N_TMP1 = 9
+N_TMP2 = 10
+N_TMP3 = 11
+N_TMP4 = 12
+N_TMP5 = 13
+N_TMP6 = 14
+N_FILL = 1.0
+N_OUTLINE_POLY = 2.0
+N_OUTLINE_PATCH = 5.0
+N_ISOLINE_S = 12.0
+N_ST = 0x8
+N_STW = 0xd
+N_XYZ = 0x4c
+N_XYZW = 0x51
+N_TEX = 0x88
+N_TEXW = 0x8d
+N_RGBA = 0xd0
+N_RGBAW = 0xd5
+N_P2D = 0x8
+N_P2DR = 0xd
+N_V3D = 0x4c
+N_V3DR = 0x51
+N_T2D = 0x88
+N_T2DR = 0x8d
+N_C4D = 0xd0
+N_C4DR = 0xd5
+LMNULL = 0.0
+MSINGLE = 0
+MPROJECTION = 1
+MVIEWING = 2
+MTEXTURE = 3
+MAXLIGHTS = 8
+MAXRESTRICTIONS = 4
+DEFMATERIAL = 0
+EMISSION = 1
+AMBIENT = 2
+DIFFUSE = 3
+SPECULAR = 4
+SHININESS = 5
+COLORINDEXES = 6
+ALPHA = 7
+DEFLIGHT = 100
+LCOLOR = 101
+POSITION = 102
+SPOTDIRECTION = 103
+SPOTLIGHT = 104
+DEFLMODEL = 200
+LOCALVIEWER = 201
+ATTENUATION = 202
+ATTENUATION2 = 203
+TWOSIDE = 204
+MATERIAL = 1000
+BACKMATERIAL = 1001
+LIGHT0 = 1100
+LIGHT1 = 1101
+LIGHT2 = 1102
+LIGHT3 = 1103
+LIGHT4 = 1104
+LIGHT5 = 1105
+LIGHT6 = 1106
+LIGHT7 = 1107
+LMODEL = 1200
+LMC_COLOR = 0
+LMC_EMISSION = 1
+LMC_AMBIENT = 2
+LMC_DIFFUSE = 3
+LMC_SPECULAR = 4
+LMC_AD = 5
+LMC_NULL = 6
+TX_MINFILTER = 0x100
+TX_MAGFILTER = 0x200
+TX_WRAP = 0x300
+TX_WRAP_S = 0x310
+TX_WRAP_T = 0x320
+TX_TILE = 0x400
+TX_BORDER = 0x500
+TX_NULL = 0x000
+TX_POINT = 0x110
+TX_BILINEAR = 0x220
+TX_MIPMAP = 0x120
+TX_MIPMAP_POINT = 0x121
+TX_MIPMAP_LINEAR = 0x122
+TX_MIPMAP_BILINEAR = 0x123
+TX_MIPMAP_TRILINEAR = 0x124
+TX_REPEAT = 0x301
+TX_CLAMP = 0x302
+TX_SELECT = 0x303
+TX_TEXTURE_0 = 0
+TV_MODULATE = 0x101
+TV_BLEND = 0x102
+TV_DECAL = 0x103
+TV_COLOR = 0x200
+TV_NULL = 0x000
+TV_ENV0 = 0
+TX_S = 0
+TX_T = 1
+TG_OFF = 0
+TG_ON = 1
+TG_CONTOUR = 2
+TG_LINEAR = 3
+TG_SPHEREMAP = 4
+TG_REFRACTMAP = 5
+DGLSINK = 0
+DGLLOCAL = 1
+DGLTSOCKET = 2
+DGL4DDN = 3
+PUP_CURSOR = PUP_COLOR
+FATAL = 1
+WARNING = 2
+ASK_CONT = 3
+ASK_RESTART = 4
+XMAXSCREEN = 1279
+YMAXSCREEN = 1023
+XMAXMEDIUM = 1023
+YMAXMEDIUM = 767
+XMAX170 = 645
+YMAX170 = 484
+XMAXPAL = 779
+YMAXPAL = 574
diff --git a/Lib/plat-irix6/GLWS.py b/Lib/plat-irix6/GLWS.py
new file mode 100644
index 0000000..69dab71
--- /dev/null
+++ b/Lib/plat-irix6/GLWS.py
@@ -0,0 +1,12 @@
+NOERROR = 0
+NOCONTEXT = -1
+NODISPLAY = -2
+NOWINDOW = -3
+NOGRAPHICS = -4
+NOTTOP = -5
+NOVISUAL = -6
+BUFSIZE = -7
+BADWINDOW = -8
+ALREADYBOUND = -100
+BINDFAILED = -101
+SETFAILED = -102
diff --git a/Lib/plat-irix6/IN.py b/Lib/plat-irix6/IN.py
new file mode 100644
index 0000000..7340878
--- /dev/null
+++ b/Lib/plat-irix6/IN.py
@@ -0,0 +1,133 @@
+# Generated by h2py from /usr/include/netinet/in.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+
+# Included from sys/endian.h
+LITTLE_ENDIAN = 1234
+BIG_ENDIAN = 4321
+PDP_ENDIAN = 3412
+BYTE_ORDER = BIG_ENDIAN
+BYTE_ORDER = LITTLE_ENDIAN
+def ntohl(x): return (x)
+
+def ntohs(x): return (x)
+
+def htonl(x): return (x)
+
+def htons(x): return (x)
+
+def htonl(x): return ntohl(x)
+
+def htons(x): return ntohs(x)
+
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+
+# Included from standards.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+IPPROTO_IP = 0
+IPPROTO_ICMP = 1
+IPPROTO_IGMP = 2
+IPPROTO_GGP = 3
+IPPROTO_IPIP = 4
+IPPROTO_ENCAP = IPPROTO_IPIP
+IPPROTO_ST = 5
+IPPROTO_TCP = 6
+IPPROTO_EGP = 8
+IPPROTO_PUP = 12
+IPPROTO_UDP = 17
+IPPROTO_IDP = 22
+IPPROTO_TP = 29
+IPPROTO_XTP = 36
+IPPROTO_RSVP = 46
+IPPROTO_HELLO = 63
+IPPROTO_ND = 77
+IPPROTO_EON = 80
+IPPROTO_OSPF = 89
+IPPROTO_SWIPE = 94
+IPPROTO_RAW = 255
+IPPROTO_MAX = 256
+IPPORT_RESERVED = 1024
+IPPORT_MAXPORT = 65535
+def IN_CLASSA(i): return (((__int32_t)(i) & 0x80000000) == 0)
+
+IN_CLASSA_NET = 0xff000000
+IN_CLASSA_NSHIFT = 24
+IN_CLASSA_HOST = 0x00ffffff
+IN_CLASSA_MAX = 128
+def IN_CLASSB(i): return (((__int32_t)(i) & 0xc0000000) == 0x80000000)
+
+IN_CLASSB_NET = 0xffff0000
+IN_CLASSB_NSHIFT = 16
+IN_CLASSB_HOST = 0x0000ffff
+IN_CLASSB_MAX = 65536
+def IN_CLASSC(i): return (((__int32_t)(i) & 0xe0000000) == 0xc0000000)
+
+IN_CLASSC_NET = 0xffffff00
+IN_CLASSC_NSHIFT = 8
+IN_CLASSC_HOST = 0x000000ff
+def IN_CLASSD(i): return (((__int32_t)(i) & 0xf0000000) == 0xe0000000)
+
+IN_CLASSD_NET = 0xf0000000
+IN_CLASSD_NSHIFT = 28
+IN_CLASSD_HOST = 0x0fffffff
+def IN_MULTICAST(i): return IN_CLASSD(i)
+
+def IN_EXPERIMENTAL(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
+
+def IN_BADCLASS(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
+
+INADDR_NONE = 0xffffffff
+IN_LOOPBACKNET = 127
+IP_OPTIONS = 1
+IP_HDRINCL = 2
+IP_TOS = 3
+IP_TTL = 4
+IP_RECVOPTS = 5
+IP_RECVRETOPTS = 6
+IP_RECVDSTADDR = 7
+IP_RETOPTS = 8
+IP_MULTICAST_IF = 20
+IP_MULTICAST_TTL = 21
+IP_MULTICAST_LOOP = 22
+IP_ADD_MEMBERSHIP = 23
+IP_DROP_MEMBERSHIP = 24
+IP_MULTICAST_VIF = 25
+IP_RSVP_VIF_ON = 26
+IP_RSVP_VIF_OFF = 27
+IP_RSVP_ON = 28
+IP_SENDSRCADDR = 36
+IP_DEFAULT_MULTICAST_TTL = 1
+IP_DEFAULT_MULTICAST_LOOP = 1
+IP_MAX_MEMBERSHIPS = 20
diff --git a/Lib/plat-irix6/IOCTL.py b/Lib/plat-irix6/IOCTL.py
new file mode 100644
index 0000000..cec3c3f
--- /dev/null
+++ b/Lib/plat-irix6/IOCTL.py
@@ -0,0 +1,233 @@
+# These lines were mostly generated by h2py.py (see demo/scripts)
+# from <sys/ioctl.h>, <sys/termio.h> and <termios.h> on Irix 4.0.2
+# with some manual changes to cope with imperfections in h2py.py.
+# The applicability on other systems is not clear; especially non-SYSV
+# systems may have a totally different set of ioctls.
+
+IOCTYPE = 0xff00
+LIOC = (ord('l')<<8)
+LIOCGETP = (LIOC|1)
+LIOCSETP = (LIOC|2)
+LIOCGETS = (LIOC|5)
+LIOCSETS = (LIOC|6)
+DIOC = (ord('d')<<8)
+DIOCGETC = (DIOC|1)
+DIOCGETB = (DIOC|2)
+DIOCSETE = (DIOC|3)
+IOCPARM_MASK = 0x7f
+IOC_VOID = 0x20000000
+IOC_OUT = 0x40000000
+IOC_IN = 0x80000000
+IOC_INOUT = (IOC_IN|IOC_OUT)
+int = 'i'
+short = 'h'
+long = 'l'
+def sizeof(t): import struct; return struct.calcsize(t)
+def _IO(x,y): return (IOC_VOID|((x)<<8)|y)
+def _IOR(x,y,t): return (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
+def _IOW(x,y,t): return (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
+# this should be _IORW, but stdio got there first
+def _IOWR(x,y,t): return (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
+FIONREAD = _IOR(ord('f'), 127, int)
+FIONBIO = _IOW(ord('f'), 126, int)
+FIOASYNC = _IOW(ord('f'), 125, int)
+FIOSETOWN = _IOW(ord('f'), 124, int)
+FIOGETOWN = _IOR(ord('f'), 123, int)
+NCC = 8
+NCC_PAD = 7
+NCC_EXT = 16
+NCCS = (NCC+NCC_PAD+NCC_EXT)
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VEOL = 5
+VEOL2 = 6
+VMIN = VEOF
+VTIME = VEOL
+VSWTCH = 7
+VLNEXT = (NCC+NCC_PAD+0)
+VWERASE = (NCC+NCC_PAD+1)
+VRPRNT = (NCC+NCC_PAD+2)
+VFLUSHO = (NCC+NCC_PAD+3)
+VSTOP = (NCC+NCC_PAD+4)
+VSTART = (NCC+NCC_PAD+5)
+CNUL = '\0'
+CDEL = '\377'
+CESC = '\\'
+CINTR = '\177'
+CQUIT = '\34'
+CBRK = '\377'
+def CTRL(c): return ord(c) & 0x0f
+CERASE = CTRL('H')
+CKILL = CTRL('U')
+CEOF = CTRL('d')
+CEOT = CEOF
+CSTART = CTRL('q')
+CSTOP = CTRL('s')
+CSWTCH = CTRL('z')
+CSUSP = CSWTCH
+CNSWTCH = 0
+CLNEXT = CTRL('v')
+CWERASE = CTRL('w')
+CFLUSHO = CTRL('o')
+CFLUSH = CFLUSHO
+CRPRNT = CTRL('r')
+CDSUSP = CTRL('y')
+IGNBRK = 0000001
+BRKINT = 0000002
+IGNPAR = 0000004
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IBLKMD = 0020000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+BSDLY = 0020000
+BS0 = 0
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0
+FF1 = 0100000
+CBAUD = 0000017
+B0 = 0
+B50 = 0000001
+B75 = 0000002
+B110 = 0000003
+B134 = 0000004
+B150 = 0000005
+B200 = 0000006
+B300 = 0000007
+B600 = 0000010
+B1200 = 0000011
+B1800 = 0000012
+B2400 = 0000013
+B4800 = 0000014
+B9600 = 0000015
+B19200 = 0000016
+EXTA = 0000016
+B38400 = 0000017
+EXTB = 0000017
+CSIZE = 0000060
+CS5 = 0
+CS6 = 0000020
+CS7 = 0000040
+CS8 = 0000060
+CSTOPB = 0000100
+CREAD = 0000200
+PARENB = 0000400
+PARODD = 0001000
+HUPCL = 0002000
+CLOCAL = 0004000
+LOBLK = 0040000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+IIEXTEN = 0000400
+ITOSTOP = 0001000
+SSPEED = B9600
+IOCTYPE = 0xff00
+TIOC = (ord('T')<<8)
+oTCGETA = (TIOC|1)
+oTCSETA = (TIOC|2)
+oTCSETAW = (TIOC|3)
+oTCSETAF = (TIOC|4)
+TCSBRK = (TIOC|5)
+TCXONC = (TIOC|6)
+TCFLSH = (TIOC|7)
+TCGETA = (TIOC|8)
+TCSETA = (TIOC|9)
+TCSETAW = (TIOC|10)
+TCSETAF = (TIOC|11)
+TIOCFLUSH = (TIOC|12)
+TCDSET = (TIOC|32)
+TCBLKMD = (TIOC|33)
+TIOCPKT = (TIOC|112)
+TIOCPKT_DATA = 0x00
+TIOCPKT_FLUSHREAD = 0x01
+TIOCPKT_FLUSHWRITE = 0x02
+TIOCPKT_NOSTOP = 0x10
+TIOCPKT_DOSTOP = 0x20
+TIOCNOTTY = (TIOC|113)
+TIOCSTI = (TIOC|114)
+TIOCSPGRP = _IOW(ord('t'), 118, int)
+TIOCGPGRP = _IOR(ord('t'), 119, int)
+TIOCCONS = _IOW(ord('t'), 120, int)
+struct_winsize = 'hhhh'
+TIOCGWINSZ = _IOR(ord('t'), 104, struct_winsize)
+TIOCSWINSZ = _IOW(ord('t'), 103, struct_winsize)
+TFIOC = (ord('F')<<8)
+oFIONREAD = (TFIOC|127)
+LDIOC = (ord('D')<<8)
+LDOPEN = (LDIOC|0)
+LDCLOSE = (LDIOC|1)
+LDCHG = (LDIOC|2)
+LDGETT = (LDIOC|8)
+LDSETT = (LDIOC|9)
+TERM_NONE = 0
+TERM_TEC = 1
+TERM_V61 = 2
+TERM_V10 = 3
+TERM_TEX = 4
+TERM_D40 = 5
+TERM_H45 = 6
+TERM_D42 = 7
+TM_NONE = 0000
+TM_SNL = 0001
+TM_ANL = 0002
+TM_LCF = 0004
+TM_CECHO = 0010
+TM_CINVIS = 0020
+TM_SET = 0200
+LDISC0 = 0
+LDISC1 = 1
+NTTYDISC = LDISC1
+VSUSP = VSWTCH
+TCSANOW = 0
+TCSADRAIN = 1
+TCSAFLUSH = 2
+TCIFLUSH = 0
+TCOFLUSH = 1
+TCIOFLUSH = 2
+TCOOFF = 0
+TCOON = 1
+TCIOFF = 2
+TCION = 3
+TO_STOP = LOBLK
+IEXTEN = IIEXTEN
+TOSTOP = ITOSTOP
diff --git a/Lib/plat-irix6/SOCKET.py b/Lib/plat-irix6/SOCKET.py
new file mode 100644
index 0000000..39a8b63
--- /dev/null
+++ b/Lib/plat-irix6/SOCKET.py
@@ -0,0 +1,152 @@
+# Generated by h2py from /usr/include/sys/socket.h
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+
+# Included from standards.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+NC_TPI_CLTS = 1
+NC_TPI_COTS = 2
+NC_TPI_COTS_ORD = 3
+NC_TPI_RAW = 4
+SOCK_DGRAM = NC_TPI_CLTS
+SOCK_STREAM = NC_TPI_COTS
+SOCK_RAW = NC_TPI_RAW
+SOCK_RDM = 5
+SOCK_SEQPACKET = 6
+SO_DEBUG = 0x0001
+SO_ACCEPTCONN = 0x0002
+SO_REUSEADDR = 0x0004
+SO_KEEPALIVE = 0x0008
+SO_DONTROUTE = 0x0010
+SO_BROADCAST = 0x0020
+SO_USELOOPBACK = 0x0040
+SO_LINGER = 0x0080
+SO_OOBINLINE = 0x0100
+SO_REUSEPORT = 0x0200
+SO_ORDREL = 0x0200
+SO_IMASOCKET = 0x0400
+SO_CHAMELEON = 0x1000
+SO_PASSIFNAME = 0x2000
+SO_SNDBUF = 0x1001
+SO_RCVBUF = 0x1002
+SO_SNDLOWAT = 0x1003
+SO_RCVLOWAT = 0x1004
+SO_SNDTIMEO = 0x1005
+SO_RCVTIMEO = 0x1006
+SO_ERROR = 0x1007
+SO_TYPE = 0x1008
+SO_PROTOTYPE = 0x1009
+SOL_SOCKET = 0xffff
+AF_UNSPEC = 0
+AF_LOCAL = 1
+AF_UNIX = AF_LOCAL
+AF_INET = 2
+AF_IMPLINK = 3
+AF_PUP = 4
+AF_CHAOS = 5
+AF_NS = 6
+AF_ISO = 7
+AF_ECMA = 8
+AF_DATAKIT = 9
+AF_CCITT = 10
+AF_SNA = 11
+AF_DECnet = 12
+AF_DLI = 13
+AF_LAT = 14
+AF_HYLINK = 15
+AF_APPLETALK = 16
+AF_ROUTE = 17
+AF_RAW = 18
+AF_LINK = 18
+pseudo_AF_XTP = 19
+AF_NIT = 17
+AF_802 = 18
+AF_OSI = 19
+AF_X25 = 20
+AF_OSINET = 21
+AF_GOSIP = 22
+AF_SDL = 23
+AF_INET6 = 24
+AF_LINK = 25
+AF_MAX = (AF_LINK+1)
+_SIN_ADDR_SIZE = 8
+_SIN_SA_DATA_SIZE = 14
+_MAX_SA_LEN = 20
+def OPTLEN(x): return ((((x) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
+
+PF_UNSPEC = AF_UNSPEC
+PF_LOCAL = AF_LOCAL
+PF_UNIX = PF_LOCAL
+PF_INET = AF_INET
+PF_IMPLINK = AF_IMPLINK
+PF_PUP = AF_PUP
+PF_CHAOS = AF_CHAOS
+PF_NS = AF_NS
+PF_ISO = AF_ISO
+PF_OSI = AF_ISO
+PF_ECMA = AF_ECMA
+PF_DATAKIT = AF_DATAKIT
+PF_CCITT = AF_CCITT
+PF_SNA = AF_SNA
+PF_DECnet = AF_DECnet
+PF_DLI = AF_DLI
+PF_LAT = AF_LAT
+PF_HYLINK = AF_HYLINK
+PF_APPLETALK = AF_APPLETALK
+PF_ROUTE = AF_ROUTE
+PF_LINK = AF_LINK
+PF_XTP = pseudo_AF_XTP
+PF_RAW = AF_RAW
+PF_NIT = AF_NIT
+PF_802 = AF_802
+PF_X25 = AF_X25
+PF_OSINET = AF_OSINET
+PF_GOSIP = AF_GOSIP
+PF_INET6 = AF_INET6
+PF_MAX = AF_MAX
+NET_RT_DUMP = 1
+NET_RT_FLAGS = 2
+NET_RT_IFLIST = 3
+IPCTL_FORWARDING = 1
+IPCTL_SENDREDIRECTS = 2
+UDPCTL_CHECKSUM = 1
+SOMAXCONN = 1000
+MSG_OOB = 0x1
+MSG_PEEK = 0x2
+MSG_DONTROUTE = 0x4
+MSG_EOR = 0x8
+MSG_TRUNC = 0x10
+MSG_CTRUNC = 0x20
+MSG_WAITALL = 0x40
+MSG_DONTWAIT = 0x80
+MSG_BTAG = 0x40
+MSG_ETAG = 0x80
+MSG_MAXIOVLEN = 16
+_ALIGNBYTES = 7
+def _ALIGN(p): return (((u_int)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
+
+SCM_RIGHTS = 0x01
diff --git a/Lib/plat-irix6/SV.py b/Lib/plat-irix6/SV.py
new file mode 100644
index 0000000..08fb917
--- /dev/null
+++ b/Lib/plat-irix6/SV.py
@@ -0,0 +1,120 @@
+NTSC_XMAX = 640
+NTSC_YMAX = 480
+PAL_XMAX = 768
+PAL_YMAX = 576
+BLANKING_BUFFER_SIZE = 2
+
+MAX_SOURCES = 2
+
+# mode parameter for Bind calls
+IN_OFF = 0 # No Video
+IN_OVER = 1 # Video over graphics
+IN_UNDER = 2 # Video under graphics
+IN_REPLACE = 3 # Video replaces entire win
+
+# mode parameters for LoadMap calls. Specifies buffer, always 256 entries
+INPUT_COLORMAP = 0 # tuples of 8-bit RGB
+CHROMA_KEY_MAP = 1 # tuples of 8-bit RGB
+COLOR_SPACE_MAP = 2 # tuples of 8-bit RGB
+GAMMA_MAP = 3 # tuples of 24-bit red values
+
+# mode parameters for UseExclusive calls
+INPUT = 0
+OUTPUT = 1
+IN_OUT = 2
+
+# Format constants for the capture routines
+RGB8_FRAMES = 0 # noninterleaved 8 bit 3:2:3 RBG fields
+RGB32_FRAMES = 1 # 32-bit 8:8:8 RGB frames
+YUV411_FRAMES = 2 # interleaved, 8:2:2 YUV format
+YUV411_FRAMES_AND_BLANKING_BUFFER = 3
+
+#
+# sv.SetParam is passed variable length argument lists,
+# consisting of <name, value> pairs. The following
+# constants identify argument names.
+#
+_NAME_BASE = 1000
+SOURCE = (_NAME_BASE + 0)
+SOURCE1 = 0
+SOURCE2 = 1
+SOURCE3 = 2
+COLOR = (_NAME_BASE + 1)
+DEFAULT_COLOR = 0
+USER_COLOR = 1
+MONO = 2
+OUTPUTMODE = (_NAME_BASE + 2)
+LIVE_OUTPUT = 0
+STILL24_OUT = 1
+FREEZE = (_NAME_BASE + 3)
+DITHER = (_NAME_BASE + 4)
+OUTPUT_FILTER = (_NAME_BASE + 5)
+HUE = (_NAME_BASE + 6)
+GENLOCK = (_NAME_BASE + 7)
+GENLOCK_OFF = 0
+GENLOCK_ON = 1
+GENLOCK_HOUSE = 2
+BROADCAST = (_NAME_BASE + 8)
+NTSC = 0
+PAL = 1
+VIDEO_MODE = (_NAME_BASE + 9)
+COMP = 0
+SVIDEO = 1
+INPUT_BYPASS = (_NAME_BASE + 10)
+FIELDDROP = (_NAME_BASE + 11)
+SLAVE = (_NAME_BASE + 12)
+APERTURE_FACTOR = (_NAME_BASE + 13)
+AFACTOR_0 = 0
+AFACTOR_QTR = 1
+AFACTOR_HLF = 2
+AFACTOR_ONE = 3
+CORING = (_NAME_BASE + 14)
+COR_OFF = 0
+COR_1LSB = 1
+COR_2LSB = 2
+COR_3LSB = 3
+APERTURE_BANDPASS = (_NAME_BASE + 15)
+ABAND_F0 = 0
+ABAND_F1 = 1
+ABAND_F2 = 2
+ABAND_F3 = 3
+PREFILTER = (_NAME_BASE + 16)
+CHROMA_TRAP = (_NAME_BASE + 17)
+CK_THRESHOLD = (_NAME_BASE + 18)
+PAL_SENSITIVITY = (_NAME_BASE + 19)
+GAIN_CONTROL = (_NAME_BASE + 20)
+GAIN_SLOW = 0
+GAIN_MEDIUM = 1
+GAIN_FAST = 2
+GAIN_FROZEN = 3
+AUTO_CKILL = (_NAME_BASE + 21)
+VTR_MODE = (_NAME_BASE + 22)
+VTR_INPUT = 0
+CAMERA_INPUT = 1
+LUMA_DELAY = (_NAME_BASE + 23)
+VNOISE = (_NAME_BASE + 24)
+VNOISE_NORMAL = 0
+VNOISE_SEARCH = 1
+VNOISE_AUTO = 2
+VNOISE_BYPASS = 3
+CHCV_PAL = (_NAME_BASE + 25)
+CHCV_NTSC = (_NAME_BASE + 26)
+CCIR_LEVELS = (_NAME_BASE + 27)
+STD_CHROMA = (_NAME_BASE + 28)
+DENC_VTBYPASS = (_NAME_BASE + 29)
+FAST_TIMECONSTANT = (_NAME_BASE + 30)
+GENLOCK_DELAY = (_NAME_BASE + 31)
+PHASE_SYNC = (_NAME_BASE + 32)
+VIDEO_OUTPUT = (_NAME_BASE + 33)
+CHROMA_PHASEOUT = (_NAME_BASE + 34)
+CHROMA_CENTER = (_NAME_BASE + 35)
+YUV_TO_RGB_INVERT = (_NAME_BASE + 36)
+SOURCE1_BROADCAST = (_NAME_BASE + 37)
+SOURCE1_MODE = (_NAME_BASE + 38)
+SOURCE2_BROADCAST = (_NAME_BASE + 39)
+SOURCE2_MODE = (_NAME_BASE + 40)
+SOURCE3_BROADCAST = (_NAME_BASE + 41)
+SOURCE3_MODE = (_NAME_BASE + 42)
+SIGNAL_STD = (_NAME_BASE + 43)
+NOSIGNAL = 2
+SIGNAL_COLOR = (_NAME_BASE + 44)
diff --git a/Lib/plat-irix6/TERMIOS.py b/Lib/plat-irix6/TERMIOS.py
new file mode 100644
index 0000000..fa4a475
--- /dev/null
+++ b/Lib/plat-irix6/TERMIOS.py
@@ -0,0 +1,676 @@
+# Generated by h2py from /usr/include/sys/termios.h
+
+# Included from standards.h
+
+# Included from sys/ttydev.h
+__NEW_INVALID_BAUD = 1800
+__OLD_B0 = 0
+__OLD_B50 = 0000001
+__OLD_B75 = 0000002
+__OLD_B110 = 0000003
+__OLD_B134 = 0000004
+__OLD_B150 = 0000005
+__OLD_B200 = 0000006
+__OLD_B300 = 0000007
+__OLD_B600 = 0000010
+__OLD_B1200 = 0000011
+__OLD_B1800 = 0000012
+__OLD_B2400 = 0000013
+__OLD_B4800 = 0000014
+__OLD_B9600 = 0000015
+__OLD_B19200 = 0000016
+__OLD_EXTA = 0000016
+__OLD_B38400 = 0000017
+__OLD_EXTB = 0000017
+__OLD_INVALID_BAUD = __OLD_B1800
+B0 = 0
+B50 = 50
+B75 = 75
+B110 = 110
+B134 = 134
+B150 = 150
+B200 = 200
+B300 = 300
+B600 = 600
+B1200 = 1200
+B1800 = 1800
+B2400 = 2400
+B4800 = 4800
+B9600 = 9600
+B19200 = 19200
+EXTA = 19200
+B38400 = 38400
+EXTB = 38400
+B57600 = 57600
+B76800 = 76800
+B115200 = 115200
+__INVALID_BAUD = 1800
+B0 = __OLD_B0
+B50 = __OLD_B50
+B75 = __OLD_B75
+B110 = __OLD_B110
+B134 = __OLD_B134
+B150 = __OLD_B150
+B200 = __OLD_B200
+B300 = __OLD_B300
+B600 = __OLD_B600
+B1200 = __OLD_B1200
+B1800 = __OLD_B1800
+B2400 = __OLD_B2400
+B4800 = __OLD_B4800
+B9600 = __OLD_B9600
+B19200 = __OLD_B19200
+EXTA = __OLD_B19200
+B38400 = __OLD_B38400
+EXTB = __OLD_B38400
+__INVALID_BAUD = __OLD_INVALID_BAUD
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+_POSIX_VDISABLE = 0
+def CTRL(c): return ((c)&037)
+
+IBSHIFT = 16
+NCC = 8
+NCCS = 23
+__NEW_MAX_BAUD = 500000
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VEOL = 5
+VEOL2 = 6
+VMIN = 4
+VTIME = 5
+VSWTCH = 7
+VSTART = 8
+VSTOP = 9
+VSUSP = 10
+VDSUSP = 11
+VREPRINT = 12
+VDISCARD = 13
+VWERASE = 14
+VLNEXT = 15
+VRPRNT = VREPRINT
+VFLUSHO = VDISCARD
+VCEOF = NCC
+VCEOL = (NCC + 1)
+CNUL = 0
+CDEL = 0377
+CESC = ord('\\')
+CINTR = 0177
+CQUIT = 034
+CERASE = CTRL(ord('H'))
+CKILL = CTRL(ord('U'))
+CEOL = 0
+CEOL2 = 0
+CEOF = CTRL(ord('d'))
+CEOT = CEOF
+CSTART = CTRL(ord('q'))
+CSTOP = CTRL(ord('s'))
+CSWTCH = CTRL(ord('z'))
+CNSWTCH = 0
+CSUSP = CSWTCH
+CLNEXT = CTRL(ord('v'))
+CWERASE = CTRL(ord('w'))
+CFLUSHO = CTRL(ord('o'))
+CFLUSH = CFLUSHO
+CRPRNT = CTRL(ord('r'))
+CDSUSP = CTRL(ord('y'))
+CBRK = 0377
+IGNBRK = 0000001
+BRKINT = 0000002
+IGNPAR = 0000004
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IMAXBEL = 0020000
+IBLKMD = 0040000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+XTABS = 0014000
+BSDLY = 0020000
+BS0 = 0
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0
+FF1 = 0100000
+PAGEOUT = 0200000
+WRAP = 0400000
+CBAUD = 000000017
+CSIZE = 000000060
+CS5 = 0
+CS6 = 000000020
+CS7 = 000000040
+CS8 = 000000060
+CSTOPB = 000000100
+CREAD = 000000200
+PARENB = 000000400
+PARODD = 000001000
+HUPCL = 000002000
+CLOCAL = 000004000
+RCV1EN = 000010000
+XMT1EN = 000020000
+LOBLK = 000040000
+XCLUDE = 000100000
+CIBAUD = 003600000
+PAREXT = 004000000
+CNEW_RTSCTS = 010000000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+IEXTEN = 0000400
+ITOSTOP = 0100000
+TOSTOP = ITOSTOP
+ECHOCTL = 0001000
+ECHOPRT = 0002000
+ECHOKE = 0004000
+DEFECHO = 0010000
+FLUSHO = 0020000
+PENDIN = 0040000
+TIOC = (ord('T')<<8)
+__NEW_TCGETA = (TIOC|201)
+__NEW_TCSETA = (TIOC|202)
+__NEW_TCSETAW = (TIOC|203)
+__NEW_TCSETAF = (TIOC|204)
+__OLD_TCGETA = (TIOC|1)
+__OLD_TCSETA = (TIOC|2)
+__OLD_TCSETAW = (TIOC|3)
+__OLD_TCSETAF = (TIOC|4)
+TCGETA = __NEW_TCGETA
+TCSETA = __NEW_TCSETA
+TCSETAW = __NEW_TCSETAW
+TCSETAF = __NEW_TCSETAF
+TCGETA = __OLD_TCGETA
+TCSETA = __OLD_TCSETA
+TCSETAW = __OLD_TCSETAW
+TCSETAF = __OLD_TCSETAF
+TCSBRK = (TIOC|5)
+TCXONC = (TIOC|6)
+TCFLSH = (TIOC|7)
+
+# Included from sys/ioctl.h
+IOCTYPE = 0xff00
+LIOC = (ord('l')<<8)
+LIOCGETP = (LIOC|1)
+LIOCSETP = (LIOC|2)
+LIOCGETS = (LIOC|5)
+LIOCSETS = (LIOC|6)
+DIOC = (ord('d')<<8)
+DIOCGETC = (DIOC|1)
+DIOCGETB = (DIOC|2)
+DIOCSETE = (DIOC|3)
+
+# Included from sys/ioccom.h
+IOCPARM_MASK = 0xff
+IOC_VOID = 0x20000000
+IOC_OUT = 0x40000000
+IOC_IN = 0x80000000
+IOC_INOUT = (IOC_IN|IOC_OUT)
+
+# Included from net/soioctl.h
+
+# Included from sys/termio.h
+
+# Included from sys/termios.h
+_POSIX_VDISABLE = 0
+def CTRL(c): return ((c)&037)
+
+IBSHIFT = 16
+NCC = 8
+NCCS = 23
+__NEW_MAX_BAUD = 500000
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VEOL = 5
+VEOL2 = 6
+VMIN = 4
+VTIME = 5
+VSWTCH = 7
+VSTART = 8
+VSTOP = 9
+VSUSP = 10
+VDSUSP = 11
+VREPRINT = 12
+VDISCARD = 13
+VWERASE = 14
+VLNEXT = 15
+VRPRNT = VREPRINT
+VFLUSHO = VDISCARD
+VCEOF = NCC
+VCEOL = (NCC + 1)
+CNUL = 0
+CDEL = 0377
+CESC = ord('\\')
+CINTR = 0177
+CQUIT = 034
+CERASE = CTRL(ord('H'))
+CKILL = CTRL(ord('U'))
+CEOL = 0
+CEOL2 = 0
+CEOF = CTRL(ord('d'))
+CEOT = CEOF
+CSTART = CTRL(ord('q'))
+CSTOP = CTRL(ord('s'))
+CSWTCH = CTRL(ord('z'))
+CNSWTCH = 0
+CSUSP = CSWTCH
+CLNEXT = CTRL(ord('v'))
+CWERASE = CTRL(ord('w'))
+CFLUSHO = CTRL(ord('o'))
+CFLUSH = CFLUSHO
+CRPRNT = CTRL(ord('r'))
+CDSUSP = CTRL(ord('y'))
+CBRK = 0377
+IGNBRK = 0000001
+BRKINT = 0000002
+IGNPAR = 0000004
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IMAXBEL = 0020000
+IBLKMD = 0040000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+XTABS = 0014000
+BSDLY = 0020000
+BS0 = 0
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0
+FF1 = 0100000
+PAGEOUT = 0200000
+WRAP = 0400000
+CBAUD = 000000017
+CSIZE = 000000060
+CS5 = 0
+CS6 = 000000020
+CS7 = 000000040
+CS8 = 000000060
+CSTOPB = 000000100
+CREAD = 000000200
+PARENB = 000000400
+PARODD = 000001000
+HUPCL = 000002000
+CLOCAL = 000004000
+RCV1EN = 000010000
+XMT1EN = 000020000
+LOBLK = 000040000
+XCLUDE = 000100000
+CIBAUD = 003600000
+PAREXT = 004000000
+CNEW_RTSCTS = 010000000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+IEXTEN = 0000400
+ITOSTOP = 0100000
+TOSTOP = ITOSTOP
+ECHOCTL = 0001000
+ECHOPRT = 0002000
+ECHOKE = 0004000
+DEFECHO = 0010000
+FLUSHO = 0020000
+PENDIN = 0040000
+TIOC = (ord('T')<<8)
+__NEW_TCGETA = (TIOC|201)
+__NEW_TCSETA = (TIOC|202)
+__NEW_TCSETAW = (TIOC|203)
+__NEW_TCSETAF = (TIOC|204)
+__OLD_TCGETA = (TIOC|1)
+__OLD_TCSETA = (TIOC|2)
+__OLD_TCSETAW = (TIOC|3)
+__OLD_TCSETAF = (TIOC|4)
+TCGETA = __NEW_TCGETA
+TCSETA = __NEW_TCSETA
+TCSETAW = __NEW_TCSETAW
+TCSETAF = __NEW_TCSETAF
+TCGETA = __OLD_TCGETA
+TCSETA = __OLD_TCSETA
+TCSETAW = __OLD_TCSETAW
+TCSETAF = __OLD_TCSETAF
+TCSBRK = (TIOC|5)
+TCXONC = (TIOC|6)
+TCFLSH = (TIOC|7)
+LDISC0 = 0
+LDISC1 = 1
+NTTYDISC = LDISC1
+TIOCFLUSH = (TIOC|12)
+TCSETLABEL = (TIOC|31)
+TCDSET = (TIOC|32)
+TCBLKMD = (TIOC|33)
+TIOCPKT = (TIOC|112)
+TIOCPKT_DATA = 0x00
+TIOCPKT_FLUSHREAD = 0x01
+TIOCPKT_FLUSHWRITE = 0x02
+TIOCPKT_NOSTOP = 0x10
+TIOCPKT_DOSTOP = 0x20
+TIOCPKT_IOCTL = 0x40
+TIOCNOTTY = (TIOC|113)
+TIOCSTI = (TIOC|114)
+TFIOC = (ord('F')<<8)
+oFIONREAD = (TFIOC|127)
+TO_STOP = LOBLK
+IOCTYPE = 0xff00
+__NEW_TCGETS = (TIOC|213)
+__NEW_TCSETS = (TIOC|214)
+__NEW_TCSETSW = (TIOC|215)
+__NEW_TCSETSF = (TIOC|216)
+__OLD_TCGETS = (TIOC|13)
+__OLD_TCSETS = (TIOC|14)
+__OLD_TCSETSW = (TIOC|15)
+__OLD_TCSETSF = (TIOC|16)
+TCGETS = __NEW_TCGETS
+TCSETS = __NEW_TCSETS
+TCSETSW = __NEW_TCSETSW
+TCSETSF = __NEW_TCSETSF
+TCGETS = __OLD_TCGETS
+TCSETS = __OLD_TCSETS
+TCSETSW = __OLD_TCSETSW
+TCSETSF = __OLD_TCSETSF
+TCSANOW = ((ord('T')<<8)|14)
+TCSADRAIN = ((ord('T')<<8)|15)
+TCSAFLUSH = ((ord('T')<<8)|16)
+TCIFLUSH = 0
+TCOFLUSH = 1
+TCIOFLUSH = 2
+TCOOFF = 0
+TCOON = 1
+TCIOFF = 2
+TCION = 3
+tIOC = (ord('t')<<8)
+TIOCGETD = (tIOC|0)
+TIOCSETD = (tIOC|1)
+TIOCHPCL = (tIOC|2)
+TIOCGETP = (tIOC|8)
+TIOCSETP = (tIOC|9)
+TIOCSETN = (tIOC|10)
+TIOCEXCL = (tIOC|13)
+TIOCNXCL = (tIOC|14)
+TIOCSETC = (tIOC|17)
+TIOCGETC = (tIOC|18)
+TIOCLBIS = (tIOC|127)
+TIOCLBIC = (tIOC|126)
+TIOCLSET = (tIOC|125)
+TIOCLGET = (tIOC|124)
+TIOCSBRK = (tIOC|123)
+TIOCCBRK = (tIOC|122)
+TIOCSDTR = (tIOC|121)
+TIOCCDTR = (tIOC|120)
+TIOCSLTC = (tIOC|117)
+TIOCGLTC = (tIOC|116)
+TIOCOUTQ = (tIOC|115)
+TIOCSTOP = (tIOC|111)
+TIOCSTART = (tIOC|110)
+TIOCGSID = (tIOC|22)
+TIOCSSID = (tIOC|24)
+TIOCMSET = (tIOC|26)
+TIOCMBIS = (tIOC|27)
+TIOCMBIC = (tIOC|28)
+TIOCMGET = (tIOC|29)
+TIOCM_LE = 0001
+TIOCM_DTR = 0002
+TIOCM_RTS = 0004
+TIOCM_ST = 0010
+TIOCM_SR = 0020
+TIOCM_CTS = 0040
+TIOCM_CAR = 0100
+TIOCM_CD = TIOCM_CAR
+TIOCM_RNG = 0200
+TIOCM_RI = TIOCM_RNG
+TIOCM_DSR = 0400
+TIOCREMOTE = (tIOC|30)
+TIOCSIGNAL = (tIOC|31)
+ISPTM = ((ord('P')<<8)|1)
+UNLKPT = ((ord('P')<<8)|2)
+SVR4SOPEN = ((ord('P')<<8)|100)
+LDIOC = (ord('D')<<8)
+LDOPEN = (LDIOC|0)
+LDCLOSE = (LDIOC|1)
+LDCHG = (LDIOC|2)
+LDGETT = (LDIOC|8)
+LDSETT = (LDIOC|9)
+LDSMAP = (LDIOC|10)
+LDGMAP = (LDIOC|11)
+LDNMAP = (LDIOC|12)
+DIOC = (ord('d')<<8)
+DIOCGETP = (DIOC|8)
+DIOCSETP = (DIOC|9)
+FIORDCHK = ((ord('f')<<8)|3)
+CLNEXT = CTRL(ord('v'))
+CWERASE = CTRL(ord('w'))
+CFLUSHO = CTRL(ord('o'))
+CFLUSH = CFLUSHO
+CRPRNT = CTRL(ord('r'))
+CDSUSP = CTRL(ord('y'))
+__OLD_SSPEED = __OLD_B9600
+SSPEED = B9600
+TERM_NONE = 0
+TERM_TEC = 1
+TERM_V61 = 2
+TERM_V10 = 3
+TERM_TEX = 4
+TERM_D40 = 5
+TERM_H45 = 6
+TERM_D42 = 7
+TM_NONE = 0000
+TM_SNL = 0001
+TM_ANL = 0002
+TM_LCF = 0004
+TM_CECHO = 0010
+TM_CINVIS = 0020
+TM_SET = 0200
+LDISC0 = 0
+LDISC1 = 1
+NTTYDISC = LDISC1
+TIOCFLUSH = (TIOC|12)
+TCSETLABEL = (TIOC|31)
+TCDSET = (TIOC|32)
+TCBLKMD = (TIOC|33)
+TIOCPKT = (TIOC|112)
+TIOCPKT_DATA = 0x00
+TIOCPKT_FLUSHREAD = 0x01
+TIOCPKT_FLUSHWRITE = 0x02
+TIOCPKT_NOSTOP = 0x10
+TIOCPKT_DOSTOP = 0x20
+TIOCPKT_IOCTL = 0x40
+TIOCNOTTY = (TIOC|113)
+TIOCSTI = (TIOC|114)
+TFIOC = (ord('F')<<8)
+oFIONREAD = (TFIOC|127)
+TO_STOP = LOBLK
+IOCTYPE = 0xff00
+__NEW_TCGETS = (TIOC|213)
+__NEW_TCSETS = (TIOC|214)
+__NEW_TCSETSW = (TIOC|215)
+__NEW_TCSETSF = (TIOC|216)
+__OLD_TCGETS = (TIOC|13)
+__OLD_TCSETS = (TIOC|14)
+__OLD_TCSETSW = (TIOC|15)
+__OLD_TCSETSF = (TIOC|16)
+TCGETS = __NEW_TCGETS
+TCSETS = __NEW_TCSETS
+TCSETSW = __NEW_TCSETSW
+TCSETSF = __NEW_TCSETSF
+TCGETS = __OLD_TCGETS
+TCSETS = __OLD_TCSETS
+TCSETSW = __OLD_TCSETSW
+TCSETSF = __OLD_TCSETSF
+TCSANOW = ((ord('T')<<8)|14)
+TCSADRAIN = ((ord('T')<<8)|15)
+TCSAFLUSH = ((ord('T')<<8)|16)
+TCIFLUSH = 0
+TCOFLUSH = 1
+TCIOFLUSH = 2
+TCOOFF = 0
+TCOON = 1
+TCIOFF = 2
+TCION = 3
+tIOC = (ord('t')<<8)
+TIOCGETD = (tIOC|0)
+TIOCSETD = (tIOC|1)
+TIOCHPCL = (tIOC|2)
+TIOCGETP = (tIOC|8)
+TIOCSETP = (tIOC|9)
+TIOCSETN = (tIOC|10)
+TIOCEXCL = (tIOC|13)
+TIOCNXCL = (tIOC|14)
+TIOCSETC = (tIOC|17)
+TIOCGETC = (tIOC|18)
+TIOCLBIS = (tIOC|127)
+TIOCLBIC = (tIOC|126)
+TIOCLSET = (tIOC|125)
+TIOCLGET = (tIOC|124)
+TIOCSBRK = (tIOC|123)
+TIOCCBRK = (tIOC|122)
+TIOCSDTR = (tIOC|121)
+TIOCCDTR = (tIOC|120)
+TIOCSLTC = (tIOC|117)
+TIOCGLTC = (tIOC|116)
+TIOCOUTQ = (tIOC|115)
+TIOCSTOP = (tIOC|111)
+TIOCSTART = (tIOC|110)
+TIOCGSID = (tIOC|22)
+TIOCSSID = (tIOC|24)
+TIOCMSET = (tIOC|26)
+TIOCMBIS = (tIOC|27)
+TIOCMBIC = (tIOC|28)
+TIOCMGET = (tIOC|29)
+TIOCM_LE = 0001
+TIOCM_DTR = 0002
+TIOCM_RTS = 0004
+TIOCM_ST = 0010
+TIOCM_SR = 0020
+TIOCM_CTS = 0040
+TIOCM_CAR = 0100
+TIOCM_CD = TIOCM_CAR
+TIOCM_RNG = 0200
+TIOCM_RI = TIOCM_RNG
+TIOCM_DSR = 0400
+TIOCREMOTE = (tIOC|30)
+TIOCSIGNAL = (tIOC|31)
+ISPTM = ((ord('P')<<8)|1)
+UNLKPT = ((ord('P')<<8)|2)
+SVR4SOPEN = ((ord('P')<<8)|100)
+LDIOC = (ord('D')<<8)
+LDOPEN = (LDIOC|0)
+LDCLOSE = (LDIOC|1)
+LDCHG = (LDIOC|2)
+LDGETT = (LDIOC|8)
+LDSETT = (LDIOC|9)
+LDSMAP = (LDIOC|10)
+LDGMAP = (LDIOC|11)
+LDNMAP = (LDIOC|12)
+DIOC = (ord('d')<<8)
+DIOCGETP = (DIOC|8)
+DIOCSETP = (DIOC|9)
+FIORDCHK = ((ord('f')<<8)|3)
diff --git a/Lib/plat-irix6/WAIT.py b/Lib/plat-irix6/WAIT.py
new file mode 100644
index 0000000..741af3b
--- /dev/null
+++ b/Lib/plat-irix6/WAIT.py
@@ -0,0 +1,335 @@
+# Generated by h2py from /usr/include/sys/wait.h
+
+# Included from standards.h
+def _W_INT(i): return (i)
+
+WUNTRACED = 0004
+WNOHANG = 0100
+_WSTOPPED = 0177
+def WIFEXITED(stat): return ((_W_INT(stat)&0377)==0)
+
+def WEXITSTATUS(stat): return ((_W_INT(stat)>>8)&0377)
+
+def WTERMSIG(stat): return (_W_INT(stat)&0177)
+
+def WSTOPSIG(stat): return ((_W_INT(stat)>>8)&0377)
+
+WEXITED = 0001
+WTRAPPED = 0002
+WSTOPPED = 0004
+WCONTINUED = 0010
+WNOWAIT = 0200
+WOPTMASK = (WEXITED|WTRAPPED|WSTOPPED|WCONTINUED|WNOHANG|WNOWAIT)
+WSTOPFLG = 0177
+WCONTFLG = 0177777
+WCOREFLAG = 0200
+WSIGMASK = 0177
+def WWORD(stat): return (_W_INT(stat)&0177777)
+
+def WIFCONTINUED(stat): return (WWORD(stat)==WCONTFLG)
+
+def WCOREDUMP(stat): return (_W_INT(stat) & WCOREFLAG)
+
+
+# Included from sys/types.h
+
+# Included from sgidefs.h
+_MIPS_ISA_MIPS1 = 1
+_MIPS_ISA_MIPS2 = 2
+_MIPS_ISA_MIPS3 = 3
+_MIPS_ISA_MIPS4 = 4
+_MIPS_SIM_ABI32 = 1
+_MIPS_SIM_NABI32 = 2
+_MIPS_SIM_ABI64 = 3
+P_MYID = (-1)
+P_MYHOSTID = (-1)
+
+# Included from sys/bsd_types.h
+
+# Included from sys/mkdev.h
+ONBITSMAJOR = 7
+ONBITSMINOR = 8
+OMAXMAJ = 0x7f
+OMAXMIN = 0xff
+NBITSMAJOR = 14
+NBITSMINOR = 18
+MAXMAJ = 0x1ff
+MAXMIN = 0x3ffff
+OLDDEV = 0
+NEWDEV = 1
+MKDEV_VER = NEWDEV
+def major(dev): return __major(MKDEV_VER, dev)
+
+def minor(dev): return __minor(MKDEV_VER, dev)
+
+
+# Included from sys/select.h
+FD_SETSIZE = 1024
+__NBBY = 8
+
+# Included from string.h
+NULL = 0L
+NBBY = 8
+
+# Included from sys/procset.h
+P_INITPID = 1
+P_INITUID = 0
+P_INITPGID = 0
+
+# Included from sys/signal.h
+SIGHUP = 1
+SIGINT = 2
+SIGQUIT = 3
+SIGILL = 4
+SIGTRAP = 5
+SIGIOT = 6
+SIGABRT = 6
+SIGEMT = 7
+SIGFPE = 8
+SIGKILL = 9
+SIGBUS = 10
+SIGSEGV = 11
+SIGSYS = 12
+SIGPIPE = 13
+SIGALRM = 14
+SIGTERM = 15
+SIGUSR1 = 16
+SIGUSR2 = 17
+SIGCLD = 18
+SIGCHLD = 18
+SIGPWR = 19
+SIGWINCH = 20
+SIGURG = 21
+SIGPOLL = 22
+SIGIO = 22
+SIGSTOP = 23
+SIGTSTP = 24
+SIGCONT = 25
+SIGTTIN = 26
+SIGTTOU = 27
+SIGVTALRM = 28
+SIGPROF = 29
+SIGXCPU = 30
+SIGXFSZ = 31
+SIG32 = 32
+SIGCKPT = 33
+SIGRTMIN = 49
+SIGRTMAX = 64
+SIGPTINTR = 47
+SIGPTRESCHED = 48
+__sigargs = int
+SIGEV_NONE = 128
+SIGEV_SIGNAL = 129
+SIGEV_CALLBACK = 130
+
+# Included from sys/siginfo.h
+ILL_ILLOPC = 1
+ILL_ILLOPN = 2
+ILL_ILLADR = 3
+ILL_ILLTRP = 4
+ILL_PRVOPC = 5
+ILL_PRVREG = 6
+ILL_COPROC = 7
+ILL_BADSTK = 8
+NSIGILL = 8
+FPE_INTDIV = 1
+FPE_INTOVF = 2
+FPE_FLTDIV = 3
+FPE_FLTOVF = 4
+FPE_FLTUND = 5
+FPE_FLTRES = 6
+FPE_FLTINV = 7
+FPE_FLTSUB = 8
+NSIGFPE = 8
+SEGV_MAPERR = 1
+SEGV_ACCERR = 2
+NSIGSEGV = 2
+BUS_ADRALN = 1
+BUS_ADRERR = 2
+BUS_OBJERR = 3
+NSIGBUS = 3
+TRAP_BRKPT = 1
+TRAP_TRACE = 2
+NSIGTRAP = 2
+CLD_EXITED = 1
+CLD_KILLED = 2
+CLD_DUMPED = 3
+CLD_TRAPPED = 4
+CLD_STOPPED = 5
+CLD_CONTINUED = 6
+NSIGCLD = 6
+POLL_IN = 1
+POLL_OUT = 2
+POLL_MSG = 3
+POLL_ERR = 4
+POLL_PRI = 5
+POLL_HUP = 6
+NSIGPOLL = 6
+SI_MAXSZ = 128
+SI_USER = 0
+SI_KILL = SI_USER
+SI_QUEUE = -1
+SI_ASYNCIO = -2
+SI_TIMER = -3
+SI_MESGQ = -4
+SIG_NOP = 0
+SIG_BLOCK = 1
+SIG_UNBLOCK = 2
+SIG_SETMASK = 3
+SIG_SETMASK32 = 256
+SA_ONSTACK = 0x00000001
+SA_RESETHAND = 0x00000002
+SA_RESTART = 0x00000004
+SA_SIGINFO = 0x00000008
+SA_NODEFER = 0x00000010
+SA_NOCLDWAIT = 0x00010000
+SA_NOCLDSTOP = 0x00020000
+_SA_BSDCALL = 0x10000000
+MINSIGSTKSZ = 512
+SIGSTKSZ = 8192
+SS_ONSTACK = 0x00000001
+SS_DISABLE = 0x00000002
+
+# Included from sys/ucontext.h
+NGREG = 36
+NGREG = 37
+GETCONTEXT = 0
+SETCONTEXT = 1
+UC_SIGMASK = 001
+UC_STACK = 002
+UC_CPU = 004
+UC_MAU = 010
+UC_MCONTEXT = (UC_CPU|UC_MAU)
+UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
+CTX_R0 = 0
+CTX_AT = 1
+CTX_V0 = 2
+CTX_V1 = 3
+CTX_A0 = 4
+CTX_A1 = 5
+CTX_A2 = 6
+CTX_A3 = 7
+CTX_T0 = 8
+CTX_T1 = 9
+CTX_T2 = 10
+CTX_T3 = 11
+CTX_T4 = 12
+CTX_T5 = 13
+CTX_T6 = 14
+CTX_T7 = 15
+CTX_A4 = 8
+CTX_A5 = 9
+CTX_A6 = 10
+CTX_A7 = 11
+CTX_T0 = 12
+CTX_T1 = 13
+CTX_T2 = 14
+CTX_T3 = 15
+CTX_S0 = 16
+CTX_S1 = 17
+CTX_S2 = 18
+CTX_S3 = 19
+CTX_S4 = 20
+CTX_S5 = 21
+CTX_S6 = 22
+CTX_S7 = 23
+CTX_T8 = 24
+CTX_T9 = 25
+CTX_K0 = 26
+CTX_K1 = 27
+CTX_GP = 28
+CTX_SP = 29
+CTX_S8 = 30
+CTX_RA = 31
+CTX_MDLO = 32
+CTX_MDHI = 33
+CTX_CAUSE = 34
+CTX_EPC = 35
+CTX_SR = 36
+CXT_R0 = CTX_R0
+CXT_AT = CTX_AT
+CXT_V0 = CTX_V0
+CXT_V1 = CTX_V1
+CXT_A0 = CTX_A0
+CXT_A1 = CTX_A1
+CXT_A2 = CTX_A2
+CXT_A3 = CTX_A3
+CXT_T0 = CTX_T0
+CXT_T1 = CTX_T1
+CXT_T2 = CTX_T2
+CXT_T3 = CTX_T3
+CXT_T4 = CTX_T4
+CXT_T5 = CTX_T5
+CXT_T6 = CTX_T6
+CXT_T7 = CTX_T7
+CXT_S0 = CTX_S0
+CXT_S1 = CTX_S1
+CXT_S2 = CTX_S2
+CXT_S3 = CTX_S3
+CXT_S4 = CTX_S4
+CXT_S5 = CTX_S5
+CXT_S6 = CTX_S6
+CXT_S7 = CTX_S7
+CXT_T8 = CTX_T8
+CXT_T9 = CTX_T9
+CXT_K0 = CTX_K0
+CXT_K1 = CTX_K1
+CXT_GP = CTX_GP
+CXT_SP = CTX_SP
+CXT_S8 = CTX_S8
+CXT_RA = CTX_RA
+CXT_MDLO = CTX_MDLO
+CXT_MDHI = CTX_MDHI
+CXT_CAUSE = CTX_CAUSE
+CXT_EPC = CTX_EPC
+CXT_SR = CTX_SR
+SV_ONSTACK = 0x0001
+SV_INTERRUPT = 0x0002
+NUMBSDSIGS = (32)
+def sigmask(sig): return (1L << ((sig)-1))
+
+def sigmask(sig): return (1L << ((sig)-1))
+
+SIG_ERR = (-1)
+SIG_IGN = (1)
+SIG_HOLD = (2)
+SIG_DFL = (0)
+NSIG = 65
+MAXSIG = (NSIG-1)
+NUMSIGS = (NSIG-1)
+BRK_USERBP = 0
+BRK_KERNELBP = 1
+BRK_ABORT = 2
+BRK_BD_TAKEN = 3
+BRK_BD_NOTTAKEN = 4
+BRK_SSTEPBP = 5
+BRK_OVERFLOW = 6
+BRK_DIVZERO = 7
+BRK_RANGE = 8
+BRK_PSEUDO_OP_BIT = 0x80
+BRK_PSEUDO_OP_MAX = 0x3
+BRK_CACHE_SYNC = 0x80
+BRK_SWASH_FLUSH = 0x81
+BRK_SWASH_SWTCH = 0x82
+BRK_MULOVF = 1023
+
+# Included from sys/resource.h
+PRIO_MIN = -20
+PRIO_MAX = 20
+PRIO_PROCESS = 0
+PRIO_PGRP = 1
+PRIO_USER = 2
+RUSAGE_SELF = 0
+RUSAGE_CHILDREN = -1
+RLIMIT_CPU = 0
+RLIMIT_FSIZE = 1
+RLIMIT_DATA = 2
+RLIMIT_STACK = 3
+RLIMIT_CORE = 4
+RLIMIT_NOFILE = 5
+RLIMIT_VMEM = 6
+RLIMIT_RSS = 7
+RLIMIT_AS = RLIMIT_VMEM
+RLIM_NLIMITS = 8
+RLIM32_INFINITY = 0x7fffffff
+RLIM_INFINITY = 0x7fffffff
diff --git a/Lib/plat-irix6/cddb.py b/Lib/plat-irix6/cddb.py
new file mode 100644
index 0000000..57cf3c6
--- /dev/null
+++ b/Lib/plat-irix6/cddb.py
@@ -0,0 +1,208 @@
+# This file implements a class which forms an interface to the .cddb
+# directory that is maintained by SGI's cdman program.
+#
+# Usage is as follows:
+#
+# import readcd
+# r = readcd.Readcd()
+# c = Cddb(r.gettrackinfo())
+#
+# Now you can use c.artist, c.title and c.track[trackno] (where trackno
+# starts at 1). When the CD is not recognized, all values will be the empty
+# string.
+# It is also possible to set the above mentioned variables to new values.
+# You can then use c.write() to write out the changed values to the
+# .cdplayerrc file.
+
+import string, posix, os
+
+_cddbrc = '.cddb'
+_DB_ID_NTRACKS = 5
+_dbid_map = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@_=+abcdefghijklmnopqrstuvwxyz'
+def _dbid(v):
+ if v >= len(_dbid_map):
+ return string.zfill(v, 2)
+ else:
+ return _dbid_map[v]
+
+def tochash(toc):
+ if type(toc) == type(''):
+ tracklist = []
+ for i in range(2, len(toc), 4):
+ tracklist.append((None,
+ (string.atoi(toc[i:i+2]),
+ string.atoi(toc[i+2:i+4]))))
+ else:
+ tracklist = toc
+ ntracks = len(tracklist)
+ hash = _dbid((ntracks >> 4) & 0xF) + _dbid(ntracks & 0xF)
+ if ntracks <= _DB_ID_NTRACKS:
+ nidtracks = ntracks
+ else:
+ nidtracks = _DB_ID_NTRACKS - 1
+ min = 0
+ sec = 0
+ for track in tracklist:
+ start, length = track
+ min = min + length[0]
+ sec = sec + length[1]
+ min = min + sec / 60
+ sec = sec % 60
+ hash = hash + _dbid(min) + _dbid(sec)
+ for i in range(nidtracks):
+ start, length = tracklist[i]
+ hash = hash + _dbid(length[0]) + _dbid(length[1])
+ return hash
+
+class Cddb:
+ def __init__(self, tracklist):
+ if os.environ.has_key('CDDB_PATH'):
+ path = os.environ['CDDB_PATH']
+ cddb_path = string.splitfields(path, ',')
+ else:
+ home = os.environ['HOME']
+ cddb_path = [home + '/' + _cddbrc]
+
+ self._get_id(tracklist)
+
+ for dir in cddb_path:
+ file = dir + '/' + self.id + '.rdb'
+ try:
+ f = open(file, 'r')
+ self.file = file
+ break
+ except IOError:
+ pass
+ ntracks = string.atoi(self.id[:2], 16)
+ self.artist = ''
+ self.title = ''
+ self.track = [None] + [''] * ntracks
+ self.trackartist = [None] + [''] * ntracks
+ self.notes = []
+ if not hasattr(self, 'file'):
+ return
+ import regex
+ reg = regex.compile('^\\([^.]*\\)\\.\\([^:]*\\):[\t ]+\\(.*\\)')
+ while 1:
+ line = f.readline()
+ if not line:
+ break
+ if reg.match(line) == -1:
+ print 'syntax error in ' + file
+ continue
+ name1 = line[reg.regs[1][0]:reg.regs[1][1]]
+ name2 = line[reg.regs[2][0]:reg.regs[2][1]]
+ value = line[reg.regs[3][0]:reg.regs[3][1]]
+ if name1 == 'album':
+ if name2 == 'artist':
+ self.artist = value
+ elif name2 == 'title':
+ self.title = value
+ elif name2 == 'toc':
+ if not self.toc:
+ self.toc = value
+ if self.toc != value:
+ print 'toc\'s don\'t match'
+ elif name2 == 'notes':
+ self.notes.append(value)
+ elif name1[:5] == 'track':
+ try:
+ trackno = string.atoi(name1[5:])
+ except strings.atoi_error:
+ print 'syntax error in ' + file
+ continue
+ if trackno > ntracks:
+ print 'track number ' + `trackno` + \
+ ' in file ' + file + \
+ ' out of range'
+ continue
+ if name2 == 'title':
+ self.track[trackno] = value
+ elif name2 == 'artist':
+ self.trackartist[trackno] = value
+ f.close()
+ for i in range(2, len(self.track)):
+ track = self.track[i]
+ # if track title starts with `,', use initial part
+ # of previous track's title
+ if track and track[0] == ',':
+ try:
+ off = string.index(self.track[i - 1],
+ ',')
+ except string.index_error:
+ pass
+ else:
+ self.track[i] = self.track[i-1][:off] \
+ + track
+
+ def _get_id(self, tracklist):
+ # fill in self.id and self.toc.
+ # if the argument is a string ending in .rdb, the part
+ # upto the suffix is taken as the id.
+ if type(tracklist) == type(''):
+ if tracklist[-4:] == '.rdb':
+ self.id = tracklist[:-4]
+ self.toc = ''
+ return
+ t = []
+ for i in range(2, len(tracklist), 4):
+ t.append((None, \
+ (string.atoi(tracklist[i:i+2]), \
+ string.atoi(tracklist[i+2:i+4]))))
+ tracklist = t
+ ntracks = len(tracklist)
+ self.id = _dbid((ntracks >> 4) & 0xF) + _dbid(ntracks & 0xF)
+ if ntracks <= _DB_ID_NTRACKS:
+ nidtracks = ntracks
+ else:
+ nidtracks = _DB_ID_NTRACKS - 1
+ min = 0
+ sec = 0
+ for track in tracklist:
+ start, length = track
+ min = min + length[0]
+ sec = sec + length[1]
+ min = min + sec / 60
+ sec = sec % 60
+ self.id = self.id + _dbid(min) + _dbid(sec)
+ for i in range(nidtracks):
+ start, length = tracklist[i]
+ self.id = self.id + _dbid(length[0]) + _dbid(length[1])
+ self.toc = string.zfill(ntracks, 2)
+ for track in tracklist:
+ start, length = track
+ self.toc = self.toc + string.zfill(length[0], 2) + \
+ string.zfill(length[1], 2)
+
+ def write(self):
+ import posixpath
+ if os.environ.has_key('CDDB_WRITE_DIR'):
+ dir = os.environ['CDDB_WRITE_DIR']
+ else:
+ dir = os.environ['HOME'] + '/' + _cddbrc
+ file = dir + '/' + self.id + '.rdb'
+ if posixpath.exists(file):
+ # make backup copy
+ posix.rename(file, file + '~')
+ f = open(file, 'w')
+ f.write('album.title:\t' + self.title + '\n')
+ f.write('album.artist:\t' + self.artist + '\n')
+ f.write('album.toc:\t' + self.toc + '\n')
+ for note in self.notes:
+ f.write('album.notes:\t' + note + '\n')
+ prevpref = None
+ for i in range(1, len(self.track)):
+ if self.trackartist[i]:
+ f.write('track'+`i`+'.artist:\t'+self.trackartist[i]+'\n')
+ track = self.track[i]
+ try:
+ off = string.index(track, ',')
+ except string.index_error:
+ prevpref = None
+ else:
+ if prevpref and track[:off] == prevpref:
+ track = track[off:]
+ else:
+ prevpref = track[:off]
+ f.write('track' + `i` + '.title:\t' + track + '\n')
+ f.close()
diff --git a/Lib/plat-irix6/cdplayer.py b/Lib/plat-irix6/cdplayer.py
new file mode 100644
index 0000000..5c2c95a
--- /dev/null
+++ b/Lib/plat-irix6/cdplayer.py
@@ -0,0 +1,89 @@
+# This file implements a class which forms an interface to the .cdplayerrc
+# file that is maintained by SGI's cdplayer program.
+#
+# Usage is as follows:
+#
+# import readcd
+# r = readcd.Readcd()
+# c = Cdplayer(r.gettrackinfo())
+#
+# Now you can use c.artist, c.title and c.track[trackno] (where trackno
+# starts at 1). When the CD is not recognized, all values will be the empty
+# string.
+# It is also possible to set the above mentioned variables to new values.
+# You can then use c.write() to write out the changed values to the
+# .cdplayerrc file.
+
+cdplayerrc = '.cdplayerrc'
+
+class Cdplayer:
+ def __init__(self, tracklist):
+ import string
+ self.artist = ''
+ self.title = ''
+ if type(tracklist) == type(''):
+ t = []
+ for i in range(2, len(tracklist), 4):
+ t.append((None, \
+ (string.atoi(tracklist[i:i+2]), \
+ string.atoi(tracklist[i+2:i+4]))))
+ tracklist = t
+ self.track = [None] + [''] * len(tracklist)
+ self.id = 'd' + string.zfill(len(tracklist), 2)
+ for track in tracklist:
+ start, length = track
+ self.id = self.id + string.zfill(length[0], 2) + \
+ string.zfill(length[1], 2)
+ try:
+ import posix
+ f = open(posix.environ['HOME'] + '/' + cdplayerrc, 'r')
+ except IOError:
+ return
+ import regex
+ reg = regex.compile('^\\([^:]*\\):\t\\(.*\\)')
+ s = self.id + '.'
+ l = len(s)
+ while 1:
+ line = f.readline()
+ if line == '':
+ break
+ if line[:l] == s:
+ line = line[l:]
+ if reg.match(line) == -1:
+ print 'syntax error in ~/' + cdplayerrc
+ continue
+ name = line[reg.regs[1][0]:reg.regs[1][1]]
+ value = line[reg.regs[2][0]:reg.regs[2][1]]
+ if name == 'title':
+ self.title = value
+ elif name == 'artist':
+ self.artist = value
+ elif name[:5] == 'track':
+ trackno = string.atoi(name[6:])
+ self.track[trackno] = value
+ f.close()
+
+ def write(self):
+ import posix
+ filename = posix.environ['HOME'] + '/' + cdplayerrc
+ try:
+ old = open(filename, 'r')
+ except IOError:
+ old = open('/dev/null', 'r')
+ new = open(filename + '.new', 'w')
+ s = self.id + '.'
+ l = len(s)
+ while 1:
+ line = old.readline()
+ if line == '':
+ break
+ if line[:l] <> s:
+ new.write(line)
+ new.write(self.id + '.title:\t' + self.title + '\n')
+ new.write(self.id + '.artist:\t' + self.artist + '\n')
+ for i in range(1, len(self.track)):
+ new.write(self.id + '.track.' + `i` + ':\t' + \
+ self.track[i] + '\n')
+ old.close()
+ new.close()
+ posix.rename(filename + '.new', filename)
diff --git a/Lib/plat-irix6/flp.doc b/Lib/plat-irix6/flp.doc
new file mode 100644
index 0000000..1a2f374
--- /dev/null
+++ b/Lib/plat-irix6/flp.doc
@@ -0,0 +1,117 @@
+.SH
+Module flp
+.LP
+The flp module loads fl-forms from fd files, as generated
+by fdesign. The module is designed to be flexible enough to allow
+almost anything to be done with the loaded form.
+.LP
+Loadform defines
+two types of functions: functions to parse fd files and functions to
+create the forms from the templates returned by the parse functions.
+There are fairly low-level create functions that create single objects,
+and convenience routines that create complete forms, including callbacks,
+etc.
+.LP
+The exception flp.error is raised whenever an error occurs while parsing a forms
+definition file or creating a form.
+.SH 2
+Parsing functions
+.LP
+There are two parsing functions, parse_form() and parse_forms(). They
+take the following form:
+.LP
+.ft C
+ftuple = parse_form(filename, formname)
+.br
+ftdict = parse_forms(filename)
+.IP
+Parse_form parses a single form, and returns a tuple (ftmp, otmplist).
+Ftmp is a template for a form, otmplist is a list of templates for
+objects. See below for a description of these templates.
+.IP
+Parse_forms parses all forms in an fd file. It returns a dictionary of
+(ftmp, otmplist) tuples, indexed by formname.
+.IP
+Filename is the name of the forms definition file to inspect. The functions
+appends '.fd' if needed, and use 'sys.path' to locate the file.
+.IP
+formname is the name of the form to load. This argument is mandatory,
+even if the file only contains one form.
+.LP
+The form template and object template are structures that contain all
+the information read from the fd file, in 'natural' form. A form
+template record contains the following fields:
+.IP
+.nf
+"Name", the name of the form;
+"Width", the width of the form;
+"Height", the height of the form; and
+"Numberofobjects", the number of objects in the form.
+.LP
+An object template contains the following fields:
+.IP
+.nf
+"Class", the class of object (eg. FL.BUTTON);
+"Type", the sub-class (eg. FL.NORMALBUTTON);
+"Box", a list with four members: [x, y, width, height];
+"Boxtype", the type of box (eg. FL.DOWNBOX);
+"Colors", a list with the two object colors;
+"Alignment", the label alignment (eg. FL.ALIGNLEFT);
+"Style", the label style (eg. FL.BOLDSTYLE);
+"Lcol", the label color;
+"Label", a string containing the label;
+"Name", a string containing the name of the object;
+"Callback", a string containing the callback routine name; and
+"Argument", a string containing the callback routine extra argument.
+.SH
+Low-level create routines.
+.LP
+The three low-level creation routines are called as follows:
+.LP
+.ft C
+form = create_form(form_template)
+.IP
+Create an fl form from a form template. Returns the form created.
+.LP
+.ft C
+obj = create_object(form, obj_template)
+.IP
+Create an object in an fl form. Return the new object.
+An error is raised if the object has a callback routine.
+.SH
+High-level create routines.
+.LP
+The 'standard' way to handle forms in python is to define a class
+that contains the form and all the objects (insofar as they are named),
+and that defines all the callback functions, and use an instance of
+this class to handle the form interaction.
+Flp contains three routines that simplify handling this paradigm:
+.LP
+.ft C
+create_full_form(instance, ftuple)
+.IP
+This routine takes an instance of your form-handling class and an
+ftuple (as returned by the parsing routines) as parameters. It inserts
+the form into the instance, defines all object names and arranges that
+the callback methods are called. All the names inserted into the
+instance are the same as the names used for the objects, etc. in the
+fd file.
+.LP
+.ft C
+merge_full_form(instance, form, ftuple)
+.IP
+This function does the same as create_full_form, only it does not create
+the form itself nor the 'background box' that fdesign automatically
+adds to each form. This is useful if your class inherits a superclass
+that already defines a skeleton form (with 'OK' and 'Cancel' buttons,
+for instance), and you want to merge the new form into that existing
+form. The 'form' parameter is the form to which the new objects are
+added.
+.LP
+If you use the paradigm sketched here but need slightly more control
+over object creation there is a routine that creates a single object
+and inserts its name (and arranges for the callback routine to be
+called):
+.LP
+.ft C
+create_object_instance(instance, form, obj_template)
diff --git a/Lib/plat-irix6/flp.py b/Lib/plat-irix6/flp.py
new file mode 100644
index 0000000..14e2278
--- /dev/null
+++ b/Lib/plat-irix6/flp.py
@@ -0,0 +1,455 @@
+#
+# flp - Module to load fl forms from fd files
+#
+# Jack Jansen, December 1991
+#
+import string
+import os
+import sys
+import FL
+
+SPLITLINE = '--------------------'
+FORMLINE = '=============== FORM ==============='
+ENDLINE = '=============================='
+
+error = 'flp.error'
+
+##################################################################
+# Part 1 - The parsing routines #
+##################################################################
+
+#
+# Externally visible function. Load form.
+#
+def parse_form(filename, formname):
+ forms = checkcache(filename)
+ if forms is None:
+ forms = parse_forms(filename)
+ if forms.has_key(formname):
+ return forms[formname]
+ else:
+ raise error, 'No such form in fd file'
+
+#
+# Externally visible function. Load all forms.
+#
+def parse_forms(filename):
+ forms = checkcache(filename)
+ if forms != None: return forms
+ fp = _open_formfile(filename)
+ nforms = _parse_fd_header(fp)
+ forms = {}
+ for i in range(nforms):
+ form = _parse_fd_form(fp, None)
+ forms[form[0].Name] = form
+ writecache(filename, forms)
+ return forms
+
+#
+# Internal: see if a cached version of the file exists
+#
+MAGIC = '.fdc'
+_internal_cache = {} # Used by frozen scripts only
+def checkcache(filename):
+ if _internal_cache.has_key(filename):
+ altforms = _internal_cache[filename]
+ return _unpack_cache(altforms)
+ import marshal
+ fp, filename = _open_formfile2(filename)
+ fp.close()
+ cachename = filename + 'c'
+ try:
+ fp = open(cachename, 'r')
+ except IOError:
+ #print 'flp: no cache file', cachename
+ return None
+ try:
+ if fp.read(4) != MAGIC:
+ print 'flp: bad magic word in cache file', cachename
+ return None
+ cache_mtime = rdlong(fp)
+ file_mtime = getmtime(filename)
+ if cache_mtime != file_mtime:
+ #print 'flp: outdated cache file', cachename
+ return None
+ #print 'flp: valid cache file', cachename
+ altforms = marshal.load(fp)
+ return _unpack_cache(altforms)
+ finally:
+ fp.close()
+
+def _unpack_cache(altforms):
+ forms = {}
+ for name in altforms.keys():
+ altobj, altlist = altforms[name]
+ obj = _newobj()
+ obj.make(altobj)
+ list = []
+ for altobj in altlist:
+ nobj = _newobj()
+ nobj.make(altobj)
+ list.append(nobj)
+ forms[name] = obj, list
+ return forms
+
+def rdlong(fp):
+ s = fp.read(4)
+ if len(s) != 4: return None
+ a, b, c, d = s[0], s[1], s[2], s[3]
+ return ord(a)<<24 | ord(b)<<16 | ord(c)<<8 | ord(d)
+
+def wrlong(fp, x):
+ a, b, c, d = (x>>24)&0xff, (x>>16)&0xff, (x>>8)&0xff, x&0xff
+ fp.write(chr(a) + chr(b) + chr(c) + chr(d))
+
+def getmtime(filename):
+ import os
+ from stat import ST_MTIME
+ try:
+ return os.stat(filename)[ST_MTIME]
+ except os.error:
+ return None
+
+#
+# Internal: write cached version of the form (parsing is too slow!)
+#
+def writecache(filename, forms):
+ import marshal
+ fp, filename = _open_formfile2(filename)
+ fp.close()
+ cachename = filename + 'c'
+ try:
+ fp = open(cachename, 'w')
+ except IOError:
+ print 'flp: can\'t create cache file', cachename
+ return # Never mind
+ fp.write('\0\0\0\0') # Seek back and write MAGIC when done
+ wrlong(fp, getmtime(filename))
+ altforms = _pack_cache(forms)
+ marshal.dump(altforms, fp)
+ fp.seek(0)
+ fp.write(MAGIC)
+ fp.close()
+ #print 'flp: wrote cache file', cachename
+
+#
+# External: print some statements that set up the internal cache.
+# This is for use with the "freeze" script. You should call
+# flp.freeze(filename) for all forms used by the script, and collect
+# the output on a file in a module file named "frozenforms.py". Then
+# in the main program of the script import frozenforms.
+# (Don't forget to take this out when using the unfrozen version of
+# the script!)
+#
+def freeze(filename):
+ forms = parse_forms(filename)
+ altforms = _pack_cache(forms)
+ print 'import flp'
+ print 'flp._internal_cache[', `filename`, '] =', altforms
+
+#
+# Internal: create the data structure to be placed in the cache
+#
+def _pack_cache(forms):
+ altforms = {}
+ for name in forms.keys():
+ obj, list = forms[name]
+ altobj = obj.__dict__
+ altlist = []
+ for obj in list: altlist.append(obj.__dict__)
+ altforms[name] = altobj, altlist
+ return altforms
+
+#
+# Internal: Locate form file (using PYTHONPATH) and open file
+#
+def _open_formfile(filename):
+ return _open_formfile2(filename)[0]
+
+def _open_formfile2(filename):
+ if filename[-3:] <> '.fd':
+ filename = filename + '.fd'
+ if filename[0] == '/':
+ try:
+ fp = open(filename,'r')
+ except IOError:
+ fp = None
+ else:
+ for pc in sys.path:
+ pn = os.path.join(pc, filename)
+ try:
+ fp = open(pn, 'r')
+ filename = pn
+ break
+ except IOError:
+ fp = None
+ if fp == None:
+ raise error, 'Cannot find forms file ' + filename
+ return fp, filename
+
+#
+# Internal: parse the fd file header, return number of forms
+#
+def _parse_fd_header(file):
+ # First read the magic header line
+ datum = _parse_1_line(file)
+ if datum <> ('Magic', 12321):
+ raise error, 'Not a forms definition file'
+ # Now skip until we know number of forms
+ while 1:
+ datum = _parse_1_line(file)
+ if type(datum) == type(()) and datum[0] == 'Numberofforms':
+ break
+ return datum[1]
+#
+# Internal: parse fd form, or skip if name doesn't match.
+# the special value None means 'allways parse it'.
+#
+def _parse_fd_form(file, name):
+ datum = _parse_1_line(file)
+ if datum <> FORMLINE:
+ raise error, 'Missing === FORM === line'
+ form = _parse_object(file)
+ if form.Name == name or name == None:
+ objs = []
+ for j in range(form.Numberofobjects):
+ obj = _parse_object(file)
+ objs.append(obj)
+ return (form, objs)
+ else:
+ for j in range(form.Numberofobjects):
+ _skip_object(file)
+ return None
+
+#
+# Internal class: a convient place to store object info fields
+#
+class _newobj:
+ def add(self, name, value):
+ self.__dict__[name] = value
+ def make(self, dict):
+ for name in dict.keys():
+ self.add(name, dict[name])
+
+#
+# Internal parsing routines.
+#
+def _parse_string(str):
+ if '\\' in str:
+ s = '\'' + str + '\''
+ try:
+ return eval(s)
+ except:
+ pass
+ return str
+
+def _parse_num(str):
+ return eval(str)
+
+def _parse_numlist(str):
+ slist = string.split(str)
+ nlist = []
+ for i in slist:
+ nlist.append(_parse_num(i))
+ return nlist
+
+# This dictionary maps item names to parsing routines.
+# If no routine is given '_parse_num' is default.
+_parse_func = { \
+ 'Name': _parse_string, \
+ 'Box': _parse_numlist, \
+ 'Colors': _parse_numlist, \
+ 'Label': _parse_string, \
+ 'Name': _parse_string, \
+ 'Callback': _parse_string, \
+ 'Argument': _parse_string }
+
+# This function parses a line, and returns either
+# a string or a tuple (name,value)
+
+import regex
+prog = regex.compile('^\([^:]*\): *\(.*\)')
+
+def _parse_line(line):
+ if prog.match(line) < 0:
+ return line
+ a = prog.regs
+ name = line[:a[1][1]]
+ if name[0] == 'N':
+ name = string.joinfields(string.split(name),'')
+ name = string.lower(name)
+ name = string.upper(name[0]) + name[1:]
+ value = line[a[2][0]:]
+ try:
+ pf = _parse_func[name]
+ except KeyError:
+ pf = _parse_num
+ value = pf(value)
+ return (name, value)
+
+def _readline(file):
+ line = file.readline()
+ if not line:
+ raise EOFError
+ return line[:-1]
+
+def _parse_1_line(file):
+ line = _readline(file)
+ while line == '':
+ line = _readline(file)
+ return _parse_line(line)
+
+def _skip_object(file):
+ line = ''
+ while not line in (SPLITLINE, FORMLINE, ENDLINE):
+ pos = file.tell()
+ line = _readline(file)
+ if line == FORMLINE:
+ file.seek(pos)
+
+def _parse_object(file):
+ obj = _newobj()
+ while 1:
+ pos = file.tell()
+ datum = _parse_1_line(file)
+ if datum in (SPLITLINE, FORMLINE, ENDLINE):
+ if datum == FORMLINE:
+ file.seek(pos)
+ return obj
+ if type(datum) <> type(()) or len(datum) <> 2:
+ raise error, 'Parse error, illegal line in object: '+datum
+ obj.add(datum[0], datum[1])
+
+#################################################################
+# Part 2 - High-level object/form creation routines #
+#################################################################
+
+#
+# External - Create a form an link to an instance variable.
+#
+def create_full_form(inst, (fdata, odatalist)):
+ form = create_form(fdata)
+ exec 'inst.'+fdata.Name+' = form\n'
+ for odata in odatalist:
+ create_object_instance(inst, form, odata)
+
+#
+# External - Merge a form into an existing form in an instance
+# variable.
+#
+def merge_full_form(inst, form, (fdata, odatalist)):
+ exec 'inst.'+fdata.Name+' = form\n'
+ if odatalist[0].Class <> FL.BOX:
+ raise error, 'merge_full_form() expects FL.BOX as first obj'
+ for odata in odatalist[1:]:
+ create_object_instance(inst, form, odata)
+
+
+#################################################################
+# Part 3 - Low-level object/form creation routines #
+#################################################################
+
+#
+# External Create_form - Create form from parameters
+#
+def create_form(fdata):
+ import fl
+ return fl.make_form(FL.NO_BOX, fdata.Width, fdata.Height)
+
+#
+# External create_object - Create an object. Make sure there are
+# no callbacks. Returns the object created.
+#
+def create_object(form, odata):
+ obj = _create_object(form, odata)
+ if odata.Callback:
+ raise error, 'Creating free object with callback'
+ return obj
+#
+# External create_object_instance - Create object in an instance.
+#
+def create_object_instance(inst, form, odata):
+ obj = _create_object(form, odata)
+ if odata.Callback:
+ cbfunc = eval('inst.'+odata.Callback)
+ obj.set_call_back(cbfunc, odata.Argument)
+ if odata.Name:
+ exec 'inst.' + odata.Name + ' = obj\n'
+#
+# Internal _create_object: Create the object and fill options
+#
+def _create_object(form, odata):
+ crfunc = _select_crfunc(form, odata.Class)
+ obj = crfunc(odata.Type, odata.Box[0], odata.Box[1], odata.Box[2], \
+ odata.Box[3], odata.Label)
+ if not odata.Class in (FL.BEGIN_GROUP, FL.END_GROUP):
+ obj.boxtype = odata.Boxtype
+ obj.col1 = odata.Colors[0]
+ obj.col2 = odata.Colors[1]
+ obj.align = odata.Alignment
+ obj.lstyle = odata.Style
+ obj.lsize = odata.Size
+ obj.lcol = odata.Lcol
+ return obj
+#
+# Internal crfunc: helper function that returns correct create function
+#
+def _select_crfunc(fm, cl):
+ if cl == FL.BEGIN_GROUP: return fm.bgn_group
+ elif cl == FL.END_GROUP: return fm.end_group
+ elif cl == FL.BITMAP: return fm.add_bitmap
+ elif cl == FL.BOX: return fm.add_box
+ elif cl == FL.BROWSER: return fm.add_browser
+ elif cl == FL.BUTTON: return fm.add_button
+ elif cl == FL.CHART: return fm.add_chart
+ elif cl == FL.CHOICE: return fm.add_choice
+ elif cl == FL.CLOCK: return fm.add_clock
+ elif cl == FL.COUNTER: return fm.add_counter
+ elif cl == FL.DIAL: return fm.add_dial
+ elif cl == FL.FREE: return fm.add_free
+ elif cl == FL.INPUT: return fm.add_input
+ elif cl == FL.LIGHTBUTTON: return fm.add_lightbutton
+ elif cl == FL.MENU: return fm.add_menu
+ elif cl == FL.POSITIONER: return fm.add_positioner
+ elif cl == FL.ROUNDBUTTON: return fm.add_roundbutton
+ elif cl == FL.SLIDER: return fm.add_slider
+ elif cl == FL.VALSLIDER: return fm.add_valslider
+ elif cl == FL.TEXT: return fm.add_text
+ elif cl == FL.TIMER: return fm.add_timer
+ else:
+ raise error, 'Unknown object type: ' + `cl`
+
+
+def test():
+ import time
+ t0 = time.time()
+ if len(sys.argv) == 2:
+ forms = parse_forms(sys.argv[1])
+ t1 = time.time()
+ print 'parse time:', 0.001*(t1-t0), 'sec.'
+ keys = forms.keys()
+ keys.sort()
+ for i in keys:
+ _printform(forms[i])
+ elif len(sys.argv) == 3:
+ form = parse_form(sys.argv[1], sys.argv[2])
+ t1 = time.time()
+ print 'parse time:', round(t1-t0, 3), 'sec.'
+ _printform(form)
+ else:
+ print 'Usage: test fdfile [form]'
+
+def _printform(form):
+ f = form[0]
+ objs = form[1]
+ print 'Form ', f.Name, ', size: ', f.Width, f.Height, ' Nobj ', f.Numberofobjects
+ for i in objs:
+ print ' Obj ', i.Name, ' type ', i.Class, i.Type
+ print ' Box ', i.Box, ' btype ', i.Boxtype
+ print ' Label ', i.Label, ' size/style/col/align ', i.Size,i.Style, i.Lcol, i.Alignment
+ print ' cols ', i.Colors
+ print ' cback ', i.Callback, i.Argument
+
+# Local variables:
+# py-indent-offset: 4
+# end:
diff --git a/Lib/plat-irix6/jpeg.py b/Lib/plat-irix6/jpeg.py
new file mode 100644
index 0000000..85d6d83
--- /dev/null
+++ b/Lib/plat-irix6/jpeg.py
@@ -0,0 +1,110 @@
+# Implement 'jpeg' interface using SGI's compression library
+
+# XXX Options 'smooth' and 'optimize' are ignored.
+
+# XXX It appears that compressing grayscale images doesn't work right;
+# XXX the resulting file causes weirdness.
+
+error = 'jpeg.error' # Exception
+
+options = {'quality': 75, 'optimize': 0, 'smooth': 0, 'forcegray': 0}
+
+comp = None
+decomp = None
+
+def compress(imgdata, width, height, bytesperpixel):
+ global comp
+ import cl, CL
+ if comp is None: comp = cl.OpenCompressor(CL.JPEG)
+ if bytesperpixel == 1:
+ format = CL.GRAYSCALE
+ elif bytesperpixel == 4:
+ format = CL.RGBX
+ if options['forcegray']:
+ iformat = CL.GRAYSCALE
+ else:
+ iformat = CL.YUV
+ # XXX How to support 'optimize'?
+ params = [CL.IMAGE_WIDTH, width, CL.IMAGE_HEIGHT, height, \
+ CL.ORIGINAL_FORMAT, format, \
+ CL.ORIENTATION, CL.BOTTOM_UP, \
+ CL.QUALITY_FACTOR, options['quality'], \
+ CL.INTERNAL_FORMAT, iformat, \
+ ]
+ comp.SetParams(params)
+ jpegdata = comp.Compress(1, imgdata)
+ return jpegdata
+
+def decompress(jpegdata):
+ global decomp
+ import cl, CL
+ if decomp is None: decomp = cl.OpenDecompressor(CL.JPEG)
+ headersize = decomp.ReadHeader(jpegdata)
+ params = [CL.IMAGE_WIDTH, 0, CL.IMAGE_HEIGHT, 0, CL.INTERNAL_FORMAT, 0]
+ decomp.GetParams(params)
+ width, height, format = params[1], params[3], params[5]
+ if format == CL.GRAYSCALE or options['forcegray']:
+ format = CL.GRAYSCALE
+ bytesperpixel = 1
+ else:
+ format = CL.RGBX
+ bytesperpixel = 4
+ # XXX How to support 'smooth'?
+ params = [CL.ORIGINAL_FORMAT, format, \
+ CL.ORIENTATION, CL.BOTTOM_UP, \
+ CL.FRAME_BUFFER_SIZE, width*height*bytesperpixel]
+ decomp.SetParams(params)
+ imgdata = decomp.Decompress(1, jpegdata)
+ return imgdata, width, height, bytesperpixel
+
+def setoption(name, value):
+ if type(value) <> type(0):
+ raise TypeError, 'jpeg.setoption: numeric options only'
+ if name == 'forcegrey':
+ name = 'forcegray'
+ if not options.has_key(name):
+ raise KeyError, 'jpeg.setoption: unknown option name'
+ options[name] = int(value)
+
+def test():
+ import sys
+ if sys.argv[1:2] == ['-g']:
+ del sys.argv[1]
+ setoption('forcegray', 1)
+ if not sys.argv[1:]:
+ sys.argv.append('/usr/local/images/data/jpg/asterix.jpg')
+ for file in sys.argv[1:]:
+ show(file)
+
+def show(file):
+ import gl, GL, DEVICE
+ jpegdata = open(file, 'r').read()
+ imgdata, width, height, bytesperpixel = decompress(jpegdata)
+ gl.foreground()
+ gl.prefsize(width, height)
+ win = gl.winopen(file)
+ if bytesperpixel == 1:
+ gl.cmode()
+ gl.pixmode(GL.PM_SIZE, 8)
+ gl.gconfig()
+ for i in range(256):
+ gl.mapcolor(i, i, i, i)
+ else:
+ gl.RGBmode()
+ gl.pixmode(GL.PM_SIZE, 32)
+ gl.gconfig()
+ gl.qdevice(DEVICE.REDRAW)
+ gl.qdevice(DEVICE.ESCKEY)
+ gl.qdevice(DEVICE.WINQUIT)
+ gl.qdevice(DEVICE.WINSHUT)
+ gl.lrectwrite(0, 0, width-1, height-1, imgdata)
+ while 1:
+ dev, val = gl.qread()
+ if dev in (DEVICE.ESCKEY, DEVICE.WINSHUT, DEVICE.WINQUIT):
+ break
+ if dev == DEVICE.REDRAW:
+ gl.lrectwrite(0, 0, width-1, height-1, imgdata)
+ gl.winclose(win)
+ # Now test the compression and write the result to a fixed filename
+ newjpegdata = compress(imgdata, width, height, bytesperpixel)
+ open('/tmp/j.jpg', 'w').write(newjpegdata)
diff --git a/Lib/plat-irix6/panel.py b/Lib/plat-irix6/panel.py
new file mode 100644
index 0000000..2c0365c
--- /dev/null
+++ b/Lib/plat-irix6/panel.py
@@ -0,0 +1,281 @@
+# Module 'panel'
+#
+# Support for the Panel library.
+# Uses built-in module 'pnl'.
+# Applciations should use 'panel.function' instead of 'pnl.function';
+# most 'pnl' functions are transparently exported by 'panel',
+# but dopanel() is overridden and you have to use this version
+# if you want to use callbacks.
+
+
+import pnl
+
+
+debug = 0
+
+
+# Test if an object is a list.
+#
+def is_list(x):
+ return type(x) == type([])
+
+
+# Reverse a list.
+#
+def reverse(list):
+ res = []
+ for item in list:
+ res.insert(0, item)
+ return res
+
+
+# Get an attribute of a list, which may itself be another list.
+# Don't use 'prop' for name.
+#
+def getattrlist(list, name):
+ for item in list:
+ if item and is_list(item) and item[0] == name:
+ return item[1:]
+ return []
+
+
+# Get a property of a list, which may itself be another list.
+#
+def getproplist(list, name):
+ for item in list:
+ if item and is_list(item) and item[0] == 'prop':
+ if len(item) > 1 and item[1] == name:
+ return item[2:]
+ return []
+
+
+# Test if an actuator description contains the property 'end-of-group'
+#
+def is_endgroup(list):
+ x = getproplist(list, 'end-of-group')
+ return (x and x[0] == '#t')
+
+
+# Neatly display an actuator definition given as S-expression
+# the prefix string is printed before each line.
+#
+def show_actuator(prefix, a):
+ for item in a:
+ if not is_list(item):
+ print prefix, item
+ elif item and item[0] == 'al':
+ print prefix, 'Subactuator list:'
+ for a in item[1:]:
+ show_actuator(prefix + ' ', a)
+ elif len(item) == 2:
+ print prefix, item[0], '=>', item[1]
+ elif len(item) == 3 and item[0] == 'prop':
+ print prefix, 'Prop', item[1], '=>',
+ print item[2]
+ else:
+ print prefix, '?', item
+
+
+# Neatly display a panel.
+#
+def show_panel(prefix, p):
+ for item in p:
+ if not is_list(item):
+ print prefix, item
+ elif item and item[0] == 'al':
+ print prefix, 'Actuator list:'
+ for a in item[1:]:
+ show_actuator(prefix + ' ', a)
+ elif len(item) == 2:
+ print prefix, item[0], '=>', item[1]
+ elif len(item) == 3 and item[0] == 'prop':
+ print prefix, 'Prop', item[1], '=>',
+ print item[2]
+ else:
+ print prefix, '?', item
+
+
+# Exception raised by build_actuator or build_panel.
+#
+panel_error = 'panel error'
+
+
+# Dummy callback used to initialize the callbacks.
+#
+def dummy_callback(arg):
+ pass
+
+
+# Assign attributes to members of the target.
+# Attribute names in exclist are ignored.
+# The member name is the attribute name prefixed with the prefix.
+#
+def assign_members(target, attrlist, exclist, prefix):
+ for item in attrlist:
+ if is_list(item) and len(item) == 2 and item[0] not in exclist:
+ name, value = item[0], item[1]
+ ok = 1
+ if value[0] in '-0123456789':
+ value = eval(value)
+ elif value[0] == '"':
+ value = value[1:-1]
+ elif value == 'move-then-resize':
+ # Strange default set by Panel Editor...
+ ok = 0
+ else:
+ print 'unknown value', value, 'for', name
+ ok = 0
+ if ok:
+ lhs = 'target.' + prefix + name
+ stmt = lhs + '=' + `value`
+ if debug: print 'exec', stmt
+ try:
+ exec stmt + '\n'
+ except KeyboardInterrupt: # Don't catch this!
+ raise KeyboardInterrupt
+ except:
+ print 'assign failed:', stmt
+
+
+# Build a real actuator from an actuator descriptior.
+# Return a pair (actuator, name).
+#
+def build_actuator(descr):
+ namelist = getattrlist(descr, 'name')
+ if namelist:
+ # Assume it is a string
+ actuatorname = namelist[0][1:-1]
+ else:
+ actuatorname = ''
+ type = descr[0]
+ if type[:4] == 'pnl_': type = type[4:]
+ act = pnl.mkact(type)
+ act.downfunc = act.activefunc = act.upfunc = dummy_callback
+ #
+ assign_members(act, descr[1:], ['al', 'data', 'name'], '')
+ #
+ # Treat actuator-specific data
+ #
+ datalist = getattrlist(descr, 'data')
+ prefix = ''
+ if type[-4:] == 'puck':
+ prefix = 'puck_'
+ elif type == 'mouse':
+ prefix = 'mouse_'
+ assign_members(act, datalist, [], prefix)
+ #
+ return act, actuatorname
+
+
+# Build all sub-actuators and add them to the super-actuator.
+# The super-actuator must already have been added to the panel.
+# Sub-actuators with defined names are added as members to the panel
+# so they can be referenced as p.name.
+#
+# Note: I have no idea how panel.endgroup() works when applied
+# to a sub-actuator.
+#
+def build_subactuators(panel, super_act, al):
+ #
+ # This is nearly the same loop as below in build_panel(),
+ # except a call is made to addsubact() instead of addact().
+ #
+ for a in al:
+ act, name = build_actuator(a)
+ act.addsubact(super_act)
+ if name:
+ stmt = 'panel.' + name + ' = act'
+ if debug: print 'exec', stmt
+ exec stmt + '\n'
+ if is_endgroup(a):
+ panel.endgroup()
+ sub_al = getattrlist(a, 'al')
+ if sub_al:
+ build_subactuators(panel, act, sub_al)
+ #
+ # Fix the actuator to which whe just added subactuators.
+ # This can't hurt (I hope) and is needed for the scroll actuator.
+ #
+ super_act.fixact()
+
+
+# Build a real panel from a panel definition.
+# Return a panel object p, where for each named actuator a, p.name is a
+# reference to a.
+#
+def build_panel(descr):
+ #
+ # Sanity check
+ #
+ if (not descr) or descr[0] <> 'panel':
+ raise panel_error, 'panel description must start with "panel"'
+ #
+ if debug: show_panel('', descr)
+ #
+ # Create an empty panel
+ #
+ panel = pnl.mkpanel()
+ #
+ # Assign panel attributes
+ #
+ assign_members(panel, descr[1:], ['al'], '')
+ #
+ # Look for actuator list
+ #
+ al = getattrlist(descr, 'al')
+ #
+ # The order in which actuators are created is important
+ # because of the endgroup() operator.
+ # Unfortunately the Panel Editor outputs the actuator list
+ # in reverse order, so we reverse it here.
+ #
+ al = reverse(al)
+ #
+ for a in al:
+ act, name = build_actuator(a)
+ act.addact(panel)
+ if name:
+ stmt = 'panel.' + name + ' = act'
+ exec stmt + '\n'
+ if is_endgroup(a):
+ panel.endgroup()
+ sub_al = getattrlist(a, 'al')
+ if sub_al:
+ build_subactuators(panel, act, sub_al)
+ #
+ return panel
+
+
+# Wrapper around pnl.dopanel() which calls call-back functions.
+#
+def my_dopanel():
+ # Extract only the first 4 elements to allow for future expansion
+ a, down, active, up = pnl.dopanel()[:4]
+ if down:
+ down.downfunc(down)
+ if active:
+ active.activefunc(active)
+ if up:
+ up.upfunc(up)
+ return a
+
+
+# Create one or more panels from a description file (S-expressions)
+# generated by the Panel Editor.
+#
+def defpanellist(file):
+ import panelparser
+ descrlist = panelparser.parse_file(open(file, 'r'))
+ panellist = []
+ for descr in descrlist:
+ panellist.append(build_panel(descr))
+ return panellist
+
+
+# Import everything from built-in method pnl, so the user can always
+# use panel.foo() instead of pnl.foo().
+# This gives *no* performance penalty once this module is imported.
+#
+from pnl import * # for export
+
+dopanel = my_dopanel # override pnl.dopanel
diff --git a/Lib/plat-irix6/panelparser.py b/Lib/plat-irix6/panelparser.py
new file mode 100644
index 0000000..1b069fa
--- /dev/null
+++ b/Lib/plat-irix6/panelparser.py
@@ -0,0 +1,128 @@
+# Module 'parser'
+#
+# Parse S-expressions output by the Panel Editor
+# (which is written in Scheme so it can't help writing S-expressions).
+#
+# See notes at end of file.
+
+
+whitespace = ' \t\n'
+operators = '()\''
+separators = operators + whitespace + ';' + '"'
+
+
+# Tokenize a string.
+# Return a list of tokens (strings).
+#
+def tokenize_string(s):
+ tokens = []
+ while s:
+ c = s[:1]
+ if c in whitespace:
+ s = s[1:]
+ elif c == ';':
+ s = ''
+ elif c == '"':
+ n = len(s)
+ i = 1
+ while i < n:
+ c = s[i]
+ i = i+1
+ if c == '"': break
+ if c == '\\': i = i+1
+ tokens.append(s[:i])
+ s = s[i:]
+ elif c in operators:
+ tokens.append(c)
+ s = s[1:]
+ else:
+ n = len(s)
+ i = 1
+ while i < n:
+ if s[i] in separators: break
+ i = i+1
+ tokens.append(s[:i])
+ s = s[i:]
+ return tokens
+
+
+# Tokenize a whole file (given as file object, not as file name).
+# Return a list of tokens (strings).
+#
+def tokenize_file(fp):
+ tokens = []
+ while 1:
+ line = fp.readline()
+ if not line: break
+ tokens = tokens + tokenize_string(line)
+ return tokens
+
+
+# Exception raised by parse_exr.
+#
+syntax_error = 'syntax error'
+
+
+# Parse an S-expression.
+# Input is a list of tokens as returned by tokenize_*().
+# Return a pair (expr, tokens)
+# where expr is a list representing the s-expression,
+# and tokens contains the remaining tokens.
+# May raise syntax_error.
+#
+def parse_expr(tokens):
+ if (not tokens) or tokens[0] <> '(':
+ raise syntax_error, 'expected "("'
+ tokens = tokens[1:]
+ expr = []
+ while 1:
+ if not tokens:
+ raise syntax_error, 'missing ")"'
+ if tokens[0] == ')':
+ return expr, tokens[1:]
+ elif tokens[0] == '(':
+ subexpr, tokens = parse_expr(tokens)
+ expr.append(subexpr)
+ else:
+ expr.append(tokens[0])
+ tokens = tokens[1:]
+
+
+# Parse a file (given as file object, not as file name).
+# Return a list of parsed S-expressions found at the top level.
+#
+def parse_file(fp):
+ tokens = tokenize_file(fp)
+ exprlist = []
+ while tokens:
+ expr, tokens = parse_expr(tokens)
+ exprlist.append(expr)
+ return exprlist
+
+
+# EXAMPLE:
+#
+# The input
+# '(hip (hop hur-ray))'
+#
+# passed to tokenize_string() returns the token list
+# ['(', 'hip', '(', 'hop', 'hur-ray', ')', ')']
+#
+# When this is passed to parse_expr() it returns the expression
+# ['hip', ['hop', 'hur-ray']]
+# plus an empty token list (because there are no tokens left.
+#
+# When a file containing the example is passed to parse_file() it returns
+# a list whose only element is the output of parse_expr() above:
+# [['hip', ['hop', 'hur-ray']]]
+
+
+# TOKENIZING:
+#
+# Comments start with semicolon (;) and continue till the end of the line.
+#
+# Tokens are separated by whitespace, except the following characters
+# always form a separate token (outside strings):
+# ( ) '
+# Strings are enclosed in double quotes (") and backslash (\) is used
+# as escape character in strings.
diff --git a/Lib/plat-irix6/readcd.doc b/Lib/plat-irix6/readcd.doc
new file mode 100644
index 0000000..1be549c
--- /dev/null
+++ b/Lib/plat-irix6/readcd.doc
@@ -0,0 +1,104 @@
+Interface to CD-ROM player.
+
+This module implements an interface to the built-in cd module. The
+intention is to provide a more user-friendly interface than the
+built-in module.
+
+The module defines a class Readcd with several methods. The
+initialization of the class will try to open the CD player. This
+means that initialization will fail if the CD player is already in
+use. A RuntimeError will be raised by the cd module in that case.
+
+The way to work with this module is as follows. The user specifies
+the parts of the CD that are to be read and he specifies callback
+functions which are to be called by the system. At some point he can
+tell the system to play. The specified parts of the CD will then be
+read and the callbacks will be called.
+
+Initialization.
+===============
+
+r = readcd.Readcd([cd-player [, mode]])
+
+The optional arguments are the name of the CD device and the mode.
+When "mode" is not specified, it defaults to 'r' (which is the only
+possible value); when "cd-player" also isn't specified, it defaults
+to "None" which indicates the default CD player.
+
+Methods.
+========
+
+eject() -- Eject the CD from the player.
+
+reset() -- Reset the list of data stretches to be played.
+
+appendtrack(track) -- Append the specified track to the list of music
+stretches.
+
+appendstretch(first, last) -- Append the stretch from "first" to "last"
+to the list of music stretches. Both "first" and "last" can be in one
+of four forms. "None": for "first", the beginning of the CD, for
+"last" the end of the CD; a single integer: a track number--playing
+starts at the beginning of the track or ends at the end of the
+specified track; a three-tuple: the absolute time from the start of
+the CD in minutes, seconds, frames; a four-tuple: track number and
+relative time within the track in minutes, seconds, frames.
+
+settracks(tracklist) -- The argument is a list of integers. The list
+of stretches is set to argument list. The old list is discarded.
+
+setcallback(type, func, arg) -- Set a callback function for "type".
+The function will be called as func(arg, type, data) where "arg" is
+the third argument of setcallback, "type" is the type of callback,
+"data" is type-dependent data. See the CDsetcallback(3) manual page
+for more information. The possible "type" arguments are defined in
+the CD module.
+
+removecallback(type) -- Remove the callback for "type".
+
+gettrackinfo([tracklist]) -- Return a list of tuples. Each tuple
+consists of start and length information of a track. The start and
+length information consist of three-tuples with minutes, seconds and
+frames. The optional tracklist argument gives a list of interesting
+track numbers. If no tracklist is specified, information about all
+tracks is returned.
+
+getstatus() -- Return the status information of the CD.
+
+play() -- Play the preprogrammed stretches of music from the CD. When
+nothing was programmed, the whole CD is played.
+
+Specifying stretches.
+=====================
+
+There are three methods available to specify a stretch of music to be
+played. The easiest way is to use "settracklist(tracklist)" with which
+a list of tracks can be specified. "settracklist(tracklist)" is
+equivalent to the sequence
+ reset()
+ for track in tracklist:
+ appendtrack(track)
+
+The next method is "appendtrack(track)" with which a whole track can be
+added to the list of music to be played. "appendtrack(track)" is
+equivalent to "appendstretch(track, track)".
+
+The most complete method is "appendstretch(first, last)". Using this
+method, it is possible to specify any stretch of music.
+
+When two consecutive tracks are played, it is possible to choose
+whether the pause that may be between the tracks is played as well or
+whether the pause should be skipped. When the end of a stretch is
+specified using a track number and the next stretch starts at the
+beginning of the following track and that was also specified using the
+track number (that is, both were specified as integers, not as tuples),
+the pause is played. When either value was specified using absolute
+time or track-relative time (that is, as three-tuple or as
+four-tuple), the pause will not be played.
+
+Errors.
+=======
+
+When an error occurs, an exception will be raised. Depending on where
+the error occurs, the exception may either be "readcd.Error" or
+"RuntimeError".
diff --git a/Lib/plat-irix6/readcd.py b/Lib/plat-irix6/readcd.py
new file mode 100644
index 0000000..5c4b824
--- /dev/null
+++ b/Lib/plat-irix6/readcd.py
@@ -0,0 +1,242 @@
+# Class interface to the CD module.
+
+import cd, CD
+
+Error = 'Readcd.Error'
+_Stop = 'Readcd.Stop'
+
+def _doatime(self, cb_type, data):
+ if ((data[0] * 60) + data[1]) * 75 + data[2] > self.end:
+## print 'done with list entry',`self.listindex`
+ raise _Stop
+ func, arg = self.callbacks[cb_type]
+ if func:
+ func(arg, cb_type, data)
+
+def _dopnum(self, cb_type, data):
+ if data > self.end:
+## print 'done with list entry',`self.listindex`
+ raise _Stop
+ func, arg = self.callbacks[cb_type]
+ if func:
+ func(arg, cb_type, data)
+
+class Readcd:
+ def __init__(self, *arg):
+ if len(arg) == 0:
+ self.player = cd.open()
+ elif len(arg) == 1:
+ self.player = cd.open(arg[0])
+ elif len(arg) == 2:
+ self.player = cd.open(arg[0], arg[1])
+ else:
+ raise Error, 'bad __init__ call'
+ self.list = []
+ self.callbacks = [(None, None)] * 8
+ self.parser = cd.createparser()
+ self.playing = 0
+ self.end = 0
+ self.status = None
+ self.trackinfo = None
+
+ def eject(self):
+ self.player.eject()
+ self.list = []
+ self.end = 0
+ self.listindex = 0
+ self.status = None
+ self.trackinfo = None
+ if self.playing:
+## print 'stop playing from eject'
+ raise _Stop
+
+ def pmsf2msf(self, track, min, sec, frame):
+ if not self.status:
+ self.cachestatus()
+ if track < self.status[5] or track > self.status[6]:
+ raise Error, 'track number out of range'
+ if not self.trackinfo:
+ self.cacheinfo()
+ start, total = self.trackinfo[track]
+ start = ((start[0] * 60) + start[1]) * 75 + start[2]
+ total = ((total[0] * 60) + total[1]) * 75 + total[2]
+ block = ((min * 60) + sec) * 75 + frame
+ if block > total:
+ raise Error, 'out of range'
+ block = start + block
+ min, block = divmod(block, 75*60)
+ sec, frame = divmod(block, 75)
+ return min, sec, frame
+
+ def reset(self):
+ self.list = []
+
+ def appendtrack(self, track):
+ self.appendstretch(track, track)
+
+ def appendstretch(self, start, end):
+ if not self.status:
+ self.cachestatus()
+ if not start:
+ start = 1
+ if not end:
+ end = self.status[6]
+ if type(end) == type(0):
+ if end < self.status[5] or end > self.status[6]:
+ raise Error, 'range error'
+ else:
+ l = len(end)
+ if l == 4:
+ prog, min, sec, frame = end
+ if prog < self.status[5] or prog > self.status[6]:
+ raise Error, 'range error'
+ end = self.pmsf2msf(prog, min, sec, frame)
+ elif l <> 3:
+ raise Error, 'syntax error'
+ if type(start) == type(0):
+ if start < self.status[5] or start > self.status[6]:
+ raise Error, 'range error'
+ if len(self.list) > 0:
+ s, e = self.list[-1]
+ if type(e) == type(0):
+ if start == e+1:
+ start = s
+ del self.list[-1]
+ else:
+ l = len(start)
+ if l == 4:
+ prog, min, sec, frame = start
+ if prog < self.status[5] or prog > self.status[6]:
+ raise Error, 'range error'
+ start = self.pmsf2msf(prog, min, sec, frame)
+ elif l <> 3:
+ raise Error, 'syntax error'
+ self.list.append((start, end))
+
+ def settracks(self, list):
+ self.list = []
+ for track in list:
+ self.appendtrack(track)
+
+ def setcallback(self, cb_type, func, arg):
+ if cb_type < 0 or cb_type >= 8:
+ raise Error, 'type out of range'
+ self.callbacks[cb_type] = (func, arg)
+ if self.playing:
+ start, end = self.list[self.listindex]
+ if type(end) == type(0):
+ if cb_type <> CD.PNUM:
+ self.parser.setcallback(cb_type, func, arg)
+ else:
+ if cb_type <> CD.ATIME:
+ self.parser.setcallback(cb_type, func, arg)
+
+ def removecallback(self, cb_type):
+ if cb_type < 0 or cb_type >= 8:
+ raise Error, 'type out of range'
+ self.callbacks[cb_type] = (None, None)
+ if self.playing:
+ start, end = self.list[self.listindex]
+ if type(end) == type(0):
+ if cb_type <> CD.PNUM:
+ self.parser.removecallback(cb_type)
+ else:
+ if cb_type <> CD.ATIME:
+ self.parser.removecallback(cb_type)
+
+ def gettrackinfo(self, *arg):
+ if not self.status:
+ self.cachestatus()
+ if not self.trackinfo:
+ self.cacheinfo()
+ if len(arg) == 0:
+ return self.trackinfo[self.status[5]:self.status[6]+1]
+ result = []
+ for i in arg:
+ if i < self.status[5] or i > self.status[6]:
+ raise Error, 'range error'
+ result.append(self.trackinfo[i])
+ return result
+
+ def cacheinfo(self):
+ if not self.status:
+ self.cachestatus()
+ self.trackinfo = []
+ for i in range(self.status[5]):
+ self.trackinfo.append(None)
+ for i in range(self.status[5], self.status[6]+1):
+ self.trackinfo.append(self.player.gettrackinfo(i))
+
+ def cachestatus(self):
+ self.status = self.player.getstatus()
+ if self.status[0] == CD.NODISC:
+ self.status = None
+ raise Error, 'no disc in player'
+
+ def getstatus(self):
+ return self.player.getstatus()
+
+ def play(self):
+ if not self.status:
+ self.cachestatus()
+ size = self.player.bestreadsize()
+ self.listindex = 0
+ self.playing = 0
+ for i in range(8):
+ func, arg = self.callbacks[i]
+ if func:
+ self.parser.setcallback(i, func, arg)
+ else:
+ self.parser.removecallback(i)
+ if len(self.list) == 0:
+ for i in range(self.status[5], self.status[6]+1):
+ self.appendtrack(i)
+ try:
+ while 1:
+ if not self.playing:
+ if self.listindex >= len(self.list):
+ return
+ start, end = self.list[self.listindex]
+ if type(start) == type(0):
+ dummy = self.player.seektrack(
+ start)
+ else:
+ min, sec, frame = start
+ dummy = self.player.seek(
+ min, sec, frame)
+ if type(end) == type(0):
+ self.parser.setcallback(
+ CD.PNUM, _dopnum, self)
+ self.end = end
+ func, arg = \
+ self.callbacks[CD.ATIME]
+ if func:
+ self.parser.setcallback(CD.ATIME, func, arg)
+ else:
+ self.parser.removecallback(CD.ATIME)
+ else:
+ min, sec, frame = end
+ self.parser.setcallback(
+ CD.ATIME, _doatime,
+ self)
+ self.end = (min * 60 + sec) * \
+ 75 + frame
+ func, arg = \
+ self.callbacks[CD.PNUM]
+ if func:
+ self.parser.setcallback(CD.PNUM, func, arg)
+ else:
+ self.parser.removecallback(CD.PNUM)
+ self.playing = 1
+ data = self.player.readda(size)
+ if data == '':
+ self.playing = 0
+ self.listindex = self.listindex + 1
+ continue
+ try:
+ self.parser.parseframe(data)
+ except _Stop:
+ self.playing = 0
+ self.listindex = self.listindex + 1
+ finally:
+ self.playing = 0
diff --git a/Lib/plat-irix6/regen b/Lib/plat-irix6/regen
new file mode 100755
index 0000000..4c4ea5c
--- /dev/null
+++ b/Lib/plat-irix6/regen
@@ -0,0 +1,13 @@
+#! /bin/sh
+case `uname -sr` in
+'IRIX '[45].*) ;;
+*) echo Probably not on an IRIX system 1>&2
+ exit 1;;
+esac
+set -v
+h2py /usr/include/sys/fcntl.h
+h2py /usr/include/sys/file.h
+h2py /usr/include/sys/socket.h
+h2py -i '(u_long)' /usr/include/netinet/in.h
+h2py /usr/include/sys/termios.h
+h2py /usr/include/errno.h
diff --git a/Lib/plat-irix6/torgb.py b/Lib/plat-irix6/torgb.py
new file mode 100644
index 0000000..f283063
--- /dev/null
+++ b/Lib/plat-irix6/torgb.py
@@ -0,0 +1,97 @@
+# Convert "arbitrary" image files to rgb files (SGI's image format).
+# Input may be compressed.
+# The uncompressed file type may be PBM, PGM, PPM, GIF, TIFF, or Sun raster.
+# An exception is raised if the file is not of a recognized type.
+# Returned filename is either the input filename or a temporary filename;
+# in the latter case the caller must ensure that it is removed.
+# Other temporary files used are removed by the function.
+
+import os
+import tempfile
+import pipes
+import imghdr
+
+table = {}
+
+t = pipes.Template()
+t.append('fromppm $IN $OUT', 'ff')
+table['ppm'] = t
+
+t = pipes.Template()
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['pnm'] = t
+table['pgm'] = t
+table['pbm'] = t
+
+t = pipes.Template()
+t.append('fromgif $IN $OUT', 'ff')
+table['gif'] = t
+
+t = pipes.Template()
+t.append('tifftopnm', '--')
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['tiff'] = t
+
+t = pipes.Template()
+t.append('rasttopnm', '--')
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['rast'] = t
+
+t = pipes.Template()
+t.append('djpeg', '--')
+t.append('(PATH=$PATH:/ufs/guido/bin/sgi; exec pnmtoppm)', '--')
+t.append('fromppm $IN $OUT', 'ff')
+table['jpeg'] = t
+
+uncompress = pipes.Template()
+uncompress.append('uncompress', '--')
+
+
+error = 'torgb.error' # Exception
+
+def torgb(filename):
+ temps = []
+ ret = None
+ try:
+ ret = _torgb(filename, temps)
+ finally:
+ for temp in temps[:]:
+ if temp <> ret:
+ try:
+ os.unlink(temp)
+ except os.error:
+ pass
+ temps.remove(temp)
+ return ret
+
+def _torgb(filename, temps):
+ if filename[-2:] == '.Z':
+ fname = tempfile.mktemp()
+ temps.append(fname)
+ sts = uncompress.copy(filename, fname)
+ if sts:
+ raise error, filename + ': uncompress failed'
+ else:
+ fname = filename
+ try:
+ ftype = imghdr.what(fname)
+ except IOError, msg:
+ if type(msg) == type(()) and len(msg) == 2 and \
+ type(msg[0]) == type(0) and type(msg[1]) == type(''):
+ msg = msg[1]
+ if type(msg) <> type(''):
+ msg = `msg`
+ raise error, filename + ': ' + msg
+ if ftype == 'rgb':
+ return fname
+ if ftype == None or not table.has_key(ftype):
+ raise error, \
+ filename + ': unsupported image file type ' + `ftype`
+ temp = tempfile.mktemp()
+ sts = table[ftype].copy(fname, temp)
+ if sts:
+ raise error, filename + ': conversion to rgb failed'
+ return temp