summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 to exitJim Meyering2009-11-202-9/+9
| | | | | | | | | | | | | | | Convert all uses automatically, via these two commands: git grep -l '\<exit *(1)' \ | grep -vEf .x-sc_prohibit_magic_number_exit \ | xargs --no-run-if-empty \ perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/' git grep -l '\<exit *(0)' \ | grep -vEf .x-sc_prohibit_magic_number_exit \ | xargs --no-run-if-empty \ perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/' * .x-sc_prohibit_magic_number_exit: New file. Edit (RWMJ): Don't change Java code.
* build: Fix inter-directory dependenciesMatthew Booth2009-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds an explicit dependency on generator.ml for every file it generates, except java files. Java is left for another time because it's considerably trickier. It also adds a build rule for src/libguestfs.la so it can be rebuilt as required from other directories. It does this by creating a top level make file, subdir-rules.mk, which can be included from sub-directories. sub-directories need to define 'generator_built' to include local files which are built by generator.ml, and they will be updated automatically. This fixes parallel make, and will automatically re-create generated files when make is run from any directory. It also fixes the problem which efad4f53 was targetting. Specifically, src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and therefore generator.ml, despite not being directly created by it. This caused them to be recreated every time generator.ml ran rather than only when src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore appliance update. This patch also changes the contents of the distribution tarball by including files created by rpcgen.
* examples: Don't use STREQ etc in the to-xml.c example.Richard Jones2009-11-101-8/+8
|
* use STREQ, not strcmp: part 1Jim Meyering2009-11-091-3/+3
| | | | | git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
* change strncmp() == 0 to STREQLEN()Jim Meyering2009-11-091-4/+4
| | | | | git grep -l 'strncmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
* change strncmp(...) != 0 to STRNEQLEN(...)Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strncmp *([^=]*!= *0'|xargs \ perl -pi -e 's/\bstrncmp( *\(.*?\)) *!= *0/STRNEQLEN$1/g'
* examples/to-xml.c: Don't depend on Gnulib function.Richard Jones2009-11-021-2/+2
| | | | | Since this program is just an example, it shouldn't require the Gnulib c-ctype functions.
* avoid use of all ctype macrosJim Meyering2009-09-242-3/+5
| | | | | | | | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-212-2/+0
| | | | | | | | | | | | | | This commit changes guestfs_launch so that it both launches the appliance and waits until it is ready (ie. the daemon communicates back to us). Since we removed the pretence that we could implement a low-level asynchronous API, the need to call launch() followed by wait_ready() has looked a bit silly. Now guestfs_wait_ready() is basically a no-op. It is left in the API for backwards compatibility. Any calls to guestfs_wait_ready() can be removed from client code.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-8/+8
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* Guard #inclusion of config.h in examples.Jim Meyering2009-08-032-2/+6
| | | | | * examples/hello.c [HAVE_CONFIG_H]: Include <config.h> conditionally. * examples/to-xml.c: Likewise.
* always include <config.h>Jim Meyering2009-08-032-0/+2
| | | | | | * ocaml/guestfs_c.c: Include <config.h>. * examples/to-xml.c: Likewise. * examples/hello.c: Likewise.
* Make it possible to build in a separate directoryMatthew Booth2009-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments.
* Move the appliance and build scripts into new appliance/ subdirectory.Richard W.M. Jones2009-05-281-1/+1
|
* build: don't tell "make clean" to remove my '~' backup filesJim Meyering2009-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi Rich, automake's policy on what to remove via "make clean" is reasonable: if running build rules creates it, then "make clean" can and should remove it. However, even if build rules happen to create backup files, please remove only the specific ones they can create, not all of the ones in a directory. Just in case someone relies on those and expect them to hang around... >From 1e8be391ac17b4ddcf9671e8413d2660844e6993 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Thu, 30 Apr 2009 15:47:52 +0200 Subject: [PATCH] build: don't tell "make clean" to remove my '~' backup files * Makefile.am (CLEANFILES): Don't remove '~' backup files. * daemon/Makefile.am: Ditto. * examples/Makefile.am: Ditto. * fish/Makefile.am: Ditto. * images/Makefile.am: Ditto. * inspector/Makefile.am: Ditto. * java/Makefile.am: Ditto. * ocaml/Makefile.am: Ditto. * ocaml/examples/Makefile.am: Ditto. * perl/Makefile.am: Ditto. * python/Makefile.am: Ditto. * ruby/Makefile.am: Ditto. * src/Makefile.am: Ditto.
* Add support for ext4 to examples/to-xml.cRichard Jones2009-04-241-5/+7
|
* Fix infinite loop encountered when reading Windows disk in example program.Richard Jones2009-04-221-7/+11
|
* Show byte sizes in example.Richard Jones2009-04-151-3/+11
|
* Display ext2/3 details, and some bug fixes.Richard Jones2009-04-151-4/+34
|
* Added to-xml program.Richard Jones2009-04-153-2/+171
|
* Remove 'df' program from examples - didn't ever work.Richard Jones2009-04-152-35/+2
|
* Remove *~ files when doing 'make clean'.Richard Jones2009-04-091-0/+2
|
* Make the partition configurable.Richard Jones2009-04-031-4/+8
|
* Added README file for examples directory.Richard Jones2009-04-031-0/+8
|
* No verbose. User can enable by setting LIBGUESTFS_DEBUG=1 if they want.Richard Jones2009-04-032-2/+0
|
* Daemon and library are mostly talking to each other now.Richard Jones2009-04-032-2/+39
|
* Correctly handle the case when select runs out of filehandles.Richard Jones2009-04-021-5/+4
|
* Guest boots, and basic select/callbacks work.Richard Jones2009-04-021-8/+3
|
* Moved .cvsignore -> .gitignore.Richard Jones2009-04-011-5/+0
|
* Running qemu as a subprocess.rjones2009-03-034-0/+50