OLD | NEW |
1 /** | 1 /** |
2 * \file albums.c | 2 * \file albums.c |
3 * Example program that lists the albums on the device. | 3 * Example program that lists the albums on the device. |
4 * | 4 * |
5 * Copyright (C) 2006 Chris A. Debenham <chris@adebenham.com> | 5 * Copyright (C) 2006 Chris A. Debenham <chris@adebenham.com> |
6 * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> | 6 * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 26 matching lines...) Expand all Loading... |
37 int main (int argc, char *argv[]) { | 37 int main (int argc, char *argv[]) { |
38 LIBMTP_mtpdevice_t *device_list, *device; | 38 LIBMTP_mtpdevice_t *device_list, *device; |
39 | 39 |
40 int opt; | 40 int opt; |
41 extern int optind; | 41 extern int optind; |
42 extern char *optarg; | 42 extern char *optarg; |
43 | 43 |
44 while ((opt = getopt(argc, argv, "d")) != -1 ) { | 44 while ((opt = getopt(argc, argv, "d")) != -1 ) { |
45 switch (opt) { | 45 switch (opt) { |
46 case 'd': | 46 case 'd': |
47 LIBMTP_Set_Debug(LIBMTP_DEBUG_ALL); | 47 LIBMTP_Set_Debug(LIBMTP_DEBUG_PTP | LIBMTP_DEBUG_DATA); |
48 break; | 48 break; |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 argc -= optind; | 52 argc -= optind; |
53 argv += optind; | 53 argv += optind; |
54 | 54 |
55 LIBMTP_Init(); | 55 LIBMTP_Init(); |
56 | 56 |
57 fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); | 57 fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 album = album->next; | 105 album = album->next; |
106 LIBMTP_destroy_album_t(tmp); | 106 LIBMTP_destroy_album_t(tmp); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 LIBMTP_Release_Device_List(device_list); | 110 LIBMTP_Release_Device_List(device_list); |
111 printf("OK.\n"); | 111 printf("OK.\n"); |
112 return 0; | 112 return 0; |
113 } | 113 } |
114 | 114 |
OLD | NEW |