4 headers macros
forgejo docs edited this page 2026-11-17 17:33:00 +00:00

Headers macros

This file contains the macros that are written in the headers files

Go back to homepage
Skip to files index

Defined in this file

The following 120 macros are referenced in this file

macro __DEBUG_CLOCK

Go back to top

#define __DEBUG_CLOCK 

Defined in src/debug.h:142

macro __DBG_POS

Go back to top

#define __DBG_POS printf(DBG_GRAY __FILE__ ":%d | " DBG_RESET, __LINE__);

Defined in src/debug.h:146

macro __DBG_POS

Go back to top

#define __DBG_POS 

Defined in src/debug.h:148

macro __DEBUG_PREFIX

Go back to top

#define __DEBUG_PREFIX 

Defined in src/debug.h:128

macro __DEBUG_PREFIX

Go back to top

#define __DEBUG_PREFIX DBG_GREEN

Defined in src/debug.h:130

macro __DEBUG_CLOCK

Go back to top

#define __DEBUG_CLOCK {
  time_t now = time(NULL);
  struct tm * t = localtime(&now);
  printf(DBG_PURPLE "%02d:%02d:%02d | " DBG_RESET, t->tm_hour, t->tm_min, t->tm_sec);
}

Defined in src/debug.h:136

macro DEBUG_H

Go back to top

#define __DEBUG_H__ 

Defined in src/debug.h:2

macro CORE_H

Go back to top

#define __CORE_H__ 

Defined in src/core/core.h:2

macro RENDERING_H

Go back to top

#define __RENDERING_H__ 

Defined in src/render/rendering.h:2

macro MACROS_H

Go back to top

#define __MACROS_H__ 

Defined in src/macros.h:2

macro CONFIG_H

Go back to top

#define __CONFIG_H__ 

Defined in src/core/config.h:10

macro ARGS_H

Go back to top

#define __ARGS_H__ 1

Defined in src/parsers/args.h:2

macro STRINGLIB_H

Go back to top

#define __STRINGLIB_H__ 1

Defined in src/parsers/stringlib.h:2

macro PARSERS_H

Go back to top

#define __PARSERS_H__ 1

Defined in src/parsers/parsers.h:2

macro READER_H

Go back to top

#define __READER_H__ 

Defined in src/reader/reader.h:2

macro DEBUG

Go back to top

#define DEBUG(...) {
  __DEBUG_CLOCK
  __DBG_POS
  printf(__DEBUG_PREFIX __VA_ARGS__);
  printf(DBG_RESET "\n");
}

Defined in src/debug.h:163

Note


This macro takes an arbitrary number of arguments. It will format it as such :
printf(first_argument, ...) everything else

By default, it will be preceeded by the DBG_GREEN variable. It can be disabled by defining the DBG_NO_DCOL variable

By default, a clock is not enabled. You can enable the default clock by defining the DBG_CLOCK variable

By default, the filename is disabled, but it can appear if the macro DBG_POSITION is defined

It will always reset the color and print a newline afterwards

macro DEBUG_INT_VAR

Go back to top

#define DEBUG_INT_VAR(var) DEBUG(#var " : %d ", var)

Defined in src/debug.h:170

macro DEBUG_LINT_VAR

Go back to top

#define DEBUG_LINT_VAR(var) DEBUG(#var " : %ld ", var)

Defined in src/debug.h:171

macro DEBUG

Go back to top

#define DEBUG(...) 

Defined in src/debug.h:182

macro DBG_BG_LIGHT_PURPLET

Go back to top

#define DBG_BG_LIGHT_PURPLET(x) "\x1b[105m" x __DEBUG_PREFIX

Defined in src/debug.h:120

macro DBG_BG_LIGHT_CYANT

Go back to top

#define DBG_BG_LIGHT_CYANT(x) "\x1b[106m" x __DEBUG_PREFIX

Defined in src/debug.h:121

macro DBG_BG_LIGHT_WHITET

Go back to top

#define DBG_BG_LIGHT_WHITET(x) "\x1b[107m" x __DEBUG_PREFIX

Defined in src/debug.h:122

macro DBG_BD_LIGHT_GRAYT

