equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
54 |
54 |
55 CMakeKeys::CMakeKeys() |
55 CMakeKeys::CMakeKeys() |
56 :m_fVerbose(FALSE) |
56 :m_fVerbose(FALSE) |
57 { ; } |
57 { ; } |
58 |
58 |
59 int CMakeKeys::Run(const int argc, const _TCHAR *argv[], const _TCHAR *envp[]) |
59 int CMakeKeys::Run(const int argc, const _TCHAR *argv[]) |
60 // Inputs : argc, argv, envp - The command line passed to the process |
60 // Inputs : argc, argv, envp - The command line passed to the process |
61 { |
61 { |
62 BOOL bValid = TRUE; |
62 BOOL bValid = TRUE; |
63 m_KeyGen = NULL; |
63 m_KeyGen = NULL; |
64 pMakeCert = NULL; |
64 pMakeCert = NULL; |
115 { |
115 { |
116 char Warn[128]; |
116 char Warn[128]; |
117 |
117 |
118 OUT << _T("Warning: the private key should be encrypted with the -password option") << endl; |
118 OUT << _T("Warning: the private key should be encrypted with the -password option") << endl; |
119 OUT << _T("Do you want to use a password (y/n)? "); |
119 OUT << _T("Do you want to use a password (y/n)? "); |
|
120 OUT.flush(); |
120 |
121 |
121 cin >> Warn; |
122 cin >> Warn; |
122 |
123 |
123 if (stricmp(Warn, "n") != 0) |
124 if (stricmp(Warn, "n") != 0) |
124 { |
125 { |
164 { |
165 { |
165 char Warn[128]; |
166 char Warn[128]; |
166 |
167 |
167 OUT << _T("Warning: the private key should be encrypted with the -password option") << endl; |
168 OUT << _T("Warning: the private key should be encrypted with the -password option") << endl; |
168 OUT << _T("Do you want to use a password (y/n)? "); |
169 OUT << _T("Do you want to use a password (y/n)? "); |
|
170 OUT.flush(); |
169 |
171 |
170 cin >> Warn; |
172 cin >> Warn; |
171 |
173 |
172 if (stricmp(Warn, "n") != 0) |
174 if (stricmp(Warn, "n") != 0) |
173 { |
175 { |
294 } |
296 } |
295 |
297 |
296 // main function - constructs a CMakeKeys object and calls it's run method |
298 // main function - constructs a CMakeKeys object and calls it's run method |
297 extern "C" |
299 extern "C" |
298 { |
300 { |
299 int _tmain(int argc, const _TCHAR *argv[], const _TCHAR *envp[]) |
301 int main(int argc, const char *argv[], const char *envp[]) |
300 { |
302 { |
|
303 // MingW doesn't support _tmain(), |
|
304 // so using GetCommandLineW() to get wide args. |
|
305 wchar_t** argvW = CommandLineToArgvW( GetCommandLineW(), &argc); |
|
306 |
301 CMakeKeys app; |
307 CMakeKeys app; |
302 return app.Run(argc, argv, envp); |
308 return app.Run(argc, argvW); |
303 } |
309 } |
304 } |
310 } |