File: sxunzip.c

package info (click to toggle)
unzip 6.0-16%2Bdeb8u3
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 8,768 kB
  • ctags: 10,194
  • sloc: ansic: 55,133; cpp: 4,084; makefile: 2,517; asm: 1,789; cs: 1,012; sh: 119
file content (144 lines) | stat: -rw-r--r-- 3,591 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
  Copyright (c) 1990-2001 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
*/
/*****************************************************************************/
/*  Includes                                                                 */
/*****************************************************************************/

#include <string.h>
#include "unzvers.h"
#include <stdio.h>


#ifdef USE_SIOUX
#  include <sioux.h>
#  include <signal.h>
#  include <stdlib.h>
#  include <console.h>
#endif /* USE_SIOUX */


/*****************************************************************************/
/*  Global Vars                                                              */
/*****************************************************************************/

char fileList[256];


/*****************************************************************************/
/*  Prototypes                                                               */
/*****************************************************************************/

int UzpMain(int argc,char **argv);

char *GetUnZipLocalVersion(void);
char *GetUnZipInfoVersions(void);
int  macgetch(void);
void UserStop(void);



/*****************************************************************************/
/*  Functions                                                                */
/*****************************************************************************/

#ifndef MacStaticLib
#ifndef MACUNZIP_STANDALONE

/*
Program execution starts here with Metrowerks SIOUX-Console */
int main(int argc,char **argv)
{
    int return_code;

    SIOUXSettings.asktosaveonclose = FALSE;
    SIOUXSettings.showstatusline = TRUE;

    SIOUXSettings.columns = 100;
    SIOUXSettings.rows    = 40;

    argc = ccommand(&argv);

    return_code = UzpMain(argc,argv);

    printf("\n\n Finish  %d",return_code);

    return return_code;
}



int macgetch(void)
{
    WindowPtr whichWindow;
    EventRecord theEvent;
    char c;                     /* one-byte buffer for read() to use */

    do {
        SystemTask();
        if (!GetNextEvent(everyEvent, &theEvent))
            theEvent.what = nullEvent;
        else {
            switch (theEvent.what) {
            case keyDown:
                c = theEvent.message & charCodeMask;
                break;
            case mouseDown:
                if (FindWindow(theEvent.where, &whichWindow) ==
                    inSysWindow)
                    SystemClick(&theEvent, whichWindow);
                break;
            case updateEvt:
                break;
            }
        }
    } while (theEvent.what != keyDown);

    printf("*");
    fflush(stdout);

    return (int)c;
}


/* SIOUX needs no extra event handling */
void UserStop(void)
{
}

#endif  /*   #ifndef MACUNZIP_STANDALONE  */
#endif  /*   #ifndef MacStaticLib   */




char *GetUnZipLocalVersion(void)
{
static char UnZipVersionLocal[50];

memset(UnZipVersionLocal,0,sizeof(UnZipVersionLocal));

sprintf(UnZipVersionLocal, "[%s %s]", __DATE__, __TIME__);

return UnZipVersionLocal;
}




char *GetUnZipInfoVersions(void)
{
static char UnzipVersion[200];

memset(UnzipVersion,0,sizeof(UnzipVersion));

sprintf(UnzipVersion, "Unzip Module\n%d.%d%d%s of %s", UZ_MAJORVER,
        UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, UZ_VERSION_DATE);

return UnzipVersion;
}