ansi codes
This commit is contained in:
commit
53830c0d73
9
.clang-format
Normal file
9
.clang-format
Normal file
@ -0,0 +1,9 @@
|
||||
BasedOnStyle: Chromium
|
||||
IndentWidth: 2
|
||||
ColumnLimit: 160
|
||||
SpaceAfterCStyleCast: false
|
||||
UseTab: Never
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AlignTrailingComments: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
AlignConsecutiveMacros: Consecutive
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
build/*
|
||||
.vscode
|
||||
.cache
|
18
CMakeLists.txt
Normal file
18
CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
project(cex)
|
||||
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
|
||||
|
||||
file(GLOB_RECURSE SOURCES "${CMAKE_SOURCE_DIR}/src/*.c")
|
||||
add_library(cex ${SOURCES})
|
||||
target_include_directories(cex PUBLIC "${CMAKE_SOURCE_DIR}/inc")
|
||||
|
||||
file(GLOB_RECURSE TEST_SOURCES "${CMAKE_SOURCE_DIR}/test/src/*.c")
|
||||
add_executable(test ${TEST_SOURCES})
|
||||
target_include_directories(test PUBLIC "${CMAKE_SOURCE_DIR}/inc" "${CMAKE_SOURCE_DIR}/test/inc")
|
||||
target_link_libraries(test cex)
|
10
Readme.md
Normal file
10
Readme.md
Normal file
@ -0,0 +1,10 @@
|
||||
# CEX - C Extension
|
||||
## a utility library for c
|
||||
|
||||
## Features
|
||||
- containers `/containers/`
|
||||
- linked list `linked_list.h`
|
||||
- ANSI `ansi`
|
||||
- codes `codes.h`
|
||||
- testing `/test/`
|
||||
- assertions `assert.h`
|
103
inc/cex/ansi/codes.h
Normal file
103
inc/cex/ansi/codes.h
Normal file
@ -0,0 +1,103 @@
|
||||
#ifndef CEX_ANSI_CODES_H
|
||||
#define CEX_ANSI_CODES_H
|
||||
|
||||
#define ANSI_RESET "\033[0m"
|
||||
#define ANSI_RGB(r, g, b) #r ";" #g ";" #b "m"
|
||||
|
||||
#define ANSI_BELL "\u0007"
|
||||
#define ANSI_BACKSPACE "\u0008"
|
||||
#define ANSI_TAB "\u0009"
|
||||
#define ANSI_LINE_FEED "\u000A"
|
||||
#define ANSI_FORM_FEED "\u000C"
|
||||
#define ANSI_CARRIAGE_RETURN "\u000D"
|
||||
#define ANSI_ESCAPE "\u001B"
|
||||
|
||||
#define ANSI_BOLD "\033[1m"
|
||||
#define ANSI_FAINT "\033[2m"
|
||||
#define ANSI_ITALIC "\033[3m"
|
||||
#define ANSI_UNDERLINE "\033[4m"
|
||||
#define ANSI_SLOW_BLINK "\033[5m"
|
||||
#define ANSI_RAPID_BLINK "\033[6m"
|
||||
#define ANSI_INVERT "\033[7m"
|
||||
#define ANSI_HIDE "\033[8m"
|
||||
#define ANSI_STRIKE "\033[9m"
|
||||
#define ANSI_PRIMARY_FONT "\033[10m"
|
||||
|
||||
#define ANSI_FONT_1 "\033[11m"
|
||||
#define ANSI_FONT_2 "\033[12m"
|
||||
#define ANSI_FONT_3 "\033[13m"
|
||||
#define ANSI_FONT_4 "\033[14m"
|
||||
#define ANSI_FONT_5 "\033[15m"
|
||||
#define ANSI_FONT_6 "\033[16m"
|
||||
#define ANSI_FONT_7 "\033[17m"
|
||||
#define ANSI_FONT_8 "\033[18m"
|
||||
#define ANSI_FONT_9 "\033[19m"
|
||||
#define ANSI_FONT_10 "\033[20m"
|
||||
|
||||
#define ANSI_DOUBLE_UNDERLINE "\033[21m"
|
||||
#define ANSI_NORMAL "\033[22m"
|
||||
#define ANSI_NOT_ITALIC "\033[23m"
|
||||
#define ANSI_NOT_UNDEERLINED "\033[24m"
|
||||
#define ANSI_NOT_BLINKING "\033[25m"
|
||||
#define ANSI_PROPORTIONAL_SPACING "\033[26m"
|
||||
#define ANSI_NOT_INVERTED "\033[27m"
|
||||
#define ANSI_NOT_HIDDEN "\033[28m"
|
||||
#define ANSI_NO_STRIKE "\033[29m"
|
||||
|
||||
#define ANSI_FG_BLACK "\033[30m"
|
||||
#define ANSI_FG_RED "\033[31m"
|
||||
#define ANSI_FG_GREEN "\033[32m"
|
||||
#define ANSI_FG_YELLOW "\033[33m"
|
||||
#define ANSI_FG_BLUE "\033[34m"
|
||||
#define ANSI_FG_MAGENTA "\033[35m"
|
||||
#define ANSI_FG_CYAN "\033[36m"
|
||||
#define ANSI_FG_WHITE "\033[37m"
|
||||
#define ANSI_FG_COLOR_RGB "\033[38;2;"
|
||||
#define ANSI_FG_COLOR_DEFAULT "\033[39m"
|
||||
|
||||
#define ANSI_BG_BLACK "\033[40m"
|
||||
#define ANSI_BG_RED "\033[41m"
|
||||
#define ANSI_BG_GREEN "\033[42m"
|
||||
#define ANSI_BG_YELLOW "\033[43m"
|
||||
#define ANSI_BG_BLUE "\033[44m"
|
||||
#define ANSI_BG_MAGENTA "\033[45m"
|
||||
#define ANSI_BG_CYAN "\033[46m"
|
||||
#define ANSI_BG_COLOR_8 "\033[47m"
|
||||
#define ANSI_BG_COLOR_RGB "\033[48;2;"
|
||||
#define ANSI_BG_COLOR_DEFAULT "\033[49m"
|
||||
|
||||
#define ANSI_NO_PROPORTIONAL_SPACING "\033[50m"
|
||||
#define ANSI_FRAMED "\033[51m"
|
||||
#define ANSI_ENCIRCLED "\033[52m"
|
||||
#define ANSI_OVERLINED "\033[53m"
|
||||
#define ANSI_NO_FRAME_OR_CIRCLE "\033[53m"
|
||||
#define ANSI_NOT_OVERLINED "\033[53m"
|
||||
#define ANSI_UNDERLINE_COLOR_RGB "\033[58;2;"
|
||||
#define ANSI_UNDERLINE_COLOR_DEFAULT "\033[59m"
|
||||
#define ANSI_IDEOGRAM_UNDERLINE "\033[60m"
|
||||
#define ANSI_IDEOGRAM_DOUBLE_UNDERLINE "\033[61m"
|
||||
#define ANSI_IDEOGRAM_STRESS_MARKING "\033[61m"
|
||||
#define ANSI_IDEOGRAM_NOTHING "\033[61m"
|
||||
#define ANSI_SUPERSCRIPT "\033[61m"
|
||||
#define ANSI_SUBSCRIPT "\033[61m"
|
||||
#define ANSI_NOT_SUPER_OR_SUBSCRIPT "\033[61m"
|
||||
|
||||
#define ANSI_FG_GRAY "\033[90m"
|
||||
#define ANSI_FG_BRIGHT_RED "\033[91m"
|
||||
#define ANSI_FG_BRIGHT_GREEN "\033[92m"
|
||||
#define ANSI_FG_BRIGHT_YELLOW "\033[93m"
|
||||
#define ANSI_FG_BRIGHT_BLUE "\033[94m"
|
||||
#define ANSI_FG_BRIGHT_MAGENTA "\033[95m"
|
||||
#define ANSI_FG_BRIGHT_CYAN "\033[96m"
|
||||
#define ANSI_FG_BRIGHT_WHITE "\033[97m"
|
||||
|
||||
#define ANSI_BG_GRAY "\033[100m"
|
||||
#define ANSI_BG_BRIGHT_RED "\033[101m"
|
||||
#define ANSI_BG_BRIGHT_GREEN "\033[102m"
|
||||
#define ANSI_BG_BRIGHT_YELLOW "\033[103m"
|
||||
#define ANSI_BG_BRIGHT_BLUE "\033[104m"
|
||||
#define ANSI_BG_BRIGHT_MAGENTA "\033[105m"
|
||||
#define ANSI_BG_BRIGHT_CYAN "\033[106m"
|
||||
#define ANSI_BG_BRIGHT_WHITE "\033[107m"
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user