Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 01/16] generator: Fix unescaped '<' and '>' in api descriptions
--- generator/generator_actions.ml | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 68a7bf6..fcf363f 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -4664,7 +4664,7 @@ This creates an ext2/3/4 filesystem on C<device> with an external journal on C<journal>. It is equivalent to the command: - mke2fs -t fstype -b blocksize -J device=<journal> <device> + mke2fs -t fstype -b blocksize -J device=E<lt>journalE<gt> E<lt>deviceE<gt> See also C<guestfs_mke2journal>."); @@ -5330,7 +5330,7 @@ For example, in guestfish you could use the following command to examine the boot script (usually called C</init>) contained in a Linux initrd or initramfs image: - initrd-cat /boot/initrd-<version>.img init + initrd-cat /boot/initrd-E<lt>versionE<gt>.img init See also C<guestfs_initrd_list>."); @@ -6560,8 +6560,9 @@ List all Linux md devices."); [], "obtain metadata for an MD device", "\ -This command exposes the output of 'mdadm -DY <md>'. The following fields are -usually present in the returned hash. Other fields may also be present. +This command exposes the output of 'mdadm -DY E<lt>mdE<gt>'. The following +fields are usually present in the returned hash. Other fields may also be +present. =over -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 02/16] generator: Remove doc reference to non-existent guestfs_inotify_watch_all
--- generator/generator_actions.ml | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index fcf363f..c196ddd 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -4484,10 +4484,8 @@ C<IN_Q_OVERFLOW> in the returned structure list (see C<guestfs_inotify_read>). Before any events are generated, you have to add some -watches to the internal watch list. See: -C<guestfs_inotify_add_watch>, -C<guestfs_inotify_rm_watch> and -C<guestfs_inotify_watch_all>. +watches to the internal watch list. See: C<guestfs_inotify_add_watch> and +C<guestfs_inotify_rm_watch>. Queued up events should be read periodically by calling C<guestfs_inotify_read> -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 03/16] Only ignore guestfs.* at the top level
The guestfs.* rule appears to be for temporary appliance directories, which are only at the top level. It was matching more than that. --- .gitignore | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index b278ce2..d4b5de8 100644 --- a/.gitignore +++ b/.gitignore @@ -131,7 +131,7 @@ gobject/Guestfs-1.0.typelib gobject/guestfs-gobject.c gobject/guestfs-gobject.h .guestfs-* -guestfs.* +/guestfs.* guestfsd-in-wine.log haskell/Bindtests haskell/Bindtests.hs -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 04/16] gobject: Add infrastructure to build gtk-doc
--- configure.ac | 22 ++- gobject/Makefile.am | 2 + gobject/docs/.gitignore | 24 ++ gobject/docs/Makefile.am | 105 ++++++ gobject/docs/gtk-doc.make | 1 + gobject/docs/guestfs-docs.sgml.in | 38 ++ gobject/docs/guestfs-sections.txt | 689 +++++++++++++++++++++++++++++++++++++ m4/gtk-doc.m4 | 1 + 8 files changed, 881 insertions(+), 1 deletions(-) create mode 100644 gobject/docs/.gitignore create mode 100644 gobject/docs/Makefile.am create mode 120000 gobject/docs/gtk-doc.make create mode 100644 gobject/docs/guestfs-docs.sgml.in create mode 100644 gobject/docs/guestfs-sections.txt create mode 120000 m4/gtk-doc.m4 diff --git a/configure.ac b/configure.ac index 1214107..8561d67 100644 --- a/configure.ac +++ b/configure.ac @@ -1086,9 +1086,20 @@ AS_IF( ], [AC_MSG_WARN([gobject library not found, gobject binding will be disabled])] ) + + PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0], + [ + AC_SUBST([GIO_CFLAGS]) + AC_SUBST([GIO_LIBS]) + AC_DEFINE([HAVE_GIO],[1], + [gio library found at compile time.]) + ], + [AC_MSG_WARN([gio library not found, gobject binding will be disabled])] + ) ] ) -AM_CONDITIONAL([HAVE_GOBJECT],[test "x$GOBJECT_LIBS" != "x"]) +AM_CONDITIONAL([HAVE_GOBJECT], + [test "x$GOBJECT_LIBS" != "x" -a "x$GIO_LIBS" != "x"]) AC_CHECK_PROG([GJS],[gjs],[gjs]) AS_IF( @@ -1107,6 +1118,13 @@ AM_CONDITIONAL([HAVE_INTROSPECTION], [test "x$HAVE_INTROSPECTION_TRUE" = "x" && test "x$HAVE_GOBJECT_TRUE" = "x"]) +# check for gtk-doc +m4_ifdef([GTK_DOC_CHECK], [ +GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) +],[ +AM_CONDITIONAL([ENABLE_GTK_DOC], false) +]) + dnl Library versioning. MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR` AC_SUBST(MAX_PROC_NR) @@ -1146,6 +1164,8 @@ AC_CONFIG_FILES([Makefile gnulib/lib/Makefile gnulib/tests/Makefile gobject/Makefile + gobject/docs/Makefile + gobject/docs/guestfs-docs.sgml haskell/Makefile inspector/Makefile java/Makefile diff --git a/gobject/Makefile.am b/gobject/Makefile.am index 7f0a8ef..bc479ac 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -15,6 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +SUBDIRS = . docs + BUILT_SOURCES = \ guestfs-gobject.h \ guestfs-gobject.c \ diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore new file mode 100644 index 0000000..735fd55 --- /dev/null +++ b/gobject/docs/.gitignore @@ -0,0 +1,24 @@ +/guestfs.args +/guestfs-decl-list.txt +/guestfs-decl.txt +/guestfs-docs.sgml +/guestfs.hierarchy +/guestfs.interfaces +/guestfs-overrides.txt +/guestfs.prerequisites +/guestfs.signals +/guestfs.types +/guestfs-undeclared.txt +/guestfs-undocumented.txt +/guestfs-unused.txt +/html/ +/html-build.stamp +/html.stamp +/scan-build.stamp +/setup-build.stamp +/sgml-build.stamp +/sgml.stamp +/tmpl/ +/tmpl-build.stamp +/tmpl.stamp +/xml/ diff --git a/gobject/docs/Makefile.am b/gobject/docs/Makefile.am new file mode 100644 index 0000000..0dd43f6 --- /dev/null +++ b/gobject/docs/Makefile.am @@ -0,0 +1,105 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE=guestfs + +# Uncomment for versioned docs and specify the version of the module, e.g. '2'. +#DOC_MODULE_VERSION=2 + + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# Directories containing the source code. +# gtk-doc will search all .c and .h files beneath these paths +# for inline comments documenting functions and macros. +# e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk +DOC_SOURCE_DIR=$(srcdir)/.. + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS+ +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS=--rebuild-sections --rebuild-types + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml +MKDB_OPTIONS=--xml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mktmpl +# e.g. MKTMPL_OPTIONS=--only-section-tmpl +MKTMPL_OPTIONS+ +# Extra options to supply to gtkdoc-mkhtml +MKHTML_OPTIONS+ +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS+ +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB=$(srcdir)/../*.h +CFILE_GLOB=$(srcdir)/../*.c + +# Extra header to include when scanning, which are not under DOC_SOURCE_DIR +# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h +EXTRA_HFILES+ +# Header files or dirs to ignore when scanning. Use base file/dir names +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code +IGNORE_HFILES+ +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES+ +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files+ +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files+ +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +GTKDOC_CFLAGS=$(GOBJECT_CFLAGS) $(GIO_CFLAGS) +GTKDOC_LIBS=$(GOBJECT_LIBS) $(GIO_LIBS) $(builddir)/../libguestfs-gobject-1.0.la + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(srcdir)/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST ++ +# Files not to distribute +# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types +# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt +#DISTCLEANFILES ++ +# Comment this out if you want 'make check' to test doc status +# and run some sanity checks +if ENABLE_GTK_DOC +TESTS_ENVIRONMENT = cd $(srcdir) && \ + DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ + SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) +#TESTS = $(GTKDOC_CHECK) +endif + +-include $(top_srcdir)/git.mk diff --git a/gobject/docs/gtk-doc.make b/gobject/docs/gtk-doc.make new file mode 120000 index 0000000..0870846 --- /dev/null +++ b/gobject/docs/gtk-doc.make @@ -0,0 +1 @@ +/usr/share/gtk-doc/data/gtk-doc.make \ No newline at end of file diff --git a/gobject/docs/guestfs-docs.sgml.in b/gobject/docs/guestfs-docs.sgml.in new file mode 100644 index 0000000..0037864 --- /dev/null +++ b/gobject/docs/guestfs-docs.sgml.in @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" +[ + <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> +]> +<book id="index"> + <bookinfo> + <title>Libguestfs GObject Bindings Reference Manual</title> + <releaseinfo> + for libguestfs @VERSION at . + <!-- + The latest version of this documentation can be found on-line at + <ulink role="online-location" url="http://[SERVER]/guestfs/index.html">http://[SERVER]/guestfs/</ulink>. + --> + </releaseinfo> + </bookinfo> + + <chapter> + <title>Libguestfs GObject Bindings</title> + <xi:include href="xml/guestfs-gobject.xml"/> + + </chapter> + <chapter id="object-tree"> + <title>Object Hierarchy</title> + <xi:include href="xml/tree_index.sgml"/> + </chapter> + <index id="api-index-full"> + <title>API Index</title> + <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> + </index> + <index id="deprecated-api-index" role="deprecated"> + <title>Index of deprecated API</title> + <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include> + </index> + + <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> +</book> diff --git a/gobject/docs/guestfs-sections.txt b/gobject/docs/guestfs-sections.txt new file mode 100644 index 0000000..19b0de8 --- /dev/null +++ b/gobject/docs/guestfs-sections.txt @@ -0,0 +1,689 @@ +<SECTION> +<FILE>guestfs-gobject</FILE> +<TITLE>GuestfsAddDomain</TITLE> +<TITLE>GuestfsAddDriveOpts</TITLE> +<TITLE>GuestfsBTRFSFilesystemResize</TITLE> +<TITLE>GuestfsCompressDeviceOut</TITLE> +<TITLE>GuestfsCompressOut</TITLE> +<TITLE>GuestfsCopyDeviceToDevice</TITLE> +<TITLE>GuestfsCopyDeviceToFile</TITLE> +<TITLE>GuestfsCopyFileToDevice</TITLE> +<TITLE>GuestfsCopyFileToFile</TITLE> +<TITLE>GuestfsE2fsck</TITLE> +<TITLE>GuestfsInspectGetIcon</TITLE> +<TITLE>GuestfsMDCreate</TITLE> +<TITLE>GuestfsMkfsOpts</TITLE> +<TITLE>GuestfsMount9P</TITLE> +<TITLE>GuestfsNTFSResizeOpts</TITLE> +<TITLE>GuestfsNtfscloneOut</TITLE> +<TITLE>GuestfsNtfsfix</TITLE> +<TITLE>GuestfsSession</TITLE> +<TITLE>GuestfsTest0</TITLE> +<TITLE>GuestfsTune2FS</TITLE> +GuestfsAddDomain +GuestfsAddDomainClass +GuestfsAddDriveOpts +GuestfsAddDriveOptsClass +GuestfsApplication +GuestfsBTRFSFilesystemResize +GuestfsBTRFSFilesystemResizeClass +GuestfsCompressDeviceOut +GuestfsCompressDeviceOutClass +GuestfsCompressOut +GuestfsCompressOutClass +GuestfsCopyDeviceToDevice +GuestfsCopyDeviceToDeviceClass +GuestfsCopyDeviceToFile +GuestfsCopyDeviceToFileClass +GuestfsCopyFileToDevice +GuestfsCopyFileToDeviceClass +GuestfsCopyFileToFile +GuestfsCopyFileToFileClass +GuestfsDirent +GuestfsE2fsck +GuestfsE2fsckClass +GuestfsINotifyEvent +GuestfsISOInfo +GuestfsInspectGetIcon +GuestfsInspectGetIconClass +GuestfsIntBool +GuestfsLV +GuestfsMDCreate +GuestfsMDCreateClass +GuestfsMDStat +GuestfsMkfsOpts +GuestfsMkfsOptsClass +GuestfsMount9P +GuestfsMount9PClass +GuestfsNTFSResizeOpts +GuestfsNTFSResizeOptsClass +GuestfsNtfscloneOut +GuestfsNtfscloneOutClass +GuestfsNtfsfix +GuestfsNtfsfixClass +GuestfsPV +GuestfsPartition +GuestfsSession +GuestfsSessionClass +GuestfsStat +GuestfsStatVFS +GuestfsTest0 +GuestfsTest0Class +GuestfsTristate +GuestfsTune2FS +GuestfsTune2FSClass +GuestfsVG +GuestfsVersion +GuestfsXAttr +guestfs_add_domain_new +guestfs_add_drive_opts_new +guestfs_btrfs_filesystem_resize_new +guestfs_compress_device_out_new +guestfs_compress_out_new +guestfs_copy_device_to_device_new +guestfs_copy_device_to_file_new +guestfs_copy_file_to_device_new +guestfs_copy_file_to_file_new +guestfs_e2fsck_new +guestfs_inspect_get_icon_new +guestfs_md_create_new +guestfs_mkfs_opts_new +guestfs_mount_9p_new +guestfs_ntfsclone_out_new +guestfs_ntfsfix_new +guestfs_ntfsresize_opts_new +guestfs_session_add_cdrom +guestfs_session_add_domain +guestfs_session_add_drive +guestfs_session_add_drive_opts +guestfs_session_add_drive_ro +guestfs_session_add_drive_ro_with_if +guestfs_session_add_drive_with_if +guestfs_session_aug_clear +guestfs_session_aug_close +guestfs_session_aug_defnode +guestfs_session_aug_defvar +guestfs_session_aug_get +guestfs_session_aug_init +guestfs_session_aug_insert +guestfs_session_aug_load +guestfs_session_aug_ls +guestfs_session_aug_match +guestfs_session_aug_mv +guestfs_session_aug_rm +guestfs_session_aug_save +guestfs_session_aug_set +guestfs_session_available +guestfs_session_available_all_groups +guestfs_session_base64_in +guestfs_session_base64_out +guestfs_session_blkid +guestfs_session_blockdev_flushbufs +guestfs_session_blockdev_getbsz +guestfs_session_blockdev_getro +guestfs_session_blockdev_getsize64 +guestfs_session_blockdev_getss +guestfs_session_blockdev_getsz +guestfs_session_blockdev_rereadpt +guestfs_session_blockdev_setbsz +guestfs_session_blockdev_setro +guestfs_session_blockdev_setrw +guestfs_session_btrfs_filesystem_resize +guestfs_session_case_sensitive_path +guestfs_session_cat +guestfs_session_checksum +guestfs_session_checksum_device +guestfs_session_checksums_out +guestfs_session_chmod +guestfs_session_chown +guestfs_session_close +guestfs_session_command +guestfs_session_command_lines +guestfs_session_compress_device_out +guestfs_session_compress_out +guestfs_session_config +guestfs_session_copy_device_to_device +guestfs_session_copy_device_to_file +guestfs_session_copy_file_to_device +guestfs_session_copy_file_to_file +guestfs_session_copy_size +guestfs_session_cp +guestfs_session_cp_a +guestfs_session_dd +guestfs_session_debug +guestfs_session_debug_cmdline +guestfs_session_debug_drives +guestfs_session_debug_upload +guestfs_session_df +guestfs_session_df_h +guestfs_session_dmesg +guestfs_session_download +guestfs_session_download_offset +guestfs_session_drop_caches +guestfs_session_du +guestfs_session_e2fsck +guestfs_session_e2fsck_f +guestfs_session_echo_daemon +guestfs_session_egrep +guestfs_session_egrepi +guestfs_session_equal +guestfs_session_exists +guestfs_session_fallocate +guestfs_session_fallocate64 +guestfs_session_fgrep +guestfs_session_fgrepi +guestfs_session_file +guestfs_session_file_architecture +guestfs_session_filesize +guestfs_session_fill +guestfs_session_fill_pattern +guestfs_session_find +guestfs_session_find0 +guestfs_session_findfs_label +guestfs_session_findfs_uuid +guestfs_session_fsck +guestfs_session_get_append +guestfs_session_get_attach_method +guestfs_session_get_autosync +guestfs_session_get_direct +guestfs_session_get_e2label +guestfs_session_get_e2uuid +guestfs_session_get_memsize +guestfs_session_get_network +guestfs_session_get_path +guestfs_session_get_pgroup +guestfs_session_get_pid +guestfs_session_get_qemu +guestfs_session_get_recovery_proc +guestfs_session_get_selinux +guestfs_session_get_smp +guestfs_session_get_state +guestfs_session_get_trace +guestfs_session_get_umask +guestfs_session_get_verbose +guestfs_session_getcon +guestfs_session_getxattr +guestfs_session_getxattrs +guestfs_session_glob_expand +guestfs_session_grep +guestfs_session_grepi +guestfs_session_grub_install +guestfs_session_head +guestfs_session_head_n +guestfs_session_hexdump +guestfs_session_initrd_cat +guestfs_session_initrd_list +guestfs_session_inotify_add_watch +guestfs_session_inotify_close +guestfs_session_inotify_files +guestfs_session_inotify_init +guestfs_session_inotify_read +guestfs_session_inotify_rm_watch +guestfs_session_inspect_get_arch +guestfs_session_inspect_get_distro +guestfs_session_inspect_get_drive_mappings +guestfs_session_inspect_get_filesystems +guestfs_session_inspect_get_format +guestfs_session_inspect_get_hostname +guestfs_session_inspect_get_icon +guestfs_session_inspect_get_major_version +guestfs_session_inspect_get_minor_version +guestfs_session_inspect_get_mountpoints +guestfs_session_inspect_get_package_format +guestfs_session_inspect_get_package_management +guestfs_session_inspect_get_product_name +guestfs_session_inspect_get_product_variant +guestfs_session_inspect_get_roots +guestfs_session_inspect_get_windows_current_control_set +guestfs_session_inspect_get_windows_systemroot +guestfs_session_inspect_is_live +guestfs_session_inspect_is_multipart +guestfs_session_inspect_is_netinst +guestfs_session_inspect_list_applications +guestfs_session_inspect_os +guestfs_session_internal_autosync +guestfs_session_is_blockdev +guestfs_session_is_busy +guestfs_session_is_chardev +guestfs_session_is_config +guestfs_session_is_dir +guestfs_session_is_fifo +guestfs_session_is_file +guestfs_session_is_launching +guestfs_session_is_lv +guestfs_session_is_ready +guestfs_session_is_socket +guestfs_session_is_symlink +guestfs_session_is_zero +guestfs_session_is_zero_device +guestfs_session_isoinfo +guestfs_session_isoinfo_device +guestfs_session_kill_subprocess +guestfs_session_launch +guestfs_session_lchown +guestfs_session_lgetxattr +guestfs_session_lgetxattrs +guestfs_session_list_9p +guestfs_session_list_devices +guestfs_session_list_dm_devices +guestfs_session_list_filesystems +guestfs_session_list_md_devices +guestfs_session_list_partitions +guestfs_session_ll +guestfs_session_llz +guestfs_session_ln +guestfs_session_ln_f +guestfs_session_ln_s +guestfs_session_ln_sf +guestfs_session_lremovexattr +guestfs_session_ls +guestfs_session_lsetxattr +guestfs_session_lstat +guestfs_session_lstatlist +guestfs_session_luks_add_key +guestfs_session_luks_close +guestfs_session_luks_format +guestfs_session_luks_format_cipher +guestfs_session_luks_kill_slot +guestfs_session_luks_open +guestfs_session_luks_open_ro +guestfs_session_lvcreate +guestfs_session_lvcreate_free +guestfs_session_lvm_canonical_lv_name +guestfs_session_lvm_clear_filter +guestfs_session_lvm_remove_all +guestfs_session_lvm_set_filter +guestfs_session_lvremove +guestfs_session_lvrename +guestfs_session_lvresize +guestfs_session_lvresize_free +guestfs_session_lvs +guestfs_session_lvs_full +guestfs_session_lvuuid +guestfs_session_lxattrlist +guestfs_session_md_create +guestfs_session_md_detail +guestfs_session_md_stat +guestfs_session_md_stop +guestfs_session_mkdir +guestfs_session_mkdir_mode +guestfs_session_mkdir_p +guestfs_session_mkdtemp +guestfs_session_mke2fs_J +guestfs_session_mke2fs_JL +guestfs_session_mke2fs_JU +guestfs_session_mke2journal +guestfs_session_mke2journal_L +guestfs_session_mke2journal_U +guestfs_session_mkfifo +guestfs_session_mkfs +guestfs_session_mkfs_b +guestfs_session_mkfs_opts +guestfs_session_mkmountpoint +guestfs_session_mknod +guestfs_session_mknod_b +guestfs_session_mknod_c +guestfs_session_mkswap +guestfs_session_mkswap_L +guestfs_session_mkswap_U +guestfs_session_mkswap_file +guestfs_session_modprobe +guestfs_session_mount +guestfs_session_mount_9p +guestfs_session_mount_loop +guestfs_session_mount_options +guestfs_session_mount_ro +guestfs_session_mount_vfs +guestfs_session_mountpoints +guestfs_session_mounts +guestfs_session_mv +guestfs_session_new +guestfs_session_ntfs_3g_probe +guestfs_session_ntfsclone_in +guestfs_session_ntfsclone_out +guestfs_session_ntfsfix +guestfs_session_ntfsresize +guestfs_session_ntfsresize_opts +guestfs_session_ntfsresize_size +guestfs_session_part_add +guestfs_session_part_del +guestfs_session_part_disk +guestfs_session_part_get_bootable +guestfs_session_part_get_mbr_id +guestfs_session_part_get_parttype +guestfs_session_part_init +guestfs_session_part_list +guestfs_session_part_set_bootable +guestfs_session_part_set_mbr_id +guestfs_session_part_set_name +guestfs_session_part_to_dev +guestfs_session_part_to_partnum +guestfs_session_ping_daemon +guestfs_session_pread +guestfs_session_pread_device +guestfs_session_pvcreate +guestfs_session_pvremove +guestfs_session_pvresize +guestfs_session_pvresize_size +guestfs_session_pvs +guestfs_session_pvs_full +guestfs_session_pvuuid +guestfs_session_pwrite +guestfs_session_pwrite_device +guestfs_session_read_file +guestfs_session_read_lines +guestfs_session_readdir +guestfs_session_readlink +guestfs_session_readlinklist +guestfs_session_realpath +guestfs_session_removexattr +guestfs_session_resize2fs +guestfs_session_resize2fs_M +guestfs_session_resize2fs_size +guestfs_session_rm +guestfs_session_rm_rf +guestfs_session_rmdir +guestfs_session_rmmountpoint +guestfs_session_scrub_device +guestfs_session_scrub_file +guestfs_session_scrub_freespace +guestfs_session_set_append +guestfs_session_set_attach_method +guestfs_session_set_autosync +guestfs_session_set_direct +guestfs_session_set_e2label +guestfs_session_set_e2uuid +guestfs_session_set_label +guestfs_session_set_memsize +guestfs_session_set_network +guestfs_session_set_path +guestfs_session_set_pgroup +guestfs_session_set_qemu +guestfs_session_set_recovery_proc +guestfs_session_set_selinux +guestfs_session_set_smp +guestfs_session_set_trace +guestfs_session_set_verbose +guestfs_session_setcon +guestfs_session_setxattr +guestfs_session_sfdisk +guestfs_session_sfdiskM +guestfs_session_sfdisk_N +guestfs_session_sfdisk_disk_geometry +guestfs_session_sfdisk_kernel_geometry +guestfs_session_sfdisk_l +guestfs_session_sh +guestfs_session_sh_lines +guestfs_session_sleep +guestfs_session_stat +guestfs_session_statvfs +guestfs_session_strings +guestfs_session_strings_e +guestfs_session_swapoff_device +guestfs_session_swapoff_file +guestfs_session_swapoff_label +guestfs_session_swapoff_uuid +guestfs_session_swapon_device +guestfs_session_swapon_file +guestfs_session_swapon_label +guestfs_session_swapon_uuid +guestfs_session_sync +guestfs_session_tail +guestfs_session_tail_n +guestfs_session_tar_in +guestfs_session_tar_out +guestfs_session_test0 +guestfs_session_test0rbool +guestfs_session_test0rboolerr +guestfs_session_test0rbufferout +guestfs_session_test0rbufferouterr +guestfs_session_test0rconstoptstring +guestfs_session_test0rconstoptstringerr +guestfs_session_test0rconststring +guestfs_session_test0rconststringerr +guestfs_session_test0rhashtable +guestfs_session_test0rhashtableerr +guestfs_session_test0rint +guestfs_session_test0rint64 +guestfs_session_test0rint64err +guestfs_session_test0rinterr +guestfs_session_test0rstring +guestfs_session_test0rstringerr +guestfs_session_test0rstringlist +guestfs_session_test0rstringlisterr +guestfs_session_test0rstruct +guestfs_session_test0rstructerr +guestfs_session_test0rstructlist +guestfs_session_test0rstructlisterr +guestfs_session_tgz_in +guestfs_session_tgz_out +guestfs_session_touch +guestfs_session_truncate +guestfs_session_truncate_size +guestfs_session_tune2fs +guestfs_session_tune2fs_l +guestfs_session_txz_in +guestfs_session_txz_out +guestfs_session_umask +guestfs_session_umount +guestfs_session_umount_all +guestfs_session_upload +guestfs_session_upload_offset +guestfs_session_utimens +guestfs_session_version +guestfs_session_vfs_label +guestfs_session_vfs_type +guestfs_session_vfs_uuid +guestfs_session_vg_activate +guestfs_session_vg_activate_all +guestfs_session_vgcreate +guestfs_session_vglvuuids +guestfs_session_vgmeta +guestfs_session_vgpvuuids +guestfs_session_vgremove +guestfs_session_vgrename +guestfs_session_vgs +guestfs_session_vgs_full +guestfs_session_vgscan +guestfs_session_vguuid +guestfs_session_wait_ready +guestfs_session_wc_c +guestfs_session_wc_l +guestfs_session_wc_w +guestfs_session_wipefs +guestfs_session_write +guestfs_session_write_append +guestfs_session_write_file +guestfs_session_zegrep +guestfs_session_zegrepi +guestfs_session_zero +guestfs_session_zero_device +guestfs_session_zero_free_space +guestfs_session_zerofree +guestfs_session_zfgrep +guestfs_session_zfgrepi +guestfs_session_zfile +guestfs_session_zgrep +guestfs_session_zgrepi +guestfs_test0_new +guestfs_tune2fs_new +<SUBSECTION Standard> +GUESTFS_ADD_DOMAIN +GUESTFS_ADD_DOMAIN_CLASS +GUESTFS_ADD_DOMAIN_GET_CLASS +GUESTFS_ADD_DRIVE_OPTS +GUESTFS_ADD_DRIVE_OPTS_CLASS +GUESTFS_ADD_DRIVE_OPTS_GET_CLASS +GUESTFS_BTRFS_FILESYSTEM_RESIZE +GUESTFS_BTRFS_FILESYSTEM_RESIZE_CLASS +GUESTFS_BTRFS_FILESYSTEM_RESIZE_GET_CLASS +GUESTFS_COMPRESS_DEVICE_OUT +GUESTFS_COMPRESS_DEVICE_OUT_CLASS +GUESTFS_COMPRESS_DEVICE_OUT_GET_CLASS +GUESTFS_COMPRESS_OUT +GUESTFS_COMPRESS_OUT_CLASS +GUESTFS_COMPRESS_OUT_GET_CLASS +GUESTFS_COPY_DEVICE_TO_DEVICE +GUESTFS_COPY_DEVICE_TO_DEVICE_CLASS +GUESTFS_COPY_DEVICE_TO_DEVICE_GET_CLASS +GUESTFS_COPY_DEVICE_TO_FILE +GUESTFS_COPY_DEVICE_TO_FILE_CLASS +GUESTFS_COPY_DEVICE_TO_FILE_GET_CLASS +GUESTFS_COPY_FILE_TO_DEVICE +GUESTFS_COPY_FILE_TO_DEVICE_CLASS +GUESTFS_COPY_FILE_TO_DEVICE_GET_CLASS +GUESTFS_COPY_FILE_TO_FILE +GUESTFS_COPY_FILE_TO_FILE_CLASS +GUESTFS_COPY_FILE_TO_FILE_GET_CLASS +GUESTFS_E2FSCK +GUESTFS_E2FSCK_CLASS +GUESTFS_E2FSCK_GET_CLASS +GUESTFS_INSPECT_GET_ICON +GUESTFS_INSPECT_GET_ICON_CLASS +GUESTFS_INSPECT_GET_ICON_GET_CLASS +GUESTFS_IS_ADD_DOMAIN +GUESTFS_IS_ADD_DOMAIN_CLASS +GUESTFS_IS_ADD_DRIVE_OPTS +GUESTFS_IS_ADD_DRIVE_OPTS_CLASS +GUESTFS_IS_BTRFS_FILESYSTEM_RESIZE +GUESTFS_IS_BTRFS_FILESYSTEM_RESIZE_CLASS +GUESTFS_IS_COMPRESS_DEVICE_OUT +GUESTFS_IS_COMPRESS_DEVICE_OUT_CLASS +GUESTFS_IS_COMPRESS_OUT +GUESTFS_IS_COMPRESS_OUT_CLASS +GUESTFS_IS_COPY_DEVICE_TO_DEVICE +GUESTFS_IS_COPY_DEVICE_TO_DEVICE_CLASS +GUESTFS_IS_COPY_DEVICE_TO_FILE +GUESTFS_IS_COPY_DEVICE_TO_FILE_CLASS +GUESTFS_IS_COPY_FILE_TO_DEVICE +GUESTFS_IS_COPY_FILE_TO_DEVICE_CLASS +GUESTFS_IS_COPY_FILE_TO_FILE +GUESTFS_IS_COPY_FILE_TO_FILE_CLASS +GUESTFS_IS_E2FSCK +GUESTFS_IS_E2FSCK_CLASS +GUESTFS_IS_INSPECT_GET_ICON +GUESTFS_IS_INSPECT_GET_ICON_CLASS +GUESTFS_IS_MD_CREATE +GUESTFS_IS_MD_CREATE_CLASS +GUESTFS_IS_MKFS_OPTS +GUESTFS_IS_MKFS_OPTS_CLASS +GUESTFS_IS_MOUNT_9P +GUESTFS_IS_MOUNT_9P_CLASS +GUESTFS_IS_NTFSCLONE_OUT +GUESTFS_IS_NTFSCLONE_OUT_CLASS +GUESTFS_IS_NTFSFIX +GUESTFS_IS_NTFSFIX_CLASS +GUESTFS_IS_NTFSRESIZE_OPTS +GUESTFS_IS_NTFSRESIZE_OPTS_CLASS +GUESTFS_IS_SESSION +GUESTFS_IS_SESSION_CLASS +GUESTFS_IS_TEST0 +GUESTFS_IS_TEST0_CLASS +GUESTFS_IS_TUNE2FS +GUESTFS_IS_TUNE2FS_CLASS +GUESTFS_MD_CREATE +GUESTFS_MD_CREATE_CLASS +GUESTFS_MD_CREATE_GET_CLASS +GUESTFS_MKFS_OPTS +GUESTFS_MKFS_OPTS_CLASS +GUESTFS_MKFS_OPTS_GET_CLASS +GUESTFS_MOUNT_9P +GUESTFS_MOUNT_9P_CLASS +GUESTFS_MOUNT_9P_GET_CLASS +GUESTFS_NTFSCLONE_OUT +GUESTFS_NTFSCLONE_OUT_CLASS +GUESTFS_NTFSCLONE_OUT_GET_CLASS +GUESTFS_NTFSFIX +GUESTFS_NTFSFIX_CLASS +GUESTFS_NTFSFIX_GET_CLASS +GUESTFS_NTFSRESIZE_OPTS +GUESTFS_NTFSRESIZE_OPTS_CLASS +GUESTFS_NTFSRESIZE_OPTS_GET_CLASS +GUESTFS_SESSION +GUESTFS_SESSION_CLASS +GUESTFS_SESSION_GET_CLASS +GUESTFS_TEST0 +GUESTFS_TEST0_CLASS +GUESTFS_TEST0_GET_CLASS +GUESTFS_TUNE2FS +GUESTFS_TUNE2FS_CLASS +GUESTFS_TUNE2FS_GET_CLASS +GUESTFS_TYPE_ADD_DOMAIN +GUESTFS_TYPE_ADD_DRIVE_OPTS +GUESTFS_TYPE_BTRFS_FILESYSTEM_RESIZE +GUESTFS_TYPE_COMPRESS_DEVICE_OUT +GUESTFS_TYPE_COMPRESS_OUT +GUESTFS_TYPE_COPY_DEVICE_TO_DEVICE +GUESTFS_TYPE_COPY_DEVICE_TO_FILE +GUESTFS_TYPE_COPY_FILE_TO_DEVICE +GUESTFS_TYPE_COPY_FILE_TO_FILE +GUESTFS_TYPE_E2FSCK +GUESTFS_TYPE_INSPECT_GET_ICON +GUESTFS_TYPE_MD_CREATE +GUESTFS_TYPE_MKFS_OPTS +GUESTFS_TYPE_MOUNT_9P +GUESTFS_TYPE_NTFSCLONE_OUT +GUESTFS_TYPE_NTFSFIX +GUESTFS_TYPE_NTFSRESIZE_OPTS +GUESTFS_TYPE_SESSION +GUESTFS_TYPE_TEST0 +GUESTFS_TYPE_TRISTATE +GUESTFS_TYPE_TUNE2FS +GuestfsAddDomainPrivate +GuestfsAddDriveOptsPrivate +GuestfsBTRFSFilesystemResizePrivate +GuestfsCompressDeviceOutPrivate +GuestfsCompressOutPrivate +GuestfsCopyDeviceToDevicePrivate +GuestfsCopyDeviceToFilePrivate +GuestfsCopyFileToDevicePrivate +GuestfsCopyFileToFilePrivate +GuestfsE2fsckPrivate +GuestfsInspectGetIconPrivate +GuestfsMDCreatePrivate +GuestfsMkfsOptsPrivate +GuestfsMount9PPrivate +GuestfsNTFSResizeOptsPrivate +GuestfsNtfscloneOutPrivate +GuestfsNtfsfixPrivate +GuestfsSessionPrivate +GuestfsTest0Private +GuestfsTune2FSPrivate +guestfs_add_domain_get_type +guestfs_add_drive_opts_get_type +guestfs_application_get_type +guestfs_btrfs_filesystem_resize_get_type +guestfs_compress_device_out_get_type +guestfs_compress_out_get_type +guestfs_copy_device_to_device_get_type +guestfs_copy_device_to_file_get_type +guestfs_copy_file_to_device_get_type +guestfs_copy_file_to_file_get_type +guestfs_dirent_get_type +guestfs_e2fsck_get_type +guestfs_inotify_event_get_type +guestfs_inspect_get_icon_get_type +guestfs_int_bool_get_type +guestfs_isoinfo_get_type +guestfs_lvm_lv_get_type +guestfs_lvm_pv_get_type +guestfs_lvm_vg_get_type +guestfs_md_create_get_type +guestfs_mdstat_get_type +guestfs_mkfs_opts_get_type +guestfs_mount_9p_get_type +guestfs_ntfsclone_out_get_type +guestfs_ntfsfix_get_type +guestfs_ntfsresize_opts_get_type +guestfs_partition_get_type +guestfs_session_get_type +guestfs_session_inspect_get_type +guestfs_stat_get_type +guestfs_statvfs_get_type +guestfs_test0_get_type +guestfs_tristate_get_type +guestfs_tune2fs_get_type +guestfs_version_get_type +guestfs_xattr_get_type +</SECTION> + diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 new file mode 120000 index 0000000..d214c6a --- /dev/null +++ b/m4/gtk-doc.m4 @@ -0,0 +1 @@ +/usr/share/aclocal/gtk-doc.m4 \ No newline at end of file -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 05/16] gobject: Include explicit types for all parameters
--- generator/generator_gobject.ml | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 7bac45e..c31f6d8 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -645,7 +645,12 @@ let generate_gobject_c_methods () fun argt -> pr " * @%s:" (name_of_argt argt); (match argt with - | Bool _ | Int _ | Int64 _ -> () + | Bool _ -> + pr " (type gboolean):" + | Int _ -> + pr " (type gint32):" + | Int64 _ -> + pr " (type gint64):" | String _ | Key _ -> pr " (transfer none) (type utf8):" | OptString _ -> -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 06/16] gobject: gtk-doc SECTION must be named after a source file
--- generator/generator_gobject.ml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index c31f6d8..c1eb6c0 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -297,7 +297,7 @@ let generate_gobject_c_static () #include \"guestfs-gobject.h\" /** - * SECTION: guestfs-session + * SECTION:guestfs-gobject * @short_description: Libguestfs session * @include: guestfs-gobject.h * -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 07/16] gobject: Add basic gtk-doc for properties
--- generator/generator_gobject.ml | 37 ++++++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 15 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index c1eb6c0..017e860 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -553,7 +553,6 @@ let generate_gobject_c_optarg name optargs flags pr "static void\nguestfs_%s_class_init(%sClass *klass)\n" name camel_name; pr "{\n"; pr " GObjectClass *object_class = G_OBJECT_CLASS(klass);\n"; - pr " GParamSpec *pspec;\n\n"; pr " object_class->set_property = guestfs_%s_set_property;\n" name; pr " object_class->get_property = guestfs_%s_get_property;\n\n" name; @@ -561,24 +560,32 @@ let generate_gobject_c_optarg name optargs flags List.iter ( fun optargt -> let optname = name_of_optargt optargt in - let uc_optname = String.uppercase optname in - pr " pspec = "; - (match optargt with + let (type_spec, type_init, type_desc) = (match optargt with | OBool n -> - pr "g_param_spec_enum(\"%s\", \"%s\", NULL, " optname optname; - pr "GUESTFS_TYPE_TRISTATE, GUESTFS_TRISTATE_NONE, "; + ("enum", "GUESTFS_TYPE_TRISTATE, GUESTFS_TRISTATE_NONE", "A boolean.") | OInt n -> - pr "g_param_spec_int(\"%s\", \"%s\", NULL, " optname optname; - pr "G_MININT32, G_MAXINT32, -1, "; + ("int", "G_MININT32, G_MAXINT32, -1", "A 32-bit integer.") | OInt64 n -> - pr "g_param_spec_int64(\"%s\", \"%s\", NULL, " optname optname; - pr "G_MININT64, G_MAXINT64, -1, "; + ("int64", "G_MININT64, G_MAXINT64, -1", "A 64-bit integer.") | OString n -> - pr "g_param_spec_string(\"%s\", \"%s\", NULL, " optname optname; - pr "NULL, "); - pr "G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);\n"; - pr " g_object_class_install_property(object_class, "; - pr "PROP_GUESTFS_%s_%s, pspec);\n\n" uc_name uc_optname; + ("string", "NULL", "A string.")) in + pr " /**\n"; + pr " * %s:%s:\n" camel_name optname; + pr " *\n"; + pr " * %s\n" type_desc; + pr " */\n"; + pr " g_object_class_install_property(\n"; + pr " object_class,\n"; + pr " PROP_GUESTFS_%s_%s,\n" uc_name (String.uppercase optname); + pr " g_param_spec_%s(\n" type_spec; + pr " \"%s\",\n" optname; + pr " \"%s\",\n" optname; + pr " \"%s\",\n" type_desc; + pr " %s,\n" type_init; + pr " G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS\n"; + pr " )\n"; + pr " );\n\n"; + ) optargs; pr " object_class->finalize = guestfs_%s_finalize;\n" name; -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 08/16] gobject: Add basic gtk-doc for all parameters
--- generator/generator_gobject.ml | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 017e860..8516e1f 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -370,6 +370,8 @@ guestfs_session_new(void) /** * guestfs_session_close: + * @session: (transfer none): A GuestfsSession object + * @err: A GError object to receive any generated errors * * Close a libguestfs session. * @@ -641,12 +643,16 @@ let generate_gobject_c_methods () "NULL" (* NULL is a valid return for RConstOptString. Error is indicated by also setting *err to a non-NULL value *) in + let cancellable + List.exists (function Cancellable -> true | _ -> false) flags + in (* The comment header, including GI annotations for arguments and the return value *) pr "/**\n"; pr " * guestfs_session_%s:\n" name; + pr " * @session: (transfer none): A GuestfsSession object\n"; List.iter ( fun argt -> @@ -669,7 +675,8 @@ let generate_gobject_c_methods () | DeviceList _ -> pr " (transfer none) (array zero-terminated=1) (element-type filename): an array of strings" | BufferIn n -> - pr " (transfer none) (array length=%s_size) (element-type guint8): an array of binary data" n + pr " (transfer none) (array length=%s_size) (element-type guint8): an array of binary data\n" n; + pr " * @%s_size: The size of %s, in bytes" n n; | Pointer _ -> failwith "gobject bindings do not support Pointer arguments" ); @@ -677,6 +684,14 @@ let generate_gobject_c_methods () ) args; if optargs <> [] then pr " * @optargs: (transfer none) (allow-none): a %s containing optional arguments\n" camel_name; + (match ret with + | RBufferOut _ -> + pr " * @size_r: The size of the returned buffer, in bytes\n"; + | _ -> ()); + if cancellable then ( + pr " * @cancellable: A GCancellable object\n"; + ); + pr " * @err: A GError object to receive any generated errors\n"; pr " *\n"; pr " * %s\n" shortdesc; @@ -716,9 +731,6 @@ let generate_gobject_c_methods () generate_gobject_proto ~single_line:false name style flags; pr "\n{\n"; - let cancellable - List.exists (function Cancellable -> true | _ -> false) flags - in if cancellable then ( pr " /* Check we haven't already been cancelled */\n"; pr " if (g_cancellable_set_error_if_cancelled (cancellable, err))\n"; -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 09/16] gobject: Handle various problem content in gtk-doc API descriptions
Produce better gtk-doc for: * URLs * RHBZ# references * CVE references * API cross-references * Parameter references * Escaped characters --- generator/generator_gobject.ml | 46 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 45 insertions(+), 1 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 8516e1f..028c3f5 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -625,9 +625,53 @@ let generate_gobject_c_optargs () let generate_gobject_c_methods () pr "/* Generated methods */\n\n"; + let urls = Str.regexp "L<\\(https?\\)://\\([^>]*\\)>" in + let bz = Str.regexp "RHBZ#\\([0-9]+\\)" in + let cve = Str.regexp "\\(CVE-[0-9]+-[0-9]+\\)" in + let api_crossref = Str.regexp "C<guestfs_\\([-_0-9a-zA-Z]+\\)>" in + let nonapi_crossref = Str.regexp "C<\\([-_0-9a-zA-Z]+\\)>" in + let escaped = Str.regexp "E<\\([0-9a-zA-Z]+\\)>" in + List.iter ( fun (name, (ret, args, optargs as style), _, flags, _, shortdesc, longdesc) -> - let doc = pod2text ~width:60 name longdesc in + let longdesc = Str.global_substitute urls ( + fun s -> + let scheme = Str.matched_group 1 s in + let url = Str.matched_group 2 s in + (* The spaces below are deliberate: they give pod2text somewhere to + split that isn't the middle of a URL. *) + "<ulink url='" ^ scheme ^ "://" ^ url ^ + "'> http://" ^ url ^ " </ulink>" + ) longdesc in + let longdesc = Str.global_substitute bz ( + fun s -> + let bz = Str.matched_group 1 s in + (* The spaces below are deliberate: they give pod2text somewhere to + split that isn't the middle of a URL. *) + "<ulink url='https://bugzilla.redhat.com/show_bug.cgi?id=" ^ + bz ^ "'> RHBZ#" ^ bz ^ " </ulink>" + ) longdesc in + let longdesc = Str.global_substitute cve ( + fun s -> + let cve = Str.matched_group 1 s in + (* The spaces below are deliberate: they give pod2text somewhere to + split that isn't the middle of a URL. *) + "<ulink url='https://cve.mitre.org/cgi-bin/cvename.cgi?name=" ^ + cve ^ "'> " ^ cve ^ " </ulink>" + ) longdesc in + let longdesc = Str.global_substitute api_crossref ( + fun s -> + "guestfs_session_" ^ Str.matched_group 1 s ^ "()" + ) longdesc in + let longdesc = Str.global_substitute nonapi_crossref ( + fun s -> + "@" ^ Str.matched_group 1 s + ) longdesc in + let longdesc = Str.global_substitute escaped ( + fun s -> + "&" ^ Str.matched_group 1 s ^ ";" + ) longdesc in + let doc = pod2text ~width:76 name longdesc in let doc = String.concat "\n * " doc in let camel_name = camel_of_name flags name in let is_RBufferOut = match ret with RBufferOut _ -> true | _ -> false in -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 10/16] gobject: Drop references to Guestfs::<foo> in comments
--- generator/generator_gobject.ml | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 028c3f5..77b8e32 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -118,7 +118,7 @@ let generate_gobject_header_static () G_BEGIN_DECLS -/* Guestfs::Session object definition */ +/* GuestfsSession object definition */ #define GUESTFS_TYPE_SESSION (guestfs_session_get_type()) #define GUESTFS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ( \ (obj), \ @@ -158,7 +158,7 @@ GType guestfs_session_get_type(void); GuestfsSession *guestfs_session_new(void); gboolean guestfs_session_close(GuestfsSession *session, GError **err); -/* Guestfs::Tristate */ +/* GuestfsTristate */ typedef enum { GUESTFS_TRISTATE_FALSE, @@ -278,7 +278,7 @@ let generate_gobject_header_optargs () ) all_functions let generate_gobject_header_methods () - pr "/* Generated methods */\n"; + pr "/* GuestfsSession */\n"; List.iter ( fun (name, style, _, flags, _, _, _) -> generate_gobject_proto name style flags; @@ -393,7 +393,7 @@ guestfs_session_close(GuestfsSession *session, GError **err) return TRUE; } -/* Guestfs::Tristate */ +/* GuestfsTristate */ GType guestfs_tristate_get_type(void) { -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 11/16] gobject: Add gtk-doc for optarg wrapper classes
--- generator/generator_gobject.ml | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 77b8e32..6a7c36a 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -158,7 +158,17 @@ GType guestfs_session_get_type(void); GuestfsSession *guestfs_session_new(void); gboolean guestfs_session_close(GuestfsSession *session, GError **err); -/* GuestfsTristate */ +/** + * GuestfsTristate: + * @GUESTFS_TRISTATE_FALSE: False + * @GUESTFS_TRISTATE_TRUE: True + * @GUESTFS_TRISTATE_NONE: Unset + * + * An object representing a tristate: i.e. true, false, or unset. If a language + * binding has a native concept of true and false which also correspond to the + * integer values 1 and 0 respectively, these will also correspond to + * GUESTFS_TRISTATE_TRUE and GUESTFS_TRISTATE_FALSE. + */ typedef enum { GUESTFS_TRISTATE_FALSE, @@ -247,20 +257,27 @@ let generate_gobject_header_optarg name optargs flags pr "(G_TYPE_INSTANCE_GET_CLASS((obj), %s, %sClass))\n" type_define camel_name; pr "\n"; - - List.iter ( - fun suffix -> - let name = camel_name ^ suffix in - pr "typedef struct _%s %s;\n" name name; - ) [ ""; "Private"; "Class" ]; - + pr "typedef struct _%sPrivate %sPrivate;\n" camel_name camel_name; pr "\n"; + pr "/**\n"; + pr " * %s:\n" camel_name; + pr " *\n"; + pr " * An object encapsulating optional arguments for guestfs_session_%s.\n" name; + pr " */\n"; + pr "typedef struct _%s %s;\n" camel_name camel_name; pr "struct _%s {\n" camel_name; pr " GObject parent;\n"; pr " %sPrivate *priv;\n" camel_name; pr "};\n\n"; + pr "/**\n"; + pr " * %sClass:\n" camel_name; + pr " * @parent_class: The superclass of %sClass\n" camel_name; + pr " *\n"; + pr " * A class metadata object for %s.\n" camel_name; + pr " */\n"; + pr "typedef struct _%sClass %sClass;\n" camel_name camel_name; pr "struct _%sClass {\n" camel_name; pr " GObjectClass parent_class;\n"; pr "};\n\n"; -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 12/16] gobject: Add gtk-doc field descriptions for generated structs
--- generator/generator_gobject.ml | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 6a7c36a..ec3f652 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -194,6 +194,31 @@ let generate_gobject_header_structs () List.iter ( fun (typ, cols) -> let camel = camel_name_of_struct typ in + pr "/**\n"; + pr " * Guestfs%s:\n" camel; + List.iter ( + function + | n, FChar -> + pr " * @%s: A character\n" n + | n, FUInt32 -> + pr " * @%s: An unsigned 32-bit integer\n" n + | n, FInt32 -> + pr " * @%s: A signed 32-bit integer\n" n + | n, (FUInt64|FBytes) -> + pr " * @%s: An unsigned 64-bit integer\n" n + | n, FInt64 -> + pr " * @%s: A signed 64-bit integer\n" n + | n, FString -> + pr " * @%s: A NULL-terminated string\n" n + | n, FBuffer -> + pr " * @%s: A GByteArray\n" n + | n, FUUID -> + pr " * @%s: A 32 byte UUID. Note that this is not NULL-terminated\n" n + | n, FOptPercent -> + pr " * @%s: A floating point number. A value between 0 and 100 " n; + pr "represents a percentage. A value of -1 represents 'not present'\n" + ) cols; + pr " */\n"; pr "typedef struct _Guestfs%s Guestfs%s;\n" camel camel; pr "struct _Guestfs%s {\n" camel; List.iter ( -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 13/16] gobject: Add gtk-doc for GuestfsSession and GuestfsSessionClass
--- generator/generator_gobject.ml | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index ec3f652..52a9a0c 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -139,16 +139,27 @@ G_BEGIN_DECLS GUESTFS_TYPE_SESSION, \ GuestfsSessionClass)) -typedef struct _GuestfsSession GuestfsSession; -typedef struct _GuestfsSessionClass GuestfsSessionClass; typedef struct _GuestfsSessionPrivate GuestfsSessionPrivate; +/** + * GuestfsSession: + * + * A libguestfs session, encapsulating a single libguestfs handle. + */ +typedef struct _GuestfsSession GuestfsSession; struct _GuestfsSession { GObject parent; GuestfsSessionPrivate *priv; }; +/** + * GuestfsSessionClass: + * @parent_class: The superclass of GuestfsSession + * + * A class metadata object for GuestfsSession. + */ +typedef struct _GuestfsSessionClass GuestfsSessionClass; struct _GuestfsSessionClass { GObjectClass parent_class; -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 14/16] gobject: Update the gtk-doc description of the gobject bindings
--- generator/generator_gobject.ml | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index 52a9a0c..70626ab 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -351,11 +351,10 @@ let generate_gobject_c_static () /** * SECTION:guestfs-gobject - * @short_description: Libguestfs session + * @short_description: The libguestfs library * @include: guestfs-gobject.h * - * A libguestfs session which can be used to inspect and modify virtual disk - * images. + * A library for accessing and modifying virtual machine images. */ /* Error quark */ -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 15/16] gobject: Improve the structure of guestfs-sections.txt
The generator doesn't make a very good job of guestfs-sections.txt. This change manually fixes its title, and moves various sections which shouldn't be in the documentation into a Private subsection. This change requires removing the --rebuild-sections command line option from gtkdoc-scan. This means that any future apis will have to be manually added to guestfs-sections.txt if they are to appear in the gtk-doc output. --- gobject/docs/Makefile.am | 3 +- gobject/docs/guestfs-sections.txt | 126 ++++++++++++++++--------------------- 2 files changed, 57 insertions(+), 72 deletions(-) diff --git a/gobject/docs/Makefile.am b/gobject/docs/Makefile.am index 0dd43f6..8988bc5 100644 --- a/gobject/docs/Makefile.am +++ b/gobject/docs/Makefile.am @@ -29,7 +29,8 @@ SCANGOBJ_OPTIONS # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS=--rebuild-sections --rebuild-types +#SCAN_OPTIONS=--rebuild-sections --rebuild-types +SCAN_OPTIONS=--rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml diff --git a/gobject/docs/guestfs-sections.txt b/gobject/docs/guestfs-sections.txt index 19b0de8..8cbaa32 100644 --- a/gobject/docs/guestfs-sections.txt +++ b/gobject/docs/guestfs-sections.txt @@ -1,80 +1,41 @@ <SECTION> <FILE>guestfs-gobject</FILE> -<TITLE>GuestfsAddDomain</TITLE> -<TITLE>GuestfsAddDriveOpts</TITLE> -<TITLE>GuestfsBTRFSFilesystemResize</TITLE> -<TITLE>GuestfsCompressDeviceOut</TITLE> -<TITLE>GuestfsCompressOut</TITLE> -<TITLE>GuestfsCopyDeviceToDevice</TITLE> -<TITLE>GuestfsCopyDeviceToFile</TITLE> -<TITLE>GuestfsCopyFileToDevice</TITLE> -<TITLE>GuestfsCopyFileToFile</TITLE> -<TITLE>GuestfsE2fsck</TITLE> -<TITLE>GuestfsInspectGetIcon</TITLE> -<TITLE>GuestfsMDCreate</TITLE> -<TITLE>GuestfsMkfsOpts</TITLE> -<TITLE>GuestfsMount9P</TITLE> -<TITLE>GuestfsNTFSResizeOpts</TITLE> -<TITLE>GuestfsNtfscloneOut</TITLE> -<TITLE>GuestfsNtfsfix</TITLE> -<TITLE>GuestfsSession</TITLE> -<TITLE>GuestfsTest0</TITLE> -<TITLE>GuestfsTune2FS</TITLE> +<TITLE>Guestfs</TITLE> +GuestfsSession GuestfsAddDomain -GuestfsAddDomainClass GuestfsAddDriveOpts -GuestfsAddDriveOptsClass GuestfsApplication GuestfsBTRFSFilesystemResize -GuestfsBTRFSFilesystemResizeClass GuestfsCompressDeviceOut -GuestfsCompressDeviceOutClass GuestfsCompressOut -GuestfsCompressOutClass GuestfsCopyDeviceToDevice -GuestfsCopyDeviceToDeviceClass GuestfsCopyDeviceToFile -GuestfsCopyDeviceToFileClass GuestfsCopyFileToDevice -GuestfsCopyFileToDeviceClass GuestfsCopyFileToFile -GuestfsCopyFileToFileClass GuestfsDirent GuestfsE2fsck -GuestfsE2fsckClass GuestfsINotifyEvent GuestfsISOInfo GuestfsInspectGetIcon -GuestfsInspectGetIconClass GuestfsIntBool GuestfsLV GuestfsMDCreate -GuestfsMDCreateClass GuestfsMDStat GuestfsMkfsOpts -GuestfsMkfsOptsClass GuestfsMount9P -GuestfsMount9PClass GuestfsNTFSResizeOpts -GuestfsNTFSResizeOptsClass GuestfsNtfscloneOut -GuestfsNtfscloneOutClass GuestfsNtfsfix -GuestfsNtfsfixClass GuestfsPV GuestfsPartition -GuestfsSession -GuestfsSessionClass GuestfsStat GuestfsStatVFS -GuestfsTest0 -GuestfsTest0Class GuestfsTristate GuestfsTune2FS -GuestfsTune2FSClass GuestfsVG GuestfsVersion GuestfsXAttr +guestfs_session_new guestfs_add_domain_new guestfs_add_drive_opts_new guestfs_btrfs_filesystem_resize_new @@ -337,7 +298,6 @@ guestfs_session_mount_vfs guestfs_session_mountpoints guestfs_session_mounts guestfs_session_mv -guestfs_session_new guestfs_session_ntfs_3g_probe guestfs_session_ntfsclone_in guestfs_session_ntfsclone_out @@ -432,29 +392,6 @@ guestfs_session_tail guestfs_session_tail_n guestfs_session_tar_in guestfs_session_tar_out -guestfs_session_test0 -guestfs_session_test0rbool -guestfs_session_test0rboolerr -guestfs_session_test0rbufferout -guestfs_session_test0rbufferouterr -guestfs_session_test0rconstoptstring -guestfs_session_test0rconstoptstringerr -guestfs_session_test0rconststring -guestfs_session_test0rconststringerr -guestfs_session_test0rhashtable -guestfs_session_test0rhashtableerr -guestfs_session_test0rint -guestfs_session_test0rint64 -guestfs_session_test0rint64err -guestfs_session_test0rinterr -guestfs_session_test0rstring -guestfs_session_test0rstringerr -guestfs_session_test0rstringlist -guestfs_session_test0rstringlisterr -guestfs_session_test0rstruct -guestfs_session_test0rstructerr -guestfs_session_test0rstructlist -guestfs_session_test0rstructlisterr guestfs_session_tgz_in guestfs_session_tgz_out guestfs_session_touch @@ -505,8 +442,6 @@ guestfs_session_zfgrepi guestfs_session_zfile guestfs_session_zgrep guestfs_session_zgrepi -guestfs_test0_new -guestfs_tune2fs_new <SUBSECTION Standard> GUESTFS_ADD_DOMAIN GUESTFS_ADD_DOMAIN_CLASS @@ -629,6 +564,27 @@ GUESTFS_TYPE_SESSION GUESTFS_TYPE_TEST0 GUESTFS_TYPE_TRISTATE GUESTFS_TYPE_TUNE2FS +<SUBSECTION Private> +GuestfsAddDomainClass +GuestfsAddDriveOptsClass +GuestfsBTRFSFilesystemResizeClass +GuestfsCompressDeviceOutClass +GuestfsCompressOutClass +GuestfsCopyDeviceToDeviceClass +GuestfsCopyDeviceToFileClass +GuestfsCopyFileToDeviceClass +GuestfsCopyFileToFileClass +GuestfsE2fsckClass +GuestfsInspectGetIconClass +GuestfsMDCreateClass +GuestfsMkfsOptsClass +GuestfsMount9PClass +GuestfsNtfscloneOutClass +GuestfsNtfsfixClass +GuestfsNTFSResizeOptsClass +GuestfsSessionClass +GuestfsTune2FSClass + GuestfsAddDomainPrivate GuestfsAddDriveOptsPrivate GuestfsBTRFSFilesystemResizePrivate @@ -647,8 +603,8 @@ GuestfsNTFSResizeOptsPrivate GuestfsNtfscloneOutPrivate GuestfsNtfsfixPrivate GuestfsSessionPrivate -GuestfsTest0Private GuestfsTune2FSPrivate + guestfs_add_domain_get_type guestfs_add_drive_opts_get_type guestfs_application_get_type @@ -680,10 +636,38 @@ guestfs_session_get_type guestfs_session_inspect_get_type guestfs_stat_get_type guestfs_statvfs_get_type -guestfs_test0_get_type guestfs_tristate_get_type guestfs_tune2fs_get_type guestfs_version_get_type guestfs_xattr_get_type -</SECTION> +GuestfsTest0 +GuestfsTest0Class +GuestfsTest0Private +guestfs_session_test0 +guestfs_session_test0rbool +guestfs_session_test0rboolerr +guestfs_session_test0rbufferout +guestfs_session_test0rbufferouterr +guestfs_session_test0rconstoptstring +guestfs_session_test0rconstoptstringerr +guestfs_session_test0rconststring +guestfs_session_test0rconststringerr +guestfs_session_test0rhashtable +guestfs_session_test0rhashtableerr +guestfs_session_test0rint +guestfs_session_test0rint64 +guestfs_session_test0rint64err +guestfs_session_test0rinterr +guestfs_session_test0rstring +guestfs_session_test0rstringerr +guestfs_session_test0rstringlist +guestfs_session_test0rstringlisterr +guestfs_session_test0rstruct +guestfs_session_test0rstructerr +guestfs_session_test0rstructlist +guestfs_session_test0rstructlisterr +guestfs_test0_new +guestfs_tune2fs_new +guestfs_test0_get_type +</SECTION> -- 1.7.7.6
Matthew Booth
2012-Mar-27 15:00 UTC
[Libguestfs] [PATCH 16/16] gobject: Update gtk-doc status in TODO
--- gobject/TODO.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gobject/TODO.txt b/gobject/TODO.txt index afe86e1..4fc74e7 100644 --- a/gobject/TODO.txt +++ b/gobject/TODO.txt @@ -4,9 +4,9 @@ Tasks required before the GObject bindings can be considered complete: - This is addressed here: https://bugzilla.gnome.org/show_bug.cgi?id=671218 The fix will hopefully make it upstream soon. No changes are required in libguestfs. -* Build the gtkdoc and make it available to the developer * Bind the libguestfs events API Tasks which would improve the usability of the GObject bindings: * Implement _async versions of all apis +* Split guestfs-gobject.(c|h) into multiple files to generate better gtk-doc. -- 1.7.7.6
Richard W.M. Jones
2012-Mar-29 08:32 UTC
[Libguestfs] [PATCH 01/16] generator: Fix unescaped '<' and '>' in api descriptions
On Tue, Mar 27, 2012 at 04:00:43PM +0100, Matthew Booth wrote:> --- > generator/generator_actions.ml | 9 +++++---- > 1 files changed, 5 insertions(+), 4 deletions(-)I've looked at this patch again, and it's wrong:> diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml > index 68a7bf6..fcf363f 100644 > --- a/generator/generator_actions.ml > +++ b/generator/generator_actions.ml > @@ -4664,7 +4664,7 @@ This creates an ext2/3/4 filesystem on C<device> with > an external journal on C<journal>. It is equivalent > to the command: > > - mke2fs -t fstype -b blocksize -J device=<journal> <device> > + mke2fs -t fstype -b blocksize -J device=E<lt>journalE<gt> E<lt>deviceE<gt>These should not be quoted, since they are in a verbatim section.> See also C<guestfs_mke2journal>."); > > @@ -5330,7 +5330,7 @@ For example, in guestfish you could use the following command > to examine the boot script (usually called C</init>) > contained in a Linux initrd or initramfs image: > > - initrd-cat /boot/initrd-<version>.img init > + initrd-cat /boot/initrd-E<lt>versionE<gt>.img initDitto.> See also C<guestfs_initrd_list>."); > > @@ -6560,8 +6560,9 @@ List all Linux md devices."); > [], > "obtain metadata for an MD device", > "\ > -This command exposes the output of 'mdadm -DY <md>'. The following fields are > -usually present in the returned hash. Other fields may also be present. > +This command exposes the output of 'mdadm -DY E<lt>mdE<gt>'. The following > +fields are usually present in the returned hash. Other fields may also be > +present. > > =overThis is OK. I'm going to revert the two wrong hunks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v