unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cmdmix.cpp
Go to the documentation of this file.
2{
4 return;
5#if defined(__GNUC__) && defined(SFX_MODULE)
7#else
8#ifndef SILENT
9 static bool TitleShown=false;
10 if (TitleShown)
11 return;
12 TitleShown=true;
13
14 wchar Version[80];
15 if (RARVER_BETA!=0)
16 swprintf(Version,ASIZE(Version),L"%d.%02d %ls %d",RARVER_MAJOR,RARVER_MINOR,St(MBeta),RARVER_BETA);
17 else
18 swprintf(Version,ASIZE(Version),L"%d.%02d",RARVER_MAJOR,RARVER_MINOR);
19#if defined(_WIN_32) || defined(_WIN_64)
20 wcsncatz(Version,L" ",ASIZE(Version));
21#endif
22#ifdef _WIN_32
23 wcsncatz(Version,St(Mx86),ASIZE(Version));
24#endif
25#ifdef _WIN_64
26 wcsncatz(Version,St(Mx64),ASIZE(Version));
27#endif
28 if (PrintVersion)
29 {
30 mprintf(L"%s",Version);
31 exit(0);
32 }
34#endif
35#endif
36}
37
38
39inline bool CmpMSGID(MSGID i1,MSGID i2)
40{
41#ifdef MSGID_INT
42 return i1==i2;
43#else
44 // If MSGID is const char*, we cannot compare pointers only.
45 // Pointers to different instances of same string can differ,
46 // so we need to compare complete strings.
47 return wcscmp(i1,i2)==0;
48#endif
49}
50
52{
53#if !defined(SILENT)
54 OutTitle();
55 static MSGID Help[]={
56#ifdef SFX_MODULE
57 // Console SFX switches definition.
59#else
60 // UnRAR switches definition.
72#endif
73 };
74
75 for (uint I=0;I<ASIZE(Help);I++)
76 {
77#ifndef SFX_MODULE
78 if (CmpMSGID(Help[I],MCHelpSwV))
79 continue;
80#ifndef _WIN_ALL
81 static MSGID Win32Only[]={
84 };
85 bool Found=false;
86 for (uint J=0;J<ASIZE(Win32Only);J++)
87 if (CmpMSGID(Help[I],Win32Only[J]))
88 {
89 Found=true;
90 break;
91 }
92 if (Found)
93 continue;
94#endif
95#if !defined(_UNIX) && !defined(_WIN_ALL)
96 if (CmpMSGID(Help[I],MCHelpSwOW))
97 continue;
98#endif
99#if !defined(_WIN_ALL) && !defined(_EMX)
100 if (CmpMSGID(Help[I],MCHelpSwAC))
101 continue;
102#endif
103#ifndef SAVE_LINKS
104 if (CmpMSGID(Help[I],MCHelpSwOL))
105 continue;
106#endif
107#ifndef RAR_SMP
108 if (CmpMSGID(Help[I],MCHelpSwMT))
109 continue;
110#endif
111#endif
112 mprintf(St(Help[I]));
113 }
114 mprintf(L"\n");
115 ErrHandler.Exit(ExitCode);
116#endif
117}
118
ErrorHandler ErrHandler
bool BareOutput
Definition: cmddata.hpp:25
void OutHelp(RAR_EXIT ExitCode)
Definition: cmdmix.cpp:51
void OutTitle()
Definition: cmdmix.cpp:1
void Exit(RAR_EXIT ExitCode)
Definition: errhnd.cpp:236
bool PrintVersion
Definition: options.hpp:139
bool DisableCopyright
Definition: options.hpp:136
bool CmpMSGID(MSGID i1, MSGID i2)
Definition: cmdmix.cpp:39
void mprintf(const wchar *fmt,...)
Definition: consio.cpp:118
RAR_EXIT
Definition: errhnd.hpp:5
#define MCHelpSwME
Definition: loclang.hpp:98
#define MCHelpSwCL
Definition: loclang.hpp:66
#define MCHelpSwAG
Definition: loclang.hpp:59
#define MCHelpSwNal
Definition: loclang.hpp:103
#define MCHelpSwTN
Definition: loclang.hpp:132
#define MCHelpSwAD
Definition: loclang.hpp:58
#define Mx64
Definition: loclang.hpp:15
#define MSHelpCmdV
Definition: loclang.hpp:355
#define MCHelpSwTO
Definition: loclang.hpp:133
#define MUNRARTitle1
Definition: loclang.hpp:29
#define MCHelpSwCU
Definition: loclang.hpp:67
#define MCHelpSwOP
Definition: loclang.hpp:110
#define MCHelpSwN
Definition: loclang.hpp:101
#define MCHelpSwEP2
Definition: loclang.hpp:77
#define MCHelpSwY
Definition: loclang.hpp:149
#define MCHelpSwXa
Definition: loclang.hpp:147
#define MCHelpSwMT
Definition: loclang.hpp:100
#define MCHelpSwINUL
Definition: loclang.hpp:87
#define MCHelpSwEP
Definition: loclang.hpp:75
#define MCHelpCmdX
Definition: loclang.hpp:53
#define MCHelpSwTS
Definition: loclang.hpp:136
#define MCHelpSwDH
Definition: loclang.hpp:69
#define MCHelpSwVER
Definition: loclang.hpp:142
#define MCHelpSwRI
Definition: loclang.hpp:119
#define MCHelpSwEP3
Definition: loclang.hpp:78
#define MCHelpSwOW
Definition: loclang.hpp:113
#define MCHelpSwKB
Definition: loclang.hpp:92
#define MCHelpSwF
Definition: loclang.hpp:80
#define MCHelpSwDR
Definition: loclang.hpp:70
#define MCHelpSw
Definition: loclang.hpp:54
#define MCHelpSwVUnr
Definition: loclang.hpp:139
#define MCHelpCmdL
Definition: loclang.hpp:41
#define MCHelpSwSM
Definition: loclang.hpp:128
#define MCHelpSwEP4
Definition: loclang.hpp:79
#define MCHelpCmdE
Definition: loclang.hpp:37
#define MCHelpSwOC
Definition: loclang.hpp:105
#define MCHelpSwOS
Definition: loclang.hpp:112
#define MCHelpCmd
Definition: loclang.hpp:31
#define MCHelpCmdP
Definition: loclang.hpp:43
#define MCHelpSwV
Definition: loclang.hpp:138
#define MCHelpSwAC
Definition: loclang.hpp:57
#define MCHelpSwR
Definition: loclang.hpp:116
#define MCHelpSwO
Definition: loclang.hpp:104
#define MCHelpSwOR
Definition: loclang.hpp:111
#define MRARTitle2
Definition: loclang.hpp:30
#define MCHelpSwm
Definition: loclang.hpp:55
#define MCHelpSwVD
Definition: loclang.hpp:141
#define MCHelpSwVP
Definition: loclang.hpp:144
#define MCHelpSwU
Definition: loclang.hpp:137
#define MCHelpSwIDP
Definition: loclang.hpp:83
#define MCHelpSwOL
Definition: loclang.hpp:108
#define MCHelpSwP
Definition: loclang.hpp:114
#define MCHelpSwCFGm
Definition: loclang.hpp:65
#define MCHelpSwSI
Definition: loclang.hpp:126
#define MUCopyright
Definition: loclang.hpp:12
#define MSHelpCmdT
Definition: loclang.hpp:354
#define MCHelpSwAP
Definition: loclang.hpp:62
#define MCHelpSwAI
Definition: loclang.hpp:60
#define MCHelpSwAT
Definition: loclang.hpp:56
#define MCHelpSwTB
Definition: loclang.hpp:135
#define MCHelpSwIERR
Definition: loclang.hpp:85
#define MCHelpSwONI
Definition: loclang.hpp:109
#define MCopyrightS
Definition: loclang.hpp:351
#define MCHelpSwTA
Definition: loclang.hpp:134
#define MCHelpCmdV
Definition: loclang.hpp:52
#define MCHelpSwCm
Definition: loclang.hpp:64
#define MCHelpSwSC
Definition: loclang.hpp:124
#define MCHelpSwIEML
Definition: loclang.hpp:84
#define MCHelpSwSL
Definition: loclang.hpp:127
#define MCHelpSwIOFF
Definition: loclang.hpp:88
#define MBeta
Definition: loclang.hpp:13
#define Mx86
Definition: loclang.hpp:14
#define MSHelpCmdE
Definition: loclang.hpp:353
#define MCHelpSwAO
Definition: loclang.hpp:61
#define MCHelpSwXal
Definition: loclang.hpp:148
#define MCHelpSwX
Definition: loclang.hpp:146
#define MCHelpSwNa
Definition: loclang.hpp:102
#define MCHelpCmdT
Definition: loclang.hpp:50
const wchar * MSGID
Definition: os.hpp:228
#define ASIZE(x)
Definition: rardefs.hpp:10
wchar_t wchar
Definition: rartypes.hpp:13
unsigned int uint
Definition: rartypes.hpp:8
const wchar * St(MSGID StringId)
Definition: resource.cpp:8
void wcsncatz(wchar *dest, const wchar *src, size_t maxlen)
Definition: strfn.cpp:300
#define RARVER_MAJOR
Definition: version.hpp:1
#define RARVER_BETA
Definition: version.hpp:3
#define RARVER_YEAR
Definition: version.hpp:6
#define RARVER_MINOR
Definition: version.hpp:2