Commit c9ec96fbf345c5ca259c325bad39eebb4bb7b886

Thomas de Grivel 2024-08-19T12:28:10

rename files in misc

diff --git a/.gitignore b/.gitignore
index bc06626..e25d591 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,10 +51,10 @@ lib/kc3/0.1/socket.so
 .libs/
 *.lo
 macos/kc3-v*
-/misc/fact_w_offsets
-/misc/http_request_offsets
-/misc/http_response_offsets
-/misc/print_limits
+/misc/fact_w
+/misc/http_request
+/misc/http_response
+/misc/limits
 *.o
 release/
 .test
diff --git a/misc/Makefile b/misc/Makefile
index f252584..479f83c 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -10,11 +10,11 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-CLEANFILES = http_request_offsets http_response_offsets print_limits
+CLEANFILES = http_request http_response limits
 
 CPPFLAGS += -I/usr/local/include -I.. -W -Wall -Werror
 
-all: fact_w_offsets http_request_offsets http_response_offsets print_limits
+all: fact_w http_request http_response limits
 
 build: all
 
@@ -23,17 +23,17 @@ clean:
 
 distclean: clean
 
-fact_w_offsets: fact_w_offsets.c
-	${CC} ${CPPFLAGS} -I.. fact_w_offsets.c -o fact_w_offsets
+fact_w: fact_w.c
+	${CC} ${CPPFLAGS} -I.. fact_w.c -o fact_w
 
-http_request_offsets: http_request_offsets.c
-	${CC} ${CPPFLAGS} -I.. http_request_offsets.c -o http_request_offsets
+http_request: http_request.c
+	${CC} ${CPPFLAGS} -I.. http_request.c -o http_request
 
-http_response_offsets: http_response_offsets.c
-	${CC} ${CPPFLAGS} -I.. http_response_offsets.c -o http_response_offsets
+http_response: http_response.c
+	${CC} ${CPPFLAGS} -I.. http_response.c -o http_response
 
-print_limits: print_limits.c
-	libtool --mode=link --tag=CC ${CC} ${CPPFLAGS} -I.. print_limits.c -L../libkc3 -lkc3 -o print_limits
+limits: limits.c
+	libtool --mode=link --tag=CC ${CC} ${CPPFLAGS} -I.. limits.c -L../libkc3 -lkc3 -o limits
 
 .PHONY: \
 	all \
