diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-05-09 00:39:17 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-09 00:39:17 +0200 | 
| commit | 0e873a30f3072dbacfb700f1e331a8c8396f2e1f (patch) | |
| tree | 557792d454fef510a90975bed4e7d1650ee26c4f /src/nvim/api/private/defs.h | |
| parent | a9981e0e7e9439340bb8c0162f860b78d8002559 (diff) | |
| parent | 5b6d598ca8301682d931539ecd6da6a9fabae569 (diff) | |
| download | rneovim-0e873a30f3072dbacfb700f1e331a8c8396f2e1f.tar.gz rneovim-0e873a30f3072dbacfb700f1e331a8c8396f2e1f.tar.bz2 rneovim-0e873a30f3072dbacfb700f1e331a8c8396f2e1f.zip | |
Merge #4411 from ZyX-I/luaviml'/lua
Diffstat (limited to 'src/nvim/api/private/defs.h')
| -rw-r--r-- | src/nvim/api/private/defs.h | 34 | 
1 files changed, 28 insertions, 6 deletions
| diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index 60bf38265f..2144c80d6a 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -5,6 +5,8 @@  #include <stdbool.h>  #include <string.h> +#include "nvim/func_attr.h" +  #define ARRAY_DICT_INIT {.size = 0, .capacity = 0, .items = NULL}  #define STRING_INIT {.data = NULL, .size = 0}  #define OBJECT_INIT { .type = kObjectTypeNil } @@ -36,8 +38,27 @@ typedef enum {  /// Used as the message ID of notifications.  #define NO_RESPONSE UINT64_MAX -/// Used as channel_id when the call is local. -#define INTERNAL_CALL UINT64_MAX +/// Mask for all internal calls +#define INTERNAL_CALL_MASK (((uint64_t)1) << (sizeof(uint64_t) * 8 - 1)) + +/// Internal call from VimL code +#define VIML_INTERNAL_CALL INTERNAL_CALL_MASK + +/// Internal call from lua code +#define LUA_INTERNAL_CALL (VIML_INTERNAL_CALL + 1) + +static inline bool is_internal_call(uint64_t channel_id) +  REAL_FATTR_ALWAYS_INLINE REAL_FATTR_CONST; + +/// Check whether call is internal +/// +/// @param[in]  channel_id  Channel id. +/// +/// @return true if channel_id refers to internal channel. +static inline bool is_internal_call(const uint64_t channel_id) +{ +  return !!(channel_id & INTERNAL_CALL_MASK); +}  typedef struct {    ErrorType type; @@ -78,16 +99,17 @@ typedef struct {  } Dictionary;  typedef enum { -  kObjectTypeBuffer, -  kObjectTypeWindow, -  kObjectTypeTabpage, -  kObjectTypeNil, +  kObjectTypeNil = 0,    kObjectTypeBoolean,    kObjectTypeInteger,    kObjectTypeFloat,    kObjectTypeString,    kObjectTypeArray,    kObjectTypeDictionary, +  // EXT types, cannot be split or reordered, see #EXT_OBJECT_TYPE_SHIFT +  kObjectTypeBuffer, +  kObjectTypeWindow, +  kObjectTypeTabpage,  } ObjectType;  struct object { | 
