mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
Create new OS module
This module will contain all functions that perform OS calls such as IO, filesystem access, etc.
This commit is contained in:
@ -10,9 +10,9 @@ endforeach()
|
||||
list(REMOVE_ITEM NEOVIM_SOURCES ${to_remove})
|
||||
list(APPEND NEOVIM_SOURCES "${PROJECT_BINARY_DIR}/config/auto/pathdef.c")
|
||||
|
||||
file( GLOB IO_SOURCES io/*.c )
|
||||
file( GLOB OS_SOURCES os/*.c )
|
||||
|
||||
add_executable (nvim ${NEOVIM_SOURCES} ${IO_SOURCES})
|
||||
add_executable (nvim ${NEOVIM_SOURCES} ${OS_SOURCES})
|
||||
|
||||
target_link_libraries (nvim m uv ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
#include "os/os.h"
|
||||
|
||||
|
||||
static int diff_busy = FALSE; /* ex_diffgetput() is busy */
|
||||
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
#include "os/os.h"
|
||||
|
||||
static int quitmore = 0;
|
||||
static int ex_pressedreturn = FALSE;
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include "vim.h"
|
||||
#include "version.h"
|
||||
#include "os/os.h"
|
||||
|
||||
static char_u *vim_version_dir __ARGS((char_u *vimdir));
|
||||
static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name));
|
||||
|
@ -11,6 +11,7 @@
|
||||
* misc2.c: Various functions.
|
||||
*/
|
||||
#include "vim.h"
|
||||
#include "os/os.h"
|
||||
|
||||
static char_u *username = NULL; /* cached result of mch_get_user_name() */
|
||||
|
||||
|
@ -8,15 +8,14 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* io.c -- filesystem access, event loop etc.
|
||||
* fs.c -- filesystem access
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
#include <uv.h>
|
||||
|
||||
#include "uv.h"
|
||||
#include "os.h"
|
||||
|
||||
int mch_chdir(char *path)
|
||||
{
|
||||
int mch_chdir(char *path) {
|
||||
if (p_verbose >= 5) {
|
||||
verbose_enter();
|
||||
smsg((char_u *)"chdir(%s)", path);
|
@ -11,16 +11,15 @@
|
||||
* os.c -- OS-level calls to query hardware, etc.
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
#include <uv.h>
|
||||
|
||||
#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)
|
||||
{
|
||||
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;
|
4
src/os/os.h
Normal file
4
src/os/os.h
Normal file
@ -0,0 +1,4 @@
|
||||
#include "../vim.h"
|
||||
|
||||
long_u mch_total_mem(int special);
|
||||
int mch_chdir(char *path);
|
@ -28,6 +28,7 @@
|
||||
# define select select_declared_wrong
|
||||
|
||||
#include "vim.h"
|
||||
#include "os/os.h"
|
||||
|
||||
|
||||
#include "os_unixx.h" /* unix includes for os_unix.c only */
|
||||
|
@ -1,9 +1,7 @@
|
||||
/* os_unix.c */
|
||||
int mch_chdir __ARGS((char *path));
|
||||
void mch_write __ARGS((char_u *s, int len));
|
||||
int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt));
|
||||
int mch_char_avail __ARGS((void));
|
||||
long_u mch_total_mem __ARGS((int special));
|
||||
void mch_delay __ARGS((long msec, int ignoreinput));
|
||||
int mch_stackcheck __ARGS((char *p));
|
||||
void mch_startjmp __ARGS((void));
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
#include "os/os.h"
|
||||
|
||||
static int path_is_url __ARGS((char_u *p));
|
||||
static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
|
||||
|
Reference in New Issue
Block a user