mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
move libuv functions to os.c and io.c module
Despite being an io library, the functions currently implemented with libuv include some non-I/O tasks like getting the total amount of memory.
This commit is contained in:
parent
65e7610655
commit
0f438e42a8
26
src/io.c
Normal file
26
src/io.c
Normal file
@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* io.c -- filesystem access, event loop etc.
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
#include "uv.h"
|
||||
|
||||
int mch_chdir(char *path)
|
||||
{
|
||||
if (p_verbose >= 5) {
|
||||
verbose_enter();
|
||||
smsg((char_u *)"chdir(%s)", path);
|
||||
verbose_leave();
|
||||
}
|
||||
return uv_chdir(path);
|
||||
}
|
27
src/os.c
Normal file
27
src/os.c
Normal file
@ -0,0 +1,27 @@
|
||||
/* 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 "vim.h"
|
||||
|
||||
#include "uv.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;
|
||||
}
|
@ -32,8 +32,6 @@
|
||||
|
||||
#include "os_unixx.h" /* unix includes for os_unix.c only */
|
||||
|
||||
#include "uv.h"
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
# include <selinux/selinux.h>
|
||||
static int selinux_enabled = -1;
|
||||
@ -222,16 +220,6 @@ static struct signalinfo {
|
||||
{-1, "Unknown!", FALSE}
|
||||
};
|
||||
|
||||
int mch_chdir(char *path)
|
||||
{
|
||||
if (p_verbose >= 5) {
|
||||
verbose_enter();
|
||||
smsg((char_u *)"chdir(%s)", path);
|
||||
verbose_leave();
|
||||
}
|
||||
return uv_chdir(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write s[len] to the screen.
|
||||
*/
|
||||
@ -333,17 +321,6 @@ int mch_char_avail() {
|
||||
return WaitForChar(0L);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
void mch_delay(long msec, int ignoreinput)
|
||||
{
|
||||
int old_tmode;
|
||||
|
Loading…
Reference in New Issue
Block a user