Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

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

/*
  Copyright (c) 1990-2007 Info-ZIP.  All rights reserved.

  See the accompanying file LICENSE, version 2007-Mar-04 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
*/
/*---------------------------------------------------------------------------

  netware.c

  This file implements these functions for a NetWare Loadable Module (NLM):

  Contains:  InitUnZipConsole()
             do_wild()
             mapattr()
             mapname()
             checkdir()
             close_outfile()
             stamp_file()
             version()
             screensize()

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


#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];
  uch attr[4];
} RO_extra_block;

#endif /* ACORN_FTYPE_NFS */

static int created_dir;        /* used in mapname(), checkdir() */
static int renamed_fullpath;   /* ditto */


/*********************************/
/*  Function InitUnZipConsole()  */
/*********************************/

void InitUnZipConsole()
{
    unsigned int myHandle = GetNLMHandle();
    unsigned int *activeScreen =
            ImportSymbol(myHandle, "activeScreen");
    unsigned int *systemConsoleScreen =
            ImportSymbol(myHandle, "systemConsoleScreen");
    void (*pUseAccurateCaseForPaths)(int) =
            ImportSymbol(myHandle, "UseAccurateCaseForPaths");

    if (!activeScreen || !systemConsoleScreen ||
            *activeScreen == *systemConsoleScreen)
        CreateScreen("Info-ZIP UnZip Utility", 0);
    else
        CreateScreen("System Console", DONT_AUTO_ACTIVATE);

    SetCurrentNameSpace(NW_NS_LONG);
    if (pUseAccurateCaseForPaths)
            pUseAccurateCaseForPaths(TRUE);

    UnimportSymbol(myHandle, "activeScreen");
    UnimportSymbol(myHandle, "systemConsoleScreen");
    UnimportSymbol(myHandle, "UseAccurateCaseForPaths");
}


/**********************/
/* Function do_wild() */   /* for porting: dir separator; match(ignore_case) */
/**********************/

char *do_wild(__G__ wildspec)
    __GDEF
    ZCONST char *wildspec;      /* only used first time on a given dir */
{
    static DIR *wild_dir = (DIR *)NULL;
    static ZCONST char *wildname;
    static char *dirname, matchname[FILNAMSIZ];



( run in 1.100 second using v1.01-cache-2.11-cpan-d8267643d1d )