Skip to content

Commit 34efb17

Browse files
committed
chore: initial commit
1 parent 248d3a4 commit 34efb17

24 files changed

+1060
-0
lines changed

.clang-format

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
BasedOnStyle: Google
3+
ColumnLimit: 100
4+
IndentWidth: 4

.github/workflows/format-code.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Format code'
2+
3+
on:
4+
push:
5+
branches:
6+
- Master
7+
paths:
8+
- '**.c'
9+
- '**.h'
10+
11+
jobs:
12+
clang-format:
13+
name: Format code
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Install clang-format (formatter tool)
20+
run: sudo apt-get install clang-format
21+
22+
- name: Run clang-format
23+
run: find . -name '*.c' -o -name '*.h' | xargs clang-format -i -style=file
24+
25+
- name: Commit changes
26+
run: |
27+
git config --global user.name 'github-actions[bot]'
28+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
29+
git add .
30+
git diff-index --quiet HEAD || git commit -m "ci: format code"
31+
32+
- name: Push changes
33+
uses: ad-m/github-push-action@v0.8.0
34+
with:
35+
branch: ${{ github.ref }}
36+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
# ---------------------------------------------------------------------------- #
3+
# PERSONAL FILES #
4+
# ---------------------------------------------------------------------------- #
5+
6+
personal-*.md
7+
8+
9+
10+
# ---------------------------------------------------------------------------- #
11+
# CODEBLOCKS #
12+
# ---------------------------------------------------------------------------- #
13+
14+
# specific to CodeBlocks IDE
15+
*.layout
16+
*.depend
17+
18+
# generated directories
19+
bin/
20+
obj/
21+
22+
23+
24+
# ---------------------------------------------------------------------------- #
25+
# C #
26+
# ---------------------------------------------------------------------------- #
27+
28+
# Prerequisites
29+
*.d
30+
31+
# Object files
32+
*.o
33+
*.ko
34+
*.obj
35+
*.elf
36+
37+
# Linker output
38+
*.dat
39+
*.ilk
40+
*.map
41+
*.exp
42+
43+
# Precompiled Headers
44+
*.gch
45+
*.pch
46+
47+
# Libraries
48+
*.lib
49+
*.a
50+
*.la
51+
*.lo
52+
53+
# Shared objects (inc. Windows DLLs)
54+
*.so
55+
*.so.*
56+
*.dylib
57+
58+
# Executables
59+
*.exe
60+
*.out
61+
*.app
62+
*.i*86
63+
*.x86_64
64+
*.hex
65+
66+
# Debug files
67+
*.dSYM/
68+
*.su
69+
*.idb
70+
*.pdb
71+
72+
# Kernel Module Compile Results
73+
*.mod*
74+
*.cmd
75+
.tmp_versions/
76+
modules.order
77+
Module.symvers
78+
Mkfile.old
79+
dkms.conf

.vscode/c_cpp_properties.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Win32",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"defines": [
9+
"_DEBUG",
10+
"UNICODE",
11+
"_UNICODE"
12+
],
13+
"compilerPath": "C:/TDM-GCC-64/bin/gcc.exe",
14+
"cStandard": "c17",
15+
"cppStandard": "c++17",
16+
"intelliSenseMode": "windows-gcc-x86"
17+
}
18+
],
19+
"version": 4
20+
}

.vscode/documentation.code-snippets

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"Document struct": {
3+
"scope": "c,cpp",
4+
"prefix": "docStruct",
5+
"body": [
6+
"/**",
7+
" * @struct ${1:<STRUCTURE NAME>}.",
8+
" * @brief ${2:<BRIEF DESCRIPTION OF WHAT THE STRUCTURE REPRESENTS>}.",
9+
" * ",
10+
" * ${3:<DETAILED DESCRIPTION OF THE STRUCTURE (PURPOSE, AND LISTS OF FIELDS)>}.",
11+
" */"
12+
]
13+
},
14+
"Document function": {
15+
"scope": "c,cpp",
16+
"prefix": "docFunction",
17+
"body": [
18+
"/**",
19+
" * @brief ${1:<BRIEF DESCRIPTION OF THE FUNCTION>}.",
20+
" * ",
21+
" * ${2:<DETAILED DESCRIPTION OF THE FUNCTION (WHAT IT DOES, HOW IT WORKS, AND ANY IMPORTANT INFORMATION)>}.",
22+
" * ",
23+
" * @param ${3:param01} ${4:<BRIEF DESCRIPTION OF `param01` PARAMETER>}.",
24+
" * ",
25+
" * @return ${5:<BRIEF DESCRIPTION OF THE FUNCTION'S RETURN VALUE>}.",
26+
" * ",
27+
" * @warning ${6:<RELEVANT INFORMATION ABOUT SIDE EFFECTS OR IMPORTANT CONSIDERATIONS (OPTIONAL)>}.",
28+
" */"
29+
]
30+
},
31+
"Document macro": {
32+
"scope": "c,cpp",
33+
"prefix": "docMacro",
34+
"body": [
35+
"/**",
36+
" * @def ${1:<MACRO NAME>}",
37+
" * @brief ${2:<BRIEF DESCRIPTION OF WHAT THE MACRO DOES>}.",
38+
" * ",
39+
" * @warning ${3:<WARNINGS ABOUT THE USE OF THE MACRO (OPTIONAL)>}.",
40+
" */"
41+
]
42+
}
43+
}

