Display pretty indentation. More...
Enumerations | |
| enum | pp_indent_style { INDENT_SPACES, INDENT_TABS, INDENT_UNKNOWN } |
| Indentation styles. More... | |
Functions | |
| void | pretty_print_indent_decrease (void) |
| Decrease the indentation level. More... | |
| void | pretty_print_indent_fprint (FILE *f) |
| Indent the current line of a stream. More... | |
| static size_t | pretty_print_indent_get_level (void) |
| Get the current indentation level. More... | |
| static pp_indent_style | pretty_print_indent_get_style (void) |
| Get the current indentation style. More... | |
| static const char * | pretty_print_indent_get_style_string (pp_indent_style style) |
| Get the string corresponding to an indent style. More... | |
| void | pretty_print_indent_increase (void) |
| Increase the indentation level. More... | |
| size_t | pretty_print_indent_level (void) |
| Get the current indentation level. More... | |
| void | pretty_print_indent_set_style (pp_indent_style style) |
| Set the indentation style. More... | |
| pp_indent_style | pretty_print_indent_style (void) |
| Get the current indentation style. More... | |
| const char * | pretty_print_indent_style_string (pp_indent_style style) |
| Get the string corresponding to an indent style. More... | |
| char * | pretty_print_indent_to_string (void) |
| Get a string that represents the current level of indentation. More... | |
Display pretty indentation.
1.0.0The current indentation level can be inspected using pretty_print_indent_level(). It can be increased or decreased with pretty_print_indent_increase() and pretty_print_indent_decrease().
The current implementation provides two indentation styles:
The currently used indentation style can be inspected using pretty_print_indent_style(). It can be changed using pretty_print_indent_set_style().
The string representation of a given indentation style can be obtained using pretty_print_indent_style_string(). However, the current implementation does not allow the user to change the string representation of an indentation style...
One can either directly print the indentation into a stream with pretty_print_indent_fprint() or convert it into a string using pretty_print_indent_to_string().
Please note that the string returned by pretty_print_indent_to_string() is malloc'd and should be free'd once it is useless.
| enum pp_indent_style |
| void pretty_print_indent_decrease | ( | void | ) |
#include <include/noclock/pretty_print.h>
Decrease the indentation level.
1.0.0 | void pretty_print_indent_fprint | ( | FILE * | f | ) |
#include <include/noclock/pretty_print.h>
Indent the current line of a stream.
1.0.0| f | Stream. |
|
inlinestatic |
#include <include/noclock/pretty_print.h>
Get the current indentation level.
1.0.0
|
inlinestatic |
#include <include/noclock/pretty_print.h>
Get the current indentation style.
1.0.0| INDENT_SPACES | if the current indentation style is set to spaces. |
| INDENT_TABS | if the current indentation style is set to tabs. |
| INDENT_UNKNOWN | if the current indentation style is unknown. |
|
inlinestatic |
#include <include/noclock/pretty_print.h>
Get the string corresponding to an indent style.
1.0.0| style | The style. |
| void pretty_print_indent_increase | ( | void | ) |
#include <include/noclock/pretty_print.h>
Increase the indentation level.
1.0.0 | size_t pretty_print_indent_level | ( | void | ) |
#include <include/noclock/pretty_print.h>
Get the current indentation level.
1.0.0| void pretty_print_indent_set_style | ( | pp_indent_style | style | ) |
#include <include/noclock/pretty_print.h>
Set the indentation style.
1.0.0| style | The desired indentation style. |
| pp_indent_style pretty_print_indent_style | ( | void | ) |
#include <include/noclock/pretty_print.h>
Get the current indentation style.
1.0.0| INDENT_SPACES | if the current indentation style is set to spaces. |
| INDENT_TABS | if the current indentation style is set to tabs. |
| INDENT_UNKNOWN | if the current indentation style is unknown. |
| const char* pretty_print_indent_style_string | ( | pp_indent_style | style | ) |
#include <include/noclock/pretty_print.h>
Get the string corresponding to an indent style.
1.0.0| style | The style. |
| char* pretty_print_indent_to_string | ( | void | ) |
#include <include/noclock/pretty_print.h>
Get a string that represents the current level of indentation.
1.0.0