Displaying 11 results from an estimated 11 matches for "withcstring".
2009 Aug 19
1
[PATCH libguestfs] avoid build failure due to Haskell keyword clash
I got this build failure:
Guestfs.hs:1941:11: parse error on input `module'
where that (generated) file looked like this:
1940 modprobe :: GuestfsH -> String -> IO ()
1941 modprobe h module = do
1942 r <- withCString module $ \module -> withForeignPtr h (\p -> c_modprobe p module)
1943 if (r == -1)
1944 then do
1945 err <- last_error h
1946 fail err
1947 else return ()
That's because "module" is a reserved word in Haskell.
The following adds a li...
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...;
) args;
diff --git a/generator/haskell.ml b/generator/haskell.ml
index 96682e6..7e3e0c2 100644
--- a/generator/haskell.ml
+++ b/generator/haskell.ml
@@ -147,7 +147,8 @@ assocListOfHashtable (a:b:rest) = (a,b) : assocListOfHashtable rest
| BufferIn n ->
pr "withCStringLen %s $ \\(%s, %s_size) -> " n n n
| OptString n -> pr "maybeWith withCString %s $ \\%s -> " n n
- | StringList n | DeviceList n -> pr "withMany withCString %s $ \\%s -> withArray0 nullPtr %s $ \\%s -> " n n n n
+ | StringList...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...;
) args;
diff --git a/generator/haskell.ml b/generator/haskell.ml
index 96682e6..59c5859 100644
--- a/generator/haskell.ml
+++ b/generator/haskell.ml
@@ -147,7 +147,8 @@ assocListOfHashtable (a:b:rest) = (a,b) : assocListOfHashtable rest
| BufferIn n ->
pr "withCStringLen %s $ \\(%s, %s_size) -> " n n n
| OptString n -> pr "maybeWith withCString %s $ \\%s -> " n n
- | StringList n | DeviceList n -> pr "withMany withCString %s $ \\%s -> withArray0 nullPtr %s $ \\%s -> " n n n n
+ | StringList...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky
for development (too easy to miss new ones) so I spent some
time last week and today working on removing them.
The first patch gets us down to almost no warnings with
the original -Wall setting. That was by far the hardest part.
Once I'd done that, I enabled nearly all of gcc's warnings via
gnulib's warnings and manywarnings modules
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change.
I'll get back to that series shortly ;-)
It turned into a factorization and constification exercise
during which I got a taste of ocaml. Thanks to Rich Jones
for help with a few snippets in generator.ml.
The overall result is that many previously-manually-maintained
bits from daemon/*.c functions are now hoisted into the automatically-
2014 Feb 10
5
[PATCH 0/4] add GUID validation (RHBZ#1008417)
Hi,
this patch serie adds a new GUID type in the generator, which would do
the same as String, but also validating (just in the C output) the
passed GUID string.
This allows to reject invalid GUIDs before passing them to low-level
tools.
Pino Toscano (4):
utils: add a function to validate a GUID string
generator: add a GUID parameter type
generator: generate code for parameter validation
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but
don't update apis which must return mountables.
Matt
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...;;
- pr "%s %s = do\n" name
- (String.concat " " ("h" :: List.map name_of_argt (snd style)));
- pr " r <- ";
- (* Convert pointer arguments using with* functions. *)
- List.iter (
- function
- | FileIn n
- | FileOut n
- | String n -> pr "withCString %s $ \\%s -> " n n
- | OptString n -> pr "maybeWith withCString %s $ \\%s -> " n n
- | StringList n -> pr "withMany withCString %s $ \\%s -> withArray0 nullPtr %s $ \\%s -> " n n n n
- | Bool _ | Int _ -> ()
- ) (snd style);
- (* Convert integer a...
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
...(a,b) : assocListOfHashtable rest
function
| FileIn n
| FileOut n
- | Pathname n | Device n | Dev_or_Path n | String n | Key n ->
+ | Pathname n | Device n | Mountable n | Dev_or_Path n | String n
+ | Key n ->
pr "withCString %s $ \\%s -> " n n
| BufferIn n ->
pr "withCStringLen %s $ \\(%s, %s_size) -> " n n n
@@ -156,7 +157,7 @@ assocListOfHashtable (a:b:rest) = (a,b) : assocListOfHashtable rest
| Int n -> sprintf "(fromIntegral %s)" n...
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...functions. *)
List.iter (
function
- | FileIn n
- | FileOut n
- | Pathname n | Device n | Mountable n
- | Dev_or_Path n | Mountable_or_Path n | String n
- | Key n | GUID n ->
+ | String (_, n) ->
pr "withCString %s $ \\%s -> " n n
| BufferIn n ->
pr "withCStringLen %s $ \\(%s, %s_size) -> " n n n
| OptString n -> pr "maybeWith withCString %s $ \\%s -> " n n
- | StringList n | DeviceList n | FilenameList n ->
+...
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator.
Rich.