LMMS
Loading...
Searching...
No Matches
unix.c File Reference
#include "unzip.h"
#include <sys/dir.h>

Macros

#define UNZIP_INTERNAL
#define dirent   direct
#define S_ISUID   0004000 /* set user id on execution */
#define S_ISGID   0002000 /* set group id on execution */
#define S_ISVTX   0001000 /* save swapped text even after use */
#define FN_MASK   7
#define FUNCTION   (flag & FN_MASK)
#define IZ_CC_NAME   "cc"
#define IZ_OS_NAME   "Unix"

Functions

static unsigned filtattr OF ((__GPRO__ unsigned perms))
char * do_wild (__G__ wildspec) __GDEF ZCONST char *wildspec
 if (!G.notfirstcall)
 if ((DIR *) G.wild_dir==(DIR *) NULL)
 while ((file=readdir((DIR *) G.wild_dir)) !=(struct dirent *) NULL)
 closedir ((DIR *) G.wild_dir)
 if (G.have_dirname) free(G.dirname)
 return (char *)
int mapattr (__G)
int mapname (__G__ renamed) __GDEF int renamed
 if (G.pInfo->vollabel) return MPN_VOL_LABEL
 if (checkdir(__G__(char *) NULL, INIT)==MPN_NOMEM)
 if (killed_ddot &&QCOND2)
 if (G.filename[strlen(G.filename) - 1]=='/')
 if (!uO.V_flag &&lastsemi)
 if (strcmp(pathcomp, ".")==0)
 checkdir (__G__ pathcomp, APPEND_NAME)
 checkdir (__G__ G.filename, GETPATH)
int checkdir (__G__ pathcomp, flag) __GDEF char *pathcomp
static int get_extattribs OF ((__GPRO__ iztimes *pzt, ulg z_uidgid[2]))
static int get_extattribs (__G__ pzt, z_uidgid) __GDEF iztimes *pzt
 if (eb_izux_flg &EB_UT_FL_MTIME)
 TTrace ((stderr, "\nget_extattribs: modification/access times = %ld\n", pzt->mtime))
void close_outfile (__G)
void version (__G)

Variables

static ZCONST char CannotSetItemUidGid []
static ZCONST char CannotSetUidGid []
static ZCONST char CannotSetItemTimestamps []
static ZCONST char CannotSetTimestamps []
G wild_dir = (zvoid *)NULL
G notfirstcall = FALSE
char * pp
char * cp =(char *)NULL
char * lastsemi =(char *)NULL
int killed_ddot = FALSE
int error = MPN_OK
register unsigned workch
G create_dirs = (!uO.fflag || renamed)
G created_dir = FALSE
G renamed_fullpath = (renamed && (*G.filename == '/'))
int flag
ulg z_uidgid [2]
unsigned eb_izux_flg
 else
 have_uidgid_flg

Macro Definition Documentation

◆ dirent

#define dirent   direct

◆ FN_MASK

#define FN_MASK   7

◆ FUNCTION

#define FUNCTION   (flag & FN_MASK)

◆ IZ_CC_NAME

#define IZ_CC_NAME   "cc"

◆ IZ_OS_NAME

#define IZ_OS_NAME   "Unix"

◆ S_ISGID

#define S_ISGID   0002000 /* set group id on execution */

◆ S_ISUID

#define S_ISUID   0004000 /* set user id on execution */

◆ S_ISVTX

#define S_ISVTX   0001000 /* save swapped text even after use */

◆ UNZIP_INTERNAL

#define UNZIP_INTERNAL

Function Documentation

◆ checkdir() [1/3]

checkdir ( __G__ G. filename,
GETPATH  )

◆ checkdir() [2/3]

checkdir ( __G__ pathcomp,
APPEND_NAME  )

◆ checkdir() [3/3]

int checkdir ( __G__ pathcomp,
flag  )

◆ close_outfile()

void close_outfile ( __G )

◆ closedir()

closedir ( (DIR *) G. wild_dir)

◆ do_wild()

char * do_wild ( __G__ wildspec)

◆ get_extattribs()

int get_extattribs ( __G__ pzt,
z_uidgid  )
static

◆ if() [1/10]

if ( !G. notfirstcall)

◆ if() [2/10]

if ( !uO.V_flag && lastsemi)

◆ if() [3/10]

if ( (DIR *) G. wild_dir = = (DIR *)NULL)

◆ if() [4/10]

if ( checkdir(__G__(char *) NULL, INIT) = MPN_NOMEM)

◆ if() [5/10]

if ( eb_izux_flg & EB_UT_FL_MTIME)

◆ if() [6/10]

if ( G. filename[strlen(G.filename) - 1] = = '/')

◆ if() [7/10]

if ( G. have_dirname)

◆ if() [8/10]

if ( G.pInfo-> vollabel)

◆ if() [9/10]

if ( killed_ddot && QCOND2)

◆ if() [10/10]

if ( strcmp(pathcomp, ".") = = 0)

◆ mapattr()

int mapattr ( __G )

◆ mapname()

int mapname ( __G__ renamed)

◆ OF() [1/2]

int get_extattribs OF ( (__GPRO__ iztimes *pzt, ulg z_uidgid[2]) )
static

◆ OF() [2/2]

unsigned filtattr OF ( (__GPRO__ unsigned perms) )
static

◆ return()

return ( char * )

◆ TTrace()

TTrace ( (stderr, "\nget_extattribs: modification/access times = %ld\n", pzt->mtime) )

◆ version()

void version ( __G )

◆ while()

while ( (file=readdir((DIR *) G.wild_dir)) ! = (struct dirent *)NULL)

Variable Documentation

◆ CannotSetItemTimestamps

ZCONST char CannotSetItemTimestamps[]
static
Initial value:
=
"warning: cannot set modif./access times for %s\n %s\n"

◆ CannotSetItemUidGid

ZCONST char CannotSetItemUidGid[]
static
Initial value:
=
"warning: cannot set UID %lu and/or GID %lu for %s\n %s\n"

◆ CannotSetTimestamps

ZCONST char CannotSetTimestamps[]
static
Initial value:
=
" (warning) cannot set modif./access times\n %s"

◆ CannotSetUidGid

ZCONST char CannotSetUidGid[]
static
Initial value:
=
" (warning) cannot set UID %lu and/or GID %lu\n %s"

◆ cp

char * cp =(char *)NULL

◆ create_dirs

G create_dirs = (!uO.fflag || renamed)

◆ created_dir

G created_dir = FALSE

◆ eb_izux_flg

eb_izux_flg
Initial value:
{
have_uidgid_flg
Definition unix.c:1084

◆ else

else
Initial value:
{
pzt->mtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime)
time_t dos_to_unix_time(ulg dosdatetime)
Definition fileio.c:1696
Uz_Globs G
Definition globals.c:42

◆ error

return error = MPN_OK

◆ flag

int flag

◆ have_uidgid_flg

return have_uidgid_flg
Initial value:
=
0

◆ killed_ddot

int killed_ddot = FALSE

◆ lastsemi

char* lastsemi =(char *)NULL

◆ notfirstcall

G notfirstcall = FALSE

◆ pp

* pp
Initial value:
{
#define FILNAMSIZ
Definition unzpriv.h:1198
if pathcomp
Definition win32.c:1891

◆ renamed_fullpath

G renamed_fullpath = (renamed && (*G.filename == '/'))

◆ wild_dir

G wild_dir = (zvoid *)NULL

◆ workch

register unsigned workch

◆ z_uidgid

ulg z_uidgid[2]