Go back to top

#define DBG_BD_LIGHT_GRAYT(x) "\x1b[100m" x __DEBUG_PREFIX

Defined in src/debug.h:123

macro DBG_BG_BLUET

Go back to top

#define DBG_BG_BLUET(x) "\x1b[44m" x __DEBUG_PREFIX

Defined in src/debug.h:111

macro DBG_BG_PURPLET

Go back to top

#define DBG_BG_PURPLET(x) "\x1b[45m" x __DEBUG_PREFIX

Defined in src/debug.h:112

macro DBG_BG_CYANT

Go back to top

#define DBG_BG_CYANT(x) "\x1b[46m" x __DEBUG_PREFIX

Defined in src/debug.h:113

macro DBG_BG_WHITET

Go back to top

#define DBG_BG_WHITET(x) "\x1b[47m" x __DEBUG_PREFIX

Defined in src/debug.h:114

macro DBG_BG_LIGHT_REDT

Go back to top

#define DBG_BG_LIGHT_REDT(x) "\x1b[101m" x __DEBUG_PREFIX

Defined in src/debug.h:116

macro DBG_BG_LIGHT_GREENT

Go back to top

#define DBG_BG_LIGHT_GREENT(x) "\x1b[102m" x __DEBUG_PREFIX

Defined in src/debug.h:117

macro DBG_BG_LIGHT_YELLOWT

Go back to top

#define DBG_BG_LIGHT_YELLOWT(x) "\x1b[103m" x __DEBUG_PREFIX

Defined in src/debug.h:118

macro DBG_BG_LIGHT_BLUET

Go back to top

#define DBG_BG_LIGHT_BLUET(x) "\x1b[104m" x __DEBUG_PREFIX

Defined in src/debug.h:119

macro DBG_LIGHT_BLUET

Go back to top

#define DBG_LIGHT_BLUET(x) "\x1b[94m" x __DEBUG_PREFIX

Defined in src/debug.h:102

macro DBG_LIGHT_PURPLET

Go back to top

#define DBG_LIGHT_PURPLET(x) "\x1b[95m" x __DEBUG_PREFIX

Defined in src/debug.h:103

macro DBG_LIGHT_CYANT

Go back to top

#define DBG_LIGHT_CYANT(x) "\x1b[96m" x __DEBUG_PREFIX

Defined in src/debug.h:104

macro DBG_GRAYT

Go back to top

#define DBG_GRAYT(x) DBG_LIGHT_BLACK x __DEBUG_PREFIX

Defined in src/debug.h:105

macro DBG_BG_REDT

Go back to top

#define DBG_BG_REDT(x) "\x1b[41m" x __DEBUG_PREFIX

Defined in src/debug.h:108

macro DBG_BG_GREENT

Go back to top

#define DBG_BG_GREENT(x) "\x1b[42m" x __DEBUG_PREFIX

Defined in src/debug.h:109

macro DBG_BG_YELLOWT

Go back to top

#define DBG_BG_YELLOWT(x) "\x1b[43m" x __DEBUG_PREFIX

Defined in src/debug.h:110

macro DBG_REDT

Go back to top

#define DBG_REDT(x) "\x1b[31m" x __DEBUG_PREFIX

Defined in src/debug.h:93

macro DBG_BLUET

Go back to top

#define DBG_BLUET(x) "\x1b[34m" x __DEBUG_PREFIX

Defined in src/debug.h:94

macro DBG_PURPLET

Go back to top

#define DBG_PURPLET(x) "\x1b[35m" x __DEBUG_PREFIX

Defined in src/debug.h:95

macro DBG_CYANT

Go back to top

#define DBG_CYANT(x) "\x1b[36m" x __DEBUG_PREFIX

Defined in src/debug.h:96

macro DBG_LIGHT_BLACKT

Go back to top

#define DBG_LIGHT_BLACKT(x) "\x1b[90m" x __DEBUG_PREFIX

Defined in src/debug.h:98

macro DBG_LIGHT_GREENT

Go back to top

#define DBG_LIGHT_GREENT(x) "\x1b[92m" x __DEBUG_PREFIX

Defined in src/debug.h:99

