From 572e5448a8a58665d8ddd68800b6620e5ecc0509 Mon Sep 17 00:00:00 2001 From: TACIXAT <982598+TACIXAT@users.noreply.github.com> Date: Tue, 26 Nov 2019 15:31:01 -0800 Subject: Content for Types & Structures user guide page. *insert passive aggressive snapchat of empty docs page here* --- docs/guide/type.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'docs') diff --git a/docs/guide/type.md b/docs/guide/type.md index 65121864..2ba5ce36 100644 --- a/docs/guide/type.md +++ b/docs/guide/type.md @@ -1,2 +1,42 @@ # Types and Structures +The types view can be opened from the top menu `View > Types`. From here you can create structures, unions, and types using C-style syntax. + +## Shortcuts and Attributes + +The creation shortcuts in this view are as follows. + +* `S` - Create new structure +* `I` - Create new type +* `Shift+S` - Creating a new union + +The shortcuts for editing are as follows. + +* `Y` - Edit type / field +* `N` - Rename type / field +* `L` - Set structure size +* `U` - undefine field. + +Structs support the attribute `__packed` to indicate that there is no padding. + +## Examples + +```C +enum _flags +{ + F_X = 0x1, + F_W = 0x2, + F_R = 0x4 +}; +``` + +```C +struct Header __packed +{ + char *name; + uint32_t version; + void (* callback)(); + uint16_t size; + enum _flags flags; +}; +``` -- cgit v1.3.1