From: Mike D. Lowis Date: Tue, 22 Sep 2015 13:18:37 +0000 (-0400) Subject: Rename library from libc to carl to avoid interfering with the system's C standard lib X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=14c8bd9f1848271f5ab327d92acf9d408349db7a;p=archive%2Fcarl.git Rename library from libc to carl to avoid interfering with the system's C standard lib --- diff --git a/source/libc.h b/source/carl.h similarity index 99% rename from source/libc.h rename to source/carl.h index 6fc20cd..a11621c 100644 --- a/source/libc.h +++ b/source/carl.h @@ -1,8 +1,8 @@ /** - @file libc.h + @file carl.h */ -#ifndef LIBC_H -#define LIBC_H +#ifndef CARL_H +#define CARL_H /* * Base Types and Definitions @@ -423,4 +423,4 @@ Rune totitlerune(Rune ch); #endif int user_main(int, char**); -#endif /* LIBC_H */ +#endif /* CARL_H */ diff --git a/source/data/bstree.h b/source/data/bstree.h index b44ac94..0c029ce 100644 --- a/source/data/bstree.h +++ b/source/data/bstree.h @@ -4,7 +4,7 @@ #ifndef BSTREE_H #define BSTREE_H -#include +#include typedef struct bstree_node_t { struct bstree_node_t* left; diff --git a/source/data/list.h b/source/data/list.h index b6b413f..6615891 100644 --- a/source/data/list.h +++ b/source/data/list.h @@ -4,7 +4,7 @@ #ifndef LIST_H #define LIST_H -#include +#include typedef struct list_node_t { struct list_node_t* next; diff --git a/source/data/slist.h b/source/data/slist.h index 28c6a31..19cbfd3 100644 --- a/source/data/slist.h +++ b/source/data/slist.h @@ -4,7 +4,7 @@ #ifndef SLIST_H #define SLIST_H -#include +#include typedef struct slist_node_t { struct slist_node_t* next; diff --git a/source/data/vec.h b/source/data/vec.h index ed92515..ce4a123 100644 --- a/source/data/vec.h +++ b/source/data/vec.h @@ -4,7 +4,7 @@ #ifndef VEC_H #define VEC_H -#include +#include typedef struct { size_t elem_count; diff --git a/source/main.c b/source/main.c index bf53ea5..a2f35df 100644 --- a/source/main.c +++ b/source/main.c @@ -1,5 +1,5 @@ #define NO_MAIN_WRAPPER -#include "libc.h" +#include int main(int argc, char** argv) { return user_main(argc, argv); diff --git a/source/refcount.c b/source/refcount.c index d665600..80ec27f 100644 --- a/source/refcount.c +++ b/source/refcount.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include typedef struct obj_t { uintptr_t refcount; diff --git a/source/utf/alphas.c b/source/utf/alphas.c index 052f72f..2befd89 100644 --- a/source/utf/alphas.c +++ b/source/utf/alphas.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[128] = { 0xaa, diff --git a/source/utf/chartorune.c b/source/utf/chartorune.c index db0ea93..38fd7e7 100644 --- a/source/utf/chartorune.c +++ b/source/utf/chartorune.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include int chartorune(Rune* r, char* s) { diff --git a/source/utf/controls.c b/source/utf/controls.c index c13c3cd..33fae2d 100644 --- a/source/utf/controls.c +++ b/source/utf/controls.c @@ -1,4 +1,4 @@ -#include +#include static Rune ranges[4][2] = { { 0x0, 0x8 }, diff --git a/source/utf/digits.c b/source/utf/digits.c index 0c3c594..ea1df48 100644 --- a/source/utf/digits.c +++ b/source/utf/digits.c @@ -1,4 +1,4 @@ -#include +#include static Rune ranges[51][2] = { { 0x30, 0x39 }, diff --git a/source/utf/fullrune.c b/source/utf/fullrune.c index f3b8063..36bab12 100644 --- a/source/utf/fullrune.c +++ b/source/utf/fullrune.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include bool fullrune(char* s, int n) { diff --git a/source/utf/lowers.c b/source/utf/lowers.c index 2763173..00cf736 100644 --- a/source/utf/lowers.c +++ b/source/utf/lowers.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[532] = { 0xb5, diff --git a/source/utf/marks.c b/source/utf/marks.c index 83dcc2e..3101b7d 100644 --- a/source/utf/marks.c +++ b/source/utf/marks.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[45] = { 0x5bf, diff --git a/source/utf/numbers.c b/source/utf/numbers.c index 707924e..1f02213 100644 --- a/source/utf/numbers.c +++ b/source/utf/numbers.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[6] = { 0xb9, diff --git a/source/utf/other.c b/source/utf/other.c index e6de8bf..483b46c 100644 --- a/source/utf/other.c +++ b/source/utf/other.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[14] = { 0xad, diff --git a/source/utf/otherletters.c b/source/utf/otherletters.c index f46e9a7..3f65ac2 100644 --- a/source/utf/otherletters.c +++ b/source/utf/otherletters.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[116] = { 0xaa, diff --git a/source/utf/punctuation.c b/source/utf/punctuation.c index c6c601f..e74a546 100644 --- a/source/utf/punctuation.c +++ b/source/utf/punctuation.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[55] = { 0x5f, diff --git a/source/utf/runeinrange.c b/source/utf/runeinrange.c index 7309a3c..afef8fc 100644 --- a/source/utf/runeinrange.c +++ b/source/utf/runeinrange.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include /* Used by rune type checking functions to find the rune in the type tables */ int runeinrange(const void* a, const void* b) { diff --git a/source/utf/runelen.c b/source/utf/runelen.c index 1e0c102..30daf49 100644 --- a/source/utf/runelen.c +++ b/source/utf/runelen.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include int runelen(long r) { diff --git a/source/utf/runenlen.c b/source/utf/runenlen.c index 326d329..ad95673 100644 --- a/source/utf/runenlen.c +++ b/source/utf/runenlen.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include int runenlen(Rune* r, int num) { diff --git a/source/utf/runetochar.c b/source/utf/runetochar.c index faca3f2..2219ebe 100644 --- a/source/utf/runetochar.c +++ b/source/utf/runetochar.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include int runetochar(char* s, Rune* r) { diff --git a/source/utf/runetype.c b/source/utf/runetype.c index 56dd4ee..16bfb71 100644 --- a/source/utf/runetype.c +++ b/source/utf/runetype.c @@ -1,4 +1,4 @@ -#include "libc.h" +#include bool isalnumrune(Rune ch) { diff --git a/source/utf/spaces.c b/source/utf/spaces.c index 37a9539..ef76084 100644 --- a/source/utf/spaces.c +++ b/source/utf/spaces.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[6] = { 0x85, diff --git a/source/utf/symbols.c b/source/utf/symbols.c index e994b78..91e244b 100644 --- a/source/utf/symbols.c +++ b/source/utf/symbols.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[70] = { 0x24, diff --git a/source/utf/titles.c b/source/utf/titles.c index 50d5582..ed43eff 100644 --- a/source/utf/titles.c +++ b/source/utf/titles.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[7] = { 0x1c5, diff --git a/source/utf/tolower.c b/source/utf/tolower.c index 767294b..d2052a0 100644 --- a/source/utf/tolower.c +++ b/source/utf/tolower.c @@ -1,4 +1,4 @@ -#include +#include static Rune mappings[1233][2] = { { 0x41, 0x61 }, diff --git a/source/utf/totitle.c b/source/utf/totitle.c index 023dc7f..d6831d5 100644 --- a/source/utf/totitle.c +++ b/source/utf/totitle.c @@ -1,4 +1,4 @@ -#include +#include static Rune mappings[1245][2] = { { 0x61, 0x41 }, diff --git a/source/utf/toupper.c b/source/utf/toupper.c index 39dec20..e785b40 100644 --- a/source/utf/toupper.c +++ b/source/utf/toupper.c @@ -1,4 +1,4 @@ -#include +#include static Rune mappings[1241][2] = { { 0x61, 0x41 }, diff --git a/source/utf/uppers.c b/source/utf/uppers.c index d1aa75d..66fae33 100644 --- a/source/utf/uppers.c +++ b/source/utf/uppers.c @@ -1,4 +1,4 @@ -#include +#include static Rune singles[539] = { 0x100, diff --git a/tests/main.c b/tests/main.c index 13a9fb0..15ae8f2 100644 --- a/tests/main.c +++ b/tests/main.c @@ -1,5 +1,5 @@ #include "atf.h" -#include "libc.h" +#include int main(int argc, char** argv) { diff --git a/tests/refcount.c b/tests/refcount.c index 9d82c4f..3eb6e41 100644 --- a/tests/refcount.c +++ b/tests/refcount.c @@ -2,7 +2,7 @@ #include "atf.h" // File To Test -#include "libc.h" +#include //----------------------------------------------------------------------------- // Begin Unit Tests diff --git a/tools/unicode.rb b/tools/unicode.rb index 5aea81c..4ddfb59 100755 --- a/tools/unicode.rb +++ b/tools/unicode.rb @@ -112,7 +112,7 @@ def generate_type_tables(type) ranges, singles = $types[type].partition {|e| e.kind_of? Array } puts "Generating #{ARGV[1]}/#{type.to_s}.c" File.open("#{ARGV[1]}/#{type.to_s}.c", "w") do |f| - f.puts("#include \n\n") + f.puts("#include \n\n") table = singles.map{|e| "0x#{e.value.to_s(16)}" }.join(",\n ") f.print("static Rune singles[#{singles.length}] = {\n #{table}\n};\n\n") if singles.length > 0 table = ranges.map{|r| "{ 0x#{r.first.value.to_s(16)}, 0x#{r.last.value.to_s(16)} }" }.join(",\n ") @@ -135,7 +135,7 @@ def generate_to_table(type) mappings = $types[:all].select{|e| e[type] > 0 } puts "Generating #{ARGV[1]}/#{type.to_s}.c" File.open("#{ARGV[1]}/#{type.to_s}.c", "w") do |f| - f.print "#include \n\n" + f.print "#include \n\n" f.print "static Rune mappings[#{mappings.length}][2] = {\n" mappings.each do |e| f.print " { 0x#{e.value.to_s(16)}, 0x#{e[type].to_s(16)} },\n"