Skip to content

Commit be0b224

Browse files
rickrick
rick
authored and
rick
committed
functional window manager
1 parent c5b4761 commit be0b224

File tree

132 files changed

+3706
-73
lines changed

Some content is hidden

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

132 files changed

+3706
-73
lines changed

Diff for: .gitmodules

+54
Original file line numberDiff line numberDiff line change
@@ -871,3 +871,57 @@
871871
[submodule "submodules/movewin"]
872872
path = submodules/movewin
873873
url = https://github.com/andrewgho/movewin
874+
[submodule "submodules/closefrom"]
875+
path = submodules/closefrom
876+
url = https://github.com/msantos/closefrom
877+
[submodule "submodules/base64-simple"]
878+
path = submodules/base64-simple
879+
url = https://github.com/bartobri/base64-simple
880+
[submodule "submodules/base64_simple"]
881+
path = submodules/base64_simple
882+
url = https://github.com/bartobri/base64-simple
883+
[submodule "submodules/hmac-sha256"]
884+
path = submodules/hmac-sha256
885+
url = https://github.com/aperezdc/hmac-sha256
886+
[submodule "submodules/hmac_sha256"]
887+
path = submodules/hmac_sha256
888+
url = https://github.com/aperezdc/hmac-sha256
889+
[submodule "submodules/libutf8"]
890+
path = submodules/libutf8
891+
url = https://github.com/jwerle/libutf8
892+
[submodule "submodules/stp_print"]
893+
path = submodules/stp_print
894+
url = https://github.com/jtfrom9/stp_print
895+
[submodule "submodules/rotate_bits"]
896+
path = submodules/rotate_bits
897+
url = https://github.com/jb55/rotate-bits.h
898+
[submodule "submodules/libmonitors"]
899+
path = submodules/libmonitors
900+
url = https://github.com/Shirakumo/libmonitors
901+
[submodule "submodules/rotate-bits"]
902+
path = submodules/rotate-bits
903+
url = https://github.com/jb55/rotate-bits.h
904+
[submodule "submodules/c_iterators"]
905+
path = submodules/c_iterators
906+
url = https://github.com/TotallyNotChase/c-iterators
907+
[submodule "submodules/osxautomation"]
908+
path = submodules/osxautomation
909+
url = https://github.com/joseph/osxautomation
910+
[submodule "submodules/sigstr"]
911+
path = submodules/sigstr
912+
url = https://github.com/adzierzanowski/sigstr
913+
[submodule "submodules/go_libproc"]
914+
path = submodules/go_libproc
915+
url = https://github.com/tejasmanohar/go-libproc
916+
[submodule "submodules/libproc"]
917+
path = submodules/libproc
918+
url = https://github.com/PolySat/libproc
919+
[submodule "submodules/wcwidth"]
920+
path = submodules/wcwidth
921+
url = https://github.com/mattn/wcwidth.c
922+
[submodule "submodules/libdefer"]
923+
path = submodules/libdefer
924+
url = https://github.com/trws/libdefer
925+
[submodule "submodules/expboff"]
926+
path = submodules/expboff
927+
url = https://github.com/willemt/expboff

Diff for: base64-simple-test/base64-simple-test.c

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
////////////////////////////////////////////
2+
3+
////////////////////////////////////////////
4+
#include "base64-simple-test/base64-simple-test.h"
5+
////////////////////////////////////////////
6+
#include "ansi-codes/ansi-codes.h"
7+
#include "base64_simple/src/base64simple.h"
8+
#include "c_fsio/include/fsio.h"
9+
#include "c_greatest/greatest/greatest.h"
10+
#include "c_stringfn/include/stringfn.h"
11+
#include "c_vector/vector/vector.h"
12+
#include "log.h/log.h"
13+
#include "timestamp/timestamp.h"
14+
15+
////////////////////////////////////////////
16+
TEST t_base64_simple_test(){
17+
char *decoded, *encoded;
18+
size_t i, size, r_size;
19+
20+
// Encoding
21+
22+
decoded = "This is a decoded string.";
23+
size = strlen(decoded);
24+
encoded = base64simple_encode(decoded, size);
25+
if (encoded == NULL) {
26+
printf("Insufficient Memory!\n");
27+
} else {
28+
printf("Encoded: %s\n", encoded);
29+
}
30+
31+
// Decoding
32+
33+
size = strlen(encoded);
34+
decoded = base64simple_decode(encoded, size, &r_size);
35+
if (decoded == NULL) {
36+
printf("Improperly Encoded String or Insufficient Memory!\n");
37+
} else {
38+
for (i = 0; i < r_size; ++i) {
39+
// Do something with decoded[i] here
40+
}
41+
}
42+
43+
// Freeing
44+
45+
free(encoded);
46+
free(decoded);
47+
PASS();
48+
}
49+
50+
SUITE(s_base64_simple_test) {
51+
RUN_TEST(t_base64_simple_test);
52+
}
53+
54+
GREATEST_MAIN_DEFS();
55+
56+
int main(const int argc, const char **argv) {
57+
GREATEST_MAIN_BEGIN();
58+
RUN_SUITE(s_base64_simple_test);
59+
GREATEST_MAIN_END();
60+
}

