Cthulhu  0.2.10
Cthulhu compiler collection
common_extra.h File Reference
#include "common.h"
#include "core/text.h"
#include "format/notify.h"
#include "notify/notify.h"
#include <stddef.h>
Include dependency graph for common_extra.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

severity_t get_severity (const diagnostic_t *diag, bool override_fatal)
 
const char * get_severity_name (severity_t severity)
 
colour_t get_severity_colour (severity_t severity)
 
typevec_tall_segments_in_scan (const typevec_t *segments, const node_t *node, arena_t *arena)
 
void segments_sort (typevec_t *segments)
 
size_t get_line_number (file_config_t config, const node_t *node)
 
bool node_has_line (const node_t *node)
 
cache_map_tcache_map_new (size_t size, arena_t *arena)
 
void cache_map_delete (cache_map_t *map)
 
text_cache_tcache_emplace_file (cache_map_t *map, const char *path)
 
text_cache_tcache_emplace_scan (cache_map_t *map, const scan_t *scan)
 
text_view_t cache_get_line (text_cache_t *cache, size_t line)
 
size_t cache_count_lines (text_cache_t *cache)
 
text_t cache_escape_line (text_cache_t *cache, size_t line, const colour_pallete_t *colours, size_t column_limit)
 
char * fmt_node_location (source_config_t config, const node_t *node)
 

Function Documentation

◆ all_segments_in_scan()

typevec_t* all_segments_in_scan ( const typevec_t segments,
const node_t node,
arena_t arena 
)

Definition at line 95 of file common_extra.c.

◆ cache_count_lines()

size_t cache_count_lines ( text_cache_t cache)

Definition at line 327 of file common_extra.c.

◆ cache_emplace_file()

text_cache_t* cache_emplace_file ( cache_map_t map,
const char *  path 
)

Definition at line 275 of file common_extra.c.

◆ cache_emplace_scan()

text_cache_t* cache_emplace_scan ( cache_map_t map,
const scan_t scan 
)

Definition at line 295 of file common_extra.c.

◆ cache_escape_line()

text_t cache_escape_line ( text_cache_t cache,
size_t  line,
const colour_pallete_t colours,
size_t  column_limit 
)

Definition at line 355 of file common_extra.c.

◆ cache_get_line()

text_view_t cache_get_line ( text_cache_t cache,
size_t  line 
)

Definition at line 310 of file common_extra.c.

◆ cache_map_delete()

void cache_map_delete ( cache_map_t map)

Definition at line 262 of file common_extra.c.

◆ cache_map_new()

cache_map_t* cache_map_new ( size_t  size,
arena_t arena 
)

Definition at line 251 of file common_extra.c.

◆ fmt_node_location()

char* fmt_node_location ( source_config_t  config,
const node_t node 
)

version 2 of the common stuff

Definition at line 530 of file common_extra.c.

◆ get_line_number()

size_t get_line_number ( file_config_t  config,
const node_t node 
)

Definition at line 121 of file common_extra.c.

◆ get_severity()

severity_t get_severity ( const diagnostic_t diag,
bool  override_fatal 
)

Definition at line 30 of file common_extra.c.

◆ get_severity_colour()

colour_t get_severity_colour ( severity_t  severity)

Definition at line 52 of file common_extra.c.

◆ get_severity_name()

const char* get_severity_name ( severity_t  severity)

Definition at line 38 of file common_extra.c.

◆ node_has_line()

bool node_has_line ( const node_t node)

Definition at line 129 of file common_extra.c.

◆ segments_sort()

void segments_sort ( typevec_t segments)

Definition at line 90 of file common_extra.c.