summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/align_init_brace.h
diff options
context:
space:
mode:
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/align_init_brace.h')
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/align_init_brace.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/align_init_brace.h b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/align_init_brace.h
new file mode 100644
index 00000000..6c0c4909
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/align_init_brace.h
@@ -0,0 +1,49 @@
+/**
+ * @file align_init_brace.h
+ *
+ * @author Guy Maurel
+ * split from align.cpp
+ * @author Ben Gardner
+ * @license GPL v2+
+ */
+
+#ifndef ALIGN_INIT_BRACE_H_INCLUDED
+#define ALIGN_INIT_BRACE_H_INCLUDED
+
+#include "uncrustify_types.h"
+
+/**
+ * Generically aligns on '=', '{', '(' and item after ','
+ * It scans the first line and picks up the location of those tags.
+ * It then scans subsequent lines and adjusts the column.
+ * Finally it does a second pass to align everything.
+ *
+ * Aligns all the '=' signs in structure assignments.
+ * a = {
+ * .a = 1;
+ * .type = fast;
+ * };
+ *
+ * And aligns on '{', numbers, strings, words.
+ * colors[] = {
+ * {"red", {255, 0, 0}}, {"blue", { 0, 255, 0}},
+ * {"green", { 0, 0, 255}}, {"purple", {255, 255, 0}},
+ * };
+ *
+ * For the C99 indexed array assignment, the leading []= is skipped (no aligning)
+ * struct foo_t bars[] =
+ * {
+ * [0] = { .name = "bar",
+ * .age = 21 },
+ * [1] = { .name = "barley",
+ * .age = 55 },
+ * };
+ *
+ * NOTE: this assumes that spacing is at the minimum correct spacing (ie force)
+ * if it isn't, some extra spaces will be inserted.
+ *
+ * @param start Points to the open brace chunk
+ */
+void align_init_brace(chunk_t *start);
+
+#endif /* ALIGN_INIT_BRACE_H_INCLUDED */