summaryrefslogtreecommitdiff
path: root/examples/detect.c
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2006-02-13 13:21:57 +0000
committerLinus Walleij <triad@df.lth.se>2006-02-13 13:21:57 +0000
commit6d6d8f6da283af6cda880ac06677cf947ccf81cf (patch)
treee844a022039062367ab769c7223cf41eda966f9e /examples/detect.c
parent56d3e187fef24e0b347040ba25adaceec3ea3428 (diff)
downloadlibmtp-6d6d8f6da283af6cda880ac06677cf947ccf81cf.tar.gz
Bang in some stuff.
Diffstat (limited to 'examples/detect.c')
-rw-r--r--examples/detect.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/detect.c b/examples/detect.c
index 22da6c2..8e0f35c 100644
--- a/examples/detect.c
+++ b/examples/detect.c
@@ -2,7 +2,8 @@
int main (int argc, char **argv)
{
- mtpdevice_t *device;
+ LIBMTP_mtpdevice_t *device;
+ char *owner;
LIBMTP_Init();
device = LIBMTP_Get_First_Device();
@@ -10,6 +11,16 @@ int main (int argc, char **argv)
printf("No devices.\n");
exit (0);
}
+
+ // Get owners name
+ owner = LIBMTP_Get_Ownername(device);
+ if (owner == NULL) {
+ printf("Owner name: (NULL)\n");
+ } else {
+ printf("Owner name: %s\n", owner);
+ free(owner);
+ }
+
LIBMTP_Release_Device(device);
printf("OK.\n");
exit (0);