?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #ifndef MHMT_GLOBALS_H
  2.  
  3. #define MHMT_GLOBALS_H
  4.  
  5.  
  6. #include <stdio.h>
  7. #include "mhmt-types.h"
  8.  
  9. //#define DBG
  10.  
  11.  
  12. // packer/depacker type constants, used in struct global
  13. #define PK_MLZ  1
  14. #define PK_HRM  2
  15. #define PK_HST  3
  16. #define PK_ZX7  4
  17.  
  18.  
  19.  
  20. // definition of a global configuration/working structure:
  21. // holding parsed commandline options, file sizes/descriptors,
  22. // allocated memory arrays etc.
  23. struct globals
  24. {
  25.         ULONG packtype; // packer/depacker type: one of PK_* constants
  26.  
  27.         ULONG greedy; // zero if no greedy mode coding (optimal coding), non-zero if greedy mode
  28.  
  29.         ULONG mode; // zero if packing, non-zero if depacking
  30.  
  31.         ULONG zxheader; // zero if no zx header needed, non-zero if zx header is needed.
  32.                         // zx header, among other, contain some bytes from the end of the unpacked file
  33.  
  34.         ULONG wordbit; // zero if bitstream is spread in 8bit (one-byte) chunks across bytestream,
  35.                        // non-zero if chunks are 16bit (two-byte).
  36.  
  37.         ULONG bigend; // zero if 16bit bitstream chunks are little-endian, non-zero if big-endian:
  38.                       // for 16 consecutive bits abcdefghijklmnop, big-endian will be
  39.                       // consecutive bytes [abcdefgh],[ijklmnop], little-endian [ijklmnop],[abcdefgh]
  40.  
  41.         ULONG fullbits; // nonzero if 'full bits', i.e. new bitword in depacker fetched after last bit consumed
  42.                         // zero if 'empty bits', new bitword fetched when bit is needed but no ones left
  43.  
  44.         ULONG maxwin; // maximum window (or lookback), positive number, which is one of:
  45.                      // 256,512,1024,2048,4096,4352,8192,16384,32768 or 65536
  46.  
  47.         ULONG prebin; // nonzero if pre-binary file is specified in arguments
  48.  
  49.  
  50.         char * fname_in;
  51.         char * fname_out;
  52.         char * fname_prebin; // filename of prebin file
  53.  
  54.         FILE * file_in;
  55.         FILE * file_out;
  56.         FILE * file_prebin;
  57.  
  58.         UBYTE * indata;     // to use in normal depacking process -- begins from input file data
  59.         UBYTE * indata_raw; // to pre-parse prebin file or to free() array -- begins from prebin file if any or from input file (if no prebin)
  60.  
  61.         ULONG inlen;
  62.  
  63.         ULONG prelen;
  64. };
  65.  
  66.  
  67. extern struct globals wrk;
  68.  
  69.  
  70.  
  71. void init_globals(void);
  72. void free_globals(void);
  73.  
  74.  
  75.  
  76. #endif
  77.  
  78.