Permalink
Browse files

generator: Sort most output.

Look for use of external_functions and fish_functions and replace with
use of external_functions_sorted and fish_functions_sorted where
possible.  This ensures that the output of the generator is sorted as
far as possible.

I also checked for uses of internal_functions and documented_functions
but those are not used.  The *_sorted versions are always used
instead.
  • Loading branch information...
1 parent bbfb9f9 commit 6cc521dc4533d10659214cc660f31239de9e28e7 @rwmjones rwmjones committed Feb 15, 2014
Showing with 93 additions and 93 deletions.
  1. +3 −3 generator/fish.ml
  2. +3 −3 generator/gobject.ml
  3. +2 −2 generator/haskell.ml
  4. +2 −2 generator/java.ml
  5. +1 −1 generator/main.ml
  6. +1 −1 generator/perl.ml
  7. +3 −3 generator/python.ml
  8. +2 −2 generator/ruby.ml
  9. +76 −76 gobject/Makefile.inc
View
@@ -80,7 +80,7 @@ let generate_fish_cmds () =
fun { name = name } ->
pr "static int run_%s (const char *cmd, size_t argc, char *argv[]);\n"
name
- ) fish_functions;
+ ) fish_functions_sorted;
pr "\n";
@@ -170,7 +170,7 @@ Guestfish will prompt for these separately."
pr " .run = run_%s\n" name;
pr "};\n";
pr "\n";
- ) fish_functions;
+ ) fish_functions_sorted;
(* list_commands function, which implements guestfish -h *)
pr "void\n";
@@ -657,7 +657,7 @@ Guestfish will prompt for these separately."
pr " return ret;\n";
pr "}\n";
pr "\n"
- ) fish_functions;
+ ) fish_functions_sorted;
(* run_action function *)
pr "int\n";
View
@@ -116,7 +116,7 @@ let filenames =
function
| { style = _, _, (_::_) } -> true
| { style = _, _, [] } -> false
- ) external_functions
+ ) external_functions_sorted
)
let header_start filename =
@@ -706,7 +706,7 @@ gboolean guestfs_session_close (GuestfsSession *session, GError **err);
fun ({ name = name; style = style } as f) ->
generate_gobject_proto name style f;
pr ";\n";
- ) external_functions;
+ ) external_functions_sorted;
header_end filename
@@ -1293,4 +1293,4 @@ guestfs_session_close (GuestfsSession *session, GError **err)
);
pr "}\n";
- ) external_functions
+ ) external_functions_sorted
View
@@ -60,7 +60,7 @@ module Guestfs (
List.iter (
fun { name = name; style = style } ->
if can_generate style then pr ",\n %s" name
- ) external_functions;
+ ) external_functions_sorted;
pr "
) where
@@ -208,7 +208,7 @@ assocListOfHashtable (a:b:rest) = (a,b) : assocListOfHashtable rest
);
pr "\n";
)
- ) external_functions
+ ) external_functions_sorted
and generate_haskell_prototype ~handle ?(hs = false) (ret, args, optargs) =
pr "%s -> " handle;
View
@@ -389,7 +389,7 @@ public class GuestFS {
generate_java_prototype ~privat:true ~native:true f.name f.style;
pr "\n";
pr "\n";
- ) external_functions;
+ ) external_functions_sorted;
pr "}\n"
@@ -1114,7 +1114,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
pr "}\n";
pr "\n"
- ) external_functions
+ ) external_functions_sorted
and generate_java_struct_return typ jtyp cols =
pr " cl = (*env)->FindClass (env, \"com/redhat/et/libguestfs/%s\");\n" jtyp;
View
@@ -196,7 +196,7 @@ Run it from the top source directory using the command
output_to filename
(generate_gobject_optargs_source short name optargs f)
| { style = _, _, [] } -> ()
- ) external_functions;
+ ) external_functions_sorted;
delete_except_generated "gobject/include/guestfs-gobject/optargs-*.h";
delete_except_generated "gobject/src/optargs-*.c";
View
@@ -577,7 +577,7 @@ PREINIT:
);
pr "\n"
- ) external_functions
+ ) external_functions_sorted
and generate_perl_struct_list_code typ cols name style n =
pr " if (r == NULL)\n";
View
@@ -518,7 +518,7 @@ put_table (char * const * const argv)
pr " return py_r;\n";
pr "}\n";
pr "\n"
- ) external_functions;
+ ) external_functions_sorted;
(* Table of functions. *)
pr "static PyMethodDef methods[] = {\n";
@@ -534,7 +534,7 @@ put_table (char * const * const argv)
fun { name = name } ->
pr " { (char *) \"%s\", py_guestfs_%s, METH_VARARGS, NULL },\n"
name name
- ) external_functions;
+ ) external_functions_sorted;
pr " { NULL, NULL, 0, NULL }\n";
pr "};\n";
pr "\n";
@@ -823,4 +823,4 @@ class GuestFS(object):
fun alias ->
pr " %s = %s\n\n" alias f.name
) f.non_c_aliases
- ) external_functions
+ ) external_functions_sorted
View
@@ -743,7 +743,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
pr "}\n";
pr "\n"
- ) external_functions;
+ ) external_functions_sorted;
pr "\
extern void Init__guestfs (void); /* keep GCC warnings happy */
@@ -804,7 +804,7 @@ Init__guestfs (void)
pr " rb_define_method (c_guestfs, \"%s\",\n" alias;
pr " ruby_guestfs_%s, %d);\n" name nr_args
) non_c_aliases
- ) external_functions;
+ ) external_functions_sorted;
pr "}\n"
View
@@ -43,58 +43,58 @@ guestfs_gobject_headers= \
include/guestfs-gobject/struct-utsname.h \
include/guestfs-gobject/struct-hivex_node.h \
include/guestfs-gobject/struct-hivex_value.h \
- include/guestfs-gobject/optargs-internal_test.h \
- include/guestfs-gobject/optargs-internal_test_only_optargs.h \
- include/guestfs-gobject/optargs-internal_test_63_optargs.h \
- include/guestfs-gobject/optargs-add_drive.h \
include/guestfs-gobject/optargs-add_domain.h \
- include/guestfs-gobject/optargs-inspect_get_icon.h \
- include/guestfs-gobject/optargs-mount_local.h \
- include/guestfs-gobject/optargs-umount_local.h \
+ include/guestfs-gobject/optargs-add_drive.h \
include/guestfs-gobject/optargs-add_drive_scratch.h \
- include/guestfs-gobject/optargs-disk_create.h \
- include/guestfs-gobject/optargs-is_file.h \
- include/guestfs-gobject/optargs-is_dir.h \
- include/guestfs-gobject/optargs-umount.h \
- include/guestfs-gobject/optargs-tar_in.h \
- include/guestfs-gobject/optargs-tar_out.h \
- include/guestfs-gobject/optargs-mkswap.h \
- include/guestfs-gobject/optargs-grep.h \
- include/guestfs-gobject/optargs-is_chardev.h \
- include/guestfs-gobject/optargs-is_blockdev.h \
- include/guestfs-gobject/optargs-is_fifo.h \
- include/guestfs-gobject/optargs-is_socket.h \
- include/guestfs-gobject/optargs-mkfs.h \
- include/guestfs-gobject/optargs-mount_9p.h \
- include/guestfs-gobject/optargs-ntfsresize.h \
include/guestfs-gobject/optargs-btrfs_filesystem_resize.h \
- include/guestfs-gobject/optargs-compress_out.h \
+ include/guestfs-gobject/optargs-btrfs_fsck.h \
include/guestfs-gobject/optargs-compress_device_out.h \
+ include/guestfs-gobject/optargs-compress_out.h \
+ include/guestfs-gobject/optargs-copy_attributes.h \
include/guestfs-gobject/optargs-copy_device_to_device.h \
include/guestfs-gobject/optargs-copy_device_to_file.h \
include/guestfs-gobject/optargs-copy_file_to_device.h \
include/guestfs-gobject/optargs-copy_file_to_file.h \
- include/guestfs-gobject/optargs-tune2fs.h \
- include/guestfs-gobject/optargs-md_create.h \
+ include/guestfs-gobject/optargs-disk_create.h \
include/guestfs-gobject/optargs-e2fsck.h \
- include/guestfs-gobject/optargs-ntfsfix.h \
- include/guestfs-gobject/optargs-ntfsclone_out.h \
- include/guestfs-gobject/optargs-mkfs_btrfs.h \
- include/guestfs-gobject/optargs-set_e2attrs.h \
- include/guestfs-gobject/optargs-btrfs_fsck.h \
include/guestfs-gobject/optargs-fstrim.h \
- include/guestfs-gobject/optargs-xfs_growfs.h \
- include/guestfs-gobject/optargs-rsync.h \
- include/guestfs-gobject/optargs-rsync_in.h \
- include/guestfs-gobject/optargs-rsync_out.h \
- include/guestfs-gobject/optargs-xfs_admin.h \
+ include/guestfs-gobject/optargs-grep.h \
include/guestfs-gobject/optargs-hivex_open.h \
- include/guestfs-gobject/optargs-xfs_repair.h \
+ include/guestfs-gobject/optargs-inspect_get_icon.h \
+ include/guestfs-gobject/optargs-internal_test.h \
+ include/guestfs-gobject/optargs-internal_test_63_optargs.h \
+ include/guestfs-gobject/optargs-internal_test_only_optargs.h \
+ include/guestfs-gobject/optargs-is_blockdev.h \
+ include/guestfs-gobject/optargs-is_chardev.h \
+ include/guestfs-gobject/optargs-is_dir.h \
+ include/guestfs-gobject/optargs-is_fifo.h \
+ include/guestfs-gobject/optargs-is_file.h \
+ include/guestfs-gobject/optargs-is_socket.h \
+ include/guestfs-gobject/optargs-md_create.h \
include/guestfs-gobject/optargs-mke2fs.h \
+ include/guestfs-gobject/optargs-mkfs.h \
+ include/guestfs-gobject/optargs-mkfs_btrfs.h \
+ include/guestfs-gobject/optargs-mkswap.h \
include/guestfs-gobject/optargs-mktemp.h \
- include/guestfs-gobject/optargs-syslinux.h \
+ include/guestfs-gobject/optargs-mount_9p.h \
+ include/guestfs-gobject/optargs-mount_local.h \
+ include/guestfs-gobject/optargs-ntfsclone_out.h \
+ include/guestfs-gobject/optargs-ntfsfix.h \
+ include/guestfs-gobject/optargs-ntfsresize.h \
include/guestfs-gobject/optargs-remount.h \
- include/guestfs-gobject/optargs-copy_attributes.h
+ include/guestfs-gobject/optargs-rsync.h \
+ include/guestfs-gobject/optargs-rsync_in.h \
+ include/guestfs-gobject/optargs-rsync_out.h \
+ include/guestfs-gobject/optargs-set_e2attrs.h \
+ include/guestfs-gobject/optargs-syslinux.h \
+ include/guestfs-gobject/optargs-tar_in.h \
+ include/guestfs-gobject/optargs-tar_out.h \
+ include/guestfs-gobject/optargs-tune2fs.h \
+ include/guestfs-gobject/optargs-umount.h \
+ include/guestfs-gobject/optargs-umount_local.h \
+ include/guestfs-gobject/optargs-xfs_admin.h \
+ include/guestfs-gobject/optargs-xfs_growfs.h \
+ include/guestfs-gobject/optargs-xfs_repair.h
guestfs_gobject_sources= \
src/session.c \
@@ -119,55 +119,55 @@ guestfs_gobject_sources= \
src/struct-utsname.c \
src/struct-hivex_node.c \
src/struct-hivex_value.c \
- src/optargs-internal_test.c \
- src/optargs-internal_test_only_optargs.c \
- src/optargs-internal_test_63_optargs.c \
- src/optargs-add_drive.c \
src/optargs-add_domain.c \
- src/optargs-inspect_get_icon.c \
- src/optargs-mount_local.c \
- src/optargs-umount_local.c \
+ src/optargs-add_drive.c \
src/optargs-add_drive_scratch.c \
- src/optargs-disk_create.c \
- src/optargs-is_file.c \
- src/optargs-is_dir.c \
- src/optargs-umount.c \
- src/optargs-tar_in.c \
- src/optargs-tar_out.c \
- src/optargs-mkswap.c \
- src/optargs-grep.c \
- src/optargs-is_chardev.c \
- src/optargs-is_blockdev.c \
- src/optargs-is_fifo.c \
- src/optargs-is_socket.c \
- src/optargs-mkfs.c \
- src/optargs-mount_9p.c \
- src/optargs-ntfsresize.c \
src/optargs-btrfs_filesystem_resize.c \
- src/optargs-compress_out.c \
+ src/optargs-btrfs_fsck.c \
src/optargs-compress_device_out.c \
+ src/optargs-compress_out.c \
+ src/optargs-copy_attributes.c \
src/optargs-copy_device_to_device.c \
src/optargs-copy_device_to_file.c \
src/optargs-copy_file_to_device.c \
src/optargs-copy_file_to_file.c \
- src/optargs-tune2fs.c \
- src/optargs-md_create.c \
+ src/optargs-disk_create.c \
src/optargs-e2fsck.c \
- src/optargs-ntfsfix.c \
- src/optargs-ntfsclone_out.c \
- src/optargs-mkfs_btrfs.c \
- src/optargs-set_e2attrs.c \
- src/optargs-btrfs_fsck.c \
src/optargs-fstrim.c \
- src/optargs-xfs_growfs.c \
- src/optargs-rsync.c \
- src/optargs-rsync_in.c \
- src/optargs-rsync_out.c \
- src/optargs-xfs_admin.c \
+ src/optargs-grep.c \
src/optargs-hivex_open.c \
- src/optargs-xfs_repair.c \
+ src/optargs-inspect_get_icon.c \
+ src/optargs-internal_test.c \
+ src/optargs-internal_test_63_optargs.c \
+ src/optargs-internal_test_only_optargs.c \
+ src/optargs-is_blockdev.c \
+ src/optargs-is_chardev.c \
+ src/optargs-is_dir.c \
+ src/optargs-is_fifo.c \
+ src/optargs-is_file.c \
+ src/optargs-is_socket.c \
+ src/optargs-md_create.c \
src/optargs-mke2fs.c \
+ src/optargs-mkfs.c \
+ src/optargs-mkfs_btrfs.c \
+ src/optargs-mkswap.c \
src/optargs-mktemp.c \
- src/optargs-syslinux.c \
+ src/optargs-mount_9p.c \
+ src/optargs-mount_local.c \
+ src/optargs-ntfsclone_out.c \
+ src/optargs-ntfsfix.c \
+ src/optargs-ntfsresize.c \
src/optargs-remount.c \
- src/optargs-copy_attributes.c
+ src/optargs-rsync.c \
+ src/optargs-rsync_in.c \
+ src/optargs-rsync_out.c \
+ src/optargs-set_e2attrs.c \
+ src/optargs-syslinux.c \
+ src/optargs-tar_in.c \
+ src/optargs-tar_out.c \
+ src/optargs-tune2fs.c \
+ src/optargs-umount.c \
+ src/optargs-umount_local.c \
+ src/optargs-xfs_admin.c \
+ src/optargs-xfs_growfs.c \
+ src/optargs-xfs_repair.c

0 comments on commit 6cc521d

Please sign in to comment.