Remove C infrastructure

This commit is contained in:
Wilson Lin 2019-12-15 19:48:44 +11:00
parent 1fb675ef91
commit 2f24d2e618
65 changed files with 1 additions and 2667 deletions

View File

@ -1,24 +0,0 @@
# Linux kernel style
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Linux
BreakStringLiterals: false
ContinuationIndentWidth: 8
IndentCaseLabels: false
MaxEmptyLinesToKeep: 2
# Custom
DerivePointerAlignment: false
PointerAlignment: Left
SpaceAfterCStyleCast: true
SortIncludes: true

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/out/
/docs/
/cmake-build-*
/Cargo.lock

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "ext/nicehash"]
path = ext/nicehash
url = https://github.com/wilsonzlin/nicehash.git

View File

@ -1,79 +0,0 @@
cmake_minimum_required(VERSION 3.13)
project(hyperbuild C)
set(CMAKE_C_STANDARD 11)
include_directories(src lib)
add_library(nicehash
lib/nicehash/bitfield-ascii.c
lib/nicehash/list-char.c
lib/nicehash/list-list-char.c
lib/nicehash/list-uchar.c
lib/nicehash/set-int32.c
lib/nicehash/set-int64.c
lib/nicehash/set-str.c
lib/nicehash/set-view-str.c
lib/nicehash/view-str.c)
add_library(hyperbuild
src/hb/cfg.c
src/hb/collection.c
src/hb/err.c
src/hb/hyperbuild.c
src/hb/proc/accept.c
src/hb/proc/bounds.c
src/hb/proc/error.c
src/hb/proc/matches.c
src/hb/proc/peek.c
src/hb/proc/require.c
src/hb/proc/skip.c
src/hb/proc/view.c
src/hb/proc/write.c
src/hb/rule/ascii/control.c
src/hb/rule/ascii/digit.c
src/hb/rule/ascii/hex.c
src/hb/rule/ascii/lowercase.c
src/hb/rule/ascii/uppercase.c
src/hb/rule/ascii/whitespace.c
src/hb/rule/attr/name.c
src/hb/rule/attr/quote.c
src/hb/rule/attr/unquotedvalue.c
src/hb/rule/entity/reference.c
src/hb/rule/rule.c
src/hb/rule/tag/child/blacklist.c
src/hb/rule/tag/child/whitelist.c
src/hb/rule/tag/content.c
src/hb/rule/tag/contentfirst.c
src/hb/rule/tag/formatting.c
src/hb/rule/tag/heading.c
src/hb/rule/tag/html.c
src/hb/rule/tag/layout.c
src/hb/rule/tag/media.c
src/hb/rule/tag/name.c
src/hb/rule/tag/parent/blacklist.c
src/hb/rule/tag/parent/whitelist.c
src/hb/rule/tag/sectioning.c
src/hb/rule/tag/specific.c
src/hb/rule/tag/svg.c
src/hb/rule/tag/valid.c
src/hb/rule/tag/void.c
src/hb/rule/tag/wss.c
src/hb/unit/attr.c
src/hb/unit/attr/val.c
src/hb/unit/attr/val/quoted.c
src/hb/unit/attr/val/unquoted.c
src/hb/unit/bang.c
src/hb/unit/comment.c
src/hb/unit/content/html.c
src/hb/unit/content/script.c
src/hb/unit/content/style.c
src/hb/unit/entity.c
src/hb/unit/tag.c
src/hb/unit/tag/name.c)
target_link_libraries(hyperbuild nicehash)
add_executable(hyperbuild-test
test/hb/unit/attr/val/quoted.test.c)
target_link_libraries(hyperbuild-test hyperbuild)
target_include_directories(hyperbuild-test PRIVATE test)

2494
Doxyfile

File diff suppressed because it is too large Load Diff

@ -1 +0,0 @@
Subproject commit 22dc3c77560d19eea32c5b5b363d6fe1ae5e2fda

View File

@ -1 +0,0 @@
../ext/nicehash/src

View File

@ -1,43 +0,0 @@
#!/usr/bin/env bash
pushd "$(dirname "$0")" > /dev/null
rm -rf tmp
mkdir -p tmp
for f in $(find src/main/c -type f -name '*.c'); do
content="$(cat "$f")"
no_prefix="$(echo "$f" | sed -e 's%^src/main/c/%%')"
guard="$(echo "$no_prefix" | sed -e 's%\.c$%%' | tr '[a-z]' '[A-Z]' | tr '[/.\-]' '_')"
util_include="$([[ "$f" != src/main/c/util/* ]] && echo "#include <util/__main__.c>")"
rule_include="$([[ "$f" != src/main/c/util/* ]] && [[ "$f" != src/main/c/rule/* ]] && echo "#include <rule/__main__.c>")"
IFS='' read -r -d '' wrapped << EOF
#ifndef _HDR_HYPBERUILD_${guard}
#define _HDR_HYPBERUILD_${guard}
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <nicehash/set/int32.h>
#include <nicehash/set/int64.h>
#include <nicehash/set/str.h>
#include <nicehash/map/str.h>
${util_include}
${rule_include}
${content}
#endif // _HDR_HYPBERUILD_${guard}
EOF
dest="tmp/$no_prefix"
mkdir -p "$(dirname "$dest")"
echo "${wrapped}" > "tmp/$no_prefix"
done
popd > /dev/null
exit 0

0
src/unit/attr/val.c Normal file
View File

22
test.sh
View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
shopt -s globstar
pushd "$(dirname "$0")" > /dev/null
tmp_out="$(mktemp)"
fail_count=0
for test_file in ./test/**/*.c; do
gcc --std=c11 -Wall -Wextra -Werror -O0 -g -Ilib -Isrc -Itest -o "$tmp_out" "$test_file" lib/**/*.c src/**/*.c || exit 1
"$tmp_out"
res="$?"
if [[ $res != 0 ]]; then
fail_count=$((fail_count + 1))
fi;
done
if [[ $fail_count == 0 ]]; then
echo "All tests passed successfully"
fi
popd > /dev/null