merged 2.2 branch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2000-07-15 19:51:35 +00:00
parent 8a693e6e04
commit f6bcfd974e
1835 changed files with 237729 additions and 67990 deletions

View File

@@ -0,0 +1,151 @@
#ifndef __acestruc_h
#define __acestruc_h
#include "declare.h"
#include "portable.h"
#define acesign_len 7
#define bytes_before_acesign 7
#define acever 10
struct tech
{
UCHAR TYPE;
UCHAR QUAL;
USHORT PARM;
};
typedef struct tacehead
{
USHORT HEAD_CRC;
USHORT HEAD_SIZE;
UCHAR HEAD_TYPE;
USHORT HEAD_FLAGS;
ULONG ADDSIZE;
UCHAR other[2048];
} thead;
typedef struct tacemhead
{
USHORT HEAD_CRC;
USHORT HEAD_SIZE;
UCHAR HEAD_TYPE;
USHORT HEAD_FLAGS;
UCHAR ACESIGN[acesign_len];
UCHAR VER_MOD;
UCHAR VER_CR;
UCHAR HOST_CR;
UCHAR VOL_NUM;
ULONG TIME_CR;
USHORT RES1;
USHORT RES2;
ULONG RES;
UCHAR AV_SIZE;
UCHAR AV[256];
USHORT COMM_SIZE;
UCHAR COMM[2048];
} tmhead;
#ifndef PATH_MAX
#define PATH_MAX 512
#endif
typedef struct tacefhead
{
USHORT HEAD_CRC;
USHORT HEAD_SIZE;
UCHAR HEAD_TYPE;
USHORT HEAD_FLAGS;
ULONG PSIZE;
ULONG SIZE;
ULONG FTIME;
ULONG ATTR;
ULONG CRC32;
struct tech TECH;
USHORT RESERVED;
USHORT FNAME_SIZE;
UCHAR FNAME[PATH_MAX];
USHORT COMM_SIZE;
UCHAR COMM[2048];
} tfhead;
#define mhead (*t_mhead)
#define fhead (*t_fhead)
#define rhead (*t_rhead)
#define tmpmhead (*t_tmpmhead)
#define tmpfhead (*t_tmpfhead)
#define tmprhead (*t_tmprhead)
#define mhead_size h_mhead_size(mhead)
#define fhead_size h_fhead_size(fhead)
#define rhead_size ((INT)&rhead.REC_CRC-(INT)&head.HEAD_TYPE+sizeof(rhead.REC_CRC))
#define h_mhead_size(phead) ((INT)mhead.AV-(INT)&head.HEAD_TYPE+ \
(phead).AV_SIZE+ \
((phead).HEAD_FLAGS&ACE_COMM? \
sizeof((phead).COMM_SIZE)+H_MCOMM_SIZE(phead):0))
#define h_fhead_size(phead) ((INT)fhead.FNAME-(INT)&head.HEAD_TYPE+ \
(phead).FNAME_SIZE+ \
((phead).HEAD_FLAGS&ACE_COMM? \
sizeof((phead).COMM_SIZE)+H_FCOMM_SIZE(phead):0))
//main-comment-definitions
#define H_MCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).AV+(head).AV_SIZE))
#define MCOMM_SIZE H_MCOMM_SIZE(mhead)
#define H_MCOMM(head) ((UCHAR*)&(head).AV+(head).AV_SIZE+sizeof((head).COMM_SIZE))
#define MCOMM H_MCOMM(mhead)
//file-comment-definitions
#define H_FCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).FNAME+(head).FNAME_SIZE))
#define FCOMM_SIZE H_FCOMM_SIZE(fhead)
#define H_FCOMM(head) ((UCHAR*)&(head).FNAME+(head).FNAME_SIZE+sizeof((head).COMM_SIZE))
#define FCOMM H_FCOMM(fhead)
//
#define calc_head_crc getcrc16(CRC_MASK, (CHAR*)&head.HEAD_TYPE, head.HEAD_SIZE)
#define GET_ADDSIZE ((head.HEAD_FLAGS & ACE_ADDSIZE) ? head.ADDSIZE : 0)
//archive-header-flags
#define ACE_LIM256 1024
#define ACE_MULT_VOL 2048
#define ACE_AV 4096
#define ACE_RECOV 8192
#define ACE_LOCK 16384
#define ACE_SOLID 32768
//file-header-flags
#define ACE_ADDSIZE 1
#define ACE_PASSW 16384
#define ACE_SP_BEF 4096
#define ACE_SP_AFTER 8192
#define ACE_COMM 2
//block types
#define MAIN_BLK 0
#define FILE_BLK 1
#define REC_BLK 2
//known compression types
#define TYPE_STORE 0
#define TYPE_LZW1 1
//structure for archive handling
struct tadat
{
INT sol,
vol,
vol_num;
ULONG time_cr;
};
#endif /* __acestruc_h */

