home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 10 / Sonderheft_12.iso / best-of-tools / packer / xpk3.11 / xpk_source / include / sdi_defines.h < prev   
C/C++ Source or Header  |  1996-11-26  |  4KB  |  158 lines

  1. #ifndef SDI_DEFINES_H
  2. #define SDI_DEFINES_H
  3.  
  4. /* Includeheader
  5.  
  6.     Name:        SDI_defines
  7.     Versionstring:    $VER: SDI_defines.h 1.22 (18.11.96)
  8.     Author:        SDI
  9.     Distribution:    PD
  10.     Description:    standard defines and Makros and the version string
  11.  
  12.  1.0    : aus ...SDI.h Files aufgebaut
  13.  1.1    : SDI_ERROR eingefügt
  14.  1.2    : INFO's verbessert
  15.  1.3    : SDI_ERROR entfernt
  16.  1.4    : INFO_ERR berichtigt
  17.  1.5    : wenn DATE nicht definiert, dann DATE == __DATE2__
  18.  1.6    : DEBUG Teile eingeführt
  19.  1.7    : DEBUG's etwas geändert
  20.  1.8    : OS_VERSION und TEST_OS eingeführt
  21.  1.9   10.08.95 : OS_VERSION verkürzt
  22.  1.10  18.08.95 : DEBUG_BREAKS ergänzt
  23.  1.11  23.09.95 : NOVERSION ergänzt
  24.  1.12  15.10.95 : jetzt STRPTR version
  25.  1.13  05.02.96 : isprintSDI, isHEXNum entfernt
  26.  1.14  13.04.96 : Versionsstring in Header
  27.  1.15  28.05.96 : ENDCODE eingebaut
  28.  1.16  05.06.96 : Protos für End und extern def für version auch ohne
  29.      die defines, ausgenommen mit NOCODE define, TEST_OS, OS_VERSION
  30.      entfernt
  31.  1.17  12.06.96 : RETURN_WARN instead of RETURN_ERROR in ENDCODE
  32.  1.18  06.07.96 : ENDCODE: PrintFault behind end --> allows selecting output
  33.  1.19  21.08.96 : added __SASC __AMIGADATE__ support
  34.  1.20  24.08.96 : better SAS-C support
  35.  1.21  04.09.96 : changed error with SAS date having the brackets already
  36.  1.22  18.11.96 : converted to english, C++ comments to C ones
  37. */
  38.  
  39. #include <exec/types.h>
  40.  
  41. /* ========================== spart <stdlib.h> ========================== */
  42.  
  43. extern void exit(int);
  44.  
  45. /* ============== Defines für GetCharHEX und GetCharSTRING ============== */
  46.  
  47. #define PATTERN_BACK        351  /* '_' bei Ausgabe */
  48. #define PATTERN            '?'
  49. #define PATTERN_VORZ        92   /* '\'        */
  50. #define BACK_MAX        256
  51.  
  52. /* ========================== sonstige Makros =========================== */
  53.  
  54. /* <pragma/exec_lib.h>, <dos/dos.h> */
  55.  
  56. #define CTRL_C        (SetSignal (0L,0L) & SIGBREAKF_CTRL_C)
  57.  
  58. /* ===================== Makros für Infotextausgabe ===================== */
  59.  
  60. /* <pragma/dos_lib.h>, <dos/dos.h> */
  61.  
  62. #define IS_PAR_HELP    (argc > 1 && argv[1][0] == '?')
  63.  
  64. #define INFO_OK  {PutStr(NAME " : "); PutStr(Info_Head);    \
  65.         PutStr(Info_Text); exit(RETURN_FAIL);}
  66. #define INFO_ERR {PutStr(NAME " : "); PutStr(Info_Head);    \
  67.         PrintFault(ERROR_REQUIRED_ARG_MISSING,0); exit(RETURN_FAIL);}
  68.  
  69. /* ======================== Zeichendefinitionen ========================= */
  70.  
  71. #define BS     8
  72. #define ESC    27
  73.  
  74. /* ========================== Debug - Defines =========================== */
  75.  
  76. /*
  77. #define DEBUG            // Standard Debugging
  78. #define DEBUG_LOOP        // innerhalb von Schleifen
  79. #define DEBUG_INC_FUNC        // Ausgaben der Includefunktionen
  80. #define DEBUG_BREAKS        // für Breakpoints mit Wait
  81. #define DEBUG_OLD        // DEBUG defines which aren't needed actually
  82. */
  83.  
  84. /* ================================= SAS C ============================== */
  85.  
  86. #ifdef __SASC
  87.   extern struct ExecBase    *SysBase;
  88.   extern struct DosLibrary    *DOSBase;
  89.   #include <dos/dosextens.h>
  90.  
  91.   #define TestOS if(DOSBase->dl_lib.lib_Version < DosVersion)    \
  92.              exit(RETURN_FAIL)
  93. #endif
  94.  
  95. /* ===================== Versionsstring und EndCode ===================== */
  96.  
  97. #ifndef NOCODE
  98.   extern STRPTR version;        // Proto für Version
  99.   extern void End(UBYTE);        // Proto für End
  100.  
  101.   #if !defined(NOVERSION) && defined(NAME)
  102.     #ifndef AUTHOR
  103.       #define AUTHOR "by SDI"
  104.     #endif
  105.     #ifndef VERSION
  106.       #define VERSION "1"
  107.     #endif
  108.     #ifndef REVISION
  109.       #define REVISION "0"
  110.     #endif
  111.     #ifndef DATE
  112.       #ifdef __MAXON__
  113.         #define DATE __DATE2__
  114.       #elif defined(__SASC)
  115.         #define DATE __AMIGADATE__
  116.       #endif
  117.     #endif
  118.     #ifdef __MAXON__
  119.       #define SDI_DATE "(" DATE ")"
  120.     #elif defined(__SASC)
  121.       #define SDI_DATE DATE
  122.     #endif
  123.  
  124.     #ifndef DISTRIBUTION
  125.       #define DISTRIBUTION "(PD) "
  126.     #endif
  127.     STRPTR version = (STRPTR) "$VER: " NAME " " VERSION "." REVISION " "
  128.     SDI_DATE " " DISTRIBUTION AUTHOR;
  129.  
  130.   #endif /* !NOVERSION && NAME */
  131.  
  132.   #if defined(ENDCODE) || defined(ENDCODE_NOCTRLC)
  133.     #ifdef __MAXON__
  134.       #define __inline
  135.       inline
  136.     #endif
  137.       void __inline end(void);
  138.     void End(UBYTE err)
  139.     {
  140.       #ifndef ENDCODE_NOCTRLC
  141.       if(CTRL_C)
  142.       {
  143.         err = RETURN_WARN;
  144.         SetIoErr(ERROR_BREAK);
  145.       }
  146.       #endif
  147.  
  148.       end();
  149.  
  150.       if(err)        PrintFault(IoErr(), 0);
  151.       exit(err);
  152.     }
  153.   #endif /* ENDCODE && ENDCODE_NOCTRLC */
  154. #endif /* NOCODE */
  155.  
  156. #endif /* SDI_DEFINES_H */
  157.  
  158.