diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-23 15:49:25 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-23 16:06:58 -0300 |
commit | 72e3125f452ae7224162da8e940e20b00680d41a (patch) | |
tree | 0838c44afc2ebdb583585f6522248ed2efdff397 /src/nvim/api/private/defs.h | |
parent | 399a0e37405a0f68ef3373c8ad9bcfa94ee0f649 (diff) | |
download | rneovim-72e3125f452ae7224162da8e940e20b00680d41a.tar.gz rneovim-72e3125f452ae7224162da8e940e20b00680d41a.tar.bz2 rneovim-72e3125f452ae7224162da8e940e20b00680d41a.zip |
API: Refactor: Move non-public files to private subdirectory
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r-- | src/nvim/api/private/defs.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h new file mode 100644 index 0000000000..3ee50310fb --- /dev/null +++ b/src/nvim/api/private/defs.h @@ -0,0 +1,79 @@ +#ifndef NVIM_API_DEFS_H +#define NVIM_API_DEFS_H + +#include <stdint.h> +#include <stdbool.h> +#include <string.h> + +// Basic types +typedef struct { + char msg[256]; + bool set; +} Error; + +typedef bool Boolean; +typedef int64_t Integer; +typedef double Float; + +typedef struct { + char *data; + size_t size; +} String; + +typedef Integer Buffer; +typedef Integer Window; +typedef Integer Tabpage; + +typedef struct object Object; + +typedef struct { + String *items; + size_t size; +} StringArray; + +typedef struct { + Integer row, col; +} Position; + +typedef struct { + Object *items; + size_t size; +} Array; + +typedef struct key_value_pair KeyValuePair; + +typedef struct { + KeyValuePair *items; + size_t size; +} Dictionary; + +typedef enum { + kObjectTypeNil, + kObjectTypeBoolean, + kObjectTypeInteger, + kObjectTypeFloat, + kObjectTypeString, + kObjectTypeArray, + kObjectTypeDictionary +} ObjectType; + +struct object { + ObjectType type; + union { + Boolean boolean; + Integer integer; + Float floating; + String string; + Array array; + Dictionary dictionary; + } data; +}; + +struct key_value_pair { + String key; + Object value; +}; + + +#endif // NVIM_API_DEFS_H + |