Lines Matching +full:d3 +full:- +full:force
13 # XXXX Note: currently, textfiles appear in mac-form on all platforms.
14 # We seem to lack a simple character-translate in python.
15 # (we should probably use ISO-Latin-1 on all but the mac platform).
17 # files in-core. Should be fixed.
39 REASONABLY_LARGE=32768 # Minimal amount we pass the rle-coder
41 RUNCHAR=chr(0x90) # run-length introducer
44 # This code is no longer byte-order dependent
47 # Workarounds for non-mac machines.
73 # Glue code for non-macintosh usage
96 file = file.replace(':', '-', 1)
113 """Write data to the coder in 3-byte chunks"""
119 self.linelen = LINELEN-1
132 def _flush(self, force): argument
134 while first <= len(self.hqxdata)-self.linelen:
140 if force:
152 """Write data to the RLE-coder in suitably large chunks"""
197 # Force all structs to be packed with big-endian
198 d3 = struct.pack('>h', finfo.Flags)
200 info = d + d2 + d3 + d4
221 self.dlen = self.dlen - len(data)
235 self.rlen = self.rlen - len(data)
248 "Incorrect resource-datasize, diff=%r" % (self.rlen,)
257 """(infilename, outfilename) - Create binhex-encoded copy of a file"""
262 # XXXX Do textfile translation on non-mac systems
279 """Read data via the decoder in 4-byte chunks"""
314 wtd = totalwtd - len(decdata)
323 """Read data via the RLE-coder"""
333 self._fill(wtd-len(self.post_buffer))
351 # '\220\0\220' - Keep 3 bytes: repeated \220 (escaped as \220\0)
352 # '?\220' - Keep 2 bytes: repeated something-else
353 # '\220\0' - Escaped \220: Keep 2 bytes.
354 # '?\220?' - Complete repeat sequence: decode all
358 if self.pre_buffer[-3:] == RUNCHAR + '\0' + RUNCHAR:
359 mark = mark - 3
360 elif self.pre_buffer[-1] == RUNCHAR:
361 mark = mark - 2
362 elif self.pre_buffer[-2:] == RUNCHAR + '\0':
363 mark = mark - 2
364 elif self.pre_buffer[-2] == RUNCHAR:
367 mark = mark - 1
446 rv = rv + self._read(n-len(rv))
447 self.dlen = self.dlen - n
468 self.rlen = self.rlen - n
483 """(infilename, outfilename) - Decode binhexed file"""
490 # XXXX Do translation on non-mac systems