File: amiga.h

package info (click to toggle)
unzip 5.40-1
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 4,120 kB
  • ctags: 5,900
  • sloc: ansic: 40,977; cpp: 3,778; makefile: 1,384; asm: 1,228; sh: 133
file content (139 lines) | stat: -rw-r--r-- 4,672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* amiga.h
 *
 * Globular definitions that affect all of AmigaDom.
 *
 * Originally included in unzip.h, extracted for simplicity and eeze of
 * maintenance by John Bush.
 *
 * THIS FILE IS #INCLUDE'd by unzip.h
 *
 */

#ifndef __amiga_amiga_h
#define __amiga_amiga_h

#include "amiga/z-stat.h"     /* substitute for <stat.h> and <direct.h> */
#include "amiga/z-time.h"                    /* substitute for <time.h> */
#include <limits.h>
#ifndef NO_FCNTL_H
#  include <fcntl.h>
#else
   int mkdir(const char *_name);
#endif

#ifdef AZTEC_C                       /* Manx Aztec C, 5.0 or newer only */
#  include <clib/dos_protos.h>
#  include <pragmas/dos_lib.h>           /* do inline dos.library calls */
#  define O_BINARY 0
#  define direct dirent

#  define DECLARE_TIMEZONE
#  define ASM_INFLATECODES
#  define ASM_CRC

/* Note that defining REENTRANT will not eliminate all global/static */
/* variables.  The functions we use from c.lib, including stdio, are */
/* not reentrant.  Neither are the stuff in amiga/stat.c or the time */
/* functions in amiga/filedate.c, because they just augment c.lib.   */
/* If you want a fully reentrant and reexecutable "pure" UnZip with  */
/* Aztec C, assemble and link in the startup module purify.a by Paul */
/* Kienitz.  REENTRANT should be used just to reduce memory waste.   */
#endif /* AZTEC_C */


#ifdef __SASC
/* includes */
#  include <sys/types.h>
#  include <sys/dir.h>
#  include <dos.h>
#  include <exec/memory.h>
#  include <exec/execbase.h>
#  if (defined(_M68020) && (!defined(__USE_SYSBASE)))
                            /* on 68020 or higher processors it is faster   */
#    define __USE_SYSBASE   /* to use the pragma libcall instead of syscall */
#  endif                    /* to access functions of the exec.library      */
#  include <proto/exec.h>   /* see SAS/C manual:part 2,chapter 2,pages 6-7  */
#  include <proto/dos.h>
#  include <proto/locale.h>

#  ifdef DEBUG
#    include <sprof.h>      /* profiler header file */
#  endif
#  if ( (!defined(O_BINARY)) && defined(O_RAW))
#    define O_BINARY O_RAW
#  endif
#  if (defined(_SHORTINT) && !defined(USE_FWRITE))
#    define USE_FWRITE      /* define if write() returns 16-bit int */
#  endif
#  if (!defined(REENTRANT) && !defined(FUNZIP))
#    define REENTRANT      /* define if unzip is going to be pure */
#  endif
#  if defined(REENTRANT) && defined(DYNALLOC_CRCTAB)
#    undef DYNALLOC_CRCTAB
#  endif
#  ifdef MWDEBUG
#    include <stdio.h>      /* both stdio.h and stdlib.h must be included */
#    include <stdlib.h>     /* before memwatch.h                          */
#    include "memwatch.h"
#    undef getenv
#  endif /* MWDEBUG */
#endif /* SASC */


#define MALLOC_WORK
#define USE_EF_UT_TIME
#if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
#  define TIMESTAMP
#endif

/* check that TZ environment variable is defined before using UTC times */
#if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ))
#  define IZ_CHECK_TZ
#endif

#define AMIGA_FILENOTELEN 80
#ifndef DATE_FORMAT
#  define DATE_FORMAT     DF_MDY
#endif
#define lenEOL            1
#define PutNativeEOL      *q++ = native(LF);
#define PIPE_ERROR        0

#ifdef GLOBAL         /* crypt.c usage conflicts with AmigaDOS headers */
#  undef GLOBAL
#endif

/* Funkshine Prough Toe Taipes */

int Agetch (void);              /* getch() like function, in amiga/filedate.c */
LONG FileDate (char *, time_t[]);
int windowheight (BPTR fh);
void _abort(void);              /* ctrl-C trap */

#define SCREENLINES windowheight(Output())

#ifdef USE_TIME_LIB
   extern int real_timezone_is_set;
#  define VALID_TIMEZONE(tempvar) (tzset(), real_timezone_is_set)
#else
#  define VALID_TIMEZONE(tempvar) ((tempvar = getenv("TZ")) && tempvar[0])
#endif

/* Static variables that we have to add to Uz_Globs: */
#define SYSTEM_SPECIFIC_GLOBALS \
    int filenote_slot;\
    char *(filenotes[DIR_BLKSIZ]);\
    int created_dir, renamed_fullpath, rootlen;\
    char *rootpath, *buildpath, *build_end;\
    DIR *wild_dir;\
    char *dirname, *wildname, matchname[FILNAMSIZ];\
    int dirnamelen, notfirstcall;

/* filenotes[] and filenote_slot are for the -N option that restores      */
/*    comments of Zip archive entries as AmigaDOS filenotes.  The others  */
/*    are used by functions in amiga/amiga.c only.                        */
/* created_dir and renamed_fullpath are used by mapname() and checkdir(). */
/* rootlen, rootpath, buildpath, and build_end are used by checkdir().    */
/* wild_dir, dirname, wildname, matchname[], dirnamelen and notfirstcall  */
/*    are used by do_wild().                                              */
#endif /* __amiga_amiga_h */