solidc
Robust collection of general-purpose cross-platform C libraries and data structures designed for rapid and safe development in C
Loading...
Searching...
No Matches
Functions | Variables
prettytable.c File Reference

Implementation of generic pretty table printer. More...

#include "../include/prettytable.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for prettytable.c:

Go to the source code of this file.

Functions

void prettytable_config_init (prettytable_config *config)
 
int prettytable_print (const prettytable_config *config)
 

Variables

const prettytable_style PRETTYTABLE_STYLE_BOX
 

Detailed Description

Implementation of generic pretty table printer.

Definition in file prettytable.c.

Function Documentation

◆ prettytable_config_init()

void prettytable_config_init ( prettytable_config config)

Initialize config with default values.

Parameters
configConfig to initialize

Definition at line 68 of file prettytable.c.

References PRETTYTABLE_STYLE_BOX.

◆ prettytable_print()

int prettytable_print ( const prettytable_config config)

Print a formatted table.

Parameters
configTable configuration
Returns
0 on success, -1 on error

Definition at line 158 of file prettytable.c.

References PRETTYTABLE_STYLE_BOX.

Variable Documentation

◆ PRETTYTABLE_STYLE_BOX

const prettytable_style PRETTYTABLE_STYLE_BOX
Initial value:
= {
.top_left = "┌",
.top_mid = "┬",
.top_right = "┐",
.mid_left = "├",
.mid_mid = "┼",
.mid_right = "┤",
.bottom_left = "└",
.bottom_mid = "┴",
.bottom_right = "┘",
.horizontal = "─",
.vertical = "│",
}

Predefined border styles.

Definition at line 12 of file prettytable.c.

Referenced by prettytable_config_init(), and prettytable_print().