Skip to content

Commit

Permalink
feat: 0.1.2 print_kls_2file() (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgabaut committed Aug 19, 2023
1 parent 5ae0952 commit 0af56e2
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tests# tests folder name
[Supported versions]
0.1.0# First release
0.1.1# abort() on failed operations
0.1.2# print_kls_2file()
4 changes: 4 additions & 0 deletions bin/v0.1.2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#amboso compliant version folder, will ignore everything inside BUT the gitignore, to keep the clean dir
*
!.gitignore
!static
1 change: 1 addition & 0 deletions bin/v0.1.2/static
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the package name and version
AC_INIT([koliseo], [0.1.1], [jgabaut@github.com])
AC_INIT([koliseo], [0.1.2], [jgabaut@github.com])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand All @@ -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.1"
VERSION="0.1.2"
fi

# Output variables to the config.h header
Expand Down
2 changes: 1 addition & 1 deletion docs/koliseo.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "koliseo"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "0.1.1"
PROJECT_NUMBER = "0.1.2"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
24 changes: 18 additions & 6 deletions src/koliseo.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,31 @@ void* kls_push_zero(Koliseo* kls, ptrdiff_t size, ptrdiff_t align, ptrdiff_t cou
}

/**
* Prints header fields from the passed Koliseo pointer.
* Prints header fields from the passed Koliseo pointer, to the passed FILE pointer.
* @param kls The Koliseo at hand.
*/
void print_dbg_kls(Koliseo* kls) {
void print_kls_2file(FILE* fp, Koliseo* kls) {
if (fp == NULL) {
fprintf(stderr,"print_kls_2file(): fp was NULL.\n");
exit(EXIT_FAILURE);
}
if (kls == NULL) {
fprintf(stderr,"[KLS] kls was NULL.");
fprintf(fp,"[KLS] kls was NULL.");
} else {
printf("\n[KLS] Size: [%li]\n", kls->size);
printf("[KLS] Offset: [%li]\n", kls->offset);
printf("[KLS] Prev_Offset: [%li]\n\n", kls->prev_offset);
fprintf(fp,"\n[KLS] Size: [%li]\n", kls->size);
fprintf(fp,"[KLS] Offset: [%li]\n", kls->offset);
fprintf(fp,"[KLS] Prev_Offset: [%li]\n\n", kls->prev_offset);
}
}

/**
* Prints header fields from the passed Koliseo pointer, to stderr.
* @param kls The Koliseo at hand.
*/
void print_dbg_kls(Koliseo* kls) {
print_kls_2file(stderr,kls);
}

/**
* Resets the offset field for the passed Koliseo pointer.
* Notably, it sets the prev_offset field to the previous offset, thus remembering where last allocation was before the clear.
Expand Down
5 changes: 3 additions & 2 deletions src/koliseo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#define KLS_MAJOR 0 /**< Represents current major release.*/
#define KLS_MINOR 1 /**< Represents current minor release.*/
#define KLS_PATCH 1 /**< Represents current patch release.*/
#define KLS_PATCH 2 /**< Represents current patch release.*/

static const char KOLISEO_API_VERSION_STRING[] = "0.1.1"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/
static const char KOLISEO_API_VERSION_STRING[] = "0.1.2"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/

const char* string_koliseo_version(void);

Expand Down Expand Up @@ -65,6 +65,7 @@ void* kls_pop(Koliseo* kls, ptrdiff_t size, ptrdiff_t align, ptrdiff_t count);

void kls_clear(Koliseo* kls);
void kls_free(Koliseo* kls);
void print_kls_2file(FILE* fp, Koliseo* kls);
void print_dbg_kls(Koliseo* kls);

Koliseo_Temp kls_temp_start(Koliseo* kls);
Expand Down

0 comments on commit 0af56e2

Please sign in to comment.