mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-05 05:59:23 +01: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:
parent
3cfb34564f
commit
18b78c7498
48 changed files with 801 additions and 603 deletions
|
|
@ -29,21 +29,31 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_printf printf
|
||||
#define polarssl_malloc malloc
|
||||
#include <stdio.h>
|
||||
#define polarssl_free free
|
||||
#define polarssl_malloc malloc
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BASE64_C) && defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/base64.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define DFL_FILENAME "file.pem"
|
||||
#define DFL_OUTPUT_FILENAME "file.der"
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: pem2der param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" filename=%%s default: file.pem\n" \
|
||||
" output_file=%%s default: file.der\n" \
|
||||
"\n"
|
||||
|
||||
#if !defined(POLARSSL_BASE64_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
|
|
@ -170,13 +180,6 @@ static int write_file( const char *path, unsigned char *buf, size_t n )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: pem2der param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" filename=%%s default: file.pem\n" \
|
||||
" output_file=%%s default: file.der\n" \
|
||||
"\n"
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
|||
|
|
@ -29,14 +29,17 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_ERROR_C) || defined(POLARSSL_ERROR_STRERROR_DUMMY)
|
||||
#include "polarssl/error.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "polarssl/error.h"
|
||||
#endif
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: strerror <errorcode>\n" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue