sl@0: #ifndef __CERTAPP_API_H__ sl@0: #define __CERTAPP_API_H__/* sl@0: * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: /** sl@0: RunCertApp sl@0: sl@0: This API will run certapp as separate process and returns the sl@0: result. This approach is taken so that the caller is protected from sl@0: any possible certapp failure. Even if certapp crashes, RunCertApp will sl@0: return without crashing the caller. sl@0: sl@0: Certapp guarantees to return a non-zero status if it fails, which sl@0: means you don't need to parse its output to deduce if it worked or sl@0: not. sl@0: sl@0: The certapp executable must be in the current search path. sl@0: sl@0: The caller will be blocked whilst certapp runs. sl@0: sl@0: There are two logging arguments, aProgress and aErrors. These may be sl@0: set to either a filename to write the output to or to "-" which means sl@0: standard output. If both logging arguments are identical, then the sl@0: output will be merged to a single location. sl@0: sl@0: Progress and warning messages are written to aProgress. sl@0: sl@0: Fatal errors will be logged to aErrors, and RunCertApp will return a sl@0: non-zero number. An error code of -1 means the certapp executable sl@0: failed or was not found, other error codes indicate problems launching sl@0: the executable. sl@0: sl@0: The argc argument should be set to the count of the argv arguments. sl@0: sl@0: The argv argument should be set to an array of const char * ptrs to sl@0: the remaining arguments. sl@0: sl@0: The argv arguments maybe any of the arguments accepted by the certapp sl@0: executable, run "certapp -h" for further information. sl@0: */ sl@0: int RunCertApp(const char *aProgress, const char *aErrors, sl@0: int argc, char **argv); sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: sl@0: #endif