API: Refactor: Register/unregister created/destroyed windows

- Add the 'handle' field to `win_T`
- Add declare/implement functions for registering/unregistering/retrieving
  windows
- Register/unregister windows when they are created/destroyed.
This commit is contained in:
Thiago de Arruda
2014-05-23 15:49:33 -03:00
parent ed99198ff1
commit 20848c4064
4 changed files with 8 additions and 0 deletions

View File

@@ -29,8 +29,10 @@
static uint64_t next_handle = 1;
HANDLE_IMPL(buf_T, buffer)
HANDLE_IMPL(win_T, window)
void handle_init()
{
HANDLE_INIT(buffer);
HANDLE_INIT(window);
}

View File

@@ -10,6 +10,7 @@
void handle_unregister_##name(type *name);
HANDLE_DECLS(buf_T, buffer)
HANDLE_DECLS(win_T, window)
void handle_init(void);