home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / packery / xpk_source / include / sdi_defines.h < prev   
C/C++ Source or Header  |  1996-10-19  |  4KB  |  155 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.21 (04.09.96)
  8.     Author:        SDI
  9.     Distribution:    PD
  10.     Description:    Standard Defines und Makros, sowie Versionsstring
  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 statt RETURN_ERROR in ENDCODE
  32.  1.18  06.07.96 : ENDCODE: PrintFault hinter end --> ermöglicht SelectOutput
  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. */
  37.  
  38. #include <exec/types.h>
  39.  
  40. /* ========================== spart <stdlib.h> ========================== */
  41.  
  42. extern void exit(int);
  43.  
  44. /* ============== Defines für GetCharHEX und GetCharSTRING ============== */
  45.  
  46. #define PATTERN_BACK        351  // '_' bei Ausgabe
  47. #define PATTERN            '?'
  48. #define PATTERN_VORZ        92   // '\'
  49. #define BACK_MAX        256
  50.  
  51. /* ========================== sonstige Makros =========================== */
  52.  
  53. // <pragma/exec_lib.h>, <dos/dos.h>
  54.  
  55. #define CTRL_C        (SetSignal (0L,0L) & SIGBREAKF_CTRL_C)
  56.  
  57. /* ===================== Makros für Infotextausgabe ===================== */
  58.  
  59. // <pragma/dos_lib.h>, <dos/dos.h>
  60.  
  61. #define IS_PAR_HELP    (argc > 1 && argv[1][0] == '?')
  62.  
  63. #define INFO_OK  {PutStr(NAME " : "); PutStr(Info_Head);    \
  64.         PutStr(Info_Text); exit(RETURN_FAIL);}
  65. #define INFO_ERR {PutStr(NAME " : "); PutStr(Info_Head);    \
  66.         PrintFault(ERROR_REQUIRED_ARG_MISSING,0); exit(RETURN_FAIL);}
  67.  
  68. /* ======================== Zeichendefinitionen ========================= */
  69.  
  70. #define BS     8
  71. #define ESC    27
  72.  
  73. /* ========================== Debug - Defines =========================== */
  74.  
  75. // #define DEBUG        // Standard Debugging
  76. // #define DEBUG_LOOP        // innerhalb von Schleifen
  77. // #define DEBUG_INC_FUNC    // Ausgaben der Includefunktionen
  78. // #define DEBUG_BREAKS        // für Breakpoints mit Wait
  79. // #define DEBUG_OLD        // DEBUG defines which aren't needed actually
  80.  
  81. /* ================================= SAS C ============================== */
  82.  
  83. #ifdef __SASC
  84.   extern struct ExecBase    *SysBase;
  85.   extern struct DosLibrary    *DOSBase;
  86.   #include <dos/dosextens.h>
  87.  
  88.   #define TestOS if(DOSBase->dl_lib.lib_Version < DosVersion)    \
  89.              exit(RETURN_FAIL)
  90. #endif
  91.  
  92. /* ===================== Versionsstring und EndCode ===================== */
  93.  
  94. #ifndef NOCODE
  95.   extern STRPTR version;        // Proto für Version
  96.   extern void End(UBYTE);        // Proto für End
  97.  
  98.   #if !defined(NOVERSION) && defined(NAME)
  99.     #ifndef AUTHOR
  100.       #define AUTHOR "by SDI"
  101.     #endif
  102.     #ifndef VERSION
  103.       #define VERSION "1"
  104.     #endif
  105.     #ifndef REVISION
  106.       #define REVISION "0"
  107.     #endif
  108.     #ifndef DATE
  109.       #ifdef __MAXON__
  110.         #define DATE __DATE2__
  111.       #elif defined(__SASC)
  112.         #define DATE __AMIGADATE__
  113.       #endif
  114.     #endif
  115.     #ifdef __MAXON__
  116.       #define SDI_DATE "(" DATE ")"
  117.     #elif defined(__SASC)
  118.       #define SDI_DATE DATE
  119.     #endif
  120.  
  121.     #ifndef DISTRIBUTION
  122.       #define DISTRIBUTION "(PD) "
  123.     #endif
  124.     STRPTR version = (STRPTR) "$VER: " NAME " " VERSION "." REVISION " "
  125.     SDI_DATE " " DISTRIBUTION AUTHOR;
  126.  
  127.   #endif /* !NOVERSION && NAME */
  128.  
  129.   #if defined(ENDCODE) || defined(ENDCODE_NOCTRLC)
  130.     #ifdef __MAXON__
  131.       #define __inline
  132.       inline
  133.     #endif
  134.       void __inline end(void);
  135.     void End(UBYTE err)
  136.     {
  137.       #ifndef ENDCODE_NOCTRLC
  138.       if(CTRL_C)
  139.       {
  140.         err = RETURN_WARN;
  141.         SetIoErr(ERROR_BREAK);
  142.       }
  143.       #endif
  144.  
  145.       end();
  146.  
  147.       if(err)        PrintFault(IoErr(), 0);
  148.       exit(err);
  149.     }
  150.   #endif /* ENDCODE && ENDCODE_NOCTRLC */
  151. #endif /* NOCODE */
  152.  
  153. #endif /* SDI_DEFINES_H */
  154.  
  155.