Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

new_stackinfo||5.005000|
new_version||5.009000|
next_symbol|||
nextargv|||
nextchar|||
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
oopsAV|||
oopsCV|||
oopsHV|||
op_clear|||
op_const_sv|||
op_dump||5.006000|
op_free|||
op_null||5.007002|

ppport.h  view on Meta::CPAN

save_op|||
save_padsv||5.007001|
save_pptr|||
save_re_context||5.006000|
save_scalar_at|||
save_scalar|||
save_set_svflags||5.009000|
save_shared_pvref||5.007003|
save_sptr|||
save_svref|||
save_threadsv||5.005000|
save_vptr||5.006000|
savepvn|||
savepv|||
savesharedpv||5.007003|
savestack_grow_cnt||5.008001|
savestack_grow|||
savesvpv||5.009002|
sawparens|||
scalar_mod_type|||
scalarboolean|||

ppport.h  view on Meta::CPAN

	PL_curcop->cop_stash = old_cop_stash;
	PL_curstash = old_curstash;
	PL_curcop->cop_line = oldline;
}
#endif
#endif

/*
 * Boilerplate macros for initializing and accessing interpreter-local
 * data from C.  All statics in extensions should be reworked to use
 * this, if you want to make the extension thread-safe.  See ext/re/re.xs
 * for an example of the use of these macros.
 *
 * Code that uses these macros is responsible for the following:
 * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
 * 2. Declare a typedef named my_cxt_t that is a structure that contains
 *    all the data that needs to be interpreter-local.
 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
 *    (typically put in the BOOT: section).
 * 5. Use the members of the my_cxt_t structure everywhere as

ppport.h  view on Meta::CPAN

 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
 *    access MY_CXT.
 */

#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
    defined(PERL_CAPI)    || defined(PERL_IMPLICIT_CONTEXT)

#ifndef START_MY_CXT

/* This must appear in all extensions that define a my_cxt_t structure,
 * right after the definition (i.e. at file scope).  The non-threads
 * case below uses it to declare the data as static. */
#define START_MY_CXT

#if (PERL_VERSION < 4 || (PERL_VERSION == 4 && PERL_SUBVERSION < 68 ))
/* Fetches the SV that keeps the per-interpreter data. */
#define dMY_CXT_SV \
	SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
#else /* >= perl5.004_68 */
#define dMY_CXT_SV \
	SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,		\

ppport.h  view on Meta::CPAN

        if (*sp + len <= send && memEQ(*sp, radix, len)) {
            *sp += len;
            return TRUE;
        }
    }
#else
    /* older perls don't have PL_numeric_radix_sv so the radix
     * must manually be requested from locale.h
     */
#include <locale.h>
    dTHR;  /* needed for older threaded perls */
    struct lconv *lc = localeconv();
    char *radix = lc->decimal_point;
    if (radix && IN_LOCALE) {
        STRLEN len = strlen(radix);
        if (*sp + len <= send && memEQ(*sp, radix, len)) {
            *sp += len;
            return TRUE;
        }
    }
#endif /* PERL_VERSION */

unzip-6.0/INSTALL  view on Meta::CPAN

        CygWin, GNU Make and win32\Makefile.gcc should do the job.
        With emx+gcc, a good choice is GNUMake 3.75 (or higher) from the
        djgpp V2 distribution used on win32\Makefile.emx.

        The unzip32.dll WinDLL executables can be built using the appropiate
        Makefile in the win32\ subdirectory, or by using the Microsoft Visual
        C++ project files supplied below the windll subdirectory.  Besides the
        MSC compilers, gcc-mingw32, Watcom C and Borland C allow to build the
        Windows UnZip DLL.  By default, the Makefiles for compilers that use
        the Microsoft C runtime are configured to link against the shared
        multithreading C runtime DLL.  Depending on the intended usage for
        unzip32.dll, a statically linked dll might be more suitable.  The
        make scripts for MSC support build variants with static linking; you
        should look up the configuration switch DLLSTANDALONE in the MSC
        Makefile or the "Static..." build configurations in the Visual Studio
        project files.

      WinCE (WinCE or WinNT)
        Only Microsoft Visual C++ 5.0, 6.0 or Visual C++ embedded 3.0 or later
        are supported.  Use the appropiate version of the included project
        files and check wince\README for details.

