-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAN
164 lines (127 loc) · 10 KB
/
MAN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
CNoEvil 1.2.0 - A Language Extension for C
Some definitions can produce warnings. Hide these by defining EVIL_NO_WARN before including `evil.h`.
Some definitions can produce errors. There is no option to hide these.
Definitions are expected to be created before the `evil.h` file is included.
e.g.
#define EVIL_IO
#include "evil.h"
Available by default:
The equivalent of including stdbool.h. Exclude by defining EVIL_NO_BOOL.
Main - A keyword, expected to be followed by keyword `then`. Automatically makes argc and argv available. Use instead of the `main` function. Exclude by defining `EVIL_NO_MAIN`.
then - A keyword, used to follow some constructs (such as If, While, etc.) Exclude by defining `EVIL_NO_FLOW`.
end - A keyword, used to close functions, and some other constructs. Exclude by defining `EVIL_NO_FLOW`.
If - A keyword, used to replace C's bracket'd `if`. i.e. Equivalent to `if(`. Exclude by defining `EVIL_NO_FLOW`.
For - A keyword, used to replace C's bracket'd `for`. i.e. Equivalent to `for(`. Exclude by defining `EVIL_NO_FLOW`.
While - A keyword, used to replace C's bracket'd `while`. i.e. Equivalent to `while(`. Exclude by defining `EVIL_NO_FLOW`.
Do - A keyword, replaces C's `do`, and opens the block automatically. Exclude by defining `EVIL_NO_FLOW`.
Switch(T) - A macro, creates and opens the block of a switch statement. Exclude by defining `EVIL_NO_FLOW`.
contant(Type, Name, Value) - A macro, generates a `const`. Exclude by defining `EVIL_NO_SPECIFIER`.
storage(Type, Name, Value) - A macro, generates a `static`. Exclude by defining `EVIL_NO_SPECIFIER`.
declare(Name, ReturnType, ...); - A variadic macro. Arguments are as in C function arguments. Declare a C function. Exclude by defining `EVIL_NO_PROC`.
proc(Name, ReturnType, ...) - A variadic macro. Arguments are as in C function arguments. Creates the start of a C function, that is, it is followed by a function body. Exclude by defining `EVIL_NO_PROC`.
comment(...) - A variadic macro. Arguments can be anything. Creates a multiline comment. Exclude by definine `EVIL_NO_COMMENT`.
CNOEVIL - A macro that is defined if this library is available. It is a char* containing a version number.
Available if EVIL_MALLOC defined:
checked_malloc(VARIABLE, VARIABLE_TYPE, BUFFER_SIZE, FAIL_MSG, EXIT?) - A macro to perform the normal malloc check for success. If exit is considered true by C, then the failure will cause an exit. It will always print FAIL_MSG to stderr, if allocation fails.
Available if EVIL_IO defined:
The equivalent of including stdio.h
display(T) - Prints a representation of the given value to stdout.
displayf(F, T) - Prints a representation of the given value to F, a `FILE*`.
displayln(T) - Prints a representation of the given value to stdout, followed by a system-compatible line ending.
displayfln(F, T) - Prints a representation of the given value to F, a `FILE*`, followed by a system-compatible line ending.
endl - A keyword. Prints a system-comaptible line ending to stdout.
endlf(F) - Prints a system-comaptible line ending to F, a `FILE*`.
repr_type(T) - Returns a `char*` containing a text representation of the type. Optimisation may effect results. Returns "Unknown" for any type that cannot be accounted for.
Available if EVIL_STRUCT defined:
Struct(Name) - Starts a struct definition.
Union(Name) - Start a union definition.
Typedef - A keyword, exactly equivalent to `typedef`.
BitField(Name, Type, Width) - Used for defining a Bitfield inside a struct.
Available if EVIL_COROUTINE defined:
coroutine() - A macro that marks the beginning of a coroutine body.
co_return(T) - A macro that marks a return from a coroutine.
co_end() - A macro that closes a coroutine body.
Available if EVIL_HELP defined:
evil_manual() - Prints this.
evil_explain(char*) - Prints further information on a single item. (Under heavy development.)
Available if EVIL_LAMBDA defined:
lambda(Type, Body) - A simple macro to construct an anonymous function-like object
Available if EVIL_CLI defined:
Note: None of the module's functions check if function supported by current terminal.
cli_reset() - Removes any active effects and colors from the terminal.
cli_fg_256(N) - Takes a number between 0-255, and applies the corresponding color to the terminal text.
cli_bg_256(N) - Takes a number between 0-255, and applies the corresponding color to the terminal background.
cli_fg_rgb(R,G,B) - Takes three values (Red, Green, Blue), and applies the corresponding truecolor to the terminal text.
cli_bg_rgb(R,G,B) - Takes three values (Red, Green, Blue), and applies the corresponding truecolor to the terminal background.
cli_cursor_up(N) - Moves the console cursor up N lines.
cli_cursor_down(N) - Moves the console cursor down N lines.
cli_cursor_right(N) - Moves the console cursor right N characters.
cli_cursor_left(N) - Moves the console cursor left N characters.
cli_cursor_save() - Saves the current cursor position.
cli_cursor_restore() - Moves the cursor to the last saved position.
cli_screen_clear() - Clears the current terminal screen.
cli_screen_clear_before() - Clears the current terminal screen, before the cursor.
cli_screen_clear_after() - Clears the current terminal screen, after the cursor.
cli_line_clear() - Clears the current terminal line.
cli_line_clear_before() - Clears the current terminal line, before the cursor.
cli_line_clear_after() - Clears the current terminal line, after the cursor.
cli_effect_reset() - Removes any active effects from the terminal.
cli_effect_bold() - Activates the bold text terminal effect.
cli_effect_underline() - Activates the underlined text terminal effect.
cli_effect_reverse() - Activates the reversed text terminal effect.
cli_effect_blink() - Activates the blinking text terminal effect.
cli_effect_invisible() - Activates the invisible text terminal effect.
cli_fg_black() - Sets the terminal text to simple black.
cli_fg_red() - Sets the terminal text to simple red.
cli_fg_green() - Sets the terminal text to simple green.
cli_fg_yellow() - Sets the terminal text to simple yellow.
cli_fg_blue() - Sets the terminal text to simple blue.
cli_fg_magenta() - Sets the terminal text to simple magenta.
cli_fg_cyan() - Sets the terminal text to simple cyan.
cli_fg_white() - Sets the terminal text to simple white.
cli_fg_bright_black() - Sets the terminal text to complex black.
cli_fg_bright_red() - Sets the terminal text to complex red.
cli_fg_bright_green() - Sets the terminal text to complex green.
cli_fg_bright_yellow() - Sets the terminal text to complex yellow.
cli_fg_bright_blue() - Sets the terminal text to complex blue.
cli_fg_bright_magenta() - Sets the terminal text to complex magenta.
cli_fg_bright_cyan() - Sets the terminal text to complex cyan.
cli_fg_bright_white() - Sets the terminal text to complex white.
cli_bg_black() - Sets the terminal background to simple black.
cli_bg_red() - Sets the terminal background to simple red.
cli_bg_green() - Sets the terminal background to simple green.
cli_bg_yellow() - Sets the terminal background to simple yellow.
cli_bg_blue() - Sets the terminal background to simple blue.
cli_bg_magenta() - Sets the terminal background to simple magenta.
cli_bg_cyan() - Sets the terminal background to simple cyan.
cli_bg_white() - Sets the terminal background to simple white.
cli_bg_bright_black() - Sets the terminal background to complex black.
cli_bg_bright_red() - Sets the terminal background to complex red.
cli_bg_bright_green() - Sets the terminal background to complex green.
cli_bg_bright_yellow() - Sets the terminal background to complex yellow.
cli_bg_bright_blue() - Sets the terminal background to complex blue.
cli_bg_bright_magenta() - Sets the terminal background to complex magenta.
cli_bg_bright_cyan() - Sets the terminal background to complex cyan.
cli_bg_bright_white() - Sets the terminal background to complex white.
Available if EVIL_HASH defined:
jenkins64(char* key, size_t length) - Hash a given string into a uint64_t. Only defined if 64bit numbers are supported. Based on Jenkins One-At-A-Time hash.
fletcher64(char* key, size_t length) - Hash a given string into a uint64_t. Only defined if 64bit numbers are supported. Based on Fletcher's checksum.
fletcher32(char* key, size_t length) - Hash a given string into a uint32_t. Based on Fletcher's checksum.
jenkins32(char* key, size_t length) - Hash a given string into a uint32_t. Based on Jenkins One-At-A-Time hash.
adler32(char* key, size_t length) - Hash a given string into a uint32_t. Based on Adler-32.
fletcher16(char* key, size_t length) - Hash a given string into a uint16_t. Based on Fletcher's checksum.
Available if EVIL_LOG defined:
message(char* ) - Logs a message to stdout. If (char*)message_file has a length > 0, then logs to that file in append mode. If (char*)log_file has a length > 0, then logs to that file in append mode.
warning(char* ) - Logs a message to stdout. If (char*)warning_file has a length > 0, then logs to that file in append mode. If (char*)log_file has a length > 0, then logs to that file in append mode.
critical(char* ) - Logs a message to stderr. If (char*)critical_file has a length > 0, then logs to that file in append mode. If (char*)log_file has a length > 0, then logs to that file in append mode.
error(char* ) - Logs a message to stderr. If (char*)error_file has a length > 0, then logs to that file in append mode. If (char*)log_file has a length > 0, then logs to that file in append mode.
info(char* ) - Logs a message to stdout. If (char*)info_file has a length > 0, then logs to that file in append mode. If (char*)log_file has a length > 0, then logs to that file in append mode.
debug(char* ) - If DEBUG defined, logs a message to stdout. If (char*)debug_file has a length > 0, then logs to that file in append mode. If (char*)log_file has a length > 0, then logs to that file in append mode.
debug(char* ) - If DEBUG not defined, doesn't do anything.
EVIL_MATH module under heavy development.
EVIL_ARGPARSE module under heavy development.
EVIL_INT module under heavy development.
EVIL_RANDOM module under heavy development.
EVIL_LIST module under heavy development.
EVIL_SORT module under heavy development.
EVIL_GC module under heavy development.