View File

@@ -0,0 +1,33 @@
#ifndef __attribs_h
#define __attribs_h
#ifndef _A_SUBDIR
#define _A_SUBDIR 0x10 // MS-DOS directory constant
#endif
#ifndef S_IEXEC
#ifdef S_IEXECUTE
#define S_IEXEC S_IEXECUTE
#else
#define S_IEXEC 0
#endif
#endif
#ifndef S_IDELETE
#define S_IDELETE 0
#endif
#ifndef S_IRGRP
#define S_IRGRP 0
#define S_IWGRP 0
#endif
#ifndef S_IROTH
#define S_IROTH 0
#define S_IWOTH 0
#endif
#endif /* __attribs_h */

View File

@@ -0,0 +1,38 @@
/******************************************************/
/* */
/* declare.h: declaration-symbols (UCHAR, ULONG, ...) */
/* */
/******************************************************/
#ifndef __declare_h
#define __declare_h
#if defined(__CYGWIN__)
#include <Windows32/Base.h>
#endif
#if !defined(OS2_H_INCLUDED) && !defined(__CYGWIN__)
#ifdef AMIGA
#include <exec/types.h>
#else /* AMIGA */
typedef unsigned short USHORT;
typedef short SHORT ;
typedef unsigned short UWORD ;
typedef short WORD ;
typedef unsigned long ULONG ;
typedef long LONG ;
#endif /* !AMIGA */
typedef unsigned char UCHAR ;
typedef char CHAR ;
typedef unsigned UINT ;
typedef int INT ;
#else
typedef unsigned short UWORD ;
#endif
#endif /* __declare_h */

View File

@@ -0,0 +1,90 @@
/* ------------------------------------------------------------------------ */
/* */
/* Global variable definitions */
/* */
/* ------------------------------------------------------------------------ */
#ifndef __globals_h
#define __globals_h
#include "acestruc.h"
#include "unace.h"
//-------- Ace sign
extern const char *acesign;
//-------- Version string for program
extern const char *version;
//-------- header buffer and pointers
extern thead head;
extern tmhead *t_mhead;
extern tfhead *t_fhead;
//-------- buffers
extern ULONG *buf_rd ;
extern CHAR *buf ;
extern CHAR *buf_wr ;
extern UCHAR *readbuf;
//-------- decompressor variables
extern
SHORT rpos ,
dcpr_do ,
dcpr_do_max ,
blocksize ,
dcpr_dic ,
dcpr_oldnum ,
bits_rd ,
dcpr_frst_file;
extern
USHORT dcpr_code_mn[1 << maxwd_mn],
dcpr_code_lg[1 << maxwd_lg];
extern
UCHAR dcpr_wd_mn[maxcode + 2],
dcpr_wd_lg[maxcode + 2],
wd_svwd[svwd_cnt];
extern
ULONG dcpr_dpos ,
cpr_dpos2 ,
dcpr_dicsiz ,
dcpr_dican ,
dcpr_size ,
dcpr_olddist[4],
code_rd ;
extern
CHAR *dcpr_text ;
//-------- quicksort
extern USHORT sort_org[maxcode + 2];
extern UCHAR sort_freq[(maxcode + 2) * 2];
//-------- file handling
extern CHAR aname[PATH_MAX];
extern
INT archan,
wrhan;
#if !defined(__EMX__) && !defined(__OS2__)
extern FILE *farchan;
#endif
extern LONG skipsize;
//-------- structures for archive handling
extern struct tadat adat;
//-------- flags
extern
INT f_err ,
f_ovrall ,
f_allvol_pr,
f_curpas ,
f_criterr ;
int pipeit(char *format, ...);
void error(char *format, ...);
int confirm(char *format, ...);
#endif /* __globals_h */