unzip-6.0/README  view on Meta::CPAN


        http://www.info-zip.org/pub/infozip/FAQ.html#lists

(Please note that as of late May 2004, the lists are unavailable pending
a move to a new site; we hope to have them restored shortly.  In the
interim ...)  Feel free to use our bug-reporting web page for bug reports
and to ask questions not answered on the FAQ page above:

        http://www.info-zip.org/zip-bug.html

For now the best option is to monitor and contribute to the various threads
on the new discussion forum site at:

      http://www.info-zip.org/board/board.pl

The second best way to contribute is through the various features at
SourceForge, such as the bug posting areas.

There is also a closed mailing list for internal discussions of our core
development team. This list is now kept secret to prevent us from being
flooded with spam messages.

unzip-6.0/ebcdic.h  view on Meta::CPAN

    0xB0, 0xA8, 0xB7, 0xB9, 0xB3, 0xB2, 0xA6, 0xA0   /* F8 - FF */
};
#endif /* IZ_OEM2ISO_ARRAY */

/* The following pointers to the OEM<-->ISO translation tables are used
   by the translation code portions.  They may get initialized at program
   startup to point to the matching static translation tables, or to NULL
   to disable OEM-ISO translation.
   The compile-time initialization used here provides the backward compatible
   setting, as can be found in UnZip 5.52 and earlier.
   In case this mechanism will ever get used on a multithreading system that
   allows different codepage setups for concurrently running threads, these
   pointers should get moved into UnZip's thread-safe global data structure.
 */
#ifdef IZ_ISO2OEM_ARRAY
ZCONST uch Far *iso2oem = iso2oem_850;  /* backward compatibility default */
#endif /* IZ_ISO2OEM_ARRAY */
#ifdef IZ_OEM2ISO_ARRAY
ZCONST uch Far *oem2iso = oem2iso_850;  /* backward compatibility default */
#endif /* IZ_OEM2ISO_ARRAY */

#if defined(THEOS) || defined(THEOS_SUPPORT)
#  include "theos/charconv.h"

unzip-6.0/globals.c  view on Meta::CPAN


  See the accompanying file LICENSE, version 2003-May-08 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
*/
/*---------------------------------------------------------------------------

  globals.c

  Routines to allocate and initialize globals, with or without threads.

  Contents:  registerGlobalPointer()
             deregisterGlobalPointer()
             getGlobalPointer()
             globalsCtor()

  ---------------------------------------------------------------------------*/


#define UNZIP_INTERNAL

unzip-6.0/globals.c  view on Meta::CPAN

#ifndef REENTRANT
   Uz_Globs G;
#else /* REENTRANT */

#  ifndef USETHREADID
     Uz_Globs *GG;
#  else /* USETHREADID */
#    define THREADID_ENTRIES  0x40

     int lastScan;
     Uz_Globs  *threadPtrTable[THREADID_ENTRIES];
     ulg        threadIdTable [THREADID_ENTRIES] = {
         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,    /* Make sure there are */
         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,    /* THREADID_ENTRIES 0s */
         0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0
     };

     static ZCONST char Far TooManyThreads[] =
       "error:  more than %d simultaneous threads.\n\
        Some threads are probably not calling DESTROYTHREAD()\n";
     static ZCONST char Far EntryNotFound[] =
       "error:  couldn't find global pointer in table.\n\
        Maybe somebody accidentally called DESTROYTHREAD() twice.\n";
     static ZCONST char Far GlobalPointerMismatch[] =
       "error:  global pointer in table does not match pointer passed as\
 parameter\n";

static void registerGlobalPointer OF((__GPRO));



static void registerGlobalPointer(__G)
    __GDEF
{
    int scan=0;
    ulg tid = GetThreadId();

    while (threadIdTable[scan] && scan < THREADID_ENTRIES)
        scan++;

    if (scan == THREADID_ENTRIES) {
        ZCONST char *tooMany = LoadFarString(TooManyThreads);
        Info(slide, 0x421, ((char *)slide, tooMany, THREADID_ENTRIES));
        free(pG);
        EXIT(PK_MEM);   /* essentially memory error before we've started */
    }

    threadIdTable [scan] = tid;
    threadPtrTable[scan] = pG;
    lastScan = scan;
}



void deregisterGlobalPointer(__G)
    __GDEF
{
    int scan=0;
    ulg tid = GetThreadId();


    while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES)
        scan++;

