demake 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/bin/demake +163 -176
  3. data/lib/apps/example/Makefile +374 -0
  4. data/lib/{data → apps}/example/demake/applications +1 -1
  5. data/lib/apps/example/demake/brief_description +1 -0
  6. data/lib/{data → apps}/example/demake/license +0 -0
  7. data/lib/{data → apps}/example/demake/settings.rb +14 -14
  8. data/lib/apps/example/demake/suggestion +1 -0
  9. data/lib/{data → apps}/example/demake/test-target.rb +0 -0
  10. data/lib/{data → apps}/example/src/goodbye.c +0 -0
  11. data/lib/{data → apps}/example/src/hello.c +0 -0
  12. data/lib/{data → apps}/example/src/string/string.c +0 -0
  13. data/lib/{data → apps}/example/src/string/string.h +0 -0
  14. data/lib/apps/oreo/Makefile +260 -0
  15. data/lib/{data → apps}/oreo/demake/applications +0 -0
  16. data/lib/apps/oreo/demake/brief_description +1 -0
  17. data/lib/{data → apps}/oreo/demake/license +0 -0
  18. data/lib/{data → apps}/oreo/demake/settings.rb +13 -13
  19. data/lib/apps/oreo/demake/suggestion +1 -0
  20. data/lib/{data → apps}/oreo/demake/test-target.rb +0 -0
  21. data/lib/apps/oreo/src/defines.h +29 -0
  22. data/lib/{data → apps}/oreo/src/fast_read_file.h +18 -18
  23. data/lib/{data → apps}/oreo/src/oreo.c +4 -4
  24. data/lib/{data → apps}/oreo/src/typedefs.h +8 -8
  25. data/lib/data/libsrc/auto_bits.h +33 -0
  26. data/lib/data/libsrc/base.h +10 -0
  27. data/lib/data/libsrc/cpu_mark_check.h +267 -0
  28. data/lib/data/libsrc/defines.h +29 -0
  29. data/lib/data/libsrc/fast_read_file.h +259 -0
  30. data/lib/data/libsrc/fast_sha2.h +1840 -0
  31. data/lib/data/libsrc/parse_arguments.h +0 -0
  32. data/lib/data/libsrc/rb_library.c +140 -0
  33. data/lib/data/libsrc/typedefs.h +61 -0
  34. data/lib/template/build_target.rb +0 -0
  35. data/lib/template/clean_target.rb +0 -0
  36. data/lib/template/debug_executable_target.rb +0 -0
  37. data/lib/template/debug_library_target.rb +0 -0
  38. data/lib/template/debug_target.rb +0 -0
  39. data/lib/template/dependency_targets.rb +0 -0
  40. data/lib/template/executable_debug_target.rb +0 -0
  41. data/lib/template/executable_target.rb +0 -0
  42. data/lib/template/generic_dependency_targets.rb +0 -0
  43. data/lib/template/library_debug_target.rb +0 -0
  44. data/lib/template/library_target.rb +0 -0
  45. data/lib/template/license_target.rb +0 -0
  46. data/lib/template/link_library_target.rb +0 -0
  47. data/lib/template/strip_build.rb +0 -0
  48. metadata +35 -20
  49. data/lib/data/oreo/src/defines.h +0 -29
  50. /data/lib/{data → apps}/oreo/oreo_test.txt +0 -0
