Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsZipArchive.cpp File Reference
#include "nsWildCard.h"
#include "nscore.h"
#include "prmem.h"
#include "prio.h"
#include "plstr.h"
#include "prlog.h"
#include "prprf.h"
#include "zlib.h"
#include "nsISupportsUtils.h"
#include "nsRecyclingAllocator.h"
#include "nsPrintfCString.h"
#include "zipfile.h"
#include "zipstruct.h"
#include "nsZipArchive.h"

Go to the source code of this file.

Defines

#define ZFILE_CREATE   PR_WRONLY | PR_CREATE_FILE
#define READTYPE   PRInt32
#define NBUCKETS   6
 Globals.
#define BY4ALLOC_ITEMS   320
#define S_IFMT   0170000
#define S_IFLNK   0120000
#define PATH_MAX   1024
#define BR_BUF_SIZE   1024 /* backward read buffer size */

Functions

static PRUint16 xtoint (unsigned char *ii)
static PRUint32 xtolong (unsigned char *ll)
static PRUint16 ExtractMode (PRUint32 ext_attr)
static PRBool IsSymlink (PRUint32 ext_attr)
 zlibAlloc (void *opaque, uInt items, uInt size)
 zlibFree (void *opaque, void *ptr)

Variables

nsRecyclingAllocator * gZlibAllocator = NULL

Define Documentation

#define BR_BUF_SIZE   1024 /* backward read buffer size */

Definition at line 875 of file nsZipArchive.cpp.

Definition at line 72 of file nsZipArchive.cpp.

#define NBUCKETS   6

Globals.

Global allocator used with zlib. Destroyed in module shutdown.

Definition at line 71 of file nsZipArchive.cpp.

#define PATH_MAX   1024

Definition at line 124 of file nsZipArchive.cpp.

Definition at line 61 of file nsZipArchive.cpp.

#define S_IFLNK   0120000

Definition at line 121 of file nsZipArchive.cpp.

#define S_IFMT   0170000

Definition at line 118 of file nsZipArchive.cpp.

Definition at line 60 of file nsZipArchive.cpp.


Function Documentation

static PRUint16 ExtractMode ( PRUint32  ext_attr) [static]

Definition at line 1871 of file nsZipArchive.cpp.

{
    ext_attr &= 0x00FF0000;
    ext_attr >>= 16;
    ext_attr |= 0x00000100;

    return (PRUint16) ext_attr;
}

Here is the caller graph for this function:

static PRBool IsSymlink ( PRUint32  ext_attr) [static]

Definition at line 1887 of file nsZipArchive.cpp.

{
  return (((ext_attr>>16) & S_IFMT) == S_IFLNK) ? PR_TRUE : PR_FALSE;
}

Here is the caller graph for this function:

static PRUint16 xtoint ( unsigned char *  ii) [static]

Definition at line 1838 of file nsZipArchive.cpp.

{
  return (PRUint16) ((ii [0]) | (ii [1] << 8));
}

Here is the caller graph for this function:

static PRUint32 xtolong ( unsigned char *  ll) [static]

Definition at line 1849 of file nsZipArchive.cpp.

{
  PRUint32 ret;

  ret =  (
         (((PRUint32) ll [0]) <<  0) |
         (((PRUint32) ll [1]) <<  8) |
         (((PRUint32) ll [2]) << 16) |
         (((PRUint32) ll [3]) << 24)
        );

  return ret;
}

Here is the caller graph for this function:

zlibAlloc ( void opaque,
uInt  items,
uInt  size 
)

Definition at line 407 of file nsZipArchive.cpp.

{
  nsRecyclingAllocator *zallocator = (nsRecyclingAllocator *)opaque;
  if (zallocator) {
    // Bump up x4 allocations
    PRUint32 realitems = items;
    if (size == 4 && items < BY4ALLOC_ITEMS)
      realitems = BY4ALLOC_ITEMS;
     return zallocator->Calloc(realitems, size);
  }
  else
    return calloc(items, size);
}

Here is the call graph for this function:

Here is the caller graph for this function:

zlibFree ( void opaque,
void ptr 
)

Definition at line 422 of file nsZipArchive.cpp.

{
  nsRecyclingAllocator *zallocator = (nsRecyclingAllocator *)opaque;
  if (zallocator)
    zallocator->Free(ptr);
  else
    free(ptr);
  return;
}

Here is the caller graph for this function:


Variable Documentation

nsRecyclingAllocator* gZlibAllocator = NULL

Definition at line 73 of file nsZipArchive.cpp.