/*---------------------------------------------------------------------------
    There are two things we can do if we can't find the entry:  ignore it or
    scream.  The most likely reason for it not to be here is the user calling
    this routine twice.  Since this could cause BIG problems if any globals
    are accessed after the first call, we'd better scream.
  ---------------------------------------------------------------------------*/

    if (scan == THREADID_ENTRIES || threadPtrTable[scan] != pG) {
        ZCONST char *noEntry;
        if (scan == THREADID_ENTRIES)
            noEntry = LoadFarString(EntryNotFound);
        else
            noEntry = LoadFarString(GlobalPointerMismatch);
        Info(slide, 0x421, ((char *)slide, noEntry));
        EXIT(PK_WARN);   /* programming error, but after we're all done */
    }

    threadIdTable [scan] = 0;
    lastScan = scan;
    free(threadPtrTable[scan]);
}



Uz_Globs *getGlobalPointer()
{
    int scan=0;
    ulg tid = GetThreadId();

    while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES)
        scan++;

/*---------------------------------------------------------------------------
    There are two things we can do if we can't find the entry:  ignore it or
    scream.  The most likely reason for it not to be here is the user calling
    this routine twice.  Since this could cause BIG problems if any globals
    are accessed after the first call, we'd better scream.
  ---------------------------------------------------------------------------*/

    if (scan == THREADID_ENTRIES) {
        ZCONST char *noEntry = LoadFarString(EntryNotFound);
        fprintf(stderr, noEntry);  /* can't use Info w/o a global pointer */
        EXIT(PK_ERR);   /* programming error while still working */
    }

    return threadPtrTable[scan];
}

#  endif /* ?USETHREADID */
#endif /* ?REENTRANT */



