| OLD | NEW |
| 1 /** | 1 /** |
| 2 * \file albumart.c | 2 * \file albumart.c |
| 3 * Example program to send album art. | 3 * Example program to send album art. |
| 4 * | 4 * |
| 5 * Copyright (C) 2006 Andy Kelk <andy@mopoke.co.uk> | 5 * Copyright (C) 2006 Andy Kelk <andy@mopoke.co.uk> |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 uint32_t storageid = 0; | 56 uint32_t storageid = 0; |
| 57 uint32_t parentid = 0; | 57 uint32_t parentid = 0; |
| 58 | 58 |
| 59 fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); | 59 fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); |
| 60 | 60 |
| 61 while ( (opt = getopt(argc, argv, "dhn:i:s:p:")) != -1 ) { | 61 while ( (opt = getopt(argc, argv, "dhn:i:s:p:")) != -1 ) { |
| 62 switch (opt) { | 62 switch (opt) { |
| 63 case 'h': | 63 case 'h': |
| 64 usage(); | 64 usage(); |
| 65 case 'd': | 65 case 'd': |
| 66 LIBMTP_Set_Debug(LIBMTP_DEBUG_ALL); | 66 LIBMTP_Set_Debug(LIBMTP_DEBUG_PTP | LIBMTP_DEBUG_DATA); |
| 67 break; | 67 break; |
| 68 case 'i': | 68 case 'i': |
| 69 idcount++; | 69 idcount++; |
| 70 if ((tmp = realloc(ids, sizeof(uint32_t) * (idcount))) == NULL) { | 70 if ((tmp = realloc(ids, sizeof(uint32_t) * (idcount))) == NULL) { |
| 71 printf("realloc failed\n"); | 71 printf("realloc failed\n"); |
| 72 return 1; | 72 return 1; |
| 73 } | 73 } |
| 74 ids = tmp; | 74 ids = tmp; |
| 75 ids[(idcount-1)] = strtoul(optarg, &rest, 0); | 75 ids[(idcount-1)] = strtoul(optarg, &rest, 0); |
| 76 break; | 76 break; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 LIBMTP_destroy_filesampledata_t(albumart); | 164 LIBMTP_destroy_filesampledata_t(albumart); |
| 165 LIBMTP_destroy_album_t(album); | 165 LIBMTP_destroy_album_t(album); |
| 166 | 166 |
| 167 LIBMTP_Release_Device(device); | 167 LIBMTP_Release_Device(device); |
| 168 printf("OK.\n"); | 168 printf("OK.\n"); |
| 169 return 0; | 169 return 0; |
| 170 } | 170 } |
| 171 | 171 |
| OLD | NEW |