evemu.h | evemu.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTH ER | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTH ER | |||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
* DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | |||
* | * | |||
************************************************************************** **/ | ************************************************************************** **/ | |||
#ifndef _EVPLAY_H | #ifndef _EVEMU_H | |||
#define _EVPLAY_H | #define _EVEMU_H | |||
#include <linux/uinput.h> | ||||
#include <stdio.h> | #include <stdio.h> | |||
#include <errno.h> | ||||
#include <linux/input.h> | ||||
#define EVPLAY_NBITS KEY_CNT | #define EVEMU_VERSION 0x00010000 | |||
#define EVPLAY_NBYTES ((EVPLAY_NBITS + 7) / 8) | ||||
struct evemu_device { | struct evemu_device *evemu_new(const char *name); | |||
char name[UINPUT_MAX_NAME_SIZE]; | void evemu_delete(struct evemu_device *dev); | |||
struct input_id id; | ||||
unsigned char mask[EV_CNT][EVPLAY_NBYTES]; | ||||
int bytes[EV_CNT]; | ||||
struct input_absinfo abs[ABS_CNT]; | ||||
}; | ||||
static inline int evemu_has(const struct evemu_device *dev, | unsigned int evemu_get_version(const struct evemu_device *dev); | |||
int type, int code) | ||||
{ | const char *evemu_get_name(const struct evemu_device *dev); | |||
return (dev->mask[type][code >> 3] >> (code & 7)) & 1; | ||||
} | unsigned int evemu_get_id_bustype(const struct evemu_device *dev); | |||
unsigned int evemu_get_id_vendor(const struct evemu_device *dev); | ||||
unsigned int evemu_get_id_product(const struct evemu_device *dev); | ||||
unsigned int evemu_get_id_version(const struct evemu_device *dev); | ||||
int evemu_get_abs_minimum(const struct evemu_device *dev, int code); | ||||
int evemu_get_abs_maximum(const struct evemu_device *dev, int code); | ||||
int evemu_get_abs_fuzz(const struct evemu_device *dev, int code); | ||||
int evemu_get_abs_flat(const struct evemu_device *dev, int code); | ||||
int evemu_get_abs_resolution(const struct evemu_device *dev, int code); | ||||
int evemu_has_prop(const struct evemu_device *dev, int code); | ||||
int evemu_has_event(const struct evemu_device *dev, int type, int code); | ||||
int evemu_extract(struct evemu_device *dev, int fd); | int evemu_extract(struct evemu_device *dev, int fd); | |||
int evemu_write(const struct evemu_device *dev, FILE *fp); | int evemu_write(const struct evemu_device *dev, FILE *fp); | |||
int evemu_read(struct evemu_device *dev, FILE *fp); | int evemu_read(struct evemu_device *dev, FILE *fp); | |||
int evemu_write_event(FILE *fp, const struct input_event *ev); | int evemu_write_event(FILE *fp, const struct input_event *ev); | |||
int evemu_read_event(FILE *fp, struct input_event *ev); | int evemu_read_event(FILE *fp, struct input_event *ev); | |||
int evemu_record(FILE *fp, int fd, int ms); | int evemu_record(FILE *fp, int fd, int ms); | |||
int evemu_play(FILE *fp, int fd); | int evemu_play(FILE *fp, int fd); | |||
End of changes. 6 change blocks. | ||||
17 lines changed or deleted | 24 lines changed or added | |||