macro DBG_LIGHT_YELLOWT

Go back to top

#define DBG_LIGHT_YELLOWT(x) "\x1b[93m" x __DEBUG_PREFIX

Defined in src/debug.h:100

macro DBG_LIGHT_REDT

Go back to top

#define DBG_LIGHT_REDT(x) "\x1b[91m" x __DEBUG_PREFIX

Defined in src/debug.h:101

macro DBG_BOLDT

Go back to top

#define DBG_BOLDT(x) "\x1b[1m" x __DEBUG_PREFIX

Defined in src/debug.h:84

macro DBG_ITALICT

Go back to top

#define DBG_ITALICT(x) "\x1b[3m" x __DEBUG_PREFIX

Defined in src/debug.h:85

macro DBG_UNDERLINET

Go back to top

#define DBG_UNDERLINET(x) "\x1b[4m" x __DEBUG_PREFIX

Defined in src/debug.h:86

macro DBG_BLINKT

Go back to top

#define DBG_BLINKT(x) "\x1b[5m" x __DEBUG_PREFIX

Defined in src/debug.h:87

macro DBG_BLACKT

Go back to top

#define DBG_BLACKT(x) "\x1b[30m" x __DEBUG_PREFIX

Defined in src/debug.h:90

macro DBG_GREENT

Go back to top

#define DBG_GREENT(x) "\x1b[32m" x __DEBUG_PREFIX

Defined in src/debug.h:91

macro DBG_YELLOWT

Go back to top

#define DBG_YELLOWT(x) "\x1b[33m" x __DEBUG_PREFIX

Defined in src/debug.h:92

macro DBG_BG_LIGHT_RED

Go back to top

#define DBG_BG_LIGHT_RED "\x1b[101m"

Defined in src/debug.h:73

macro DBG_BG_LIGHT_GREEN

Go back to top

#define DBG_BG_LIGHT_GREEN "\x1b[102m"

Defined in src/debug.h:74

macro DBG_BG_LIGHT_YELLOW

Go back to top

#define DBG_BG_LIGHT_YELLOW "\x1b[103m"

Defined in src/debug.h:75

macro DBG_BG_LIGHT_BLUE

Go back to top

#define DBG_BG_LIGHT_BLUE "\x1b[104m"

Defined in src/debug.h:76

macro DBG_BG_LIGHT_PURPLE

Go back to top

#define DBG_BG_LIGHT_PURPLE "\x1b[105m"

Defined in src/debug.h:77

macro DBG_BG_LIGHT_CYAN

Go back to top

#define DBG_BG_LIGHT_CYAN "\x1b[106m"

Defined in src/debug.h:78

macro DBG_BG_LIGHT_WHITE

Go back to top

#define DBG_BG_LIGHT_WHITE "\x1b[107m"

Defined in src/debug.h:79

macro DBG_BD_LIGHT_GRAY

Go back to top

#define DBG_BD_LIGHT_GRAY "\x1b[100m"

Defined in src/debug.h:80

macro DBG_BG_RED

Go back to top

#define DBG_BG_RED "\x1b[41m"

Defined in src/debug.h:65

macro DBG_BG_GREEN

Go back to top

#define DBG_BG_GREEN "\x1b[42m"

Defined in src/debug.h:66

macro DBG_BG_YELLOW

Go back to top

#define DBG_BG_YELLOW "\x1b[43m"

Defined in src/debug.h:67

macro DBG_BG_BLUE

Go back to top

#define DBG_BG_BLUE "\x1b[44m"

Defined in src/debug.h:68

macro DBG_BG_PURPLE

Go back to top

#define DBG_BG_PURPLE "\x1b[45m"

Defined in src/debug.h:69

macro DBG_BG_CYAN

Go back to top

#define DBG_BG_CYAN "\x1b[46m"

Defined in src/debug.h:70

macro DBG_BG_WHITE

Go back to top

#define DBG_BG_WHITE "\x1b[47m"

Defined in src/debug.h:71

macro DBG_LIGHT_BLACK

Go back to top

#define DBG_LIGHT_BLACK "\x1b[90m"

Defined in src/debug.h:55

macro DBG_LIGHT_GREEN