Uz_Globs *globalsCtor()
{
#ifdef REENTRANT

unzip-6.0/globals.h  view on Meta::CPAN

  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
*/
/*---------------------------------------------------------------------------

  globals.h

  There is usually no need to include this file since unzip.h includes it.

  This header file is used by all of the UnZip source files.  It contains
  a struct definition that is used to "house" all of the global variables.
  This is done to allow for multithreaded environments (OS/2, NT, Win95,
  Unix) to call UnZip through an API without a semaphore.  REENTRANT should
  be defined for all platforms that require this.

  GLOBAL CONSTRUCTOR AND DESTRUCTOR (API WRITERS READ THIS!!!)
  ------------------------------------------------------------

  No, it's not C++, but it's as close as we can get with K&R.

  The main() of each process that uses these globals must include the
  CONSTRUCTGLOBALS; statement.  This will malloc enough memory for the

unzip-6.0/globals.h  view on Meta::CPAN

  up if REENTRANT is defined.  All platforms should run with REENTRANT
  defined.  Platforms that can't take advantage of it will just be paying
  a performance penalty needlessly.

  SIGNAL MADNESS
  --------------

  This whole pointer passing scheme falls apart when it comes to SIGNALs.
  I handle this situation 2 ways right now.  If you define USETHREADID,
  UnZip will include a 64-entry table.  Each entry can hold a global
  pointer and thread ID for one thread.  This should allow up to 64
  threads to access UnZip simultaneously.  Calling DESTROYGLOBALS()
  will free the global struct and zero the table entry.  If somebody
  forgets to call DESTROYGLOBALS(), this table will eventually fill up
  and UnZip will exit with an error message.  A good way to test your
  code to make sure you didn't forget a DESTROYGLOBALS() is to change
  THREADID_ENTRIES to 3 or 4 in globals.c, making the table real small.
  Then make a small test program that calls your API a dozen times.

  Those platforms that don't have threads still need to be able to compile
  with REENTRANT defined to test and see if new code is correctly written
  to work either way.  For these platforms, I simply keep a global pointer
  called GG that points to the Globals structure.  Good enough for testing.

  I believe that NT has thread level storage.  This could probably be used
  to store a global pointer for the sake of the signal handler more cleanly
  than my table approach.

  ---------------------------------------------------------------------------*/

#ifndef __globals_h
#define __globals_h

#ifdef USE_ZLIB
#  include "zlib.h"

unzip-6.0/netware/netware.c  view on Meta::CPAN


  ---------------------------------------------------------------------------*/


#define UNZIP_INTERNAL
#include "unzip.h"
#include <dirent.h>
#include <nwdir.h>
#include <nwnamspc.h>
#include <nwconio.h>
#include <nwthread.h>
#include <nwadv.h>

#ifdef ACORN_FTYPE_NFS
/* Acorn bits for NFS filetyping */
typedef struct {
  uch ID[2];
  uch size[2];
  uch ID_2[4];
  uch loadaddr[4];
  uch execaddr[4];

unzip-6.0/netware/unzip.link  view on Meta::CPAN

format novell NLM 'unzip utility'
name unzip
option caseexact
option copyright 'Copyright 1990-2005 Info-ZIP (www.info-zip.org).'
option map = unzip.map
option nodefaultlibs
option quiet
option screenname 'none'
option stack = 32k
option symfile = unzip.sym
option threadname 'unzip'
option version = 5.5.1
module clib
import @c:/novell/ndk/nwsdk/imports/clib.imp
import @c:/novell/ndk/nwsdk/imports/nlmlib.imp
import @c:/novell/ndk/nwsdk/imports/threads.imp
import @c:/novell/ndk/nwsdk/imports/nit.imp
file crc32.obj
file crypt.obj
file envargs.obj
file explode.obj
file extract.obj
file fileio.obj
file globals.obj
file inflate.obj
file list.obj

unzip-6.0/win32/Makefile  view on Meta::CPAN

# Using zlib DLL as decompression core (and/or bzip2 decompression dll)
# implies linking all executables against the DLL version of the C RTL.
cvars_iz = $(cvarsdll) $(CF_LOC)
cvars_izdll = $(cvarsdll) $(CF_LOC)
conlibs_iz = $(conlibsdll) $(ZLIBLIBDLL) $(BZIPLIBEXE)
conlibs_izdll = $(conlibsdll) $(ZLIBLIBDLL) $(BZIPLIBDLL)
guilibs_iz = $(guilibsdll) $(ZLIBLIBDLL) $(BZIPLIBEXE)
!ELSE
# With the default setup (using Info-ZIP's own inflate code and/or static
# external decompression code), the executables are linked against the
# single-thread static C-RTL library to get self-contained programs.
cvars_iz = $(cvars) $(CF_LOC)
conlibs_iz = $(conlibs) $(ZLIBLIB) $(BZIPLIBEXE)
guilibs_iz = $(guilibs) $(ZLIBLIB) $(BZIPLIBEXE)

!IFDEF DLLSTANDALONE
# The standalone variant of unzip32.dll is linked against the
# multithread-safe static C runtime library.
cvars_izdll = $(cvarsmt) $(CF_LOC)
conlibs_izdll = $(conlibsmt) $(ZLIBLIB) $(BZIPLIBDLL)
!ELSE
# The (normal) variant of unzip32.dll is linked against the import library
# of the multithread-safe C runtime dll.
# -> smaller dll size; efficient use of shared resources,
#    but requires the C RTL DLL msvcrt.dll to be installed at runtime
cvars_izdll = $(cvarsdll) $(CF_LOC)
conlibs_izdll = $(conlibsdll) $(ZLIBLIBDLL) $(BZIPLIBDLL)
!ENDIF
!ENDIF # ?(LINK_CRTDLL == 1)

CFLAGS_UN = $(cdebug) $(cflags) $(INC_BZ2LIB) $(cvars_iz)
CFLAGS_SX = $(cdbgsz) $(cflags) $(INC_BZ2LIB) $(cvars_iz) -DSFX
CFLAGS_FU = $(cdebug) $(cflags) $(cvars_iz) -DFUNZIP

unzip-6.0/win32/nt.c  view on Meta::CPAN

/* our single cached volume capabilities structure that describes the last
   volume root we encountered.  A single entry like this works well in the
   zip/unzip scenario for a number of reasons:
   1. typically one extraction path during unzip.
   2. typically process one volume at a time during zip, and then move
      on to the next.
   3. no cleanup code required and no memory leaks.
   4. simple code.

   This approach should be reworked to a linked list approach if we expect to
   be called by many threads which are processing a variety of input/output
   volumes, since lock contention and stale data may become a bottleneck. */

VOLUMECAPS g_VolumeCaps;
CRITICAL_SECTION VolumeCapsLock;


static BOOL Initialize(VOID)
{
    HANDLE hMutex;
    HANDLE hOldMutex;

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN

extern "C" {
#define __INTRFACE_CPP__
#define UNZIP_INTERNAL
#include "unzip.h"
#include "crypt.h"     // Needed to pick up CRYPT define
#include <commctrl.h>
#include "intrface.h"
#include "winmain.h"

#ifndef _WIN32_WCE
#include <process.h>   // _beginthreadex() and _endthreadex()
#endif

}
#include <tchar.h> // Must be outside of extern "C" block

#ifdef POCKET_UNZIP

//******************************************************************************
//***** "Local" Global Variables
//******************************************************************************

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN


   // Free our globals.
   FreeGlobals(pG);

   return result;
}

//******************************************************************************
BOOL DoExtractOrTestFiles(LPCSTR szZipFile, EXTRACT_INFO *pei) {

   // WARNING!!!  This functions hands the EXTRACT_INFO structure of to a thread
   // to perform the actual extraction/test.  When the thread is done, it will
   // send a message to the progress dialog.  The calling function must not
   // delete the EXTRACT_INFO structure until it receives the message.  Currently,
   // this is not a problem for us since the structure lives on the stack of the
   // calling thread.  The calling thread then displays a dialog that blocks the
   // calling thread from clearing the stack until the dialog is dismissed, which
   // occurs when the dialog receives the message.

   // Create our globals so we can store the file name.
   Uz_Globs *pG = InitGlobals(szZipFile);
   if (!pG) {
      pei->result = PK_MEM;
      SendMessage(g_hDlgProgress, WM_PRIVATE, MSG_OPERATION_COMPLETE, (LPARAM)pei);
      return FALSE;
   }

   // Store a global pointer to the Extract structure so it can be reached from
   // our thread and callback functions.
   g_pExtractInfo = pei;

   // Spawn our thread
   DWORD dwThreadId;
   HANDLE hThread;

#ifdef _WIN32_WCE

   // On CE, we use good old CreateThread() since the WinCE CRT does not
   // allocate per-thread storage.
   hThread = CreateThread(NULL, 0, ExtractOrTestFilesThread, pG, 0,
                          &dwThreadId);

#else

   // On NT, we need use the CRT's thread function so that we don't leak any
   // CRT allocated memory when the thread exits.
   hThread = (HANDLE)_beginthreadex(NULL, 0, ExtractOrTestFilesThread, pG, 0,
                                    (unsigned*)&dwThreadId);

#endif

   // Bail out if our thread failed to create.
   if (!hThread) {

      DebugOut(TEXT("CreateThread() failed [%u]"), GetLastError());

      // Set our error as a memory error.
      g_pExtractInfo->result = PK_MEM;

      // Free our globals.
      FreeGlobals(pG);

      // Tell the progress dialog that we are done.
      SendMessage(g_hDlgProgress, WM_PRIVATE, MSG_OPERATION_COMPLETE, (LPARAM)pei);

      g_pExtractInfo = NULL;
      return FALSE;
   }

   // Close our thread handle since we have no use for it.
   CloseHandle(hThread);
   return TRUE;
}

//******************************************************************************
int DoGetComment(LPCSTR szZipFile) {

   int result;

   // Create our Globals struct and fill it in with some default values.

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN

      pG->wildzipfnPtr = pG->wildzipfn = NULL;
   }

   // Free everything else.
   DESTROYGLOBALS();
}

//******************************************************************************
#ifdef _WIN32_WCE

// On WinCE, we declare our thread function the way CreateThread() likes it.
static DWORD WINAPI ExtractOrTestFilesThread(LPVOID lpv)

#else

// On WinNT, we declare our thread function the way _beginthreadex likes it.
static unsigned __stdcall ExtractOrTestFilesThread(void *lpv)

#endif
{
   Uz_Globs *pG = (Uz_Globs*)lpv;

   if (g_pExtractInfo->fExtract) {

      pG->extract_flag = TRUE;

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN


   // Tell the progress dialog that we are done.
   SendMessage(g_hDlgProgress, WM_PRIVATE, MSG_OPERATION_COMPLETE,
               (LPARAM)g_pExtractInfo);

   // Clear our global pointer as we are done with it.
   g_pExtractInfo = NULL;

#ifndef _WIN32_WCE
   // On NT, we need to free any CRT allocated memory.
   _endthreadex(0);
#endif

   return 0;
}

//******************************************************************************
static void SetCurrentFile(__GPRO)
{
   // Reset all our counters as we about to process a new file.
   g_pExtractInfo->uzFileOffset = (zusz_t)G.pInfo->offset;
   g_pExtractInfo->dwFile++;
   g_pExtractInfo->uzBytesWrittenThisFile = 0;
   g_pExtractInfo->uzBytesWrittenPreviousFiles += g_pExtractInfo->uzBytesTotalThisFile;
   g_pExtractInfo->uzBytesTotalThisFile = G.lrec.ucsize;
   g_pExtractInfo->szFile = G.filename;
   g_pExtractInfo->fNewLineOfText = TRUE;

   // Pass control to our GUI thread to do a full update our progress dialog.
   SendMessage(g_hWndMain, WM_PRIVATE, MSG_UPDATE_PROGRESS_COMPLETE,
               (LPARAM)g_pExtractInfo);

   // Check our abort flag.
}
#endif // POCKET_UNZIP

//******************************************************************************
static int IsFileOrDirectory(LPCTSTR szPath)
{

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN


   // Clear the password to be safe.
   *di.szPassword = '\0';

   // On our first call for a file, *pcRetry == 0.  If we would like to allow
   // for retries, then we set the value of *pcRetry to the number of retries we
   // are willing to allow.  We will be recalled as neccessary, each time with
   // *pcRetry being decremented once.  1 is the last retry we will get.
   *pcRetry = (*pcRetry == 0) ? MAX_PASSWORD_RETRIES : (*pcRetry - 1);

   // Pass control to our GUI thread which will prompt the user for a password.
   return SendMessage(g_hWndMain, WM_PRIVATE, MSG_PROMPT_FOR_PASSWORD, (LPARAM)&di);

#else
   return IZ_PW_CANCELALL;
#endif
}

//******************************************************************************
int UZ_EXP CheckForAbort2(zvoid *pG, int fnflag, ZCONST char *zfn,
                    ZCONST char *efn, ZCONST zvoid *details)

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN


      // Signal "Immediate Cancel" back to the UnZip engine.
      rval = UZ_ST_BREAK;
   }

   return rval;
}

