MCPcopy Create free account
hub / github.com/clementgallet/libTAS / is_evdev

Function is_evdev

src/library/inputs/evdev.cpp:40–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38static std::pair<std::pair<int, int>, int> evdevfds[AllInputsFlat::MAXJOYS];
39
40int is_evdev(const char* source)
41{
42 /* Extract the ev number from the dev filename */
43 int evnum;
44 int ret = sscanf(source, "/dev/input/event%d", &evnum);
45 if (ret != 1)
46 return -1;
47
48 if (evnum < 0 || evnum >= Global::shared_config.nb_controllers || evnum >= AllInputsFlat::MAXJOYS) {
49 return 0;
50 }
51
52 return 1;
53}
54
55int open_evdev(const char* source, int flags)
56{

Callers 5

open64Function · 0.85
accessFunction · 0.85
stat_specialFunction · 0.85
stat64_specialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected