summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-06-10 11:49:42 +0100
committerRichard Jones <rjones@redhat.com>2009-06-10 14:16:47 +0100
commit56bef498f46ac3dd580f4bde3c8f3ed2fe688826 (patch)
tree73bb0d8c5df5ec8c5af905be3283b6beaa2994bc /src
parent2df2f2854ed2d1f9857ef3c5aaca29810cf3c506 (diff)
downloadlibguestfs-56bef498f46ac3dd580f4bde3c8f3ed2fe688826.tar.gz
libguestfs-56bef498f46ac3dd580f4bde3c8f3ed2fe688826.tar.xz
libguestfs-56bef498f46ac3dd580f4bde3c8f3ed2fe688826.zip
In the daemon, change all const char * parameters to char *.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/generator.ml b/src/generator.ml
index 2113bc43..3e4b506e 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -3496,8 +3496,12 @@ and generate_daemon_actions () =
pr " struct guestfs_%s_args args;\n" name;
List.iter (
function
+ (* Note we allow the string to be writable, in order to
+ * allow device name translation. This is safe because
+ * we can modify the string (passed from RPC).
+ *)
| String n
- | OptString n -> pr " const char *%s;\n" n
+ | OptString n -> pr " char *%s;\n" n
| StringList n -> pr " char **%s;\n" n
| Bool n -> pr " int %s;\n" n
| Int n -> pr " int %s;\n" n
@@ -4929,8 +4933,14 @@ and generate_prototype ?(extern = true) ?(static = false) ?(semicolon = true)
List.iter (
function
| String n
- | OptString n -> next (); pr "const char *%s" n
- | StringList n -> next (); pr "char * const* const %s" n
+ | OptString n ->
+ next ();
+ if not in_daemon then pr "const char *%s" n
+ else pr "char *%s" n
+ | StringList n ->
+ next ();
+ if not in_daemon then pr "char * const* const %s" n
+ else pr "char **%s" n
| Bool n -> next (); pr "int %s" n
| Int n -> next (); pr "int %s" n
| FileIn n