From 2d92a7dd875e3c35df2def9f1102ab485bbd1cd8 Mon Sep 17 00:00:00 2001 From: jgabaut <109908086+jgabaut@users.noreply.github.com> Date: Mon, 21 Aug 2023 18:27:48 +0200 Subject: [PATCH 1/3] feat: bump amboso to 1.6.1 --- amboso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amboso b/amboso index 737fd68..fe16210 160000 --- a/amboso +++ b/amboso @@ -1 +1 @@ -Subproject commit 737fd68ff68a4da04e13924f51db6389571ed091 +Subproject commit fe16210bd53440ee2e1ccf36a4fb2f8e6d330341 From 965fe4a11a91dba8ccfc4aa18e2ae6b11103d25d Mon Sep 17 00:00:00 2001 From: jgabaut <109908086+jgabaut@users.noreply.github.com> Date: Tue, 22 Aug 2023 03:56:41 +0200 Subject: [PATCH 2/3] feat: 0.1.6 Fix Koliseo_Temp --- bin/stego.lock | 1 + bin/v0.1.6/.gitignore | 4 ++++ bin/v0.1.6/static | 1 + configure.ac | 4 ++-- src/koliseo.c | 12 +++++++++--- src/koliseo.h | 6 +++++- static/demo.c | 17 ++++++++++++++++- 7 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 bin/v0.1.6/.gitignore create mode 120000 bin/v0.1.6/static diff --git a/bin/stego.lock b/bin/stego.lock index 3078593..bcb8e30 100644 --- a/bin/stego.lock +++ b/bin/stego.lock @@ -10,3 +10,4 @@ tests# tests folder name 0.1.2# print_kls_2file() 0.1.3# update prev_offset on kls_push() 0.1.5# add kls_log(), fixes +0.1.6# functional Koliseo_Temp diff --git a/bin/v0.1.6/.gitignore b/bin/v0.1.6/.gitignore new file mode 100644 index 0000000..f915d8e --- /dev/null +++ b/bin/v0.1.6/.gitignore @@ -0,0 +1,4 @@ +#amboso compliant version folder, will ignore everything inside BUT the gitignore, to keep the clean dir +* +!.gitignore +!static diff --git a/bin/v0.1.6/static b/bin/v0.1.6/static new file mode 120000 index 0000000..382349a --- /dev/null +++ b/bin/v0.1.6/static @@ -0,0 +1 @@ +../../static/ \ No newline at end of file diff --git a/configure.ac b/configure.ac index ce4296b..580875b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Define the package name and version -AC_INIT([koliseo], [0.1.5], [jgabaut@github.com]) +AC_INIT([koliseo], [0.1.6], [jgabaut@github.com]) # Verify automake version and enable foreign option AM_INIT_AUTOMAKE([foreign -Wall]) @@ -24,7 +24,7 @@ fi # Set a default version number if not specified externally AC_ARG_VAR([VERSION], [Version number]) if test -z "$VERSION"; then - VERSION="0.1.5" + VERSION="0.1.6" fi # Output variables to the config.h header diff --git a/src/koliseo.c b/src/koliseo.c index 08e6bcf..c330489 100644 --- a/src/koliseo.c +++ b/src/koliseo.c @@ -29,7 +29,13 @@ void kls_log(const char* tag, const char* msg) { if (KOLISEO_DEBUG_FP == NULL) { fprintf(stderr,"[KLS] kls_log(): Failed opening KOLISEO_DEBUG_FP to print logs.\n"); } else { - fprintf(KOLISEO_DEBUG_FP,"[%s] %s\n", tag, msg); + time_t now = time(0); + struct tm *mytime = localtime(&now); + char timeheader[500]; + if ( strftime(timeheader, sizeof timeheader, "%X", mytime) ) + { + fprintf(KOLISEO_DEBUG_FP,"[%-10.10s] [%s] [%s]\n", tag, timeheader, msg); + } } } } @@ -238,8 +244,8 @@ Koliseo_Temp kls_temp_start(Koliseo* kls) { * @param kls The Koliseo at hand. */ void kls_temp_end(Koliseo_Temp tmp_kls) { - tmp_kls.prev_offset = tmp_kls.prev_offset; - tmp_kls.offset = tmp_kls.offset; + tmp_kls.kls->prev_offset = tmp_kls.prev_offset; + tmp_kls.kls->offset = tmp_kls.offset; char msg[500]; sprintf(msg,"Ended Temp KLS."); kls_log("KLS",msg); diff --git a/src/koliseo.h b/src/koliseo.h index 95b32a2..c8839e1 100644 --- a/src/koliseo.h +++ b/src/koliseo.h @@ -6,6 +6,7 @@ #include #include #include +#include #define KLS_MAJOR 0 /**< Represents current major release.*/ #define KLS_MINOR 1 /**< Represents current minor release.*/ @@ -21,7 +22,7 @@ extern int KOLISEO_DEBUG; */ extern FILE* KOLISEO_DEBUG_FP; -static const char KOLISEO_API_VERSION_STRING[] = "0.1.5"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/ +static const char KOLISEO_API_VERSION_STRING[] = "0.1.6"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/ const char* string_koliseo_version(void); @@ -83,4 +84,7 @@ void print_dbg_kls(Koliseo* kls); Koliseo_Temp kls_temp_start(Koliseo* kls); void kls_temp_end(Koliseo_Temp tmp_kls); +#define KLS_PUSH_T(kls_temp, type, count) (type*)KLS_PUSH(kls_temp.kls, type, count) +#define KLS_POP_T(kls_temp, type, count) (type*)KLS_POP(kls_temp.kls, type, count) + #endif diff --git a/static/demo.c b/static/demo.c index 904a85a..1246c4f 100644 --- a/static/demo.c +++ b/static/demo.c @@ -34,17 +34,27 @@ int main(void) { print_dbg_kls(kls); + Koliseo_Temp temp_kls = kls_temp_start(kls); + printf("[Started Koliseo_Temp] [pos: %li]\n",kls_get_pos(temp_kls.kls)); + int minusone = -1; int* p = &minusone; + int* p2 = &minusone; printf("\n*p is [%i] before KLS_PUSH\n",*p); + printf("\n*p2 is [%i] before KLS_PUSH_T\n",*p2); printf("[KLS_PUSH for a int to Koliseo] [size: %li]\n",sizeof(int)); + printf("[This handles the Koliseo directly while we have an open Koliseo_Temp.]\n"); p = (int*) KLS_PUSH(kls, int, 1); + printf("[KLS_PUSH_T for a int to Koliseo_Temp] [size: %li]\n",sizeof(int)); + p2 = (int*) KLS_PUSH_T(temp_kls, int, 1); printf("[Current position in Koliseo] [pos: %li]\n",kls_get_pos(kls)); + printf("[Current position in Koliseo_Temp] [pos: %li]\n",temp_kls.offset); print_dbg_kls(kls); - *p = 1; printf("\n*p is [%i] after KLS_PUSH\n",*p); + *p2 = 3; + printf("\n*p2 is [%i] after KLS_PUSH\n",*p2); int* z = &minusone; printf("\n*z is [%i] before KLS_POP\n",*z); @@ -58,6 +68,11 @@ int main(void) { print_dbg_kls(kls); + kls_temp_end(temp_kls); + printf("[Ended Koliseo_Temp]\n"); + + print_dbg_kls(kls); + printf("[Clear Koliseo]\n"); kls_clear(kls); print_dbg_kls(kls); From 709262f426619808d66f9f3d042276504aefff1c Mon Sep 17 00:00:00 2001 From: jgabaut <109908086+jgabaut@users.noreply.github.com> Date: Tue, 22 Aug 2023 03:58:43 +0200 Subject: [PATCH 3/3] fix: run make on pull requests --- .github/workflows/makefile.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 9fafff8..0d13b20 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -3,6 +3,8 @@ name: Build CI with make on: push: branches: [ "master" ] + pull_request: + branches: [ "master" , "devel"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: