1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2026-01-06 11:41:12 +03:00

cleanup programs

Clean up the contents of programs, add more guards to includes, move all
defines to the top of the top of files, remove some unused includes
This commit is contained in:
Rich Evans
2015-02-11 14:06:19 +00:00
parent 3cfb34564f
commit 18b78c7498
48 changed files with 801 additions and 603 deletions

View File

@@ -29,15 +29,28 @@
#if defined(POLARSSL_PLATFORM_C)
#include "polarssl/platform.h"
#else
#include <stdio.h>
#define polarssl_printf printf
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) &&\
defined(POLARSSL_X509_CSR_PARSE_C) && defined(POLARSSL_FS_IO)
#include "polarssl/x509_csr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#define DFL_FILENAME "cert.req"
#define DFL_DEBUG_LEVEL 0
#define USAGE \
"\n usage: req_app param=<>...\n" \
"\n acceptable parameters:\n" \
" filename=%%s default: cert.req\n" \
"\n"
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \
!defined(POLARSSL_X509_CSR_PARSE_C) || !defined(POLARSSL_FS_IO)
int main( int argc, char *argv[] )
@@ -50,10 +63,6 @@ int main( int argc, char *argv[] )
return( 0 );
}
#else
#define DFL_FILENAME "cert.req"
#define DFL_DEBUG_LEVEL 0
/*
* global options
*/
@@ -62,12 +71,6 @@ struct options
const char *filename; /* filename of the certificate request */
} opt;
#define USAGE \
"\n usage: req_app param=<>...\n" \
"\n acceptable parameters:\n" \
" filename=%%s default: cert.req\n" \
"\n"
int main( int argc, char *argv[] )
{
int ret = 0;