26
utils/Install/incace/os.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef __os_h
#define __os_h
#if defined(AMIGA)
#define DIRSEP '/'
#define HI_LO_BYTE_ORDER
#endif
#if defined(DOS) || defined(WINNT) || defined(WIN16)
#define DIRSEP '\\'
#define LO_HI_BYTE_ORDER
#endif
#if defined(OS2) || defined(__EMX__)
#define DIRSEP '\\'
#define LO_HI_BYTE_ORDER
#endif
#if defined(UNIX)
#define DIRSEP '/'
#define HI_LO_BYTE_ORDER
#endif
#endif /* __os_h */

View File

@@ -0,0 +1,101 @@
/****************************************************************/
/* */
/* A collection of routines used in making ACE portable for */
/* different computers */
/* */
/****************************************************************/
#ifndef __portable_h
#define __portable_h
#include "os.h"
#ifdef HI_LO_BYTE_ORDER
/* All kinds of inplace swap routines, to reverse from LOHI to HILO byte order */
#ifdef AMIGA
#if __SASC && __VERSION__>=6 && __REVISION__>=58
#define WORDswap(n) (*(n) = __builtin_rol(*(n), 8, 1))
#define LONGswap(n) ( WORDswap(&((WORD *)(n))[0]),\
WORDswap(&((WORD *)(n))[1]),\
*(n) = __builtin_rol(*(n), 16, 2) )
#else /* __SASC */
#define EORSWAP
#endif /* !__SASC */
#endif /* AMIGA */
#ifdef EORSWAP
/* With some compilers and processors these work faster then the
* regular swap below, for example on a Amiga 68040 using SAS C 6.58.
* But using builtin rotates works even faster, see above.
*/
#define WORDswap(n) (((BYTE*)(n))[0] ^= ((BYTE*)(n))[1],\
((BYTE*)(n))[1] ^= ((BYTE*)(n))[0],\
((BYTE*)(n))[0] ^= ((BYTE*)(n))[1])
#define LONGswap(n) (((BYTE*)(n))[0] ^= ((BYTE*)(n))[3],\
((BYTE*)(n))[3] ^= ((BYTE*)(n))[0],\
((BYTE*)(n))[0] ^= ((BYTE*)(n))[3],\
((BYTE*)(n))[1] ^= ((BYTE*)(n))[2],\
((BYTE*)(n))[2] ^= ((BYTE*)(n))[1],\
((BYTE*)(n))[1] ^= ((BYTE*)(n))[2])
#endif /* EORSWAP */
#ifndef WORDswap
/* If not yet defined use the standard swaps */
#define WORDswap(n) (*(n) = (*(n) << 8) | (*(n) >> 8))
#define LONGswap(n) ( WORDswap(&((WORD *)(n))[0]),\
WORDswap(&((WORD *)(n))[1]),\
*(n) = (*(n) >> 16) | (*(n) << 16) )
#endif /* WORDSWAP */
#endif /* HI_LO_BYTE_ORDER */
/* GENERIC: Convert to LONG or WORD from BYTE-Pointer-to-LOHI-byte-order data,
* without worrying if the bytes are word alined in memory.
* p is a pointer to char.
*/
#ifdef HI_LO_BYTE_ORDER
#define BUFP2WORD(p) ((UWORD)*(p)++ | ((*(p)++)<<8))
#define BUFP2LONG(p) ((ULONG)*(p)++ | ((*(p)++)<<8) | ((*(p)++)<<16) | ((*(p)++)<<24))
#define BUF2WORD(p) ((UWORD)*(p) | (*((p)+1)<<8))
#define BUF2LONG(p) ((ULONG)*(p) | (*((p)+1)<<8) | (*((p)+2)<<16) | (*((p)+3)<<24))
#else /* HI_LO_BYTE_ORDER */
#define BUFP2WORD(p) *(UWORD*)((p+=2)-2)
#define BUFP2LONG(p) *(ULONG*)((p+=4)-4)
#define BUF2WORD(p) (*(UWORD*)p)
#define BUF2LONG(p) (*(ULONG*)p)
#endif /* !HI_LO_BYTE_ORDER */
/* Timestamp macros */
#define get_tx(m,d,h,n) (((ULONG)m<<21)+((ULONG)d<<16)+((ULONG)h<<11)+(n<<5))
#define get_tstamp(y,m,d,h,n,s) ((((ULONG)(y-1980))<<25)+get_tx(m,d,h,n)+(s/2))
#define ts_year(ts) ((UINT)((ts >> 25) & 0x7f) + 1980)
#define ts_month(ts) ((UINT)(ts >> 21) & 0x0f) // 1..12 means Jan..Dec
#define ts_day(ts) ((UINT)(ts >> 16) & 0x1f) // 1..31 means 1st..31st
#define ts_hour(ts) ((UINT)(ts >> 11) & 0x1f)
#define ts_min(ts) ((UINT)(ts >> 5) & 0x3f)
#define ts_sec(ts) ((UINT)((ts & 0x1f) * 2))
#endif /* __portable_h */

