1 |
|
---|
2 | #define OS2EMX_PLAIN_CHAR
|
---|
3 | // this is needed for "os2emx.h"; if this is defined,
|
---|
4 | // emx will define PSZ as _signed_ char, otherwise
|
---|
5 | // as unsigned char
|
---|
6 |
|
---|
7 | #define INCL_DOSMODULEMGR
|
---|
8 | #define INCL_DOSPROCESS
|
---|
9 | #define INCL_DOSEXCEPTIONS
|
---|
10 | #define INCL_DOSSESMGR
|
---|
11 | #define INCL_DOSQUEUES
|
---|
12 | #define INCL_DOSSEMAPHORES
|
---|
13 | #define INCL_DOSMISC
|
---|
14 | #define INCL_DOSDEVICES
|
---|
15 | #define INCL_DOSDEVIOCTL
|
---|
16 | #define INCL_DOSERRORS
|
---|
17 |
|
---|
18 | #define INCL_KBD
|
---|
19 | #include <os2.h>
|
---|
20 |
|
---|
21 | #include <stdlib.h>
|
---|
22 | #include <string.h>
|
---|
23 | #include <stdio.h>
|
---|
24 | #include <stdarg.h>
|
---|
25 | #include <ctype.h>
|
---|
26 |
|
---|
27 | #include "setup.h" // code generation and debugging options
|
---|
28 |
|
---|
29 | #include "helpers\dosh.h"
|
---|
30 | #include "helpers\exeh.h"
|
---|
31 | #include "helpers\standards.h"
|
---|
32 |
|
---|
33 | #pragma hdrstop
|
---|
34 |
|
---|
35 | int main (int argc, char *argv[])
|
---|
36 | {
|
---|
37 | int arc = 0;
|
---|
38 | PEXECUTABLE pExe;
|
---|
39 |
|
---|
40 | if (argc != 2)
|
---|
41 | {
|
---|
42 | printf("exeh (built " __DATE__ "): displays the bldlevel of an executable.\n");
|
---|
43 | printf("Usage: exeh <name.exe>\n");
|
---|
44 | arc = 1003;
|
---|
45 | }
|
---|
46 | else
|
---|
47 | {
|
---|
48 | if (!(arc = exehOpen(argv[1], &pExe)))
|
---|
49 | {
|
---|
50 | if (!(arc = exehQueryBldLevel(pExe)))
|
---|
51 | {
|
---|
52 | #define STRINGORNA(p) ((pExe->p) ? (pExe->p) : "n/a")
|
---|
53 |
|
---|
54 | printf("exeh: dumping bldlevel of \"%s\"\n", argv[1]);
|
---|
55 | printf(" Description: \"%s\"\n", STRINGORNA(pszDescription));
|
---|
56 | printf(" Vendor: \"%s\"\n", STRINGORNA(pszVendor));
|
---|
57 | printf(" Version: \"%s\"\n", STRINGORNA(pszVersion));
|
---|
58 | printf(" Info: \"%s\"\n", STRINGORNA(pszInfo));
|
---|
59 | printf(" Build date/time: \"%s\"\n", STRINGORNA(pszBuildDateTime));
|
---|
60 | printf(" Build machine: \"%s\"\n", STRINGORNA(pszBuildMachine));
|
---|
61 | printf(" ASD: \"%s\"\n", STRINGORNA(pszASD));
|
---|
62 | printf(" Language: \"%s\"\n", STRINGORNA(pszLanguage));
|
---|
63 | printf(" Country: \"%s\"\n", STRINGORNA(pszCountry));
|
---|
64 | printf(" Revision: \"%s\"\n", STRINGORNA(pszRevision));
|
---|
65 | printf(" Unknown string: \"%s\"\n", STRINGORNA(pszUnknown));
|
---|
66 | printf(" Fixpak: \"%s\"\n", STRINGORNA(pszFixpak));
|
---|
67 |
|
---|
68 | }
|
---|
69 |
|
---|
70 | exehClose(&pExe);
|
---|
71 | }
|
---|
72 |
|
---|
73 | if (arc)
|
---|
74 | {
|
---|
75 | printf("exeh: Error %d occurred with \"%s\".\n", arc, argv[1]);
|
---|
76 | }
|
---|
77 | }
|
---|
78 |
|
---|
79 | return arc;
|
---|
80 | }
|
---|