//******************************************************************************
int WINAPI UzpReplace(LPSTR szFile, unsigned nbufsiz) {
   // Pass control to our GUI thread which will prompt the user to overwrite.
   // The nbufsiz parameter is not needed here, because this program does not
   // (yet?) contain support for renaming the extraction target.
   return SendMessage(g_hWndMain, WM_PRIVATE, MSG_PROMPT_TO_REPLACE,
                      (LPARAM)szFile);
}

//******************************************************************************
void WINAPI UzpSound(void) {
   // Do nothing.
}

unzip-6.0/wince/intrface.cpp  view on Meta::CPAN

#if (defined(_WIN32_WCE) && (_WIN32_WCE < 211))
      // On WinCE all FILEs are really HANDLEs.  See WINCE.CPP for more info.
      WriteFile((HANDLE)file, buffer, dwCount, &dwBytesWritten, NULL);
#else
      dwBytesWritten = fwrite(buffer, 1, dwCount, file);
#endif

      // Update our bytes written count.
      g_pExtractInfo->uzBytesWrittenThisFile += dwBytesWritten;

      // Pass control to our GUI thread to do a partial update our progress dialog.
      SendMessage(g_hWndMain, WM_PRIVATE, MSG_UPDATE_PROGRESS_PARTIAL,
                  (LPARAM)g_pExtractInfo);

      return dwBytesWritten;
   }

   // Check to see if we are expecting a extraction progress string
   if (g_pExtractInfo) {

      // Most of our progress strings come to our UzpMessagePrnt2() callback,

unzip-6.0/wince/winmain.cpp  view on Meta::CPAN


   // Pass all messages to the base control's window proc.
   return CallWindowProc(g_wpSaveAsDlg, hDlg, uMsg, wParam, lParam);
}
#endif // _WIN32_WCE