Go back to top

#define DBG_LIGHT_GREEN "\x1b[92m"

Defined in src/debug.h:56

macro DBG_LIGHT_YELLOW

Go back to top

#define DBG_LIGHT_YELLOW "\x1b[93m"

Defined in src/debug.h:57

macro DBG_LIGHT_RED

Go back to top

#define DBG_LIGHT_RED "\x1b[91m"

Defined in src/debug.h:58

macro DBG_LIGHT_BLUE

Go back to top

#define DBG_LIGHT_BLUE "\x1b[94m"

Defined in src/debug.h:59

macro DBG_LIGHT_PURPLE

Go back to top

#define DBG_LIGHT_PURPLE "\x1b[95m"

Defined in src/debug.h:60

macro DBG_LIGHT_CYAN

Go back to top

#define DBG_LIGHT_CYAN "\x1b[96m"

Defined in src/debug.h:61

macro DBG_GRAY

Go back to top

#define DBG_GRAY DBG_LIGHT_BLACK

Defined in src/debug.h:62

macro DBG_BLACK

Go back to top

#define DBG_BLACK "\x1b[30m"

Defined in src/debug.h:47

macro DBG_GREEN

Go back to top

#define DBG_GREEN "\x1b[32m"

Defined in src/debug.h:48

macro DBG_YELLOW

Go back to top

#define DBG_YELLOW "\x1b[33m"

Defined in src/debug.h:49

macro DBG_RED

Go back to top

#define DBG_RED "\x1b[31m"

Defined in src/debug.h:50

macro DBG_BLUE

Go back to top

#define DBG_BLUE "\x1b[34m"

Defined in src/debug.h:51

macro DBG_PURPLE

Go back to top

#define DBG_PURPLE "\x1b[35m"

Defined in src/debug.h:52

macro DBG_CYAN

Go back to top

#define DBG_CYAN "\x1b[36m"

Defined in src/debug.h:53

macro DBG_RESET

Go back to top

#define DBG_RESET "\x1b[0m"

Defined in src/debug.h:37

macro DBG_BOLD

Go back to top

#define DBG_BOLD "\x1b[1m"

Defined in src/debug.h:41

macro DBG_ITALIC

Go back to top

#define DBG_ITALIC "\x1b[3m"

Defined in src/debug.h:42

macro DBG_UNDERLINE

Go back to top

#define DBG_UNDERLINE "\x1b[4m"

Defined in src/debug.h:43

Go back to top

#define DBG_BLINK "\x1b[5m"

Defined in src/debug.h:44

macro ENTITIES_NAME_LENGTH

Go back to top

#define ENTITIES_NAME_LENGTH 64

Defined in src/reader/reader.h:15

macro F_MSTATIC

Go back to top

#define F_MSTATIC 0x00000001

Defined in src/reader/reader.h:21

macro F_MVOLATI

Go back to top

#define F_MVOLATI 0x00000010

Defined in src/reader/reader.h:22

macro F_MEXTERN

Go back to top

#define F_MEXTERN 0x00000100

Defined in src/reader/reader.h:23

macro F_ISTATIC

Go back to top

#define F_ISTATIC(x) (((x) & F_MSTATIC) == F_MSTATIC)

Defined in src/reader/reader.h:25

macro F_IVOLATI

Go back to top

#define F_IVOLATI(x) (((x) & F_MVOLATI) == F_MVOLATI)

Defined in src/reader/reader.h:26

macro F_IEXTERN

Go back to top

#define F_IEXTERN(x) (((x) & F_MEXTERN) == F_MEXTERN)

Defined in src/reader/reader.h:27

macro F_INONE

Go back to top

#define F_INONE(x) (!F_ISTATIC(x) && !F_IEXTERN(x) && !F_IVOLATI(x))

Defined in src/reader/reader.h:29

macro IS_STRING_DEL

Go back to top

#define IS_STRING_DEL(origin, cptr) (*(cptr) == '"' && (cptr == origin || *(cptr - 1) != '\\'))

Defined in src/core/core.h:17

macro IS_CHAR_DEL

Go back to top

