formatting method and version module.

This commit is contained in:
louib
2020-01-05 13:08:46 -05:00
parent cb4d411b05
commit bc8cfeb478
6 changed files with 969 additions and 900 deletions

View File

@@ -23,4 +23,4 @@ jobs:
- name: verifying code style - name: verifying code style
# TODO use check-format when all the code has been formatted. # TODO use check-format when all the code has been formatted.
# run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && make check-format # run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && make check-format
run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && clang-format -i -style=file src/nwipe.c src/nwipe.h src/options.c src/options.h && git diff-index --quiet HEAD run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && clang-format -i -style=file src/nwipe.c src/nwipe.h src/options.c src/options.h src/version.h src/version.c src/method.h src/method.c && git diff-index --quiet HEAD

View File

@@ -23,4 +23,4 @@ jobs:
- name: verifying code style - name: verifying code style
# TODO use check-format when all the code has been formatted. # TODO use check-format when all the code has been formatted.
# run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && make check-format # run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && make check-format
run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && clang-format -i -style=file src/nwipe.c src/nwipe.h src/options.c src/options.h && git diff-index --quiet HEAD run: export PATH=$PATH:/usr/lib/llvm-5.0/bin && clang-format -i -style=file src/nwipe.c src/nwipe.h src/options.c src/options.h src/version.h src/version.c src/method.h src/method.c && git diff-index --quiet HEAD

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
* methods.c: Method implementations for nwipe. * methods.c: Method implementations for nwipe.
* *
* Copyright Darik Horn <dajhorn-dban@vanadac.com>. * Copyright Darik Horn <dajhorn-dban@vanadac.com>.
* *
* Modifications to original dwipe Copyright Andy Beverley <andy@andybev.com> * Modifications to original dwipe Copyright Andy Beverley <andy@andybev.com>
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
@@ -16,47 +16,43 @@
* *
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., * this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
*/ */
#ifndef METHOD_H_ #ifndef METHOD_H_
#define METHOD_H_ #define METHOD_H_
/* The argument list for nwipe methods. */ /* The argument list for nwipe methods. */
#define NWIPE_METHOD_SIGNATURE nwipe_context_t* c #define NWIPE_METHOD_SIGNATURE nwipe_context_t* c
typedef enum nwipe_verify_t_ typedef enum nwipe_verify_t_ {
{ NWIPE_VERIFY_NONE = 0, // Do not read anything back from the device.
NWIPE_VERIFY_NONE = 0, /* Do not read anything back from the device. */ NWIPE_VERIFY_LAST, // Check the last pass.
NWIPE_VERIFY_LAST, /* Check the last pass. */ NWIPE_VERIFY_ALL, // Check all passes.
NWIPE_VERIFY_ALL, /* Check all passes. */
} nwipe_verify_t; } nwipe_verify_t;
/* The typedef of the function that will do the wipe. */ /* The typedef of the function that will do the wipe. */
typedef int(*nwipe_method_t)( void *ptr ); typedef int ( *nwipe_method_t )( void* ptr );
typedef struct /* nwipe_pattern_t */ typedef struct
{ {
int length; /* Length of the pattern in bytes, -1 means random. */ int length; // Length of the pattern in bytes, -1 means random.
char* s; /* The actual bytes of the pattern. */ char* s; // The actual bytes of the pattern.
} nwipe_pattern_t; } nwipe_pattern_t;
const char* nwipe_method_label( void* method ); const char* nwipe_method_label( void* method );
int nwipe_runmethod( NWIPE_METHOD_SIGNATURE, nwipe_pattern_t* patterns ); int nwipe_runmethod( NWIPE_METHOD_SIGNATURE, nwipe_pattern_t* patterns );
void *nwipe_dod522022m( void *ptr ); void* nwipe_dod522022m( void* ptr );
void *nwipe_dodshort( void *ptr ); void* nwipe_dodshort( void* ptr );
void *nwipe_gutmann( void *ptr ); void* nwipe_gutmann( void* ptr );
void *nwipe_ops2( void *ptr ); void* nwipe_ops2( void* ptr );
void *nwipe_is5enh( void *ptr ); void* nwipe_is5enh( void* ptr );
void *nwipe_random( void *ptr ); void* nwipe_random( void* ptr );
void *nwipe_zero( void *ptr ); void* nwipe_zero( void* ptr );
void *nwipe_verify( void *ptr ); void* nwipe_verify( void* ptr );
void calculate_round_size( nwipe_context_t* ); void calculate_round_size( nwipe_context_t* );
#endif /* METHOD_H_ */ #endif /* METHOD_H_ */
/* eof */

View File

@@ -1,17 +1,17 @@
/** /**
* version_string and program_name are used by siege * version_string and program_name are used by siege
* and configure; author_name and email_address are * and configure; author_name and email_address are
* used by configure to dynamically assign those values * used by configure to dynamically assign those values
* to documentation files. * to documentation files.
*/ */
const char *version_string = "0.27rc1"; const char* version_string = "0.27rc1";
const char *program_name = "nwipe"; const char* program_name = "nwipe";
const char *author_name = "Martijn van Brummelen"; const char* author_name = "Martijn van Brummelen";
const char *email_address = "git@brumit.nl"; const char* email_address = "git@brumit.nl";
const char *years = "2019"; const char* years = "2019";
const char *copyright = "Copyright Darik Horn <dajhorn-dban@vanadac.com>\n\ const char* copyright = "Copyright Darik Horn <dajhorn-dban@vanadac.com>\n\
Modifications to original dwipe Copyright Andy Beverley <andy@andybev.com>\n\ Modifications to original dwipe Copyright Andy Beverley <andy@andybev.com>\n\
This is free software; see the source for copying conditions.\n\ This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\
FOR A PARTICULAR PURPOSE.\n"; FOR A PARTICULAR PURPOSE.\n";
const char *banner = "nwipe 0.27rc1"; const char* banner = "nwipe 0.27rc1";

View File

@@ -1,11 +1,11 @@
#ifndef __VERSION_H #ifndef __VERSION_H
#define __VERSION_H #define __VERSION_H
extern char *version_string; extern char* version_string;
extern char *program_name; extern char* program_name;
extern char *author_name; extern char* author_name;
extern char *email_address; extern char* email_address;
extern char *copyright; extern char* copyright;
extern char *banner; extern char* banner;
#endif/*__VERSION_H*/ #endif /*__VERSION_H*/