From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567500196; cv=none; d=zoho.com; s=zohoarc; b=MEZ2NC+2LCnkWUZmAK+aeKz3tJHrFoI5ZGtVDmEFnvDiEU0KJXHICZ0ceaOAqlvtzHoIpghuOrwxLjqlnoi0xPkzP33yVQJle9nHiOnXqGVssYa52APiPaiWw4zK596/uu2kmibkcNqMETuaZYzuPCIqCLJlOwXVpp/B6hutV2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567500196; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BYmxo1Ja6TQPEMwxGd97jzdysS8PoSaa8aBKEYTHBHA=; b=egAxaBPUzshCBjLC5h80NKt01pjSoKbZ9PETxmLnQisO/VrmlbXkVf6IjPqOEZ4xrtDRit+w6p+mZ5r6RHw5Uv2LXflwxedas/liDGBjKXgZxwNsIILc8vOjdgEY7vyqrQkXL4fLX/gd2gBkiUW6uh2LiqAanXD8B4enug9Hn/c= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567500196876957.1335595990942; Tue, 3 Sep 2019 01:43:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 879FE3001A9A; Tue, 3 Sep 2019 08:43:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B3076012A; Tue, 3 Sep 2019 08:43:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0315F180221D; Tue, 3 Sep 2019 08:43:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x838hD6m030014 for ; Tue, 3 Sep 2019 04:43:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 885845D6D0; Tue, 3 Sep 2019 08:43:13 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD45B5D6B7; Tue, 3 Sep 2019 08:43:12 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 10:43:01 +0200 Message-Id: <20190903084306.32520-2-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 1/6] Rename libvirt_c_prologue.c to libvirt_c.h X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 03 Sep 2019 08:43:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since it contains prototypes of functions and common macros, just rename it so it will be used as proper general header for multiple sources in the future. Signed-off-by: Pino Toscano --- MANIFEST | 2 +- libvirt/Makefile.in | 2 +- libvirt/README | 8 +++----- libvirt/generator.pl | 2 +- libvirt/{libvirt_c_prologue.c =3D> libvirt_c.h} | 0 5 files changed, 6 insertions(+), 8 deletions(-) rename libvirt/{libvirt_c_prologue.c =3D> libvirt_c.h} (100%) diff --git a/MANIFEST b/MANIFEST index e969dd5..c026fef 100644 --- a/MANIFEST +++ b/MANIFEST @@ -19,9 +19,9 @@ gitlog-to-changelog install-sh libvirt/.depend libvirt/generator.pl +libvirt/libvirt_c.h libvirt/libvirt_c_epilogue.c libvirt/libvirt_c_oneoffs.c -libvirt/libvirt_c_prologue.c libvirt/libvirt.ml libvirt/libvirt.mli libvirt/libvirt_version.ml.in diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in index f255ee2..8451c5d 100644 --- a/libvirt/Makefile.in +++ b/libvirt/Makefile.in @@ -104,7 +104,7 @@ libvirt_c.c: generator.pl $(PERL) -w $< =20 # Extra dependencies. -libvirt_c.c: libvirt_c_prologue.c +libvirt_c.c: libvirt_c.h libvirt_c.c: libvirt_c_oneoffs.c libvirt_c.c: libvirt_c_epilogue.c =20 diff --git a/libvirt/README b/libvirt/README index be8300d..0109940 100644 --- a/libvirt/README +++ b/libvirt/README @@ -10,6 +10,9 @@ documentation starting at html/index.html. 'libvirt_c*.c' are the C functions which map OCaml objects to C objects and vice versa (see next section). =20 +'libvirt_c.h' contains prototypes of common functions defined +in the epilogue (see below), and provides some general macros. + Generated code -------------- =20 @@ -27,11 +30,6 @@ directory to find out how we're doing. The generated 'libvirt_c.c' #includes some other C files in this directory: =20 - #include "libvirt_c_prologue.c" - - A prologue that prototypes some static functions which are defined - in the epilogue (see below), and provides some general macros. - #include "libvirt_c_oneoffs.c" =20 One-off bindings: Bindings which are too specialised or one-of-a-kind diff --git a/libvirt/generator.pl b/libvirt/generator.pl index 279331a..92d5a64 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -249,7 +249,7 @@ print F <<'END'; #include #include =20 -#include "libvirt_c_prologue.c" +#include "libvirt_c.h" =20 #include "libvirt_c_oneoffs.c" =20 diff --git a/libvirt/libvirt_c_prologue.c b/libvirt/libvirt_c.h similarity index 100% rename from libvirt/libvirt_c_prologue.c rename to libvirt/libvirt_c.h --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567500200; cv=none; d=zoho.com; s=zohoarc; b=XA4JwUejecSOh/jRzHBRnfSJUmw3tc+P1uIzKvTg2FUUrbU+ZVTVFDqHg5AWNAqT1w1/akLdW3Atu/Eyzx72ZpzJkuEIPhvPKCMVylEXHT197AblSLnCHaacpaehLGD6lGDGRKvpI5v2EpuGe5KOEai7sAfc4+zL17wVkqvE+K4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567500200; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=7GmiQVmG0dYyCFasOrCmWliPuIYCu0Zg+kmUNHf7bMI=; b=np73JZoFDkl60fi9ae4H4T/2HSTI5vWDx+XQS0Tr4cV24B1lamPkcZHwy7HVnw/WZ8jNkQ7RD5jxfdU2EW/UkqenGsNbriX4cn4ww3eShklz+5AQ6eprTYSIUc26Eao4gIbBgpcpNPYEmxdDOYSUsnmSwUqpPoj5OOJRG7M5AE4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567500200966242.4211057697354; Tue, 3 Sep 2019 01:43:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C902D3082126; Tue, 3 Sep 2019 08:43:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A195960C63; Tue, 3 Sep 2019 08:43:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5A73E2551E; Tue, 3 Sep 2019 08:43:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x838hEBO030024 for ; Tue, 3 Sep 2019 04:43:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6ACA5D704; Tue, 3 Sep 2019 08:43:14 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4BFE5D6B7; Tue, 3 Sep 2019 08:43:13 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 10:43:02 +0200 Message-Id: <20190903084306.32520-3-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 2/6] Turn libvirt_c.h as proper header X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 03 Sep 2019 08:43:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" - make sure that all the function declarations are non-static, so the header can be included by more than one C source - move all the common includes there from the generated file from generator.pl - add include guard for it, even if it will not be used in practice Signed-off-by: Pino Toscano --- libvirt/generator.pl | 17 ---------- libvirt/libvirt_c.h | 60 ++++++++++++++++++++++++------------ libvirt/libvirt_c_epilogue.c | 38 +++++++++++------------ 3 files changed, 60 insertions(+), 55 deletions(-) diff --git a/libvirt/generator.pl b/libvirt/generator.pl index 92d5a64..61526c0 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -232,23 +232,6 @@ print F <<'END'; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130= 1 USA */ =20 -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "libvirt_c.h" =20 #include "libvirt_c_oneoffs.c" diff --git a/libvirt/libvirt_c.h b/libvirt/libvirt_c.h index 8533618..541d8e3 100644 --- a/libvirt/libvirt_c.h +++ b/libvirt/libvirt_c.h @@ -18,18 +18,38 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130= 1 USA */ =20 +#ifndef LIBVIRT_C_H +#define LIBVIRT_C_H + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* Please read libvirt/README file. */ =20 -static const char *Optstring_val (value strv); +const char *Optstring_val (value strv); typedef value (*Val_ptr_t) (void *); -static value Val_opt (void *ptr, Val_ptr_t Val_ptr); +value Val_opt (void *ptr, Val_ptr_t Val_ptr); typedef value (*Val_const_ptr_t) (const void *); -static value Val_opt_const (const void *ptr, Val_const_ptr_t Val_ptr); -/*static value option_default (value option, value deflt);*/ -static void _raise_virterror (const char *fn) Noreturn; -static value Val_virterror (virErrorPtr err); -static int _list_length (value listv); -static value Val_virconnectcredential (const virConnectCredentialPtr cred); +value Val_opt_const (const void *ptr, Val_const_ptr_t Val_ptr); +/*value option_default (value option, value deflt);*/ +void _raise_virterror (const char *fn) Noreturn; +value Val_virterror (virErrorPtr err); +int _list_length (value listv); +value Val_virconnectcredential (const virConnectCredentialPtr cred); =20 /* Use this around synchronous libvirt API calls to release the OCaml * lock, allowing other threads to run simultaneously. 'code' must not @@ -106,12 +126,12 @@ static value Val_virconnectcredential (const virConne= ctCredentialPtr cred); #define Sec_val(rv) (*((virSecretPtr *)Data_custom_val(rv))) =20 /* Wrap up a pointer to something in a custom block. */ -static value Val_connect (virConnectPtr conn); -static value Val_dom (virDomainPtr dom); -static value Val_net (virNetworkPtr net); -static value Val_pol (virStoragePoolPtr pool); -static value Val_vol (virStorageVolPtr vol); -static value Val_sec (virSecretPtr sec); +value Val_connect (virConnectPtr conn); +value Val_dom (virDomainPtr dom); +value Val_net (virNetworkPtr net); +value Val_pol (virStoragePoolPtr pool); +value Val_vol (virStorageVolPtr vol); +value Val_sec (virSecretPtr sec); =20 /* Domains and networks are stored as pairs (dom/net, conn), so have * some convenience functions for unwrapping and wrapping them. @@ -127,8 +147,10 @@ static value Val_sec (virSecretPtr sec); #define Connect_volv(rv) (Connect_val(Field((rv),1))) #define Connect_secv(rv) (Connect_val(Field((rv),1))) =20 -static value Val_domain (virDomainPtr dom, value connv); -static value Val_network (virNetworkPtr net, value connv); -static value Val_pool (virStoragePoolPtr pol, value connv); -static value Val_volume (virStorageVolPtr vol, value connv); -static value Val_secret (virSecretPtr sec, value connv); +value Val_domain (virDomainPtr dom, value connv); +value Val_network (virNetworkPtr net, value connv); +value Val_pool (virStoragePoolPtr pol, value connv); +value Val_volume (virStorageVolPtr vol, value connv); +value Val_secret (virSecretPtr sec, value connv); + +#endif diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c index 37efc43..e58f7bb 100644 --- a/libvirt/libvirt_c_epilogue.c +++ b/libvirt/libvirt_c_epilogue.c @@ -20,7 +20,7 @@ =20 /* Please read libvirt/README file. */ =20 -static const char * +const char * Optstring_val (value strv) { if (strv =3D=3D Val_int (0)) /* None */ @@ -29,7 +29,7 @@ Optstring_val (value strv) return String_val (Field (strv, 0)); } =20 -static value +value Val_opt (void *ptr, Val_ptr_t Val_ptr) { CAMLparam0 (); @@ -45,7 +45,7 @@ Val_opt (void *ptr, Val_ptr_t Val_ptr) CAMLreturn (optv); } =20 -static value +value Val_opt_const (const void *ptr, Val_const_ptr_t Val_ptr) { CAMLparam0 (); @@ -62,7 +62,7 @@ Val_opt_const (const void *ptr, Val_const_ptr_t Val_ptr) } =20 #if 0 -static value +value option_default (value option, value deflt) { if (option =3D=3D Val_int (0)) /* "None" */ @@ -72,7 +72,7 @@ option_default (value option, value deflt) } #endif =20 -static void +void _raise_virterror (const char *fn) { CAMLparam0 (); @@ -100,7 +100,7 @@ _raise_virterror (const char *fn) (void) caml__frame; } =20 -static int +int _list_length (value listv) { CAMLparam1 (listv); @@ -111,7 +111,7 @@ _list_length (value listv) CAMLreturnT (int, len); } =20 -static value +value Val_virconnectcredential (const virConnectCredentialPtr cred) { CAMLparam0 (); @@ -196,7 +196,7 @@ Val_err_level (virErrorLevel code) } =20 /* Convert a virterror to a value. */ -static value +value Val_virterror (virErrorPtr err) { CAMLparam0 (); @@ -283,7 +283,7 @@ static struct custom_operations sec_custom_operations = =3D { custom_deserialize_default }; =20 -static value +value Val_connect (virConnectPtr conn) { CAMLparam0 (); @@ -294,7 +294,7 @@ Val_connect (virConnectPtr conn) CAMLreturn (rv); } =20 -static value +value Val_dom (virDomainPtr dom) { CAMLparam0 (); @@ -305,7 +305,7 @@ Val_dom (virDomainPtr dom) CAMLreturn (rv); } =20 -static value +value Val_net (virNetworkPtr net) { CAMLparam0 (); @@ -316,7 +316,7 @@ Val_net (virNetworkPtr net) CAMLreturn (rv); } =20 -static value +value Val_pol (virStoragePoolPtr pol) { CAMLparam0 (); @@ -327,7 +327,7 @@ Val_pol (virStoragePoolPtr pol) CAMLreturn (rv); } =20 -static value +value Val_vol (virStorageVolPtr vol) { CAMLparam0 (); @@ -338,7 +338,7 @@ Val_vol (virStorageVolPtr vol) CAMLreturn (rv); } =20 -static value +value Val_sec (virSecretPtr sec) { CAMLparam0 (); @@ -350,7 +350,7 @@ Val_sec (virSecretPtr sec) } =20 /* This wraps up the (dom, conn) pair (Domain.t). */ -static value +value Val_domain (virDomainPtr dom, value connv) { CAMLparam1 (connv); @@ -364,7 +364,7 @@ Val_domain (virDomainPtr dom, value connv) } =20 /* This wraps up the (net, conn) pair (Network.t). */ -static value +value Val_network (virNetworkPtr net, value connv) { CAMLparam1 (connv); @@ -378,7 +378,7 @@ Val_network (virNetworkPtr net, value connv) } =20 /* This wraps up the (pol, conn) pair (Pool.t). */ -static value +value Val_pool (virStoragePoolPtr pol, value connv) { CAMLparam1 (connv); @@ -392,7 +392,7 @@ Val_pool (virStoragePoolPtr pol, value connv) } =20 /* This wraps up the (vol, conn) pair (Volume.t). */ -static value +value Val_volume (virStorageVolPtr vol, value connv) { CAMLparam1 (connv); @@ -406,7 +406,7 @@ Val_volume (virStorageVolPtr vol, value connv) } =20 /* This wraps up the (sec, conn) pair (Secret.t). */ -static value +value Val_secret (virSecretPtr sec, value connv) { CAMLparam1 (connv); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567500198; cv=none; d=zoho.com; s=zohoarc; b=XD3KUXueu0PYSk9X3ygyv9omA4mRZUW/i1t0RCdwapuxVYLCBTjV8Lq8Lsl5b1wCuBCG+t3Wic7UlfUsD9PaRlDXlvhR5ZThn8moWyM0k353JrbWgQ2/mM33ethqY3DCPbu8g+wuBZBeoiZp608uFhDM8bfswM6j7+cW3QfGeJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567500198; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=84oCnQV5kD1ESfD9o9AvCiEDOn0uwJrLs5JS6nus8K8=; b=furNO2oMIKMS9HTvnVExP1uWKNm96HsiFr26DKXB1ULCOF6zEUR0wQOza/AzRqm/K3xJ7GbYl2I78SmI3lX//w6QUmH3EedN2C5+x3z3rrNCbHNtfImnWWInfqyYNXgsTTVU+cE7+RDRa0QRdlpszNiIolJxXf2Jn8TtTshpIK8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567500198370793.5451035422044; Tue, 3 Sep 2019 01:43:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F15C83082133; Tue, 3 Sep 2019 08:43:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB8D060C05; Tue, 3 Sep 2019 08:43:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8DDA92551D; Tue, 3 Sep 2019 08:43:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x838hFNA030039 for ; Tue, 3 Sep 2019 04:43:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9EA735D6C8; Tue, 3 Sep 2019 08:43:15 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3ADC5D6B7; Tue, 3 Sep 2019 08:43:14 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 10:43:03 +0200 Message-Id: <20190903084306.32520-4-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 3/6] Build C sources separately X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 03 Sep 2019 08:43:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Instead of including everything in a single C source, build all the 3 C sources separately. Signed-off-by: Pino Toscano --- libvirt/Makefile.in | 14 +++++++------- libvirt/README | 28 ++++++---------------------- libvirt/generator.pl | 4 ---- libvirt/libvirt_c_epilogue.c | 2 ++ libvirt/libvirt_c_oneoffs.c | 2 ++ 5 files changed, 17 insertions(+), 33 deletions(-) diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in index 8451c5d..ad56bb5 100644 --- a/libvirt/Makefile.in +++ b/libvirt/Makefile.in @@ -64,10 +64,10 @@ OPTOBJS :=3D libvirt.cmx libvirt_version.cmx =20 ifneq ($(OCAMLMKLIB),) # Good, we can just use ocamlmklib -mllibvirt.cma: libvirt_c.o $(COBJS) +mllibvirt.cma: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o $(COBJ= S) $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) =20 -mllibvirt.cmxa: libvirt_c.o $(OPTOBJS) +mllibvirt.cmxa: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o $(OPT= OBJS) $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) =20 else @@ -83,11 +83,11 @@ mllibvirt.cmxa: libmllibvirt.a $(OPTOBJS) $(OCAMLOPT) -a -linkall -o $@ $(OPTOBJS) \ -cclib -lmllibvirt -cclib "$(LDFLAGS)" =20 -dllmllibvirt.dll: libvirt_c.o +dllmllibvirt.dll: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o $(CC) -shared -o $@ $^ \ $(LDFLAGS) "$(shell ocamlc -where)"/ocamlrun.a =20 -libmllibvirt.a: libvirt_c.o +libmllibvirt.a: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o ar rc $@ $^ ranlib $@ =20 @@ -104,9 +104,9 @@ libvirt_c.c: generator.pl $(PERL) -w $< =20 # Extra dependencies. -libvirt_c.c: libvirt_c.h -libvirt_c.c: libvirt_c_oneoffs.c -libvirt_c.c: libvirt_c_epilogue.c +libvirt_c.o: libvirt_c.h +libvirt_c_oneoffs.o: libvirt_c.h +libvirt_c_epilogue.o: libvirt_c.h =20 # Status of automatically generated bindings. autostatus: libvirt_c.c diff --git a/libvirt/README b/libvirt/README index 0109940..3fb8f53 100644 --- a/libvirt/README +++ b/libvirt/README @@ -7,12 +7,15 @@ documentation starting at html/index.html. =20 'libvirt.ml' describes how OCaml functions map to C functions. =20 -'libvirt_c*.c' are the C functions which map OCaml objects to C -objects and vice versa (see next section). - 'libvirt_c.h' contains prototypes of common functions defined in the epilogue (see below), and provides some general macros. =20 +'libvirt_c_epilogue.c' contains some standard functions (eg.) for +wrapping and unwrapping libvirt objects. + +'libvirt_c_oneoffs.c' contains bindings which are too specialised or +one-of-a-kind to be worth generating automatically. + Generated code -------------- =20 @@ -26,22 +29,3 @@ there are a few one-off bindings (eg. one-of-a-type func= tions, functions with particularly complex mappings). Our eventual aim to is autogenerate as much as possible. Use 'make autostatus' in this directory to find out how we're doing. - -The generated 'libvirt_c.c' #includes some other C files in this -directory: - - #include "libvirt_c_oneoffs.c" - - One-off bindings: Bindings which are too specialised or one-of-a-kind - to be worth generating automatically. - - [Followed by generated bindings, then ...] - - #include "libvirt_c_epilogue.c" - - An epilogue which defines some standard static functions (eg.) for - wrapping and unwrapping libvirt objects. - -The key to understanding the generator is to look at the generated -code (libvirt_c.c) first, and go from there back to parts of the -generator script. diff --git a/libvirt/generator.pl b/libvirt/generator.pl index 61526c0..eb329a0 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -234,8 +234,6 @@ print F <<'END'; =20 #include "libvirt_c.h" =20 -#include "libvirt_c_oneoffs.c" - END =20 #---------------------------------------------------------------------- @@ -880,8 +878,6 @@ END # Write the epilogue. =20 print F <<'END'; -#include "libvirt_c_epilogue.c" - /* EOF */ END =20 diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c index e58f7bb..3baf290 100644 --- a/libvirt/libvirt_c_epilogue.c +++ b/libvirt/libvirt_c_epilogue.c @@ -20,6 +20,8 @@ =20 /* Please read libvirt/README file. */ =20 +#include "libvirt_c.h" + const char * Optstring_val (value strv) { diff --git a/libvirt/libvirt_c_oneoffs.c b/libvirt/libvirt_c_oneoffs.c index 0a9e485..6f56f10 100644 --- a/libvirt/libvirt_c_oneoffs.c +++ b/libvirt/libvirt_c_oneoffs.c @@ -19,6 +19,8 @@ =20 /* Please read libvirt/README file. */ =20 +#include "libvirt_c.h" + #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wmissing-prototypes" #endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567500206; cv=none; d=zoho.com; s=zohoarc; b=YbH49mV56LzIC8tm0JRjy62ft3WdvVvI//mwmvAL5e9Nu0Pn5x+OvcpVr6jnGmYW/sMaUUxeGiclK/N2OAI6uH+zyqik/6OKeqZbobWNZQFhxDcvq2Oa+/vDVw1zHiRaKI6udAIb4lzJZ9sUikmLc/ptHmg/1SedMihhet+/6yk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567500206; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JDAPJq37aLJNinBNvK7hHNRuxE8F8pQIYJ4sBhbrPqM=; b=OFGPkgx6XcdLXPfAIHPA2Q2xROWREGDwsWihhuKoabKd5JYUS/8mvjBp6hXts2ezP5TLfgw94CiKHvxYH2Xdp6Aic+8XlBSVv/Ydr2gh/piE3yT+rmQ45KSV/PpxakKWl1TfUMd0zKAx0XfFaJq0L7GglpubddNHO8QH1wDGwCE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567500206738541.121694837475; Tue, 3 Sep 2019 01:43:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7CFB8307D868; Tue, 3 Sep 2019 08:43:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E8C346; Tue, 3 Sep 2019 08:43:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F337B180BA99; Tue, 3 Sep 2019 08:43:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x838hGlm030049 for ; Tue, 3 Sep 2019 04:43:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 96C7D5D6D0; Tue, 3 Sep 2019 08:43:16 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC0505D6B7; Tue, 3 Sep 2019 08:43:15 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 10:43:04 +0200 Message-Id: <20190903084306.32520-5-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 4/6] Rename the generated libvirt_c.c to libvirt_generated.c X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 03 Sep 2019 08:43:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Make it clear it is a generated source. Signed-off-by: Pino Toscano --- .gitignore | 2 +- Makefile.in | 2 +- libvirt/Makefile.in | 18 +++++++++--------- libvirt/README | 6 +++--- libvirt/generator.pl | 4 ++-- libvirt/libvirt.mli | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 840c0c4..c52c1b8 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ core.* /examples/list_secrets /examples/node_info /html/ -/libvirt/libvirt_c.c +/libvirt/libvirt_generated.c /libvirt/libvirt_version.ml /ocaml-libvirt-*.exe /ocaml-libvirt-*.tar.gz diff --git a/Makefile.in b/Makefile.in index e50600a..4357ba6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,7 +35,7 @@ clean: for d in . $(SUBDIRS); do \ (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.d= ll *.exe core); \ done - rm -f libvirt/libvirt_c.c + rm -f libvirt/libvirt_generated.c rm -f examples/list_domains rm -f examples/node_info rm -f examples/get_cpu_stats diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in index ad56bb5..d78056b 100644 --- a/libvirt/Makefile.in +++ b/libvirt/Makefile.in @@ -64,10 +64,10 @@ OPTOBJS :=3D libvirt.cmx libvirt_version.cmx =20 ifneq ($(OCAMLMKLIB),) # Good, we can just use ocamlmklib -mllibvirt.cma: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o $(COBJ= S) +mllibvirt.cma: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilogue.= o $(COBJS) $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) =20 -mllibvirt.cmxa: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o $(OPT= OBJS) +mllibvirt.cmxa: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilogue= .o $(OPTOBJS) $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) =20 else @@ -83,11 +83,11 @@ mllibvirt.cmxa: libmllibvirt.a $(OPTOBJS) $(OCAMLOPT) -a -linkall -o $@ $(OPTOBJS) \ -cclib -lmllibvirt -cclib "$(LDFLAGS)" =20 -dllmllibvirt.dll: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o +dllmllibvirt.dll: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilog= ue.o $(CC) -shared -o $@ $^ \ $(LDFLAGS) "$(shell ocamlc -where)"/ocamlrun.a =20 -libmllibvirt.a: libvirt_c.o libvirt_c_oneoffs.o libvirt_c_epilogue.o +libmllibvirt.a: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilogue= .o ar rc $@ $^ ranlib $@ =20 @@ -100,24 +100,24 @@ endif endif =20 # Automatically generate the C code from a Perl script 'generator.pl'. -libvirt_c.c: generator.pl +libvirt_generated.c: generator.pl $(PERL) -w $< =20 # Extra dependencies. -libvirt_c.o: libvirt_c.h +libvirt_generated.o: libvirt_c.h libvirt_c_oneoffs.o: libvirt_c.h libvirt_c_epilogue.o: libvirt_c.h =20 # Status of automatically generated bindings. -autostatus: libvirt_c.c +autostatus: libvirt_generated.c @echo -n "Functions which have manual bindings: " @grep ^ocaml_libvirt_ libvirt_c_oneoffs.c | wc -l @echo -n "Functions which have automatic bindings: " - @grep ^ocaml_libvirt_ libvirt_c.c | wc -l + @grep ^ocaml_libvirt_ libvirt_generated.c | wc -l @echo -n "LOC in manual bindings: " @wc -l < libvirt_c_oneoffs.c @echo -n "LOC in automatic bindings: " - @wc -l < libvirt_c.c + @wc -l < libvirt_generated.c =20 =20 install-byte: diff --git a/libvirt/README b/libvirt/README index 3fb8f53..197a07a 100644 --- a/libvirt/README +++ b/libvirt/README @@ -19,9 +19,9 @@ one-of-a-kind to be worth generating automatically. Generated code -------------- =20 -The C bindings in 'libvirt_c.c' are now generated automatically by a -Perl script called 'generator.pl'. You do not normally need to run -this script, but you may need to if you want to extend libvirt +The C bindings in 'libvirt_generated.c' are now generated automatically +by a Perl script called 'generator.pl'. You do not normally need to +run this script, but you may need to if you want to extend libvirt coverage. =20 The majority of the functions are now generated automatically, but diff --git a/libvirt/generator.pl b/libvirt/generator.pl index eb329a0..cb2b845 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -19,7 +19,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301= USA =20 -# This generates libvirt_c.c (the core of the bindings). You don't +# This generates libvirt_generated.c (the core of the bindings). You don't # need to run this program unless you are extending the bindings # themselves (eg. because libvirt has been extended). # @@ -199,7 +199,7 @@ my @unimplemented =3D ( =20 # Open the output file. =20 -my $filename =3D "libvirt_c.c"; +my $filename =3D "libvirt_generated.c"; open F, ">$filename" or die "$filename: $!"; =20 # Write the prologue. diff --git a/libvirt/libvirt.mli b/libvirt/libvirt.mli index 72e83f9..0739702 100644 --- a/libvirt/libvirt.mli +++ b/libvirt/libvirt.mli @@ -1574,7 +1574,7 @@ sig | VIR_ERR_NONE | VIR_ERR_WARNING | VIR_ERR_ERROR - (* ^^ NB: If you add a variant you MUST edit libvirt_c.c: MAX_VIR_* *) + (* ^^ NB: If you add a variant you MUST edit libvirt_generated.c: MAX_VIR= _* *) | VIR_ERR_UNKNOWN_LEVEL of int (** Other level, not handled with exist= ing values. *) (** No error, a warning or an error. *) =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567500210; cv=none; d=zoho.com; s=zohoarc; b=eO6gZjhYI3nReopCUvA7lCfcqvG4q/QDR0c27uFgywpsSCuue1X0h4UB3no7Pmt1Hw3t5RF77K+XOVDPvoo/Gzfwu/2fiCo86rxZE6wRqr//Y6mbMae5gnAasuKv4kcyx8zhO2sitn1EQwVKkl+6TeJa3omDmuFxEY1gozEJAUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567500210; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=iwuxzTn+XBG8KFqA6CI2dve7NGtY540K51OuG0Bwccw=; b=hOA/BZlfUf8R0ugJgx8Bd43ZhXv3hz3ySbW/cZMgGDtuTf3+bi3L9OJnVMNCIQctFNbeS+UyFxolviOOJ/qLLggwg5a9dA0JipMdxLoAUbmxzbtewSHlwk0iP1J/LPY3kxQlYjzcbcgJtjHjQRoGxEaXBbprB4326qXZjdrfeY8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567500210416536.956629351716; Tue, 3 Sep 2019 01:43:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57EB518F3525; Tue, 3 Sep 2019 08:43:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 298CC194BB; Tue, 3 Sep 2019 08:43:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E1279180BA9D; Tue, 3 Sep 2019 08:43:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x838hHlF030054 for ; Tue, 3 Sep 2019 04:43:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8E0CD5D6D0; Tue, 3 Sep 2019 08:43:17 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2B485D6B7; Tue, 3 Sep 2019 08:43:16 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 10:43:05 +0200 Message-Id: <20190903084306.32520-6-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 5/6] Build libvirt_generated.c with -Wmissing-prototypes X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Tue, 03 Sep 2019 08:43:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There are no prototypes for the autogenerated C functions, so build this source with that too. Previously it was pulled in when all the sources were built as one. Signed-off-by: Pino Toscano --- libvirt/generator.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libvirt/generator.pl b/libvirt/generator.pl index cb2b845..ac3dd65 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -234,6 +234,10 @@ print F <<'END'; =20 #include "libvirt_c.h" =20 +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#endif + END =20 #---------------------------------------------------------------------- --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567500202; cv=none; d=zoho.com; s=zohoarc; b=CRlFLI7ZgGw1f8Bylqy+mvBbCOdBDBSqovijRIy5LUOdu/LUKZ9lT37buKCA/o6NY/IoAq641UKVUkAZum5QUevFQdyWRyhlumRmik+5mZY1HmCYy3PwOUytIBjofBmahII7yP7RWMkHpeg5bhvPcAK81Tz7Fx/EOeDAGfS+Buk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567500202; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=L+O0BRf/If185cimsgL0GILSE4cvpNhpGe8PlNC+x4o=; b=kdS/ZKn8k7EGgEMtOE93CbfOXmtWUzGsVN3TKIK2OvNO3nQPSy0IEAhzspYGb+7MUltG2SzHlOwnWvdT9iM7mPQQBmnsgYJiT9P214BwGm1M9EM8pamBAmt2NIfcR9PZpUj/00pE5R872KN7nDThfPrbDSCt//A/4zWm4BDKmmw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567500202509130.64467402699063; Tue, 3 Sep 2019 01:43:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FF8CA36F04; Tue, 3 Sep 2019 08:43:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D637860606; Tue, 3 Sep 2019 08:43:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 947E124FDF; Tue, 3 Sep 2019 08:43:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x838hIMJ030065 for ; Tue, 3 Sep 2019 04:43:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 847055D6D0; Tue, 3 Sep 2019 08:43:18 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DADDA5D6C8; Tue, 3 Sep 2019 08:43:17 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 10:43:06 +0200 Message-Id: <20190903084306.32520-7-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 6/6] Rename libvirt_c_epilogue.c to libvirt_c_common.c X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Tue, 03 Sep 2019 08:43:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Make it clear it contains common code, and it is no more the final part of some other source. Signed-off-by: Pino Toscano --- MANIFEST | 2 +- libvirt/Makefile.in | 10 +++++----- libvirt/README | 2 +- libvirt/libvirt.mli | 4 ++-- libvirt/{libvirt_c_epilogue.c =3D> libvirt_c_common.c} | 0 5 files changed, 9 insertions(+), 9 deletions(-) rename libvirt/{libvirt_c_epilogue.c =3D> libvirt_c_common.c} (100%) diff --git a/MANIFEST b/MANIFEST index c026fef..b6a7707 100644 --- a/MANIFEST +++ b/MANIFEST @@ -20,7 +20,7 @@ install-sh libvirt/.depend libvirt/generator.pl libvirt/libvirt_c.h -libvirt/libvirt_c_epilogue.c +libvirt/libvirt_c_common.c libvirt/libvirt_c_oneoffs.c libvirt/libvirt.ml libvirt/libvirt.mli diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in index d78056b..2fa445b 100644 --- a/libvirt/Makefile.in +++ b/libvirt/Makefile.in @@ -64,10 +64,10 @@ OPTOBJS :=3D libvirt.cmx libvirt_version.cmx =20 ifneq ($(OCAMLMKLIB),) # Good, we can just use ocamlmklib -mllibvirt.cma: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilogue.= o $(COBJS) +mllibvirt.cma: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_common.o = $(COBJS) $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) =20 -mllibvirt.cmxa: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilogue= .o $(OPTOBJS) +mllibvirt.cmxa: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_common.o= $(OPTOBJS) $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) =20 else @@ -83,11 +83,11 @@ mllibvirt.cmxa: libmllibvirt.a $(OPTOBJS) $(OCAMLOPT) -a -linkall -o $@ $(OPTOBJS) \ -cclib -lmllibvirt -cclib "$(LDFLAGS)" =20 -dllmllibvirt.dll: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilog= ue.o +dllmllibvirt.dll: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_common= .o $(CC) -shared -o $@ $^ \ $(LDFLAGS) "$(shell ocamlc -where)"/ocamlrun.a =20 -libmllibvirt.a: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_epilogue= .o +libmllibvirt.a: libvirt_generated.o libvirt_c_oneoffs.o libvirt_c_common.o ar rc $@ $^ ranlib $@ =20 @@ -106,7 +106,7 @@ libvirt_generated.c: generator.pl # Extra dependencies. libvirt_generated.o: libvirt_c.h libvirt_c_oneoffs.o: libvirt_c.h -libvirt_c_epilogue.o: libvirt_c.h +libvirt_c_common.o: libvirt_c.h =20 # Status of automatically generated bindings. autostatus: libvirt_generated.c diff --git a/libvirt/README b/libvirt/README index 197a07a..fb8e7f5 100644 --- a/libvirt/README +++ b/libvirt/README @@ -10,7 +10,7 @@ documentation starting at html/index.html. 'libvirt_c.h' contains prototypes of common functions defined in the epilogue (see below), and provides some general macros. =20 -'libvirt_c_epilogue.c' contains some standard functions (eg.) for +'libvirt_c_common.c' contains some standard functions (eg.) for wrapping and unwrapping libvirt objects. =20 'libvirt_c_oneoffs.c' contains bindings which are too specialised or diff --git a/libvirt/libvirt.mli b/libvirt/libvirt.mli index 0739702..cbcf616 100644 --- a/libvirt/libvirt.mli +++ b/libvirt/libvirt.mli @@ -1485,7 +1485,7 @@ sig | VIR_ERR_NETWORK_PORT_EXIST | VIR_ERR_NO_NETWORK_PORT (* ^^ NB: If you add a variant you MUST edit - libvirt_c_epilogue.c:MAX_VIR_* *) + libvirt_c_common.c:MAX_VIR_* *) | VIR_ERR_UNKNOWN of int (** Other error, not handled with existing va= lues. *) (** See [] for meaning of these codes. *) =20 @@ -1564,7 +1564,7 @@ sig | VIR_FROM_DOMAIN_CHECKPOINT | VIR_FROM_TPM (* ^^ NB: If you add a variant you MUST edit - libvirt_c_epilogue.c: MAX_VIR_* *) + libvirt_c_common.c: MAX_VIR_* *) | VIR_FROM_UNKNOWN of int (** Other domain, not handled with existing = values. *) (** Subsystem / driver which produced the error. *) =20 diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_common.c similarity index 100% rename from libvirt/libvirt_c_epilogue.c rename to libvirt/libvirt_c_common.c --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 14:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567510886; cv=none; d=zoho.com; s=zohoarc; b=aMx27vQKv0a9yplTx3z9DhjpTT7aXrfvYi1P7+qGm9/VqQ+LGKpl7VhjeJQMgrU3nWt8USJUO2VBhAAv1gG+SLw+AtFOkZBsf3ulrofTA76Z0EBthROZZT4P+4PMOIt821nswT0qCJx5iJlLu+wLkh7V3y+81JAvFVX8k80Sxwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567510886; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Mhc4epXOT4fD3XaNpdXjs/Wig7/lhOdc3OEA6oNc6tU=; b=hjvd2Rj6U7vq/rXN9NwPWO26R+fyu1qUWOLIXn+OgO4SqWlwwUr81aoZ322QapcsjujHUyexOwclYUPEYawFW3FKUmL12AwxbqAwDc1+Bpok23XLE0i06KYrkz+b+uodEMWwObYsYoGhGWvjaFcbL2EQAliilgzs84ITNMKS1gk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567510886156236.1613349369078; Tue, 3 Sep 2019 04:41:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD79185543; Tue, 3 Sep 2019 11:41:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82E3119C78; Tue, 3 Sep 2019 11:41:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E33911802217; Tue, 3 Sep 2019 11:41:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x83BfMpO003194 for ; Tue, 3 Sep 2019 07:41:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 38C126012C; Tue, 3 Sep 2019 11:41:22 +0000 (UTC) Received: from lindworm.usersys.redhat.com (unknown [10.43.2.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E6DE6012A; Tue, 3 Sep 2019 11:41:19 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 13:41:16 +0200 Message-Id: <20190903114116.6866-1-ptoscano@redhat.com> In-Reply-To: <20190903084306.32520-1-ptoscano@redhat.com> References: <20190903084306.32520-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [ocaml PATCH 7/6] Hide again the internal helpers X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 03 Sep 2019 11:41:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Use a GCC pragma to hide all the internal helpers, so they are not exposed as public symbols of the stub library. Signed-off-by: Pino Toscano --- libvirt/libvirt_c.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libvirt/libvirt_c.h b/libvirt/libvirt_c.h index 541d8e3..45937f6 100644 --- a/libvirt/libvirt_c.h +++ b/libvirt/libvirt_c.h @@ -40,6 +40,13 @@ =20 /* Please read libvirt/README file. */ =20 +/* Make sure to not expose our internal helpers as public symbols. + * https://gcc.gnu.org/wiki/Visibility + */ +#ifdef __GNUC__ +#pragma GCC visibility push(hidden) +#endif + const char *Optstring_val (value strv); typedef value (*Val_ptr_t) (void *); value Val_opt (void *ptr, Val_ptr_t Val_ptr); @@ -153,4 +160,8 @@ value Val_pool (virStoragePoolPtr pol, value connv); value Val_volume (virStorageVolPtr vol, value connv); value Val_secret (virSecretPtr sec, value connv); =20 +#ifdef __GNUC__ +#pragma GCC visibility pop +#endif + #endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list