XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX BZman XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Small library for managing compression (HP49) --------------------------------------------------------------------- NEW in VERSION 8.2001: Some commands slightly faster. Unnamed decompressor XLIB 262 6 from now on stable (no argument or type checking). NEW in VERSION 7.2001: Command menu expanded, Text rewritten. --------------------------------------------------------------------- This library has one page of commands of which the most important one is the BZ-toggler bz. We recommend to assign bz to a key. Store BZMAN in a port and attach the library with ON_C as usual. Most of BZMAN belongs also to OT49. Command description in RPN mode: bz Toggles compression and decompression of any object in Level 1. After compression another menu is created for further processing the BZstring: |UBZi| |UBZe| |ApEVL| |BZC| |BZCE| |EXIT| The first 3 belong also to BZMAN's command menu and are described below. BZC generates a code object from a BZ-string "BZ..." which decompresses very fast. Moreover, it is 35 bytes shorter than the equivalent program generated from the BZ-string with UBZe below, and is slightly faster. BZCE behaves like BZC but evals the decompressed object, in addition. The code is difficult to hack and kills two birds with one stone: it makes self-decompression fast and saves the source from being misused. EXIT returns to the previous menu. bzDIR compresses a whole directory together with its subdirectories. A single file is left in the directory, with the directories' name. Its execution immediately restores the original. Thus, a directory with a single and equally named file in it means the latter holds the packed directory. ?BZ BZ-string filter. Errors except for a BZ-string input. Does cheching for nullcharacters only. Stack: BZ$ -> BZ$, ob -> ob Bad_Arg_Type_Error UBZi Appends the unnamed BZMAN-decompressor XLIB 262 6 to a BZ-string for decompression. For internal use only, i.e., if BZMAN is installed. UBZe Appends a small BZ-decompessor to a BZ-string, known to every HP49. For external use, e.g., for sending a compressed program to hpcalc.org. ApEVL Appends the EVAL-command to a program. E.g., if applied to the program <<"BZ..." bz >> one gets <<"BZ..." bz EVAL>> (it evals the decompressed object). Avoid to apply ApEVL twice which may later yield an error. Compression pays only for relatively large objects, programs, strings or grobs of more the 300 bytes, say. The compression rate strongly depends on how much "coloured" the object is. The less coloured the higher the compression rate. For programs or strings "highly coloured" means using many different commands or words and leaving not much room for repetition. CREDITS. BZ is due to Mika Heiskanen. BZC and BZCE are essentially due to Jurjen Bos. ----------------------------------------------------------------------------- Wolfgang Rautenberg, raut@math.fu-berlin.de www.math.fu-berlin.de/usr/raut