diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-11-18 17:53:35 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-11-19 19:27:29 +0900 |
commit | c0a6f1b84c84749908961579b84513fd9f9d9eac (patch) | |
tree | ace7ba60cb031acd3a1f4ff10f7bbc5668fa801f /debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/prototypes.h | |
parent | 52e5ffe140f0f4402e97936447bc9a606045d2b5 (diff) | |
download | extra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.tar.gz extra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.zip |
uncrustify-trinity: updated based on upstream version 0.78.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/prototypes.h')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/prototypes.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/prototypes.h b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/prototypes.h new file mode 100644 index 00000000..55fe35b6 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/prototypes.h @@ -0,0 +1,64 @@ +/** + * @file prototypes.h + * Big jumble of prototypes used in Uncrustify. + * + * @author Ben Gardner + * @license GPL v2+ + */ + +#ifndef C_PARSE_PROTOTYPES_H_INCLUDED +#define C_PARSE_PROTOTYPES_H_INCLUDED + +#include "chunk.h" +#include "log_rules.h" +#include "uncrustify_types.h" + +#include <deque> +#include <string> + + +/** + * Advances to the next tab stop. + * Column 1 is the left-most column. + * + * @param col The current column + * @param tabsize The tabsize + * @return the next tabstop column + */ +static inline size_t calc_next_tab_column(size_t col, size_t tabsize) +{ + if (col == 0) + { + col = 1; + } + + if (cpd.frag_cols > 0) + { + col += cpd.frag_cols - 1; + } + col = 1 + ((((col - 1) / tabsize) + 1) * tabsize); + + if (cpd.frag_cols > 0) + { + col -= cpd.frag_cols - 1; + } + return(col); +} + + +/** + * Advances to the next tab stop for output. + * + * @param col The current column + * @return the next tabstop column + */ +static inline size_t next_tab_column(size_t col) +{ + constexpr static auto LCURRENT = LINDENT; + + log_rule_B("output_tab_size"); + return(calc_next_tab_column(col, uncrustify::options::output_tab_size())); +} + + +#endif /* C_PARSE_PROTOTYPES_H_INCLUDED */ |