X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=generator%2Fgenerator.ml;h=31478cdd421eaee220deaafbe63604b10280c25c;hb=76fdcceff966c35ac0f3177e6543486fffb6f754;hp=9722312b6423f8a1fad18f4d1f366a036bd967f5;hpb=d0e382c601cbba8bba6df4258f91c3414ee82766;p=hivex.git diff --git a/generator/generator.ml b/generator/generator.ml index 9722312..31478cd 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -1,6 +1,6 @@ #!/usr/bin/env ocaml (* hivex - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,16 +19,16 @@ (* This script generates language bindings and some documentation for * hivex. - * + * * After editing this file, run it (./generator/generator.ml) to * regenerate all the output files. 'make' will rerun this * automatically when necessary. Note that if you are using a separate * build directory you must run generator.ml from the _source_ * directory. - * + * * IMPORTANT: This script should NOT print any warnings. If it prints * warnings, you should treat them as errors. - * + * * OCaml tips: (1) In emacs, install tuareg-mode to display and format * OCaml code correctly. 'vim' comes with a good OCaml editing mode by * default. (2) Read the resources at http://ocaml-tutorial.org/ @@ -73,7 +73,7 @@ and argt = (* Note, cannot be NULL/0 unless it (* Hive types, from: * https://secure.wikimedia.org/wikipedia/en/wiki/Windows_Registry#Keys_and_values - * + * * It's unfortunate that in our original C binding we strayed away from * the names that Windows uses (eg. REG_SZ for strings). We include * both our names and the Windows names. @@ -701,6 +701,13 @@ typedef struct hive_h hive_h; typedef size_t hive_node_h; typedef size_t hive_value_h; +#include +#ifdef ENOKEY +# define HIVEX_NO_KEY ENOKEY +#else +# define HIVEX_NO_KEY ENOENT +#endif + /* Pre-defined types. */ enum hive_type { "; @@ -834,7 +841,7 @@ hivex - Windows Registry \"hive\" extraction library =head1 SYNOPSIS #include - + "; List.iter ( fun (shortname, style, _, _) -> @@ -1273,7 +1280,7 @@ exhaustive): Corrupt or unsupported Registry file format. -=item ENOKEY +=item HIVEX_NO_KEY Missing root key. @@ -2181,10 +2188,7 @@ and generate_perl_xs () = #include #include - -#ifndef PRId64 -#define PRId64 \"lld\" -#endif +#include static SV * my_newSVll(long long val) { @@ -2198,10 +2202,6 @@ my_newSVll(long long val) { #endif } -#ifndef PRIu64 -#define PRIu64 \"llu\" -#endif - #if 0 static SV * my_newSVull(unsigned long long val) { @@ -3020,7 +3020,7 @@ initlibhivexmod (void) initialized = 1; } " - + and generate_python_py () = generate_header HashStyle LGPLv2plus;