diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-16 10:21:30 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-17 08:05:44 -0300 |
commit | 76a2fb5667461a8b7fa1abfb5a2c7381ced3f519 (patch) | |
tree | c5f06f37b7019107b9f70f24b5eb9951a5619e17 /src/nvim/api/defs.h | |
parent | a8b0c9e576e9c0155546b03944314449d3f1a5c3 (diff) | |
download | rneovim-76a2fb5667461a8b7fa1abfb5a2c7381ced3f519.tar.gz rneovim-76a2fb5667461a8b7fa1abfb5a2c7381ced3f519.tar.bz2 rneovim-76a2fb5667461a8b7fa1abfb5a2c7381ced3f519.zip |
Use more descriptive names for API primitive types
Instead of exposing native C types to a public API that can be consumed by other
platforms, we are now using the following translation:
int64_t -> Integer
double -> Float
bool -> Boolean
Diffstat (limited to 'src/nvim/api/defs.h')
-rw-r--r-- | src/nvim/api/defs.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/nvim/api/defs.h b/src/nvim/api/defs.h index 914ff3c5d5..3ee50310fb 100644 --- a/src/nvim/api/defs.h +++ b/src/nvim/api/defs.h @@ -2,6 +2,7 @@ #define NVIM_API_DEFS_H #include <stdint.h> +#include <stdbool.h> #include <string.h> // Basic types @@ -10,14 +11,18 @@ typedef struct { bool set; } Error; +typedef bool Boolean; +typedef int64_t Integer; +typedef double Float; + typedef struct { char *data; size_t size; } String; -typedef int64_t Buffer; -typedef int64_t Window; -typedef int64_t Tabpage; +typedef Integer Buffer; +typedef Integer Window; +typedef Integer Tabpage; typedef struct object Object; @@ -27,7 +32,7 @@ typedef struct { } StringArray; typedef struct { - int64_t row, col; + Integer row, col; } Position; typedef struct { @@ -44,8 +49,8 @@ typedef struct { typedef enum { kObjectTypeNil, - kObjectTypeBool, - kObjectTypeInt, + kObjectTypeBoolean, + kObjectTypeInteger, kObjectTypeFloat, kObjectTypeString, kObjectTypeArray, @@ -55,9 +60,9 @@ typedef enum { struct object { ObjectType type; union { - bool boolean; - int64_t integer; - double floating_point; + Boolean boolean; + Integer integer; + Float floating; String string; Array array; Dictionary dictionary; |