| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-01-29 19:54:26 +0100 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-01-29 19:54:26 +0100 | 
| commit | 1373211465c34015ee900e097aa87fbffb401187 (patch) | |
| tree | 8ffa1f9296097c91627c05874fcf4559cac45de7 /src/cli | |
| parent | df3657b2a99ef20da99ac3c6c02f43cc23e70fca (diff) | |
Trying out ACSL, continuing implementation.
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/cli/parameters.c | 84 | ||||
| -rw-r--r-- | src/cli/parameters.h | 18 | ||||
| -rw-r--r-- | src/cli/parameters_types.h | 18 | 
4 files changed, 0 insertions, 126 deletions
| diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt deleted file mode 100644 index 94e6337..0000000 --- a/src/cli/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set( -   SRC_FILES ${SRC_FILES} -   ${CMAKE_CURRENT_SOURCE_DIR}/parameters.c -) -set(SRC_FILES ${SRC_FILES} PARENT_SCOPE) - diff --git a/src/cli/parameters.c b/src/cli/parameters.c deleted file mode 100644 index 82ac9d1..0000000 --- a/src/cli/parameters.c +++ /dev/null @@ -1,84 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> - -#include "../core/index.h" - -#include "parameters.h" - -static int parse_markov_order -( -   struct ZoO_parameters param [const restrict static 1], -   const char argv [const restrict] -) -{ -	long long int input; -	const int old_errno = errno; - -	errno = 0; - -   input = strtoll(argv, (char **) NULL, 10); - -   if -   ( -      (errno != 0) -		|| (input > (long long int) ZoO_INDEX_MAX) -		|| (input < 1) -   ) -   { -		fprintf -      ( -			stderr, -         "[F] Invalid or value for parameter 'MARKOV_ORDER', accepted" -			"range is " -         "[1, %lli] (integer).", -         (long long int) ZoO_INDEX_MAX -      ); - -      errno = old_errno; - -      return -1; -   } - -	param->markov_order = (ZoO_index) input; - -   errno = old_errno; - -   return 0; -} - -enum ZoO_invocation_objective ZoO_parameters_initialize -( -   struct ZoO_parameters param [const restrict static 1], -   int const argc, -   const char * argv [const static argc] -) -{ -   param->session = (const char *) NULL; -   param->markov_order = 1; -   param->storage = (const char *) NULL; - -   switch (argc) -   { -      case 4: -         param->session = argv[1]; -         param->storage = argv[3]; - -         if (parse_markov_order(param, argv[2]) < 0) -         { -            return ZoO_PRINTS_HELP; -         } -         else -         { -            return ZoO_RUNS; -         } - -      case 3: -         param->session = argv[1]; - -			return ZoO_CLEANS_UP; - -      default: -         return ZoO_PRINTS_HELP; -   } -} diff --git a/src/cli/parameters.h b/src/cli/parameters.h deleted file mode 100644 index 7927ef7..0000000 --- a/src/cli/parameters.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ZoO_CLI_PARAMETERS_H_ -#define _ZoO_CLI_PARAMETERS_H_ - -#include "parameters_types.h" - -char * ZoO_parameters_get_session_name -( -   const struct ZoO_parameters param [const restrict static 1] -); - -enum ZoO_invocation_objective ZoO_parameters_initialize -( -   struct ZoO_parameters param [const restrict static 1], -   int const argc, -   const char * argv [const static argc] -); - -#endif diff --git a/src/cli/parameters_types.h b/src/cli/parameters_types.h deleted file mode 100644 index f9ca88b..0000000 --- a/src/cli/parameters_types.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ZoO_CLI_PARAMETERS_TYPES_H_ -#define _ZoO_CLI_PARAMETERS_TYPES_H_ - -enum ZoO_invocation_objective -{ -   ZoO_PRINTS_HELP, -   ZoO_CLEANS_UP, -   ZoO_RUNS -}; - -struct ZoO_parameters -{ -   const char * restrict session; -   ZoO_index markov_order; -   const char * restrict storage; -}; - -#endif | 


