diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-09-24 09:26:10 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-09-24 09:46:14 +0100 |
commit | db6a8512402f068815f882928662af0d8f5eec83 (patch) | |
tree | 39f1e9f08f6d449f263a7b6a3c0aeac45f7e8b36 | |
parent | a95d4261b8cedc31bfc3c5358be7b346b27d457b (diff) | |
download | libguestfs-db6a8512402f068815f882928662af0d8f5eec83.tar.gz libguestfs-db6a8512402f068815f882928662af0d8f5eec83.tar.xz libguestfs-db6a8512402f068815f882928662af0d8f5eec83.zip |
generator: Tidy up comments in guestfs_protocol.x.
-rw-r--r-- | generator/xdr.ml | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/generator/xdr.ml b/generator/xdr.ml index 9ba8c53a..9fd31832 100644 --- a/generator/xdr.ml +++ b/generator/xdr.ml @@ -37,10 +37,18 @@ open 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 { name =shortname; style = 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 ( function @@ -165,6 +176,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 @@ -175,10 +189,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; |