From 8ecc25b6daeeaa8faafba65f94fcfff418465fd3 Mon Sep 17 00:00:00 2001 From: Matthew Owens Date: Tue, 21 Dec 2021 20:44:14 +0000 Subject: [PATCH] replaced template strings with priority-queue --- .gitignore | 1 + CMakeLists.txt | 12 +++++----- README.md | 2 +- init_module.sh | 36 ---------------------------- src/priority_queue.c | 1 + src/{template.h => priority_queue.h} | 0 src/template.c | 1 - 7 files changed, 9 insertions(+), 44 deletions(-) create mode 100644 .gitignore delete mode 100755 init_module.sh create mode 100644 src/priority_queue.c rename src/{template.h => priority_queue.h} (100%) delete mode 100644 src/template.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/CMakeLists.txt b/CMakeLists.txt index f7e5667..a91b8eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,17 @@ cmake_minimum_required(VERSION 3.15) -project(template) +project(priority_queue) set(CMAKE_C_STANDARD 11) file(GLOB_RECURSE SRC src/*.c - template-test/*.c + priority_queue-test/*.c ) -add_executable(template-test ${SRC}) -target_include_directories(template-test +add_executable(priority_queue-test ${SRC}) +target_include_directories(priority_queue-test PUBLIC src - PUBLIC template-test + PUBLIC priority_queue-test ) -target_link_libraries(template-test PRIVATE check) +target_link_libraries(priority_queue-test PRIVATE check) diff --git a/README.md b/README.md index c95f8c6..70a3d25 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# module-template +# priority-queue diff --git a/init_module.sh b/init_module.sh deleted file mode 100755 index 3f82dfa..0000000 --- a/init_module.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -function error() -{ - echo "provide a name" - exit 1 -} - -function init() -{ - echo "renaming template file & lines to $1" - upper=$(echo $1 | tr '[:lower:]' '[:upper:]') - under=$(echo $1 | tr '-' '_') - dashes=$(echo $1 | tr '_' '-') - - mv src/template.h src/$under.h - mv src/template.c src/$under.c - find . -type f -name '*.[c|h]' -exec sed -i "s/template/$under/g" {} + - sed -i "s/template/$under/g" CMakeLists.txt - echo "build" > .gitignore - - # clearing README - echo "# $dashes" > README.md -} - -# do we have a name parameter? -[ $# -eq 1 ] && init $1 || error -rm -- "$0" - -# clearing up source control -git rm src/template.c src/template.h $0 -git add src/ README.md .gitignore CMakeLists.txt - -git commit -m "replaced template strings with $1" -git push - diff --git a/src/priority_queue.c b/src/priority_queue.c new file mode 100644 index 0000000..c782d23 --- /dev/null +++ b/src/priority_queue.c @@ -0,0 +1 @@ +#include "priority_queue.h" diff --git a/src/template.h b/src/priority_queue.h similarity index 100% rename from src/template.h rename to src/priority_queue.h diff --git a/src/template.c b/src/template.c deleted file mode 100644 index a0c3cf6..0000000 --- a/src/template.c +++ /dev/null @@ -1 +0,0 @@ -#include "template.h" -- 2.20.1