Displaying 8 results from an estimated 8 matches for "event_all".
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...Err(e) => panic!(format!(" could not create handle {:?}", e)),
+ };
+ g.set_event_callback(
+ |e, _, _, _| match e {
+ Event::Close => print!("c"),
+ _ => print!("o"),
+ },
+ &EVENT_ALL,
+ )
+ .unwrap();
+ let eh = g
+ .set_event_callback(|_, _, _, _| print!("n"), &EVENT_ALL)
+ .unwrap();
+ g.set_trace(true).unwrap();
+ g.delete_event_callback(eh).unwrap();
+ g.set_trace(false).unwrap();
+ }
+ let...
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
I fixed based on comments.
I'll send these two patches to this mailing list.
- Fix Handle -> Handle<'a>
- Add events
Regards,
Hiroyuki
2019年8月1日(木) 0:01 Pino Toscano <ptoscano@redhat.com>:
> Hi Hiroyuki,
>
> On Tuesday, 30 July 2019 07:51:37 CEST Hiroyuki Katsura wrote:
> > This patch includes:
> >
> > - Event callback handlers
> > -
2023 Feb 14
1
Issue with downloading files whose path contains multi-byte utf-8 characters
...logging, etc.
> http://people.redhat.com/~rjones/virt-top
>
>
> import guestfs
> from guestfs import GuestFS
>
> g = GuestFS(python_return_dict=True)
> def callback(event, _event_handle, buf: str, array):
> pass
>
> g.set_event_callback(callback, guestfs.EVENT_ALL)
> g.set_verbose(True)
> path = '/tmp/tmp_disk'
> g.disk_create(path, format='raw', size=32*1024*1024)
> g.add_drive(path)
> g.launch()
> g.mkfs('ext4', '/dev/sda')
> g.mount('/dev/sda', '/')
> for _ in range(20000):
> t...
2015 Oct 06
6
[PATCH 0/4] ocaml: Allow Guestfs.t handle to be garbage collected.
Allow Guestfs.t handle to be garbage collected, and add a
regression test.
2019 Aug 05
0
[PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...{\n";
+ List.iter (
+ fun (name, i) ->
+ pr " %d => Some(Event::%s),\n" i (snake2caml name)
+ ) events;
+ pr " _ => None,\n";
+ pr " }\n";
+ pr " }\n";
+ pr "}\n\n";
+
+ pr "pub const EVENT_ALL: [Event; %d] = [\n" (List.length events);
+ List.iter (
+ fun (name, _) ->
+ pr " Event::%s,\n" (snake2caml name)
+ ) events;
+ pr "];\n";
+
List.iter (
fun { s_camel_name = name; s_name = c_name; s_cols = cols } ->
pr "\n";
@@ -...
2012 Dec 13
3
Lua improvements
Here are a few patches I applied to get the Lua bindings to build
correctly with different versions of Lua.
I am not particularly happy with generating all the test scripts just
for the shebang line. Since it has been a while since I had to edit
autoconf/automake, this was the best I could come up with.
Cheers,
-Hilko
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...nts;
pr "\n";
@@ -310,7 +311,7 @@ type event =
";
List.iter (
fun (name, _) ->
- pr " | EVENT_%s\n" (String.uppercase name)
+ pr " | EVENT_%s\n" (String.uppercase_ascii name)
) events;
pr "\n";
@@ -319,7 +320,7 @@ let event_all = [
";
List.iter (
fun (name, _) ->
- pr " EVENT_%s;\n" (String.uppercase name)
+ pr " EVENT_%s;\n" (String.uppercase_ascii name)
) events;
pr "\
@@ -342,7 +343,7 @@ module Errno = struct
";
List.iter (
fun e ->
- l...
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...{\n";
+ List.iter (
+ fun (name, i) ->
+ pr " %d => Some(Event::%s),\n" i (snake2caml name)
+ ) events;
+ pr " _ => None,\n";
+ pr " }\n";
+ pr " }\n";
+ pr "}\n\n";
+
+ pr "pub const EVENT_ALL: [Event; %d] = [\n" (List.length events);
+ List.iter (
+ fun (name, _) ->
+ pr " Event::%s,\n" (snake2caml name)
+ ) events;
+ pr "];\n";
+
List.iter (
fun { s_camel_name = name; s_name = c_name; s_cols = cols } ->
pr "\n";
@@ -...