summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-05-29 13:40:20 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-05-29 13:50:17 -0300
commit9cc248a1aff11af92902093d2991e462f36f72fa (patch)
treec0b7170c97b751abf2697fcf2d5d16c1184745a9 /docs
parent6a72e73d0ca6a34e541cc4bec322458555b5d5d6 (diff)
downloadgnome-control-center-9cc248a1aff11af92902093d2991e462f36f72fa.tar.gz
docs: Improve code style guideline
Diffstat (limited to 'docs')
-rw-r--r--docs/HACKING.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/HACKING.md b/docs/HACKING.md
index cf9265f50..880c3fcd5 100644
--- a/docs/HACKING.md
+++ b/docs/HACKING.md
@@ -23,6 +23,48 @@ Comment blocks should be formatted as following:
*/
```
+## Structs and Enums
+
+Structures and enums are formatted as following:
+
+```c
+struct _FooBar
+{
+ guint32 field_one;
+ gchar *text;
+};
+
+typedef struct
+{
+ FooParent parent;
+
+ guint32 field_one;
+ gchar *text;
+
+ struct
+ {
+ CustomType *something;
+ guint something_else;
+ } inner_struct;
+
+ gboolean flag : 1;
+} FooBar;
+
+enum
+{
+ FIRST,
+ SECOND,
+ LAST,
+};
+
+typedef enum
+{
+ FOO_BAR_FIRST,
+ FOO_BAR_SECOND,
+ FOO_BAR_LAST,
+} FooEnumBar;
+```
+
## Header (.h) files
It is organized by the following structure: