forked from as-com/precomp-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dlltest.cpp
41 lines (33 loc) · 1 KB
/
dlltest.cpp
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
#include <stdio.h>
#include "precomp.h"
__declspec (dllimport)
void get_copyright_msg(char* msg);
__declspec (dllimport)
bool precompress_file(char* in_file, char* out_file, char* msg, Switches switches);
__declspec (dllimport)
bool recompress_file(char* in_file, char* out_file, char* msg, Switches switches);
int main(int argc, char* argv[]) {
char msg[256];
if ((argc != 2) && (argc != 3)) {
printf("\nSyntax: dlltest [d] input_file\n");
return -1;
}
printf("\nCopyright message:\n");
get_copyright_msg(msg);
printf("%s\n", msg);
Switches switches; //Precomp switches
if (argc == 2) {
if (!precompress_file(argv[1], "~temp.pcf", msg, switches)) {
printf("%s\n", msg);
} else {
printf("File %s was precompressed successfully to ~temp.pcf.\n", argv[1]);
}
} else {
if (!recompress_file(argv[2], "out.dat", msg, switches)) {
printf("%s\n", msg);
} else {
printf("File %s was recompressed successfully to out.dat.\n", argv[2]);
}
}
return 0;
}