Home
User Manual V2.5 (SCO-UNIX)
Contents
1. Application Examples Compressed file Block size Record format Record size Device Organization Record delimiter Close disposition Key description Decompressed file Device Organization Block size Record format Record size if fixed Record delimiter Close disposition Key description Original file Block size Record format Record size Device Organization Record delimiter Close disposition Key description Name of exit routine Name of exit routine Integer Return code CPU time Record counter Byte counter Byte counter overflow Record counter Byte counter Byte counter overflow Output file FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 7 Application Examples Enter file name printf File name input scanf s kname printf File name output scanf s dname Initialize FLAM opmode FLAM C OPEN INPUT Decompress statis FLAM C STATISTIC Statistics lstpar FLAM C MORE PARAMETER flmopn amp flmid amp rc amp lstpar amp opmode kname amp statis if rc FLAM NORMAL put flmsg roc exit rc Specifications for compressed file il 100 cldispk FLAM C CLOSE REWIND Close disposition flmopd amp flmid amp rc amp lstpar amp il kname amp orgak amp recfk amp recsk recdelk c amp
2. 2014 by limes datentechnik gmbh Chapter 7 if po 0x00 po amp string 0 while po 0x00 pptt pott istt else po amp string 0 do pp po istt while pot z pptt istt if po i pott while po 0x00 if po amp amp po pptt pot istt else if po pott else pptt pott istt if pp 1 pp is pprr is pprt is if is 0 pp is 7 87 87 87 8 Frankenstein Limes Access Method f n amp amp Application Examples Parameter without lists After parameter string Parameter with list dl d2 di d2 d1 d2 After parameter string po FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 7 Application Examples flamup call flamup amp id amp retco parstring amp is put flmsg retco Return code output return retco FLAM V4 3 UNIX 7 9 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 6 How to Use the Record Interface 7 6 1 Compressing a File Data records are read in a user program and transferred to FLAM s record interface for compression The information about the original file and the information which is generated by the use
3. Common information is stored in the common FLAM file header This includes all information about the original file such as the file organization record format length and position of the primary key etc as well as details of the FLAM version and the operating system in which the FLAMFILE was created User specific information of any kind is stored in the user specific FLAM file header This header type can be inserted additionally if the record interface is used for example for information which must be evaluated by the application program Creation of the common FLAM file header is supported by all interfaces command subprogram and record by means of parameters and arguments A user specific FLAM file header can only be created if the record interface is used This interface incorporates the following functions for creating and evaluating the various file header types FLAM file header Created by Evaluated by poc Common flmphd flmghd Userspeciic fimpuh fmguh It is not mandatory to insert FLAM file headers in the FLAMFILE If they are inserted it is essential to observe the stipulated order when invoking the functions of the record interface see section 1 5 3 for further details FLAM file headers are always inserted in the FLAMFILE directly preceding the compressed version of the file to which they belong If a FLAMFILE contains compressed versions of several files a FLAM file header can be
4. Name of original file Name of decompressed file FLAM code Compression mode Statistics Open mode Block mode File header Feed control character FLAM version Record length Buffer length Length of file name Length of system specific information System specific information Data area Operating system Max no of records block Max buffer size in KB Last parameter 7 15 2014 by limes datentechnik gmbh Chapter 7 long blksk long recfk long recsk long devk long orgak union char c 4 unsigned long i recdelk long cldispk struct kd keydesck long devd long orgad long blksd long recfd long recsd union char c 4 unsigned long i recdeld long cldispd struct kd keydescd long blkso long recfo long recso long devo long orgao union char c 4 unsigned long i recdelo long cldispo struct kd keydesco char exk20 34 char exd20 34 long il ir unsigned long rc unsigned long cputime unsigned long zks unsigned long zkb unsigned long zkbofl unsigned long zunks unsigned long zunkb unsigned long zunkbofl FILE outfile long uattrlen char usrattr 1000 7 167 167 167 16 Frankenstein Limes Access Method
5. The user exits must be linked to the subprogram interface flam upu o or to the record interface flam recu o and to the application program This means that at present only one function can be used per user exit Any user exits which are not required by an application program must be installed as dummy functions please refer to sections 3 3 and 4 5 for details of how to link the programs Chapter 7 contains examples of user exits as well as a program for compressing and decompressing files similar to FLAM 6 1 1 Programming the Access Exits When programming user exits for file accesses their execution environment must be taken into consideration For example operator interventions must be avoided if their use in batch processing cannot be ruled out Likewise output to displays might result in undesirable distortions to FLAM s processing logs Storage areas made available through pointers must not be modified beyond the length specified in the call Storage for inserted records must be requested and released by the exit itself The following pages describe the syntax of the interfaces between FLAM an the user exits in detail FLAM V4 3 UNIB 4 2014 by limes datentechnik gmbh Chapter 6 exd10 Syntax Arguments functioncode returncode record_pointer record_length work FLAM V4 3 UNIX Frankenstein Limes Access Method The User Exits This user exit can be used during the decompression p
6. Whereas with the functions of the record interface the programmer is obliged to observe a series of rules regarding the order and consistency of the calls the correct interaction of the functions of the user defined input output is the responsibility of FLAM which also takes the initiative for the calls The programmer of the user defined input output routines is merely required to make sure that the actions and behavior of the individual functions are correct The description in this chapter is therefore restricted to these aspects usropn is invoked first of all once and once only for each assigned file The workio argument causes a work area of 1024 bytes to be made available as file specific memory This area is adopted automatically for all subsequent calls until the usrcls The openmode argument specifies the desired access type input output The record_format record_size etc arguments specify the file and record attributes which can be adapted to each particular file if necessary The successful termination of the function and any special states or errors can be reported by means of predefined and freely assignable return codes Each return code is evaluated by FLAM and passed on to the invoking programs if an error is established A record is transferred for writing with usrput If the record cannot be written with the specified size the return code must include the information that it has been either shortened
7. if functioncode 0 functioncode 8 return File record processed shown record pointer record length 0x00 work printf s n record pointer returncode 4 No errors don t transfer record return FLAM V4 3 UNIX 7 27 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 8 3 Swapping Two Bytes with exk20 during Compression Two bytes are swapped in each record to provide additional protection for the compressed file If the data were to be decompressed without swapping the bytes back again an error would occur The swapped bytes are returned to their original positions using the same program during the decompression procedure Example of exitk20 and exitd20 Swap two bytes during compression procedure The swapped bytes are returned to their original positions using the same program during the decompression procedure The program call then becomes exd20 instead of exk20 exk20 functioncode returncode record pointer record length work long functioncode Function code long returncode Return code char record pointer Record pointer long record length Record length char work Work area returncode 0 No errors transfer record if functioncode 0 functioncode 8 return if record length 16 Swap bytes 16 and 17 work
8. jklmnopqr FR SCUVWRY Z BRR RR KR I KR I IK ABCDEFGHI JKLMNOPOR x STUVWXYZ x 0123456789 ee eRe Code Tables B 4B 4B 4 B 4 Appendix B This table can be used to translate EBCDIC data containing alphanumeric characters and the following special characters All other EBCDIC codes are converted to the ASCII character The position of each character in the translation table is derived by adding 1 to the numeric value of its EBCDIC code The number 9 for example corresponds to the hexadecimal EBCDIC code F9 decimal 249 and its position is 250 If for instance the German umlaut needed to be added to the table its EBCDIC code would have to be determined first Assuming this code to be hexadecimal DO decimal 208 the ASCII code for would have to be replaced by the ASCII code for at position 209 directly in front of the A Conversely the EBCDIC code F9 hexadecimal would have to be entered at position 58 for the number 9 ASCII code hexadecimal 39 decimal 57 in a table for translating ASCII to EBCDIC B 2 Generating code tables When code tables are generated it is not normally possible to enter character codes which correspond to non printing ASCII characters using the keyboard It is advisable to use the following program which incorporates a modified code table see example in usr lib flame samplest cr_code c FLAM V4 3 UNIX Frankenstein Limes
9. 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 Oxff Ox2d OxOd Ox3d Oxid Ox6c 0x60 Oxf5 Ox7e Oxc5 Oxd4 Oxe4 Oxbd 0x85 0x94 Oxa4 Oxfd 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x06 Code Tables 0x2e 0x0e 0x32 Oxle 0x50 Ox4b Oxf6 Ox6e Oxc6 Oxd5 Oxe5 Ox6a 0x86 0x95 Oxa5 Oxff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 Ox2f OxOf 0x26 Ox1f 0x7d 0x61 Oxf7 Ox6f Oxc7 Oxd6 Oxe6 Ox6d 0x87 0x96 Oxa6 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 B 5 2014 by limes datentechnik gmbh Code Tables Appendix B fk open filename O CREAT O WRONLY O TRUNC if fk 1 perror Open file exit 1 status chmod filename S IWUSR S IRUSR S IRGRP S IROTH if status 1 perror chmod exit 1 status write fk ebcdic 256 if status 256 perror Write error status close fk exit 0 B 6B 6B 6 B 6 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh
10. Affected files Input file Output file FLAMFILE Parameter file Message filei Code table Default values Messages Origin of error FLAM message I O function message A 11 2014 by limes datentechnik gmbh FLAM UNIX User Manual Appendix B Code Tables B Code tables If you need to exchange files between systems which use different character sets you can ask FLAM to convert your data to the desired codes automatically by specifying the parameter translate code table You must make a translation table available to FLAM in order to do so This chapter describes how to generate a code table B 1 Structure of code tables FLAM reads the first 256 bytes of the file you have specified as a code table These 256 bytes form a string which is used by FLAM as a translation table The numeric value of the code for each character of the original data is taken as an index for the translation table and replaced by the corresponding table element The possible value range of this numeric value is 0 255 decimal which corresponds to table positions 1 256 The following code table can be generated for example in order to convert EBCDIC coded text data to ASCII code for the decompression procedure Example B 1 Contents of a code table KKK KKK KKK KKK KR EK ke KKK ke ee ke KKK RRR KEK KKK KKK KKK KKK RRR KKK ko kk e ke ke ke ke ke ke ke k k FOI III de e eke ok II Deko III III FO DI III IO ek Token abcdefghi
11. flmid returncode user_attr_length user_attributes Dependencies Return codes FLAM V4 3 UNIX Frankenstein Limes Access Method The Record Interface The flmpuh put user header function enables additional information with any structure to be saved in the FLAMFILE This information is inserted in the form of a string and can be made available during the decompression procedure with flmguh the complementary function The flmpuh function is only allowed during the compression procedure and immediately following an flmphd call void flmpuh char flmid long returncode long user attr length char user attributes The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program This argument passes the length of the user specific header maximum length 32732 bytes This argument specifies a memory area containing the user specific header the contents of which can be freely defined by the user flmpuh may only be called at compression It may be used only immediately after flmphd and is mandatory when a Secure FLAMFILE is being created A description of the return codes can be found in Appendix A Return codes 4 25 2014 by limes datentechnik gmbh The Record Interface Chapter 4
12. inrecformat format option Meaning EAF data variable record size with a 4 byte size field in ASCII or EBCDIC code The record size only specifies the length of the data excluding the size field The size field is part of the data Fixed record size as set by inrecsize Variable record size max 2048 characters with record delimiter Typically text data Records with no defined structure records of an identical size are read with the possible exception of the last one Variable record size with 2 byte binary record size includ ing length field Variable record size with 2 byte binary record size includ ing length field Variable record size with 2 byte binary record size not in cluding length field Variable record size with 4 byte binary record size includ ing length field host Variable record size with 4 byte size field in ASCII code including length field Variable record size with 4 byte size field in EBCDIC code including length field This parameter specifies the record format of the original file The data is read from the file in the form of logical records with the specified format FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 The flam Command inrecsize This parameter specifies the record size of the original file Syntax inrecsize n Values n Integer number between 1 and 32760 Description This parameter specifies the record size of original files with a fix
13. As a general rule the efficiency of the compression procedure increases the more records are compressed together in the same block If there are no other factors which need to be taken into account it is normally best to choose the highest possible number 255 or 4095 resp This preset number is however merely an upper limit There may be fewer records if the space in the matrix buffer is exhausted or if the end of the original file is reached The size which must be set for the matrix buffer is dependent on the number and size of the records that need to be buffered The space requirement for files with fixed size records is calculated simply as the product of the number of records and the record size If the files have a variable record size it is not normally possible to predict the memory requirement exactly The value which is chosen is bound to be approximate However the matrix buffer must always be at least large enough to hold every individual record in the file 1 5 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh FLAM Overview 1 61 6 1 61 6 Frankenstein Limes Access Method Chapter 1 1 4 The FLAMFILE 1 4 1 Structure of the FLAMFILE In order to achieve the aim of universal interchangeability the structure of the FLAMFILE must be such that it can be represented in any operating system This least common denominator is the sequential file with fixed size records Although other FLAMFI
14. Chapter 1 FLAM V4 3 UNIX datentechnik gmbh The FLAM modes aes and flamenc respectively correspond to these two combinations None of the other compression methods allows encryption In all binary modes the compressed information is largely independent of the characteristics of the system on which the compression took place i e the FLAMFILEs must not be modified for example if they are transmitted on a line which translates codes automatically FLAMFILEs which are compressed in the cx7 mode on the other hand are insensitive to code translations since they represent all control information by means of alphanumeric characters the codes for which are standardized internationally in the ASCII and EBCDIC systems Providing the original data is character coded and suitable for exchange between systems with different character sets the information content of the FLAMFILE remains fully intact after it has been converted to the character set of the destination system despite the altered binary contents thanks to the character oriented interpretation The compression mode is identified automatically when the file is decompressed The user thus does not need to know the compression mode in order to decompress a file 1 3 Matrix Buffer and Number of Records The size of the matrix buffer and the number of records which are stored there can be specified for the compression procedure using the maxbuffer and maxrecords parameters
15. Contents 7 2 3 Several Files into Several Separate Files 7 4 7 3 Decompressing 7 4 7 3 1 One File into One File 7 4 7 3 2 One Compressed File Comprising Several Original Files into Separate Files Each Identical to One of the Original Files 7 4 7 3 3 Several Files into one File 7 4 7 3 4 Several Files into Several Separate Files 7 5 7 4 How to Use a Parameter File 7 5 7 5 How to Use the Subprogram Interface 7 6 7 6 How to Use the Record Interface 7 9 7 6 1 Compressing a File 7 9 7 6 2 Decompressing a File 7 14 7 7 User Defined Input Output 7 19 7 7 1 Opening a File 7 19 7 7 2 Reading a File 7 22 7 7 3 Writing a File 7 23 7 7 4 Closing a File 7 24 7 8 User Exits 7 25 7 8 1 Selecting Records of a Particular Type from a File with exk10 and Compressing Them 7 25 7 8 2 Processing Records in a Compressed File with exd10 7 26 7 8 3 Swapping Two Bytes with exk20 during Compression 7 27 7 8 4 Swapping Two Bytes with exd20 during Decompression 7 28 7 8 5 Automatic Key Management Function 7 29 Return Codes A 3 Code Tables B 3 vii 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 1 FLAM Overview 1 FLAM Overview FLAM is an implementation of the FLAM algorithms for computers running under the UNIX operating system Its purpose is to compress and decompress files in a format that allows easy exchange of data with numerous computer types from a wide range of manufacturers Moreover it offers the
16. Record counter unsigned long zunkb Byte counter unsigned long zunkbofl Byte counter overflow Exit FLAM flmcls flmid amp il amp cputime amp zunks amp zunkb amp zunkbofl amp zks amp zkb amp zkbof1 Output statistics if il FLAM NORMAL printf nNo of non compressed records d n zunks printf No of non compressed bytes d n zunkb printf nNo of non compressed records d n zks printf No of non compressed bytes d n zkb if rc FLAM NORMAL rc il Convert return put flmsg rc exit rc FLAM V4 3 UNIX 7 19 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 7 User Defined Input Output The examples below describe the interfaces for the user defined input and output functions The calls the necessary parameters and the possible values are specified for each function Input and output errors are not shown 7 7 1 Opening a File Open a file to read or write user io include flamincl h void usropn workio retco openmode linkname fcbtype recform recsize blksize keydesc device recdelim padchar prertl closdisp access namelen filename FLAM PPCHAR workio File ID FLAM PLONG retco Return code FLAM PLONG openmode Processing mode 0 input seq read 1 output seq write 2 inout read and write with key existing file 3 o
17. default specification Default specifications always consist either of a keyword or of a keyword with an assigned value With only a few exceptions the keywords are identical to the parameters of the flam command and the assigned values are subject to the same syntax as for these parameters Where the default specifications described below include references to the corresponding parameters their syntax and meaning can be taken from the descriptions of these parameters This specifies how individual ASCII characters are to be converted to EBCDIC code Translation options have the following format ascii code ebcdic code ascii code and ebcdic code are the codes for the ASCII character which must be converted and for the EBCDIC character which must be inserted they are both specified in the form of a hexadecimal number between 00 and ff Example defaults ascii_ ebcdic 41 81 causes each ASCII A to be converted to an EBCDIC a during a compression procedure for which translate e a has been specified See description of the attributes parameter Note It is advisable to set attributes all as the default value to ensure that FLAMFILES which have been created using the default values and which contain compressed versions of several original files can be decompressed into individual files again with the original names and the original attributes such as the record format Otherwise this information will be lost when the
18. flmid The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done returncode This argument returns a return code to the invoking program record length This argument returns the length of the record which has been read in bytes record This argument is the record buffer buffer length This argument contains the length of the record buffer in bytes Dependencies flmget may only be used at decompression With encrypted FLAMFILEs a password must be provided via flmpwd before the first invocation of flmget Return codes A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 4 11 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Record Interface Chapter 4 flmghd flmghd get file header allows retrieving the file attributes of the original file during decompression if they were stored in the FLAMFILE during compression If the FLAMFILE contains several file headers see flmphd the last file header found by FLAM is transferred with flmghd Syntax void flmghd char flmid long returncode long filename_length char filename long organization long record_format long record size char record delimiter struct kd key description long block size long print control char system Arguments flmid The conte
19. logging in the message file does not begin until after the syntax and compatibility of the FLAM settings specified in the command have been checked Error messages concerning syntax errors missing files or invalid settings are not logged In such cases FLAM stops processing without creating a message file FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 ndc Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter can be used in adc mode to suppress compression ndc None For data that is known to compress badly FLAM s performance can be improved by this parameter which suppresses compression With modes aes and flamenc only encryption is done while with mode adc this parameter causes FLAM to simply copy the data With other modes ndc has no effect FLAMFILEs created with ndc are always Secure FLAMFILEs and are logged as adc compressed files at decompression ndc cannot be set as default 2 29 2014 by limes datentechnik gmbh The flam Command nopath Syntax Values Description 2 302 302 302 30 Chapter 2 This parameter suppresses including information on the directory path of the original file in the compressed data nopath None When compressing with attributes all FLAM stores the entire absolute path name of the original file in the compressed file s file header Trying to create a file with
20. msglen Upon return to FLAM this argument indicates the byte length of the string in the message argument Maximum is 128 bytes message The exit routine may put here a message text which will be output to the log file by FLAM Return codes Value Meaning 0 Success otherwise Error FLAM V4 3 UNIX 6 15 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The User Exits Chapter 6 6 2 2 Creating a Key Exit The key exit function may be given any valid function name The function must reside in a shared library which will be opened by FLAM at execution time For information regarding the generation of shared libraries please refer to the documentation of the compiler used 6 16 FLAM V4 3 UNIB316 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 7 Application Examples 7 Application Examples This chapter illustrates FLAM s applications with numerous examples These demonstrate the various options which are available for the flam command C programs and excerpts from C programs show how the program interfaces can be used in practice These examples are supplemented where necessary by instructions for linking the programs 7 1 Commands Only the parameters which are actually required are used in the examples If the values of the parameters are required to vary from the default values they must be specified explicitly 7 2 Compressing 7 2 1 O
21. password Syntax Values Description 2 382 382 382 38 This parameter is used to specify a password for encrypting or decrypting a FLAMFILE in aes or flamenc mode when compressed with mode adc password password The value for password can be entered in two formats As a simple character string In this format the password is entered immediately following the equal sign as a string of up to 64 characters Valid characters are all capital and small Latin letters decimal digits the minus sign and underscore _ Using any other characters may yield unpredictable results Note that capital and small letters are different characters Example password Alligator As a sequence of hexadecimal digits In this format the password may consist of an even number of up to 128 hexadecimal digits 0 9 a f A F In this context small and capital letters are interchangeable The sequence is enclosed in single quotes V and preceded by the letter X Any such combination is permitted Example passwordzXV416c6c696761746172NV FLAM uses the specified password during compression with mode adc to encrypt the compressed data and during decompression to decrypt the encrypted compressed data The passwords used at compression and decompression must be identical or else the decompression command is rejected with an appropriate error message With modes other than adc aes or flamenc this parameter causes an error When used wi
22. the desired substitution rule is actually applied to the suffix flam compress flaminzt dat flamfile dat cmp 7 3 Decompressing 7 3 1 One File into One File A file called test cmp is decompressed and the decompressed data is written in a file called test dat The compressed file may comprise one or more original files flam decompress flamfile test cmp flamout test dat 7 3 2 One Compressed File Comprising Several Original Files into Separate Files Each Identical to One of the Original Files A compressed file containing the data of several different original files each with a FLAM file header attributes all is decompressed The decompressed data of each original file is written in a file with the same name and the same attributes flam decompress flamfile test cmp flamout 7 3 3 Several Files into One File All the files which match the search pattern t cmp are decompressed and the decompressed data is written in a file called test dat flam decompress flamfile t cmp flamout test dat FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 7 FLAM V4 3 UNIX Frankenstein Limes Access Method Application Examples 7 3 4 Several Files into Several Separate Files All the files which match the search pattern t cmp are decompressed The decompressed data of each file is written in a separate file which is given the same name and a dat suffix flam decompress flamfilezt
23. A 5 2014 by limes datentechnik gmbh Return Codes Return Code 56 57 59 60 65 70 71 72 73 74 81 A 6A 6A 6 A 6 Frankenstein Limes Access Method Appendix A Symbolic Name Meaning FLAM FILEHEADER GR 32KB Meaning File header of compressed file longer than 32 KB FLAM KOMP LENGTH Meaning Compressed file length invalid FLAM ERR NONDC Meaning ndc only allowed with adc aes or flamenc FLAM SYNTAX Meaning Error in compressed file FLAM CONS RECORD Meaning Consistency point invalid FLAM NOT VALID VERSION Meaning FLAM compressed file is not Version 2x FLAM FL CUT Meaning Decompressed record cut flamup error FLAM RECORD CUT Meaning Decompressed record s cut warning from flamup FLAM ERR KOMP LENGTH Meaning Wrong length of compressed data FLAM CHECK CHARACTER Meaning Check character error FLAM PARAM ERR Meaning Unknown parameter qualifier FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Appendix A Return Code 82 85 87 88 90 92 98 99 101 102 271 FLAM V4 3 UNIX Frankenstein Limes Access Method Return Codes Symbolic Name Meaning FLAM_PARAMETER_VALUE Meaning Parameter value invalid FLAM_SAME_NAME Meaning Same name for input and output files FLAM NO INPUT FILE Meaning Input file has no name FLAM NO OUTPUT FILE Meaning Output file has no name FLAM QUALIFIER VALU
24. Access Method 2014 by limes datentechnik gmbh Appendix B Example B 2 ASCII EBCDIC translation table Example ASCII EBCDIC translation table include lt stdio h gt include lt sys types h gt include sys stat h include lt errno h gt include fcntl h extern int errno extern int sys_nerr main int status unsigned long fk static char filename 20 code_ae dat static char ebcdic 256 0x00 0x01 0x02 0x16 0x05 0x25 0x10 0x11 0x12 0x18 0x19 Ox3f 0x40 Ox5a Ox7f Ox4d Ox5d Ox5c Oxf0 Oxf1 Oxf2 Oxf8 Oxf9 Ox7a Ox7c Oxcl Oxc2 Oxc8 Oxc9 Oxdl Oxd7 Oxd8 Oxd9 Oxe7 Oxe8 Oxe9 Ox4a 0x81 0x82 0x88 0x89 0x91 0x97 0x98 0x99 Oxa7 Oxa8 Oxa9 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 FLAM V4 3 UNIX Frankenstein Limes Access Method 0x03 OxOb 0x13 0x27 Ox7b Ox4e Oxf3 Ox5e Oxc3 Oxd2 Oxe2 Oxbb 0x83 0x92 0xa2 Oxfb 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x37 0x0c 0x3c oxic Ox5b Ox6b Oxf4 Ox4c Oxc4 Oxd3 Oxe3 Oxbc 0x84 0x93 0xa3 Ox4f 0x00 0x00 0x00 0x00 0x00
25. can be invoked with the flam command File compression with or without encryption using the compress parameter File decompression with decryption if needed using the decompress parameter e Modification of installation specific default values using the defaults parameter e List of installation specific default values using the list parameter When the flam command is invoked all the necessary information can be specified at different levels namely explicitly in the command itself in a parameter file or implicitly by means of default values The description of the command syntax below sets out the logical relationships between the syntax elements in other words between the parameters and their arguments irrespective of the level at which they are actually specified The classification of the syntax elements in this chapter as either mandatory or optional applies to this FLAM check The syntax rules consequently refer to all the settings together and not simply to the inputs in the command line Other than in relation to the priority rules the specification level is therefore not relevant to the syntax description Thus where the explanations below refer to parameters they apply equally irrespective of whether they are taken to mean the flam command the parameter file or the default values Explicit reference is made to exceptions When the flam command is entered either upper or lowercase notation can be
26. cmp flamout cmp dat It should be noted in this connection that all the compressed data in a single FLAMFILE is also decompressed into a single file If attributes all was specified for the compression procedure the following decompress command flam decompress flamfile t cmp flamout can be used to create decompressed files with the original names and the original attributes 7 4 How to Use a Parameter File The FLAM parameters do not necessarily need to be specified directly in the command They can also be entered in a parameter file which is then specified in the command instead flam parfile param dat The file called param dat contains the following parameters For compression flamin test dat flamfile test cmp comp For decompression flamfile test cmp flamout test dat decomp 7 5 2014 by limes datentechnik gmbh Chapter 7 7 67 67 67 6 Frankenstein Limes Access Method Application Examples 7 5 How to Use the Subprogram Interface Files can be compressed in a user program and decompressed again by means of the flamup subprogram interface The call in a C user program is as follows flamup id rc par string parlen id is the address of a 4 byte long field rc is the address of a 4 byte long numeric field which contains the return code after flamup has been executed par string is the address of a string which contains the parameters parlen is the address of a 4 byte long nu
27. compression this argument specifies the maximum buffer size which is to be used This information is returned as a number of bytes during decompression The buffer size is specified in either bytes or Kbytes All values between 1 and 2 621 440 are valid Details on how this value is interpreted and the buffer sizes actually used are found in the description of the maxbuffer parameter in section 2 3 Implicit value at compression 32 Kbytes fileheader During decompression the information returned by this argument indicates whether or not the FLAMFILE contains a FLAM file header This determines whether or not a subsequent flmghd call is meaningful The argument is not used during the compression 0 No FLAM file header 1 FLAM file header Implicit value at compression 0 max records During compression this argument specifies the maximum number of records which are to be used per matrix This information is returned during decompression Implicit value at compression 255 FLAM V4 3 UNIX 4 19 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Record Interface Chapter 4 key_description This argument is reserved for future extensions block_mode This argument is reserved for future extensions exitroutine_comp This argument contains the name of a user exit in other words an executable program which is invoked each time the FLAMFILE is accessed during compression This program must be linked to
28. containing the C constant definitions is provided for C programmers 1 9 2014 by limes datentechnik gmbh FLAM Overview 1 101 101 101 10 Frankenstein Limes Access Method Chapter 1 However these interfaces do not support C programs only Rather they can be used with any programming language since all arguments are referenced by addresses instead of the typical C referencing by values Even though in a strict C context a name without an operator still identifies the argument address with this form of transfer all references to such arguments in the descriptions below in fact relate to the argument values 1 5 1 The flam Command The flam command can be used to compress or decompress individual files or groups of files either interactively or by means of procedures The compress or decompress parameter specifies which operation is to be performed All the information necessary to execute the command can be specified in the form of inputs made directly in the command line in a parameter file or as installation specific default values If the flam command is specified with the list parameter a list of the currently active settings of the default values is displayed they can be modified by the system manager using the defaults parameter The flam command permits a separate FLAMFILE to be created from each original file It is also possible to compress a group of original files into one FLAMFILE The input fil
29. decompressed files are derived from the FLAMFILE provided the FLAMFILE actually contains them If not an error message is output attributes all must be specified for the compression procedure in order to include the names of the original files in the FLAMFILE 2 47 2014 by limes datentechnik gmbh The flam Command 2 482 482 482 48 Frankenstein Limes Access Method Chapter 2 If the output specification is the effect is similar to the output specification i e the names of the decompressed files are derived from the FLAMFILE s except that only the file name is taken into account The path name is ignored All the files are thus created in the current directory if no outpath specification is given Once again attributes all must have been set for the compression procedure The output specifications file name and must not be part of a list of output specifications i e they must stand alone If the output specification specifies files for processing by FLAM either the flamfile parameter or flamout must be specified for the compression or decompression procedure respectively If the data is to be output to the special file stdout the parameter for the output specification must be omitted FLAM can thus be used as a filter 2 4 3 Assignment of Input Specifications to Output Specifications If the flam command contains several different input and output specifications they are assigned
30. default values are used and it will not be possible to reconstruct the origin of the files again later on See description of the compress parameter 2 11 2014 by limes datentechnik gmbh The flam Command decompress ebcdic_ascii translation option flamcode character set flamfile file specification flamfile none flamin input specification flamin none 2 122 122 122 12 Frankenstein Limes Access Method Chapter 2 See description of the decompress parameter This specifies how individual EBCDIC characters must be converted to ASCII codes Translation options have the following format ebcdic_code ascii_code ebcdic code and ascii code are the codes for the EBCDIC character which must be converted and for the ASCII character which must be inserted they are both specified in the form of a hexadecimal number between 00 and ff See description of the flamcode parameter This defines the default name for the FLAMFILE The file specification must name a single file uniquely it must not contain any patterns nor must it be specified as a substitution rule Note that when a default name is defined stdin stdout and pipelines can no longer be used for flamfile With flamfile none the default value for this parameter is dropped This file name is the default value for the output file during the compression procedure and the default value for the input file during the decompression procedure The charac
31. flmid amp rc amp cputime amp zunks amp zunkb amp zunkbofl amp zks amp zkb amp zkbof1 Output statistics printf nNo of non compressed records d n zunks printf No of non compressed bytes d n zunkb printf nNo of non compressed records d n zks printf No of non compressed bytes dWMn zkb if rc FLAM NORMAL closinput rc infile Close original file rc fclose infile return rc Close files exit program FLAM V4 3 UNIX 7 13 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples void closfiles unsigned long rc FILE infile char flmid long il unsigned long cputime CPU time unsigned long zks Record counter unsigned long zkb Byte counter unsigned long zkbofl Byte counter overflow unsigned long zunks Record counter unsigned long zunkb Byte counter unsigned long zunkbofl Byte counter overflow Exit FLAM flmcls flmid amp il amp cputime amp zunks amp zunkb amp zunkbofl amp zks amp zkb amp zkbof1 Output statistics if il FLAM NORMAL printf nNo of non compressed records d n zunks printf No of non compressed bytes d n zunkb printf nNo of non compressed records d n zks printf No of non compressed bytes d n zkb closinput rc infile Close original file exit program void clo
32. has a fixed record format and a record size of 1 024 and contains all the compression information so that it can be decompressed in the same environment without having to specify the decompressed file FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 The flam Command FLAM V4 3 UNIX The same FLAM parameters can also be arranged as follows compress mode cx8 maxbuffer 128 flamin test dat flamfile flamfilel cmp recformat fix recsize 1024 attributes all In this case the output on the screen will be as follows FLAM R 4 2 0 for Linux copyright c 2012 by limes datentechnik gmbh Start 06 08 2006 15 35 07 compress m de maree e heces SP aere desea e acd e d dag adc nlaxDiutfetft iq ln ee c poke EE EIE 65 536 MAXKECOTAS ahs bce ies Sa Ss ba Ue SR S 4 096 ELAMCOAS scsi iets wu Ex es LE ae ker ASCII ditrrbutes cipe eR inset aie ie all Name of original file path001 test dat inrecformat stream inrecdelim x 0a Number of uncompressed records 778 Number of uncompressed bytes 26 947 Name of compressed file flamfilel cmp re cformat xs fix IeGCSLZze 44 Bucy ePEG 1 024 Number of compressed records 14 Number of compressed bytes 7 168 Compression efficiency 73 4 CPU time used sec 0 0 2 53 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The flam Command 2 542 542
33. messages in accordance with the meanings listed in Appendix A Return Codes The internal message routine of the flam command can be used alternatively if desired with the FLAM table instead of a separate table with error texts The call to output an error message with the tables used internally by FLAM is put flmsg return code The definitions used by FLAM in particular those of the symbolic names for the various return codes are contained in the C header file usr include flamincl h Application programs which are written in other programming languages require these definitions to be translated to the appropriate language by the programmer FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 3 The flamup Subprogram Call 3 2 FLAM Parameters in the flamup Subprogram Call The parameter_string argument of the flamup subprogram call may contain all the parameters which are valid for the flam command with any of their valid values The special rule which applies when lists of file names are specified should be noted The individual file names must be separated by a comma and enclosed in parentheses for the parameter concerned Example FLAM file1 file2 filen In addition to the parameters which are valid for the flam command the subprogram call may contain the FLAM parameters for the user input output routines see also chapter 5 and the user exits see also chapter 6 The following user i
34. pwd_length This argument contains the password s length in characters pwd This argument is the buffer containing the password string Dependencies flmpwd may only be used when compression or decompression is done with encryption decryption Return codes A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 4 27 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Record Interface Chapter 4 4 5 Linking Record Interface Functions to Application Programs FLAM s record interface is installed in two prelinked modules namely flam rec o and flam recu o The flam rec o module contains the dummy functions for the user input output and the user exits The flam recu o module contains no user input output routines and no user exits The record interface must be linked to the user program xyz with the following command ld o xyz usr lib flame flam rec o xyz c lc If the user wishes to use his own exits and or his own input output routines they must be linked to the application program In this case the flam recu o module must be used instead of flam rec o It should be noted that all the user exits and or input output routines must be generated by the user and not just certain ones If the user wants to use just his own exits or just his own input output routines he can link the dummy routines flam usrmod o and flam exitmod o which are installed in usr lib flame for the ot
35. reading the file s structural information is preserved which is of great importance for reproducing the original file in computing environments with data management systems Depending on the compression mode each record in the FLAMFILE is given either a binary checksum or a check character which is used to verify the integrity of the data when the file is decompressed The FLAMFILE can be saved or exchanged with another computer When the file is decompressed it may have a different organization a different record format or a different record size from the original file depending on the settings entered by the user or on the default settings 1 2 FLAM Modes FLAM supports four compression modes adc cx7 cx8 and vr8 In the adc cx8 and vr8 modes it creates the FLAMFILE as a binary file Mode adc is the most efficient one lt compresses the datastream by removing the redundancy of repetitive sequences and can be used universally The other modes mainly eliminate vertical redundancy i e their efficiency relies on the recognition of re occurring column contents in table structured data Compression mode adc can be combined with one of two encryption methods supported by FLAM The first is AES that has been declared standard for US government agencies by NIST National Institute of Standards and Technology the second is a proprietary algoriths of limes FLAM V4 3 UNIX 2014 by limes datentechnik gmbh FLAM Overview
36. record pointer 15 record pointer 15 record pointer 16 record pointer 16 work return 7 287 287 287 28 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 8 4 Swapping Two Bytes with exd20 during Decompression The bytes which were swapped with exk20 during the compression procedure are returned to their original positions see section 7 8 3 The program is the same as for compression with exitk20 Example of exitd20 Swap two bytes during decompression procedure Same program as for compression with exitk20 exd20 functioncode returncode record pointer record length work long functioncode Function code long returncode Return code char record pointer Record pointer long record length Record length char work Work area returncode 0 No errors transfer record if functioncode 0 functioncode 8 return if record length 16 Swap bytes 16 and 17 work record pointer 15 record pointer 15 record pointer 16 record pointer 16 work return FLAM V4 3 UNIX 7 29 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 8 5 Automatic Key Management Function When using encryption decryption the kmexit parameter can be used to make FLAM activate a function
37. that automatically generates or retrieves the required passwords Such a function as a C language program might look like this include lt stdio h gt include lt stdlib h gt include lt time h gt include lt sys types h gt include sys stat h define KMX KEY LENGTH 8 define KMX ID INFO OxFFFFFFFF define KMX_ENCRYPT 1 define KMX_DECRYPT 0 void samplexl RRR RK KKK KR KK KKK KKK KR KKK KKK KKK KEK KK KKK KKK KKK KKK KKH f To generate a password fuco 1 this exit signed long fuco routine randomly positions into a text file signed long retco and extracts a string of length 8 It passes unsigned long parmlen back the string in cryptokey and the blurred unsigned char param random position in data unsigned long datalen To retrieve a password fuco 0 the read unsigned char data position is derived from data and the string unsigned long ckylen found there is passed back in cryptokey unsigned char cryptokey With fuco 1 only a text line identifying unsigned long msglen the routine is passed back in message unsigned char message RRR ek He e hee KK KKK KKK he ee He e de He e e He ke ke e He ke ke e ee ke ke e ke k kk k f const char exit id Key Management Exit Version 1 0 0 const char ffkmx flam ffkmx const char errmsgl Can t get info on file flam ffkmx const char errmsg2 Can t open file flam ff
38. the command string passed to flamup must contain kmexit samplex1 libuserex For encryption compression a password is then generated automatically and passed to FLAM along with the information required to retrieve that password FLAM stores this information in a user specific file header For decryption decompression FLAM passes this information back to this function and receives in return the matching password FLAM V4 3 UNIX 2014 by limes datentechnik gmbh FLAM UNIX User Manual Appendix A Return Codes Return Code 10 A Return Codes Symbolic Name Meaning FLAM_FCT_NOT_EXIST Meaning Function not available not allowed does not exist changed by flamup to 999 FLAM_NORMAL Meaning No errors FLAM_RECORD_SHORTENED Meaning Decompressed record shortened record interface warning FLAM_EOF Meaning End of file FLAM_RECORD_LENGTHENED Meaning Decompressed record s lengthened FLAM NEW FILE Meaning Start of new file FLAM NO PW Meaning Password must be specified FLAM NO FILEHEADER Meaning No file header FLAM NOT FLAMFILE Meaning File is not a FLAMFILE Return Codes Return Code 11 12 13 14 15 16 17 20 22 25 26 A 4A 4A 4 A 4 Frankenstein Limes Access Method Appendix A Symbolic Name Meaning FLAM_FLAMFILE_FORMAT_ERROR Meaning FLAMFILE formatting error FLAM_FLAMFILE_RECORD_SIZE Meaning Invalid record size for
39. the original path at decompression may cause problems on systems with a different directory structure or file naming syntax With the nopath parameter only the filename proper is stored while the directory path is discarded When decompressing files compressed with nopath using flamout has the same effect as flamout nopath cannot be set as default FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 2 option Syntax Values FLAM option cut nocut suppress nosuppress Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter controls FLAM s behaviour when decompressed records are output option FLAM option FLAM option Meaning Records with a length greater than the maximum record size are truncated Records with a length greater than the maximum record size are not truncated Blank space at the end of a record is suppressed Blank space at the end of a record is not suppressed During the decompression the record format and size of the decompressed file can either be specified explicitly or adopted from predecessor versions so that the maximum record size is less than in the original file If the cut option is specified the decompression continues and any records which are too long are truncated to the maximum size If nocut is specified decompression is aborted and an error message
40. the transferred arguments This section describes the data type and the semantics of the arguments In real applications the call must be adapted to the syntax of the respective programming language In C the arguments follow the name flamup they are enclosed in parentheses and separated by commas The flamup Subprogram Call Chapter 3 flamup Syntax Arguments flamid returncode parameter_string string_length Return Codes 3 43 43 4 3 4 Frankenstein Limes Access Method The flamup interface provides application programs with the functionality of the flam command User I O and user exits are supported in addition void flamup char flamid unsigned long returncode char parameter string long string length Specifies a long integer 4 bytes which is used internally by FLAM during execution to identify the file Specifies a long integer 4 bytes which is used by flamup to return a return code to the invoking program Specifies a string containing the FLAM parameters which must be used see section 3 2 FLAM parameters in the flamup subprogram call The individual FLAM parameters are separated by commas Specifies a long integer 4 bytes containing the length of the parameter string argument in bytes Maximal length is 512 bytes A description of the return codes can be found in Appendix A Return Codes Application programs can convert the return codes which are returned by flamup to error
41. used as the final function call of an open sequence in other words only after flmopd if this is invoked or only after flmopn if it is not void flmopf char flmid long returncode long flam version long flam code long comp mode long max buffer long fileheader long max recoras struct kd key description long block mode char exitroutine comp char exitroutine decomp The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program The value of this argument must always be 2 During compression this argument specifies the character set which must be used to write the character coded information in the FLAMFILE This information is returned during the decompression procedure 0 EBCDIC 1 ASCII Implicit value at compression 1 FLAM V4 3 UNIX318 2014 by limes datentechnik gmbh Chapter 4 The Record Interface comp_mode During compression this argument specifies which compression and or encryption method to apply This information is returned at decompression The following hexadecimal decimal values are permitted Encryption method Compress not permitted not permitted not permitted not permitted 0 19 35 Implicit value at compression 0 max_buffer During
42. which were created during the compression procedure or read during the decompression procedure This value is only significant if complete files are processed 4 9 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Record Interface Chapter 4 cmpbytes If statistical information has been requested with flmopn statistics 0 this argument returns the number of bytes which were created during the compression procedure or read during the decompression procedure This value is only significant if complete files are processed cmpbytofl If the accumulated value of the cmpbytes argument exceeds 2 000 000 000 this counter is used for multiples of 2 000 000 000 Dependencies When compressing Secure FLAMFILEs flmflu is permitted only after flmpuh or flmput When decompressing Secure FLAMFILEs flmflu must be preceded either by flmget flmghd or flmguh Return codes A description of the return codes can be found in Appendix A Return codes 4 10 FLAM V4 3 UNI310 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 4 The Record Interface flmget The flmget get record function reads the next original record sequentially The data is transferred to the record buffer of the invoking program A special return code indicates when a new file header is encountered Syntax void flmget char flmid long returncode long record length char record long buffer length Arguments
43. 1 4 1 5 1 6 1 6 1 7 1 8 1 9 1 10 1 11 1 11 1 12 1 14 1 14 2 3 2 4 2 5 2 6 2 7 2 7 2 7 2 8 2 9 2 10 2 11 2 15 2 16 2 17 Contents 2 4 2 4 1 2 4 2 2 4 3 2 5 2 6 2 7 2 8 iviviviv Frankenstein Limes Access Method flamout inrecdelim inrecformat inrecsize kmexit list maxbuffer maxrecords mode msgfile ndc nopath option outpath outrecdelim outrecformat outrecsize pad char parfile password recdelim recformat recsize show translate File Specifications Input Specifications Output Specifications Assignment of Input Specifications to Output Specifications Priority Rules for FLAM Settings The FLAM Parameter File The FLAM Default Values Alternative Parameter Names 2 18 2 19 2 20 2 21 2 22 2 23 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 40 2 41 2 42 2 43 2 46 2 47 2 47 2 48 2 49 2 51 2 53 2 55 2 56 FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 3 3 3 1 3 2 3 3 Chapter 4 4 4 1 4 2 4 3 44 4 5 FLAM V4 3 UNIX Frankenstein Limes Access Method Contents Calling flamup The flamup Calling Sequence FLAM Parameters in the flamup Subprogram Call exd10 exd20 exk10 exk20 inuser io outuser io User io Linking flamup The Record Interface Functions of the Record Interface Programming the Record Interface at Compression Pro
44. 542 54 Frankenstein Limes Access Method Chapter 2 2 7 The FLAM Default Values File The default values for the flam command are saved in the default values file flam def dat located in the lib subdirectory of the FLAM installation directory This file is given the following access rights rw r r It can be modified at any time by the system manager but not deleted The default value file can be modified using the flam command with the defaults parameter The settings in the default value file can be displayed using the flam list command No special privileges are necessary to do so When FLAM is invoked any setting not provided in the command line nor via a parameter file is derived if necessary from the default values file which contains the installation specific default values This is a binary file and may not be edited wit programs other than flam FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 The flam Command 2 8 Alternative parameter names Sometimes old parameters are replaced by new ones in order to make the most of FLAM s enhanced functionality while in other cases different system specific names are used to designate the same functions Both the old names and those used by other systems are allowed in addition to the parameter names specified here to ensure compatibility with Version 2 0 of FLAM for UNIX and with these other systems However it is always best to use the stand
45. Chapter 1 FLAM V4 3 UNIX Frankenstein Limes Access Method FLAM Overview they were compressed they can only be decompressed if the modifications are undone again by the complementary user exit exd20 i e if every FLAM record is reset by exd20 to the state in which it was originally transferred by FLAM at user exit exk20 1 5 5 2 User Exit for Automatic Key Management Automatic key management facilitates handling encrypted files by relieving the user from duties like generating exchanging and storing passwords in whatever way When invoking the key management exit routine for encryption FLAM also passes an optionally user supplied character string via the interface The exit returns a password which is used by FLAM for encrypting In addition the exit may also return a byte string that FLAM attaches to the encrypted FLAMFILE When decrypting FLAM passes this string back to the exit for the retrieval of the password This exit can be activated by the flam command or the subprogram interface It is not available via the record interface Programs invoked through these interfaces must be created as shareable objects and are linked dynamically see section 6 2 Note Throughout this manual the terms password and encryption key are used synonymously 1 15 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 2 The flam Command 2 The flam Command 2 1 Functions The following functions
46. E Meaning Qualifier value invalid FLAM NO REPLACING CHARACTERS Meaning Cannot substitute any characters in input file name FLAM READ ERROR Meaning Error occurred while reading a record FLAM WRITE ERROR Meaning Error occurred while writing a record FLAM NOT ALL INPUT FILES Meaning Some input files not processed FLAM ANZ OUTFILE GR INFILE Meaning Number of output files greater than number of input files FLAM ERR BAD KMEXIT A 7 2014 by limes datentechnik gmbh Return Codes Return Code 272 351 352 354 355 356 357 360 401 402 403 A 8A 8A 8 A 8 Appendix A Meaning Wrong specification of key management exit Symbolic Name Meaning FLAM ERR KMEX1 Meaning Error loading the key management exit FLAM SEC ERR 351 Meaning SECURITY Member number not contiguous FLAM SEC ERR 352 Meaning SECURITY Member trailer counters wrong AES MEM MAC Meaning AES Member MACs wrong AES_FIL_MAC Meaning AES File MACs wrong AES_CRC_SUFF Meaning Bad checksum in compressed data CRC Offs AES_CRC_5 Meaning Bad checksum in compressed data CRC 5 FLAM_ERR_REDUNDANT Meaning Parameter redundant or ambiguous FLAM_SEQ_OPD Meaning Wrong sequence in flmopd call FLAM_SEQ_OPF Meaning Wrong sequence in flmopf call FLAM_SEQ_PHD Meaning Wrong sequence in flmphd call FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes da
47. FRANKENSTEIN LIMES ACCESS METHOD for UNIX USER MANUAL October 2014 Version 4 3 Copyright 1989 2014 by limes datentechnik amp gmbh iUi Louisenstrasse 21 I D 61348 Bad Homburg v d H Phone 49 6172 5919 0 IB Fax 49 6172 5919 39 http Awww flam de User Manual FLAM V4 3 UNIX Copyright by limes datentechnik gmbh All rights reserved The reproduction transmission or use of this document is not permitted without express written authorization Offender will be liable for damages Delivery subject to availability right of technichal modifications reserved FLAM UNIX User Manual Contents Chapter 1 Chapter 2 Contents 1 1 1 2 1 3 1 4 1 4 1 1 4 2 1 4 3 1 5 1 5 1 1 5 2 1 5 3 1 5 4 1 5 5 1 5 5 1 1 5 5 2 2 1 2 2 2 2 1 2 2 2 2 2 3 2 2 4 2 3 FLAM Overview Mode of Operation Compression Modes Matrix Buffer and Number of Records The FLAMFILE Structure of the FLAMFILE The FLAM File Header Secure FLAMFILEs Interfaces The flam Command The flamup Subprogram The flamrec Record Interface The User Defined Input Output The User Exits File Access Exits User Exit for Automatic Key Management The flam Command Functions Command Syntax FLAM Compression FLAM Decompression Displaying the FLAM Default Values Setting the FLAM default Values flam Command Parameters attributes compress decompress defaults flamcode flamfile flamin 1 3 1 4
48. LAM NORMAL while il FLAM NORMAL datrec reclength 0x0a datrec reclength 0x00 ir fputs datrec outfile if ir reclength rc FLAM WRITE ERR closfiles rc outfile amp flmid Read decompressed record flmget amp flmid amp rc amp reclength datrec amp buflength if rc FLAM NORMAL if rc FLAM EOF il rc else closfiles rc outfile amp flmid Close decompressed file rc close outfile Exit FLAM flmcls amp flmid amp rc amp cputime amp zunks amp zunkb amp zunkbofl amp zks amp zkb amp zkbofl Output statistics printf nNo of non compressed records d n zunks printf No of non compressed bytes d n zunkb printf nNo of compressed records d n zks printf No of compressed bytes dWMn zkb put flmsg rc return rc Close decompressed file exit FLAM closfiles unsigned long rc FILE outfile char flmid long il Close decompressed file il close outfile closflam rc flmid 7 187 187 187 18 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples Exit FLAM exit program closflam unsigned long rc char flmid long il unsigned long cputime CPU time unsigned long zks Record counter unsigned long zkb Byte counter unsigned long zkbofl Byte counter overflow unsigned long zunks
49. LE record formats are allowed for the FLAMFILE in addition to the fixed format the compressed data which is generated by the compression procedure is broken down into abstract records known as FLAM records with an identical size these records are then mapped to the concrete structures of the installed operating system In addition to the compressed data each FLAM record contains a FLAM record size field at the beginning and either a checksum or a check character at the end The FLAM record size field and the checksum or the check character are elements of the FLAM syntax This permits the start and end of a FLAM record to be identified irrespective of the record format in which the FLAMFILE has been stored by the operating system In FLAM terminology a FLAM record is the same as a record if the FLAMFILE has fixed and variable record formats The specified FLAM record size is thus the same as the record size or the maximum record size The residual data in a compressed block belonging to a FLAMFILE is merged with the data in the next block to form a FLAM record with the fixed or maximum size With the possible exception of the final record all the FLAM records have the same length This enables optimum use to be made of the storage medium however it is not possible to assign the records of the original file to the records of a FLAMFILE uniquely A FLAMFILE of this type can therefore only ever be decompressed in its entirety FLA
50. M supports fixed and variable or stream record formats for the FLAMFILE Irrespective of the record format the minimum permissible size of a FLAM record is 80 bytes and the maximum size 32 760 bytes 4095 for mode cx7 providing a lower upper limit has not been set by the user This span is sufficient in practice to allow any FLAMFILE to be transferred even in situations where this would not necessarily be the case with the original file owing to restrictions imposed on the record size or the record format by the file transfer product Even though many data exchange problems can be eliminated to a greater or lesser extent with the FLAM concept there are some which still cannot be solved If a file is unsuitable for uncompressed transfer with a particular file transfer product for example on account of the binary data it contains it will still not be possible to transfer it after it has been compressed with FLAM even if it is compressed in the cx7 mode The reason for this is FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 1 FLAM V4 3 UNIX Frankenstein Limes Access Method FLAM Overview that every bit combination which occurs in the original file also occurs in the FLAMFILE 1 4 2 The FLAM File Header In addition to the compressed data a FLAMFILE may contain other information which is stored in the FLAM file header FLAM distinguishes between two information categories in two different types of file header
51. V4 3 UNIX 7 11 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples Open FLAM opmode FLAM_C_OPEN_OUTPUT Compress statis FLAM C STATISTIC Statistics lstpar FLAM C MORE PARAMETER flmopn amp flmid amp rc amp lstpar amp opmode kname amp statis if rc FLAM NORMAL closinput rc infile Specifications for compressed file orgak FLAM C ORG SEQ recfk FLAM C RECFRM FIX recsk 512 blksk 0 cldispk FLAM C CLOSE REWIND devk FLAM C DEVICE DISK keydesck keyparts 0 il 100 flmopd amp flmid amp rc amp lstpar amp il kname amp orgak amp recfk amp recsk recdelk c amp keydesck amp blksk amp cldispk amp devk if rc FLAM NORMAL closinput rc infile Compression specifications il FLAM C VERSION Version 2 flcode FLAM C CHAR ASCII Code of compressed file modus FLAM C MODUS CX8 EIGHT BIT mode maxb 32768 Buffer size sanz 255 No of records per block header FLAM C FILEHEADER File header blkmode FLAM C BLOCKMODE FLAMFILE blocking mode keydesco keyparts 0 exk20 0 No exit routine exd20 0 flmopf amp flmid amp rc amp il amp flcode amp modus amp maxb amp header amp sanz amp keydesco amp blkmode exk20 exd20 if rc FLAM NORMAL closinput rc infile Output file header namle
52. ard parameter names where possible Parameter name Alternative name attributes no header no attributes common attributes all fileinfo header yes decompress uncompress flamcode character_set inrecdelim in_format recdelim irecdelim irdelim indelim inrecformat in format informat irformat irecformat inrecsize in_format record format insize irsize irecsize maxbuffer buffer_size maxrecords records in buffer msgfile messages message file log FLAM V4 3 UNIX 2 55 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The flam Command 2 562 562 562 56 Parameter name mode cx7 mode cx8 mode vr8 mode adc option cut option nocut outrecdelim outrecformat outrecsize parfile show no show error show attributes show all translate Chapter 2 Alternative name Cx7 seven bit cx8 eight bit vr8 adc cut nocut out_format recdelim orecdelim ordelim outdelim out format orecformat orformat outformat out_format record format orecsize orsize outsize parameter_file info no info hold info yes code_table FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 3 The flamup Subprogram Call 3 Calling flamup 3 1 The flamup Calling Sequence The application programs invoke the flamup subprogram in order to compress or decompress one or more files in accordance with
53. argument see separate description of return codes and their meanings This argument contains a pointer to a character string The pointer is 4 bytes long and thus corresponds to a long integer If a call is specified with function code 4 it contains the address of the record in the FLAMFILE which must be written If a call is specified with function code 4 this argument contains the length of the record which must be written This argument is a 1 Kbyte area which is made available by FLAM as a work area each time the user exit is invoked and which is not altered by FLAM between the calls When it is invoked for the first time function code 0 the name of the file is at the start of the area and the remainder of the area is initialized with binary zeros 6 11 2014 by limes datentechnik gmbh The User Exits Chapter 6 Return codes Value Meaning 0 Transfer record or no errors 4 Don t transfer record 8 Insert record The buffer address and the length of the record which is to be inserted must be returned in the record_pointer and record_length arguments The user exit is invoked again for the original record During the decompression procedure records which have been inserted in this way must be removed again by means of a complementary user exit 12 Terminate compression procedure 16 Error in user exit abnormal termination 6 12 FLAM V4 3 UNIE312 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh C
54. at option fix var stream Description 2 402 402 402 40 Frankenstein Limes Access Method Chapter 2 This parameter specifies the record format of the FLAMFILE recformat format option format option Meaning Fixed size records size as set by the recsize parameter Variable size records the record size field is 2 bytes long Variable size records with a record delimiter The FLAMFILE always contains records of identical size In the cx8 and vr8 modes the records can be written either with variable or without fixed a record size field The stream record format is used in the cx7 mode If recdelim is not specified OxOa is used as the default record delimiter recformat need only be specified for the compression procedure FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 recsize Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies the record size of the FLAMFILE recsize n n Integer number between 80 and 32760 for all modes except cx7 Integer number between 80 and 4095 for the cx7 mode This parameter specifies the record size of the FLAMFILE The compressed data is always written in records of the same size irrespective of the record format There is no relationship between the compressed blocks and the records in the compressed file A record may contain data pertaining to one or more compres
55. bytes Application Examples of record buffer in bytes 7 23 2014 by limes datentechnik gmbh Chapter 7 Write file user io include flamincl h void usrput workio FLAM PPCHAR workio FLAM PLONG retco FLAM PLONG reclen FLAM PPCHAR record retco 0 Write record aden return 7 247 247 247 24 Frankenstein Limes Access Method retco 7 7 3 Writing a File reclen record File ID Return code Record length in bytes Record Application Examples FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 7 7 7 4 Closing a File Close file user_io include flamincl h void usrcls workio retco FLAM PPCHAR workio File ID FLAM PLONG retco Return code retco 0 Close file ende return FLAM V4 3 UNIX Frankenstein Limes Access Method Application Examples 7 25 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 8 User Exits 7 8 4 Selecting Records of a Particular Type from a File with exk10 and Compressing Them FLAM reads the records in a file and transfers them to exk10 for processing The record type 1st character in the record is verified by exk10 Records whose type is 1 are returned to FLAM for compression returncode 0 all other records are not processed any further returncode 4 Select records of a particular type fr
56. cked 1 32767 negative use system specific attributes if open output sattrlen not equal to 0 Key description Device type 0 hard disk unknown 1 tape 2 diskette 3 streamer 7 15 23 user i o negative use system specific attributes if open output sattrlen not equal to 0 Record delimiter terminated with 0 If vfc lst byte contains header length Padding character Feed control character Close disposition 0 rewind 1 unload 2 retain leave Access method 0 logical 1 2 physical block oriented mixed block access with record transfer 7 21 2014 by limes datentechnik gmbh Chapter 7 Application Examples FLAM PLONG namelen Length of file name expanded name FLAM PPCHAR filename File name expanded name retco 0 Open file ende return 7 227 227 227 22 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Read file user_io include flamincl h void usrget workio FLAM PPCHAR workio FLAM PLONG retco FLAM PLONG reclen FLAM PPCHAR record FLAM PLONG buflen retco 0 Read record ende return FLAM V4 3 UNIX Frankenstein Limes Access Method retco 7 7 2 reclen Reading a File record buflen File ID Return Record Record Length code length in
57. compressed file FLAM_FILE_LENGTH Meaning FLAMFILE incomplete or damaged FLAM_CHECKSUM Meaning Checksum error FLAM RECORD GR 32KB Meaning Original record larger than 32764 bytes FLAM RECORD GR BUFFER Meaning Original record larger than matrix 4 FLAM FLAM VERSION 1 Meaning FLAM compressed file is Version 1 FLAM ILLEGAL FLAM OPEN Meaning Open mode illegal FLAM ILLEGAL COMPRESSION MODE Meaning Compression mode illegal FLAM ILLEGAL RECORD SIZE Meaning Record size illegal FLAM ILLEGAL CHARACTER SET Meaning Character set illegal FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Appendix A Return Code 29 30 31 32 34 35 39 43 46 47 53 FLAM V4 3 UNIX Frankenstein Limes Access Method Return Codes Symbolic Name Meaning FLAM ERR PW Meaning Password wrong or missing FLAM FILE EMPTY Meaning Input file empty FLAM FILE NOT FOUND Meaning Input file does not exist FLAM OPEN MODE Meaning Invalid open mode FLAM RECORD FORMAT Meaning Invalid record format FLAM RECORD SIZE Meaning Invalid record size FLAM NO VALID FILENAME Meaning File name not valid FLAM ERR EXIT Meaning Abnormal termination by exit routine FLAM OPEN MSGFILE Meaning Cannot open message file FLAM ERR OUTPATH Meaning outpath only allowed with or filename FLAM PATH INVALID Meaning Environment variable FLAM PATH not defined
58. cords of the compressed file s after they are read This code must be generated by the user and linked to flamup and the embedding user program see chapter 6 FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 3 The flamup Subprogram Call exk10 Syntax Values Description exk10 specifies the name of a function which can be used to process the records of the original file after they are read exk10 exit specification exit specification In this version only exk10 may be specified for exit specification exk10 defines a function which processes the records of the original file s after they are read This code must be generated by the user and linked to flamup and the embedding user program see chapter 6 exk20 Syntax Values Description FLAM V4 3 UNIX exk20 specifies the name of a function which can be used to process the records of the compressed file before they are written exk20 exit specification exit specification In this version only exk20 may be specified for exit specification exk20 defines a function which processes the records of the compressed file s before they are written This code must be generated by the user and linked to flamup and the embedding user program see chapter 6 3 7 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The flamup Subprogram Call Chapter 3 inuser_io Syntax Values Description outuser_io Synta
59. d Interface cmprecs cmpbytes cmpbytofl Dependencies Return codes 4 8 Frankenstein Limes Access Method Chapter 4 If statistical information has been requested with flmopn statistics 0 this argument returns the number of compressed records which were created during the compression procedure or read during the decompression procedure This value is only significant if complete files are processed If statistical information has been requested with flmopn statistics 0 this argument returns the number of bytes which were created during the compression procedure or read during the decompression procedure This value is only significant if complete files are processed If the accumulated value of the cmpbytes argument exceeds 2 000 000 000 this counter is used for multiples of 2 000 000 000 With Secure FLAMFILEs flmcls may only be invoked immediately after flmflu or flmpos A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX38 2014 by limes datentechnik gmbh Chapter 4 The Record Interface flmflu Syntax Arguments flmid returncode cputime records bytes byteofl cmprecs FLAM V4 3 UNIX flmflu flush terminates the compression procedure for a file the remaining records in the block are compressed and written with padding of the last FLAM record where necessary The compressed file is not closed after flmflu and the statistic
60. e struct kd key description long device char record delimiter char pad char long print control long close disposition long access long filename length char fname Arguments workio This argument is a 1 Kbyte area which is made available by FLAM as a work area each time a user input output function is invoked and which is not altered by FLAM between the calls When usropn is invoked the name of the file which must be processed is at the start of the area and the remainder of the area is filled with binary zeros returncode This argument returns a return code to the invoking program file open This argument specifies the processing mode of the file which must be opened 0 input read i e decompress 1 output write i e compress filename This argument passes the specification for the file which must be opened The string must be terminated with a zero byte binary zero The specification may also be a logical name The actual file name should be returned by this argument The contents of this argument are also located at the start of the memory area which was passed with the workarea argument 5 6 5 65 65 6 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 5 organization record_format record_size block_size key_description device record_delimiter pad_char print_control FLAM V4 3 UNIX Frankenstein Limes Access Method The Use
61. e requires different actions from data supplied by measuring instruments FLAM considers the origin of the data to be file even though in a particular instance other objects may be involved The functions of the user defined input output are as follows Correspondi Purpose usrcls Terminating processing of file fclose fopen Writing one record FLAM specifies a range of functions based on the file processing requirements for this interface in accordance with the above point of view It is up to the user of the interface to optimize the design of the functions to ensure that the desired results are achieved with them In order to be able to use a user defined input output the routines concerned must be linked to the application program This option is therefore only supported by the program interfaces i e by the subprogram and record interfaces The support by the record interface of course only applies to accesses to the FLAMFILE since these are the only types of access which take place via it A user defined input output is initiated by invoking flmopd with device 7 This input output can be activated at the subprogram interface for all the files which are concerned by the compression or decompression procedure by means of the FLAM parameters user_io inuser_io and outuser_io FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 1 FLAM V4 3 UNIX Frankenstein Limes Access Method FLAM Overview
62. e area and the remainder of the area is initialized with binary zeros 6 7 2014 by limes datentechnik gmbh The User Exits Return codes 6 8 Frankenstein Limes Access Method Value 12 16 Chapter 6 Meaning Transfer record or no errors Don t transfer record Insert record The buffer address and the length of the record which is to be inserted must be returned in the record_pointer and record_length arguments The user exit is invoked again for the original record Terminate compression procedure Error in user exit abnormal termination FLAM V4 3 UNIK 8 2014 by limes datentechnik gmbh Chapter 6 exk10 Syntax Arguments functioncode returncode record_pointer record_length work FLAM V4 3 UNIX Frankenstein Limes Access Method The User Exits This user exit can be used during the compression procedure to process the records in the original file after they have been read It is activated by the flamup subprogram by means of the parameter exk10 exit specification in the argument parameter_string It takes over control after the original file is opened after each read access and before the file is closed the record which has been read is made available to it after read accesses It sends a return code when it returns control to FLAM void exk10 long functioncode long returncode char record pointer long record length char work This argument transfers a funct
63. ed or undefined record format FLAM V4 3 UNIX 2 21 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The flam Command kmexit Syntax Values Description 2 222 222 222 22 Frankenstein Limes Access Method Chapter 2 This parameter specifies a user exit routine for automatic key management kmexit exit specification exit specification has the general form fund Eib lexparm where func is the name of a function in a shared library that supplies the password key needed for en decryption lib is the name of a shared library without the so suffix containing func When ib is omitted FLAM loads the function from libflamkm so which it expects to find in directory FLAM PATH lib when that environment variable is defined or otherwise in usr lib Note When entered in a shell command each parenthesis must be preceded by an escape character 9 to avoid its being interpreted by the shell Escape characters are not requitred in parameter files exparm is a sequence of up to 256 characters to be passed to the password function func It must not contain space characters or parentheses If it contains commas the entire Exit specification must be enclosed in parentheses exparm must always be preceded by a pair of parentheses which may be empty when ib is omitted With this parameter FLAM is told the name of a function it has to invoke in order to receive a password needed for encrypt
64. efault retco if retc strepy msglen return strcpy message msglen strlen message retco 0 return 0x55555555L char rnd nbr 8 char rnd nbr 8 char rnd nbr 8 char rnd_nbr 4 unsigned long data 0 8 unsigned long data 1 8 unsigned long data 2 8 unsigned long data 3 rnd nbr 0x55555555L char exit id sprintf message errmsg5 fuco msglen strlen message retco 1 return fseek khandle o 0 message char errmsg3 strlen message FLAM V4 3 UNIX Frankenstein Limes Access Method read_pos SEEK_SET Application Examples Open text file random filestat st size For Encryption generate random i as read position and obscure it save modified For Decryption retrieve saved number undo obscuring For Info request pass ID string For all other codes issue error Position on read pos 7 31 2014 by limes datentechnik gmbh Chapter 7 Application Examples countl filestat st size read pos Check if file wrap if countl gt KMX KEY LENGTH necessary retco fread cryptokey 1 if not read full key KMX KEY LENGTH khandle if retco KMX KEY LENGTH strcpy message cha
65. es over control after the FLAMFILE is opened after each read access and before the file is closed the record which has been read is made available to it after read accesses It sends a return code when it returns control to FLAM void exd20 long functioncode long returncode char record_pointer long record_length char work This argument transfers a function code to the user exit The valid values are as follows 0 First call for the file after open 4 Record made available in record buffer 8 Last call for the file before close The user exit sends a return code to FLAM with this argument see separate description of return codes and their meanings This argument contains a pointer to a character string The pointer is 4 bytes long and thus corresponds to a long integer If a call is specified with function code 4 it contains the address of the record which has been read This address can be modified by the user exit for example in order to insert a record If a call is specified with function code 4 this argument contains the length of the record which has been read This length can be modified by the user exit for example in order to insert a record This argument is a 1 Kbyte area which is made available by FLAM as a work area each time the user exit is invoked and which is not altered by FLAM between the calls When it is invoked for the first time function code 0 the name of the file is at the start of th
66. es which are compressed can either be named explicitly or specified implicitly by means of patterns with wildcards either explicit names or names determined through substitution rules are allowed for the output files The same specification forms can also be used when the files are decompressed in addition the special output specification or permits a file to be restored with its original name and attributes The attributes of the decompressed file such as its organization and record format may otherwise differ from those of the original file FLAM can thus also be used for file conversions With the exception of the list and defaults parameters there are equivalent FLAM parameters for all the elements of the command syntax so that each setting can be entered either directly in the command line or in a parameter file which is referred to in the command by the parameter parfile parameter file Using a parameter file permits complicated keyboard inputs to be avoided for example if settings which differ from the installed default values are required frequently FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 1 FLAM V4 3 UNIX Frankenstein Limes Access Method FLAM Overview 1 5 2 The flamup Subprogram The interface to the flamup subprogram permits roughly the same operations as with the flam command to be initiated in an application program This interface makes the same range of functions ava
67. escription of return codes and their meanings parmlen When functioncode is 0 or 1 this argument contains the byte length of the data in the param argument That may be an integer value between 0 and 256 param When parmlen 0 this argument contains the exparm part of the exit specification in the kmexit parameter see description of the parameter kmexit in section 2 3 datalen When functioncode is 0 or 1 this argument contains the byte length of the data in the data argument That may be an integer value between O0 and 512 For calls for encryption it is set by the exit routine For calls for decryption it is set by FLAM 6 14 FLAM V4 3 UNIB314 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 6 The User Exits data When datalen gt 0 with calls for encryption functioncode 1 the exit routine returns here the data required for retrieving the password needed for decryption FLAM stores these data in a user specific FLAM file header With calls for decryption functioncode 0 FLAM returns here these data to the exit routine ckylen After a successful call to the exit routine with functioncode O or 1 this argument contains the byte length of the password returned to FLAM in the cryptokey argument Maximum key length is 64 bytes cryptokey In this argument FLAM receives after exit calls with functioncode 0 or 1 the password for encryption or decryption with the length specified in ckylen
68. et by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program This argument indicates whether or not more setting data should subsequently be transferred with an flmopf call 0 No flmopf call Other values flmopf call follows This argument transfers the length of the area for the name of the FLAMFILE which must be opened and returns the actual length of this name This argument is the area in which the name of the FLAMFILE which must be opened is returned FLAM V4 3 UNIX316 2014 by limes datentechnik gmbh Chapter 4 organization record_format record_size record_delimiter key_description block_size close_disposition device Dependencies Return codes FLAM V4 3 UNIX Frankenstein Limes Access Method The Record Interface This argument transfers and returns a code for the organization of the FLAMFILE which must be opened The possible values are 0 sequential Implicit value at compression 0 This argument transfers and returns a code for the record format of the FLAMFILE which must be opened Valid values are 0 var with mode adc cx8 vr8 1 fixed with modezadc cx8 vr8 3 stream only with mode cx7 Implicit value at compression 1 This argument passes and returns the maximum record size of the FLAMFILE to be opened Implicit value at compression 512 This character string is 4 bytes long corresponding t
69. f the original file is transferred The name is saved there as a string and terminated with O This argument transfers a code for the organization of the original file The permissible values are described under the flmghd function FLAM V4 3 UNIX322 2014 by limes datentechnik gmbh Chapter 4 The Record Interface record_format This argument transfers a code for the record format of the original file The permissible values are described under the flmghd function record_size This argument transfers the maximum record size of the original file The permissible values are described under the flmghd function record_delimiter The record delimiter is saved in this argument if the record format has been specified as stream The character string is 4 bytes long corresponding to a long integer The structure of the record delimiter is described under the flmghd function key description This argument is reserved for future extensions print control This argument is reserved for future extensions system This argument consists of two bytes and is used to transfer a code for the operating system in which the FLAMFILE was created The list of valid values is listed with flmghd continue param This argument indicates whether or not more information for the FLAM file header should subsequently be transferred with an flmpuh call 0 No more information Other values More information Dependencies flmphd may only be used a
70. fied by flamfile and the output specification decompressed file by flamout 2 4 1 Input Specifications The input specification may consist of a file or directory name a pattern with wildcards or a list of such elements Elements of a list are separated by commas Filenames may contain space characters but not as first characters Filnames containing spaces must be enclosed in double quotes The files specified as input files must actually exist At least one matching file must exist for a pattern Otherwise the flam command will be aborted and an error message output If the input specification specifies files for processing by FLAM either the flamin parameter or flamfile must be specified for the compression or decompression procedure respectively If the data is to be entered via the special stdin file the parameter for the input specification is omitted FLAM can thus be used as a filter FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command 2 4 2 Output Specifications The output specification may consist of a filename a list of filenames Separated by commas or a substitution rule A substitution rule has the following format string 1 string2 Moreover one of the output specifications or filename may be used see description below Output files are created if they do not exist and overwritten if t
71. fied number and compresses them This specified number may occasionally not be reached if the matrix buffer is too small for the full number of records The compression efficiency generally increases with the number of records If maxrecords 1 the compression is sequential and record oriented With modes cx7 cx8 and vr8 up to 255 records are stored in one matrix If a higher value is specified it takes effect only with mode adc FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 mode Syntax Values FLAM mode adc aes flamenc cx cx8 vr8 Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies the mode in which the original file is compressed and when desired encrypted mode FLAM mode FLAM mode Meaning With mode adc the input file is compressed in the adc mode and a binary FLAMFILE is created This is the most efficient mode and can be used universally irrespective of the data structure With this mode a password can be specified to encrypt the FLAMFILE mode aes causes the input file to be compressed in the adc mode with AES encryption A password must be specified with the password parameter mode flamenc causes the input file to be compressed in the adc mode with FLAM encryption the proprietary encryption method used with FLAM 3 A password must be specified with the password parameter With mode cx7 the in
72. flmput The flmput put record function transfers one original record at a time for compression Syntax void flmput flmid returncode record_length record char flmid long returncode long record_length char record Description flmid The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done returncode This argument returns a return code to the invoking program record length This argument contains the record length in bytes record This argument is the record buffer Dependencies flmput may only be used at compression Return codes A description of the return codes can be found in Appendix A Return codes 4 26 FLAM V4 3 UNIJ326 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 4 The Record Interface flmpwd Mit der Funktion flmpwd password wird beim Komprimieren ein Kennwort zum _ Ver beim Dekomprimieren zum Entschl sseln der Komprimatsdaten bergeben Syntax void flmpwd char flmid long returncode long pwd length char pwad Arguments flmid The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done returncode This argument returns a return code to the invoking program
73. gramming the Record Interface at Decompression Description of flamrec Functions flmcls flmflu flmget flmghd flmguh flmopd flmopf flmopn flmphd flmpos flmpuh flmput flmpwd Linking Record Interface Functions to Application Programs 3 3 3 5 3 7 3 7 3 8 3 8 3 9 3 9 3 10 3 11 4 3 4 4 4 5 4 6 4 7 4 9 4 11 4 12 4 15 4 16 4 18 4 21 4 23 4 25 4 26 4 27 4 28 4 29 V 2014 by limes datentechnik gmbh Contents Chapter 5 Chapter 6 Chapter 7 vivivivi Frankenstein Limes Access Method 5 1 5 2 6 1 6 1 1 6 1 2 6 2 6 2 1 6 2 2 7 1 7 2 7 2 1 7 2 2 The User Input Output Interface How to Use the User Input Output Interface usrcls usrget usropn usrpos usrput Linking User Input Output Routines to Application Programs The User Exits User Exits for File Accesses Access Exits Programming the Access Exits exd10 exd20 exk10 exk20 Linking File Access Exits to Application Programs The User Exit for Automatic Key Management Key Exit Programming the Key Exit kmfunc Creating a Key Exit Application Examples Commands Compressing One File into One File Several Files into One File 5 3 5 5 5 6 5 7 5 10 5 11 6 3 6 4 6 5 6 7 6 9 6 11 6 13 6 13 6 13 6 14 6 16 7 3 7 3 7 3 7 3 FLAM V4 3 UNIX 2014 by limes datentechnik gmbh FLAM V4 3 UNIX Frankenstein Limes Access Method
74. hapter 6 The User Exits 6 1 2 Linking File Access Exits to Application Programs FLAM supports calling user exits for file accesses both on the subprogram interface level flamup as well as on the record interface level flamrec the latter supporting accesses to FLAMFILEs only In order to be able to process data records with FLAM by means of these user exits the associated linked object files must contain all the access functions described above any functions which are not required may be included as dummy functions User exits for file accesses are linked statically with FLAM as described in section 3 3 Linking flamup as well as in section 4 5 Linking Record Interface Functions to Application Programs 6 2 The User Exit for Automatic Key Management Key Exit The user exits for automatic key management can be activated via the subprogram interface flamup and in contrast to the access exits throu the flam command but not through the record interface flamrec Another major difference is that a key exit routine is linked dynamically It is created as a shared object and both the name of the shared library and that of the called function can be chosen freely and are passed to FLAM as a parameter 6 2 1 Programming the Key Exit Key exit routines must also avoid interactive operations if they are meant for use in batch processing Display messages can be synchronized with FLAM logging by use of the message and msg
75. he runtime library lib crtO o to be specified in the link command as well e g SCO UNIX 3 103 103 103 10 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 4 The Record Interface flamrec 4 The Record Interface flamrec 4 1 Functions of the Record Interface The record interface flamrec consists of a series of subprograms which can be invoked by all programming languages in which C functions can be used With the exception of the key description which is used in a later version all arguments are represented using elementary data types long integer string The arguments are transferred by means of pointers and not as values The rules concerning notation in section 2 5 Interfaces apply here analogously Application programs which are written in C may include the statement include flamincl h This C header file contains the definitions of the symbolic constants and return codes as well as the structure of the key description These definitions must be transferred in the same way for programs written in other languages All argument lists begin with an ID which identifies the compression file uniquely This flmid argument contains the address of the work area for the compressed file which was specified by flmopn and must not be modified until flmcls All other arguments are only relevant to the function to which they are transferred The
76. her functions In this case the command is as follows ld o xyz usr lib flame flam recu o usr lib flame flam usrmod o D usr lib flame flam exitmod o xyz c lc usr lib flame flam usrmod o and or usr lib flame flam exitmod o must be replaced by the user s own modules Some UNIX systems require the runtime library lib crtO o to be specified in the link command as well 4 28 FLAM V4 3 UNIX328 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 5 The User Input Output Interface 5 The User Input Output Interface 5 1 How to Use the User Input Output Interface FLAM uses the standard functions to input and output original files decompressed files and FLAMFILEs It is however also possible to process data in a non supported format or on hardware which is not supported by UNIX with the aid of programs which invoke the FLAM functions of the record interface The necessary input and output routines must be made available in order to do so FLAM uses these routines for the file concerned if user input output device 7 is specified in the device argument when the FLAM flmopd function is invoked The most important difference between the user input output interface and the record interface is that the user program is the invoking program and FLAM the executive program for the record interface functions User inputs outputs on the other hand are themselves exec
77. hey do If a substitution rule is defined as an output specification the name of the FLAMFILE or the decompressed file must be formed by substituting string2 for string1 in the name of the input file The strings and the equal sign must have no separating spaces in between The substitution rule applies only to file names and not to path names Example flam compress mode cx8 flamin helptxtl txt helptxt2 txt flamfile txt cmp causes the files called helptxt1 txt and helptxt2 txt to be compressed and the compressed data to be saved in the associated FLAMFILEs called helptxti cmp and helptxt2 cmp The substitution rule must be applicable to all the assigned input files i e string must be contained in the names of every one of these files or the flam command will be aborted for the file to which it does not apply and an error message will be output Only one substitution takes place when the name of the output file is formed even if string occurs more than once in the name of the input file The output specifications file name and have special meanings Using file name as output specification causes the decompression to select one or when file name contains wildcards possibly several matching file s from a FLAMFILE archive Those are decompressed into the current directory unless outpathz directs otherwise If the output specification for the decompression procedure is the names of the
78. hod 2014 by limes datentechnik gmbh Chapter 2 maxbuffer Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies the size of the matrix buffer maxbuffer n n Integer number between 1 and 2 621 440 Values n where 0 n 2 560 are interpreted as a number of Kbytes 1 Kbyte 1 024 bytes while higher values are interpreted as a number of bytes FLAM chooses one of the buffer sizes from the table below in Kbytes ef of ef w we se se s ee eof os 1af 128 144 If the specified value is not contained in the table the nearest higher buffer size is taken instead if any otherwise the maximum value is always used 2 560 During the compression with modes cx7 cx8 and vr8 FLAM reserves the matrix buffer for the records of the original file Please note that a matrix buffer of the same size must also be made available for the decompression procedure even if this takes place on a different system With mode adc this parameter has no effect 2 25 2014 by limes datentechnik gmbh The flam Command maxrecords Syntax Values Description 2 262 262 262 26 Frankenstein Limes Access Method Chapter 2 This parameter specifies the maximum number of records which can be compressed in the same block maxrecords n n Integer number between 1 and 4095 FLAM buffers records in the matrix buffer up to the speci
79. idden by the higher priority i e it is not possible to define a list of input specifications partly in the command itself and partly in the parameter file or in the form of default values The list in the command cancels out the list at the lower specification level 2 51 2014 by limes datentechnik gmbh The flam Command 2 522 522 522 52 Frankenstein Limes Access Method Chapter 2 2 6 The FLAM parameter file The parameter file can be edited using a text editor it contains FLAM parameters which uniquely match the information in the command line of the flam command Each FLAM parameter consists of a keyword and possibly an assigned value or a list of values The FLAM parameters can be arranged so that each one is entered on a separate line a line can however also contain several parameters separated by commas Comments are allowed they always start with a and end at the line break The length of a line in the paramerter file must not exceed 2 048 bytes The example below illustrates how a parameter file can be used FLAM is invoked by the following command FLAM parfile param flam The parameter file called param flam contains the following FLAM parameters compress mode cx8 maxbuffer 128 flamin test dat flamfile flamfilel cmp attributes all recformat fixed recsize 1024 This FLAM call causes the file called test dat to be compressed in the cx8 mode The FLAMFILE is the file called flamfile1 cmp It
80. ilable to the application programmer as to the user with the exception of the functions for listing and modifying default settings FLAM parameters are used to specify these settings similar to the procedure for the parameter file These parameters are specified consecutively in an ASCII string which is transferred to the subprogram in the form of an argument Once again it is possible to refer to a parameter file using the parameter parfile parameter file f any information is omitted the same default settings are used as for the flam command When flamup has been executed in its entirety the invoking program receives a return code indicating either the success of the call or the cause of the error 1 5 3 The flamrec Record Interface The flamrec record interface permits file processing and compression to be integrated in an application program Decompressed records can be read sequentially from a FLAMFILE A new FLAMFILE is created when the compressed data is output A FLAMFILE can thus be opened either for read accesses only decompression or for write accesses only compression FLAM s record interface consists of a class of functions which allow the application program to access and process compressed data in the same way as is possible with ordinary input output instructions in the case of non compressed data The use of these functions is governed by rules similar to those which apply to the standard input output After the f
81. ile has been opened records can be read or written the file is closed again when all processing has been completed The compression or decompression that takes place during processing is completely transparent to the programmer so that compared to programs using conventional input output operations there are almost no differences in the program logic By using the record interface compressing or decom pressing the processed data no longer requires an extra step after or before running the application In addition it is no longer necessary to provide sufficient temporary storage space for both the compressed and the uncompressed copy of a file 1 11 2014 by limes datentechnik gmbh FLAM Overview 1 121 121 121 12 Frankenstein Limes Access Method Chapter 1 1 5 4 The User Defined Input Output FLAM supports all inputs and outputs to and from disk files using standard input output instructions However it also allows the user to replace these standard input output routines with routines of his own This may be a good idea for example if there is a possibility of an input output device other than a hard disk being used or if the file contains a record format which is not supported It is not possible to describe every single aspect of every function of the user defined input output in detail since these vary according to the device and to the nature of the data Data which is received via a modem line for exampl
82. imes datentechnik gmbh Chapter 2 Syntax FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command 2 2 1 FLAM Compression flam compress parameter value attributes attribute option compress flamcode Character set flamfile file specification flamin file specification inrecdelim record delimiter inrecformat record format inrecsize n kmexit exit specification maxbuffer n maxrecords 2n msgfile message file mode compression mode ndc nopath parfile parameter file password password recformat record format recsize n show display option translate code table 2 5 2014 by limes datentechnik gmbh The flam Command Syntax 2 62 62 62 6 Frankenstein Limes Access Method Chapter 2 2 2 2 FLAM Decompression flam decompress parameter value flamfile file specification flamout file specification kmexit exit specification msgfile message file option FLAM option outpath Output path outrecdelim record delimiter outrecformat record format outrecsize n pad_char padding character parfile parameter file password password show display option translate code table FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 Syntax Syntax FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command 2 2 3 Displaying the FLAM Default Values FLAM
83. ined through all segments of the same member and a third MAC chained through all members of the FLAMFILE ensures the completeness with regard to the file Similar features are included when FLAMFILEs are created with mode flamenc To include the information necessary for these checks such as counts timestamps MACs etc a member header is inserted in front of each member and each member ist followed by a member trailer In addition a file trailer is appended at the end of every Secure FLAMFILE Secure FLAMFILEs may not be concatinated since this would create discontinuities of numbering counters and MAC chainings that would make FLAM assume integity violations and break off processing Individual members of a FLAMFILE however can be extracted since checking of the member chaining is suspended whenever members are skipped and only the segment chaining is then tested FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 1 FLAM V4 3 UNIX Frankenstein Limes Access Method FLAM Overview 1 5 Interfaces FLAM s various interfaces are extremely flexible FLAM can be embedded in user defined applications or vice versa by means of calls at different levels The available interfaces are listed in the table below interface Call level Purpose FLAM System Compress decompress command entire files interactively or in procedures flamup Application Compress decompress subprogram programs entire file
84. inserted in front of each compressed file When the files are decompressed the compressed data originating from different files can be distinguished and decompressed into separate files 1 7 2014 by limes datentechnik gmbh FLAM Overview 1 81 8 1 81 8 Frankenstein Limes Access Method Chapter 1 1 4 3 Secure FLAMFILEs Each record in a FLAMFILE is protected against manipulations and transmission errors by an appended checksum In compliance with increased requirements regarding cryptographic security additional security features for encrypted FLAMFILEs have been imple mented which improve the protection against a greater variety of attacks A FLAMFILE provided with these features is called Secure FLAMFILE The new protection mechanisms work on three levels e the segment level e the member level and e the file level Here segment denotes the compressed result of a single matrix and member the entirety of segments from a single original file In a Secure FLAMFILE there are byte and record counts both for each member as well as for the entire file members are numbered consecutively and a timestamp marks the creation time When encrypted with AES MACs Message Authentication Codes are attached to the FLAMFILE Those are checksums calculated with a secret key that allow verifying the authenticity of the data A MAC is calculated for each segment To ensure the completeness of a member a second MAC is cha
85. ion code to the user exit The valid values are as follows 0 First call for the file after open 4 Record made available in record buffer 8 Last call for the file before close The user exit sends a return code to FLAM with this argument see separate description of return codes and their meanings This argument contains a pointer to a character string The pointer is 4 bytes long and thus corresponds to a long integer If a call is specified with function code 4 it contains the address of the record which has been read This address can be modified by the user exit for example in order to insert a record If a call is specified with function code 4 this argument contains the length of the record which has been read This length can be modified by the user exit for example in order to insert a record This argument is a 1 Kbyte area which is made available by FLAM as a work area each time the user exit is invoked and which is not altered by FLAM between the calls When it is invoked for the first time function code 0 the name of the file is at the start of the area and the remainder of the area is initialized with binary zeros 6 9 2014 by limes datentechnik gmbh The User Exits Return codes 6 10 Frankenstein Limes Access Method Value 12 16 Chapter 6 Meaning Transfer record or no errors Don t transfer record Insert record The buffer address and the length of the record which is to be inserted m
86. ion or decryption of a file This function must reside in a shared library file type so the name of which may be specified after the function name After the library name an alphanumeric string may be appended that will be passed as a parameter string to the invoked function No default value can be set for kmexit This parameter and password are mutually exclusive For details on the interface to this user exit and its building see section 6 2 FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 list Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter permits a list of the installation specific default values to be output The list can only be displayed using a command list ist specification list specification Any flam parameter for which a default value can be set The installation specific default values can be displayed with the list parameter When a list specification is supplied the current setting of the default value for the respective paramter is displayed When list specification is omitted a list of all current default values is displayed except the code tables for ASCII EBCDIC and EBCDIC ASCII translations Also the FLAM version and its creation date are displayed The details are displayed similar to the following example while the operating system the creation date and the effective values correspond to tho
87. is output If the decompressed file is written with the stream record format during the decompression procedure blanks at the end of a record can be suppressed by specifying suppress nosuppress causes the blanks to be written 2 31 2014 by limes datentechnik gmbh The flam Command outpath Syntax Values Description 2 322 322 322 32 Frankenstein Limes Access Method Chapter 2 This parameter determines the directory location used by FLAM to create a decompressed file outpath output path output path This specifies an existing directory at which FLAM will create the file s being decompressed This may be an absolute or a relative path An explicit specification flamout at decompression may also include a complete directory path This option is not available when decompressing with flamout In that case an output directory can be specified using outpathz No default value can be set for outpath FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 outrecdelim Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies a record delimiter for decompressed files outrecdelim record delimiter record delimiter Hexadecimal characters between 01 and ff with a length of either 1 or 2 bytes This parameter specifies the record delimiter for a decompressed file with the stream record forma
88. is shown during the decompression procedure FLAM version FLAM settings Operation decompress Code table only if the FLAM call includes the necessary specifications Name of the compressed file FLAMFILE Name of the decompressed file Formatting information for the decompressed file Saved compression information see show attributes Statistical information see show statistic Error messages and warnings Decompression only This suppresses creation of the decompressed file Only the saved compression information is shown Name of the original file only if attributes all was specified when it was compressed Formatting information for the original file Compression mode Character set ASCII or EBCDIC System which created the FLAMFILE Only error messages and warnings are shown 2 43 2014 by limes datentechnik gmbh The flam Command display option statistics Description 2 442 442 442 44 Frankenstein Limes Access Method Chapter 2 Meaning Error messages warnings and the following statistics are shown Number of compressed records Number of compressed bytes Number of non compressed records Number of non compressed bytes Compression efficiency as compared with the original file compression only 1 Runtime 1 This efficiency is the ratio of the number of bytes actually read to the number of bytes output and is specified as a percentage Record size fields record delimiters and cha
89. k area each time the user exit is invoked and which is not altered by FLAM between the calls When it is invoked for the first time function code 0 the name of the file is at the start of the area and the remainder of the area is initialized with binary zeros 6 5 2014 by limes datentechnik gmbh The User Exits Return codes 6 6 Frankenstein Limes Access Method Value 12 16 Chapter 6 Meaning Transfer record or no errors Don t transfer record Insert record The buffer address and the length of the record which is to be inserted must be returned in the record_pointer and record_length arguments The user exit is invoked again for the original record Terminate compression procedure Error in user exit abnormal termination FLAM V4 3 UNIK36 2014 by limes datentechnik gmbh Chapter 6 exd20 Syntax Arguments functioncode returncode record_pointer record_length work FLAM V4 3 UNIX Frankenstein Limes Access Method The User Exits This user exit can be used during the decompression procedure for accesses to the FLAMFILE in order to preprocess the records which have been read It can be activated either by the flamup subprogram or by the flmopf function of the record interface It is specified in the subprogram call by means of the parameter exd20 exit specification in the argument parameter_string and in the flmopf function by means of the argument exitroutine_decomp It tak
90. k gmbh Chapter 2 inrecdelim Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies a record delimiter for original files inrecdelim record delimiter record delimiter Hexadecimal characters between 01 and ff with a length of either 1 or 2 bytes This parameter specifies the record delimiter for an original file with a stream record format If a stream record format is specified without a record delimiter Ox0a and Ox0d0a are interpreted as the end of a record If only OxOa should be interpreted as the end of a record inrecdelim 0a must be specified in order to ensure that occurrences of OxOd which precede 0x0a are interpreted as part of the data and not as part of a record delimiter If only Ox0d0a should be interpreted as a record delimiter in a particular file inrecdelim O0d0a must be specified to ensure that any OxOa strings which occur alone are identified as belonging to the data Any other character combinations can be used as record delimiters in addition to Ox0a and Ox0d0a 2 19 2014 by limes datentechnik gmbh The flam Command inrecformat Syntax Values format option eaf fix stream undefined variable var_2b var2b_data var_4b var ascii var ebcdic Description 2 202 202 202 20 Frankenstein Limes Access Method Chapter 2 This parameter specifies the record format of the original file
91. kenstein Limes Access Method The Record Interface The flmopn open function starts the open sequence for a FLAMFILE It can be followed by a flmopd and or flmopf call in order to set or query the attributes of the FLAMFILE or the FLAM settings void flmopn char flmid long returncode long continue_param long flam_open char filename long statistics The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program This argument indicates whether or not more setting data should subsequently be transferred with an flmopd or flmopf call 0 No more calls Other values More calls follow This argument specifies the FLAMFILE processing mode 0 input read FLAMFILE i e decompress 1 output write FLAMFILE i e compress This argument transfers the name of the FLAMFILE The string must be terminated with a zero byte binary zero The file name is returned by the flmopd function If stdin stdout are used the first byte contains either a binary zero or a blank This argument specifies whether or not statistical information is desired at the end of the compression procedure 0 No statistics Other values Statistical information returned None A description of the return codes can be found in A
92. keydesck amp blksk amp cldispk amp devk if rc FLAM NORMAL put flmsg rc exit rc Compression specifications header FLAM C FILEHEADER Read file header keydesco keyparts 0 exk20 0 No exit routine exd20 0 flmopf amp flmid amp rc amp version amp flcode amp modus amp maxb amp header amp sanz amp keydescd amp blkmode exk20 exd20 if rc FLAM NORMAL put flmsg roc exit rc Read file header Common information namlen 100 flmghd amp flmid amp rc amp namlen oname amp orgao amp recfo amp recso recdelo c amp keydesco amp blkso amp prctrl system if rc FLAM NORMAL amp amp rc FLAM NO FILEHEADER closflam rc amp flmid VAX NMS system if rc FLAM NO FILEHEADER User specific information uattrlen 1000 flmguh amp flmid amp rc amp uattrlen usrattr if rc FLAM NORMAL amp amp rc FLAM NO FILEHEADER closflam rc amp flmid Open decompressed file outfile fopen dname w if outfile NULL exit 1 FLAM V4 3 UNIX 7 17 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples Decompress and write file buflength 2048 flmget amp flmid amp rc amp reclength datrec amp buflength if rc FLAM NORMAL if rc FLAM EOF rc FLAM NORMAL closfiles rc outfile amp flmid il F
93. kmx const char errmsg3 Positioning in file flam ffkmx failed const char errmsg4 Reading file flam ffkmx failed const char errmsg5 Function code d not supported const char errmsg6 File flam ffkmx too small unsigned long counti E unsigned long count2 7 unsigned long rnd nbr unsigned long read pos FILE khandle time t unixtime struct tm p tm struct stat filestat msglen 0 retco stat ffkmx amp filestat Determine file size if retco 0 strcpy message char errmsg1 msglen strlen message return if filestat st size 256 Check file s size strcpy message char errmsg6 msglen strlen message return 7 307 307 307 30 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 khandle fopen ffkmx if khandle NULL strepy msglen return switch message rb char errmsg2 strlen message fuco case KMX ENCRYPT time amp unixtime srandom unixtime 0x00010001L read_pos rnd_nbr rnd_nbr data 3 rnd_nbr gt gt data 2 rnd_nbr gt gt data 1 rnd_nbr gt gt data 0 datalen break case KMX_DECRYPT rnd_nbr rnd_nbr lt lt rnd nbr rnd nbr lt lt rnd nbr rnd nbr lt lt rnd nbr read pos break case KMX ID INFO d
94. len arguments with function code 1 version identification At each execution FLAM invokes the key exit routine once with this function code and logs the returned message text if present at an appropriate place With other function codes message texts should only be returned to indicate error causes Below is the detailed description of the interface between FLAM abd the key exit routine FLAM V4 3 UNIX 6 13 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The User Exits Chapter 6 kmfunc This user exit can be used at encryption or decryption to provide a password automatically It is activated by the parameter kmexit exit specification in the flam command or in the parameter_string argument of the subprogram call flamup The actual name used instead of kmfunc may be any valid function name It sends a return code when it returns control to FLAM Syntax void kmfunc signed long functioncode signed long returncode const unsigned long parmlen const unsigned char param unsigned long datalen unsigned char data unsigned long ckylen unsigned char cryptokey unsigned long msglen unsigned char message Argumente functioncode This argument transfers a function code to the user exit The valid values are as follows 1 call for version identification 0 call for decryption 1 call for encryption returncode The user exit sends a return code to FLAM with this argument see separate d
95. list ist specification See description of the list parameter 2 2 4 Setting the FLAM Default Values FLAM defaults default specification This call can only be used by the system manager See description of the defaults parameter 2 3 flam Command Parameters This section describes the parameters of FLAM in alphabetical order irrespective of the functions with which they can be used 2 7 2014 by limes datentechnik gmbh The flam Command attributes Syntax Values attribute option none common all Description 2 82 82 82 8 Frankenstein Limes Access Method Chapter 2 This parameter causes original file information to be entered in the FLAMFILE attributes attribute option Meaning No file information Common file information Common file information and system specific information about the original file Entering file information in the FLAMFILE permits it to be extracted later on without having to decompress the entire FLAMFILE The organization the record format and the record size of the original file can be saved during the compression procedure together with a flag which identifies the operating system in which the compression took place attributes common Thus when the file is decompressed it can be restored with its original characteristicsif necessary The original file specification can be entered optionally attributes all When the file is decompressed the outp
96. lmopn was called with continue param set When both functions are called flmopd must come first and also have continue param set When flmopd or flmopf are not called by the application program FLAM uses implicit settings to generate such calls internally Default values used with the flam command and flamup calls are not effective here FLAM V4 3 UNIA 4 2014 by limes datentechnik gmbh Chapter 4 FLAM V4 3 UNIX Frankenstein Limes Access Method The Record Interface Finally if encryption is used a password must be provided by a flmpwd call In the second phase one compression cycle must be done for each file being compressed Such a cycle would normally begin with a flmphd call to generate a common FLAM fileheader Only when a single file is compressed without encryption this may be omitted If a FLAM fileheader was created a user specific header may be appended by invoking flmpuh With Secure FLAMFILEs this invocation is mandatory even if the header data length is O Now data can be submitted for compression by repeated execution of flmput Each such call passes a record in the FLAM terminology which can be later replicated identically or with modified record attributes thanks to the structure information kept by FLAM FLAM collects the data passed to it in the compression buffer and controls compression and the resulting output without involving the application program A compression cycle is terminated b
97. lows 00 00 Unknown system 00 OE MS Windows 0101 IBM MVS 0102 IBM VSE 0103 IBM VM 0301 HP OpenVMS 09 01 HP NonStop 1204 Unix Dependencies flmghd may only be used at decompression It may be called to retrieve the attributes of the first member of a FLAMFILE is FLAM returns code 1 after the opening sequence flmopn flmopd flmopf The attributes of a subsequent member are available if a preceding flmget returns with code 6 Return codes A description of the return codes can be found in Appendix A Return codes 4 14 FLAM V4 3 UNIA314 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 4 The Record Interface flmguh The flmguh get user header function is used to recover the data from the user specific FLAM file header during the decompression procedure It is only allowed during this procedure and immediately following an flmghd call Syntax void flmguh char flmid long returncode long user attributes length char user attributes Arguments flmid The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done returncode This argument returns a return code to the invoking program user attributes This argument transfers the length of the memory area in length in which the user specific FLAM file header must be saved It returns the leng
98. meric field which contains the length of par string par string contains for example flaminztest dat flamfileztest cmp comp In this case parlen contains the value 38 The sample program below uses the subprogram interface The parameters are specified in the call in the same way as in the flam command This program can be used as a user program with user input output routines and or user exits FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 7 flamup call with user exit and or user i o include lt stdio h gt include lt sys types h gt include lt sys stat h gt include flamincl h void main int argc char argv char id unsigned long retco long ip is char po pq unsigned char pp char string 100 char parstring 1500 retco FLAM NORMAL pp parstring is 0 ip 0 while ip lt argc po argv ip pq amp string 0 while po 0x00 if po amp amp po pqtt pott else pott pq 0x00 po amp string 0 while po 0x00 amp amp po pott FLAM V4 3 UNIX Frankenstein Limes Access Method Application Examples ID Return code Integer Pointer Pointer Character string Parameter string Return code ok Parameter after input area Contains parameter lists amp amp po 7 7
99. n strlen oname orgao FLAM C ORG SEQ Organization seq recfo FLAM C RECFRM STREAM Record format stream text file recso 0 blkso 0 prctrl FLAM C PRINT CTRL NONE system 0 FLAM C SYSTEM COMP Computer processor system 1 FLAM C SYSTEM OS Operating system flmphd amp flmid amp rc amp namlen oname amp orgao amp recfo amp recso recdelo c amp keydesco amp blkso amp prctrl system amp lstpar if rc FLAM NORMAL closfiles rc infile amp flmid Output user specific file header uattrlen strlen usrattr flmpuh amp flmid amp rc amp uattrlen usrattr if rc FLAM NORMAL closfiles rc infile amp flmid 7 127 127 127 12 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples Read and compress file il FLAM NORMAL ptr fgets datrec 2048 infile if ptr NULL if errno 0 il FLAM_EOF else rc errno FLAM IO closfiles rc infile amp flmid while il FLAM NORMAL reclength strlen datrec 1 Output compressed file flmput amp flmid amp rc amp reclength datrec if rc FLAM NORMAL closfiles rc infile amp flmid Read original file ptr fgets datrec 2048 infile if ptr NULL if errno 0 il FLAM_EOF else rc errno FLAM IO closfiles rc infile amp flmid Exit FLAM flmcls amp
100. n of the inrecformat parameter See description of the inrecsize parameter See description of the maxbuffer parameter See description of the maxrecords parameter See description of the mode parameter See description of the msgfile parameter With msgfile none any default value for this setting is dropped See description of the option parameter See description of the outrecdelim parameter See description of the outrecformat parameter See description of the outrecsize parameter See description of the parfile parameter With parfile none any default value for this setting is dropped See description of the recdelim parameter See description of the recformat parameter See description of the recsize parameter See description of the show parameter See description of the translate parameter With translate none any default value for this setting is dropped 2 13 2014 by limes datentechnik gmbh The flam Command Description 2 142 142 142 14 Frankenstein Limes Access Method Chapter 2 The system manager can define default values for all the parameters of the flam command except the defaults list kmexit ndc nopath outpath and password parameters The default values can only be modified by a command The default values can be defined by invoking FLAM with the defaults parameter and specifying the default specification This consists of a keyword and possibly an assigned
101. n the command line itself or as FLAM parameters in a parameter file which is referred to by the parameter parfile parameter file Chapter 2 The flam command discusses these parameters in greater detail Unless otherwise explicitly mentioned all the information in this chapter relating to the use of parameters in the command line applies equally to the parameters in the parameter file FLAM Overview 1 41 4 1 41 4 Frankenstein Limes Access Method Chapter 1 1 1 Mode of Operation When a file is being compressed with FLAM one or more original files are read record by record and a compressed and optionally encrypted file called FLAMFILE is created When a file is decompressed using FLAM the compressed file is read sequentialy and one or more decompressed files are created The compression process consists of a series of recurring cycles Each cycle generally entails reading a fixed number of records in the original file these records are then buffered in the matrix buffer compressed and output in the form of a compressed block The number of records is between 1 and 255 or 4095 depending on the compression mode used and is specified when the compression procedure is invoked A compressed block containing correspondingly fewer records is generated when the end of the file is reached or if the matrix buffer overflows The compressed blocks created by FLAM are written into a sequential FLAMFILE By the record oriented
102. nctions described above any functions which are not required can be installed as dummy functions How to link the routines to the application program is described in section 3 3 Linking flamup as well as in section 4 5 Linking Record Interface Functions to Application Programs 5 11 2014 by limes datentechnik gmbh FLAM UNIX User Manual Chapter 6 The User Exits 6 The User Exits A user exit is a user provided program that is activated by FLAM and which communicates with it through a defined interface FLAM supports two sorts of user exits e exits activated when files are accessed i e opened closed read or written also called access exits an exit for automatic key management also called key exit In order to be available in FLAM the access exits must be statically linked with FLAM see section 6 1 2 whereas the key exit is created as a shared object and linked dynamically i e at runtimes For details see section 6 2 2 6 1 User Exits for File Accesses Access Exits These exits are programs which are activated by FLAM with each operation on the associated file When the file is opened or accessed for reading the user exit is activated immediately after the file has been opened or after a record has been transferred to the read buffer and before FLAM begins processing When the file is closed or accessed for writing the user exit is activated immediately before the closing or bef
103. ne File into One File A file called test dat is compressed and the compressed data is written in a file called test cmp flam compress flamin test dat flamfile test cmp 7 2 2 Several Files into One File All the files which match the search pattern t dat are compressed and the compressed data is written in a file called test cmp flam compress flamin t dat flamfileztest cmp attributes all showzall show all causes all the compression information to be shown on the screen attributes all causes the names file attributes and record attributes of the original files to be saved in the compressed file as well They can then be shown on the screen with the following command flam decompress showzattributes flamfile test cmp without creating the decompressed files Chapter 7 7 47 47 47 4 Frankenstein Limes Access Method Application Examples 7 2 3 Several Files into Several Separate Files All the files which match the search pattern t dat are compressed The compressed data of each file is written in a separate file which is given the name of the original file and a cmp suffix flam compress flamin t dat flamfile dat cmp If the default directory were also to contain a file called tvdaten dat for example as well the compressed data of this file would be saved in the FLAMFILE called tvcmpen dat see section 2 3 2 Output specifications The following notation should be preferred to ensure that
104. next original file This function has no counterpart with compression Typically a decompression cycle initially invokes flmghd which returns details about the original file such as file name record format etc This may be followed by flmguh to retrieve the user specific header if present Subsequent flmget calls retrieve one record per call with the last record of an original file being signalled by a special return code Skipping the remaining records of an original file can be done by flmpos which positions to the next file header A flmflu terminates a decompression cycle that may be followed by another cycle or by flmcls which terminates the processing One flmflu or flmpos per cycle is mandatory all other calls are optional 4 4 Description of flamrec Functions The next section describes the functions of the record interface in alphabetical order FLAM V4 3 UNIX36 2014 by limes datentechnik gmbh Chapter 4 The Record Interface flmcis Syntax Arguments flmid returncode cputime records bytes byteofl FLAM V4 3 UNIX The flmcls close function terminates the access to the record interface After the final matrix has been compressed during the compression procedure the compressed data is written in the FLAMFILE and the FLAMFILE is closed With Secure FLAMFILEs a file trailer is appended During the decompression procedure only the FLAMFILE is closed any remaining original records are n
105. nput output routines can be specified User io i n user io o ut user io The following user exits for file accesses can be specified exk10 exk20 exd10 exd20 The user input output routines and the user exits must be generated by the user and linked to the application program and flamup flam upu o module Only the parameters for the user input output routines and user exits which are valid in flamup are described below FLAM V4 3 UNIX 3 5 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The flamup Subprogram Call Chapter 3 exd10 Syntax Values Description exd20 Syntax Values Description 3 63 63 6 3 6 Frankenstein Limes Access Method exd10 specifies the name of a function which can be used to process the records of the decompressed file before they are written exd10 exit specification exit specification In this version only exd10 may be specified for exit specification exd10 defines a function which processes the records of the decompressed file s before they are written This code must be generated by the user and linked to flamup and the embedding user program see chapter 6 exd20 specifies the name of a function which can be used to process the records of the compressed file after they are read exd20 exit specification exit specification In this version only exd20 may be specified for exit specification exd20 defines a function which processes the re
106. nslate code table Code table This specifies a file containing the code table The code table is a string of 256 characters making up the character set into which the data is to be translated Please refer to Appendix C Code tables for further details of the code table If translate code table is specified for the compression procedure every record in the original file is translated according to the specified code table before it is buffered in the matrix buffer During the decompression procedure this specification causes every decompressed record to be translated according to the code table before it is inserted in the decompressed file When FLAM is installed code tables for converting from ASCII to EBCDIC and from EBCDIC to ASCII are made available as standard If one of the code tables in the default value file is to be used the following specifications are necessary a e to convert from ASCII to EBCDIC e a to convert from EBCDIC to ASCII 2 45 2014 by limes datentechnik gmbh The flam Command 2 462 462 462 46 Frankenstein Limes Access Method Chapter 2 2 4 File Specifications File specifications are subdivided into input specifications and output specifications The input specification for the compression procedure original file is specified by flamin and the output specification compressed file by flamfile The input specification for the decompression procedure compressed file is speci
107. nstruction or to a corresponding call of the user defined input output and not to a call of a record interface function Thus at least as far as the FLAMFILE is concerned the user exits are not synchronized with the application program since the latter is not able to establish for example whether or not a flmget call actually does initiate one or more read operations These user exits can be activated via the subprogram interface or the record interface the latter being able to activate the user exits for FLAMFILE accesses only The programs invoked through these interfaces must be staticly linked to the application see section 6 2 A user exit is invoked each time the file is opened read written or closed The functioncode argument indicates to the user exit the access type to permit it to respond in the appropriate manner to each particular situation FLAM supports the following user exits for file accesses lUserexit Invoked for accesses to Original file compress FLAMFILE compress Decompressed file decompress FLAMFILE decompress User exits exk10 and exk20 can be used during the compression procedure for accesses to the original file or to the FLAMFILE whereas exd10 and exd20 can be used during the decompression procedure to access the decompressed file or the FLAMFILE If records contained in the FLAMFILE were modified by user exit exk20 when FLAM V4 3 UNIX 2014 by limes datentechnik gmbh
108. nts of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done returncode This argument returns a return code to the invoking program filename length This argument contains the length of the buffer area in which the name of the original file must be returned The actual length is also returned by it filename This argument specifies the buffer area in which the name of the original file must be returned The name is saved there in the form of a character string If the area is not long enough only the number of characters in the name which the area can actually hold are returned 4 12 FLAM V4 3 UNIX312 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 4 organization record_format record_size record_delimiter FLAM V4 3 UNIX Frankenstein Limes Access Method The Record Interface This argument returns a value for the organization of the original file The possible values and their meanings some of which refer to organization types which either do not exist at all in UNIX or which are not supported by it are as follows sequential index sequential relative direct access no record structure library physical OnahkWNM O This argument returns a value for the record format of the original file The possible values and their meanings some of
109. o a long integer The structure of the record delimiter is described under the flmghd function The argument is reserved for future extensions This argument is reserved for future extensions This argument is reserved for future extensions This argument is used to activate the user defined input output These routines must be made available instead of the input output instructions and linked to the application program 7 User input output Other values Standard Implicit value at compression 0 flmopd is only permitted after a call to flmopn with continue param 0 The flmopd call itself must have continue param 0 if flmopf is to be called subsequently When called with device 7 the application program must be linked with user I O routines as described in section 5 2 A description of the return codes can be found in Appendix A Return codes 4 17 2014 by limes datentechnik gmbh The Record Interface flmopf Syntax Arguments flmid returncode flam_version flam_code 4 18 Frankenstein Limes Access Method Chapter 4 The flmopf open FLAM settings function enables the FLAM settings to be set or interrogated explicitly This call is not necessarily mandatory If it is not executed during the compression procedure implicit values are used instead for the relevant settings These are specified where applicable together with the descriptions of the various arguments flmopf can only be
110. om a file with exitk10 and compress them exklO functioncode returncode record pointer record length work long functioncode Function code long returncode Return code char record pointer Record pointer long record length Record length char work Work area returncode 0 Call after open or before close if functioncode 0 functioncode 8 return if record_pointer 1 Records whose type is 1 1st character in record are compressed all other records are skipped returncode 4 return 7 267 267 267 26 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Application Examples 7 8 2 Processing Records in a Compressed File with exd10 The decompressed records are not written in the decompressed file but are transferred by FLAM to exd10 for processing exd10 processes the records screen output shown here and does not return them for writing returncode 4 Process records in a compressed file with exitdl10 The decompressed records are not written in the decompressed file include lt stdio h gt exd10 functioncode returncode record pointer record length work long functioncode Function code long returncode Return code char record pointer Record pointer long record length Record length char work Work area returncode 0
111. option of encrypting compressed or uncompressed data Its heterogeneous compatibility also renders FLAM particularly suitable for long term archiving of data since the reproducibility of this data is no longer tied to the life cycle of a specific system In addition FLAM enables files to be converted in almost any way i e to files with a different organization a different record format or a different character set The architecture of the software is layer oriented i e it is made up of a series of hierarchically arranged functional groups which are completely distinct from one another and which communicate via defined interfaces Since these interfaces are open it is up to the user to choose the extent to which he wishes FLAM to be integrated in his applications FLAM can be invoked either by means of a command or by an application program via the corresponding interface Although FLAM is capable of compressing any type of file it was originally designed for files with a largely standardized record structure and character coded data It is most efficient at compressing such files The above requirements are normally satisfied if the processing application programs are written in a high level programming language This chapter attempts to assist the user in deciding when and if so how FLAM can be used effectively and with the optimum benefit The flam command may contain the necessary information either in the form of parameters i
112. or padded with the characters specified by padchar in the usropn FLAM requests the next record with usrget The maximum number of characters which can be transferred is specified in the buffer_length parameter If the record needs to be shortened as a result this must be indicated by the return code The return code must also indicate when the end of the file is reached The record size must be returned for each record which is read even if the record format is fixed usrcls causes the file to be closed The work area for this file is released again by FLAM after control has been handed back urspos is a dummy function in UNIX 1 13 2014 by limes datentechnik gmbh FLAM Overview 1 141 141 141 14 Frankenstein Limes Access Method Chapter 1 1 5 5 The User Exits A user exit is a user provided program that is invoked by FLAM at specific events during the processing via the defined interface FLAM supports two catagories of user exits file access exits and an exit for automatic key management 1 5 5 1 File Access Exits These exits permit the user to postprocess the records output by FLAM both those contained in the FLAMFILE and those in the decompressed file before they are finally saved i e they can be modified deleted or given additional records The records which are read by FLAM can be prepared for processing by FLAM in the same way The term access refers in this context either to an input output i
113. ore the output takes place and after FLAM has finished processing The user exit can evaluate and manipulate the record concerned or possibly insert additional records before handing control back to FLAM At the same time FLAM expects the user exit to supply instructions in the form of a return code telling it either how to continue processing or that it should abort due to an error User exits can be specified for FLAMFILEs when calls are made via the subprogram or record interface If FLAM calls are made using the record interface functions only user exits for the FLAMFILE can be activated since FLAM is not able to read or write the original and decompressed files For FLAM calls via the subprogram interface flamup access exits can be specified both for FLAMFILEs as well as for original or decompressed files The record interface flamrec only allows activating exits for FLAMFILEs since access to original or decompressed files then lies with the application program The User Exits 6 4 Frankenstein Limes Access Method Chapter 6 FLAM has the following access exits for compression exk10 This is activated after a record in the original file has been read exk20 This is activated before a record in the FLAMFILE is written FLAM has the following user exits for decompression exd10 This is activated before a record in the decompressed file is written exd20 This is activated after a record in the FLAMFILE has been read
114. ot transferred Statistical information is returned as well if it has been requested with flmopn statistics 0 void flmcls char flmid long returncode unsigned long cputime unsigned long records unsigned long bytes unsigned long byteofl unsigned long cmprecs unsigned long cmpbytes unsigned long cmpbytofl The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program This argument returns the current time in seconds units If statistical information has been requested with flmopn statistics 0 this argument returns the number of decompressed records which have been transferred with flmput or flmget The accumulated values of this counter are only significant if complete files are processed If statistical information has been requested with flmopn statistics 0 this argument returns the number of bytes in the decompressed records which have been transferred with flmput or flmget The accumulated values of this counter are only significant if complete files are processed If the accumulated value of the bytes argument exceeds 2 000 000 000 this counter is used for multiples of 2 000 000 000 4 7 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Recor
115. owing order 1 The command itself 2 The parameter files 3 The installed default values If the command itself contains any contradictory or incompatible information it is rejected and an error message is output FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command The following priority rules apply in all other situations If a FLAM operation is specified in the command compress decompress it has priority over all the other specifications If the command does not contain such a specification a search is made for it in the parameter file if one is named by parfile or by default If the operation is not specified as a FLAM parameter either the installed default value i e the default operation is taken instead Any specifications which are incompatible with the FLAM operation are rejected All specifications missing in the command are set according to the parameter file if one is specified either in the command itself or as an installation specific default value All settings which cannot be established either at all or in part after rules 1 to 3 have been applied are determined on the basis of the installation specific default values If the input or output specification is missing the special stdin and stdout files are used In the case of FLAM parameters specifications with a lower priority are always completely overr
116. pecification specifies a specific file a directory a search pattern with wildcards or or a list of such elements separated by commas The specified files are compressed in accordance with the other parameters specified for the command When a name refers to a directory all files in that directory and if present its subdirectories are compressed If the input specification contains more than one element the rules described in sections 2 4 1 and 2 4 3 regarding the syntax and the assignment to the FLAMFILE specifications must be observed 2 17 2014 by limes datentechnik gmbh The flam Command flamout Syntax Values Description 2 182 182 182 18 Frankenstein Limes Access Method Chapter 2 This parameter specifies the names of the decompressed files flamout output specification output specification The output specification specifies a specific files a search pattern with wildcards or or a list of such elements separated by commas It may also consist of one of the special output specifications or fileame see Sect 2 4 During the decompression procedure the decompressed data of the FLAMFILE is written in the specified file s If the output specification contains more than one file the rules described in sections 2 4 2 and 2 4 3 with regard to the syntax and the assignment to the FLAMFILE specifications must be observed FLAM V4 3 UNIX 2014 by limes datentechni
117. ppendix A Return codes 4 21 2014 by limes datentechnik gmbh The Record Interface flmphd Syntax Arguments flmid returncode filename_length filename organization 4 22 Frankenstein Limes Access Method Chapter 4 The flmphd put file header function is only allowed for the compression procedure It generates a common file header which describes the file format of the original records that are transferred subsequently If several different files are compressed into a single FLAMFILE a separate file header can be generated for each file with the flmphd function FLAM returns this file header information during the decompression procedure if it has been requested to do so with flmghd void flmphd char flmid long returncode long filename_length char filename long organization long record format long record size char record delimiter struct kd key description long block size long print control char system long continue param The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program This argument contains the length of the buffer area in which the name of the original file is transferred This argument specifies the buffer area in which the name o
118. put file is compressed in the cx7 mode and a character coded FLAMFILE is created However files should only be compressed in this mode if they do not contain any non printing characters It is a slightly less efficient mode though on the other hand the FLAMFILE which is created can be converted to other character sets e g from ASCII to EBCDIC without losing information With mode cx8 or mode vr8 the input file is com pressed in the cx8 or vr8 mode respectively and a binary FLAMFILE is created The purpose of these two modes is to ensure compatibility with previous versions The input file is compressed in the specified FLAM mode and when a password is entered encrypted with the selected method When mode adc is specified and a password is given the result is the same as with mode flamenc 2 27 2014 by limes datentechnik gmbh The flam Command msgfile Syntax Values Description 2 282 282 282 28 Frankenstein Limes Access Method Chapter 2 This parameter can be used to redirect FLAM message output to a file msgfile2 message file message file This specifies a file to which the FLAM messages must be written FLAM messages are output to stderr which is generally the users screen when working interactively With msgfile message file output can be sent to a file to act as a permanent copy for documenting the compression procedure This is important for batch processing for example However
119. r errmsg4 msglen strlen message retco 1 return retco 0 else retco fread cryptokey 1 countl khandle if yes read first part if retco count1 strcpy message char errmsg4 msglen strlen message retco 1 return read pos 0 retco fseek khandle read_pos SEEK_SET reposition on beginning if retco 0 wrap around strcpy message char errmsg3 msglen strlen message return count2 KMX KEY LENGTH countl1 retco fread amp cryptokey count1 1 then read second part count2 khandle if retco count2 strcpy message char errmsg4 msglen strlen message retco 1 return cryptokey KMX KEY LENGTH 0 Terminate string ckylen KMX KEY LENGTH Set length fclose khandle Close file return 7 327 327 327 32 Frankenstein Limes Access Method This function responds to requests passed via the user exit for automatic key management For FLAM to be able to activate it it must be a member of a shared library located in the lib subdirectory of FLAM s installation directory Assuming that this library is named libuserex so then to have this function manage the passwords automatically the flam command or
120. r Input Output Interface This argument is reserved for future extensions This argument transfers and returns a code for the record format of the file which must be opened The values are defined as follows 0 variable var_2b 1 fixed 2 undefined 3 stream 18 eaf 32 var_4b 40 var_ascii 48 var_ebcdic This argument transfers the record size of the file and may return this value for an input file The value O is set for variable record formats A value other than O is required for the fixed and undefined record formats This argument is reserved for future extensions The argument is reserved for future extensions This argument is reserved for future extensions This argument specifies the record delimiters which must be used when files with the stream record format are opened If the argument contains the value 0 the default delimiters are used If not the record delimiter is the contents of this argument The record delimiter has the following structure The most significant byte contains the number of bytes If the number of bytes is 1 the least significant byte contains the record delimiter If the number of bytes is 2 the second least significant byte contains the first byte of the record delimiter and the least significant byte contains the second byte of this delimiter e g 0a 00 00 01 UNIX record delimiter 0a Od 00 02 MS DOS record delimiter This argument transfers a padding character which is used
121. r is saved in the file header The names of the input and output files are entered interactively Example Compress a file The file include lt stdio h gt include lt time h gt include lt sys types h gt include lt sys stat h gt include lt errno h gt include fcntl h extern extern int errno int sys nerr include flamincl h int main char char char long long long long long long long long long long flmid kname 100 oname 100 flcode modus statis opmode blkmode header pretrl reclength namlen sattrlen union char c 4 char char char p sysattr datrec 2048 system 2 7 107 107 107 10 Frankenstein Limes Access Method header is written with a common part and a user part Record interface ID Name of compressed file Name of original file FLAM code Compression mode Statistics Open mode Block mode File header Feed control character Record length Length of file name Length of system specific information System specific information Data area Operating system FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 7 Application Examples long sanz Max no of records block unsigned long maxb Max buffer size in KB long lstpar Last parameter Compressed file long blksk Block si
122. racted from the original data however remain unaffected in all modes Their translation can be achieved by the translate parameter 2 15 2014 by limes datentechnik gmbh The flam Command flamfile Syntax Values Description 2 162 162 162 16 Frankenstein Limes Access Method Chapter 2 This parameter specifies the FLAMFILE s flamfile file specification file specification With compression file specification specifies a specific file or a list of files separated by commas A substitution rule is also permitted see Sect 2 4 With decompression file specification specifies a specific file a pattern with wildcards or or a list of such elements separated by commas During compression the compressed data is written in the specified file s During decompression the compressed data is read from the specified file s If the file specification contains more than one file the rules described in sections 2 4 1 to 2 4 3 with regard to the syntax of the file specification and the assignment to the input specification compression or the output specification decompression must be observed FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 flamin Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies the files to be compressed flamin input specification input specification The input s
123. racters for padding compressed records are not taken into account This parameter controls the information output by FLAM You can choose between detailed information all error messages and warnings either with or without statistics error or statistic and no information none During the decompression procedure you can decide just to show the information about the original file without cre ating a decompressed file Use show attributes to do so If the FLAMFILE contains compressed versions of several files the information about each of the original files is shown one file at a time However this information is only shown if this was specified when the files were compressed into the FLAMFILE see attributes parameter If show attributes is specified the output file parameter is ignored Message outputs can be redirected to a file by specifying 2 gt gt filename If msgfile filename is specified on the other hand the FLAM messages are written into a file but system messages continue to be displayed on the screen FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 translate Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter causes the codes for the data in the original file to be translated prior to the compression procedure or those for the data in the decompressed file to be translated after the decompression procedure tra
124. returncode argument is likewise contained in every argument list it serves either to confirm successful execution of a function or to report an error if one has occurred All the codes and their meanings are listed in Appendix A Return Codes together with the meaning of the additional information supplied in the most significant byte of the return code for all error types which occur in connection with file accesses As with the flamup subprogram the return codes of the record interface functions can be converted to message numbers or output with FLAM s internal message routine put_flmsg The Record Interface 4 4 Frankenstein Limes Access Method Chapter 4 The record interface comprises the following functions Correspon Calls flmcls Terminate processing of original close P ieandcoeoetaweue flmflu Terminate processing of original fflush PM Inewinoutcesng AME nn sequentially read ical header flmguh Reading user specific FLAM file aa eee header Opening a FLAMFILE flmphd Writing common FLAM file Cee ee flmpos Positioning to next FLAM file AN HN header s sequentially i peu ume Ju 4 2 Programming the Record Interface at Compression The process of creating a FLAMFILE can be divided into three phases open sequence one or more compression cycles termination function flmcls The open sequence always starts calling the flmopn function Subsequently flmopd and or flmopf can be called if f
125. rocedure for accesses to the decompressed file in order to postprocess the records which must be output It is activated by the flamup subprogram by means of the parameter exd10 exit specification in the argument parameter_string It takes over control after the decompressed file is opened before each write access and before the file is closed the record which must be written is made available to it prior to write accesses It sends a return code when it returns control to FLAM void exd10 long functioncode long returncode char record_pointer long record_length char work This argument transfers a function code to the user exit The valid values are as follows 0 First call for the file after open 4 Record made available in record buffer 8 Last call for the file before close The user exit sends a return code to FLAM with this argument see separate description of return codes and their meanings This argument contains a pointer to a character string If a call is specified with function code 4 it contains the address of the record which must be written This address can be modified by the user exit for example in order to insert a record If a call is specified with function code 4 this argument contains the length of the record which must be written This length can be modified by the user exit for example in order to insert a record This argument is a 1 Kbyte area which is made available by FLAM as a wor
126. s counters are not reset With Secure FLAMFILEs a member trailer is appended void flmflu char flmid long returncode unsigned long cputime unsigned long recoras unsigned long bytes unsigned long byteofl unsigned long cmprecs unsigned long cmpbytes unsigned long cmpbytofl The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done This argument returns a return code to the invoking program This argument returns the current time in seconds units If statistical information has been requested with flmopn statistics 0 this argument returns the number of decompressed records which have been transferred with flmput or flmget The accumulated values of this counter are only significant if complete files are processed If statistical information has been requested with flmopn statistics 0 this argument returns the number of bytes in the decompressed records which have been transferred with flmput or flmget The accumulated values of this counter are only significant if complete files are processed If the accumulated value of the bytes argument exceeds 2 000 000 000 this counter is used for multiples of 2 000 000 000 If statistical information has been requested with flmopn statistics 0 this argument returns the number of compressed records
127. s in user defined applications Flamrec Application Transfer and recall record programs individual records in user interface defined appliations User defined FLAM Replace FLAM input output input output routines User exits FLAM User defined file and record preprocessing and postprocessing for compressed and non compressed data Key management These interfaces have a hierarchical order which defines which interface can be used or invoked from where The interfaces are subdivided into two categories active and passive Active interface calls are initiated either by the user or by his application program they activate the FLAM routines which support them These routines include the command and the subprogram and record interfaces FLAM uses passive interfaces to activate user routines which are required to perform a particular range of functions but whose calls are not synchronized with the logic of the application program This category includes the user defined input output and the user exits The next few sections contain a brief description of the ways in which the different interfaces can be used without covering every single detail Each of the following chapters contains a detailed description of one of the interfaces and can be used as a reference document All the program interfaces i e all interfaces other than the command are represented in C notation in the reference chapters and the C header file flamincl h
128. se of the particular installation 2 23 2014 by limes datentechnik gmbh The flam Command Chapter 2 FLAM R 4 2 0 for Linux copyright c 2012 by limes datentechnik gmbh Build from Aug 2 2012 14 53 25 Expiration date 12 31 2012 Licensed for limes datentechnik gmbh Default settings attributes saenga ue mee quen he Se mie all decompress t lamcode wee Me p eques ASCII flamfile compressed file not specified recformat fix rTGGS326 bites adelante os 512 Elamin Source Bile vies aides 9e not specified inrecformat stream inrecdelim x 0a flamout decompressed file not specified outrecformat stream outrecdelim x 0a maxbHutfer eee c uw wey ERU ERIT NUS 32768 li xrecOrdSs s c 9 eg e rere o UR n 4095 message file v9 wee w eoe not specified MODE Juego uer bruce bu S ex adc Gnorypbdj On emm hae RU ases none OPE LON 62v 6c ee edere hm NER ee BIR nocut nosuppress parameter Pile soy sli X995 4 x wel not specified SHOW und edere ERR R a a a eae ee all translate conversion file not specified The list specifications ascii ebcdic and ebcdic ascii cause the respective code tables to be displayed The format of the display is the same as described for the setting of these default values see description of the parameter defaults 2 242 242 242 24 FLAM V4 3 UNIX Frankenstein Limes Access Met
129. sed blocks A compressed block may be contained in one or more records There is no relationship between the records in the compressed and non compressed files This parameter need only be specified for the compression procedure 2 41 2014 by limes datentechnik gmbh The flam Command show Syntax Values display option none all 2 422 422 422 42 Frankenstein Limes Access Method Chapter 2 This parameter specifies which information should be shown by FLAM show display option Display option Meaning No information is shown All the available information is shown This depends on the invoked operation compress or decompress but not on whether FLAM was invoked directly or using the parameter file The following information is shown during the compression procedure FLAM version FLAM settings Operation compress Code table Compression mode Matrix buffer size Maximum number of records matrix buffer Character set ASCII or EBCDIC attributes setting Name of the original file Formatting information for the original file Name of the compressed file FLAMFILE Formatting information for the compressed file Statistical information see show statistic Error messages and warnings FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 display option attributes error FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command Meaning The following information
130. sinput unsigned long rc FILE infile long il Close original file il fclose infile put_flmsg rc exit rc 7 147 147 147 14 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 Example The file include include include include include include extern extern include lt stdio h gt lt time h gt sys stat h lt errno h gt fcntl h int errno int sys nerr flamincl h int main char char char char long long long long long long long long long long long long char char char long flmid kname 100 oname 100 dname 100 flcode modus statis opmode blkmode header pretrl version reclength buflength namlen sattrlen sysattr 2048 datrec 2048 system 2 sanz unsigned long maxb long lstpar FLAM V4 3 UNIX Frankenstein Limes Access Method sys types h Application Examples 7 6 2 Decompressing a File The records of a file which have been decompressed by FLAM are recalled The file header which comprises a common part and a user specific part is read The names of the input and output files are entered interactively Decompress a file header is read with a common part and a user part Record interface ID Name of compressed file
131. sitions which must be skipped A description of the return codes can be found in Appendix A Return codes 5 9 2014 by limes datentechnik gmbh The User Input Output Interface Chapter 5 usrput Syntax Arguments workio returncode record_length record Return codes 5 105 105 105 10 Frankenstein Limes Access Method This function writes a record which has been transferred by FLAM sequentially void usrput char workio long returncode long record_length char record This argument is a 1 Kbyte area which is made available by FLAM as a work area each time a user input output function is invoked and which is not altered by FLAM between the calls This argument returns a return code to the invoking program This argument contains the record length in bytes This argument is the record buffer A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 5 FLAM V4 3 UNIX Frankenstein Limes Access Method The User Input Output Interface 5 2 Linking User Input Output Routines to Application Programs Data access with the aid of user input output routines is supported by FLAM both for subprogram interface calls and for record interface calls In order to be able to access data with FLAM by means of user input output routines the associated linked object files must be made available for all the access fu
132. t If a record delimiter is not specified for the stream record format OxOa is used as a default delimiter If outrecdelim 0d0a is specified the decompressed file can be generated in MS DOS format Any other character combinations are also allowed as record delimiters 2 33 2014 by limes datentechnik gmbh The flam Command outrecformat Syntax Values Description 2 342 342 342 34 Frankenstein Limes Access Method Chapter 2 This parameter specifies the record format of the decompressed file outrecformat format option format option See description of format options for inrecformat This parameter specifies the record format of the decompressed file The decompressed data is written in the file in the form of logical records with the specified format FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 outrecsize Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies the record size of the decompressed file outrecsize n n Integer number between 1 and 32760 This parameter specifies the record size of the decompressed files with a fixed or undefined record format For other record formats this indicates rhe buffer size 2 35 2014 by limes datentechnik gmbh The flam Command pad_char Syntax Values Description 2 362 362 362 36 Frankenstein Limes Access Method Chap
133. t compression and only if flmopf was called before with fileheader 1 Calls to flmphd with continue param 0 or after flmpwd must be followed immediately by flmpuh Return codes A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 4 23 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Record Interface Chapter 4 flmpos The flmpos position function can be used to advance to the end of the data in an original file during the decompression procedure in order to read the file header of the next file Syntax void flmpos char flmid long returncode long position Arguments flmid The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is set by the flmopn function and must not be changed until flmcls is done returncode This argument returns a return code to the invoking program position This argument effects a jump to the end of the data in an original file during a decompression procedure with 99 999 998 in other words either to the next FLAM file header or to the end of the FLAMFILE Dependencies flmpos may only be used at decompression Return codes A description of the return codes can be found in Appendix A Return codes 4 24 FLAM V4 3 UNIX324 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 4 flmpuh Syntax Arguments
134. tentechnik gmbh Appendix A Return Code 404 405 406 407 408 409 410 411 412 900 998 FLAM V4 3 UNIX Frankenstein Limes Access Method Return Codes Symbolic Name Meaning FLAM_SEQ_GHD Meaning Wrong sequence in flmghd call FLAM_SEQ_PUH Meaning Wrong sequence in flmpuh call FLAM_SEQ_GUH Meaning Wrong sequence in flmguh call FLAM_SEQ_PUT Meaning Wrong sequence in flmput call FLAM_SEQ_GET Meaning Wrong sequence in flmget call FLAM SEQ POS Meaning Wrong sequence in flmpos call FLAM SEQ FLU Meaning Wrong sequence in flmflu call FLAM SEQ CLS Meaning Wrong sequence in flmcls call FLAM SEQ PWD Meaning Wrong sequence in flmpwd call FLAM PARAMETER QUALIFIER Meaning FLAM options invalid flamup only FLAM INVALID LICENSE A 9 2014 by limes datentechnik gmbh Return Codes Return Code 999 A 10A 10A 10A 10 Frankenstein Limes Access Method Appendix A Meaning License invalid Symbolic Name Meaning FLAM INVALID FUNCTION Meaning Required call sequence was violated or request for memory could not be met FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Appendix A 1 half byte 2 half byte FLAM V4 3 UNIX Frankenstein Limes Access Method Return Codes lO error flags in the most significant byte of the return code Flag X ex X ax X Ix X cx X dx X 9x X 8x X 7x Flag X x0 X xf
135. ter 2 This parameter specifies the character which is used to pad the records in the decompressed file pad_char hexcode hexcode Hexadecimal characters between 00 and ff During the decompression procedure the record format and size of the decompressed file can be specified explicitly so that the record size is greater than in the original file In this case the records are padded to the specified length FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 parfile Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter permits the specifications in the command line to be supplemented or overridden by FLAM parameters in a parameter file parfile parameter file parameter file This parameter specifies a file containing FLAM parameters When no path is given the current directory is searched Specifying a parameter file permits default values to be overridden without the need for complex inputs in the command line see also section 2 5 Priority Rules for FLAM Settings This file can be created interactively using a text editor see example in Sect 2 6 One parameter file cannot refer to another i e it may not contain a parfile specification Furthermore it may not change the show parameter whose setting is determined when the command line is analyzed 2 37 2014 by limes datentechnik gmbh The flam Command Chapter 2
136. teristics which are specified with recformat recsize recdelim delete user io exd20 and exk20 all refer to this file This defines the default name for the input file during the compression procedure The input specification is a file specification It must name a single file uniquely an may not contain patterns wildcards Note that when a default name is defined stdin and pipelines can no longer be used for flamin With flamin none the default value for this parameter is dropped FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 flamout output specification flamout none inrecdelim inrecformat inrecsize maxbuffer maxrecords mode FLAM mode msgfilezmessage file msgfileznone optionz FLAM option outrecdelim outrecformat outrecsize parfilezparameter file parfileznone recdelim recformat recsize showzdisplay option translatezcode table translate none FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This defines the default name for the output file during the decompression procedure The output specification is a file specification It must name a single file uniquely and must not contain any patterns wildcards nor a substitution rule Note that when a default name is defined stdout and pipelines can no longer be used for flamout With flamout none the default value for this parameter is dropped See description of the inrecdelim parameter See descriptio
137. th mode adc the flamenc method is used for encryption A password entered as a character string is equivalent to a hexadecimal sequence consisting of its character codes and vice versa Note that a given character string entered on an ASCII system is not equivalent to the same string entered on a system using EBCDIC code Therefore for data exchange among systems with different character codes the hexadecimal format must be used if the codes of the password characters are not available on the keyboard This parameter cannot be set by default This parameter and kmexit are mutually exclusive FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 2 recdelim Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter specifies the record delimiter for the FLAMFILE recdelim record delimiter Hexadecimal characters between 01 and ff with a length of either 1 or 2 bytes This parameter permits a record delimiter to be specified for the stream record format If a record delimiter is not specified for the stream record format O0x0a is used as a default delimiter If recdelim 0d0a is specified for example the data can be output in MS DOS format This parameter can only be specified for the compression procedure 2 39 2014 by limes datentechnik gmbh The flam Command recformat Syntax Values form
138. th which is actually used user attributes This argument returns the user specific FLAM file header Dependencies flmguh may only be used at decompression It returns data from the user specific header that were stored with flmpuh Return codes A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 4 15 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The Record Interface flmopd Syntax Arguments flmid returncode continue_param filename_length filename 4 16 Frankenstein Limes Access Method Chapter 4 The flmopd open file description function enables special attributes of the FLAMFILE to be set or interrogated explicitly This call is not necessarily mandatory If it is not executed during the compression procedure implicit values are used instead for the relevant attributes of the FLAMFILE These are specified where applicable together with the descriptions of the various arguments flmopd can only be invoked following flmopn void flmopd char flmid long returncode long continue_param long filename_length char filename long organization long record format long record size char record delimiter struct kd key description long block size long close disposition long device The contents of flmid is a pointer to a character string This argument identifies the FLAMFILE for which the function is being executed It is s
139. the decompression procedure to ensure that the files are decompressed separately and given their original names again If an output file were to be specified a single file would result in which all the records of the original files would be concatenated 2 49 2014 by limes datentechnik gmbh The flam Command 2 502 502 502 50 Frankenstein Limes Access Method Chapter 2 2 5 Priority Rules for FLAM Settings Settings such as the type of operation compress or decompress the input output files etc can be entered either directly in the flam command or explicitly in a parameter file Implicit settings are also possible simply by omitting certain information for example the compression mode for the compression procedure The settings which apply automatically if any specifications are missing or redundant are determined by evaluating certain information in a fixed sequence this results in an order of priorities which is based both on the category and on the origin of the information Since parameter files may refer to other parameter files it is possible for several such files possibly containing contradictory information to be concatenated The first of these parameter files has priority over all the others If the same parameter is specified more than once within a parameter file however only the final specification is valid The information which is used to determine the FLAM settings is evaluated in the foll
140. the application program as a C function with the name exk20 The user exit is not invoked if the name begins either with a blank X 20 or with a binary zero X 00 If the user exit exitroutine_comp modifies the compressed record a corresponding user exit exitroutine_decomp must be specified for decompression so that the changes are undone again before the record is processed by FLAM exitroutine decomp This argument contains the name of a user exit in other words an executable program which is invoked each time the FLAMFILE is accessed during decompression This program must be linked to the application program as a C function with the name exd20 The user exit is not invoked if the name begins either with a blank X 20 or with a binary zero X 00 A user exit exitroutine_decomp must be specified if FLAMFILE records have been modified during the compression procedure by a user exit exitroutine comp and all the changes need to be undone again by this exit Dependencies flmopf may only be invoked immediately after a call to flmopn or flmopd with continue param 0 Return codes A description of the return codes can be found in Appendix A Return codes 4 20 FLAM V4 3 UNIX320 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 4 flmopn Syntax Arguments flmid returncode continue_param flam_open filename statistics Dependencies Return codes FLAM V4 3 UNIX Fran
141. to one another The assignment determines where the compressed data of each original file and the decompressed data of each compressed file is saved The input and output specifications are assigned to one another by means of their positions in the lists The first input specification is assigned to the first output specification and the second input specification to the second output specification etc If there are more input specifications than output specifications the excess input specifications are assigned to the final output specification If there are too many output specifications the excess ones are ignored If the output specification is a file specification all the outputs which result from processing the assigned input files are saved in this file The file attributes must be compatible If the output specification is a substitution rule a separate FLAMFILE which is named according to this rule is created during the compression procedure for each of the assigned input files During the decompression procedure the substitution rule is applied to the names of the FLAMFILEs and not to the FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command names of the compressed original files i e each FLAMFILE results in a separate decompressed file If a FLAMFILE which contains the compressed data of several different files is assigned an o
142. to pad short fixed size records when they are output This argument is reserved for future extensions 5 7 2014 by limes datentechnik gmbh The User Input Output Interface Chapter 5 close_disposition access filename_length fname Return codes 5 8 5 85 85 8 Frankenstein Limes Access Method This argument is reserved for future extensions This argument is reserved for future extensions This argument passes the length of the string filename of the file which must be opened and returns the length of the name This argument is reserved for future extensions A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 5 usrpos Syntax Arguments workio returncode position Return codes FLAM V4 3 UNIX Frankenstein Limes Access Method The User Input Output Interface The usrpos function increments the record key when a relative file is decompressed if gaps need to be generated in the decompressed file This function is not used it is a dummy function void usrpos char workio long returncode long position This argument is a 1 Kbyte area which is made available by FLAM as a work area each time a user input output function is invoked and which is not altered by FLAM between the calls This argument returns a return code to the invoking program This argument transfers the number of record po
143. ure usrpos is a dummy function The function which is not required usrget or usrput may also be a dummy function see chapter 5 3 9 2014 by limes datentechnik gmbh The flamup Subprogram Call Chapter 3 3 3 Linking flamup flamup is installed in two prelinked modules namely flam_up o and flam_upu o The flam_up o module contains dummy functions for the user input output routines and the user exits The flam_upu o module contains no user input output routines and no user exits flamup must be linked to the application program xyz with the following command ld o xyz usr lib flame flam_up o xyz c lc If the user wishes to use his own exits and or his own input output routines they must be linked to the application program In this case the flam_upu o module must be used instead of flam_up o It should be noted that all the user exits and or input output routines must be generated by the user and not just certain ones If the user wants to use just his own exits or just his own input output routines he can link the dummy routines flam usrmod o and flam exitmod o which are installed in usr lib flame for the other functions In this case the command is as follows ld o xyz usr lib flame flam upu o usr lib flame flam usrmod o D usr lib flame flam exitmod o xyz c lc usr lib flame flam usrmod o and or usr lib flame flam exitmod o must be replaced by the user s own modules Some UNIX systems require t
144. used for FLAM FLAMFILE and all the other parameter names The flam Command Syntax 2 42 42 42 4 Frankenstein Limes Access Method Chapter 2 2 2 Command Syntax The shell command flam invokes the utility either interactively or from a shellscript FLAM parameter value Since the parameters can be specified in a parameter file as well as in the command and since the missing parameters necessary to execute a particular function must then be taken from the default value file the order of the specifications is arbitrary Parameters and their values may be abbreviated by omitting as much of their endings as possible without causing ambiguity For example recs may be used for recsize while using less characters could be taken to mean recdelim recformat or recsize The parameters which are allowed for each function are specified in the appropriate sections of this chapter A detailed description of all the parameters in alphabetical order can be found in section 2 3 For better redability all parameters in this manual are preceded by a minus sign Its use however is optional Notational remark On this and the following pages square brackets and denote syntax elements optional in the respective contexts Command parts printed in italics are to be substituted by the user for actual values Ellipses stand for repetitions of the previous syntax element FLAM V4 3 UNIX 2014 by l
145. ust be returned in the record_pointer and record_length arguments The user exit is invoked again for the original record Terminate compression procedure Error in user exit abnormal termination FLAM V4 3 UNIEj10 2014 by limes datentechnik gmbh Chapter 6 exk20 Syntax Arguments functioncode returncode record_pointer record_length work FLAM V4 3 UNIX Frankenstein Limes Access Method The User Exits This user exit can be used during the compression procedure to process the records in the FLAMFILE before they are written It can be activated either by the flamup subprogram or by the record interface It is specified in the subprogram call by means of the parameter exk20 exit specification in the argument parameter_string and in the flmopf function by means of the argument exitroutine_comp It takes over control after the FLAMFILE is opened before each write access and before the file is closed the record which must be written is made available to it before write accesses It sends a return code when it returns control to FLAM void exk20 long functioncode long returncode char record_pointer long record_length char work This argument transfers a function code to the user exit The valid values are as follows 0 First call for the file after open 4 Record made available in record buffer 8 Last call for the file before close The user exit sends a return code to FLAM with this
146. ut specification or can then be set so that FLAM automatically restores both the entered file specification and the associated characteristics If attributes none no information about the original file is entered in the FLAMFILE FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 The flam Command compress This parameter causes FLAM to compress the original file Syntax compress Values None Description When FLAM is invoked compress must be specified in order to compress the original file and create a FLAMFILE FLAM V4 3 UNIX 2 9 Frankenstein Limes Access Method 2014 by limes datentechnik gmbh The flam Command decompress Syntax Values Description 2 102 102 102 10 Frankenstein Limes Access Method Chapter 2 This parameter causes FLAM to decompress the compressed file decompress None When FLAM is invoked decompress must be specified in order to decompress the compressed file and create a decompressed file or show the information about the original file s FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 defaults Syntax Values ascii ebcdicz translation option attributes attribute option compress FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter permits the installation specific default values to be modified It can only be used by the system manager defaultse default specification
147. utin write and read with key new file FLAM PPCHAR linkname Link name file name FLAM PLONG fcbtype Organization 0 8 16 sequential 1 9 17 index sequential 2 10 18 relative 3 11 19 direct access 5 13 21 library 6 14 22 physical negative use system specific attributes if open output sattrlen not equal to 0 7 207 207 207 20 FLAM V4 3 UNIX Frankenstein Limes Access Method 2014 by limes datentechnik gmbh Chapter 7 FLAM_PLONG recform FLAM PLONG recsize FLAM PLONG blksize PSTRKD keydesc FLAM PLONG device FLAM PCHAR recdelim FLAM PCHAR padchar FLAM PLONG prcrtl FLAM PLONG closdisp FLAM PLONG access FLAM V4 3 UNIX Frankenstein Limes Access Method Application Examples Record format 0 8 16 variable 8 blocked 16 blocked spanned 24 VFC 32 2 byte size field 40 4 byte ASCII size field 48 4 byte EBCDIC size field 1 9 17 fixed 8 blocked 16 blocked standard 2 10 18 undefined 18 EAF 3 11 19 stream negative use system specific attributes if open output sattrlen not equal to 0 Record size 0 32767 recform v Max record size 0 recform f Record size recform u Max record size 0 recform s Max record size 0 Block size 0 unblo
148. utive routines and are invoked by FLAM They thus have no control over the order in which they are activated and must respond context sensitively to each call If they need RAM in order to do so the file is assigned an area of 1 Kbyte for each usropn call the same area remains assigned each time this file is called subsequently Since the FLAM concept always entails reading data from one file and writing it in another user input output routines are simply alternative file accesses from FLAM s point of view irrespective of the actions which are actually performed by them User input output routines must therefore incorporate the following functions e usrcls e usrget e usropn e UsSrpos e Usrput These functions must conform to the interface conventions i e they must be defined with the specified name the type and length of their arguments must match and their return codes must reflect the success or error situation correctly Instructions for linking user input output routines can be found at the end of this chapter The User Input Output Interface Chapter 5 usrcls Syntax Arguments workio returncode Return codes 5 4 5 45 45 4 Frankenstein Limes Access Method This function closes a file void usrcls char workio long returncode This argument is a 1 Kbyte area which is made available by FLAM as a work area each time a user input output function is invoked and which is not altered by FLAM bet
149. utput file all the compressed data in this FLAMFILE is decompressed into the output file The output specification or is then necessary in order to create separate files again In this case each compressed block is decompressed into a file with the original name In the example below the flam command contains a list of input specifications and a list of output specifications flam compress attributes all flamin dat txt funcl hlp func2 hlp flamfile dat cmp text arc hlp xyz The list of input specifications contains four entries namely the output specifications two substitution rules and a file specification In accordance with the assignment rules a file with the same name and a cmp extension is created for each file which has a dat extension and the compressed data of all the files with a txt extension is saved in a single FLAMFILE called text arc The compressed data of funci hlp is saved in funcixyz on account of the substitution rule contained in the final output specification Since there are no further output specifications this rule is also applied to func2 hlp i e a FLAMFILE called func2xyz is created for its compressed data It should be noted that text arc can only be decompressed into separate files if attributes all is specified for the compression procedure so that the names of all the original files are included in the FLAMFILE Either of the output specifications or can be used for
150. value The syntax of the default specifications is the same as that of the flam parameters In addition there are also the ascii_ebcdic and ebcdic ascii parameters When defining default settings one should take into account that some settings cannot be modified by the user via command line or parameter file entries This is the case for example when defaults flamin is defined The name of the file may still be modified but there is no way to use stdin as input FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 2 flamcode Syntax Values character set ascii ebcdic Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flam Command This parameter defines the character set for character coded information in the FLAMFILE when a file is compressed such as the file name and control characters flamcode character set Meaning Use ASCII code for the FLAMFILE Use EBCDIC code for the FLAMFILE This parameter specifies the character set which is to be used to represent character coded information in the FLAMFILE during the compression procedure In adc cx8 and vr8 modes this only concerns the information contained in the FLAM file header such as the original file name and a few control characters since the compressed file is represented in binary form In the cx7 mode all the FLAM control characters in the compressed file are also coded in this character set The characters ext
151. ween the calls This argument returns a return code to the invoking program A description of the return codes can be found in Appendix A Return codes FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 5 usrget Syntax Arguments workio returncode record_length record buffer_length Return codes FLAM V4 3 UNIX Frankenstein Limes Access Method The User Input Output Interface This function reads a record sequentially and transfers it to FLAM void usrget char workio long returncode long record_length char record long buffer_length This argument is a 1 Kbyte area which is made available by FLAM as a work area each time a user input output function is invoked and which is not altered by FLAM between the calls This argument returns a return code to the invoking program This argument returns the length of the record which has been read in bytes This argument is the record buffer This argument contains the length of the record buffer in bytes A description of the return codes can be found in Appendix A Return codes 5 5 2014 by limes datentechnik gmbh The User Input Output Interface Chapter 5 usropn This function opens the file whose specification is transferred by the filename argument Syntax void usropn char workio long returncode long file open char fname long organization long record format long record size long block siz
152. which refer to record formats which do not exist in UNIX are as follows 0 variable 1 fixed 2 undefined 3 stream 8 var blocked 9 fix blocked 16 var blocked spanned 17 fix blocked standard 18 eaf 24 vic 32 var 4b 40 var ascii 48 var ebcdic This argument returns the record size of the original file The value O is set for variable record sizes and for the stream record format This argument specifies the record delimiter for the stream record format The character string is 4 bytes long corresponding to a long integer The record delimiter has the following structure The most significant byte contains the number of bytes If the number of bytes is 1 the least significant byte contains the record delimiter If the number of bytes is 2 the second least significant byte contains the first byte of the record delimiter and the least significant byte contains the second byte of this delimiter e g 0x0100000a record delimiter LF Ox0a 0x02000d0a record delimiter CR LF 0x0d0a 4 13 2014 by limes datentechnik gmbh The Record Interface Chapter 4 key_description This argument is reserved for future extensions block_size This argument is reserved for future extensions print_control This argument is reserved for future extensions system This argument consists of two bytes and is used to return a code for the operating system in which the FLAMFILE was created The meaning of this hexadecimal code is as fol
153. x Values Description 3 83 83 8 3 8 Frankenstein Limes Access Method This parameter specifies that the user defined input output routines should be used for the original file instead of those provided by FLAM inuser_io None The original file s are read with the input output routines generated by the user The usropn usrget and usrcls functions are required to do so the usrput and usrpos functions may be dummy functions see chapter 5 This parameter specifies that the user defined input output routines should be used for the decompressed file instead of those provided by FLAM outuser_io None The decompressed file s are read with the input output routines generated by the user The usropn usrput and usrcls functions are required to do so the usrget and usrpos functions may be dummy functions see chapter FLAM V4 3 UNIX 2014 by limes datentechnik gmbh Chapter 3 user_io Syntax Values Description FLAM V4 3 UNIX Frankenstein Limes Access Method The flamup Subprogram Call This parameter specifies that the user defined input output routines should be used for the compressed file instead of those provided by FLAM user_io None The compressed file s are read or written with the input output routines generated by the user The usropn and usrcls functions are always required to do so usrput is required additionally for the compression procedure and usrget for the decompression proced
154. y a call to flmflu which causes the remainder in the compression buffer to be compressed and the output of the result This function also returns statistical information to the application Following this a new compression cycle may be initiated by another flmphd or the FLAMFILE can be closed by calling flmcls Control is always returned to the invoking program There are no error exits and no error messages are generated by the record interface Rather a return code is passed back to the application 4 5 2014 by limes datentechnik gmbh The Record Interface 4 6 Frankenstein Limes Access Method Chapter 4 4 3 Programming the Record Interface at Decompression As with compression decompressing a FLAMFILE also consists of three phases open sequence decompression cycle s termination function flmcls The open sequence here consists of the same function calls as at compression Only the direction of the flow of information is reversed for some of the arguments e g the compression mode They are returned to the application Every function used in the compression cycle has its decompression counterpart that performs the complementary operation The complements for flmphd and flmpuh are flmghd and flmguh respectively that for flmput is flmget A decompressin cycle is also terminated with flmflu In addition there is a function flmpos which advances the read position in a FLAMFILE to the beginning of the
155. ze long recfk Record format long recsk Record size long devk Device long orgak Organization union char c 4 unsigned long i recdelk Record delimiter long cldispk Close disposition struct kd keydesck Key description Original file long devo Device long orgao Organization long blkso Block size long recfo Record format long recso Record size if fixed union char c 4 unsigned long i recdelo Record delimiter long cldispo Close disposition struct kd keydesco Key description char exk20 34 Name of exit routine char exd20 34 Name of exit routine char ptr Pointer long il Integer unsigned long rc Return code unsigned long cputime CPU time unsigned long zks Record counter unsigned long zkb Byte counter unsigned long zkbofl Byte counter overflow unsigned long zunks Record counter unsigned long zunkb Byte counter unsigned long zunkbofl Byte counter overflow FILE infile Input file long uattrlen Length of user information static char usrattr 50 The file contains data belonging to application xyz Enter file name printf File name input scanf s oname printf File name output scanf s kname Open original file infile fopen oname r if infile NULL exit 1 FLAM
Download Pdf Manuals
Related Search
Related Contents
LevelOne IFS-0502 network switch Sony CDX-F7710 CD Player User Manual-SND-5010-ENGLISH_Web.indb TELECHARGEMENT ET INSTALLATION DES Worldwide Lighting W83532C6-CL Installation Guide FiberMix 832-60(-BL) User Manual Untitled Télécharger la fiche technique produits - V Deutschsprachige Anleitung als PDF - Uni Copyright © All rights reserved.
Failed to retrieve file