From 70c853d67a0cd5e54c821cd08726b91174517221 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 4 Jan 2010 14:51:36 +0000 Subject: [PATCH] C#: Add documentation about experimental nature of these bindings. --- .gitignore | 1 + src/generator.ml | 28 ++++++++++++++++++++++++++++ src/guestfs.pod | 16 +++++++++++----- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 484b947..37fb73e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ config.log config.status config.sub configure +csharp/ daemon/actions.h daemon/guestfsd daemon/guestfsd.exe diff --git a/src/generator.ml b/src/generator.ml index 3bc8d6f..adccf9e 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -9928,6 +9928,34 @@ and generate_csharp () = let library = "libguestfs.so.0" in pr "\ +// These C# bindings are highly experimental at present. +// +// Firstly they only work on Linux (ie. Mono). In order to get them +// to work on Windows (ie. .Net) you would need to port the library +// itself to Windows first. +// +// The second issue is that some calls are known to be incorrect and +// can cause Mono to segfault. Particularly: calls which pass or +// return string[], or return any structure value. This is because +// we haven't worked out the correct way to do this from C#. +// +// The third issue is that when compiling you get a lot of warnings. +// We are not sure whether the warnings are important or not. +// +// Fourthly we do not routinely build or test these bindings as part +// of the make && make check cycle, which means that regressions might +// go unnoticed. +// +// Suggestions and patches are welcome. + +// To compile: +// +// gmcs Libguestfs.cs +// mono Libguestfs.exe +// +// (You'll probably want to add a Test class / static main function +// otherwise this won't do anything useful). + using System; using System.IO; using System.Runtime.InteropServices; diff --git a/src/guestfs.pod b/src/guestfs.pod index 3075960..c959d23 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -36,8 +36,9 @@ LVs, what filesystem is in each LV, etc.). It can also run commands in the context of the guest. Also you can access filesystems over FTP. Libguestfs is a library that can be linked with C and C++ management -programs (or management programs written in OCaml, Perl, Python, Ruby, Java -or Haskell). You can also use it from shell scripts or the command line. +programs (or management programs written in OCaml, Perl, Python, Ruby, +Java, Haskell or C#). You can also use it from shell scripts or the +command line. You don't need to be root to use libguestfs, although obviously you do need enough permissions to access the disk images. @@ -480,11 +481,16 @@ You can use the I header file from C++ programs. The C++ API is identical to the C API. C++ classes and exceptions are not implemented. +=item B + +The C# bindings are highly experimental. Please read the warnings +at the top of C. + =item B -This is the only language binding that is incomplete. Only calls -which return simple integers have been bound in Haskell, and we are -looking for help to complete this binding. +This is the only language binding that working but incomplete. Only +calls which return simple integers have been bound in Haskell, and we +are looking for help to complete this binding. =item B -- 1.8.3.1