search for: camlprim

Displaying 20 results from an estimated 38 matches for "camlprim".

2019 Dec 16
4
[PATCH 0/2] Move ocaml-augeas copy to libguestfs repo
ocaml-augeas is used only by virtlibguestfs, so move it to this repository, instead of having it around in the common submodule. The removal from common will happen later. Pino Toscano (2): Bundle the ocaml-augeas library for use by libguestfs build: switch embedded copy of ocaml-augeas .gitignore | 1 + 3rdparty/ocaml-augeas/COPYING.LIB | 515
2019 May 30
5
[PATCH 0/5] RFC: switch augeas APIs to OCaml
This synchronizes the embedded ocaml-augeas copy, and reimplements the augeas APIs using it (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Pino Toscano (5): common/mlaugeas: Synchronize with latest ocaml-augeas daemon: fix/enhance error reporting of Augeas exceptions Revert "Revert "daemon: implement
2017 Jul 31
0
[PATCH v11 02/10] daemon: Embed the ocaml-augeas library in the daemon.
...const int max = 1; + + rv = caml_alloc_custom (&custom_operations, + sizeof (augeas_t), used, max); + Augeas_t_val(rv) = t; + + CAMLreturn (rv); +} + +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + +/* val create : string -> string option -> flag list -> t */ +CAMLprim value +ocaml_augeas_create (value rootv, value loadpathv, value flagsv) +{ + CAMLparam1 (rootv); + char *root = String_val (rootv); + char *loadpath; + int flags = 0, i; + augeas_t t; + + /* Optional loadpath. */ + loadpath = + loadpathv == Val_int (0) + ? NULL + : String_val (Field...
2009 Aug 28
1
[PATCHES] avoid more warnings
...rator.ml +++ b/src/generator.ml @@ -6770,6 +6770,10 @@ copy_table (char * const * argv) let needs_extra_vs = match fst style with RConstOptString _ -> true | _ -> false in + pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n"; + pr "CAMLprim value ocaml_guestfs_%s (value %s" name (List.hd params); + List.iter (pr ", value %s") (List.tl params); pr ");\n"; + pr "CAMLprim value\n"; pr "ocaml_guestfs_%s (value %s" name (List.hd params); List.iter (pr ", value %s&q...
2017 Aug 09
0
[PATCH v12 02/11] common: Bundle the ocaml-augeas library for use by the daemon.
...const int max = 1; + + rv = caml_alloc_custom (&custom_operations, + sizeof (augeas_t), used, max); + Augeas_t_val(rv) = t; + + CAMLreturn (rv); +} + +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + +/* val create : string -> string option -> flag list -> t */ +CAMLprim value +ocaml_augeas_create (value rootv, value loadpathv, value flagsv) +{ + CAMLparam1 (rootv); + char *root = String_val (rootv); + char *loadpath; + int flags = 0, i; + augeas_t t; + + /* Optional loadpath. */ + loadpath = + loadpathv == Val_int (0) + ? NULL + : String_val (Field...
2009 Nov 28
1
PROTECT and OCaml GC.
Hello. In the writing of my OCaml-R binding, I'm sort of confused when it comes to the use of the PROTECT and UNPROTECT macros. Basically, I have C stub functions that are in charge of calling R for everything. Here's a simple example: > CAMLprim value r_findvar (value symbol) { > /* The findVar function is defined in envir.c. It looks up a symbol > in an environment. */ > CAMLparam1(symbol); > CAMLreturn(Val_sexp(findVar(Sexp_val(symbol), R_GlobalEnv))); > } This simply makes a call to findVar and returns the val...
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...= gen_arg_names ($sig); + my $nr_arg_names = scalar @arg_names; + my $arg_names = join ", ", @arg_names; + my $arg_names_as_values = join (", ", map { "value $_" } @arg_names); + + # Generate the start of the function, arguments. + print F <<END; +CAMLprim value +$c_external_name ($arg_names_as_values) +{ + CAMLparam$nr_arg_names ($arg_names); +END + + # Generate the internals of the function. + print F (gen_c_code ($sig, $c_name)); + + # Finish off the function. + print F <<END; +} + +END +} + +#-----------------------------------...
2013 Mar 13
0
[PATCH 3 of 4] PoC: libxc+ocaml: add interfaces to send triggers to HVM guests
...= "stub_xc_hvm_check_pvdriver" external version : handle -> version = "stub_xc_version_version" diff -r b279ec057736 -r 03997417771b tools/ocaml/libs/xc/xenctrl_stubs.c --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -1247,6 +1247,20 @@ CAMLprim value stub_xc_domain_set_vpt_al CAMLreturn(Val_unit); } +CAMLprim value stub_xc_domain_trigger_power(value xch, value domid) +{ + CAMLparam2(xch, domid); + xc_domain_trigger_power(_H(xch), _D(domid)); + CAMLreturn(Val_unit); +} + +CAMLprim value stub_xc_domain_trigger_sleep(value xch, v...
2019 Dec 16
3
[v2v PATCH 0/2] Move libvirt-ocaml copy to v2v repo
libvirt-ocaml is used only by virt-v2v, so move it to this repository, instead of having it around in the common submodule. The removal from common will happen later. Pino Toscano (2): common: Bundle the libvirt-ocaml library for use by virt-v2v build: switch embedded copy of libvirt-ocaml .gitignore | 2 + 3rdparty/libvirt-ocaml/Makefile.am |
2019 May 20
8
[PATCH v5 0/7] v2v: switch to ocaml-libvirt
Hi, this series switches virt-2v to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not test all
2018 Nov 27
8
[PATCH v2 0/7] RFC: switch v2v to ocaml-libvirt
Hi, this is a mostly done attempt to switch to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not
2019 Jan 30
8
[PATCH v3 0/7] RFC: switch v2v to ocaml-libvirt
Hi, this is a mostly done attempt to switch to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not
2019 Apr 08
12
[PATCH 43 0/7] v2v: switch to ocaml-libvirt
Hi, this series switches virt-2v to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not test all
2010 Aug 18
0
[LLVMdev] a typo in OCaml bindings
Hi, revision 111418 binding/ocaml/llvm/llvm_ocaml.c /* llvalue -> int -> llvalue */ CAMLprim value llvm_params(LLVMValueRef Fn, value Index) { value Params = alloc(LLVMCountParams(Fn), 0); LLVMGetParams(Fn, (LLVMValueRef *) Op_val(Params)); return Params; } does not match the interface at binding/ocaml/llvm/llvm.ml external params : llvalue -> llvalue array = "llvm_params&q...
2009 Nov 18
1
R_NilValue and segfault.
...nil object */ > LibExtern SEXP R_UnboundValue; /* Unbound marker */ > LibExtern SEXP R_MissingArg; /* Missing argument marker */ So, in my r_data.c file, I have: -1- an #include directive. > #include <Rinternals.h> -2- the function wrapping R data in OCaml data > CAMLprim value Val_sexp (SEXP sexp) > { > CAMLparam0(); > CAMLlocal1(result); > result = caml_alloc(1, Abstract_tag); > Field(result, 0) = (value) sexp; > /* Do not use Val_long in the above statement, > as it will drop the top bit. See mlvalues.h. */ > CAMLretur...
2018 Aug 30
8
[PATCH 0/7] RFC: switch v2v to ocaml-libvirt
Hi, this is a mostly done attempt to switch to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not
2009 Aug 27
1
[PATCH 4/4] build: enable gcc warnings in capitests/ and ocaml/
...estfs_c.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c index 62d42d3..80dcf99 100644 --- a/ocaml/guestfs_c.c +++ b/ocaml/guestfs_c.c @@ -42,6 +42,10 @@ }while(0) #endif +/* These prototypes are solely to quiet gcc warning. */ +CAMLprim value ocaml_guestfs_create (void); +CAMLprim value ocaml_guestfs_close (value gv); + /* Allocate handles and deal with finalization. */ static void guestfs_finalize (value gv) -- 1.6.4.1.359.g4fc77 >From e933691fd1c1a5543c05fcd209ce57daf6cac4f7 Mon Sep 17 00:00:00 2001 From: Jim Meyering &l...
2010 Oct 25
0
[LLVMdev] Ocaml bindings for execution engines
Hi All, Here is the code from bindings/ocam/executionengine/executionengine_ocaml.c. /* llvalue -> GenericValue.t array -> ExecutionEngine.t -> GenericValue.t */ CAMLprim value llvm_ee_run_function(LLVMValueRef F, value Args, LLVMExecutionEngineRef EE) { unsigned NumArgs; LLVMGenericValueRef Result, *GVArgs; unsigned I; NumArgs = Wosize_val(Args); GVArgs = (LLVMGenericValueRef*) malloc(NumArgs * sizeof(LLVMGenericValueR...
2019 May 29
0
[PATCH 3/3] daemon: implement OptString for OCaml APIs
...ons(+), 1 deletion(-) diff --git a/generator/daemon.ml b/generator/daemon.ml index a4e136aaa..c2b7c79a2 100644 --- a/generator/daemon.ml +++ b/generator/daemon.ml @@ -600,6 +600,22 @@ let generate_daemon_caml_stubs () = #include \"actions.h\" #include \"daemon-c.h\" +static CAMLprim value +Val_optstring (const char *s) +{ + CAMLparam0 (); + CAMLlocal2 (optv, v); + + if (s) { /* Return Some val */ + v = caml_copy_string (s); + optv = caml_alloc (1, 0); + Field (optv, 0) = v; + } else /* Return None */ + optv = Val_int (0); + + CAMLreturn (optv); +} + ";...
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch: https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html This adds OCaml and Perl bindings (both tested), support for progress bars in virt-resize, and adds progress notifications to a number of the simpler commands. Still to do is to add progress messages to more commands. There are still a few commands which would be