//******************************************************************************
#ifdef _WIN32_WCE
void SubclassSaveAsDlg() {

   // Get our current thread ID so we can compare it to other thread IDs.
   DWORD dwThreadId = GetCurrentThreadId();

   // Get the the top window in the z-order that is a child of the desktop.
   // Dialogs are always children of the desktop on CE.  This first window
   // should be the dialog we are looking for, but we will walk the window list
   // just in case.
   HWND hWnd = GetWindow(g_hWndMain, GW_HWNDFIRST);

   // Walk the window list.
   while (hWnd) {

unzip-6.0/wince/winmain.cpp  view on Meta::CPAN


   static EXTRACT_INFO *pei;
   static BOOL fComplete;
   static HWND hWndButton;
   TCHAR szBuffer[32];

   switch (uMsg) {

      case WM_INITDIALOG:

         // Globally store our handle so our worker thread can post to us.
         g_hDlgProgress = hDlg;

         // Get a pointer to our extract information structure.
         pei = (EXTRACT_INFO*)lParam;

         // Clear our complete flag.  It will be set to TRUE when done.
         fComplete = FALSE;

         // Get and store our edit control.
         g_hWndEdit = GetDlgItem(hDlg, IDC_LOG);

unzip-6.0/wince/winmain.cpp  view on Meta::CPAN

                     MAKELPARAM(0, PROGRESS_MAX));
         SendMessage(pei->hWndProgTotal, PBM_SETRANGE, 0,
                     MAKELPARAM(0, PROGRESS_MAX));

         // Set our file and byte totals.
         SetDlgItemText(hDlg, IDC_FILES_TOTAL,
                        FormatValue(szBuffer, pei->dwFileCount));
         SetDlgItemText(hDlg, IDC_BYTES_TOTAL,
                        FormatValue(szBuffer, pei->uzByteCount));

         // Launch our Extract/Test thread and wait for WM_PRIVATE
         DoExtractOrTestFiles(g_szZipFile, pei);

         return TRUE;


      case WM_PRIVATE: // Sent with wParam equal to MSG_OPERATION_COMPLETE when
                       // test/extract is complete.

         // Check to see if the operation was a success
         if ((pei->result == PK_OK) || (pei->result == PK_WARN)) {

unzip-6.0/wince/winmain.cpp  view on Meta::CPAN

                       g_szAppName, MB_ICONERROR | MB_OK);
         }

         // We are done.  Allow the user to close the dialog.
         fComplete = TRUE;
         return FALSE;

      case WM_COMMAND:
         switch (LOWORD(wParam)) {
            case IDCANCEL:
               // If abort is pressed, then set a flag that our worker thread
               // periodically checks to decide if it needs to bail out.
               if (!fComplete && !pei->fAbort) {
                  pei->fAbort = TRUE;
                  SetWindowText(hWndButton, TEXT("Aborting..."));
                  EnableWindow(hWndButton, FALSE);
                  return FALSE;
               }
               // fall through to IDOK

            case IDOK:

unzip-6.0/wince/winmain.cpp  view on Meta::CPAN


//******************************************************************************
BOOL CALLBACK DlgProcViewProgress(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {

   static EXTRACT_INFO *pei;

   switch (uMsg) {

      case WM_INITDIALOG:

         // Globally store our handle so our worker thread can post to us.
         g_hDlgProgress = hDlg;

         // Get a pointer to our extract information structure.
         pei = (EXTRACT_INFO*)lParam;

         // Center our dialog over our parent.
         CenterWindow(hDlg);

         // Store some globals until the extract finishes.
         pei->hWndProgFile = GetDlgItem(hDlg, IDC_FILE_PROGRESS);

         // Set the ranges on our progress bar.
         SendDlgItemMessage(hDlg, IDC_FILE_PROGRESS, PBM_SETRANGE, 0,
                            MAKELPARAM(0, PROGRESS_MAX));

         // Launch our Extract thread and wait for WM_PRIVATE message.
         DoExtractOrTestFiles(g_szZipFile, pei);

         return TRUE;

      case WM_PRIVATE: // Sent with wParam equal to MSG_OPERATION_COMPLETE when
                       // test/extract is complete.

         // We are done.  Close our dialog.  Any errors will be reported by
         // OnActionView().
         g_hDlgProgress = NULL;
         EndDialog(hDlg, LOWORD(wParam));
         return FALSE;

      case WM_COMMAND:
         // If abort is pressed, then set a flag that our worker thread
         // periodically checks to decide if it needs to bail out.
         if ((LOWORD(wParam) == IDCANCEL) && !pei->fAbort) {
            pei->fAbort = TRUE;
            SetWindowText(GetDlgItem(hDlg, IDCANCEL), TEXT("Aborting..."));
            EnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE);
            return FALSE;
         }
   }

   return FALSE;



( run in 0.339 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )