search for: camlparam1

Displaying 20 results from an estimated 123 matches for "camlparam1".

2017 Feb 07
0
[PATCH v2 2/7] Move xml and xpath_helpers OCAML code to mllib
...am is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,7 +53,7 @@ static struct custom_operations docptr_custom_operations = { }; value -v2v_xml_free_docptr (value docv) +mllib_xml_free_docptr (value docv) { CAMLparam1 (docv); xmlDocPtr doc = docptr_val (docv); @@ -74,7 +75,7 @@ static struct custom_operations xpathctxptr_custom_operations = { }; value -v2v_xml_free_xpathctxptr (value xpathctxv) +mllib_xml_free_xpathctxptr (value xpathctxv) { CAMLparam1 (xpathctxv); xmlXPathContextPtr xpathctx = xpa...
2010 Jun 28
8
[PATCH] add xl ocaml bindings
...+void failwith_xl(char *log_data) +{ + char s[1024]; + snprintf(s, 1024, "proper logging not implemented yet: error in %s", log_data); + caml_raise_with_string(*caml_named_value("xl.error"), log_data); +} + +static int string_string_tuple_array_val (char ***c_val, value v) +{ + CAMLparam1(v); + CAMLlocal1(a); + int i; + char **array; + + for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1)) { i++; } + + array = calloc((i + 1) * 2, sizeof(char *)); + if (!array) + return 1; + for (i = 0, a = Field(v, 5); a != Val_emptylist; a = Field(a, 1), i++) { + value b = Field(a, 0...
2009 Nov 28
1
PROTECT and OCaml GC.
...T 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 value to Objective Caml. It seems to me that I should be writing: > CAMLprim value r_findvar (value symbol) { > /* The findVar function is defined in e...
2015 Jun 25
0
[PATCH v2] v2v: Free XML objects in the correct order.
...custom_operations doc_custom_operations = { (char *) "doc_custom_operations", - doc_finalize, + custom_finalize_default, custom_compare_default, custom_hash_default, custom_serialize_default, custom_deserialize_default }; +value +v2v_xml_free_doc_ptr (value docv) +{ + CAMLparam1 (docv); + xmlDocPtr doc = Doc_val (docv); + + xmlFreeDoc (doc); + CAMLreturn (Val_unit); +} + /* xmlXPathContextPtr type */ -#define Xpathctx_val(v) (*((xmlXPathContextPtr *)Data_custom_val(v))) +#define Xpathctx_ptr_val(v) (*((xmlXPathContextPtr *)Data_custom_val(v))) -static void -xpathctx_...
2015 Jun 25
0
[PATCH] v2v: Free XML objects in the correct order.
...uct custom_operations doc_custom_operations = { (char *) "doc_custom_operations", - doc_finalize, + custom_finalize_default, custom_compare_default, custom_hash_default, custom_serialize_default, custom_deserialize_default }; +value +v2v_xml_free_doc (value docv) +{ + CAMLparam1 (docv); + xmlDocPtr doc = Doc_val (docv); + + xmlFreeDoc (doc); + CAMLreturn (Val_unit); +} + /* xmlXPathContextPtr type */ -#define Xpathctx_val(v) (*((xmlXPathContextPtr *)Data_custom_val(v))) +#define Xpathctx_ptr_val(v) (*((xmlXPathContextPtr *)Data_custom_val(v))) -static void -xpathctx_...
2015 Jun 25
2
[PATCH v2] v2v: Free XML objects in the correct order.
In version 2: - No substantial change, I just tidied up the code a bit. - Removed one case where whitespace changes had crept in. Rich.
2017 Mar 13
0
[PATCH] mllib: Add a binding for realpath(3).
...; +extern value guestfs_int_mllib_realpath (value pathv); extern value guestfs_int_mllib_statvfs_free_space (value pathv); /* NB: This is a "noalloc" call. */ @@ -196,6 +198,22 @@ guestfs_int_mllib_mkdtemp (value val_pattern) } value +guestfs_int_mllib_realpath (value pathv) +{ + CAMLparam1 (pathv); + CAMLlocal1 (rv); + char *r; + + r = realpath (String_val (pathv), NULL); + if (r == NULL) + unix_error (errno, (char *) "realpath", pathv); + + rv = caml_copy_string (r); + free (r); + CAMLreturn (rv); +} + +value guestfs_int_mllib_statvfs_free_space (value pathv) {...
2013 Mar 25
86
[PATCH 00/28] libxl: ocaml: improve the bindings
The following series of patches fill in most of the gaps in the OCaml bindings to libxl, to make them useful for clients such as xapi/xenopsd (from XCP). There are a number of bugfixes to the existing bindings as well. I have an experimental version of xenopsd that successfully uses the new bindings. An earlier version of the first half of the series was submitted to the last by Ian Campbell on
2017 Mar 13
2
[PATCH] mllib: Add a binding for realpath(3).
I was planning to use this function to harden the code in v2v/input_ova.ml against malicious OVA files. However I didn't complete that work. Hate to see a good commit go to waste ... Rich.
2017 Jul 31
0
[PATCH v11 02/10] daemon: Embed the ocaml-augeas library in the daemon.
...ugeas_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 (loadpathv, 0)); + + /* Convert list of flags to C. */ + for (; flagsv != Val_int (0);...
2020 Jan 22
4
[v2v PATCH 0/3] Use libosinfo for query device drivers
This patch series integrates libosinfo in virt-v2v to get the list of files for Windows from libosinfo, if possible. The actual data is still from virtio-win, just unpacked. Pino Toscano (3): build: require libosinfo v2v: add a minimal libosinfo interface v2v: try to get windows driver files from libosinfo m4/guestfs-v2v.m4 | 3 + v2v/Makefile.am | 9 +-
2019 Apr 01
2
[PATCH] OCaml tools: fix 3999 -> 3339 typo
...v); /* Interface with the guestfish inspection and decryption code. */ int echo_keys = 0; @@ -108,7 +108,7 @@ guestfs_int_mllib_set_keys_from_stdin (value unitv) } value -guestfs_int_mllib_rfc3999_date_time_string (value unitv) +guestfs_int_mllib_rfc3339_date_time_string (value unitv) { CAMLparam1 (unitv); char buf[64]; diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index de42df600..127180225 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -32,7 +32,7 @@ and key_store_key = external c_inspect_decrypt : Guestfs.t -> int64 -&...
2020 Jan 28
4
[v2v PATCH v2 0/3] Use libosinfo for query device drivers
This patch series integrates libosinfo in virt-v2v to get the list of files for Windows from libosinfo, if possible. The actual data is still from virtio-win, just unpacked. Changes from v1: - adapt to use the priority in libosinfo 1.7.0+ - filter out non-pre-installable drivers - collect all the drivers matching the requirements, not just the first, sorting them by priority like libosinfo does
2018 Feb 15
0
[PATCH] Introduce a wrapper around xmlParseURI.
....h> +#include "libxml2-utils.h" + #pragma GCC diagnostic ignored "-Wmissing-prototypes" /* xmlDocPtr type */ @@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) } } -value -mllib_xml_parse_uri (value strv) +static value +Val_uri (xmlURIPtr uri) { - CAMLparam1 (strv); + CAMLparam0 (); CAMLlocal3 (rv, sv, ov); - xmlURIPtr uri; - - uri = xmlParseURI (String_val (strv)); - if (uri == NULL) - caml_invalid_argument ("parse_uri: unable to parse URI"); rv = caml_alloc_tuple (9); @@ -514,7 +513,37 @@ mllib_xml_parse_uri (value strv)...
2017 Aug 09
0
[PATCH v12 02/11] common: Bundle the ocaml-augeas library for use by the daemon.
...ugeas_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 (loadpathv, 0)); + + /* Convert list of flags to C. */ + for (; flagsv != Val_int (0);...
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...ssage = (char *) fn; + errp = &err; + } + + rv = Val_virterror (errp); + caml_raise_with_arg (*caml_named_value ("ocaml_libvirt_virterror"), rv); + + /*NOTREACHED*/ + /* Suppresses a compiler warning. */ + (void) caml__frame; +} + +static int +_list_length (value listv) +{ + CAMLparam1 (listv); + int len = 0; + + for (; listv != Val_emptylist; listv = Field (listv, 1), ++len) {} + + CAMLreturnT (int, len); +} + +static value +Val_virconnectcredential (const virConnectCredentialPtr cred) +{ + CAMLparam0 (); + CAMLlocal1 (rv); + + rv = caml_alloc (4, 0); + Store_field (rv, 0...
2018 Nov 02
0
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
....h> +#include "libxml2-utils.h" + #pragma GCC diagnostic ignored "-Wmissing-prototypes" /* xmlDocPtr type */ @@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) } } -value -mllib_xml_parse_uri (value strv) +static value +Val_uri (xmlURIPtr uri) { - CAMLparam1 (strv); + CAMLparam0 (); CAMLlocal3 (rv, sv, ov); - xmlURIPtr uri; - - uri = xmlParseURI (String_val (strv)); - if (uri == NULL) - caml_invalid_argument ("parse_uri: unable to parse URI"); rv = caml_alloc_tuple (9); @@ -514,7 +513,37 @@ mllib_xml_parse_uri (value strv)...
2017 Dec 12
1
[PATCH] Introduce a wrapper around xmlParseURI.
An alternate solution to: https://www.redhat.com/archives/libguestfs/2017-December/msg00035.html "[PATCH] v2v: -i vmx: Allow ssh URLs to use spaces." is to classify all URLs processed by libguestfs as either ordinary URLs or the special non-standard URLs that we use for things like ‘virt-v2v -i vmx’ and ‘guestfish --add’. For the non-standard URLs, provide a wrapper around
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 |
2018 Nov 02
2
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
Previously posted: https://www.redhat.com/archives/libguestfs/2017-December/msg00046.html Rich.