mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
generator: Implement struct FDevice type
This acts just like FString except that we do reverse device name translation on it. The only use is in the 'pvs-full' API where we will use it (in a subsequent commit) to reverse translate the pv_name field (a device name) before returning it from the daemon. Compare this to the 'pvs' API which also returns a list of device names, but using the generator's 'RStructList (RDevice,...)' return type, where RDevice is similarly reverse translated. Note in the library-side bindings, because the name has already been translated in the daemon, we just treat it exactly the same as FString. The vast majority of this patch is this mechanical change.
This commit is contained in:
@@ -616,7 +616,7 @@ and generate_php_struct_code typ cols =
|
||||
pr " array_init (return_value);\n";
|
||||
List.iter (
|
||||
function
|
||||
| name, FString ->
|
||||
| name, (FString|FDevice) ->
|
||||
pr " guestfs_add_assoc_string (return_value, \"%s\", r->%s, 1);\n" name name
|
||||
| name, FBuffer ->
|
||||
pr " guestfs_add_assoc_stringl (return_value, \"%s\", r->%s, r->%s_len, 1);\n"
|
||||
@@ -650,7 +650,7 @@ and generate_php_struct_list_code typ cols =
|
||||
pr " array_init (z_elem);\n";
|
||||
List.iter (
|
||||
function
|
||||
| name, FString ->
|
||||
| name, (FString|FDevice) ->
|
||||
pr " guestfs_add_assoc_string (z_elem, \"%s\", r->val[c].%s, 1);\n"
|
||||
name name
|
||||
| name, FBuffer ->
|
||||
|
||||
Reference in New Issue
Block a user