Merge lp:~oif-packaging/evemu/ubuntu.v1.0.5 into lp:evemu/ubuntu
- ubuntu.v1.0.5
- Merge into ubuntu
Proposed by
Henrik Rydberg
Status: | Merged |
---|---|
Merged at revision: | 13 |
Proposed branch: | lp:~oif-packaging/evemu/ubuntu.v1.0.5 |
Merge into: | lp:evemu/ubuntu |
Diff against target: |
635 lines (+353/-49) 10 files modified
ChangeLog (+58/-0) config-aux/ltmain.sh (+2/-2) configure (+10/-10) configure.ac (+1/-1) debian/changelog (+8/-0) debian/libutouch-evemu1.symbols (+2/-0) include/evemu.h (+230/-0) src/evemu.c (+38/-32) tools/evemu-describe.1 (+2/-2) tools/evemu-device.1 (+2/-2) |
To merge this branch: | bzr merge lp:~oif-packaging/evemu/ubuntu.v1.0.5 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chase Douglas (community) | Approve | ||
Review via email: mp+53474@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Henrik Rydberg (rydberg) wrote : | # |
Revision history for this message
Chase Douglas (chasedouglas) wrote : | # |
Looks good.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'ChangeLog' |
2 | --- ChangeLog 2011-01-05 10:58:59 +0000 |
3 | +++ ChangeLog 2011-03-15 16:22:40 +0000 |
4 | @@ -1,4 +1,62 @@ |
5 | ------------------------------------------------------------ |
6 | +revno: 30 |
7 | +tags: v1.0.5 |
8 | +committer: Henrik Rydberg <rydberg@bitmath.org> |
9 | +branch nick: trunk |
10 | +timestamp: Tue 2011-03-15 17:03:53 +0100 |
11 | +message: |
12 | + Release v1.0.5 |
13 | +------------------------------------------------------------ |
14 | +revno: 29 |
15 | +committer: Henrik Rydberg <rydberg@bitmath.org> |
16 | +branch nick: trunk |
17 | +timestamp: Tue 2011-03-15 15:47:40 +0100 |
18 | +message: |
19 | + Complete function documentation in evemu.h |
20 | + |
21 | + For reasons not likely to become clear again at the moment, only |
22 | + two functions were ever documented, and those were made in the |
23 | + source file where nobody can see it. This patch adds function |
24 | + documentation to all functions in the header file. |
25 | + |
26 | + Signed-off-by: Henrik Rydberg <rydberg@euromail.se> |
27 | +------------------------------------------------------------ |
28 | +revno: 28 |
29 | +committer: Henrik Rydberg <rydberg@bitmath.org> |
30 | +branch nick: trunk |
31 | +timestamp: Tue 2011-03-15 15:47:21 +0100 |
32 | +message: |
33 | + Add the missing evemu_set_name() function |
34 | + |
35 | + During the evolution of evemu, the process of setting the device |
36 | + name has shifted towards the evemu_extract() and evemu_read() functions, |
37 | + rendering the initial name in evemu_new() more or less useless. |
38 | + This patch adds the missing evemu_set_name() function, in order to |
39 | + make it possible to override the device name before device creation. |
40 | + |
41 | + Signed-off-by: Henrik Rydberg <rydberg@euromail.se> |
42 | +------------------------------------------------------------ |
43 | +revno: 27 |
44 | +committer: Henrik Rydberg <rydberg@bitmath.org> |
45 | +branch nick: trunk |
46 | +timestamp: Mon 2011-03-14 18:07:46 +0100 |
47 | +message: |
48 | + Move realtime read into its own function |
49 | + |
50 | + The realtime read functionality is needed in many places, |
51 | + in particular in the test frameworks of utouch-frame and utouch-grail. |
52 | + Move the realtime code from evemu_play into its own function, |
53 | + and make it part of the API. |
54 | + |
55 | + Signed-off-by: Henrik Rydberg <rydberg@euromail.se> |
56 | +------------------------------------------------------------ |
57 | +revno: 26 |
58 | +committer: Stephen M. Webb <stephen.webb@canonical.com> |
59 | +branch nick: utouch-evemu |
60 | +timestamp: Wed 2011-02-02 21:29:13 -0500 |
61 | +message: |
62 | + Added GPL-3 licensing to source files. |
63 | +------------------------------------------------------------ |
64 | revno: 25 |
65 | committer: Henrik Rydberg <rydberg@bitmath.org> |
66 | branch nick: trunk |
67 | |
68 | === modified file 'config-aux/ltmain.sh' |
69 | --- config-aux/ltmain.sh 2010-12-22 08:47:30 +0000 |
70 | +++ config-aux/ltmain.sh 2011-03-15 16:22:40 +0000 |
71 | @@ -65,7 +65,7 @@ |
72 | # compiler: $LTCC |
73 | # compiler flags: $LTCFLAGS |
74 | # linker: $LD (gnu? $with_gnu_ld) |
75 | -# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 |
76 | +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3 |
77 | # automake: $automake_version |
78 | # autoconf: $autoconf_version |
79 | # |
80 | @@ -73,7 +73,7 @@ |
81 | |
82 | PROGRAM=ltmain.sh |
83 | PACKAGE=libtool |
84 | -VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" |
85 | +VERSION="2.2.6b Debian-2.2.6b-2ubuntu3" |
86 | TIMESTAMP="" |
87 | package_revision=1.3017 |
88 | |
89 | |
90 | === modified file 'configure' |
91 | --- configure 2011-01-05 10:58:59 +0000 |
92 | +++ configure 2011-03-15 16:22:40 +0000 |
93 | @@ -1,6 +1,6 @@ |
94 | #! /bin/sh |
95 | # Guess values for system-dependent variables and create Makefiles. |
96 | -# Generated by GNU Autoconf 2.67 for Kernel device emulation 1.0.4. |
97 | +# Generated by GNU Autoconf 2.67 for Kernel device emulation 1.0.5. |
98 | # |
99 | # |
100 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
101 | @@ -698,8 +698,8 @@ |
102 | # Identity of this package. |
103 | PACKAGE_NAME='Kernel device emulation' |
104 | PACKAGE_TARNAME='utouch-evemu' |
105 | -PACKAGE_VERSION='1.0.4' |
106 | -PACKAGE_STRING='Kernel device emulation 1.0.4' |
107 | +PACKAGE_VERSION='1.0.5' |
108 | +PACKAGE_STRING='Kernel device emulation 1.0.5' |
109 | PACKAGE_BUGREPORT='' |
110 | PACKAGE_URL='' |
111 | |
112 | @@ -1422,7 +1422,7 @@ |
113 | # Omit some internal or obsolete options to make the list less imposing. |
114 | # This message is too long to be a string in the A/UX 3.1 sh. |
115 | cat <<_ACEOF |
116 | -\`configure' configures Kernel device emulation 1.0.4 to adapt to many kinds of systems. |
117 | +\`configure' configures Kernel device emulation 1.0.5 to adapt to many kinds of systems. |
118 | |
119 | Usage: $0 [OPTION]... [VAR=VALUE]... |
120 | |
121 | @@ -1492,7 +1492,7 @@ |
122 | |
123 | if test -n "$ac_init_help"; then |
124 | case $ac_init_help in |
125 | - short | recursive ) echo "Configuration of Kernel device emulation 1.0.4:";; |
126 | + short | recursive ) echo "Configuration of Kernel device emulation 1.0.5:";; |
127 | esac |
128 | cat <<\_ACEOF |
129 | |
130 | @@ -1595,7 +1595,7 @@ |
131 | test -n "$ac_init_help" && exit $ac_status |
132 | if $ac_init_version; then |
133 | cat <<\_ACEOF |
134 | -Kernel device emulation configure 1.0.4 |
135 | +Kernel device emulation configure 1.0.5 |
136 | generated by GNU Autoconf 2.67 |
137 | |
138 | Copyright (C) 2010 Free Software Foundation, Inc. |
139 | @@ -1873,7 +1873,7 @@ |
140 | This file contains any messages produced by compilers while |
141 | running configure, to aid debugging if configure makes a mistake. |
142 | |
143 | -It was created by Kernel device emulation $as_me 1.0.4, which was |
144 | +It was created by Kernel device emulation $as_me 1.0.5, which was |
145 | generated by GNU Autoconf 2.67. Invocation command line was |
146 | |
147 | $ $0 $@ |
148 | @@ -2693,7 +2693,7 @@ |
149 | |
150 | # Define the identity of the package. |
151 | PACKAGE='utouch-evemu' |
152 | - VERSION='1.0.4' |
153 | + VERSION='1.0.5' |
154 | |
155 | |
156 | cat >>confdefs.h <<_ACEOF |
157 | @@ -11667,7 +11667,7 @@ |
158 | # report actual input values of CONFIG_FILES etc. instead of their |
159 | # values after options handling. |
160 | ac_log=" |
161 | -This file was extended by Kernel device emulation $as_me 1.0.4, which was |
162 | +This file was extended by Kernel device emulation $as_me 1.0.5, which was |
163 | generated by GNU Autoconf 2.67. Invocation command line was |
164 | |
165 | CONFIG_FILES = $CONFIG_FILES |
166 | @@ -11733,7 +11733,7 @@ |
167 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
168 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
169 | ac_cs_version="\\ |
170 | -Kernel device emulation config.status 1.0.4 |
171 | +Kernel device emulation config.status 1.0.5 |
172 | configured by $0, generated by GNU Autoconf 2.67, |
173 | with options \\"\$ac_cs_config\\" |
174 | |
175 | |
176 | === modified file 'configure.ac' |
177 | --- configure.ac 2011-01-05 10:58:59 +0000 |
178 | +++ configure.ac 2011-03-15 16:22:40 +0000 |
179 | @@ -1,7 +1,7 @@ |
180 | # Initialize Autoconf |
181 | AC_PREREQ([2.60]) |
182 | AC_INIT([Kernel device emulation], |
183 | - [1.0.4], |
184 | + [1.0.5], |
185 | [], |
186 | [utouch-evemu]) |
187 | AC_CONFIG_SRCDIR([Makefile.am]) |
188 | |
189 | === modified file 'debian/changelog' |
190 | --- debian/changelog 2011-02-03 17:51:49 +0000 |
191 | +++ debian/changelog 2011-03-15 16:22:40 +0000 |
192 | @@ -1,3 +1,11 @@ |
193 | +utouch-evemu (1.0.5-0ubuntu1) UNRELEASED; urgency=low |
194 | + |
195 | + * New upstream release. |
196 | + * Add the new functions to the symbols file |
197 | + * Feature freeze exception LP: #735558 |
198 | + |
199 | + -- Henrik Rydberg <rydberg@bitmath.org> Tue, 15 Mar 2011 17:18:53 +0100 |
200 | + |
201 | utouch-evemu (1.0.4-0ubuntu1) natty; urgency=low |
202 | |
203 | [ Henrik Rydberg ] |
204 | |
205 | === modified file 'debian/libutouch-evemu1.symbols' |
206 | --- debian/libutouch-evemu1.symbols 2010-12-22 09:52:23 +0000 |
207 | +++ debian/libutouch-evemu1.symbols 2011-03-15 16:22:40 +0000 |
208 | @@ -20,6 +20,8 @@ |
209 | evemu_play@Base 1.0.3 |
210 | evemu_read@Base 1.0.3 |
211 | evemu_read_event@Base 1.0.3 |
212 | + evemu_read_event_realtime@Base 1.0.5 |
213 | evemu_record@Base 1.0.3 |
214 | + evemu_set_name@Base 1.0.5 |
215 | evemu_write@Base 1.0.3 |
216 | evemu_write_event@Base 1.0.3 |
217 | |
218 | === modified file 'include/evemu.h' |
219 | --- include/evemu.h 2011-02-03 02:54:15 +0000 |
220 | +++ include/evemu.h 2011-03-15 16:22:40 +0000 |
221 | @@ -49,38 +49,268 @@ |
222 | |
223 | #define EVEMU_VERSION 0x00010000 |
224 | |
225 | +/** |
226 | + * evemu_new() - allocate a new evemu device |
227 | + * @name: wanted input device name (or NULL to leave empty) |
228 | + * |
229 | + * This function allocates a new evemu device structure and |
230 | + * initializes all fields to zero. If name is non-null and the length |
231 | + * is sane, it is copied to the device name. |
232 | + * |
233 | + * Returns NULL in case of memory failure. |
234 | + */ |
235 | struct evemu_device *evemu_new(const char *name); |
236 | + |
237 | +/** |
238 | + * evemu_delete() - free and allocated evemu device |
239 | + * @dev: the device to free |
240 | + * |
241 | + * The device pointer is invalidated by this call. |
242 | + */ |
243 | void evemu_delete(struct evemu_device *dev); |
244 | |
245 | +/** |
246 | + * evemu_get_version() - get library version |
247 | + * @dev: the device in use |
248 | + * |
249 | + * Returns the library version used to create this evemu instance. The |
250 | + * version may differ from the value of EVEMU_VERSION in this header |
251 | + * file. |
252 | + */ |
253 | unsigned int evemu_get_version(const struct evemu_device *dev); |
254 | |
255 | +/** |
256 | + * evemu_get_name() - get device name |
257 | + * @dev: the device in use |
258 | + * |
259 | + * Returns the name of the device. The pointer is owned by the evemu |
260 | + * instance and has evemu scope. |
261 | + */ |
262 | const char *evemu_get_name(const struct evemu_device *dev); |
263 | |
264 | +/** |
265 | + * evemu_set_name() - set device name |
266 | + * @dev: the device in use |
267 | + * |
268 | + * Sets the name of the device. If name is non-null and the length is |
269 | + * sane, it is copied to the device name. |
270 | + */ |
271 | +void evemu_set_name(struct evemu_device *dev, const char *name); |
272 | + |
273 | +/** |
274 | + * evemu_get_id_bustype() - get kernel device bustype |
275 | + * @dev: the device in use |
276 | + * |
277 | + * Returns the kernel bus type used by the device. |
278 | + */ |
279 | unsigned int evemu_get_id_bustype(const struct evemu_device *dev); |
280 | + |
281 | +/** |
282 | + * evemu_get_id_vendor() - get kernel device vendor id |
283 | + * @dev: the device in use |
284 | + * |
285 | + * Returns the kernel vendor id used by the device. |
286 | + */ |
287 | unsigned int evemu_get_id_vendor(const struct evemu_device *dev); |
288 | + |
289 | +/** |
290 | + * evemu_get_id_product() - get kernel device product id |
291 | + * @dev: the device in use |
292 | + * |
293 | + * Returns the kernel product id used by the device. |
294 | + */ |
295 | unsigned int evemu_get_id_product(const struct evemu_device *dev); |
296 | + |
297 | +/** |
298 | + * evemu_get_id_version() - get kernel device id version |
299 | + * @dev: the device in use |
300 | + * |
301 | + * Returns the kernel device id used by the device. |
302 | + */ |
303 | unsigned int evemu_get_id_version(const struct evemu_device *dev); |
304 | |
305 | +/** |
306 | + * evemu_get_abs_minimum() - get kernel minimum value of event type |
307 | + * @dev: the device in use |
308 | + * @code: the event type code to query |
309 | + * |
310 | + * Returns the range minimum of the specified event type. |
311 | + */ |
312 | int evemu_get_abs_minimum(const struct evemu_device *dev, int code); |
313 | + |
314 | +/** |
315 | + * evemu_get_abs_maximum() - get kernel maximum value of event type |
316 | + * @dev: the device in use |
317 | + * @code: the event type code to query |
318 | + * |
319 | + * Returns the range maximum of the specified event type. |
320 | + */ |
321 | int evemu_get_abs_maximum(const struct evemu_device *dev, int code); |
322 | + |
323 | +/** |
324 | + * evemu_get_abs_maximum() - get kernel filter fuzz of event type |
325 | + * @dev: the device in use |
326 | + * @code: the event type code to query |
327 | + * |
328 | + * Returns the filter fuzz of the specified event type. |
329 | + */ |
330 | int evemu_get_abs_fuzz(const struct evemu_device *dev, int code); |
331 | + |
332 | +/** |
333 | + * evemu_get_abs_maximum() - get kernel flat value of event type |
334 | + * @dev: the device in use |
335 | + * @code: the event type code to query |
336 | + * |
337 | + * Returns the flat value of the specified event type. Only used for |
338 | + * joysticks. |
339 | + */ |
340 | int evemu_get_abs_flat(const struct evemu_device *dev, int code); |
341 | + |
342 | +/** |
343 | + * evemu_get_abs_resolution() - get kernel resolution of event type |
344 | + * @dev: the device in use |
345 | + * @code: the event type code to query |
346 | + * |
347 | + * Returns the resolution of the specified event type. Resolution is |
348 | + * specified in units per millimeter (units/mm), or units per radian |
349 | + * where appropriate. |
350 | + */ |
351 | int evemu_get_abs_resolution(const struct evemu_device *dev, int code); |
352 | |
353 | +/** |
354 | + * evemu_has_prop() - check if device has a certain property |
355 | + * @dev: the device in use |
356 | + * @code: the property type code to query |
357 | + * |
358 | + * Returns true if the device has the given property. |
359 | + */ |
360 | int evemu_has_prop(const struct evemu_device *dev, int code); |
361 | + |
362 | +/** |
363 | + * evemu_has_event() - check if device has a certain event type |
364 | + * @dev: the device in use |
365 | + * @code: the event type code to query |
366 | + * |
367 | + * Returns true if the event type is supported by the device. |
368 | + */ |
369 | int evemu_has_event(const struct evemu_device *dev, int type, int code); |
370 | |
371 | +/** |
372 | + * evemu_extract() - configure evemu instance directly from the kernel device |
373 | + * @dev: the device in use |
374 | + * @fd: file descriptor of the kernel device to query |
375 | + * |
376 | + * Returns zero if successful, negative error otherwise. |
377 | + */ |
378 | int evemu_extract(struct evemu_device *dev, int fd); |
379 | + |
380 | +/** |
381 | + * evemu_write() - write evemu configuration to a file |
382 | + * @dev: the device in use |
383 | + * @fp: file pointer to write the evemu configuration to |
384 | + * |
385 | + * Returns zero if successful, negative error otherwise. |
386 | + */ |
387 | int evemu_write(const struct evemu_device *dev, FILE *fp); |
388 | + |
389 | +/** |
390 | + * evemu_read() - read evemu configuration from a file |
391 | + * @dev: the device in use |
392 | + * @fp: file pointer to read the evemu configuration from |
393 | + * |
394 | + * Returns a positive number if successful, zero or negative error |
395 | + * otherwise. |
396 | + */ |
397 | int evemu_read(struct evemu_device *dev, FILE *fp); |
398 | |
399 | +/** |
400 | + * evemu_write_event() - write kernel event to file |
401 | + * @fp: file pointer to write the event to |
402 | + * @ev: pointer to the kernel event to write |
403 | + * |
404 | + * Writes the kernel event to the file. |
405 | + * |
406 | + * Returns a positive number if successful, zero or negative error |
407 | + * otherwise. |
408 | + */ |
409 | int evemu_write_event(FILE *fp, const struct input_event *ev); |
410 | + |
411 | +/** |
412 | + * evemu_read_event() - read kernel event from file |
413 | + * @fp: file pointer to read the event from |
414 | + * @ev: pointer to the kernel event to be filled |
415 | + * |
416 | + * Reads a kernel event from the file. |
417 | + * |
418 | + * Returns a positive number if successful, zero or negative error |
419 | + * otherwise. |
420 | + */ |
421 | int evemu_read_event(FILE *fp, struct input_event *ev); |
422 | |
423 | +/** |
424 | + * evemu_read_event_realtime() - read kernel events in realtime |
425 | + * @fp: file pointer to read the event from |
426 | + * @ev: pointer to the kernel event to be filled |
427 | + * @evtime: pointer to a timeval struct |
428 | + * |
429 | + * The evtime struct should be cleared (zeroed) before the first call |
430 | + * to this function. This function reads a kernel event from the file, |
431 | + * and performs the microsleep necessary to deliver the event with the |
432 | + * same timings as originally received. |
433 | + * |
434 | + * Returns a positive number if successful, zero or negative error |
435 | + * otherwise. |
436 | + */ |
437 | +int evemu_read_event_realtime(FILE *fp, struct input_event *ev, |
438 | + struct timeval *evtime); |
439 | + |
440 | +/** |
441 | + * evemu_record() - read events directly from a kernel device |
442 | + * @fp: file pointer to write the events to |
443 | + * @fd: file descriptor of kernel device to read from |
444 | + * @ms: maximum time to wait for an event to appear before reading (ms) |
445 | + * |
446 | + * Contiuously reads events from the kernel device and writes them to |
447 | + * the file. The function terminates after ms milliseconds of |
448 | + * inactivity. |
449 | + * to this function. This function reads a kernel event from the file, |
450 | + * and performs the microsleep necessary to deliver the event with the |
451 | + * same timings as originally received. |
452 | + * |
453 | + * Returns zero if successful, negative error otherwise. |
454 | + */ |
455 | int evemu_record(FILE *fp, int fd, int ms); |
456 | + |
457 | +/** |
458 | + * evemu_play() - replay events from file to kernel device in realtime |
459 | + * @fp: file pointer to read the events from |
460 | + * @fd: file descriptor of kernel device to write to |
461 | + * |
462 | + * Contiuously reads events from the file and writes them to the |
463 | + * kernel device, in realtime. The function terminates when end of |
464 | + * file has been reached. |
465 | + * |
466 | + * Returns zero if successful, negative error otherwise. |
467 | + */ |
468 | int evemu_play(FILE *fp, int fd); |
469 | |
470 | +/** |
471 | + * evemu_create() - create a kernel device from the evemu configuration |
472 | + * @dev: the device in use |
473 | + * @fd: file descriptor of the special kernel uinput device |
474 | + * |
475 | + * Creates a new device with all the properties of the evemu device. |
476 | + * |
477 | + * Returns zero if successful, negative error otherwise. |
478 | + */ |
479 | int evemu_create(const struct evemu_device *dev, int fd); |
480 | + |
481 | +/** |
482 | + * evemu_destroy() - destroy all created kernel devices |
483 | + * @fd: file descriptor of the special kernel uinput device |
484 | + * |
485 | + * Destroys all devices created using this file descriptor. |
486 | + */ |
487 | void evemu_destroy(int fd); |
488 | |
489 | #endif |
490 | |
491 | === modified file 'src/evemu.c' |
492 | --- src/evemu.c 2011-02-03 02:54:15 +0000 |
493 | +++ src/evemu.c 2011-03-15 16:22:40 +0000 |
494 | @@ -72,33 +72,18 @@ |
495 | } |
496 | } |
497 | |
498 | -/** |
499 | - * evemu_new() - allocate a new evemu device |
500 | - * @name: wanted input device name (or NULL to leave empty) |
501 | - * |
502 | - * This function allocates a new evemu device structure and |
503 | - * initializes all fields to zero. If name is non-null and the length |
504 | - * is sane, it is copied to the device name. |
505 | - * |
506 | - * Returns NULL in case of memory failure. |
507 | - */ |
508 | struct evemu_device *evemu_new(const char *name) |
509 | { |
510 | struct evemu_device *dev = calloc(1, sizeof(struct evemu_device)); |
511 | |
512 | - dev->version = EVEMU_VERSION; |
513 | - if (name && strlen(name) < sizeof(dev->name)) |
514 | - strcpy(dev->name, name); |
515 | + if (dev) { |
516 | + dev->version = EVEMU_VERSION; |
517 | + evemu_set_name(dev, name); |
518 | + } |
519 | |
520 | return dev; |
521 | } |
522 | |
523 | -/** |
524 | - * evemu_delete() - free and allocated evemu device |
525 | - * @dev: the device to free |
526 | - * |
527 | - * The device pointer is invalidated by this call. |
528 | - */ |
529 | void evemu_delete(struct evemu_device *dev) |
530 | { |
531 | free(dev); |
532 | @@ -114,6 +99,12 @@ |
533 | return dev->name; |
534 | } |
535 | |
536 | +void evemu_set_name(struct evemu_device *dev, const char *name) |
537 | +{ |
538 | + if (name && strlen(name) < sizeof(dev->name)) |
539 | + strcpy(dev->name, name); |
540 | +} |
541 | + |
542 | unsigned int evemu_get_id_bustype(const struct evemu_device *dev) |
543 | { |
544 | return dev->id.bustype; |
545 | @@ -361,24 +352,39 @@ |
546 | return ret; |
547 | } |
548 | |
549 | +int evemu_read_event_realtime(FILE *fp, struct input_event *ev, |
550 | + struct timeval *evtime) |
551 | +{ |
552 | + unsigned long usec; |
553 | + int ret; |
554 | + |
555 | + ret = evemu_read_event(fp, ev); |
556 | + if (ret <= 0) |
557 | + return ret; |
558 | + |
559 | + if (evtime) { |
560 | + if (!evtime->tv_sec) |
561 | + *evtime = ev->time; |
562 | + usec = 1000000L * (ev->time.tv_sec - evtime->tv_sec); |
563 | + usec += ev->time.tv_usec - evtime->tv_usec; |
564 | + if (usec > 500) { |
565 | + usleep(usec); |
566 | + *evtime = ev->time; |
567 | + } |
568 | + } |
569 | + |
570 | + return ret; |
571 | +} |
572 | + |
573 | int evemu_play(FILE *fp, int fd) |
574 | { |
575 | - struct input_event prev, ev; |
576 | - long check = 0, usec; |
577 | + struct input_event ev; |
578 | + struct timeval evtime; |
579 | int ret; |
580 | |
581 | - memset(&prev, 0, sizeof(prev)); |
582 | - while (evemu_read_event(fp, &ev) > 0) { |
583 | - if (!prev.time.tv_sec) |
584 | - prev = ev; |
585 | - usec = 1000000L * (ev.time.tv_sec - prev.time.tv_sec); |
586 | - usec += ev.time.tv_usec - prev.time.tv_usec; |
587 | - if (usec - check > 500) { |
588 | - usleep(usec - check); |
589 | - check = usec; |
590 | - } |
591 | + memset(&evtime, 0, sizeof(evtime)); |
592 | + while (evemu_read_event_realtime(fp, &ev, &evtime) > 0) |
593 | SYSCALL(ret = write(fd, &ev, sizeof(ev))); |
594 | - } |
595 | |
596 | return 0; |
597 | } |
598 | |
599 | === modified file 'tools/evemu-describe.1' |
600 | --- tools/evemu-describe.1 2011-01-05 10:58:59 +0000 |
601 | +++ tools/evemu-describe.1 2011-03-15 16:22:40 +0000 |
602 | @@ -2,12 +2,12 @@ |
603 | .\" Title: evemu-describe |
604 | .\" Author: [see the "AUTHOR" section] |
605 | .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/> |
606 | -.\" Date: 01/05/2011 |
607 | +.\" Date: 03/15/2011 |
608 | .\" Manual: \ \& |
609 | .\" Source: \ \& |
610 | .\" Language: English |
611 | .\" |
612 | -.TH "EVEMU\-DESCRIBE" "1" "01/05/2011" "\ \&" "\ \&" |
613 | +.TH "EVEMU\-DESCRIBE" "1" "03/15/2011" "\ \&" "\ \&" |
614 | .\" ----------------------------------------------------------------- |
615 | .\" * Define some portability stuff |
616 | .\" ----------------------------------------------------------------- |
617 | |
618 | === modified file 'tools/evemu-device.1' |
619 | --- tools/evemu-device.1 2011-01-05 10:58:59 +0000 |
620 | +++ tools/evemu-device.1 2011-03-15 16:22:40 +0000 |
621 | @@ -2,12 +2,12 @@ |
622 | .\" Title: evemu-device |
623 | .\" Author: [see the "AUTHOR" section] |
624 | .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/> |
625 | -.\" Date: 01/05/2011 |
626 | +.\" Date: 03/15/2011 |
627 | .\" Manual: \ \& |
628 | .\" Source: \ \& |
629 | .\" Language: English |
630 | .\" |
631 | -.TH "EVEMU\-DEVICE" "1" "01/05/2011" "\ \&" "\ \&" |
632 | +.TH "EVEMU\-DEVICE" "1" "03/15/2011" "\ \&" "\ \&" |
633 | .\" ----------------------------------------------------------------- |
634 | .\" * Define some portability stuff |
635 | .\" ----------------------------------------------------------------- |
Packaging for the v1.0.5 FFe. Package pushed to utouch unstable for testing.