Browse Source

Merge pull request #143 from mdiluz/client-example-check

Small client header improvements
Alex Smith 5 years ago
parent
commit
b04e39df43
3 changed files with 9 additions and 6 deletions
  1. 1 1
      .travis.yml
  2. 1 1
      bootstrap.sh
  3. 7 4
      lib/gamemode_client.h

+ 1 - 1
.travis.yml

@@ -19,5 +19,5 @@ before_script:
 
 script:
   - ./scripts/format-check.sh
-  - ./bootstrap.sh
+  - ./bootstrap.sh -Dwith-examples=true
   - gamemoded -v

+ 1 - 1
bootstrap.sh

@@ -26,7 +26,7 @@ fi
 
 # Echo the rest so it's obvious
 set -x
-meson --prefix=$prefix build --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user
+meson --prefix=$prefix build --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user "$@"
 cd build
 ninja
 

+ 7 - 4
lib/gamemode_client.h

@@ -42,6 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
  *   0 if the request was sent successfully
  *   -1 if the request failed
  *
+ * GAMEMODE_AUTO can be defined to make the above two functions apply during static init and
+ * destruction, as appropriate. In this configuration, errors will be printed to stderr
+ *
  * int gamemode_query_status() - Query the current status of gamemode
  *   0 if gamemode is inactive
  *   1 if gamemode is active
@@ -66,15 +69,15 @@ POSSIBILITY OF SUCH DAMAGE.
  *
  * const char* gamemode_error_string() - Get an error string
  *   returns a string describing any of the above errors
+ *
+ * Note: All the above requests can be blocking - dbus requests can and will block while the daemon
+ * handles the request. It is not recommended to make these calls in performance critical code
  */
 
 #include <stdbool.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 
 #include <dlfcn.h>
-#include <errno.h>
 #include <string.h>
 
 #include <sys/types.h>
@@ -232,7 +235,7 @@ __attribute__((always_inline)) static inline const char *gamemode_error_string(v
 }
 
 /**
- * Redirect to the real libgamemod
+ * Redirect to the real libgamemode
  * Allow automatically requesting game mode
  * Also prints errors as they happen.
  */