Skip to content

Commit 1fbcec6

Browse files
rickrick
rick
authored and
rick
committed
deprecate jinja process hack, replace with roscha!
1 parent 60dba05 commit 1fbcec6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+243
-207
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ loc.sh
3434
*/.venv-*
3535
.xmake
3636
richard-100*
37+
.meson.build*.log
38+
.meson-build*.log

.gitmodules

+15
Original file line numberDiff line numberDiff line change
@@ -799,3 +799,18 @@
799799
[submodule "submodules/c_img"]
800800
path = submodules/c_img
801801
url = [email protected]:binRick/c_img.git
802+
[submodule "submodules/qoi"]
803+
path = submodules/qoi
804+
url = https://github.com/phoboslab/qoi
805+
[submodule "submodules/interface99"]
806+
path = submodules/interface99
807+
url = https://github.com/Hirrolot/interface99
808+
[submodule "submodules/metalang99"]
809+
path = submodules/metalang99
810+
url = https://github.com/Hirrolot/metalang99
811+
[submodule "submodules/restic"]
812+
path = submodules/restic
813+
url = https://github.com/restic/restic
814+
[submodule "submodules/utf8.h"]
815+
path = submodules/utf8.h
816+
url = https://github.com/sheredom/utf8.h

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ default: all
22
include submodules/c_deps/etc/includes.mk
33
local-setup: setup-binaries setup-golang setup-wg setup
44
##############################################################
5-
TIDIED_FILES = */*.c */*.h \
5+
TIDIED_FILES = deps*/*.c deps*/*.h term*/*.c term*/*.h ctable*/*.c ctable*/*.h *table*/*.c *table*/*.h cgif-test/*.c *-test/*.c *-test/*.h chan-test/*.c chan-test/*.h \
6+
introspect-test/*.c introspect-test/*.h \
7+
introspect/*.c introspect/*.h \
8+
reproc-test/*.c reproc-test/*.h \
9+
list-test/*.c list-test/*.h \
10+
*-test/*.c *-test/*.h \
11+
intro*/*.c intro*/*.h \
12+
exec-fzf*/*.c exec-fzf*/*.h \
613
submodules/c_vt100utils/vt100utils.h \
714
submodules/c_vt100utils/vt100utils.c \
815
submodules/c_vt100utils/tuibox.c \

blocks-test/blocks-test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "c_fsio/include/fsio.h"
99
#include "c_greatest/greatest/greatest.h"
1010
#include "c_stringfn/include/stringfn.h"
11-
#include "c_vector/include/vector.h"
11+
#include "c_vector/vector/vector.h"
1212
////////////////////////////////////////////
1313
#include "blocks-test/blocks-test.h"
1414
#include "tiny-regex-c/re.h"

c-meson-utils-test/c-meson-utils-test.c

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "c-meson-utils-test/c-meson-utils-test.h"
1313
#include "c-meson-utils/c-meson-utils.h"
1414
#include "c_fsio/include/fsio.h"
15-
#include "jinja2-cli/jinja2-cli.h"
1615
#include "tempdir.c/tempdir.h"
1716

1817
//////////////////////////////////////////////

c-meson-utils/c-meson-utils.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#include "c_fsio/include/fsio.h"
1010
#include "c_string_buffer/include/stringbuffer.h"
1111
#include "c_stringfn/include/stringfn.h"
12-
#include "c_vector/include/vector.h"
13-
#include "jinja2-cli/jinja2-cli.h"
12+
#include "c_vector/vector/vector.h"
1413
/////////////////////////////////////
1514
struct c_meson_module_dep_t { // meson/deps/xxxxx/meson.build
1615
char *dep_name;

c-meson-utils/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ c_meson_utils_deps = [
1212
c_fsio_dep,
1313
c_string_buffer_dep,
1414
c_stringfn_dep,
15-
jinja2_cli_dep,
1615
c_fsio_dep,
1716
tempdir_dep,
1817
]

chan-test/chan-test.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#include "chan-test.h"
22
#include <assert.h>
33
#include <ctype.h>
4-
#include <ctype.h>
54
#include <pthread.h>
65
#include <stdarg.h>
76
#include <stdbool.h>
87
#include <stdint.h>
9-
#include <stdint.h>
108
#include <stdio.h>
119
#include <stdlib.h>
1210
#include <string.h>
@@ -160,15 +158,12 @@ TEST t_chan_jobs_worker(void *buffer_qty,
160158
pthread_create(&worker_threads[2], NULL, worker, (void *)5);
161159

162160
ct_start(NULL);
163-
char *send_dur;
164161

165162
for (size_t i = 1; i <= JOBS_QTY; i++) {
166163
usleep(SEND_JOBS_DELAY_MS * 1000);
167164
chan_send(JOBS_CHANNEL, (void *)i);
168165
}
169166

170-
free(send_dur);
171-
//ct_set_unit(ct_MILLISECONDS);
172167
char *sent_dur = ct_stop("");
173168

174169
chan_close(JOBS_CHANNEL);
@@ -177,12 +172,12 @@ TEST t_chan_jobs_worker(void *buffer_qty,
177172
sent_dur
178173
);
179174

180-
for (int i = 0; i < WORKERS_QTY; i++) {
175+
for (size_t i = 0; i < WORKERS_QTY; i++) {
181176
chan_recv(DONE_CHANNEL, NULL);
182177
}
183178

184179
I("done signals received.....waiting on threads to exit....");
185-
for (int i = 0; i < WORKERS_QTY; i++) {
180+
for (size_t i = 0; i < WORKERS_QTY; i++) {
186181
pthread_join(&worker_threads[i], NULL);
187182
}
188183

deps-test/deps-test.c

+32-55
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
#include "c_string_buffer/include/stringbuffer.h"
6565
#include "c_stringfn/include/stringfn.h"
6666
#include "c_timer/include/c_timer.h"
67-
#include "c_vector/include/vector.h"
67+
#include "c_vector/vector/vector.h"
6868
#include "c_workqueue/include/workqueue.h"
6969
#include "cansid/cansid.h"
7070
#include "cansid/minunit.h"
@@ -116,7 +116,6 @@
116116
#include "incbin/incbin.h"
117117
#include "int/int.h"
118118
#include "is_number.c/is_number.h"
119-
#include "jinja2-cli/jinja2-cli.h"
120119
#include "kgflags/kgflags.h"
121120
#include "kitty/kitty.h"
122121
#include "layout/layout.h"
@@ -299,7 +298,7 @@ void handle_request(struct http_request_s *request) {
299298
http_string_t url = http_request_target(request);
300299

301300
{
302-
dbg(url.buf, % s);
301+
dbg(url.buf, %s);
303302
char *U = stringfn_substring(url.buf, 0, url.len);
304303
struct StringFNStrings lines = stringfn_split_lines_and_trim(url.buf);
305304
char *req_data = lines.strings[lines.count - 1];
@@ -315,7 +314,7 @@ void handle_request(struct http_request_s *request) {
315314
}
316315
}
317316
char *normalized_url = stringbuffer_to_string(url_sb);
318-
dbg(normalized_url, % s);
317+
dbg(normalized_url, %s);
319318
struct StringFNStrings normalized_url_strings = stringfn_split(normalized_url, '/');
320319

321320
int p;
@@ -324,7 +323,7 @@ void handle_request(struct http_request_s *request) {
324323
char *parts[3];
325324
char *url_string;
326325
asprintf(&url_string, "http://localhost:%d%s?%s", HTTPSERVER_LISTEN_PORT, normalized_url, req_data);
327-
dbg(url_string, % s);
326+
dbg(url_string, %s);
328327

329328
if (-1 == yuarel_parse(&yurl, url_string)) {
330329
fprintf(stderr, "Could not parse url!\n");
@@ -335,10 +334,10 @@ void handle_request(struct http_request_s *request) {
335334
printf("scheme:\t%s\n", yurl.scheme);
336335
printf("host:\t%s\n", yurl.host);
337336
}
338-
dbg(params_strings.count, % d);
339-
dbg(req_data, % s);
340-
dbg(lines.count, % d);
341-
dbg(normalized_url_strings.count, % d);
337+
dbg(params_strings.count, %d);
338+
dbg(req_data, %s);
339+
dbg(lines.count, %d);
340+
dbg(normalized_url_strings.count, %d);
342341
printf("port:\t%d\n", yurl.port);
343342
printf("path:\t%s\n", yurl.path);
344343
printf("query:\t%s\n", yurl.query);
@@ -367,8 +366,8 @@ void handle_request(struct http_request_s *request) {
367366
char *u;
368367
asprintf(&u, "\n\turl:%s\n\tlen:%d\n", url.buf, url.len);
369368
if (false) {
370-
dbg(uri_decoded, % s);
371-
dbg(uri_encoded, % s);
369+
dbg(uri_decoded, %s);
370+
dbg(uri_encoded, %s);
372371
printf("%s", u);
373372
}
374373
}
@@ -773,7 +772,7 @@ void demo_ansi_qrcode(){
773772
}
774773

775774
void do_forever_my_program(void *context){
776-
dbg("t_forever_my_program", % s);
775+
dbg("t_forever_my_program", %s);
777776
if (context != NULL) {
778777
// do something with the context
779778
}
@@ -786,12 +785,12 @@ int do_forever_callback(void *context, const unsigned char started, int stat_loc
786785
if (context != NULL) {
787786
// do something with the context
788787
}
789-
dbg(stat_loc, % d);
790-
dbg(started, % c);
788+
dbg(stat_loc, %d);
789+
dbg(started, %c);
791790
if (stat_loc == 0 || !started) {
792791
return(-1); // no more retries
793792
}
794-
dbg("do_forever_callback", % s);
793+
dbg("do_forever_callback", %s);
795794
return(500); // wait 500 millies before next invocation, 0 for no wait.
796795
}
797796

@@ -1028,12 +1027,12 @@ TEST t_libbeaufort(void){
10281027
groove = beaufort_encrypt(groove_s, "groove", NULL);
10291028
assert(groove);
10301029
assert(0 == strcmp(groove, "3n1Cs lg y7l 9ko!F :b"));
1031-
dbg(monkey, % s);
1032-
dbg(monkey_s, % s);
1033-
dbg(goodman, % s);
1034-
dbg(goodman_s, % s);
1035-
dbg(groove, % s);
1036-
dbg(groove_s, % s);
1030+
dbg(monkey, %s);
1031+
dbg(monkey_s, %s);
1032+
dbg(goodman, %s);
1033+
dbg(goodman_s, %s);
1034+
dbg(groove, %s);
1035+
dbg(groove_s, %s);
10371036

10381037
// BENCHMARK_SUMMARY(benchmark_name);
10391038
PASS();
@@ -1044,8 +1043,8 @@ TEST t_murmurhash(void){
10441043
const char *key = "kinkajou";
10451044
uint32_t hash = murmurhash(key, (uint32_t)strlen(key), seed);
10461045

1047-
dbg(key, % s);
1048-
dbg(seed, % d);
1046+
dbg(key, %s);
1047+
dbg(seed, %d);
10491048
printf("%" PRIu32 "\n", hash);
10501049
printf("%d" PRIu32 "\n", hash);
10511050

@@ -2221,7 +2220,7 @@ TEST t_ok_file_format_wav(void){
22212220
char *wav_file = malloc(1024);
22222221

22232222
sprintf(wav_file, "%s/../sounds/key_space_down.wav", EXECUTABLE_PATH_DIRNAME);
2224-
dbg(wav_file, % s);
2223+
dbg(wav_file, %s);
22252224
FILE *file = fopen(wav_file, "rb");
22262225
ok_wav audio = ok_wav_read(file, OK_WAV_DEFAULT_DECODE_FLAGS);
22272226

@@ -2631,24 +2630,6 @@ TEST t_my_cwd(void){
26312630
PASS();
26322631
}
26332632

2634-
TEST t_jinja2_cli(void){
2635-
struct jinja2_render_template_t *CFG = jinja2_init_config();
2636-
2637-
CFG->input_json_string = "{\"abc\":\"world\"}";
2638-
CFG->template_s = "hello {{ abc }}";
2639-
CFG->debug_mode = true;
2640-
CFG->debug_mode = false;
2641-
int res = jinja2_render_template(CFG);
2642-
2643-
ASSERT_EQ(res, 0);
2644-
ASSERT_EQ(CFG->success, true);
2645-
ASSERT_EQ(strcmp(CFG->output_s, "hello world"), 0);
2646-
2647-
printf(AC_RESETALL AC_BLUE "%s" AC_RESETALL "\n", CFG->output_s);
2648-
2649-
PASS();
2650-
}
2651-
26522633
typedef struct {
26532634
char *name;
26542635
int cash;
@@ -3330,21 +3311,21 @@ TEST t_c_timestamp(void){
33303311
ts.sec = 0;
33313312
ts.offset = 0;
33323313
ts.nsec = -1;
3333-
dbg(timestamp_valid(&ts), % d);
3314+
dbg(timestamp_valid(&ts), %d);
33343315

33353316
ts.nsec = 1000000000;
3336-
dbg(!timestamp_valid(&ts), % d);
3317+
dbg(!timestamp_valid(&ts), %d);
33373318

33383319
ts.nsec = 0;
33393320
ts.offset = -23 * 60 - 60;
3340-
dbg(!timestamp_valid(&ts), % d);
3321+
dbg(!timestamp_valid(&ts), %d);
33413322

33423323
ts.offset = +23 * 60 + 60;
3343-
dbg(!timestamp_valid(&ts), % d);
3324+
dbg(!timestamp_valid(&ts), %d);
33443325

33453326
ts.offset = 0;
33463327
ts.sec = INT64_C(-62135596801);
3347-
dbg(!timestamp_valid(&ts), % d);
3328+
dbg(!timestamp_valid(&ts), %d);
33483329
ts.sec = INT64_C(253402387140);
33493330
timestamp_t ts1;
33503331
struct tm tm1;
@@ -3353,10 +3334,10 @@ TEST t_c_timestamp(void){
33533334
ts.nsec = 0;
33543335
ts.offset = 0;
33553336
memset(&tm1, 0, sizeof(tm1));
3356-
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_year), % d);
3357-
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_mon), % d);
3358-
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_hour), % d);
3359-
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_sec), % d);
3337+
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_year), %d);
3338+
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_mon), %d);
3339+
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_hour), %d);
3340+
dbg(timestamp_to_tm_utc(&ts, &tm1.tm_sec), %d);
33603341

33613342
PASS();
33623343
}
@@ -4087,9 +4068,6 @@ SUITE(s_kitty){
40874068
SUITE(s_my_cwd){
40884069
RUN_TEST(t_my_cwd);
40894070
}
4090-
SUITE(s_jinja2_cli){
4091-
RUN_TEST(t_jinja2_cli);
4092-
}
40934071
SUITE(s_levenshtein){
40944072
RUN_TEST(t_levenshtein);
40954073
}
@@ -4272,7 +4250,6 @@ int main(int argc, char **argv) {
42724250
// RUN_SUITE(s_occurrences);
42734251
// RUN_SUITE(s_str_replace);
42744252
RUN_SUITE(s_seethe);
4275-
RUN_SUITE(s_jinja2_cli);
42764253
RUN_SUITE(s_list);
42774254
RUN_SUITE(s_forever);
42784255
RUN_SUITE(s_eventemitter);

deps-test/meson.build

-11
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ deps_test_deps = [
9292
libyuarel_dep,
9393
levenshtein_dep,
9494
libut_dep,
95-
jinja2_cli_dep,
9695
chfreq_c_dep,
9796
msgbox_dep,
9897
dotenv_c_dep,
@@ -121,16 +120,6 @@ if get_option('enable-binaries')
121120
c_args: deps_c_args,
122121
install: true,
123122
)
124-
if get_option('enable-greatest-tests')
125-
# test('deps-test|List Test Cases',sh_program,
126-
# args: ['-c',deps_ls_tests_script],
127-
# workdir: meson.current_source_dir(),
128-
#)
129-
endif
130-
#test('jinja2-cli',
131-
# deps_test_exec, args: ['-v','-a','-e','-s','s_jinja2_cli'],
132-
# workdir: deps_cur_dir,
133-
# )
134123
if get_option('enable-deps-test')
135124
test('deps-test',
136125
deps_test_exec, args: ['-v','-a'],
File renamed without changes.

etc/meson-repos-info.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$include: etc/reference-data.yaml
1+
$include: etc/bashful-vars.yaml
22
$include: etc/config.yaml
33

44
config:

etc/meson-repos.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$include: etc/reference-data.yaml
1+
$include: etc/bashful-vars.yaml
22
$include: etc/config.yaml
33

44
config:

etc/meson.mk

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ meson-setup:
2525

2626
meson-build: meson-setup
2727
@$(MESON) compile -C $(MESON_BUILD_DIR) -j $(MESON_PARALLEL_JOBS)
28+
#| tee .meson-build.log
29+
#@$(GREP) 'warning:' .meson-build.log |egrep -v 'submodules|unused parameter' | tee .meson-build-warnings.log
2830

2931
do-build: meson-build muon-build
3032

etc/muon-repos.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$include: etc/reference-data.yaml
1+
$include: etc/bashful-vars.yaml
22
$include: etc/config.yaml
33

44

0 commit comments

Comments
 (0)