summaryrefslogtreecommitdiffstats
path: root/lib/termtable.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: Create termtable specific temp memoryDonald Sharp2024-09-011-1/+1
| | | | | | | | | | When trying to track down a MTYPE_TMP memory leak it's harder to search for it when you happen to have some usage of ttable_dump. Let's just give it it's own memory type so that we can avoid confusion in the future. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib: add json API to dump and override row naming conventionPhilippe Guibert2024-06-181-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following table is not compliant with caml format when displayed in json: > ttable_add_row( > tt, > "Vertex|Type|Metric|Next-Hop|Interface|Parent"); > > ttable_json(tt, "ssdsss"); output observed: > [..] > { > "Vertex":"r1", > "Type":"", > "Metric":0, > "Next-Hop":"", > "Interface":"", > "Parent":"" > } output expected: > [..] > { > "vertex":"r1", > "type":"", > "metric":0, > "nextHop":"", > "interface":"", > "parent":"" > } Override the ttable_json() function with a new function which has an extra paramter: this parameter will redefine the initial row value for json: > ttable_json_with_json_text(tt, > "vertex|type|metric|nextHop|interface|parent"); Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* lib: convert termtable to jsonEric Kinzie2023-04-181-0/+12
| | | | | | | | Add a function that returns a JSON-C structure containing a representation of a termtable. This is intended to be a quick way to implement JSON output to CLI commands. Signed-off-by: Eric Kinzie <ekinzie@labn.net>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: Remove invalid function declarationWeiguo Li2022-08-081-7/+0
| | | | | | there is no definition of ttable_cell_del(), thus remove its declaration. Signed-off-by: Weiguo Li <liwg06@foxmail.com>
* *: generously apply constDavid Lamparter2019-12-021-2/+2
| | | | | | const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: make "%Ld" work for int64_tDavid Lamparter2019-06-121-3/+2
| | | | | | ... without compiler plugins. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: add extern "C" {} blocks to all libfrr headersRenato Westphal2019-02-121-0/+8
| | | | | | | These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-2/+2
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: printf bugfixes & improvementQuentin Young2017-06-301-2/+6
| | | | | | | | * Fix bad format specifier in thread.[ch] * Move PRINTF_ATTRIBUTE macro to zebra.h * Use PRINTF_ATTRIBUTE on termtable printers Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add table generatorQuentin Young2017-06-161-0/+293
Allows for easy preparation of tabular output. Supports: -- Padding -- Alignment -- Styling