#define IS_CHAR_DEL(origin, cptr) (*(cptr) == '\'' && (cptr == origin || *(cptr - 1) != '\\'))

Defined in src/core/core.h:18

macro MEMCPY

Go back to top

#define MEMCPY(src, dest, size) {
  char * s = (char *)src;
  char * d = (char *)dest;
  while (size > 0) {
    *d = *s;
    d++;
    s++;
  }
}

Defined in src/macros.h:21

macro MACRO_PLACEHOLDER_LENGTH

Go back to top

#define MACRO_PLACEHOLDER_LENGTH 2048

Defined in src/reader/reader.h:16

macro PATH_MAX

Go back to top

#define PATH_MAX _MAX_PATH

Defined in src/core/core.h:10

macro PROG_VERSION

Go back to top

#define PROG_VERSION "1.0.1"

Defined in src/macros.h:4

macro P_TLIBSTRINGPGREP

Go back to top

#define P_TLIBSTRINGPGREP(x) ((x & LibStringpGrep) == LibStringpGrep)

Defined in src/reader/reader.h:161

macro P_TSTDTIME

Go back to top

#define P_TSTDTIME(x) ((x & Stdtime) == Stdtime)

Defined in src/reader/reader.h:162

macro P_TSTDDEF

Go back to top

#define P_TSTDDEF(x) ((x & Stddef) == Stddef)

Defined in src/reader/reader.h:163

macro P_TSYSTYPES

Go back to top

#define P_TSYSTYPES(x) ((x & SysTypes) == SysTypes)

Defined in src/reader/reader.h:164

macro P_TSTDLIB

Go back to top

#define P_TSTDLIB(x) ((x & Stdlib) == Stdlib)

Defined in src/reader/reader.h:165

macro P_TDIRENT

Go back to top

#define P_TDIRENT(x) ((x & Dirent) == Dirent)

Defined in src/reader/reader.h:166

macro PATH_MAX

Go back to top

#define PATH_MAX _MAX_PATH

Defined in src/core/config.h:4

macro P_TSTDIO

Go back to top

#define P_TSTDIO(x) ((x & Stdio) == Stdio)

Defined in src/reader/reader.h:154

macro P_TSTDBOOL

Go back to top

#define P_TSTDBOOL(x) ((x & Stdbool) == Stdbool)

Defined in src/reader/reader.h:155

macro P_TSTDINT

Go back to top

#define P_TSTDINT(x) ((x & Stdint) == Stdint)

Defined in src/reader/reader.h:156

macro P_TUNISTD

Go back to top

#define P_TUNISTD(x) ((x & Unistd) == Unistd)

Defined in src/reader/reader.h:157

macro P_TFCNTL

Go back to top

#define P_TFCNTL(x) ((x & Fcntl) == Fcntl)

Defined in src/reader/reader.h:158

macro P_TSYSSTAT

Go back to top

#define P_TSYSSTAT(x) ((x & SysStat) == SysStat)

Defined in src/reader/reader.h:159

macro P_TSYSDIR

Go back to top

#define P_TSYSDIR(x) ((x & SysDir) == SysDir)

Defined in src/reader/reader.h:160

macro P_TGLIBC

Go back to top

#define P_TGLIBC(x) ((x & GlibC) == GlibC)

Defined in src/reader/reader.h:153

macro PATH_MAX

Go back to top

#define PATH_MAX _MAX_PATH

Defined in src/reader/reader.h:8

macro STRCP

Go back to top

#define STRCP(src, dest, max, with_zero) {
  char * s = src;
  char * d = dest;
  size_t __insider_variable_index = max;

  while (*s != 0 && __insider_variable_index > 0) {
    __insider_variable_index--;
    *d = *s;
    s++;
    d++;
  }

  if (with_zero) *d = 0;
}

Defined in src/macros.h:6

macro TR_DEBUG

Go back to top

#define TR_DEBUG(trigger, ...) if (trigger) DEBUG(__VA_ARGS__)

Defined in src/debug.h:178

Note


This macro takes a trigger, and an arbitrary number of arguments. It will create an if condition depending on the trigger, that will call the
DEBUG(...) macro with the VA_ARGS, so it behaves basically the same

Indexed files