@@ -0,0 +1,260 @@
1
+ #
2
+ # Makefile automatically generated by Ruby Gem - demake 0.2.0
3
+ #
4
+ MAKE += -j 8
5
+ CC = gcc
6
+ OS := $(shell uname)
7
+ PROCESSOR := $(shell uname -p)
8
+ MACHINE := $(shell uname -m)
9
+ STRIP := strip
10
+ STRIP_ARGS := --strip-unneeded
11
+ PREFIX = /usr/local/bin/
12
+ LIBRARY_PREFIX = /usr/local/lib/
13
+ FLAGS = -ansi -pedantic -D_POSIX_C_SOURCE=200809L
14
+ ifeq '$(MACHINE)' 'riscv64'
15
+ FLAGS +=
16
+ endif
17
+ DEBUG_FLAGS = -DOREO_DEBUG -g -Wall -Wextra -Wunused-variable -Wundef -Wconversion -Wshadow -Wcast-qual -Wwrite-strings
18
+ OFLAGS = -O2
19
+ CFLAGS = $(FLAGS)
20
+ LDFLAGS =
21
+ LIB_CFLAGS = $(FLAGS)
22
+ LIB_LDFLAGS =
23
+ BUILD_FLAGS = $(CFLAGS)
24
+ LIBS =
25
+ LDLIBS = $(LIBS)
26
+ LIB_LDLIBS = $(LIBS)
27
+ BINARY = bin
28
+ LIBRARY = lib
29
+ SOURCE = src
30
+ OBJECT = obj
31
+ #
32
+ # oreo - File List (FL1)
33
+ #
34
+ FL1 = oreo.o
35
+ #
36
+ # oreo - Object List (OL1)
37
+ #
38
+ OL1 = $(patsubst %.o, $(OBJECT)/%.o, $(FL1))
39
+ #
40
+ # oreo_debug - Debug File List (DFL1)
41
+ #
42
+ DFL1 = oreo_debug.o
43
+ #
44
+ # oreo_debug - Debug Object List (DOL1)
45
+ #
46
+ DOL1 = $(patsubst %.o, $(OBJECT)/%.o, $(DFL1))
47
+
48
+ RUBY := $(shell command -v ruby 2> /dev/null)
49
+
50
+ define LICENSE
51
+
52
+ ┌────────────────────────────────────────────────────────────────────────────────┐
53
+ │ MIT License │
54
+ │ │
55
+ │ Permission is hereby granted, free of charge, to any person obtaining a copy │
56
+ │ of this software and associated documentation files (the "Software"), to deal │
57
+ │ in the Software without restriction, including without limitation the rights │
58
+ │ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell │
59
+ │ copies of the Software, and to permit persons to whom the Software is │
60
+ │ furnished to do so, subject to the following conditions: │
61
+ │ │
62
+ │ The above copyright notice and this permission notice shall be included in all │
63
+ │ copies or substantial portions of the Software. │
64
+ │ │
65
+ │ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR │
66
+ │ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, │
67
+ │ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE │
68
+ │ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER │
69
+ │ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, │
70
+ │ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE │
71
+ │ SOFTWARE. │
72
+ └────────────────────────────────────────────────────────────────────────────────┘
73
+
74
+ endef
75
+ export LICENSE
76
+ define LICENSE_FILE
77
+ MIT License
78
+
79
+ Permission is hereby granted, free of charge, to any person obtaining a copy
80
+ of this software and associated documentation files (the "Software"), to deal
81
+ in the Software without restriction, including without limitation the rights
82
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
83
+ copies of the Software, and to permit persons to whom the Software is
84
+ furnished to do so, subject to the following conditions:
85
+
86
+ The above copyright notice and this permission notice shall be included in all
87
+ copies or substantial portions of the Software.
88
+
89
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
90
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
91
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
92
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
94
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
95
+ SOFTWARE.
96
+ endef
97
+ export LICENSE_FILE
98
+
99
+ .PHONY : menu
100
+ menu : LICENSE
101
+ @echo "╔═════════════════════════════════════════════════════════════════════════╗"
102
+ @echo "║ ║"
103
+ @echo "║ Make targets: ║"
104
+ @echo "║ ║"
105
+ @echo "║ 🚧 build ║"
106
+ @echo "║ 📜 license ║"
107
+ @echo "║ 🔥 clean ║"
108
+ @echo "║ 🐛 debug ║"
109
+ @echo "║ 🔩 install ║"
110
+ @echo "║ 🔧 uninstall ║"
111
+ @echo "║ ❓ test ║"
112
+ @echo "║ ║"
113
+ @echo "╠═════════════════════════════════════════════════════════════════════════╣"
114
+ @echo "║ Build Executable: bin/oreo ║"
115
+ @echo "╠═════════════════════════════════════════════════════════════════════════╣"
116
+ @echo "║ Debug Executable: bin/oreo_debug ║"
117
+ @echo "╠═════════════════════════════════════════════════════════════════════════╣"
118
+ @echo "║ Install Binary Directory: /usr/local/bin/ ║"
119
+ @echo "║ Install Library Directory: /usr/local/lib/ ║"
120
+ @echo "╚═════════════════════════════════════════════════════════════════════════╝"
121
+ .PHONY : all
122
+ all : LICENSE build debug
123
+
124
+
125
+ .PHONY : license
126
+ license:
127
+ @echo "$$LICENSE_FILE" > LICENSE
128
+ @echo "$$LICENSE" | less -F -R -X -e
129
+
130
+ LICENSE:
131
+ @echo "$$LICENSE_FILE" > LICENSE
132
+ @echo "$$LICENSE" | less -R -X -e
133
+
134
+ .PHONY : build
135
+ build : LICENSE
136
+ @echo "╔═════════════════════════════════════════════════════════════════════════╗"
137
+ @echo "║ 🚧 Building executable: bin/oreo ║"
138
+ @echo "╚═════════════════════════════════════════════════════════════════════════╝"
139
+ @$(MAKE) $(BINARY)/oreo
140
+ @if command -v $(STRIP) >/dev/null 2>&1 ; then echo "Stripping $(BINARY)/oreo"; $(STRIP) $(STRIP_ARGS) $(BINARY)/oreo || echo "Warning: strip failed for $(BINARY)/oreo"; else echo "strip not found; skipping strip step"; fi
141
+
142
+ .PHONY : library
143
+ library : LICENSE
144
+
145
+ # Dependencies
146
+ $(OBJECT)/oreo.o : $(SOURCE)/oreo.c \
147
+ $(SOURCE)/defines.h \
148
+ $(SOURCE)/typedefs.h \
149
+ $(SOURCE)/fast_read_file.h
150
+ @echo "║ 🛠 Compiling... $(OBJECT)/oreo.o"
151
+ ifeq '$(OS)' 'Windows_NT'
152
+ @test -d $(OBJECT)/ || mkdir $(OBJECT)/
153
+ else
154
+ @mkdir -p $(OBJECT)/
155
+ endif
156
+ $(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/oreo.c -o $(OBJECT)/oreo.o
157
+ # Dependencies for debug
158
+ # $(OBJECT)/oreo_debug.o : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS)
159
+ #
160
+ $(OBJECT)/oreo_debug.o : $(SOURCE)/oreo.c \
161
+ $(SOURCE)/defines.h \
162
+ $(SOURCE)/typedefs.h \
163
+ $(SOURCE)/fast_read_file.h
164
+ @echo "║ 🐛 🛠 Compiling... $(OBJECT)/oreo_debug.o"
165
+ ifeq '$(OS)' 'Windows_NT'
166
+ @test -d $(OBJECT)/ || mkdir $(OBJECT)/
167
+ else
168
+ @mkdir -p $(OBJECT)/
169
+ endif
170
+ $(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/oreo.c -o $(OBJECT)/oreo_debug.o
171
+
172
+ $(BINARY)/oreo : BUILD_FLAGS := $(OFLAGS) $(CFLAGS) $(LDFLAGS)
173
+
174
+ $(BINARY)/oreo : $(OL1)
175
+ @echo "╔═════════════════════════════════════════════════════════════════════════╗"
176
+ @echo "║ 🔗 Linking Files... bin/oreo ║"
177
+ @echo "╚═════════════════════════════════════════════════════════════════════════╝"
178
+ ifeq '$(OS)' 'Windows_NT'
179
+ @test -d $(BINARY) || mkdir $(BINARY)
180
+ else
181
+ @mkdir -p $(BINARY)
182
+ endif
183
+ $(CC) $(BUILD_FLAGS) $(OL1) $(LDLIBS) -o $(BINARY)/oreo
184
+
185
+ $(BINARY)/oreo_debug : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS) $(LDFLAGS)
186
+
187
+ $(BINARY)/oreo_debug : LICENSE $(DOL1)
188
+ @echo "╔═════════════════════════════════════════════════════════════════════════╗"
189
+ @echo "║ 🐛 🔗 Linking Files... bin/oreo_debug ║"
190
+ @echo "╚═════════════════════════════════════════════════════════════════════════╝"
191
+ ifeq '$(OS)' 'Windows_NT'
192
+ @test -d $(BINARY) || mkdir $(BINARY)
193
+ else
194
+ @mkdir -p $(BINARY)
195
+ endif
196
+ $(CC) $(BUILD_FLAGS) $(LIBS) -o $(BINARY)/oreo_debug $(DOL1)
197
+
198
+ # General Auto-Dependencies
199
+ $(OBJECT)/%.o : $(SOURCE)/%.c
200
+ @echo "║ 🛠 Compiling... $(@)"
201
+ ifeq '$(OS)' 'Windows_NT'
202
+ @test -d $(BINARY) || mkdir $(BINARY)
203
+ @test -d $(OBJECT) || mkdir $(OBJECT)
204
+ else
205
+ @mkdir -p $(BINARY)
206
+ @mkdir -p $(OBJECT)
207
+ endif
208
+ $(CC) $(BUILD_FLAGS) $(LIBS) -c $< -o $@
209
+ # General Auto-Dependencies for debug
210
+ # $(OBJECT)/%_debug.o : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS)
211
+ #
212
+ $(OBJECT)/%_debug.o : $(SOURCE)/%.c
213
+ @echo "║ 🐛 🛠 Compiling... $(@)"
214
+ ifeq '$(OS)' 'Windows_NT'
215
+ @test -d $(BINARY) || mkdir $(BINARY)
216
+ @test -d $(OBJECT) || mkdir $(OBJECT)
217
+ else
218
+ @mkdir -p $(BINARY)
219
+ @mkdir -p $(OBJECT)
220
+ endif
221
+ $(CC) $(BUILD_FLAGS) $(LIBS) -c $< -o $@
222
+
223
+ .PHONY : clean
224
+ clean :
225
+ @echo "🔥 Removed everything from $(OBJECT), $(BINARY), and $(LIBRARY) directories"
226
+ @rm -rf $(OBJECT) $(BINARY) $(LIBRARY)
227
+
228
+ .PHONY : debug
229
+ debug : LICENSE
230
+ @echo "╔═════════════════════════════════════════════════════════════════════════╗"
231
+ @echo "║ 🐛 🚧 Building executable: bin/oreo_debug ║"
232
+ @echo "╚═════════════════════════════════════════════════════════════════════════╝"
233
+ @$(MAKE) $(BINARY)/oreo_debug
234
+
235
+ test : LICENSE build
236
+ @echo -n "❓ Running tests:"
237
+ @echo
238
+ @echo "Basic functional testing of command oreo:"
239
+ bin/oreo Test 1
240
+ echo -n "Test 2" | bin/oreo
241
+ echo -n "Test 3" | bin/oreo Test 4
242
+ bin/oreo oreo_test.txt
243
+
244
+ .PHONY : install
245
+ install : LICENSE
246
+ @echo "🔩 Starting install..."
247
+ @test -d $(PREFIX) | install -d $(PREFIX)
248
+ @test -f bin/oreo && install -v -m 755 bin/oreo $(PREFIX) || \
249
+ (echo "Executable file bin/oreo not found."; \
250
+ echo "Please type 'make build' first, if you wish to install.")
251
+ @echo "🔩 ✔ Installation Finished"
252
+
253
+ .PHONY : uninstall
254
+ uninstall :
255
+ @echo "🔧 Starting uninstall..."
256
+ rm -f $(PREFIX)oreo
257
+ ifneq '$(OS)' 'FreeBSD'
258
+ rmdir --ignore-fail-on-non-empty $(PREFIX)
259
+ endif
260
+ @echo "🔧 ✔ Uninstall Finished"
File without changes
@@ -0,0 +1 @@
1
+ Create a different sample application
File without changes
@@ -1,25 +1,25 @@
1
1
  # Uncomment to use / override
2
- # # Default Setting | none = ""
3
- #@silent = true # false
4
- #@strip = false # true
2
+ # # Default Setting | none = ""
3
+ #@silent = true # false
4
+ #@strip = false # true
5
5
  #@debug_enabled = false # true
6
- #@compiler = "clang" # "gcc"
7
- #@num_threads = 16 # 8
8
- #@prefix = "/usr/local/bin64/" # "/usr/local/bin/"
9
- #@library_prefix = "/usr/local/lib64/" # "/usr/local/lib/"
6
+ #@compiler = "clang" # "gcc"
7
+ #@num_threads = 16 # 8
8
+ #@prefix = "/usr/local/bin64/" # "/usr/local/bin/"
9
+ #@library_prefix = "/usr/local/lib64/" # "/usr/local/lib/"
10
10
  #
11
11
  # ** demake never makes changes **
12
12
  #
13
- #@source_directory = "source" # "src"
13
+ #@source_directory = "source" # "src"
14
14
  #
15
15
  # ** make clean deletes all files in these directories **
16
16
  #
17
- #@binary_directory = "binary" # "bin"
18
- #@library_directory = "library" # "lib"
19
- #@object_directory = "object" # "obj"
17
+ #@binary_directory = "binary" # "bin"
18
+ #@library_directory = "library" # "lib"
19
+ #@object_directory = "object" # "obj"
20
20
  #
21
- #@emojis = false # true
22
- #@replace_with = "|b*|n" # "|mo|n"
21
+ #@emojis = false # true
22
+ #@replace_with = "|b*|n" # "|mo|n"
23
23
  # Both compiler & linker
24
24
  @flags = "-ansi -pedantic -D_POSIX_C_SOURCE=200809L"
25
25
  @optimize_flags = "-O2"
@@ -0,0 +1 @@
1
+ cd oreo ; make ; make build ; make test
File without changes
@@ -0,0 +1,29 @@
1
+ /*
2
+ defines.h -- Basic C preprocessor macro definitions
3
+ */
4
+
5
+ #ifndef DEFINES_H_Minaswan /* Header guard to prevent multiple inclusions */
6
+ #define DEFINES_H_Minaswan
7
+ #define DEFINES_VERSION "0.1.0"
8
+ #ifndef NULL
9
+ #define NULL ((void *) 0)
10
+ #endif
11
+ #ifndef FALSE
12
+ #define FALSE 0
13
+ #endif
14
+ #ifndef TRUE
15
+ #define TRUE 1
16
+ #endif
17
+ #ifndef NO
18
+ #define NO 0
19
+ #endif
20
+ #ifndef YES
21
+ #define YES 1
22
+ #endif
23
+ #ifndef OFF
24
+ #define OFF 0
25
+ #endif
26
+ #ifndef ON
27
+ #define ON 1
28
+ #endif
29
+ #endif /* DEFINES_H_Minaswan */
@@ -16,33 +16,33 @@
16
16
 
17
17
  */
18
18
 
19
- #ifndef FAST_READ_FILE_H_Minaswan /* Prevent multiple inclusions */
19
+ #ifndef FAST_READ_FILE_H_Minaswan /* Prevent multiple inclusions */
20
20
  #define FAST_READ_FILE_H_Minaswan
21
- #define FAST_READ_FILE_VERSION "0.1.0"
22
- #ifndef TYPEDEFS_H_Minaswan /* Header guard for typedefs.h */
21
+ #define FAST_READ_FILE_VERSION "0.1.0"
22
+ #ifndef TYPEDEFS_H_Minaswan /* Header guard for typedefs.h */
23
23
  #define TYPEDEFS_H_Minaswan
24
24
  #include <stdint.h>
25
- typedef uint8_t b8; /* Booleans */
25
+ typedef uint8_t b8; /* Booleans */
26
26
  typedef uint16_t b16;
27
27
  typedef uint32_t b32;
28
28
  typedef uint64_t b64;
29
29
 
30
- typedef char c8; /* Characters */
30
+ typedef char c8; /* Characters */
31
31
  typedef unsigned char uc8;
32
32
 
33
- typedef uint8_t u8; /* Unsigned Numbers */
33
+ typedef uint8_t u8; /* Unsigned Numbers */
34
34
  typedef uint16_t u16;
35
35
  typedef uint32_t u32;
36
36
  typedef uint64_t u64;
37
37
 
38
- typedef int8_t i8; /* Signed Numbers */
38
+ typedef int8_t i8; /* Signed Numbers */
39
39
  typedef int16_t i16;
40
40
  typedef int32_t i32;
41
41
  typedef int64_t i64;
42
42
 
43
- typedef float f32; /* Floating Point Numbers */
43
+ typedef float f32; /* Floating Point Numbers */
44
44
  typedef double f64;
45
- #endif /* TYPEDEFS_H_Minaswan */
45
+ #endif /* TYPEDEFS_H_Minaswan */
46
46
 
47
47
  #include <stdio.h>
48
48
 
@@ -52,7 +52,7 @@
52
52
  c8 *fast_read_all_file_mapped(FILE *file, u64 *total_bytes);
53
53
  c8 *fast_read_all_file_aligned(FILE *file, u64 *total_bytes);
54
54
 
55
- #ifdef FAST_READ_FILE_IMPLEMENTATION /* Effectively read_all_file.c */
55
+ #ifdef FAST_READ_FILE_IMPLEMENTATION /* Effectively read_all_file.c */
56
56
  #include <stdlib.h>
57
57
  #include <string.h>
58
58
  #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
@@ -66,22 +66,22 @@
66
66
 
67
67
  extern i32 fileno(FILE *stream);
68
68
 
69
- #define FAST_READ_FILE_BUFFER_SIZE 4096
69
+ #define FAST_READ_FILE_BUFFER_SIZE 4096
70
70
 
71
71
  #ifndef FALSE
72
- #define FALSE 0
72
+ #define FALSE 0
73
73
  #endif
74
74
 
75
75
  #ifndef TRUE
76
- #define TRUE 1
76
+ #define TRUE 1
77
77
  #endif
78
78
 
79
79
  #ifndef NULL
80
- #define NULL ((void *) 0)
80
+ #define NULL ((void *) 0)
81
81
  #endif
82
82
 
83
83
  #ifndef MIN
84
- #define MIN(a, b) ((a) < (b) ? a : b)
84
+ #define MIN(a, b) ((a) < (b) ? a : b)
85
85
  #endif
86
86
 
87
87
  void *fast_file_align64_malloc(size_t size)
@@ -241,19 +241,19 @@
241
241
  u64 total_bytes = 0;
242
242
  c8 *data = fast_read_all_file_mapped(file, &total_bytes);
243
243
  use(string);
244
- free_all_mapped_read_memory(string); // Note: Doesn't use malloc/free
244
+ free_all_mapped_read_memory(string); // Note: Doesn't use malloc/free
245
245
 
246
246
  // Read everything from stdin / non-kernal mapping example:
247
247
 
248
248
  u64 total_bytes = 0;
249
249
  c8 *data = fast_read_all_file_aligned(stdin, &total_bytes);
250
250
  use(string);
251
- free_all_aligned_read_memory(string); // Note: Might not use malloc/free
251
+ free_all_aligned_read_memory(string); // Note: Might not use malloc/free
252
252
 
253
253
  FILE *file = fopen(argv[1], "rb");
254
254
  u64 total_bytes = 0;
255
255
  c8 *data = fast_read_all_file_aligned(file, &total_bytes);
256
256
  use(string);
257
- free_all_aligned_read_memory(string); // Note: Might not use malloc/free
257
+ free_all_aligned_read_memory(string); // Note: Might not use malloc/free
258
258
 
259
259
  */
@@ -68,13 +68,13 @@ i32 main(i32 argc, c8 **argv)
68
68
  for(n = 1; n < argc; n++) {
69
69
  if(string != NULL) {
70
70
  l = (u32)strlen(argv[n]);
71
- total_bytes += l + 1; /* +1 for space */
72
- string = realloc(string, (size_t)total_bytes + 1); /* +1 for \0 */
73
- strncat((c8 *)string, " ", (size_t)2); /* 2 for space and \0 */
71
+ total_bytes += l + 1; /* +1 for space */
72
+ string = realloc(string, (size_t)total_bytes + 1); /* +1 for \0 */
73
+ strncat((c8 *)string, " ", (size_t)2); /* 2 for space and \0 */
74
74
  strncat((c8 *)string, argv[n], l);
75
75
  } else {
76
76
  total_bytes = (u32)strlen(argv[n]);
77
- string = calloc(total_bytes + 1, sizeof(c8)); /* +1 for \0 */
77
+ string = calloc(total_bytes + 1, sizeof(c8)); /* +1 for \0 */
78
78
  strncpy((c8 *)string, argv[n], total_bytes);
79
79
  }
80
80
  }
@@ -10,32 +10,32 @@
10
10
 
11
11
  */
12
12
 
13
- #ifndef TYPEDEFS_H_Minaswan /* Prevents multiple inclusions */
13
+ #ifndef TYPEDEFS_H_Minaswan /* Prevents multiple inclusions */
14
14
  #define TYPEDEFS_H_Minaswan
15
- #define TYPEDEFS_VERSION "0.1.0"
15
+ #define TYPEDEFS_VERSION "0.1.0"
16
16
  #include <stdint.h>
17
17
 
18
- typedef uint8_t b8; /* Booleans */
18
+ typedef uint8_t b8; /* Booleans */
19
19
  typedef uint16_t b16;
20
20
  typedef uint32_t b32;
21
21
  typedef uint64_t b64;
22
22
 
23
- typedef char c8; /* Characters */
23
+ typedef char c8; /* Characters */
24
24
  typedef unsigned char uc8;
25
25
 
26
- typedef uint8_t u8; /* Unsigned Numbers */
26
+ typedef uint8_t u8; /* Unsigned Numbers */
27
27
  typedef uint16_t u16;
28
28
  typedef uint32_t u32;
29
29
  typedef uint64_t u64;
30
30
 
31
- typedef int8_t i8; /* Signed Numbers */
31
+ typedef int8_t i8; /* Signed Numbers */
32
32
  typedef int16_t i16;
33
33
  typedef int32_t i32;
34
34
  typedef int64_t i64;
35
35
 
36
- typedef float f32; /* Floating Point Numbers */
36
+ typedef float f32; /* Floating Point Numbers */
37
37
  typedef double f64;
38
- #endif /* TYPEDEFS_H_Minaswan */
38
+ #endif /* TYPEDEFS_H_Minaswan */
39
39
 
40
40
  /*
41
41
 
@@ -0,0 +1,33 @@
1
+ /*
2
+
3
+ auto_bits.h -- *Full Library* Header File
4
+
5
+ For auto bits
6
+
7
+ See the end of this file for an example.
8
+
9
+ Public Functions:
10
+
11
+ */
12
+
13
+ #ifndef AUTO_BITS_H_Minaswan /* Prevent multiple inclusions */
14
+ #define AUTO_BITS_H_Minaswan
15
+ #ifndef TYPEDEFS_H_Minaswan /* Header guard for typedefs.h */
16
+ #define TYPEDEFS_H_Minaswan
17
+
18
+ #endif /* TYPEDEFS_H_Minaswan */
19
+
20
+ /* Public Functions */
21
+
22
+ #ifdef AUTO_BITS_IMPLEMENTATION
23
+
24
+ #endif /* AUTO_BITS_IMPLEMENTATION */
25
+ #endif /* AUTO_BITS_H_Minaswan */
26
+
27
+ /*
28
+ Example:
29
+
30
+ #define AUTO_BITS_IMPLEMENTATION
31
+ #include "auto_bits.h"
32
+
33
+ */
@@ -0,0 +1,10 @@
1
+ /*
2
+ base.h -- Light weight C Environment Setup
3
+ */
4
+
5
+ #ifndef BASE_H_Minaswan /* Header guard to prevent multiple inclusions */
6
+ #define BASE_H_Minaswan
7
+ #define BASE_VERSION "0.1.0"
8
+ #include "defines.h"
9
+ #include "typedefs.h"
10
+ #endif /* BASE_H_Minaswan */