Typedefs | Functions | Variables
dl.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <uv.h>
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/os/dl.h"
#include "nvim/os/os.h"


typedef void(* gen_fn) (void)
 Functions for using external native libraries. More...
typedef int(* str_int_fn) (const char *str)
typedef int(* int_int_fn) (int i)


bool os_libcall (const char *libname, const char *funcname, const char *argv, int argi, char **str_out, int *int_out)


const typedef char *(* str_str_fn )(const char *str)
const typedef char *(* int_str_fn )(int i)

Typedef Documentation

◆ gen_fn

typedef void(* gen_fn) (void)

Functions for using external native libraries.

possible function prototypes that can be called by os_libcall() int -> int int -> string string -> string string -> int

◆ int_int_fn

typedef int(* int_int_fn) (int i)

◆ str_int_fn

typedef int(* str_int_fn) (const char *str)

Function Documentation

◆ os_libcall()

bool os_libcall ( const char *  libname,
const char *  funcname,
const char *  argv,
int  argi,
char **  str_out,
int *  int_out 

os_libcall - call a function in a dynamic loadable library

an example of calling a function that takes a string and returns an int:

int int_out = 0; os_libcall("mylib.so", "somefn", "string-argument", 0, NULL, &int_out);

libnamethe name of the library to load (e.g.: libsomething.so)
funcnamethe name of the library function (e.g.: myfunc)
argvthe input string, NULL when using argi
argithe input integer, not used when using argv != NULL
[out]str_outan allocated output string, caller must free if not NULL. NULL when using int_out.
[out]int_outthe output integer param
true on success, false on failure

Variable Documentation

◆ int_str_fn

const typedef char*(* int_str_fn) (int i)

◆ str_str_fn

const typedef char*(* str_str_fn) (const char *str)