Skip to content

Commit

Permalink
feat: 0.1.13 log API level (#14)
Browse files Browse the repository at this point in the history
* feat: log API Level

* chore: bump stego.lock
  • Loading branch information
jgabaut authored Sep 1, 2023
1 parent 63273c1 commit 0a7d2ac
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ tests# tests folder name
0.1.10# add ncurses debug functions
0.1.11# add kls_formatSize()
0.1.12# add int API lvl, vargs log
0.1.13# log API level
4 changes: 4 additions & 0 deletions bin/v0.1.13/.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.13/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.12], [[email protected]])
AC_INIT([koliseo], [0.1.13], [[email protected]])

# 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.12"
VERSION="0.1.13"
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.12"
PROJECT_NUMBER = "0.1.13"

# 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
16 changes: 9 additions & 7 deletions src/koliseo.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Koliseo* kls_new(ptrdiff_t size) {
//kls_log("KLS",msg);
char h_size[200];
kls_formatSize(size,h_size,sizeof(h_size));
kls_log("KLS","Allocated (%s) for new KLS.",h_size);
kls_log("KLS","API Level { %i } -> Allocated (%s) for new KLS.",int_koliseo_version(),h_size);
Koliseo* kls = p;
kls->data = p;
kls->size = size;
Expand Down Expand Up @@ -120,7 +120,7 @@ void* kls_pop(Koliseo* kls, ptrdiff_t size, ptrdiff_t align, ptrdiff_t count) {
char* p = kls->data + kls->offset - padding - size*count;
kls->prev_offset = kls->offset;
kls->offset -= padding + size*count;
kls_log("KLS","Popped (%li) for KLS.",size);
kls_log("KLS","API Level { %i } -> Popped (%li) for KLS.", int_koliseo_version(), size);
if (KOLISEO_DEBUG == 1) {
print_kls_2file(KOLISEO_DEBUG_FP,kls);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ void* kls_push(Koliseo* kls, ptrdiff_t size, ptrdiff_t align, ptrdiff_t count) {
kls_formatSize(size,h_size,sizeof(h_size));
//sprintf(msg,"Pushed size (%li) for KLS.",size);
//kls_log("KLS",msg);
kls_log("KLS","Pushed size (%s) for KLS.",h_size);
kls_log("KLS","API Level { %i } -> Pushed size (%s) for KLS.", int_koliseo_version(), h_size);
if (KOLISEO_DEBUG == 1) {
print_kls_2file(KOLISEO_DEBUG_FP,kls);
}
Expand Down Expand Up @@ -204,7 +204,7 @@ void* kls_push_zero(Koliseo* kls, ptrdiff_t size, ptrdiff_t align, ptrdiff_t cou
kls_formatSize(size,h_size,sizeof(h_size));
//sprintf(msg,"Pushed zeroes, size (%li) for KLS.",size);
//kls_log("KLS",msg);
kls_log("KLS","Pushed zeroes, size (%s) for KLS.",h_size);
kls_log("KLS","API Level { %i } -> Pushed zeroes, size (%s) for KLS.",h_size);
if (KOLISEO_DEBUG == 1) {
print_kls_2file(KOLISEO_DEBUG_FP,kls);
}
Expand Down Expand Up @@ -252,7 +252,7 @@ void* kls_push_zero_named(Koliseo* kls, ptrdiff_t size, ptrdiff_t align, ptrdiff
kls_formatSize(size,h_size,sizeof(h_size));
//sprintf(msg,"Pushed zeroes, size (%li) for KLS.",size);
//kls_log("KLS",msg);
kls_log("KLS","Pushed zeroes, size (%s) for KLS.",h_size);
kls_log("KLS","API Level { %i } -> Pushed zeroes, size (%s) for KLS.", int_koliseo_version(), h_size);
if (KOLISEO_DEBUG == 1) {
print_kls_2file(KOLISEO_DEBUG_FP,kls);
}
Expand All @@ -271,6 +271,7 @@ void print_kls_2file(FILE* fp, Koliseo* kls) {
if (kls == NULL) {
fprintf(fp,"[KLS] kls was NULL.");
} else {
fprintf(fp,"\n[KLS] API Level: { %i }\n", int_koliseo_version());
fprintf(fp,"\n[KLS] Size: { %li }\n", kls->size);
char human_size[200];
char curr_size[200];
Expand Down Expand Up @@ -334,6 +335,7 @@ void kls_show_toWin(Koliseo* kls, WINDOW* win) {
int y = 2;
int x = 2;
mvwprintw(win, y++, x, "Koliseo data:");
mvwprintw(win, y++, x, "API Level: { %i }", int_koliseo_version());
mvwprintw(win, y++, x, "Size: { %li }", kls->size);
char h_size[200];
kls_formatSize(kls->size,h_size,sizeof(h_size));
Expand Down Expand Up @@ -452,7 +454,7 @@ void kls_clear(Koliseo* kls) {
//Reset pointer
kls->prev_offset = kls->offset;
kls->offset = sizeof(*kls);
kls_log("KLS","Cleared offsets for KLS.");
kls_log("KLS","API Level { %i } -> Cleared offsets for KLS.", int_koliseo_version());
}

/**
Expand All @@ -464,7 +466,7 @@ void kls_free(Koliseo* kls) {
kls_clear(kls);
kls_freeList(kls->regs);
free(kls);
kls_log("KLS","Freed KLS.");
kls_log("KLS","API Level { %i } -> Freed KLS.", int_koliseo_version());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/koliseo.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

/**
* Global variable for debug flag.
Expand All @@ -28,7 +28,7 @@ extern int KOLISEO_AUTOSET_REGIONS;
extern FILE* KOLISEO_DEBUG_FP;

static const int KOLISEO_API_VERSION_INT = (KLS_MAJOR*3+KLS_MINOR*2+KLS_PATCH); /**< Represents current version with numeric format.*/
static const char KOLISEO_API_VERSION_STRING[] = "0.1.12"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/
static const char KOLISEO_API_VERSION_STRING[] = "0.1.13"; /**< Represents current version with MAJOR.MINOR.PATCH format.*/

const char* string_koliseo_version(void);

Expand Down

0 comments on commit 0a7d2ac

Please sign in to comment.