summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-24 09:26:10 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-10-01 14:49:08 +0100
commitd7f08bc4f7b4fa50d15fcf74a41591ba952b9f1d (patch)
tree8cd9c22d34cc42f00cc41c62f5776c5b0aed9bf4
parentd8014089d1585810153f97fc75d8e5e93fb34b2f (diff)
downloadlibguestfs-d7f08bc4f7b4fa50d15fcf74a41591ba952b9f1d.tar.gz
libguestfs-d7f08bc4f7b4fa50d15fcf74a41591ba952b9f1d.tar.xz
libguestfs-d7f08bc4f7b4fa50d15fcf74a41591ba952b9f1d.zip
generator: Tidy up comments in guestfs_protocol.x.
(cherry picked from commit db6a8512402f068815f882928662af0d8f5eec83)
-rw-r--r--generator/generator_xdr.ml28
1 files changed, 19 insertions, 9 deletions
diff --git a/generator/generator_xdr.ml b/generator/generator_xdr.ml
index 9f9020ac..ef8ea0e4 100644
--- a/generator/generator_xdr.ml
+++ b/generator/generator_xdr.ml
@@ -37,10 +37,18 @@ open Generator_structs
* This header is NOT exported to clients, but see also generate_structs_h.
*)
let generate_xdr () =
- generate_header CStyle LGPLv2plus;
+ generate_header ~emacs_mode:"c" CStyle LGPLv2plus;
- (* This has to be defined to get around a limitation in Mac OS X's rpcgen. *)
+ pr "/* This file defines the protocol used between the library and\n";
+ pr " * the appliance/daemon. For more information see the COMMUNICATION\n";
+ pr " * PROTOCOL section in guestfs(3). Note this protocol is internal\n";
+ pr " * to libguestfs and may change at any time.\n";
+ pr " */\n";
+ pr "\n";
pr "%%#include <config.h>\n";
+ pr "\n";
+
+ pr "/* This has to be defined to get around a limitation in Mac OS X's rpcgen. */\n";
pr "#if HAVE_XDR_U_INT64_T\n";
pr "#define uint64_t u_int64_t\n";
pr "%%#if HAVE_XDR_UINT64_T\n";
@@ -55,11 +63,12 @@ let generate_xdr () =
pr "#endif\n";
pr "\n";
- (* This has to be defined to get around a limitation in Sun's rpcgen. *)
+ pr "/* This has to be defined to get around a limitation in Sun's rpcgen. */\n";
pr "typedef string guestfs_str<>;\n";
pr "\n";
- (* Internal structures. *)
+ pr "/* Internal structures. */\n";
+ pr "\n";
List.iter (
function
| typ, cols ->
@@ -81,6 +90,8 @@ let generate_xdr () =
pr "\n";
) structs;
+ pr "/* Function arguments and return values. */\n";
+ pr "\n";
List.iter (
fun (shortname, (ret, args, optargs), _, _, _, _, _) ->
let name = "guestfs_" ^ shortname in
@@ -153,7 +164,7 @@ let generate_xdr () =
);
) daemon_functions;
- (* Table of procedure numbers. *)
+ pr "/* Table of procedure numbers. */\n";
pr "enum guestfs_procedure {\n";
List.iter (
fun (shortname, _, proc_nr, _, _, _, _) ->
@@ -163,6 +174,9 @@ let generate_xdr () =
pr "};\n";
pr "\n";
+ pr "/* The remote procedure call protocol. */\n";
+ pr "\n";
+
(* Having to choose a maximum message size is annoying for several
* reasons (it limits what we can do in the API), but it (a) makes
* the protocol a lot simpler, and (b) provides a bound on the size
@@ -173,10 +187,6 @@ let generate_xdr () =
(* Message header, etc. *)
pr "\
-/* The communication protocol is now documented in the guestfs(3)
- * manpage.
- */
-
const GUESTFS_PROGRAM = 0x2000F5F5;
const GUESTFS_PROTOCOL_VERSION = 4;