Diff for: base64-simple-test/base64-simple-test.h

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
//////////////////////////////////////
3+
#include <assert.h>
4+
#include <ctype.h>
5+
#include <err.h>
6+
#include <errno.h>
7+
#include <inttypes.h>
8+
#include <libgen.h>
9+
#include <limits.h>
10+
#include <locale.h>
11+
#include <math.h>
12+
#include <poll.h>
13+
#include <signal.h>
14+
#include <stdarg.h>
15+
#include <stdio.h>
16+
#include <stdlib.h>
17+
#include <string.h>
18+
#include <sys/socket.h>
19+
#include <sys/stat.h>
20+
#include <sys/time.h>
21+
#include <termios.h>
22+
#include <unistd.h>
23+
//////////////////////////////////////

Diff for: base64-simple-test/meson.build

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
base64_simple_test_srcs = [
2+
'base64-simple-test.c',
3+
]
4+
inc = get_variable('inc', join_paths(meson.current_source_dir(),'..'))
5+
base64_simple_test_include_dirs = [
6+
'.',
7+
inc,
8+
]
9+
base64_simple_test_deps = [
10+
c_greatest_dep,
11+
c_vector_dep,
12+
c_fsio_dep,
13+
base64_simple_dep,
14+
c_stringfn_dep,
15+
ansi_codes_dep,
16+
logh_dep,
17+
timestamp_dep,
18+
]
19+
base64_simple_test_c_args = [
20+
]
21+
base64_simple_test_link_args = [
22+
]
23+
24+
base64_simple_test_test_dir = join_paths(meson.current_source_dir(), '..')
25+
26+
if get_option('enable-binaries')
27+
base64_simple_test_exec = executable('base64-simple-test',
28+
base64_simple_test_srcs,
29+
dependencies: base64_simple_test_deps,
30+
include_directories: base64_simple_test_include_dirs,
31+
link_args: base64_simple_test_link_args,
32+
c_args: base64_simple_test_c_args,
33+
install: false,
34+
)
35+
#test('base64-simple-test',
36+
# base64_simple_test_exec, args: ['-v','-a'],
37+
# workdir: base64_simple_test_test_dir,
38+
#)
39+
endif

Diff for: chfreq-test/chfreq-test.c

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
////////////////////////////////////////////
2-
2+
#include <stdio.h>
33
////////////////////////////////////////////
44
#include "chfreq-test/chfreq-test.h"
55
////////////////////////////////////////////
6-
#include "ansi-codes/ansi-codes.h"
7-
#include "c_fsio/include/fsio.h"
86
#include "c_greatest/greatest/greatest.h"
9-
#include "c_stringfn/include/stringfn.h"
10-
#include "c_vector/vector/vector.h"
117
#include "chfreq.c/chfreq.h"
12-
#include "log.h/log.h"
13-
#include "timestamp/timestamp.h"
148

159
////////////////////////////////////////////
1610
TEST t_chfreq_test(){
17-
char *str = "110aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz102";
18-
uint32_t **f = chfreq(str);
19-
uint32_t *cur = NULL;
20-
21-
printf("str: %s\n", str);
22-
for (int i = 0; NULL != (cur = f[i]); ++i) {
23-
char c = cur[0];
24-
int cf = cur[1];
25-
printf("#%d> char: %c | qty: %d |\n", i, c, cf);
26-
}
11+
/*
12+
* sleep(1);
13+
* char *str = "110aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz102";
14+
* uint32_t **f = chfreq(str);
15+
* uint32_t *cur = NULL;
16+
*
17+
* printf("str: %s\n", str);
18+
* for (int i = 0; NULL != (cur = f[i]); ++i) {
19+
* char c = cur[0];
20+
* int cf = cur[1];
21+
* printf("#%d> char: %c | qty: %d |\n", i, c, cf);
22+
* }
23+
*/
2724
PASS();
2825
}
2926

Diff for: chfreq-test/chfreq-test.h

-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,2 @@
11
#pragma once
22
//////////////////////////////////////
3-
#include <assert.h>
4-
#include <ctype.h>
5-
#include <err.h>
6-
#include <errno.h>
7-
#include <inttypes.h>
8-
#include <libgen.h>
9-
#include <limits.h>
10-
#include <locale.h>
11-
#include <math.h>
12-
#include <poll.h>
13-
#include <signal.h>
14-
#include <stdarg.h>
15-
#include <stdio.h>
16-
#include <stdlib.h>
17-
#include <string.h>
18-
#include <sys/socket.h>
19-
#include <sys/stat.h>
20-
#include <sys/time.h>
21-
#include <termios.h>
22-
#include <unistd.h>
23-
//////////////////////////////////////

