xref: /Universal-ctags/main/colprint_p.h (revision c2a93c9fe99a657dd23fd6d06c6d18027d3222ba)
1 /*
2 *   Copyright (c) 2017 Masatake YAMATO
3 *
4 *   This source code is released for free distribution under the terms of the
5 *   GNU General Public License version 2 or (at your option) any later version.
6 *
7 */
8 #ifndef CTAGS_MAIN_COLPRINT_PRIVATE_H
9 #define CTAGS_MAIN_COLPRINT_PRIVATE_H
10 
11 #include "general.h"
12 
13 #include "vstring.h"
14 #include <stdio.h>
15 
16 struct colprintTable;
17 struct colprintLine;
18 
19 /* Each column must have a prefix for specifying justification: "L:" or "R:". */
20 struct colprintTable *colprintTableNew (const char* columnHeader, ... /* NULL TERMINATED */);
21 void colprintTableDelete (struct colprintTable *table);
22 void colprintTablePrint (struct colprintTable *table, unsigned int startFrom, bool withHeader, bool machinable, FILE *fp);
23 void colprintTableSort  (struct colprintTable *table, int (* compareFn) (struct colprintLine *, struct colprintLine *));
24 
25 struct colprintLine *colprintTableGetNewLine (struct colprintTable *table);
26 
27 void colprintLineAppendColumnCString (struct colprintLine *line, const char* column);
28 void colprintLineAppendColumnVString (struct colprintLine *line, vString* column);
29 void colprintLineAppendColumnChar (struct colprintLine *line, char column);
30 void colprintLineAppendColumnInt  (struct colprintLine *line, unsigned int column);
31 
32 /* Appends "yes" or "no". */
33 void colprintLineAppendColumnBool (struct colprintLine *line, bool column);
34 
35 const char *colprintLineGetColumn (struct colprintLine *line, unsigned int column);
36 
37 #endif /* CTAGS_MAIN_COLPRINT_PRIVATE_H */
38