summaryrefslogtreecommitdiffstats
path: root/unix
Commit message (Collapse)AuthorAgeFilesLines
* * unix/tkUnixSelect.c:stanton1999-06-031-3/+13
| | | | | | * tests/unixSelect.test: * generic/tkSelect.c: Fixed selection code to handle Unicode data in COMPOUND_TEXT and STRING selections. [Bug: 1791]
* * unix/tkUnixSelect.c: Improved I18N selection support.stanton1999-06-011-94/+271
| | | | | | COMPOUND_TEXT is converted to/from iso2022, and STRING is converted to/from iso8859-1. There are still a few loose ends to tie up before this is completely done.
* * unix/tkUnixFont.c: Eliminated redundant case folding code.stanton1999-06-011-7/+2
|
* Merged changes from 1-3-b2 branch into mainline.stanton1999-05-261-2/+3
|
* First pass at Unicode support in X selection code.stanton1999-05-251-9/+122
|
* * Changed version number to 8.1.1.stanton1999-04-301-2/+2
|
* * Merged changes from 8.1.0 branchstanton1999-04-301-2/+2
|
* removed extra instance of tkConsole.oredman1999-04-301-2/+2
|
* Add tkConsole.oredman1999-04-281-4/+7
|
* merged 8.1.0 changes into mainlinestanton1999-04-241-2/+8
|
* Merged 8-1-0 into mainline.rjohnson1999-04-212-3/+3
|
* modified the Tk makefiel to copy *.decls for a source releasesurles1999-04-201-1/+2
|
* fixed Tk comment errorssurles1999-04-161-2/+2
|
* * Merged 8.1 branch into the main trunkstanton1999-04-1625-1282/+3420
|
* remove --enable-tcl-stub from configure scripts due to linking problems.redman1999-03-221-25/+6
|
* integrated stubs into 8.0 main branchstanton1999-03-109-41/+250
|
* applied Paul Duffin's AIX patchstanton1999-03-062-10/+25
|
* updated readmes for 8.0.5 releasecore_8_1_merge_2_10_99core_8_0_5_basestanton1999-02-091-14/+6
|
* * unix/tkUnixSend.c (Tk_SetAppName): Fixed uninitialized memorystanton1999-02-041-4/+7
| | | | access bug. [Bug: 919]
* * unix/configure.in: TK_LD_SEARCH_FLAGS was set incorrectly ifstanton1999-02-041-2/+13
| | | | | | SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through the C compiler. Systems affected are Linux, MP-RAS and NEXTSTEP, but also with gcc on many more systems. [Bug: 908]
* * mac/tkMacAppInit.c:stanton1999-02-041-2/+2
| | | | | | | | | * generic/tkTest.c: * generic/tkAppInit.c: * win/winMain.c: Changed some EXTERN declarations to extern since they are not defining exported interfaces. This avoids generating useless declspec() attributes and makes the windows makefile simpler.
* Added -pipe option if gcc is being used.rjohnson1999-01-291-1/+18
|
* Updated the version to 8.0.5.rjohnson1999-01-041-2/+2
|
* Fixed a typorjohnson1998-12-071-3/+3
|
* Fixed font display bug (#846)stanton1998-11-251-1/+30
|
* Changed config & Makefile to support n32 format on IRIX.rjohnson1998-10-202-3/+5
|
* Updated patchlevel to 8.0.4 (to match Tcl update)rjohnson1998-10-141-2/+2
|
* Fixed memory leak in unix wm commandrjohnson1998-09-301-1/+8
|
* Removed old/unused function declarationsrjohnson1998-09-301-7/+2
| | | | | removed unused file on Mac implementation made bell cmd an obj cmd - improved it's test suite
* Removed "sccs" commands from "Makefile.in" to facilititate switch over to CVS.build1998-09-231-5/+2
|
* Replaced SCCS strings, fixed binary filesstanton1998-09-1430-30/+30
|
* fixed font display to truncate really long stringsstanton1998-08-111-1/+20
|
* fixed --with-tcl searchingwelch1998-08-071-1/+1
|
* *** empty log message ***welch1998-08-061-1/+1
|
* 8.0.3welch1998-08-061-1/+1
|
* 8.0.3-5welch1998-08-041-2/+2
|
* added SHLIB_PATH to test targets for HPUXstanton1998-08-041-0/+4
|
* Fixed old calls to XReadBitmapFilewelch1998-08-041-2/+2
|
* 8.0.3-4welch1998-07-291-1/+1
|
* More fixes for DBGXwelch1998-07-292-6/+9
|
* *** empty log message ***welch1998-07-291-1/+1
|
* DGBX changeswelch1998-07-283-6/+11
|
* eliminated static init for library directorystanton1998-07-241-13/+0
|
* the flag that caused all the X libs warnings was -Wimplicit-int, so turn thatescoffon1998-07-241-2/+2
| | | | off
* leave -Wconversion out, the X libs generate so many of these warningsescoffon1998-07-241-1/+5
| | | | that they obscure everything else.
* Added support for specifying warning flags for the compiler, with checksescoffon1998-07-222-1/+13
| | | | for gcc and appropriate defaults.
* Merged changes between child workspace "/home/escoffon/ws/tk8.0" andescoffon1998-07-212-9/+17
| | | | parent workspace "/export/home/ws/tk8.0".
* added setting of TK_LIB_FLAGescoffon1998-07-211-0/+3
|
* 8.0.3-3welch1998-07-201-1/+1
|
* Updated dist targetwelch1998-07-201-5/+6
|
lass="hl slc"># The loop here is convoluted, since we don't really now how # much to decode: there may be newlines in the incoming data. while wtd > 0: if self.eof: return decdata wtd = ((wtd + 2) // 3) * 4 data = self.ifp.read(wtd) # # Next problem: there may not be a complete number of # bytes in what we pass to a2b. Solve by yet another # loop. # while True: try: decdatacur, self.eof = binascii.a2b_hqx(data) break except binascii.Incomplete: pass newdata = self.ifp.read(1) if not newdata: raise Error('Premature EOF on binhex file') data = data + newdata decdata = decdata + decdatacur wtd = totalwtd - len(decdata) if not decdata and not self.eof: raise Error('Premature EOF on binhex file') return decdata def close(self): self.ifp.close() class _Rledecoderengine: """Read data via the RLE-coder""" def __init__(self, ifp): self.ifp = ifp self.pre_buffer = b'' self.post_buffer = b'' self.eof = 0 def read(self, wtd): if wtd > len(self.post_buffer): self._fill(wtd - len(self.post_buffer)) rv = self.post_buffer[:wtd] self.post_buffer = self.post_buffer[wtd:] return rv def _fill(self, wtd): self.pre_buffer = self.pre_buffer + self.ifp.read(wtd + 4) if self.ifp.eof: self.post_buffer = self.post_buffer + \ binascii.rledecode_hqx(self.pre_buffer) self.pre_buffer = b'' return # # Obfuscated code ahead. We have to take care that we don't # end up with an orphaned RUNCHAR later on. So, we keep a couple # of bytes in the buffer, depending on what the end of # the buffer looks like: # '\220\0\220' - Keep 3 bytes: repeated \220 (escaped as \220\0) # '?\220' - Keep 2 bytes: repeated something-else # '\220\0' - Escaped \220: Keep 2 bytes. # '?\220?' - Complete repeat sequence: decode all # otherwise: keep 1 byte. # mark = len(self.pre_buffer) if self.pre_buffer[-3:] == RUNCHAR + b'\0' + RUNCHAR: mark = mark - 3 elif self.pre_buffer[-1:] == RUNCHAR: mark = mark - 2 elif self.pre_buffer[-2:] == RUNCHAR + b'\0': mark = mark - 2 elif self.pre_buffer[-2:-1] == RUNCHAR: pass # Decode all else: mark = mark - 1 self.post_buffer = self.post_buffer + \ binascii.rledecode_hqx(self.pre_buffer[:mark]) self.pre_buffer = self.pre_buffer[mark:] def close(self): self.ifp.close() class HexBin: def __init__(self, ifp): if isinstance(ifp, str): ifp = io.open(ifp, 'rb') # # Find initial colon. # while True: ch = ifp.read(1) if not ch: raise Error("No binhex data found") # Cater for \r\n terminated lines (which show up as \n\r, hence # all lines start with \r) if ch == b'\r': continue if ch == b':': break hqxifp = _Hqxdecoderengine(ifp) self.ifp = _Rledecoderengine(hqxifp) self.crc = 0 self._readheader() def _read(self, len): data = self.ifp.read(len) self.crc = binascii.crc_hqx(data, self.crc) return data def _checkcrc(self): filecrc = struct.unpack('>h', self.ifp.read(2))[0] & 0xffff #self.crc = binascii.crc_hqx('\0\0', self.crc) # XXXX Is this needed?? self.crc = self.crc & 0xffff if filecrc != self.crc: raise Error('CRC error, computed %x, read %x' % (self.crc, filecrc)) self.crc = 0 def _readheader(self): len = self._read(1) fname = self._read(ord(len)) rest = self._read(1 + 4 + 4 + 2 + 4 + 4) self._checkcrc() type = rest[1:5] creator = rest[5:9] flags = struct.unpack('>h', rest[9:11])[0] self.dlen = struct.unpack('>l', rest[11:15])[0] self.rlen = struct.unpack('>l', rest[15:19])[0] self.FName = fname self.FInfo = FInfo() self.FInfo.Creator = creator self.FInfo.Type = type self.FInfo.Flags = flags self.state = _DID_HEADER def read(self, *n): if self.state != _DID_HEADER: raise Error('Read data at wrong time') if n: n = n[0] n = min(n, self.dlen) else: n = self.dlen rv = b'' while len(rv) < n: rv = rv + self._read(n-len(rv)) self.dlen = self.dlen - n return rv def close_data(self): if self.state != _DID_HEADER: raise Error('close_data at wrong time') if self.dlen: dummy = self._read(self.dlen) self._checkcrc() self.state = _DID_DATA def read_rsrc(self, *n): if self.state == _DID_HEADER: self.close_data() if self.state != _DID_DATA: raise Error('Read resource data at wrong time') if n: n = n[0] n = min(n, self.rlen) else: n = self.rlen self.rlen = self.rlen - n return self._read(n) def close(self): if self.rlen: dummy = self.read_rsrc(self.rlen) self._checkcrc() self.state = _DID_RSRC self.ifp.close() def hexbin(inp, out): """hexbin(infilename, outfilename) - Decode binhexed file""" ifp = HexBin(inp) finfo = ifp.FInfo if not out: out = ifp.FName ofp = io.open(out, 'wb') # XXXX Do translation on non-mac systems while True: d = ifp.read(128000) if not d: break ofp.write(d) ofp.close() ifp.close_data() d = ifp.read_rsrc(128000) if d: ofp = openrsrc(out, 'wb') ofp.write(d) while True: d = ifp.read_rsrc(128000) if not d: break ofp.write(d) ofp.close() ifp.close()