home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip532.zip / amiga / amiga.h < prev    next >
C/C++ Source or Header  |  1997-10-21  |  5KB  |  153 lines

  1. /* amiga.h
  2.  *
  3.  * Globular definitions that affect all of AmigaDom.
  4.  *
  5.  * Originally included in unzip.h, extracted for simplicity and eeze of
  6.  * maintenance by John Bush.
  7.  *
  8.  * THIS FILE IS #INCLUDE'd by unzip.h
  9.  *
  10.  */
  11.  
  12. #ifndef __amiga_amiga_h
  13. #define __amiga_amiga_h
  14. #include <time.h>
  15. #ifndef NO_FCNTL_H
  16. #  include <fcntl.h>
  17. #else
  18.    int mkdir(const char *_name);
  19. #endif
  20. #include <limits.h>
  21.  
  22. #ifdef AZTEC_C                       /* Manx Aztec C, 5.0 or newer only */
  23. #  include <clib/dos_protos.h>
  24. #  include <pragmas/dos_lib.h>           /* do inline dos.library calls */
  25. #  define O_BINARY 0
  26. #  include "amiga/z-stat.h"   /* substitute for <stat.h> and <direct.h> */
  27. #  define direct dirent
  28.  
  29. #  define DECLARE_TIMEZONE
  30. #  define ASM_INFLATECODES
  31. #  define ASM_CRC
  32. #  define USE_TIME_LIB
  33.  
  34. /* Note that defining REENTRANT will not eliminate all global/static */
  35. /* variables.  The functions we use from c.lib, including stdio, are */
  36. /* not reentrant.  Neither are the stuff in amiga/stat.c or the time */
  37. /* functions in amiga/filedate.c, because they just augment c.lib.   */
  38. /* If you want a fully reentrant and reexecutable "pure" UnZip with  */
  39. /* Aztec C, assemble and link in the startup module purify.a by Paul */
  40. /* Kienitz.  REENTRANT should be used just to reduce memory waste.   */
  41. #endif /* AZTEC_C */
  42.  
  43.  
  44. #ifdef __SASC
  45. /* includes */
  46. #  include <sys/types.h>
  47. #  include <sys/stat.h>
  48. #  include <sys/dir.h>
  49. #  include <dos.h>
  50. #  include <exec/memory.h>
  51. #  include <exec/execbase.h>
  52. #  if (defined(_M68020) && (!defined(__USE_SYSBASE)))
  53.                             /* on 68020 or higher processors it is faster   */
  54. #    define __USE_SYSBASE   /* to use the pragma libcall instead of syscall */
  55. #  endif                    /* to access functions of the exec.library      */
  56. #  include <proto/exec.h>   /* see SAS/C manual:part 2,chapter 2,pages 6-7  */
  57. #  include <proto/dos.h>
  58. #  include <proto/locale.h>
  59.  
  60. #  define USE_TIME_LIB
  61.  
  62. #  ifdef DEBUG
  63. #    include <sprof.h>      /* profiler header file */
  64. #  endif
  65.  
  66. #  if ( (!defined(O_BINARY)) && defined(O_RAW))
  67. #    define O_BINARY O_RAW
  68. #  endif
  69.  
  70. #  if (defined(_SHORTINT) && !defined(USE_FWRITE))
  71. #    define USE_FWRITE      /* define if write() returns 16-bit int */
  72. #  endif
  73.  
  74. #  if (!defined(REENTRANT) && !defined(FUNZIP))
  75. #    define REENTRANT      /* define if unzip is going to be pure */
  76. #  endif
  77.  
  78. #  if defined(REENTRANT) && defined(DYNALLOC_CRCTAB)
  79. #    undef DYNALLOC_CRCTAB
  80. #  endif
  81.  
  82. #  ifdef MWDEBUG
  83. #    include <stdio.h>      /* both stdio.h and stdlib.h must be included */
  84. #    include <stdlib.h>     /* before memwatch.h                          */
  85. #    include "memwatch.h"
  86. #    undef getenv
  87. #  endif /* MWDEBUG */
  88.  
  89. #if 0   /* disabled for now - we don't have alloc_remember() yet */
  90. /* SAS/C built-in getenv() calls malloc to store the envvar string.       */
  91. /* Therefore we need to remember the allocation in order to free it later */
  92. #  include <stdlib.h>       /* getenv() prototype in stdlib.h */
  93. #  ifdef getenv
  94. #    undef getenv           /* remove previously preprocessor symbol */
  95. #  endif
  96. #  ifndef MWDEBUG
  97. /* #    define getenv(name)    ((char *)remember_alloc((zvoid *)getenv(name))) */
  98. #  else                     /* MWGetEnv() ripped from memlib's memwatch.h */
  99. #    define getenv(name)    ((char *)remember_alloc((zvoid *)MWGetEnv(name, __FILE__, __LINE__)))
  100. #  endif
  101. #endif /* 0 */
  102.  
  103. #endif /* SASC */
  104.  
  105.  
  106. #define MALLOC_WORK
  107. #define USE_EF_UT_TIME
  108. #if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
  109. #  define TIMESTAMP
  110. #endif
  111.  
  112. #define AMIGA_FILENOTELEN 80
  113. #ifndef DATE_FORMAT
  114. #  define DATE_FORMAT     DF_MDY
  115. #endif
  116. #define lenEOL            1
  117. #define PutNativeEOL      *q++ = native(LF);
  118. #define PIPE_ERROR        0
  119.  
  120. #ifdef GLOBAL         /* crypt.c usage conflicts with AmigaDOS headers */
  121. #  undef GLOBAL
  122. #endif
  123.  
  124. /* Funkshine Prough Toe Taipes */
  125.  
  126. LONG FileDate (char *, time_t[]);
  127. void tzset(void);
  128. int windowheight (BPTR fh);
  129. void _abort(void);              /* ctrl-C trap */
  130.  
  131. #define SCREENLINES windowheight(Output())
  132.  
  133.  
  134. /* Static variables that we have to add to struct Globals: */
  135. #define SYSTEM_SPECIFIC_GLOBALS \
  136.     int N_flag;\
  137.     int filenote_slot;\
  138.     char *(filenotes[DIR_BLKSIZ]);\
  139.     int created_dir, renamed_fullpath, rootlen;\
  140.     char *rootpath, *buildpath, *build_end;\
  141.     DIR *wild_dir;\
  142.     char *dirname, *wildname, matchname[FILNAMSIZ];\
  143.     int dirnamelen, notfirstcall;
  144.  
  145. /* N_flag, filenotes[], and filenote_slot are for the -N option that      */
  146. /*    restores zipfile comments as AmigaDOS filenotes.  The others        */
  147. /*    are used by functions in amiga/amiga.c only.                        */
  148. /* created_dir and renamed_fullpath are used by mapname() and checkdir(). */
  149. /* rootlen, rootpath, buildpath, and build_end are used by checkdir().    */
  150. /* wild_dir, dirname, wildname, matchname[], dirnamelen and notfirstcall  */
  151. /*    are used by do_wild().                                              */
  152. #endif /* __amiga_amiga_h */
  153.