2 Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
4 See the accompanying file LICENSE, version 2000-Apr-09 or later
5 (the contents of which are also included in unzip.h) for terms of use.
6 If, for some reason, all these files are missing, the Info-ZIP license
7 also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
9 /* Write out a fragment of assembly source giving offsets in "Uz_Globs"
13 #define UNZIP_INTERNAL
21 static int asm_setflag(const char *flagname
);
22 static int ccp_setflag(const char *flagname
);
24 static int asm_setflag(const char *flagname
)
26 static const char asm_flagdef
[] = "%-15s EQU 1\n";
27 return printf(asm_flagdef
, flagname
);
29 static int ccp_setflag(const char *flagname
)
31 static const char ccp_flagdef
[] = "#ifndef %s\n# define %s\n#endif\n";
32 return printf(ccp_flagdef
, flagname
, flagname
);
42 struct huft
*t
= NULL
;
43 static const char asm_offsdef
[] = "%-15s EQU %lu\n";
44 static const char ccp_offsdef
[] = "#define %-15s %lu\n";
46 const char *out_format
;
47 int (*set_flag
)(const char *flagname
);
50 if (argc
> 1 && argv
[1] != NULL
&& !strcmp(argv
[1], "-ccp"))
54 out_format
= ccp_offsdef
;
55 set_flag
= ccp_setflag
;
57 out_format
= asm_offsdef
;
58 set_flag
= asm_setflag
;
61 printf(out_format
, "h_e", (ulg
)&t
->e
- (ulg
)t
);
62 printf(out_format
, "h_b", (ulg
)&t
->b
- (ulg
)t
);
63 printf(out_format
, "h_v_n", (ulg
)&t
->v
.n
- (ulg
)t
);
64 printf(out_format
, "h_v_t", (ulg
)&t
->v
.t
- (ulg
)t
);
65 printf(out_format
, "SIZEOF_huft", (ulg
)sizeof(struct huft
));
67 printf(out_format
, "bb", (ulg
)&G
.bb
- (ulg
)&G
);
68 printf(out_format
, "bk", (ulg
)&G
.bk
- (ulg
)&G
);
69 printf(out_format
, "wp", (ulg
)&G
.wp
- (ulg
)&G
);
71 printf(out_format
, "in", (ulg
)&G
.in
- (ulg
)&G
);
73 printf(out_format
, "incnt", (ulg
)&G
.incnt
- (ulg
)&G
);
74 printf(out_format
, "inptr", (ulg
)&G
.inptr
- (ulg
)&G
);
75 printf(out_format
, "csize", (ulg
)&G
.csize
- (ulg
)&G
);
76 printf(out_format
, "mem_mode", (ulg
)&G
.mem_mode
- (ulg
)&G
);
78 printf(out_format
, "redirslide", (ulg
)&redirSlide
- (ulg
)&G
);
79 printf(out_format
, "SIZEOF_slide", (ulg
)sizeof(redirSlide
));
80 #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
81 printf(out_format
, "_wsize", (ulg
)&G
._wsize
- (ulg
)&G
);
82 #endif /* DLL && !NO_SLIDE_REDIR */
83 printf(out_format
, "CRYPT", (ulg
)CRYPT
);
85 (*set_flag
)("FUNZIP");
91 (*set_flag
)("REENTRANT");
95 # ifdef NO_SLIDE_REDIR
96 (*set_flag
)("NO_SLIDE_REDIR");
100 (*set_flag
)("USE_DEFLATE64");