From 1eabaf567e9d0f7ed74e001fe9072bcd6626cca3 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Tue, 7 Jul 2020 09:35:15 -0400 Subject: [PATCH] Fix #6, Replace hardcoded string with version file --- elf2cfetbl.c | 3 ++- elf2cfetbl_version.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 elf2cfetbl_version.h diff --git a/elf2cfetbl.c b/elf2cfetbl.c index 46113a1..5c701b6 100644 --- a/elf2cfetbl.c +++ b/elf2cfetbl.c @@ -40,6 +40,7 @@ #include #include "ELF_Structures.h" #include "cfe_tbl_filedef.h" +#include "elf2cfetbl_version.h" #define MAX_SECTION_HDR_NAME_LEN (128) #define TBL_DEF_SYMBOL_NAME "CFE_TBL_FileDef" @@ -1275,7 +1276,7 @@ int32 ProcessCmdLineOptions(int ArgumentCount, char *Arguments[]) void OutputVersionInfo(void) { printf("\nElf Object File to cFE Table Image File Conversion Tool\n"); - printf(" Version v3.1.5\n"); + printf("Version v%d.%d.%d.%d ", ELF2CFETBL_MAJOR_VERSION, ELF2CFETBL_MINOR_VERSION, ELF2CFETBL_REVISION, ELF2CFETBL_MISSION_REV); printf(" Built - %s %s\n\n", __DATE__, __TIME__); } diff --git a/elf2cfetbl_version.h b/elf2cfetbl_version.h new file mode 100644 index 0000000..8ce512c --- /dev/null +++ b/elf2cfetbl_version.h @@ -0,0 +1,40 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* + * File: elf2cfetbl_version.h + * + * Purpose: + * Provide version identifiers for the ELF to cFE Table Converter. + * See cfe documentation for version and build number and description + */ + +#ifndef ELF2CFETBL_VERSION_H +#define ELF2CFETBL_VERSION_H + +/* + * Macro Definitions + */ +#define ELF2CFETBL_MAJOR_VERSION 3 +#define ELF2CFETBL_MINOR_VERSION 1 +#define ELF2CFETBL_REVISION 5 +#define ELF2CFETBL_MISSION_REV 0 + +#endif /* ELF2CFETBL_VERSION_H */