diff options
| author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-02-24 22:17:46 -0300 |
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-02-24 22:17:46 -0300 |
| commit | c067e5580b26410eb3130f716f55c4e4d0831d51 (patch) | |
| tree | 491ae7cb6982fa7ccd615a7f3c84736da538b7c3 /src/os | |
| parent | 0f438e42a839d67b1c66ceb2817ae90b0a368c2a (diff) | |
| download | rneovim-c067e5580b26410eb3130f716f55c4e4d0831d51.tar.gz rneovim-c067e5580b26410eb3130f716f55c4e4d0831d51.tar.bz2 rneovim-c067e5580b26410eb3130f716f55c4e4d0831d51.zip | |
Create new OS module
This module will contain all functions that perform OS calls such as IO,
filesystem access, etc.
Diffstat (limited to 'src/os')
| -rw-r--r-- | src/os/fs.c | 25 | ||||
| -rw-r--r-- | src/os/mem.c | 26 | ||||
| -rw-r--r-- | src/os/os.h | 4 |
3 files changed, 55 insertions, 0 deletions
diff --git a/src/os/fs.c b/src/os/fs.c new file mode 100644 index 0000000000..358b07e57b --- /dev/null +++ b/src/os/fs.c @@ -0,0 +1,25 @@ +/* vi:set ts=8 sts=4 sw=4: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * fs.c -- filesystem access + */ + +#include <uv.h> + +#include "os.h" + +int mch_chdir(char *path) { + if (p_verbose >= 5) { + verbose_enter(); + smsg((char_u *)"chdir(%s)", path); + verbose_leave(); + } + return uv_chdir(path); +} diff --git a/src/os/mem.c b/src/os/mem.c new file mode 100644 index 0000000000..20abd58261 --- /dev/null +++ b/src/os/mem.c @@ -0,0 +1,26 @@ +/* vi:set ts=8 sts=4 sw=4: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * os.c -- OS-level calls to query hardware, etc. + */ + +#include <uv.h> + +#include "os.h" + +/* + * Return total amount of memory available in Kbyte. + * Doesn't change when memory has been allocated. + */ +long_u mch_total_mem(int special) { + /* We need to return memory in *Kbytes* but uv_get_total_memory() returns the + * number of bytes of total memory. */ + return uv_get_total_memory() >> 10; +} diff --git a/src/os/os.h b/src/os/os.h new file mode 100644 index 0000000000..f344f180df --- /dev/null +++ b/src/os/os.h @@ -0,0 +1,4 @@ +#include "../vim.h" + +long_u mch_total_mem(int special); +int mch_chdir(char *path); |