diff -r 675a964f4eb5 -r 35751d3474b7 securityanddataprivacytools/securitytools/certapp/api/certapp-api.c --- a/securityanddataprivacytools/securitytools/certapp/api/certapp-api.c Tue Jul 21 01:04:32 2009 +0100 +++ b/securityanddataprivacytools/securitytools/certapp/api/certapp-api.c Thu Sep 10 14:01:51 2009 +0300 @@ -1,155 +1,155 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include -#include -#include -#include - -#include "certapp-api.h" - -#define CERTAPP "certapp" -typedef const char *ArgPtr; - -#ifdef __LINUX__ -#include -#include -#else -#include -#endif - -#ifndef BULLSEYE_OFF -#ifdef _BullseyeCoverage -#define BULLSEYE_OFF "BullseyeCoverage save off"; -#define BULLSEYE_RESTORE "BullseyeCoverage restore"; -#else -#define BULLSEYE_OFF -#define BULLSEYE_RESTORE -#endif -#endif - -static const char * const OPT_PROGRESS = "--progress="; -static const char * const OPT_ERRORS = "--errors="; - -int RunCertApp(const char *aProgress, const char *aErrors, - int argc, char **argv) -{ - int ret = -1; -BULLSEYE_OFF - if(argc<0) abort(); // Bad argument -BULLSEYE_RESTORE - - int newArgc = argc+4; - const char **newArgv = (const char **)malloc(sizeof(ArgPtr)*newArgc); - - const char *progFile = (aProgress) ? (aProgress) : ("-"); - const char *errorsFile = (aErrors) ? (aErrors) : ("-"); - - char *progress=(char *)malloc(strlen(OPT_PROGRESS)+strlen(progFile)+1); - strcpy(progress, OPT_PROGRESS); - strcat(progress, progFile); - - char *errors=(char *)malloc(strlen(OPT_ERRORS)+strlen(errorsFile)+1); - strcpy(errors, OPT_ERRORS); - strcat(errors, errorsFile); - - newArgv[0] = CERTAPP; - newArgv[1] = progress; - newArgv[2] = errors; - int i=0; - for(i=0; i +#include +#include +#include + +#include + +#define CERTAPP "certapp" +typedef const char *ArgPtr; + +#ifdef __LINUX__ +#include +#include +#else +#include +#endif + +#ifndef BULLSEYE_OFF +#ifdef _BullseyeCoverage +#define BULLSEYE_OFF "BullseyeCoverage save off"; +#define BULLSEYE_RESTORE "BullseyeCoverage restore"; +#else +#define BULLSEYE_OFF +#define BULLSEYE_RESTORE +#endif +#endif + +static const char * const OPT_PROGRESS = "--progress="; +static const char * const OPT_ERRORS = "--errors="; + +int RunCertApp(const char *aProgress, const char *aErrors, + int argc, char **argv) +{ + int ret = -1; +BULLSEYE_OFF + if(argc<0) abort(); // Bad argument +BULLSEYE_RESTORE + + int newArgc = argc+4; + const char **newArgv = (const char **)malloc(sizeof(ArgPtr)*newArgc); + + const char *progFile = (aProgress) ? (aProgress) : ("-"); + const char *errorsFile = (aErrors) ? (aErrors) : ("-"); + + char *progress=(char *)malloc(strlen(OPT_PROGRESS)+strlen(progFile)+1); + strcpy(progress, OPT_PROGRESS); + strcat(progress, progFile); + + char *errors=(char *)malloc(strlen(OPT_ERRORS)+strlen(errorsFile)+1); + strcpy(errors, OPT_ERRORS); + strcat(errors, errorsFile); + + newArgv[0] = CERTAPP; + newArgv[1] = progress; + newArgv[2] = errors; + int i=0; + for(i=0; i