X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fgenerator.ml;h=0b3f263ab5024e995c4b4d92331a0e9803afee79;hp=c01b512edd31722c58b06ef9cc31c8f285656d7e;hb=0e422c0f590caf1d5f182c9b22f0b16e2a31b02b;hpb=22aa9268f548eab9763311a080859d8cf2257a93 diff --git a/src/generator.ml b/src/generator.ml index c01b512..0b3f263 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -1825,7 +1825,7 @@ See also C."); [["is_dir"; "/known-3"]]); InitISOFS, Always, TestOutputTrue ( [["is_dir"; "/directory"]])], - "test if file exists", + "test if a directory", "\ This returns C if and only if there is a directory with the given C name. Note that it returns false for @@ -5356,6 +5356,68 @@ filesystem can be found. To find the label of a filesystem, use C."); + ("is_chardev", (RBool "flag", [Pathname "path"]), 267, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_chardev"; "/directory"]]); + InitBasicFS, Always, TestOutputTrue ( + [["mknod_c"; "0o777"; "99"; "66"; "/test"]; + ["is_chardev"; "/test"]])], + "test if character device", + "\ +This returns C if and only if there is a character device +with the given C name. + +See also C."); + + ("is_blockdev", (RBool "flag", [Pathname "path"]), 268, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_blockdev"; "/directory"]]); + InitBasicFS, Always, TestOutputTrue ( + [["mknod_b"; "0o777"; "99"; "66"; "/test"]; + ["is_blockdev"; "/test"]])], + "test if block device", + "\ +This returns C if and only if there is a block device +with the given C name. + +See also C."); + + ("is_fifo", (RBool "flag", [Pathname "path"]), 269, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_fifo"; "/directory"]]); + InitBasicFS, Always, TestOutputTrue ( + [["mkfifo"; "0o777"; "/test"]; + ["is_fifo"; "/test"]])], + "test if FIFO (named pipe)", + "\ +This returns C if and only if there is a FIFO (named pipe) +with the given C name. + +See also C."); + + ("is_symlink", (RBool "flag", [Pathname "path"]), 270, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_symlink"; "/directory"]]); + InitISOFS, Always, TestOutputTrue ( + [["is_symlink"; "/abssymlink"]])], + "test if symbolic link", + "\ +This returns C if and only if there is a symbolic link +with the given C name. + +See also C."); + + ("is_socket", (RBool "flag", [Pathname "path"]), 271, [], + (* XXX Need a positive test for sockets. *) + [InitISOFS, Always, TestOutputFalse ( + [["is_socket"; "/directory"]])], + "test if socket", + "\ +This returns C if and only if there is a Unix domain socket +with the given C name. + +See also C."); + ] let all_functions = non_daemon_functions @ daemon_functions @@ -12617,12 +12679,12 @@ print_strings (char *const *argv) | FileOut n | Key n -> pr " printf (\"%%s\\n\", %s);\n" n | BufferIn n -> - pr " {\n"; - pr " size_t i;\n"; + pr " {\n"; + pr " size_t i;\n"; pr " for (i = 0; i < %s_size; ++i)\n" n; pr " printf (\"<%%02x>\", %s[i]);\n" n; pr " printf (\"\\n\");\n"; - pr " }\n"; + pr " }\n"; | OptString n -> pr " printf (\"%%s\\n\", %s ? %s : \"null\");\n" n n | StringList n | DeviceList n -> pr " print_strings (%s);\n" n | Bool n -> pr " printf (\"%%s\\n\", %s ? \"true\" : \"false\");\n" n