View File

@@ -0,0 +1,14 @@
#ifndef __uac_comm_h
#define __uac_comm_h
#include "declare.h"
extern INT comm_cpr_size;
extern CHAR *comm;
void comment_out(CHAR *top);
#endif /* __uac_comm_h */

View File

@@ -0,0 +1,20 @@
#ifndef __uac_crc_h
#define __uac_crc_h
#include "declare.h"
#define CRC_MASK 0xFFFFFFFFL
#define CRCPOLY 0xEDB88320L
extern ULONG crctable[256];
extern ULONG rd_crc;
ULONG getcrc(ULONG crc, UCHAR * addr, INT len);
void make_crctable(void);
#endif /* __uac_crc_h */

View File

@@ -0,0 +1,12 @@
#ifndef __uac_crt_h
#define __uac_crt_h
#include "acestruc.h"
CHAR *ace_fname(CHAR * s, thead * head, INT nopath);
INT create_dest_file(CHAR * file, INT a);
#endif /* __uac_crt_h */

View File

@@ -0,0 +1,14 @@
#ifndef __uac_dcpr_h
#define __uac_dcpr_h
#include "declare.h"
INT calc_dectabs(void);
void dcpr_comm(INT comm_size);
INT read_wd(UINT maxwd, USHORT * code, UCHAR * wd, INT max_el);
void dcpr_init(void);
INT dcpr_adds_blk(CHAR * buf, UINT len);
void dcpr_init_file(void);
#endif /* __uac_dcpr_h */

View File

@@ -0,0 +1,18 @@
#ifndef __uac_sys_h
#define __uac_sys_h
#include "declare.h"
#define upcase(ch) ((in(ch,'a','z'))?(ch-32):(ch))
void memset16(USHORT * dest, SHORT val, INT len);
INT cancel(void);
INT wrask(CHAR * s);
#if !defined(__MINGW32__)
void beep(void);
#endif
void set_handler(void);
#endif

View File

@@ -0,0 +1,66 @@
#ifndef __unace_h
#define __unace_h
#include "declare.h"
//--------- functions
INT read_adds_blk(CHAR * buffer, INT len);
//--------- buffers: increase sizes when possible to speed up the program
#define size_rdb 1024
#define size_wrb 2048
#define size_buf 1024
#define size_headrdb (sizeof(head)-20) // (some bytes less esp. for Amiga)
//--------- (de-)compressor constants
#define maxdic 22
#define maxwd_mn 11
#define maxwd_lg 11
#define maxwd_svwd 7
#define maxlength 259
#define maxdis2 255
#define maxdis3 8191
#define maxcode (255+4+maxdic)
#define svwd_cnt 15
#define max_cd_mn (256+4+(maxdic+1)-1)
#define max_cd_lg (256-1)
//--------- flags
#define ERR_MEM 1
#define ERR_FILES 2
#define ERR_FOUND 3
#define ERR_FULL 4
#define ERR_OPEN 5
#define ERR_READ 6
#define ERR_WRITE 7
#define ERR_CLINE 8
#define ERR_CRC 9
#define ERR_OTHER 10
#define ERR_USER 255
//--------- system things
#define flush fflush(stdout);
#define in(v1,v2,v3) ((((long)v1)>=(v2)) && (((long)v1)<=(v3)))
#define delay_len 500
//-------- file creation
#define fileexists(name) (!access(name, 0))
//-------- eof
#endif /* __unace_h */