home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / tools / workbench / fv-220 / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-17  |  3.1 KB  |  146 lines

  1. /* fv is a binary file editor written by Chris Hooper (cdh@mtu.edu)
  2.  *      on 6-2-91 and has gone through many revisions since then.
  3.  *      Much inspiration was given by Bill Moore, the first real user!
  4.  *   Owner:  CHRISTOPHER D HOOPER
  5.  *
  6.  *   fv source Copyright (c) 1992 - 1998  Chris Hooper
  7.  *
  8.  *   Modification and redistribution is strictly prohibited.
  9.  *   Sale of this software above media cost is prohibited.
  10.  *
  11.  *   Except for above two restrictions, this software may be used for
  12.  *       any purpose, commercial and private.
  13.  *
  14.  *   Disclaimer:  This product is fit for no use, foreign or domestic.
  15.  *                Use implies knowledge you intend to destroy something.
  16.  */
  17.  
  18.  
  19. #define MAXLEN          512
  20.  
  21. #define uchar unsigned char
  22. #define ulong unsigned long
  23. #define uint  unsigned int
  24.  
  25. #define ESC    27
  26. #define HEX    0
  27. #define STRING    1
  28. #define EDIT_STRLEN 500
  29.  
  30. extern char    out_string[];
  31. extern uchar    *buffer;
  32. extern ulong    *ibuffer;
  33. extern int    buf_size;
  34. extern int    max_buf_size;
  35. extern int     daddr;
  36. extern int    addis;
  37. extern int    chdis;
  38. extern int    wdis;
  39. extern int    force_ronly;
  40. extern int    force_write;
  41. extern int    ronly;
  42. extern int    mode;
  43. extern int    wdismode;
  44. extern int     dirty;
  45. extern int    looping;
  46. extern int    wpline;
  47. extern int    cpline;
  48. extern int    divisor;
  49. extern int    divisor2;
  50. extern int    divmod;
  51. extern int    divmod2;
  52. extern int    view_address;
  53. extern int    global_type;
  54. extern int    global_direction;
  55. extern int    global_num;
  56. extern int    prompting;
  57. extern int    stopping;
  58. extern int    global_special[MAXLEN];
  59. extern int    swapmode;
  60. extern int    swapbytes;
  61. extern int    Swapbytes;
  62. extern int    SWAPBYTES;
  63. extern int    kbuffer_size;
  64. extern int    noscreen;
  65. extern int    filenum;
  66. extern int    filenames;
  67. extern char    *filename[256];
  68. extern char    *hex;
  69. extern ulong    fend;
  70. extern ulong    last_viewed;
  71. extern ulong    file_sz[];
  72. extern uchar    ascii[];
  73. extern uchar    global_search[MAXLEN];
  74. extern int    alignment;
  75.  
  76. char    *strchr();
  77. int    get_key();
  78. void    unget_key();
  79. void    error_exit();
  80. void    status_mode();
  81. int    colon_mode();
  82. ulong     file_end();
  83.  
  84. #define STATIC static
  85. #define ALIGN(x) x &= ~(alignment - 1)
  86. #define ALIGNED(x) ((x) & ~(alignment - 1))
  87.  
  88. #ifdef ALIGN_VIEW
  89. #define VALIGN(x) ALIGN(x)
  90. #else
  91. #define VALIGN(x) /* */
  92. #endif
  93.  
  94. #if defined(sun)
  95. #    if !defined(Solaris1) && !defined(Solaris2)
  96. #        if defined(__svr4__) || defined(__SVR4)
  97. #        define Solaris2
  98. #        else
  99. #        define Solaris1
  100. #        endif
  101. #    endif
  102. #    ifndef SunOS
  103. #        define SunOS
  104. #    endif
  105. #endif
  106.  
  107. #if (defined(_OS9000) || defined(_OSK)) && !defined(OS9)
  108. #    define OS9
  109. #endif
  110.  
  111. #if defined(__FreeBSD__) && !defined(FreeBSD)
  112. #    define FreeBSD
  113. #endif
  114.  
  115. /* dcc defines AMIGA */
  116. #if (defined(AMIGA) || defined(amiga)) && !defined(Amiga)
  117. #    define Amiga
  118. #endif
  119.  
  120. #if defined(linux) && !defined(Linux)
  121. #    define Linux
  122. #endif
  123.  
  124. #ifdef LITTLE_ENDIAN
  125. #    undef LITTLE_ENDIAN
  126. #endif
  127.  
  128. #if defined(__i486__) || defined(i386) || defined(Win32) || defined(_MPFARM) || defined(_MPF386) || defined(__i386)
  129. #    ifndef LITTLE_ENDIAN
  130. #        define LITTLE_ENDIAN
  131. #    endif
  132. #else
  133. #    undef LITTLE_ENDIAN
  134. #endif
  135.  
  136. #ifdef Linux
  137. #    include <endian.h>
  138. #    if __BYTE_ORDER == __BIG_ENDIAN
  139. #        undef LITTLE_ENDIAN
  140. #    else
  141. #        ifndef LITTLE_ENDIAN
  142. #            define LITTLE_ENDIAN
  143. #        endif
  144. #    endif
  145. #endif
  146.