Archive-Unzip-Burst
view release on metacpan or search on metacpan
unzip-6.0/macos/source/macos.c view on Meta::CPAN
/*
Copyright (c) 1990-2007 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2000-Apr-09 or later
(the contents of which are also included in unzip.h) for terms of use.
If, for some reason, all these files are missing, the Info-ZIP license
also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
*/
/*---------------------------------------------------------------------------
macos.c
Macintosh-specific routines for use with Info-ZIP's UnZip 5.4 and later.
Contains:
do_wild ()
mapattr ()
checkdir ()
version ()
macmkdir ()
macopen ()
maccreat ()
macread ()
macwrite ()
macclose ()
maclseek ()
BuildMacFilename()
SetFinderInfo ()
isMacOSexfield ()
makePPClong ()
makePPCword ()
PrintMacExtraInfo ()
GetExtraFieldData ()
DecodeMac3ExtraField ()
DecodeJLEEextraField ()
PrintTextEncoding ()
MacGlobalsInit ()
---------------------------------------------------------------------------*/
/*****************************************************************************/
/* Includes */
/*****************************************************************************/
#define UNZIP_INTERNAL
#include "unzip.h"
#include <script.h>
#include <sound.h>
#include "pathname.h"
#include "helpers.h"
#include "macstuff.h"
#include "mactime.h"
#include "macbin3.h"
/*****************************************************************************/
/* Macros, typedefs */
/*****************************************************************************/
/* disable ZipIt support
#define SwitchZIPITefSupportOff */
#define read_only file_attr /* for readability only */
#define EB_MAX_OF_VARDATA 1300 /* max possible datasize of extra-field */
#ifdef WILD_STOP_AT_DIR
# define WESEP , (oU.W_flag ? ':' : '\0')
#else
# define WESEP
#endif
/*****************************************************************************/
/* Global Vars */
/*****************************************************************************/
/* Note: sizeof() returns the size of this allusion
13 is current length of "XtraStuf.mac:" */
extern const char ResourceMark[13]; /* var is initialized in file pathname.c */
Boolean MacUnzip_Noisy; /* MacUnzip_Noisy is also used by console */
MACINFO newExtraField; /* contains all extra-field data */
short MacZipMode;
/*****************************************************************************/
/* Module level Vars */
/*****************************************************************************/
static const char MacPathEnd = ':'; /* the Macintosh dir separator */
static int created_dir; /* used in mapname(), checkdir() */
static int renamed_fullpath; /* ditto */
static FSSpec CurrentFile;
static Boolean OpenZipFile = true;
static Boolean UseUT_ExtraField = false;
static Boolean IgnoreEF_Macfilename = false;
static short fileSystemID;
static uch *attrbuff = NULL;
static uch *malloced_attrbuff = NULL;
const short HFS_fileSystem = 0;
/*****************************************************************************/
/* Prototypes */
/*****************************************************************************/
extern char *GetUnZipInfoVersions(void);
static OSErr SetFinderInfo(__GPRO__ int SetTime, FSSpec *spec, MACINFO *mi);
static Boolean GetExtraFieldData(short *MacZipMode, MACINFO *mi);
static uch *scanMacOSexfield(uch *ef_ptr, unsigned ef_len,
short *MacZipMode);
static Boolean isMacOSexfield(unsigned id, unsigned size, short *MacZipMode);
( run in 0.504 second using v1.01-cache-2.11-cpan-5735350b133 )