Diff for: chfreq-test/meson.build

-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ chfreq_test_include_dirs = [
88
]
99
chfreq_test_deps = [
1010
c_greatest_dep,
11-
c_vector_dep,
12-
c_fsio_dep,
1311
chfreq_c_dep,
14-
c_stringfn_dep,
15-
ansi_codes_dep,
16-
logh_dep,
17-
timestamp_dep,
1812
]
1913
chfreq_test_c_args = [
2014
]

Diff for: clamp-test/clamp-test.c

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
////////////////////////////////////////////
2+
3+
////////////////////////////////////////////
4+
#include "clamp-test/clamp-test.h"
5+
////////////////////////////////////////////
6+
#include "ansi-codes/ansi-codes.h"
7+
#include "c_fsio/include/fsio.h"
8+
#include "c_greatest/greatest/greatest.h"
9+
#include "c_stringfn/include/stringfn.h"
10+
#include "c_vector/vector/vector.h"
11+
#include "clamp/clamp.h"
12+
#include "log.h/log.h"
13+
#include "timestamp/timestamp.h"
14+
15+
////////////////////////////////////////////
16+
TEST t_clamp_test(){
17+
int value = 5;
18+
19+
value = clamp(value, 0, 4);
20+
ASSERT_EQ(value, 4);
21+
PASS();
22+
}
23+
24+
SUITE(s_clamp_test) {
25+
RUN_TEST(t_clamp_test);
26+
}
27+
28+
GREATEST_MAIN_DEFS();
29+
30+
int main(const int argc, const char **argv) {
31+
GREATEST_MAIN_BEGIN();
32+
RUN_SUITE(s_clamp_test);
33+
GREATEST_MAIN_END();
34+
}

Diff for: clamp-test/clamp-test.h

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
//////////////////////////////////////
3+
#include <assert.h>
4+
#include <ctype.h>
5+
#include <err.h>
6+
#include <errno.h>
7+
#include <inttypes.h>
8+
#include <libgen.h>
9+
#include <limits.h>
10+
#include <locale.h>
11+
#include <math.h>
12+
#include <poll.h>
13+
#include <signal.h>
14+
#include <stdarg.h>
15+
#include <stdio.h>
16+
#include <stdlib.h>
17+
#include <string.h>
18+
#include <sys/socket.h>
19+
#include <sys/stat.h>
20+
#include <sys/time.h>
21+
#include <termios.h>
22+
#include <unistd.h>
23+
//////////////////////////////////////

Diff for: clamp-test/meson.build

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
clamp_test_srcs = [
2+
'clamp-test.c',
3+
]
4+
inc = get_variable('inc', join_paths(meson.current_source_dir(),'..'))
5+
clamp_test_include_dirs = [
6+
'.',
7+
inc,
8+
]
9+
clamp_test_deps = [
10+
c_greatest_dep,
11+
clamp_dep,
12+
c_vector_dep,
13+
c_fsio_dep,
14+
c_stringfn_dep,
15+
ansi_codes_dep,
16+
logh_dep,
17+
timestamp_dep,
18+
]
19+
clamp_test_c_args = [
20+
]
21+
clamp_test_link_args = [
22+
]
23+
24+
clamp_test_test_dir = join_paths(meson.current_source_dir(), '..')
25+
26+
if get_option('enable-binaries')
27+
clamp_test_exec = executable('clamp-test',
28+
clamp_test_srcs,
29+
dependencies: clamp_test_deps,
30+
include_directories: clamp_test_include_dirs,
31+
link_args: clamp_test_link_args,
32+
c_args: clamp_test_c_args,
33+
install: false,
34+
)
35+
test('clamp-test',
36+
clamp_test_exec, args: ['-v','-a'],
37+
workdir: clamp_test_test_dir,
38+
)
39+
endif

Diff for: closefrom-test/closefrom-test.c

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
////////////////////////////////////////////
2+
3+
////////////////////////////////////////////
4+
#include "closefrom-test/closefrom-test.h"
5+
////////////////////////////////////////////
6+
#include "ansi-codes/ansi-codes.h"
7+
#include "c_fsio/include/fsio.h"
8+
#include "c_greatest/greatest/greatest.h"
9+
#include "c_stringfn/include/stringfn.h"
10+
#include "c_vector/vector/vector.h"
11+
#include "log.h/log.h"
12+
#include "timestamp/timestamp.h"
13+
14+
////////////////////////////////////////////
15+
TEST t_closefrom_test(){
16+
PASS();
17+
}
18+
19+
SUITE(s_closefrom_test) {
20+
RUN_TEST(t_closefrom_test);
21+
}
22+
23+
GREATEST_MAIN_DEFS();
24+
25+
int main(const int argc, const char **argv) {
26+
GREATEST_MAIN_BEGIN();
27+
RUN_SUITE(s_closefrom_test);
28+
GREATEST_MAIN_END();
29+
}

0 commit comments

Comments
 (0)