diff --git a/misc/fact_w.c b/misc/fact_w.c
new file mode 100644
index 0000000..d117dcd
--- /dev/null
+++ b/misc/fact_w.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stddef.h>
+#include <assert.h>
+#include "../http/types.h"
+
+void print_offsets() {
+    printf("Offset of subject: %zu\n", offsetof(struct fact_w, subject));
+    printf("Offset of predicate: %zu\n", offsetof(struct fact_w, predicate));
+    printf("Offset of object: %zu\n", offsetof(struct fact_w, object));
+    printf("Offset of id: %zu\n", offsetof(struct fact_w, id));
+}
+
+int main (void) {
+  print_offsets();
+  return 0;
+}
diff --git a/misc/fact_w_offsets.c b/misc/fact_w_offsets.c
deleted file mode 100644
index d117dcd..0000000
--- a/misc/fact_w_offsets.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-#include <stddef.h>
-#include <assert.h>
-#include "../http/types.h"
-
-void print_offsets() {
-    printf("Offset of subject: %zu\n", offsetof(struct fact_w, subject));
-    printf("Offset of predicate: %zu\n", offsetof(struct fact_w, predicate));
-    printf("Offset of object: %zu\n", offsetof(struct fact_w, object));
-    printf("Offset of id: %zu\n", offsetof(struct fact_w, id));
-}
-
-int main (void) {
-  print_offsets();
-  return 0;
-}
diff --git a/misc/http_request.c b/misc/http_request.c
new file mode 100644
index 0000000..8ca3e64
--- /dev/null
+++ b/misc/http_request.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stddef.h>
+#include <assert.h>
+#include "../http/types.h"
+
+void print_offsets() {
+    printf("Offset of method: %zu\n", offsetof(struct http_request, method));
+    printf("Offset of url: %zu\n", offsetof(struct http_request, url));
+    printf("Offset of protocol: %zu\n", offsetof(struct http_request, protocol));
+    printf("Offset of headers: %zu\n", offsetof(struct http_request, headers));
+}
+
+int main (void) {
+  print_offsets();
+  return 0;
+}
diff --git a/misc/http_request_offsets.c b/misc/http_request_offsets.c
deleted file mode 100644
index 8ca3e64..0000000
--- a/misc/http_request_offsets.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-#include <stddef.h>
-#include <assert.h>
-#include "../http/types.h"
-
-void print_offsets() {
-    printf("Offset of method: %zu\n", offsetof(struct http_request, method));
-    printf("Offset of url: %zu\n", offsetof(struct http_request, url));
-    printf("Offset of protocol: %zu\n", offsetof(struct http_request, protocol));
-    printf("Offset of headers: %zu\n", offsetof(struct http_request, headers));
-}
-
-int main (void) {
-  print_offsets();
-  return 0;
-}
diff --git a/misc/http_response.c b/misc/http_response.c
new file mode 100644
index 0000000..3cecc4f
--- /dev/null
+++ b/misc/http_response.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <stddef.h>
+#include <assert.h>
+#include "../http/types.h"
+
+// Function to calculate and print offsets
+void print_offsets() {
+    printf("Offset of protocol: %zu\n", offsetof(struct http_response, protocol));
+    printf("Offset of code: %zu\n", offsetof(struct http_response, code));
+    printf("Offset of message: %zu\n", offsetof(struct http_response, message));
+    printf("Offset of headers: %zu\n", offsetof(struct http_response, headers));
+    printf("Offset of body: %zu\n", offsetof(struct http_response, body));
+}
+
+// Main function
+int main() {
+    // Print offsets
+    print_offsets();
+
+    return 0;
+}
\ No newline at end of file
diff --git a/misc/http_response_offsets.c b/misc/http_response_offsets.c
deleted file mode 100644
index 3cecc4f..0000000
--- a/misc/http_response_offsets.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-#include <stddef.h>
-#include <assert.h>
-#include "../http/types.h"
-
-// Function to calculate and print offsets
-void print_offsets() {
-    printf("Offset of protocol: %zu\n", offsetof(struct http_response, protocol));
-    printf("Offset of code: %zu\n", offsetof(struct http_response, code));
-    printf("Offset of message: %zu\n", offsetof(struct http_response, message));
-    printf("Offset of headers: %zu\n", offsetof(struct http_response, headers));
-    printf("Offset of body: %zu\n", offsetof(struct http_response, body));
-}
-
-// Main function
-int main() {
-    // Print offsets
-    print_offsets();
-
-    return 0;
-}
\ No newline at end of file
diff --git a/misc/limits.c b/misc/limits.c
new file mode 100644
index 0000000..4e4bf53
--- /dev/null
+++ b/misc/limits.c
@@ -0,0 +1,44 @@
+#include <libkc3/kc3.h>
+
+void display_min_max() {
+  s8 s8_min = S8_MIN;
+  s8 s8_max = S8_MAX;
+  s16 s16_min = S16_MIN;
+  s16 s16_max = S16_MAX;
+  s32 s32_min = S32_MIN;
+  s32 s32_max = S32_MAX;
+  s64 s64_min = S64_MIN;
+  s64 s64_max = S64_MAX;
+  sw sw_min = SW_MIN;
+  sw sw_max = SW_MAX;
+    // Display minimum and maximum values for integer types
+  io_puts("Minimum and Maximum values for integer types:");
+  io_write_1("S8_MIN:  ");
+  io_inspect_s8_hexadecimal(&s8_min);
+  io_write_1("\nS8_MAX:   ");
+  io_inspect_s8_hexadecimal(&s8_max);
+  io_write_1("\nS16_MIN: ");
+  io_inspect_s16_hexadecimal(&s16_min);
+  io_write_1("\nS16_MAX:  ");
+  io_inspect_s16_hexadecimal(&s16_max);
+  io_write_1("\nS32_MIN: ");
+  io_inspect_s32_hexadecimal(&s32_min);
+  io_write_1("\nS32_MAX:  ");
+  io_inspect_s32_hexadecimal(&s32_max);
+  io_write_1("\nS64_MIN: ");
+  io_inspect_s64_hexadecimal(&s64_min);
+  io_write_1("\nS64_MAX:  ");
+  io_inspect_s64_hexadecimal(&s64_max);
+  io_write_1("\nSW_MIN:  ");
+  io_inspect_sw_hexadecimal(&sw_min);
+  io_write_1("\nSW_MAX:   ");
+  io_inspect_sw_hexadecimal(&sw_max);
+  io_write_1("\n");
+}
+
+int main (int argc, char **argv) {
+  kc3_init(NULL, &argc, &argv);
+  display_min_max();
+  kc3_clean(NULL);
+  return 0;
+}
diff --git a/misc/print_limits.c b/misc/print_limits.c
deleted file mode 100644
index 4e4bf53..0000000
--- a/misc/print_limits.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <libkc3/kc3.h>
-
-void display_min_max() {
-  s8 s8_min = S8_MIN;
-  s8 s8_max = S8_MAX;
-  s16 s16_min = S16_MIN;
-  s16 s16_max = S16_MAX;
-  s32 s32_min = S32_MIN;
-  s32 s32_max = S32_MAX;
-  s64 s64_min = S64_MIN;
-  s64 s64_max = S64_MAX;
-  sw sw_min = SW_MIN;
-  sw sw_max = SW_MAX;
-    // Display minimum and maximum values for integer types
-  io_puts("Minimum and Maximum values for integer types:");
-  io_write_1("S8_MIN:  ");
-  io_inspect_s8_hexadecimal(&s8_min);
-  io_write_1("\nS8_MAX:   ");
-  io_inspect_s8_hexadecimal(&s8_max);
-  io_write_1("\nS16_MIN: ");
-  io_inspect_s16_hexadecimal(&s16_min);
-  io_write_1("\nS16_MAX:  ");
-  io_inspect_s16_hexadecimal(&s16_max);
-  io_write_1("\nS32_MIN: ");
-  io_inspect_s32_hexadecimal(&s32_min);
-  io_write_1("\nS32_MAX:  ");
-  io_inspect_s32_hexadecimal(&s32_max);
-  io_write_1("\nS64_MIN: ");
-  io_inspect_s64_hexadecimal(&s64_min);
-  io_write_1("\nS64_MAX:  ");
-  io_inspect_s64_hexadecimal(&s64_max);
-  io_write_1("\nSW_MIN:  ");
-  io_inspect_sw_hexadecimal(&sw_min);
-  io_write_1("\nSW_MAX:   ");
-  io_inspect_sw_hexadecimal(&sw_max);
-  io_write_1("\n");
-}
-
-int main (int argc, char **argv) {
-  kc3_init(NULL, &argc, &argv);
-  display_min_max();
-  kc3_clean(NULL);
-  return 0;
-}