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

Function is_jsdev

src/library/inputs/jsdev.cpp:39–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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