.vscode/extensions.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"recommendations": [
3+
"bierner.markdown-checkbox",
4+
"bierner.markdown-emoji",
5+
"bierner.markdown-mermaid",
6+
"bierner.markdown-preview-github-styles",
7+
"ms-vscode.cpptools",
8+
"streetsidesoftware.code-spell-checker-spanish",
9+
"streetsidesoftware.code-spell-checker",
10+
"aaron-bond.better-comments",
11+
"bierner.markdown-footnotes",
12+
"tldraw-org.tldraw-vscode"
13+
]
14+
}

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"C_Cpp.autocompleteAddParentheses": true,
3+
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4 }",
4+
"C_Cpp.clang_format_style": "file",
5+
"C_Cpp.doxygen.generatedStyle": "/**",
6+
"cSpell.caseSensitive": true,
7+
"cSpell.language": "en,es-ES,es,en-GB,en-US,lorem",
8+
"diffEditor.ignoreTrimWhitespace": true,
9+
"editor.formatOnSave": true,
10+
"editor.minimap.renderCharacters": false,
11+
"emojisense.unicodeCompletionsEnabled": false,
12+
"files.associations": {"*.c": "c", "*.h": "c"},
13+
"files.trimTrailingWhitespace": true,
14+
"markdown-preview-github-styles.colorTheme": "dark",
15+
"terminal.integrated.defaultProfile.windows": "Command Prompt",
16+
"workbench.startupEditor": "none"
17+
}

.vscode/tasks.json

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"tasks": [
3+
{
4+
"command": [
5+
"(if exist \"${workspaceFolder}\\libs\\obj\" rmdir /s /q \"${workspaceFolder}\\libs\\obj\")",
6+
"& (mkdir \"${workspaceFolder}\\libs\\obj\\Release\")",
7+
"& (if exist \"${workspaceFolder}\\libs\\bin\" rmdir /s /q \"${workspaceFolder}\\libs\\bin\")",
8+
"& (mkdir \"${workspaceFolder}\\libs\\bin\\Release\")"
9+
],
10+
"group": {"kind": "build", "isDefault": false},
11+
"label": "Create `\\libs\\obj\\Release` and `\\libs\\bin\\Release` folders",
12+
"type": "shell"
13+
},
14+
{
15+
"command": [
16+
"(gcc -Wall -O2 -pedantic-errors -c \"${workspaceFolder}\\libs\\utilities.c\" -o \"${workspaceFolder}\\libs\\obj\\Release\\utilities.o\")",
17+
"& (ar -r -s \"${workspaceFolder}\\libs\\bin\\Release\\libs.a\" \"${workspaceFolder}\\libs\\obj\\Release\\utilities.o\")"
18+
],
19+
"group": {"kind": "build", "isDefault": false},
20+
"label": "Compile libs project",
21+
"type": "shell",
22+
"dependsOn": "Create `\\libs\\obj\\Release` and `\\libs\\bin\\Release` folders"
23+
},
24+
{
25+
"command": [
26+
"(if exist \"${workspaceFolder}\\src\\obj\" rmdir /s /q \"${workspaceFolder}\\src\\obj\")",
27+
"& (mkdir \"${workspaceFolder}\\src\\obj\\Release\")",
28+
"& (if exist \"${workspaceFolder}\\src\\bin\" rmdir /s /q \"${workspaceFolder}\\src\\bin\")",
29+
"& (mkdir \"${workspaceFolder}\\src\\bin\\Release\")"
30+
],
31+
"group": {"kind": "build", "isDefault": false},
32+
"label": "Create `\\src\\obj\\Release` and `\\src\\bin\\Release` folders",
33+
"type": "shell"
34+
},
35+
{
36+
"args": [
37+
"-fdiagnostics-color=always",
38+
"-g",
39+
"${workspaceFolder}\\src\\*.c",
40+
"-o",
41+
"${workspaceFolder}\\src\\bin\\Release\\src.exe",
42+
"-s",
43+
"${workspaceFolder}\\libs\\bin\\Release\\libs.a"
44+
],
45+
"command": "gcc",
46+
"dependsOn": ["Compile libs project", "Create `\\src\\obj\\Release` and `\\src\\bin\\Release` folders"],
47+
"group": {"kind": "build", "isDefault": true},
48+
"label": "C/C++: gcc.exe build active file",
49+
"problemMatcher": ["$gcc"],
50+
"type": "cppbuild"
51+
}
52+
],
53+
"version": "2.0.0"
54+
}

0 commit comments

Comments
 (0)