X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fasdcp-test.cpp;h=df108c3974ce221cec0fe107ad7ee9102749d251;hb=1c26f274039b5ccb93ba138482e5328de0c7df2e;hp=1dfc33f781434bdd49096b23c8fcc0386753349b;hpb=6e23666cb6184999efc74577cfb1b524181ba5df;p=asdcplib.git diff --git a/src/asdcp-test.cpp b/src/asdcp-test.cpp index 1dfc33f..df108c3 100755 --- a/src/asdcp-test.cpp +++ b/src/asdcp-test.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2005, John Hurst +Copyright (c) 2003-2014, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,26 +47,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. these features. */ -#include -#include - -#include +#include +#include #include #include -#include -#include #include #include +#include + +#include +#include using namespace ASDCP; -const ui32_t FRAME_BUFFER_SIZE = 4*1024*1024; +const ui32_t FRAME_BUFFER_SIZE = 4 * Kumu::Megabyte; //------------------------------------------------------------------------------------------ // // command line option parser class -static const char* PACKAGE = "asdcp-test"; // program name for messages +static const char* PROGRAM_NAME = "asdcp-test"; // program name for messages const ui32_t MAX_IN_FILES = 16; // maximum number of input files handled by // the command option parser @@ -83,107 +83,169 @@ public: memcpy(ProductUUID, default_ProductUUID_Data, UUIDlen); CompanyName = "WidgetCo"; ProductName = "asdcp-test"; - - char s_buf[128]; - snprintf(s_buf, 128, "%lu.%lu.%lu", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR); - ProductVersion = s_buf; + ProductVersion = ASDCP::Version(); } } s_MyInfo; -// Macros used to test command option data state. - -// True if a major mode has already been selected. -#define TEST_MAJOR_MODE() ( info_flag||create_flag||extract_flag||genkey_flag||genid_flag||gop_start_flag ) - -// Causes the caller to return if a major mode has already been selected, -// otherwise sets the given flag. -#define TEST_SET_MAJOR_MODE(f) if ( TEST_MAJOR_MODE() ) \ - { \ - fputs("Conflicting major mode, choose one of -(gcixG)).\n", stderr); \ - return; \ - } \ - (f) = true; // Increment the iterator, test for an additional non-option command line argument. // Causes the caller to return if there are no remaining arguments or if the next // argument begins with '-'. #define TEST_EXTRA_ARG(i,c) if ( ++i >= argc || argv[(i)][0] == '-' ) \ { \ - fprintf(stderr, "Argument not found for option %c.\n", (c)); \ + fprintf(stderr, "Argument not found for option -%c.\n", (c)); \ return; \ } // void -banner(FILE* stream = stderr) +banner(FILE* stream = stdout) { fprintf(stream, "\n\ %s (asdcplib %s)\n\n\ -Copyright (c) 2003-2005 John Hurst\n\n\ +Copyright (c) 2003-2015 John Hurst\n\n\ asdcplib may be copied only under the terms of the license found at\n\ the top of every file in the asdcplib distribution kit.\n\n\ Specify the -h (help) option for further information about %s\n\n", - PACKAGE, ASDCP::Version(), PACKAGE); + PROGRAM_NAME, ASDCP::Version(), PROGRAM_NAME); } // void -usage(FILE* stream = stderr) +usage(FILE* stream = stdout) { fprintf(stream, "\ -USAGE: %s [-i [-H, -n]|-c [-p , -e, -M, -R]|-x [-m][-S]|-g|-u|-G|-V|-h]\n\ - [-k ] [-j ] [-f ] [-d ]\n\ - [-b ] [-W] [-v [-s]] [, ...]\n\ -\n", PACKAGE); +USAGE: %s -c [-3] [-a ] [-b ]\n\ + [-d ] [-e|-E] [-f ] [-j ]\n\ + [-k ] [-l