summaryrefslogtreecommitdiff
path: root/examples/detect.c
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2006-02-03 09:46:22 +0000
committerLinus Walleij <triad@df.lth.se>2006-02-03 09:46:22 +0000
commiteb8c6fe031f5ba155cabcbfabcc235acffbc2fb7 (patch)
treed0062f1898e9bff04e673570289b9c062305c104 /examples/detect.c
downloadlibmtp-eb8c6fe031f5ba155cabcbfabcc235acffbc2fb7.tar.gz
Initial revision
Diffstat (limited to 'examples/detect.c')
-rw-r--r--examples/detect.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/detect.c b/examples/detect.c
new file mode 100644
index 0000000..22da6c2
--- /dev/null
+++ b/examples/detect.c
@@ -0,0 +1,17 @@
+#include "common.h"
+
+int main (int argc, char **argv)
+{
+ mtpdevice_t *device;
+
+ LIBMTP_Init();
+ device = LIBMTP_Get_First_Device();
+ if (device == NULL) {
+ printf("No devices.\n");
+ exit (0);
+ }
+ LIBMTP_Release_Device(device);
+ printf("OK.\n");
+ exit (0);
+}
+