Awesome little library! Thank you for sharing it.
A few of issues to report:
Gamepad_linux.c: PATH_MAX is used but not defined in any of the included headers. <linux/limits.h>, not <limits.h>, has the definition.
Gamepad_linux.c, line 293: The format string for sscanf should be "event%d%u" instead of "event%d%n".
Gamepad_linux.c: Valgrind reports that memory allocated in Gamepad_detectDevices is not freed on exit:
$ cat test.c
#include "gamepad/Gamepad.h"
int main( int argc, char* argv[] )
{
Gamepad_init();
Gamepad_shutdown();
}
$ valgrind --leak-check=full ./test
==14040== Memcheck, a memory error detector
==14040== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==14040== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==14040== Command: ./test
==14040==
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040== Warning: invalid file descriptor -1 in syscall close()
==14040==
==14040== HEAP SUMMARY:
==14040== in use at exit: 4,004 bytes in 6 blocks
==14040== total heap usage: 14 allocs, 8 frees, 38,762 bytes allocated
==14040==
==14040== 4,004 (56 direct, 3,948 indirect) bytes in 1 blocks are definitely lost in loss record 6 of 6
==14040== at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14040== by 0x401ABD: Gamepad_detectDevices (in /home/drtwox/dev/src/gamepad-1.3.0/source/gamepad/test)
==14040== by 0x400FF5: Gamepad_init (in /home/drtwox/dev/src/gamepad-1.3.0/source/gamepad/test)
==14040== by 0x400EC0: main (in /home/drtwox/dev/src/gamepad-1.3.0/source/gamepad/test)
==14040==
==14040== LEAK SUMMARY:
==14040== definitely lost: 56 bytes in 1 blocks
==14040== indirectly lost: 3,948 bytes in 5 blocks
==14040== possibly lost: 0 bytes in 0 blocks
==14040== still reachable: 0 bytes in 0 blocks
==14040== suppressed: 0 bytes in 0 blocks
==14040==
==14040== For counts of detected and suppressed errors, rerun with: -v
==14040== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)