summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-07-07 13:42:34 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-07-07 13:42:34 +0100
commitd5532e9ad29b28c2b323ad0abe4e0caa6e03f675 (patch)
tree14eda67960afaf590159df7ac3ef89b44b0172e3 /daemon
parent6c87a747cae61097915c71f6d505f101579e8c7a (diff)
downloadlibguestfs-d5532e9ad29b28c2b323ad0abe4e0caa6e03f675.tar.gz
libguestfs-d5532e9ad29b28c2b323ad0abe4e0caa6e03f675.tar.xz
libguestfs-d5532e9ad29b28c2b323ad0abe4e0caa6e03f675.zip
Generate structs and struct lists generically.
This modifies the way that struct and struct lists are generated (for return values) so that there is no need to add an explicit new type when adding a new structure. All tests pass, and the C API should be compatible. I have also inspected the changes that are made to the generated code by hand.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/augeas.c10
-rw-r--r--daemon/daemon.h6
-rw-r--r--daemon/lvm.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/daemon/augeas.c b/daemon/augeas.c
index 383812f8..f75a1d6f 100644
--- a/daemon/augeas.c
+++ b/daemon/augeas.c
@@ -122,21 +122,21 @@ do_aug_defvar (char *name, char *expr)
#endif
}
-guestfs_aug_defnode_ret *
+guestfs_int_int_bool *
do_aug_defnode (char *name, char *expr, char *val)
{
#ifdef HAVE_AUG_DEFNODE
- static guestfs_aug_defnode_ret r;
+ static guestfs_int_int_bool r;
int created;
NEED_AUG (NULL);
- r.nrnodes = aug_defnode (aug, name, expr, val, &created);
- if (r.nrnodes == -1) {
+ r.i = aug_defnode (aug, name, expr, val, &created);
+ if (r.i == -1) {
reply_with_error ("Augeas defnode failed");
return NULL;
}
- r.created = created;
+ r.b = created;
return &r;
#else
reply_with_error ("%s is not available", __func__);
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 5f22a4f8..814d2b18 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -67,9 +67,9 @@ extern int root_mounted;
/*-- in stubs.c (auto-generated) --*/
extern void dispatch_incoming_message (XDR *);
-extern guestfs_lvm_int_pv_list *parse_command_line_pvs (void);
-extern guestfs_lvm_int_vg_list *parse_command_line_vgs (void);
-extern guestfs_lvm_int_lv_list *parse_command_line_lvs (void);
+extern guestfs_int_lvm_pv_list *parse_command_line_pvs (void);
+extern guestfs_int_lvm_vg_list *parse_command_line_vgs (void);
+extern guestfs_int_lvm_lv_list *parse_command_line_lvs (void);
/*-- in proto.c --*/
extern void main_loop (int sock);
diff --git a/daemon/lvm.c b/daemon/lvm.c
index b81badbc..01b6435e 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
@@ -152,19 +152,19 @@ do_lvs (void)
* the code. That code is in stubs.c, and it is generated as usual
* by generator.ml.
*/
-guestfs_lvm_int_pv_list *
+guestfs_int_lvm_pv_list *
do_pvs_full (void)
{
return parse_command_line_pvs ();
}
-guestfs_lvm_int_vg_list *
+guestfs_int_lvm_vg_list *
do_vgs_full (void)
{
return parse_command_line_vgs ();
}
-guestfs_lvm_int_lv_list *
+guestfs_int_lvm_lv_list *
do_lvs_full (void)
{
return parse_command_line_lvs ();