OLD | NEW |
| (Empty) |
1 Index: config.h | |
2 =================================================================== | |
3 --- config.h (revision 0) | |
4 +++ config.h (revision 0) | |
5 @@ -0,0 +1,211 @@ | |
6 +/* config.h. Generated from config.h.in by configure. */ | |
7 +/* config.h.in. Generated from configure.ac by autoheader. */ | |
8 + | |
9 +/* Define if building universal (internal helper macro) */ | |
10 +/* #undef AC_APPLE_UNIVERSAL_BUILD */ | |
11 + | |
12 +/* Define to 1 if you have the <arpa/inet.h> header file. */ | |
13 +#define HAVE_ARPA_INET_H 1 | |
14 + | |
15 +/* Define to 1 if you have the `basename' function. */ | |
16 +#define HAVE_BASENAME 1 | |
17 + | |
18 +/* Define to 1 if you have the <byteswap.h> header file. */ | |
19 +#define HAVE_BYTESWAP_H 1 | |
20 + | |
21 +/* Define to 1 if you have the <ctype.h> header file. */ | |
22 +#define HAVE_CTYPE_H 1 | |
23 + | |
24 +/* Define to 1 if you have the <dlfcn.h> header file. */ | |
25 +#define HAVE_DLFCN_H 1 | |
26 + | |
27 +/* Define to 1 if you have the <errno.h> header file. */ | |
28 +#define HAVE_ERRNO_H 1 | |
29 + | |
30 +/* Define to 1 if you have the <fcntl.h> header file. */ | |
31 +#define HAVE_FCNTL_H 1 | |
32 + | |
33 +/* Define to 1 if you have the <getopt.h> header file. */ | |
34 +#define HAVE_GETOPT_H 1 | |
35 + | |
36 +/* Define if you have the iconv() function and it works. */ | |
37 +#define HAVE_ICONV 1 | |
38 + | |
39 +/* Define to 1 if you have the <inttypes.h> header file. */ | |
40 +#define HAVE_INTTYPES_H 1 | |
41 + | |
42 +/* Define to 1 if you have the <langinfo.h> header file. */ | |
43 +#define HAVE_LANGINFO_H 1 | |
44 + | |
45 +/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ | |
46 +#define HAVE_LIBGCRYPT 1 | |
47 + | |
48 +/* Define to 1 if you have the <libgen.h> header file. */ | |
49 +#define HAVE_LIBGEN_H 1 | |
50 + | |
51 +/* Have libusb 0.x */ | |
52 +/* #undef HAVE_LIBUSB0 */ | |
53 + | |
54 +/* Have libusb 1.0 */ | |
55 +#define HAVE_LIBUSB1 /**/ | |
56 + | |
57 +/* Define to 1 if you have the <limits.h> header file. */ | |
58 +#define HAVE_LIMITS_H 1 | |
59 + | |
60 +/* Define to 1 if you have the <locale.h> header file. */ | |
61 +#define HAVE_LOCALE_H 1 | |
62 + | |
63 +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and | |
64 + to 0 otherwise. */ | |
65 +#define HAVE_MALLOC 1 | |
66 + | |
67 +/* Define to 1 if you have the <memory.h> header file. */ | |
68 +#define HAVE_MEMORY_H 1 | |
69 + | |
70 +/* Define to 1 if you have the `memset' function. */ | |
71 +#define HAVE_MEMSET 1 | |
72 + | |
73 +/* Define to 1 if you have the `mkstemp' function. */ | |
74 +#define HAVE_MKSTEMP 1 | |
75 + | |
76 +/* Have libopenusb 1.0 */ | |
77 +/* #undef HAVE_OPENUSB */ | |
78 + | |
79 +/* Define to 1 if you have the `select' function. */ | |
80 +#define HAVE_SELECT 1 | |
81 + | |
82 +/* Define to 1 if `stat' has the bug that it succeeds when given the | |
83 + zero-length file name argument. */ | |
84 +/* #undef HAVE_STAT_EMPTY_STRING_BUG */ | |
85 + | |
86 +/* Define to 1 if you have the <stdint.h> header file. */ | |
87 +#define HAVE_STDINT_H 1 | |
88 + | |
89 +/* Define to 1 if you have the <stdio.h> header file. */ | |
90 +#define HAVE_STDIO_H 1 | |
91 + | |
92 +/* Define to 1 if you have the <stdlib.h> header file. */ | |
93 +#define HAVE_STDLIB_H 1 | |
94 + | |
95 +/* Define to 1 if you have the `strdup' function. */ | |
96 +#define HAVE_STRDUP 1 | |
97 + | |
98 +/* Define to 1 if you have the `strerror' function. */ | |
99 +#define HAVE_STRERROR 1 | |
100 + | |
101 +/* Define to 1 if you have the <strings.h> header file. */ | |
102 +#define HAVE_STRINGS_H 1 | |
103 + | |
104 +/* Define to 1 if you have the <string.h> header file. */ | |
105 +#define HAVE_STRING_H 1 | |
106 + | |
107 +/* Define to 1 if you have the `strndup' function. */ | |
108 +#define HAVE_STRNDUP 1 | |
109 + | |
110 +/* Define to 1 if you have the `strrchr' function. */ | |
111 +#define HAVE_STRRCHR 1 | |
112 + | |
113 +/* Define to 1 if you have the `strtoul' function. */ | |
114 +#define HAVE_STRTOUL 1 | |
115 + | |
116 +/* Define to 1 if `st_blksize' is a member of `struct stat'. */ | |
117 +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 | |
118 + | |
119 +/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use | |
120 + `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ | |
121 +#define HAVE_ST_BLKSIZE 1 | |
122 + | |
123 +/* Define to 1 if you have the <sys/stat.h> header file. */ | |
124 +#define HAVE_SYS_STAT_H 1 | |
125 + | |
126 +/* Define to 1 if you have the <sys/time.h> header file. */ | |
127 +#define HAVE_SYS_TIME_H 1 | |
128 + | |
129 +/* Define to 1 if you have the <sys/types.h> header file. */ | |
130 +#define HAVE_SYS_TYPES_H 1 | |
131 + | |
132 +/* Define to 1 if you have the <sys/uio.h> header file. */ | |
133 +#define HAVE_SYS_UIO_H 1 | |
134 + | |
135 +/* Define to 1 if you have the <unistd.h> header file. */ | |
136 +#define HAVE_UNISTD_H 1 | |
137 + | |
138 +/* Define to 1 if you have the `usleep' function. */ | |
139 +#define HAVE_USLEEP 1 | |
140 + | |
141 +/* Define as const if the declaration of iconv() needs const. */ | |
142 +#define ICONV_CONST | |
143 + | |
144 +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing | |
145 + slash. */ | |
146 +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 | |
147 + | |
148 +/* Define to the sub-directory in which libtool stores uninstalled libraries. | |
149 + */ | |
150 +#define LT_OBJDIR ".libs/" | |
151 + | |
152 +/* Name of package */ | |
153 +#define PACKAGE "libmtp" | |
154 + | |
155 +/* Define to the address where bug reports for this package should be sent. */ | |
156 +#define PACKAGE_BUGREPORT "libmtp-discuss@lists.sourceforge.net" | |
157 + | |
158 +/* Define to the full name of this package. */ | |
159 +#define PACKAGE_NAME "libmtp" | |
160 + | |
161 +/* Define to the full name and version of this package. */ | |
162 +#define PACKAGE_STRING "libmtp 1.1.5" | |
163 + | |
164 +/* Define to the one symbol short name of this package. */ | |
165 +#define PACKAGE_TARNAME "libmtp" | |
166 + | |
167 +/* Define to the home page for this package. */ | |
168 +#define PACKAGE_URL "" | |
169 + | |
170 +/* Define to the version of this package. */ | |
171 +#define PACKAGE_VERSION "1.1.5" | |
172 + | |
173 +/* Define as the return type of signal handlers (`int' or `void'). */ | |
174 +#define RETSIGTYPE void | |
175 + | |
176 +/* Define to 1 if you have the ANSI C header files. */ | |
177 +#define STDC_HEADERS 1 | |
178 + | |
179 +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ | |
180 +#define TIME_WITH_SYS_TIME 1 | |
181 + | |
182 +/* Enable MTPZ functionality */ | |
183 +/* #undef USE_MTPZ */ | |
184 + | |
185 +/* Version number of package */ | |
186 +#define VERSION "1.1.5" | |
187 + | |
188 +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most | |
189 + significant byte first (like Motorola and SPARC, unlike Intel). */ | |
190 +#if defined AC_APPLE_UNIVERSAL_BUILD | |
191 +# if defined __BIG_ENDIAN__ | |
192 +# define WORDS_BIGENDIAN 1 | |
193 +# endif | |
194 +#else | |
195 +# ifndef WORDS_BIGENDIAN | |
196 +/* # undef WORDS_BIGENDIAN */ | |
197 +# endif | |
198 +#endif | |
199 + | |
200 +/* Number of bits in a file offset, on hosts where this is settable. */ | |
201 +/* #undef _FILE_OFFSET_BITS */ | |
202 + | |
203 +/* Define for large files, on AIX-style hosts. */ | |
204 +/* #undef _LARGE_FILES */ | |
205 + | |
206 +/* Define to empty if `const' does not conform to ANSI C. */ | |
207 +/* #undef const */ | |
208 + | |
209 +/* Define to rpl_malloc if the replacement function should be used. */ | |
210 +/* #undef malloc */ | |
211 + | |
212 +/* Define to `long int' if <sys/types.h> does not define. */ | |
213 +/* #undef off_t */ | |
214 + | |
215 +/* Define to `unsigned int' if <sys/types.h> does not define. */ | |
216 +/* #undef size_t */ | |
217 | |
218 Property changes on: config.h | |
219 ___________________________________________________________________ | |
220 Added: svn:eol-style | |
221 + LF | |
222 | |
223 Index: libmtp.gyp | |
224 =================================================================== | |
225 --- libmtp.gyp (revision 0) | |
226 +++ libmtp.gyp (revision 0) | |
227 @@ -0,0 +1,71 @@ | |
228 +# Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
229 +# Use of this source code is governed by a BSD-style license that can be | |
230 +# found in the LICENSE file. | |
231 + | |
232 +{ | |
233 + 'variables': { | |
234 + 'use_system_libmtp%': 0, | |
235 + }, | |
236 + 'conditions': [ | |
237 + ['use_system_libmtp==0', { | |
238 + 'targets': [ | |
239 + { | |
240 + 'target_name': 'libmtp', | |
241 + 'type': 'shared_library', | |
242 + 'product_name': 'mtp', | |
243 + 'dependencies': [ | |
244 + '../../third_party/libusb/libusb.gyp:libusb', | |
245 + ], | |
246 + 'sources': [ | |
247 + 'src/libmtp.c', | |
248 + 'src/libusb1-glue.c', | |
249 + 'src/ptp.c', | |
250 + 'src/unicode.c', | |
251 + 'src/util.c', | |
252 + ], | |
253 + 'cflags!': ['-fvisibility=hidden'], | |
254 + 'include_dirs': [ | |
255 + '.', | |
256 + 'src', | |
257 + ], | |
258 + 'direct_dependent_settings': { | |
259 + 'include_dirs': [ | |
260 + 'src', | |
261 + ], | |
262 + }, | |
263 + }, | |
264 + ], | |
265 + }, { # use_system_libmtp==1 | |
266 + 'conditions': [ | |
267 + ['sysroot!=""', { | |
268 + 'variables': { | |
269 + 'pkg-config': '../../build/linux/pkg-config-wrapper "<(sysroot)" "<
(target_arch)"', | |
270 + }, | |
271 + }, { | |
272 + 'variables': { | |
273 + 'pkg-config': 'pkg-config' | |
274 + }, | |
275 + }], | |
276 + ], | |
277 + 'targets': [ | |
278 + { | |
279 + 'target_name': 'libmtp', | |
280 + 'type': 'none', | |
281 + 'direct_dependent_settings': { | |
282 + 'cflags': [ | |
283 + '<!@(<(pkg-config) --cflags libmtp)', | |
284 + ], | |
285 + }, | |
286 + 'link_settings': { | |
287 + 'ldflags': [ | |
288 + '<!@(<(pkg-config) --libs-only-L --libs-only-other libmtp)', | |
289 + ], | |
290 + 'libraries': [ | |
291 + '<!@(<(pkg-config) --libs-only-l libmtp)', | |
292 + ], | |
293 + }, | |
294 + } | |
295 + ], | |
296 + }], | |
297 + ] | |
298 +} | |
299 | |
300 Property changes on: libmtp.gyp | |
301 ___________________________________________________________________ | |
302 Added: svn:eol-style | |
303 + LF | |
304 | |
305 Index: src/gphoto2-endian.h | |
306 =================================================================== | |
307 --- src/gphoto2-endian.h (revision 0) | |
308 +++ src/gphoto2-endian.h (revision 0) | |
309 @@ -0,0 +1,124 @@ | |
310 +/* This file is generated automatically by configure */ | |
311 +/* It is valid only for the system type x86_64-unknown-linux-gnu */ | |
312 + | |
313 +#ifndef __BYTEORDER_H | |
314 +#define __BYTEORDER_H | |
315 + | |
316 +/* ntohl and relatives live here */ | |
317 +#include <arpa/inet.h> | |
318 + | |
319 +/* Define generic byte swapping functions */ | |
320 +#include <byteswap.h> | |
321 +#define swap16(x) bswap_16(x) | |
322 +#define swap32(x) bswap_32(x) | |
323 +#define swap64(x) bswap_64(x) | |
324 + | |
325 +/* The byte swapping macros have the form: */ | |
326 +/* EENN[a]toh or htoEENN[a] where EE is be (big endian) or */ | |
327 +/* le (little-endian), NN is 16 or 32 (number of bits) and a, */ | |
328 +/* if present, indicates that the endian side is a pointer to an */ | |
329 +/* array of uint8_t bytes instead of an integer of the specified length. */ | |
330 +/* h refers to the host's ordering method. */ | |
331 + | |
332 +/* So, to convert a 32-bit integer stored in a buffer in little-endian */ | |
333 +/* format into a uint32_t usable on this machine, you could use: */ | |
334 +/* uint32_t value = le32atoh(&buf[3]); */ | |
335 +/* To put that value back into the buffer, you could use: */ | |
336 +/* htole32a(&buf[3], value); */ | |
337 + | |
338 +/* Define aliases for the standard byte swapping macros */ | |
339 +/* Arguments to these macros must be properly aligned on natural word */ | |
340 +/* boundaries in order to work properly on all architectures */ | |
341 +#ifndef htobe16 | |
342 +# define htobe16(x) htons(x) | |
343 +#endif | |
344 +#ifndef htobe32 | |
345 +# define htobe32(x) htonl(x) | |
346 +#endif | |
347 +#ifndef be16toh | |
348 +# define be16toh(x) ntohs(x) | |
349 +#endif | |
350 +#ifndef be32toh | |
351 +# define be32toh(x) ntohl(x) | |
352 +#endif | |
353 + | |
354 +#define HTOBE16(x) (x) = htobe16(x) | |
355 +#define HTOBE32(x) (x) = htobe32(x) | |
356 +#define BE32TOH(x) (x) = be32toh(x) | |
357 +#define BE16TOH(x) (x) = be16toh(x) | |
358 + | |
359 +/* On little endian machines, these macros are null */ | |
360 +#ifndef htole16 | |
361 +# define htole16(x) (x) | |
362 +#endif | |
363 +#ifndef htole32 | |
364 +# define htole32(x) (x) | |
365 +#endif | |
366 +#ifndef htole64 | |
367 +# define htole64(x) (x) | |
368 +#endif | |
369 +#ifndef le16toh | |
370 +# define le16toh(x) (x) | |
371 +#endif | |
372 +#ifndef le32toh | |
373 +# define le32toh(x) (x) | |
374 +#endif | |
375 +#ifndef le64toh | |
376 +# define le64toh(x) (x) | |
377 +#endif | |
378 + | |
379 +#define HTOLE16(x) (void) (x) | |
380 +#define HTOLE32(x) (void) (x) | |
381 +#define HTOLE64(x) (void) (x) | |
382 +#define LE16TOH(x) (void) (x) | |
383 +#define LE32TOH(x) (void) (x) | |
384 +#define LE64TOH(x) (void) (x) | |
385 + | |
386 +/* These don't have standard aliases */ | |
387 +#ifndef htobe64 | |
388 +# define htobe64(x) swap64(x) | |
389 +#endif | |
390 +#ifndef be64toh | |
391 +# define be64toh(x) swap64(x) | |
392 +#endif | |
393 + | |
394 +#define HTOBE64(x) (x) = htobe64(x) | |
395 +#define BE64TOH(x) (x) = be64toh(x) | |
396 + | |
397 +/* Define the C99 standard length-specific integer types */ | |
398 +#include <_stdint.h> | |
399 + | |
400 +/* Here are some macros to create integers from a byte array */ | |
401 +/* These are used to get and put integers from/into a uint8_t array */ | |
402 +/* with a specific endianness. This is the most portable way to generate */ | |
403 +/* and read messages to a network or serial device. Each member of a */ | |
404 +/* packet structure must be handled separately. */ | |
405 + | |
406 +/* Non-optimized but portable macros */ | |
407 +#define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1])) | |
408 +#define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3
])) | |
409 +#define be64atoh_x(x,off,shift) (((uint64_t)((x)[off]))<<shift) | |
410 +#define be64atoh(x) ((uint64_t)(be64atoh_x(x,0,56)|be64atoh_x(x,1,48)|be64a
toh_x(x,2,40)| \ | |
411 + be64atoh_x(x,3,32)|be64atoh_x(x,4,24)|be64atoh_x(x,5,16)|be64atoh_x(x,6
,8)|((x)[7]))) | |
412 +#define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0])) | |
413 +#define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0
])) | |
414 +#define le64atoh_x(x,off,shift) (((uint64_t)(x)[off])<<shift) | |
415 +#define le64atoh(x) ((uint64_t)(le64atoh_x(x,7,56)|le64atoh_x(x,6,48)|le64a
toh_x(x,5,40)| \ | |
416 + le64atoh_x(x,4,32)|le64atoh_x(x,3,24)|le64atoh_x(x,2,16)|le64atoh_x(x,1
,8)|((x)[0]))) | |
417 + | |
418 +#define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x) | |
419 +#define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \ | |
420 + (a)[2]=(uint8_t)((x)>>8), (a)[3]=(uint8_t)(x) | |
421 +#define htobe64a(a,x) (a)[0]=(uint8_t)((x)>>56), (a)[1]=(uint8_t)((x)>>48), \ | |
422 + (a)[2]=(uint8_t)((x)>>40), (a)[3]=(uint8_t)((x)>>32), \ | |
423 + (a)[4]=(uint8_t)((x)>>24), (a)[5]=(uint8_t)((x)>>16), \ | |
424 + (a)[6]=(uint8_t)((x)>>8), (a)[7]=(uint8_t)(x) | |
425 +#define htole16a(a,x) (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) | |
426 +#define htole32a(a,x) (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \ | |
427 + (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) | |
428 +#define htole64a(a,x) (a)[7]=(uint8_t)((x)>>56), (a)[6]=(uint8_t)((x)>>48), \ | |
429 + (a)[5]=(uint8_t)((x)>>40), (a)[4]=(uint8_t)((x)>>32), \ | |
430 + (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \ | |
431 + (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) | |
432 + | |
433 +#endif /*__BYTEORDER_H*/ | |
434 | |
435 Property changes on: src/gphoto2-endian.h | |
436 ___________________________________________________________________ | |
437 Added: svn:eol-style | |
438 + LF | |
439 | |
440 Index: src/libmtp.h | |
441 =================================================================== | |
442 --- src/libmtp.h (revision 0) | |
443 +++ src/libmtp.h (revision 0) | |
444 @@ -0,0 +1,1026 @@ | |
445 +/** | |
446 + * \file libmtp.h | |
447 + * Interface to the Media Transfer Protocol library. | |
448 + * | |
449 + * Copyright (C) 2005-2012 Linus Walleij <triad@df.lth.se> | |
450 + * Copyright (C) 2005-2008 Richard A. Low <richard@wentnet.com> | |
451 + * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> | |
452 + * Copyright (C) 2008 Florent Mertens <flomertens@gmail.com> | |
453 + * | |
454 + * This library is free software; you can redistribute it and/or | |
455 + * modify it under the terms of the GNU Lesser General Public | |
456 + * License as published by the Free Software Foundation; either | |
457 + * version 2 of the License, or (at your option) any later version. | |
458 + * | |
459 + * This library is distributed in the hope that it will be useful, | |
460 + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
461 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
462 + * Lesser General Public License for more details. | |
463 + * | |
464 + * You should have received a copy of the GNU Lesser General Public | |
465 + * License along with this library; if not, write to the | |
466 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
467 + * Boston, MA 02111-1307, USA. | |
468 + * | |
469 + * <code> | |
470 + * #include <libmtp.h> | |
471 + * </code> | |
472 + */ | |
473 +#ifndef LIBMTP_H_INCLUSION_GUARD | |
474 +#define LIBMTP_H_INCLUSION_GUARD | |
475 + | |
476 +#define LIBMTP_VERSION 1.1.5 | |
477 +#define LIBMTP_VERSION_STRING "1.1.5" | |
478 + | |
479 +/* This handles MSVC pecularities */ | |
480 +#ifdef _MSC_VER | |
481 +#include <windows.h> | |
482 +#define __WIN32__ | |
483 +#define snprintf _snprintf | |
484 +#define ssize_t SSIZE_T | |
485 +/* | |
486 + * Types that do not exist in Windows | |
487 + * sys/types.h, but they exist in mingw32 | |
488 + * sys/types.h. | |
489 + */ | |
490 +typedef char int8_t; | |
491 +typedef unsigned char uint8_t; | |
492 +typedef __int16 int16_t; | |
493 +typedef unsigned __int16 uint16_t; | |
494 +typedef __int32 int32_t; | |
495 +typedef unsigned __int32 uint32_t; | |
496 +typedef unsigned __int64 uint64_t; | |
497 +#endif | |
498 + | |
499 +#include <stdio.h> | |
500 +#include <stdint.h> | |
501 +/* We use time_t */ | |
502 +#include <time.h> | |
503 + | |
504 +/** | |
505 + * @defgroup types libmtp global type definitions | |
506 + * @{ | |
507 + */ | |
508 + | |
509 +/** | |
510 + * The debug flags defined here are the external flags used | |
511 + * by the libmtp library interface. | |
512 + * | |
513 + * Please keep this list in sync with libmtp.c. | |
514 + */ | |
515 +#define LIBMTP_DEBUG_NONE 0x00 | |
516 +#define LIBMTP_DEBUG_PTP 0x01 | |
517 +#define LIBMTP_DEBUG_PLST 0x02 | |
518 +#define LIBMTP_DEBUG_USB 0x04 | |
519 +#define LIBMTP_DEBUG_DATA 0x08 | |
520 +#define LIBMTP_DEBUG_ALL 0xFF | |
521 + | |
522 + | |
523 +/** | |
524 + * The filetypes defined here are the external types used | |
525 + * by the libmtp library interface. The types used internally | |
526 + * as PTP-defined enumerator types is something different. | |
527 + */ | |
528 +typedef enum { | |
529 + LIBMTP_FILETYPE_FOLDER, | |
530 + LIBMTP_FILETYPE_WAV, | |
531 + LIBMTP_FILETYPE_MP3, | |
532 + LIBMTP_FILETYPE_WMA, | |
533 + LIBMTP_FILETYPE_OGG, | |
534 + LIBMTP_FILETYPE_AUDIBLE, | |
535 + LIBMTP_FILETYPE_MP4, | |
536 + LIBMTP_FILETYPE_UNDEF_AUDIO, | |
537 + LIBMTP_FILETYPE_WMV, | |
538 + LIBMTP_FILETYPE_AVI, | |
539 + LIBMTP_FILETYPE_MPEG, | |
540 + LIBMTP_FILETYPE_ASF, | |
541 + LIBMTP_FILETYPE_QT, | |
542 + LIBMTP_FILETYPE_UNDEF_VIDEO, | |
543 + LIBMTP_FILETYPE_JPEG, | |
544 + LIBMTP_FILETYPE_JFIF, | |
545 + LIBMTP_FILETYPE_TIFF, | |
546 + LIBMTP_FILETYPE_BMP, | |
547 + LIBMTP_FILETYPE_GIF, | |
548 + LIBMTP_FILETYPE_PICT, | |
549 + LIBMTP_FILETYPE_PNG, | |
550 + LIBMTP_FILETYPE_VCALENDAR1, | |
551 + LIBMTP_FILETYPE_VCALENDAR2, | |
552 + LIBMTP_FILETYPE_VCARD2, | |
553 + LIBMTP_FILETYPE_VCARD3, | |
554 + LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT, | |
555 + LIBMTP_FILETYPE_WINEXEC, | |
556 + LIBMTP_FILETYPE_TEXT, | |
557 + LIBMTP_FILETYPE_HTML, | |
558 + LIBMTP_FILETYPE_FIRMWARE, | |
559 + LIBMTP_FILETYPE_AAC, | |
560 + LIBMTP_FILETYPE_MEDIACARD, | |
561 + LIBMTP_FILETYPE_FLAC, | |
562 + LIBMTP_FILETYPE_MP2, | |
563 + LIBMTP_FILETYPE_M4A, | |
564 + LIBMTP_FILETYPE_DOC, | |
565 + LIBMTP_FILETYPE_XML, | |
566 + LIBMTP_FILETYPE_XLS, | |
567 + LIBMTP_FILETYPE_PPT, | |
568 + LIBMTP_FILETYPE_MHT, | |
569 + LIBMTP_FILETYPE_JP2, | |
570 + LIBMTP_FILETYPE_JPX, | |
571 + LIBMTP_FILETYPE_ALBUM, | |
572 + LIBMTP_FILETYPE_PLAYLIST, | |
573 + LIBMTP_FILETYPE_UNKNOWN | |
574 +} LIBMTP_filetype_t; | |
575 + | |
576 +/** | |
577 + * \def LIBMTP_FILETYPE_IS_AUDIO | |
578 + * Audio filetype test. | |
579 + * | |
580 + * For filetypes that can be either audio | |
581 + * or video, use LIBMTP_FILETYPE_IS_AUDIOVIDEO | |
582 + */ | |
583 +#define LIBMTP_FILETYPE_IS_AUDIO(a)\ | |
584 +(a == LIBMTP_FILETYPE_WAV ||\ | |
585 + a == LIBMTP_FILETYPE_MP3 ||\ | |
586 + a == LIBMTP_FILETYPE_MP2 ||\ | |
587 + a == LIBMTP_FILETYPE_WMA ||\ | |
588 + a == LIBMTP_FILETYPE_OGG ||\ | |
589 + a == LIBMTP_FILETYPE_FLAC ||\ | |
590 + a == LIBMTP_FILETYPE_AAC ||\ | |
591 + a == LIBMTP_FILETYPE_M4A ||\ | |
592 + a == LIBMTP_FILETYPE_AUDIBLE ||\ | |
593 + a == LIBMTP_FILETYPE_UNDEF_AUDIO) | |
594 + | |
595 +/** | |
596 + * \def LIBMTP_FILETYPE_IS_VIDEO | |
597 + * Video filetype test. | |
598 + * | |
599 + * For filetypes that can be either audio | |
600 + * or video, use LIBMTP_FILETYPE_IS_AUDIOVIDEO | |
601 + */ | |
602 +#define LIBMTP_FILETYPE_IS_VIDEO(a)\ | |
603 +(a == LIBMTP_FILETYPE_WMV ||\ | |
604 + a == LIBMTP_FILETYPE_AVI ||\ | |
605 + a == LIBMTP_FILETYPE_MPEG ||\ | |
606 + a == LIBMTP_FILETYPE_UNDEF_VIDEO) | |
607 + | |
608 +/** | |
609 + * \def LIBMTP_FILETYPE_IS_AUDIOVIDEO | |
610 + * Audio and&slash;or video filetype test. | |
611 + */ | |
612 +#define LIBMTP_FILETYPE_IS_AUDIOVIDEO(a)\ | |
613 +(a == LIBMTP_FILETYPE_MP4 ||\ | |
614 + a == LIBMTP_FILETYPE_ASF ||\ | |
615 + a == LIBMTP_FILETYPE_QT) | |
616 + | |
617 +/** | |
618 + * \def LIBMTP_FILETYPE_IS_TRACK | |
619 + * Test if filetype is a track. | |
620 + * Use this to determine if the File API or Track API | |
621 + * should be used to upload or download an object. | |
622 + */ | |
623 +#define LIBMTP_FILETYPE_IS_TRACK(a)\ | |
624 +(LIBMTP_FILETYPE_IS_AUDIO(a) ||\ | |
625 + LIBMTP_FILETYPE_IS_VIDEO(a) ||\ | |
626 + LIBMTP_FILETYPE_IS_AUDIOVIDEO(a)) | |
627 + | |
628 +/** | |
629 + * \def LIBMTP_FILETYPE_IS_IMAGE | |
630 + * Image filetype test | |
631 + */ | |
632 +#define LIBMTP_FILETYPE_IS_IMAGE(a)\ | |
633 +(a == LIBMTP_FILETYPE_JPEG ||\ | |
634 +a == LIBMTP_FILETYPE_JFIF ||\ | |
635 +a == LIBMTP_FILETYPE_TIFF ||\ | |
636 +a == LIBMTP_FILETYPE_BMP ||\ | |
637 +a == LIBMTP_FILETYPE_GIF ||\ | |
638 +a == LIBMTP_FILETYPE_PICT ||\ | |
639 +a == LIBMTP_FILETYPE_PNG ||\ | |
640 +a == LIBMTP_FILETYPE_JP2 ||\ | |
641 +a == LIBMTP_FILETYPE_JPX ||\ | |
642 +a == LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT) | |
643 + | |
644 +/** | |
645 + * \def LIBMTP_FILETYPE_IS_ADDRESSBOOK | |
646 + * Addressbook and Business card filetype test | |
647 + */ | |
648 +#define LIBMTP_FILETYPE_IS_ADDRESSBOOK(a)\ | |
649 +(a == LIBMTP_FILETYPE_VCARD2 ||\ | |
650 +a == LIBMTP_FILETYPE_VCARD3) | |
651 + | |
652 +/** | |
653 + * \def LIBMTP_FILETYPE_IS_CALENDAR | |
654 + * Calendar and Appointment filetype test | |
655 + */ | |
656 +#define LIBMTP_FILETYPE_IS_CALENDAR(a)\ | |
657 +(a == LIBMTP_FILETYPE_VCALENDAR1 ||\ | |
658 +a == LIBMTP_FILETYPE_VCALENDAR2) | |
659 + | |
660 +/** | |
661 + * The properties defined here are the external types used | |
662 + * by the libmtp library interface. | |
663 + */ | |
664 +typedef enum { | |
665 + LIBMTP_PROPERTY_StorageID, | |
666 + LIBMTP_PROPERTY_ObjectFormat, | |
667 + LIBMTP_PROPERTY_ProtectionStatus, | |
668 + LIBMTP_PROPERTY_ObjectSize, | |
669 + LIBMTP_PROPERTY_AssociationType, | |
670 + LIBMTP_PROPERTY_AssociationDesc, | |
671 + LIBMTP_PROPERTY_ObjectFileName, | |
672 + LIBMTP_PROPERTY_DateCreated, | |
673 + LIBMTP_PROPERTY_DateModified, | |
674 + LIBMTP_PROPERTY_Keywords, | |
675 + LIBMTP_PROPERTY_ParentObject, | |
676 + LIBMTP_PROPERTY_AllowedFolderContents, | |
677 + LIBMTP_PROPERTY_Hidden, | |
678 + LIBMTP_PROPERTY_SystemObject, | |
679 + LIBMTP_PROPERTY_PersistantUniqueObjectIdentifier, | |
680 + LIBMTP_PROPERTY_SyncID, | |
681 + LIBMTP_PROPERTY_PropertyBag, | |
682 + LIBMTP_PROPERTY_Name, | |
683 + LIBMTP_PROPERTY_CreatedBy, | |
684 + LIBMTP_PROPERTY_Artist, | |
685 + LIBMTP_PROPERTY_DateAuthored, | |
686 + LIBMTP_PROPERTY_Description, | |
687 + LIBMTP_PROPERTY_URLReference, | |
688 + LIBMTP_PROPERTY_LanguageLocale, | |
689 + LIBMTP_PROPERTY_CopyrightInformation, | |
690 + LIBMTP_PROPERTY_Source, | |
691 + LIBMTP_PROPERTY_OriginLocation, | |
692 + LIBMTP_PROPERTY_DateAdded, | |
693 + LIBMTP_PROPERTY_NonConsumable, | |
694 + LIBMTP_PROPERTY_CorruptOrUnplayable, | |
695 + LIBMTP_PROPERTY_ProducerSerialNumber, | |
696 + LIBMTP_PROPERTY_RepresentativeSampleFormat, | |
697 + LIBMTP_PROPERTY_RepresentativeSampleSize, | |
698 + LIBMTP_PROPERTY_RepresentativeSampleHeight, | |
699 + LIBMTP_PROPERTY_RepresentativeSampleWidth, | |
700 + LIBMTP_PROPERTY_RepresentativeSampleDuration, | |
701 + LIBMTP_PROPERTY_RepresentativeSampleData, | |
702 + LIBMTP_PROPERTY_Width, | |
703 + LIBMTP_PROPERTY_Height, | |
704 + LIBMTP_PROPERTY_Duration, | |
705 + LIBMTP_PROPERTY_Rating, | |
706 + LIBMTP_PROPERTY_Track, | |
707 + LIBMTP_PROPERTY_Genre, | |
708 + LIBMTP_PROPERTY_Credits, | |
709 + LIBMTP_PROPERTY_Lyrics, | |
710 + LIBMTP_PROPERTY_SubscriptionContentID, | |
711 + LIBMTP_PROPERTY_ProducedBy, | |
712 + LIBMTP_PROPERTY_UseCount, | |
713 + LIBMTP_PROPERTY_SkipCount, | |
714 + LIBMTP_PROPERTY_LastAccessed, | |
715 + LIBMTP_PROPERTY_ParentalRating, | |
716 + LIBMTP_PROPERTY_MetaGenre, | |
717 + LIBMTP_PROPERTY_Composer, | |
718 + LIBMTP_PROPERTY_EffectiveRating, | |
719 + LIBMTP_PROPERTY_Subtitle, | |
720 + LIBMTP_PROPERTY_OriginalReleaseDate, | |
721 + LIBMTP_PROPERTY_AlbumName, | |
722 + LIBMTP_PROPERTY_AlbumArtist, | |
723 + LIBMTP_PROPERTY_Mood, | |
724 + LIBMTP_PROPERTY_DRMStatus, | |
725 + LIBMTP_PROPERTY_SubDescription, | |
726 + LIBMTP_PROPERTY_IsCropped, | |
727 + LIBMTP_PROPERTY_IsColorCorrected, | |
728 + LIBMTP_PROPERTY_ImageBitDepth, | |
729 + LIBMTP_PROPERTY_Fnumber, | |
730 + LIBMTP_PROPERTY_ExposureTime, | |
731 + LIBMTP_PROPERTY_ExposureIndex, | |
732 + LIBMTP_PROPERTY_DisplayName, | |
733 + LIBMTP_PROPERTY_BodyText, | |
734 + LIBMTP_PROPERTY_Subject, | |
735 + LIBMTP_PROPERTY_Priority, | |
736 + LIBMTP_PROPERTY_GivenName, | |
737 + LIBMTP_PROPERTY_MiddleNames, | |
738 + LIBMTP_PROPERTY_FamilyName, | |
739 + LIBMTP_PROPERTY_Prefix, | |
740 + LIBMTP_PROPERTY_Suffix, | |
741 + LIBMTP_PROPERTY_PhoneticGivenName, | |
742 + LIBMTP_PROPERTY_PhoneticFamilyName, | |
743 + LIBMTP_PROPERTY_EmailPrimary, | |
744 + LIBMTP_PROPERTY_EmailPersonal1, | |
745 + LIBMTP_PROPERTY_EmailPersonal2, | |
746 + LIBMTP_PROPERTY_EmailBusiness1, | |
747 + LIBMTP_PROPERTY_EmailBusiness2, | |
748 + LIBMTP_PROPERTY_EmailOthers, | |
749 + LIBMTP_PROPERTY_PhoneNumberPrimary, | |
750 + LIBMTP_PROPERTY_PhoneNumberPersonal, | |
751 + LIBMTP_PROPERTY_PhoneNumberPersonal2, | |
752 + LIBMTP_PROPERTY_PhoneNumberBusiness, | |
753 + LIBMTP_PROPERTY_PhoneNumberBusiness2, | |
754 + LIBMTP_PROPERTY_PhoneNumberMobile, | |
755 + LIBMTP_PROPERTY_PhoneNumberMobile2, | |
756 + LIBMTP_PROPERTY_FaxNumberPrimary, | |
757 + LIBMTP_PROPERTY_FaxNumberPersonal, | |
758 + LIBMTP_PROPERTY_FaxNumberBusiness, | |
759 + LIBMTP_PROPERTY_PagerNumber, | |
760 + LIBMTP_PROPERTY_PhoneNumberOthers, | |
761 + LIBMTP_PROPERTY_PrimaryWebAddress, | |
762 + LIBMTP_PROPERTY_PersonalWebAddress, | |
763 + LIBMTP_PROPERTY_BusinessWebAddress, | |
764 + LIBMTP_PROPERTY_InstantMessengerAddress, | |
765 + LIBMTP_PROPERTY_InstantMessengerAddress2, | |
766 + LIBMTP_PROPERTY_InstantMessengerAddress3, | |
767 + LIBMTP_PROPERTY_PostalAddressPersonalFull, | |
768 + LIBMTP_PROPERTY_PostalAddressPersonalFullLine1, | |
769 + LIBMTP_PROPERTY_PostalAddressPersonalFullLine2, | |
770 + LIBMTP_PROPERTY_PostalAddressPersonalFullCity, | |
771 + LIBMTP_PROPERTY_PostalAddressPersonalFullRegion, | |
772 + LIBMTP_PROPERTY_PostalAddressPersonalFullPostalCode, | |
773 + LIBMTP_PROPERTY_PostalAddressPersonalFullCountry, | |
774 + LIBMTP_PROPERTY_PostalAddressBusinessFull, | |
775 + LIBMTP_PROPERTY_PostalAddressBusinessLine1, | |
776 + LIBMTP_PROPERTY_PostalAddressBusinessLine2, | |
777 + LIBMTP_PROPERTY_PostalAddressBusinessCity, | |
778 + LIBMTP_PROPERTY_PostalAddressBusinessRegion, | |
779 + LIBMTP_PROPERTY_PostalAddressBusinessPostalCode, | |
780 + LIBMTP_PROPERTY_PostalAddressBusinessCountry, | |
781 + LIBMTP_PROPERTY_PostalAddressOtherFull, | |
782 + LIBMTP_PROPERTY_PostalAddressOtherLine1, | |
783 + LIBMTP_PROPERTY_PostalAddressOtherLine2, | |
784 + LIBMTP_PROPERTY_PostalAddressOtherCity, | |
785 + LIBMTP_PROPERTY_PostalAddressOtherRegion, | |
786 + LIBMTP_PROPERTY_PostalAddressOtherPostalCode, | |
787 + LIBMTP_PROPERTY_PostalAddressOtherCountry, | |
788 + LIBMTP_PROPERTY_OrganizationName, | |
789 + LIBMTP_PROPERTY_PhoneticOrganizationName, | |
790 + LIBMTP_PROPERTY_Role, | |
791 + LIBMTP_PROPERTY_Birthdate, | |
792 + LIBMTP_PROPERTY_MessageTo, | |
793 + LIBMTP_PROPERTY_MessageCC, | |
794 + LIBMTP_PROPERTY_MessageBCC, | |
795 + LIBMTP_PROPERTY_MessageRead, | |
796 + LIBMTP_PROPERTY_MessageReceivedTime, | |
797 + LIBMTP_PROPERTY_MessageSender, | |
798 + LIBMTP_PROPERTY_ActivityBeginTime, | |
799 + LIBMTP_PROPERTY_ActivityEndTime, | |
800 + LIBMTP_PROPERTY_ActivityLocation, | |
801 + LIBMTP_PROPERTY_ActivityRequiredAttendees, | |
802 + LIBMTP_PROPERTY_ActivityOptionalAttendees, | |
803 + LIBMTP_PROPERTY_ActivityResources, | |
804 + LIBMTP_PROPERTY_ActivityAccepted, | |
805 + LIBMTP_PROPERTY_Owner, | |
806 + LIBMTP_PROPERTY_Editor, | |
807 + LIBMTP_PROPERTY_Webmaster, | |
808 + LIBMTP_PROPERTY_URLSource, | |
809 + LIBMTP_PROPERTY_URLDestination, | |
810 + LIBMTP_PROPERTY_TimeBookmark, | |
811 + LIBMTP_PROPERTY_ObjectBookmark, | |
812 + LIBMTP_PROPERTY_ByteBookmark, | |
813 + LIBMTP_PROPERTY_LastBuildDate, | |
814 + LIBMTP_PROPERTY_TimetoLive, | |
815 + LIBMTP_PROPERTY_MediaGUID, | |
816 + LIBMTP_PROPERTY_TotalBitRate, | |
817 + LIBMTP_PROPERTY_BitRateType, | |
818 + LIBMTP_PROPERTY_SampleRate, | |
819 + LIBMTP_PROPERTY_NumberOfChannels, | |
820 + LIBMTP_PROPERTY_AudioBitDepth, | |
821 + LIBMTP_PROPERTY_ScanDepth, | |
822 + LIBMTP_PROPERTY_AudioWAVECodec, | |
823 + LIBMTP_PROPERTY_AudioBitRate, | |
824 + LIBMTP_PROPERTY_VideoFourCCCodec, | |
825 + LIBMTP_PROPERTY_VideoBitRate, | |
826 + LIBMTP_PROPERTY_FramesPerThousandSeconds, | |
827 + LIBMTP_PROPERTY_KeyFrameDistance, | |
828 + LIBMTP_PROPERTY_BufferSize, | |
829 + LIBMTP_PROPERTY_EncodingQuality, | |
830 + LIBMTP_PROPERTY_EncodingProfile, | |
831 + LIBMTP_PROPERTY_BuyFlag, | |
832 + LIBMTP_PROPERTY_UNKNOWN | |
833 +} LIBMTP_property_t; | |
834 + | |
835 +/** | |
836 + * These are the data types | |
837 + */ | |
838 +typedef enum { | |
839 + LIBMTP_DATATYPE_INT8, | |
840 + LIBMTP_DATATYPE_UINT8, | |
841 + LIBMTP_DATATYPE_INT16, | |
842 + LIBMTP_DATATYPE_UINT16, | |
843 + LIBMTP_DATATYPE_INT32, | |
844 + LIBMTP_DATATYPE_UINT32, | |
845 + LIBMTP_DATATYPE_INT64, | |
846 + LIBMTP_DATATYPE_UINT64, | |
847 +} LIBMTP_datatype_t; | |
848 + | |
849 +/** | |
850 + * These are the numbered error codes. You can also | |
851 + * get string representations for errors. | |
852 + */ | |
853 +typedef enum { | |
854 + LIBMTP_ERROR_NONE, | |
855 + LIBMTP_ERROR_GENERAL, | |
856 + LIBMTP_ERROR_PTP_LAYER, | |
857 + LIBMTP_ERROR_USB_LAYER, | |
858 + LIBMTP_ERROR_MEMORY_ALLOCATION, | |
859 + LIBMTP_ERROR_NO_DEVICE_ATTACHED, | |
860 + LIBMTP_ERROR_STORAGE_FULL, | |
861 + LIBMTP_ERROR_CONNECTING, | |
862 + LIBMTP_ERROR_CANCELLED | |
863 +} LIBMTP_error_number_t; | |
864 + | |
865 +typedef struct LIBMTP_device_entry_struct LIBMTP_device_entry_t; /**< @see LIBM
TP_device_entry_struct */ | |
866 +typedef struct LIBMTP_raw_device_struct LIBMTP_raw_device_t; /**< @see LIBMTP_r
aw_device_struct */ | |
867 +typedef struct LIBMTP_error_struct LIBMTP_error_t; /**< @see LIBMTP_error_struc
t */ | |
868 +typedef struct LIBMTP_allowed_values_struct LIBMTP_allowed_values_t; /**< @see
LIBMTP_allowed_values_struct */ | |
869 +typedef struct LIBMTP_device_extension_struct LIBMTP_device_extension_t; /** <
@see LIBMTP_device_extension_struct */ | |
870 +typedef struct LIBMTP_mtpdevice_struct LIBMTP_mtpdevice_t; /**< @see LIBMTP_mtp
device_struct */ | |
871 +typedef struct LIBMTP_file_struct LIBMTP_file_t; /**< @see LIBMTP_file_struct *
/ | |
872 +typedef struct LIBMTP_track_struct LIBMTP_track_t; /**< @see LIBMTP_track_struc
t */ | |
873 +typedef struct LIBMTP_playlist_struct LIBMTP_playlist_t; /**< @see LIBMTP_playl
ist_struct */ | |
874 +typedef struct LIBMTP_album_struct LIBMTP_album_t; /**< @see LIBMTP_album_struc
t */ | |
875 +typedef struct LIBMTP_folder_struct LIBMTP_folder_t; /**< @see LIBMTP_folder_t
*/ | |
876 +typedef struct LIBMTP_object_struct LIBMTP_object_t; /**< @see LIBMTP_object_t
*/ | |
877 +typedef struct LIBMTP_filesampledata_struct LIBMTP_filesampledata_t; /**< @see
LIBMTP_filesample_t */ | |
878 +typedef struct LIBMTP_devicestorage_struct LIBMTP_devicestorage_t; /**< @see LI
BMTP_devicestorage_t */ | |
879 + | |
880 +/** | |
881 + * The callback type definition. Notice that a progress percentage ratio | |
882 + * is easy to calculate by dividing <code>sent</code> by | |
883 + * <code>total</code>. | |
884 + * @param sent the number of bytes sent so far | |
885 + * @param total the total number of bytes to send | |
886 + * @param data a user-defined dereferencable pointer | |
887 + * @return if anything else than 0 is returned, the current transfer will be | |
888 + * interrupted / cancelled. | |
889 + */ | |
890 +typedef int (* LIBMTP_progressfunc_t) (uint64_t const sent, uint64_t const tota
l, | |
891 + void const * const data); | |
892 + | |
893 +/** | |
894 + * Callback function for get by handler function | |
895 + * @param params the device parameters | |
896 + * @param priv a user-defined dereferencable pointer | |
897 + * @param wantlen the number of bytes wanted | |
898 + * @param data a buffer to write the data to | |
899 + * @param gotlen pointer to the number of bytes actually written | |
900 + * to data | |
901 + * @return LIBMTP_HANDLER_RETURN_OK if successful, | |
902 + * LIBMTP_HANDLER_RETURN_ERROR on error or | |
903 + * LIBMTP_HANDLER_RETURN_CANCEL to cancel the transfer | |
904 + */ | |
905 +typedef uint16_t (* MTPDataGetFunc) (void* params, void* priv, | |
906 + uint32_t wantlen, unsigned char *data, u
int32_t *gotlen); | |
907 + | |
908 +/** | |
909 + * Callback function for put by handler function | |
910 + * @param params the device parameters | |
911 + * @param priv a user-defined dereferencable pointer | |
912 + * @param sendlen the number of bytes available | |
913 + * @param data a buffer to read the data from | |
914 + * @param putlen pointer to the number of bytes actually read | |
915 + * from data | |
916 + * @return LIBMTP_HANDLER_RETURN_OK if successful, | |
917 + * LIBMTP_HANDLER_RETURN_ERROR on error or | |
918 + * LIBMTP_HANDLER_RETURN_CANCEL to cancel the transfer | |
919 + */ | |
920 +typedef uint16_t (* MTPDataPutFunc) (void* params, void* priv, | |
921 + uint32_t sendlen, unsigned char *data, u
int32_t *putlen); | |
922 + | |
923 +/** | |
924 + * The return codes for the get/put functions | |
925 + */ | |
926 +#define LIBMTP_HANDLER_RETURN_OK 0 | |
927 +#define LIBMTP_HANDLER_RETURN_ERROR 1 | |
928 +#define LIBMTP_HANDLER_RETURN_CANCEL 2 | |
929 + | |
930 +/** | |
931 + * @} | |
932 + * @defgroup structar libmtp data structures | |
933 + * @{ | |
934 + */ | |
935 + | |
936 +/** | |
937 + * A data structure to hold MTP device entries. | |
938 + */ | |
939 +struct LIBMTP_device_entry_struct { | |
940 + char *vendor; /**< The vendor of this device */ | |
941 + uint16_t vendor_id; /**< Vendor ID for this device */ | |
942 + char *product; /**< The product name of this device */ | |
943 + uint16_t product_id; /**< Product ID for this device */ | |
944 + uint32_t device_flags; /**< Bugs, device specifics etc */ | |
945 +}; | |
946 + | |
947 +/** | |
948 + * A data structure to hold a raw MTP device connected | |
949 + * to the bus. | |
950 + */ | |
951 +struct LIBMTP_raw_device_struct { | |
952 + LIBMTP_device_entry_t device_entry; /**< The device entry for this raw device
*/ | |
953 + uint32_t bus_location; /**< Location of the bus, if device available */ | |
954 + uint8_t devnum; /**< Device number on the bus, if device available */ | |
955 +}; | |
956 + | |
957 +/** | |
958 + * A data structure to hold errors from the library. | |
959 + */ | |
960 +struct LIBMTP_error_struct { | |
961 + LIBMTP_error_number_t errornumber; | |
962 + char *error_text; | |
963 + LIBMTP_error_t *next; | |
964 +}; | |
965 + | |
966 +/** | |
967 + * A data structure to hold allowed ranges of values | |
968 + */ | |
969 +struct LIBMTP_allowed_values_struct { | |
970 + uint8_t u8max; | |
971 + uint8_t u8min; | |
972 + uint8_t u8step; | |
973 + uint8_t* u8vals; | |
974 + int8_t i8max; | |
975 + int8_t i8min; | |
976 + int8_t i8step; | |
977 + int8_t* i8vals; | |
978 + uint16_t u16max; | |
979 + uint16_t u16min; | |
980 + uint16_t u16step; | |
981 + uint16_t* u16vals; | |
982 + int16_t i16max; | |
983 + int16_t i16min; | |
984 + int16_t i16step; | |
985 + int16_t* i16vals; | |
986 + uint32_t u32max; | |
987 + uint32_t u32min; | |
988 + uint32_t u32step; | |
989 + uint32_t* u32vals; | |
990 + int32_t i32max; | |
991 + int32_t i32min; | |
992 + int32_t i32step; | |
993 + int32_t* i32vals; | |
994 + uint64_t u64max; | |
995 + uint64_t u64min; | |
996 + uint64_t u64step; | |
997 + uint64_t* u64vals; | |
998 + int64_t i64max; | |
999 + int64_t i64min; | |
1000 + int64_t i64step; | |
1001 + int64_t* i64vals; | |
1002 + /** | |
1003 + * Number of entries in the vals array | |
1004 + */ | |
1005 + uint16_t num_entries; | |
1006 + /** | |
1007 + * The datatype specifying which of the above is used | |
1008 + */ | |
1009 + LIBMTP_datatype_t datatype; | |
1010 + /** | |
1011 + * Non zero for range, 0 for enum | |
1012 + */ | |
1013 + int is_range; | |
1014 +}; | |
1015 + | |
1016 +/** | |
1017 + * MTP device extension holder struct | |
1018 + */ | |
1019 +struct LIBMTP_device_extension_struct { | |
1020 + /** | |
1021 + * Name of extension e.g. "foo.com" | |
1022 + */ | |
1023 + char *name; | |
1024 + /** | |
1025 + * Major revision of extension | |
1026 + */ | |
1027 + int major; | |
1028 + /** | |
1029 + * Minor revision of extension | |
1030 + */ | |
1031 + int minor; | |
1032 + /** | |
1033 + * Pointer to the next extension or NULL if this is the | |
1034 + * last extension. | |
1035 + */ | |
1036 + LIBMTP_device_extension_t *next; | |
1037 +}; | |
1038 + | |
1039 +/** | |
1040 + * Main MTP device object struct | |
1041 + */ | |
1042 +struct LIBMTP_mtpdevice_struct { | |
1043 + /** | |
1044 + * Object bitsize, typically 32 or 64. | |
1045 + */ | |
1046 + uint8_t object_bitsize; | |
1047 + /** | |
1048 + * Parameters for this device, must be cast into | |
1049 + * \c (PTPParams*) before internal use. | |
1050 + */ | |
1051 + void *params; | |
1052 + /** | |
1053 + * USB device for this device, must be cast into | |
1054 + * \c (PTP_USB*) before internal use. | |
1055 + */ | |
1056 + void *usbinfo; | |
1057 + /** | |
1058 + * The storage for this device, do not use strings in here without | |
1059 + * copying them first, and beware that this list may be rebuilt at | |
1060 + * any time. | |
1061 + * @see LIBMTP_Get_Storage() | |
1062 + */ | |
1063 + LIBMTP_devicestorage_t *storage; | |
1064 + /** | |
1065 + * The error stack. This shall be handled using the error getting | |
1066 + * and clearing functions, not by dereferencing this list. | |
1067 + */ | |
1068 + LIBMTP_error_t *errorstack; | |
1069 + /** The maximum battery level for this device */ | |
1070 + uint8_t maximum_battery_level; | |
1071 + /** Default music folder */ | |
1072 + uint32_t default_music_folder; | |
1073 + /** Default playlist folder */ | |
1074 + uint32_t default_playlist_folder; | |
1075 + /** Default picture folder */ | |
1076 + uint32_t default_picture_folder; | |
1077 + /** Default video folder */ | |
1078 + uint32_t default_video_folder; | |
1079 + /** Default organizer folder */ | |
1080 + uint32_t default_organizer_folder; | |
1081 + /** Default ZENcast folder (only Creative devices...) */ | |
1082 + uint32_t default_zencast_folder; | |
1083 + /** Default Album folder */ | |
1084 + uint32_t default_album_folder; | |
1085 + /** Default Text folder */ | |
1086 + uint32_t default_text_folder; | |
1087 + /** Per device iconv() converters, only used internally */ | |
1088 + void *cd; | |
1089 + /** Extension list */ | |
1090 + LIBMTP_device_extension_t *extensions; | |
1091 + /** Whether the device uses caching, only used internally */ | |
1092 + int cached; | |
1093 + | |
1094 + /** Pointer to next device in linked list; NULL if this is the last device */ | |
1095 + LIBMTP_mtpdevice_t *next; | |
1096 +}; | |
1097 + | |
1098 +/** | |
1099 + * MTP file struct | |
1100 + */ | |
1101 +struct LIBMTP_file_struct { | |
1102 + uint32_t item_id; /**< Unique item ID */ | |
1103 + uint32_t parent_id; /**< ID of parent folder */ | |
1104 + uint32_t storage_id; /**< ID of storage holding this file */ | |
1105 + char *filename; /**< Filename of this file */ | |
1106 + uint64_t filesize; /**< Size of file in bytes */ | |
1107 + time_t modificationdate; /**< Date of last alteration of the file */ | |
1108 + LIBMTP_filetype_t filetype; /**< Filetype used for the current file */ | |
1109 + LIBMTP_file_t *next; /**< Next file in list or NULL if last file */ | |
1110 +}; | |
1111 + | |
1112 +/** | |
1113 + * MTP track struct | |
1114 + */ | |
1115 +struct LIBMTP_track_struct { | |
1116 + uint32_t item_id; /**< Unique item ID */ | |
1117 + uint32_t parent_id; /**< ID of parent folder */ | |
1118 + uint32_t storage_id; /**< ID of storage holding this track */ | |
1119 + char *title; /**< Track title */ | |
1120 + char *artist; /**< Name of recording artist */ | |
1121 + char *composer; /**< Name of recording composer */ | |
1122 + char *genre; /**< Genre name for track */ | |
1123 + char *album; /**< Album name for track */ | |
1124 + char *date; /**< Date of original recording as a string */ | |
1125 + char *filename; /**< Original filename of this track */ | |
1126 + uint16_t tracknumber; /**< Track number (in sequence on recording) */ | |
1127 + uint32_t duration; /**< Duration in milliseconds */ | |
1128 + uint32_t samplerate; /**< Sample rate of original file, min 0x1f80 max 0xbb80
*/ | |
1129 + uint16_t nochannels; /**< Number of channels in this recording 0 = unknown, 1
or 2 */ | |
1130 + uint32_t wavecodec; /**< FourCC wave codec name */ | |
1131 + uint32_t bitrate; /**< (Average) bitrate for this file min=1 max=0x16e360 */ | |
1132 + uint16_t bitratetype; /**< 0 = unused, 1 = constant, 2 = VBR, 3 = free */ | |
1133 + uint16_t rating; /**< User rating 0-100 (0x00-0x64) */ | |
1134 + uint32_t usecount; /**< Number of times used/played */ | |
1135 + uint64_t filesize; /**< Size of track file in bytes */ | |
1136 + time_t modificationdate; /**< Date of last alteration of the track */ | |
1137 + LIBMTP_filetype_t filetype; /**< Filetype used for the current track */ | |
1138 + LIBMTP_track_t *next; /**< Next track in list or NULL if last track */ | |
1139 +}; | |
1140 + | |
1141 +/** | |
1142 + * MTP Playlist structure | |
1143 + */ | |
1144 +struct LIBMTP_playlist_struct { | |
1145 + uint32_t playlist_id; /**< Unique playlist ID */ | |
1146 + uint32_t parent_id; /**< ID of parent folder */ | |
1147 + uint32_t storage_id; /**< ID of storage holding this playlist */ | |
1148 + char *name; /**< Name of playlist */ | |
1149 + uint32_t *tracks; /**< The tracks in this playlist */ | |
1150 + uint32_t no_tracks; /**< The number of tracks in this playlist */ | |
1151 + LIBMTP_playlist_t *next; /**< Next playlist or NULL if last playlist */ | |
1152 +}; | |
1153 + | |
1154 +/** | |
1155 + * MTP Album structure | |
1156 + */ | |
1157 +struct LIBMTP_album_struct { | |
1158 + uint32_t album_id; /**< Unique playlist ID */ | |
1159 + uint32_t parent_id; /**< ID of parent folder */ | |
1160 + uint32_t storage_id; /**< ID of storage holding this album */ | |
1161 + char *name; /**< Name of album */ | |
1162 + char *artist; /**< Name of album artist */ | |
1163 + char *composer; /**< Name of recording composer */ | |
1164 + char *genre; /**< Genre of album */ | |
1165 + uint32_t *tracks; /**< The tracks in this album */ | |
1166 + uint32_t no_tracks; /**< The number of tracks in this album */ | |
1167 + LIBMTP_album_t *next; /**< Next album or NULL if last album */ | |
1168 +}; | |
1169 + | |
1170 +/** | |
1171 + * MTP Folder structure | |
1172 + */ | |
1173 +struct LIBMTP_folder_struct { | |
1174 + uint32_t folder_id; /**< Unique folder ID */ | |
1175 + uint32_t parent_id; /**< ID of parent folder */ | |
1176 + uint32_t storage_id; /**< ID of storage holding this folder */ | |
1177 + char *name; /**< Name of folder */ | |
1178 + LIBMTP_folder_t *sibling; /**< Next folder at same level or NULL if no more *
/ | |
1179 + LIBMTP_folder_t *child; /**< Child folder or NULL if no children */ | |
1180 +}; | |
1181 + | |
1182 +/** | |
1183 + * LIBMTP Object RepresentativeSampleData Structure | |
1184 + */ | |
1185 +struct LIBMTP_filesampledata_struct { | |
1186 + uint32_t width; /**< Width of sample if it is an image */ | |
1187 + uint32_t height; /**< Height of sample if it is an image */ | |
1188 + uint32_t duration; /**< Duration in milliseconds if it is audio */ | |
1189 + LIBMTP_filetype_t filetype; /**< Filetype used for the sample */ | |
1190 + uint64_t size; /**< Size of sample data in bytes */ | |
1191 + char *data; /**< Sample data */ | |
1192 +}; | |
1193 + | |
1194 +/** | |
1195 + * LIBMTP Device Storage structure | |
1196 + */ | |
1197 +struct LIBMTP_devicestorage_struct { | |
1198 + uint32_t id; /**< Unique ID for this storage */ | |
1199 + uint16_t StorageType; /**< Storage type */ | |
1200 + uint16_t FilesystemType; /**< Filesystem type */ | |
1201 + uint16_t AccessCapability; /**< Access capability */ | |
1202 + uint64_t MaxCapacity; /**< Maximum capability */ | |
1203 + uint64_t FreeSpaceInBytes; /**< Free space in bytes */ | |
1204 + uint64_t FreeSpaceInObjects; /**< Free space in objects */ | |
1205 + char *StorageDescription; /**< A brief description of this storage */ | |
1206 + char *VolumeIdentifier; /**< A volume identifier */ | |
1207 + LIBMTP_devicestorage_t *next; /**< Next storage, follow this link until NULL
*/ | |
1208 + LIBMTP_devicestorage_t *prev; /**< Previous storage */ | |
1209 +}; | |
1210 + | |
1211 +/** | |
1212 + * LIBMTP Event structure | |
1213 + * TODO: add all externally visible events here | |
1214 + */ | |
1215 +enum LIBMTP_event_enum { | |
1216 + LIBMTP_EVENT_NONE, | |
1217 + LIBMTP_EVENT_STORE_ADDED, | |
1218 +}; | |
1219 +typedef enum LIBMTP_event_enum LIBMTP_event_t; | |
1220 + | |
1221 +/** @} */ | |
1222 + | |
1223 +/* Make functions available for C++ */ | |
1224 +#ifdef __cplusplus | |
1225 +extern "C" { | |
1226 +#endif | |
1227 + | |
1228 +extern int LIBMTP_debug; | |
1229 + | |
1230 +/** | |
1231 + * @defgroup internals The libmtp internals API. | |
1232 + * @{ | |
1233 + */ | |
1234 +void LIBMTP_Set_Debug(int); | |
1235 +void LIBMTP_Init(void); | |
1236 +int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * con
st); | |
1237 +/** | |
1238 + * @} | |
1239 + * @defgroup basic The basic device management API. | |
1240 + * @{ | |
1241 + */ | |
1242 +LIBMTP_error_number_t LIBMTP_Detect_Raw_Devices(LIBMTP_raw_device_t **, int *); | |
1243 +int LIBMTP_Check_Specific_Device(int busno, int devno); | |
1244 +LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device(LIBMTP_raw_device_t *); | |
1245 +LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device_Uncached(LIBMTP_raw_device_t *); | |
1246 +/* Begin old, legacy interface */ | |
1247 +LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void); | |
1248 +LIBMTP_error_number_t LIBMTP_Get_Connected_Devices(LIBMTP_mtpdevice_t **); | |
1249 +uint32_t LIBMTP_Number_Devices_In_List(LIBMTP_mtpdevice_t *); | |
1250 +void LIBMTP_Release_Device_List(LIBMTP_mtpdevice_t*); | |
1251 +/* End old, legacy interface */ | |
1252 +void LIBMTP_Release_Device(LIBMTP_mtpdevice_t*); | |
1253 +void LIBMTP_Dump_Device_Info(LIBMTP_mtpdevice_t*); | |
1254 +int LIBMTP_Reset_Device(LIBMTP_mtpdevice_t*); | |
1255 +char *LIBMTP_Get_Manufacturername(LIBMTP_mtpdevice_t*); | |
1256 +char *LIBMTP_Get_Modelname(LIBMTP_mtpdevice_t*); | |
1257 +char *LIBMTP_Get_Serialnumber(LIBMTP_mtpdevice_t*); | |
1258 +char *LIBMTP_Get_Deviceversion(LIBMTP_mtpdevice_t*); | |
1259 +char *LIBMTP_Get_Friendlyname(LIBMTP_mtpdevice_t*); | |
1260 +int LIBMTP_Set_Friendlyname(LIBMTP_mtpdevice_t*, char const * const); | |
1261 +char *LIBMTP_Get_Syncpartner(LIBMTP_mtpdevice_t*); | |
1262 +int LIBMTP_Set_Syncpartner(LIBMTP_mtpdevice_t*, char const * const); | |
1263 +int LIBMTP_Get_Batterylevel(LIBMTP_mtpdevice_t *, | |
1264 + uint8_t * const, | |
1265 + uint8_t * const); | |
1266 +int LIBMTP_Get_Secure_Time(LIBMTP_mtpdevice_t *, char ** const); | |
1267 +int LIBMTP_Get_Device_Certificate(LIBMTP_mtpdevice_t *, char ** const); | |
1268 +int LIBMTP_Get_Supported_Filetypes(LIBMTP_mtpdevice_t *, uint16_t ** const, uin
t16_t * const); | |
1269 +LIBMTP_error_t *LIBMTP_Get_Errorstack(LIBMTP_mtpdevice_t*); | |
1270 +void LIBMTP_Clear_Errorstack(LIBMTP_mtpdevice_t*); | |
1271 +void LIBMTP_Dump_Errorstack(LIBMTP_mtpdevice_t*); | |
1272 + | |
1273 +#define LIBMTP_STORAGE_SORTBY_NOTSORTED 0 | |
1274 +#define LIBMTP_STORAGE_SORTBY_FREESPACE 1 | |
1275 +#define LIBMTP_STORAGE_SORTBY_MAXSPACE 2 | |
1276 + | |
1277 +int LIBMTP_Get_Storage(LIBMTP_mtpdevice_t *, int const); | |
1278 +int LIBMTP_Format_Storage(LIBMTP_mtpdevice_t *, LIBMTP_devicestorage_t *); | |
1279 + | |
1280 +/** | |
1281 + * Get/set arbitrary properties. These do not update the cache; should only be
used on | |
1282 + * properties not stored in structs | |
1283 + */ | |
1284 +char *LIBMTP_Get_String_From_Object(LIBMTP_mtpdevice_t *, uint32_t const, LIBMT
P_property_t const); | |
1285 +uint64_t LIBMTP_Get_u64_From_Object(LIBMTP_mtpdevice_t *, uint32_t const, | |
1286 + LIBMTP_property_t const, uint64_t const); | |
1287 +uint32_t LIBMTP_Get_u32_From_Object(LIBMTP_mtpdevice_t *, uint32_t const, | |
1288 + LIBMTP_property_t const, uint32_t const); | |
1289 +uint16_t LIBMTP_Get_u16_From_Object(LIBMTP_mtpdevice_t *, uint32_t const, | |
1290 + LIBMTP_property_t const, uint16_t const); | |
1291 +uint8_t LIBMTP_Get_u8_From_Object(LIBMTP_mtpdevice_t *, uint32_t const, | |
1292 + LIBMTP_property_t const, uint8_t const); | |
1293 +int LIBMTP_Set_Object_String(LIBMTP_mtpdevice_t *, uint32_t const, | |
1294 + LIBMTP_property_t const, char const * const); | |
1295 +int LIBMTP_Set_Object_u32(LIBMTP_mtpdevice_t *, uint32_t const, | |
1296 + LIBMTP_property_t const, uint32_t const); | |
1297 +int LIBMTP_Set_Object_u16(LIBMTP_mtpdevice_t *, uint32_t const, | |
1298 + LIBMTP_property_t const, uint16_t const); | |
1299 +int LIBMTP_Set_Object_u8(LIBMTP_mtpdevice_t *, uint32_t const, | |
1300 + LIBMTP_property_t const, uint8_t const); | |
1301 +char const * LIBMTP_Get_Property_Description(LIBMTP_property_t inproperty); | |
1302 +int LIBMTP_Is_Property_Supported(LIBMTP_mtpdevice_t*, LIBMTP_property_t const, | |
1303 + LIBMTP_filetype_t const); | |
1304 +int LIBMTP_Get_Allowed_Property_Values(LIBMTP_mtpdevice_t*, LIBMTP_property_t c
onst, | |
1305 + LIBMTP_filetype_t const, LIBMTP_allowed_values_t*); | |
1306 +void LIBMTP_destroy_allowed_values_t(LIBMTP_allowed_values_t*); | |
1307 + | |
1308 +/** | |
1309 + * @} | |
1310 + * @defgroup files The file management API. | |
1311 + * @{ | |
1312 + */ | |
1313 +LIBMTP_file_t *LIBMTP_new_file_t(void); | |
1314 +void LIBMTP_destroy_file_t(LIBMTP_file_t*); | |
1315 +char const * LIBMTP_Get_Filetype_Description(LIBMTP_filetype_t); | |
1316 +LIBMTP_file_t *LIBMTP_Get_Filelisting(LIBMTP_mtpdevice_t *); | |
1317 +LIBMTP_file_t *LIBMTP_Get_Filelisting_With_Callback(LIBMTP_mtpdevice_t *, | |
1318 + LIBMTP_progressfunc_t const, void const * const); | |
1319 +LIBMTP_file_t * LIBMTP_Get_Files_And_Folders(LIBMTP_mtpdevice_t *, | |
1320 + uint32_t const, | |
1321 + uint32_t const); | |
1322 +LIBMTP_file_t *LIBMTP_Get_Filemetadata(LIBMTP_mtpdevice_t *, uint32_t const); | |
1323 +int LIBMTP_Get_File_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * const, | |
1324 + LIBMTP_progressfunc_t const, void const * const); | |
1325 +int LIBMTP_Get_File_To_File_Descriptor(LIBMTP_mtpdevice_t*, | |
1326 + uint32_t const, | |
1327 + int const, | |
1328 + LIBMTP_progressfunc_t const, | |
1329 + void const * const); | |
1330 +int LIBMTP_Get_File_To_Handler(LIBMTP_mtpdevice_t *, | |
1331 + uint32_t const, | |
1332 + MTPDataPutFunc, | |
1333 + void *, | |
1334 + LIBMTP_progressfunc_t const, | |
1335 + void const * const); | |
1336 +int LIBMTP_Send_File_From_File(LIBMTP_mtpdevice_t *, | |
1337 + char const * const, | |
1338 + LIBMTP_file_t * const, | |
1339 + LIBMTP_progressfunc_t const, | |
1340 + void const * const); | |
1341 +int LIBMTP_Send_File_From_File_Descriptor(LIBMTP_mtpdevice_t *, | |
1342 + int const, | |
1343 + LIBMTP_file_t * const, | |
1344 + LIBMTP_progressfunc_t const, | |
1345 + void const * const); | |
1346 +int LIBMTP_Send_File_From_Handler(LIBMTP_mtpdevice_t *, | |
1347 + MTPDataGetFunc, void *, | |
1348 + LIBMTP_file_t * const, | |
1349 + LIBMTP_progressfunc_t const, | |
1350 + void const * const); | |
1351 +int LIBMTP_Set_File_Name(LIBMTP_mtpdevice_t *, | |
1352 + LIBMTP_file_t *, | |
1353 + const char *); | |
1354 +LIBMTP_filesampledata_t *LIBMTP_new_filesampledata_t(void); | |
1355 +void LIBMTP_destroy_filesampledata_t(LIBMTP_filesampledata_t *); | |
1356 +int LIBMTP_Get_Representative_Sample_Format(LIBMTP_mtpdevice_t *, | |
1357 + LIBMTP_filetype_t const, | |
1358 + LIBMTP_filesampledata_t **); | |
1359 +int LIBMTP_Send_Representative_Sample(LIBMTP_mtpdevice_t *, uint32_t const, | |
1360 + LIBMTP_filesampledata_t *); | |
1361 +int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *, uint32_t const, | |
1362 + LIBMTP_filesampledata_t *); | |
1363 +int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const, | |
1364 + unsigned char **data, unsigned int *size); | |
1365 + | |
1366 +/** | |
1367 + * @} | |
1368 + * @defgroup tracks The track management API. | |
1369 + * @{ | |
1370 + */ | |
1371 +LIBMTP_track_t *LIBMTP_new_track_t(void); | |
1372 +void LIBMTP_destroy_track_t(LIBMTP_track_t*); | |
1373 +LIBMTP_track_t *LIBMTP_Get_Tracklisting(LIBMTP_mtpdevice_t*); | |
1374 +LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback(LIBMTP_mtpdevice_t*, | |
1375 + LIBMTP_progressfunc_t const, void const * const); | |
1376 +LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback_For_Storage(LIBMTP_mtpdev
ice_t*, uint32_t const, | |
1377 + LIBMTP_progressfunc_t const, void const * const); | |
1378 +LIBMTP_track_t *LIBMTP_Get_Trackmetadata(LIBMTP_mtpdevice_t*, uint32_t const); | |
1379 +int LIBMTP_Get_Track_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * const, | |
1380 + LIBMTP_progressfunc_t const, void const * const); | |
1381 +int LIBMTP_Get_Track_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const, in
t const, | |
1382 + LIBMTP_progressfunc_t const, void const * const); | |
1383 +int LIBMTP_Get_Track_To_Handler(LIBMTP_mtpdevice_t *, uint32_t const, MTPDataPu
tFunc, | |
1384 + void *, LIBMTP_progressfunc_t const, void const * const); | |
1385 +int LIBMTP_Send_Track_From_File(LIBMTP_mtpdevice_t *, | |
1386 + char const * const, LIBMTP_track_t * const, | |
1387 + LIBMTP_progressfunc_t const, | |
1388 + void const * const); | |
1389 +int LIBMTP_Send_Track_From_File_Descriptor(LIBMTP_mtpdevice_t *, | |
1390 + int const, LIBMTP_track_t * const, | |
1391 + LIBMTP_progressfunc_t const, | |
1392 + void const * const); | |
1393 +int LIBMTP_Send_Track_From_Handler(LIBMTP_mtpdevice_t *, | |
1394 + MTPDataGetFunc, void *, LIBMTP_track_t * const, | |
1395 + LIBMTP_progressfunc_t const, | |
1396 + void const * const); | |
1397 +int LIBMTP_Update_Track_Metadata(LIBMTP_mtpdevice_t *, | |
1398 + LIBMTP_track_t const * const); | |
1399 +int LIBMTP_Track_Exists(LIBMTP_mtpdevice_t *, uint32_t const); | |
1400 +int LIBMTP_Set_Track_Name(LIBMTP_mtpdevice_t *, LIBMTP_track_t *, const char *)
; | |
1401 +/** @} */ | |
1402 + | |
1403 +/** | |
1404 + * @} | |
1405 + * @defgroup folders The folder management API. | |
1406 + * @{ | |
1407 + */ | |
1408 +LIBMTP_folder_t *LIBMTP_new_folder_t(void); | |
1409 +void LIBMTP_destroy_folder_t(LIBMTP_folder_t*); | |
1410 +LIBMTP_folder_t *LIBMTP_Get_Folder_List(LIBMTP_mtpdevice_t*); | |
1411 +LIBMTP_folder_t *LIBMTP_Get_Folder_List_For_Storage(LIBMTP_mtpdevice_t*, | |
1412 + uint32_t const); | |
1413 +LIBMTP_folder_t *LIBMTP_Find_Folder(LIBMTP_folder_t*, uint32_t const); | |
1414 +uint32_t LIBMTP_Create_Folder(LIBMTP_mtpdevice_t*, char *, uint32_t, uint32_t); | |
1415 +int LIBMTP_Set_Folder_Name(LIBMTP_mtpdevice_t *, LIBMTP_folder_t *, const char
*); | |
1416 +/** @} */ | |
1417 + | |
1418 +#if 0 | |
1419 +/** | |
1420 + * @} | |
1421 + * @defgroup playlists The audio/video playlist management API. | |
1422 + * @{ | |
1423 + */ | |
1424 +LIBMTP_playlist_t *LIBMTP_new_playlist_t(void); | |
1425 +void LIBMTP_destroy_playlist_t(LIBMTP_playlist_t *); | |
1426 +LIBMTP_playlist_t *LIBMTP_Get_Playlist_List(LIBMTP_mtpdevice_t *); | |
1427 +LIBMTP_playlist_t *LIBMTP_Get_Playlist(LIBMTP_mtpdevice_t *, uint32_t const); | |
1428 +int LIBMTP_Create_New_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t * const)
; | |
1429 +int LIBMTP_Update_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t * const); | |
1430 +int LIBMTP_Set_Playlist_Name(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *, const c
har *); | |
1431 +#endif | |
1432 + | |
1433 +/** | |
1434 + * @} | |
1435 + * @defgroup albums The audio/video album management API. | |
1436 + * @{ | |
1437 + */ | |
1438 +LIBMTP_album_t *LIBMTP_new_album_t(void); | |
1439 +void LIBMTP_destroy_album_t(LIBMTP_album_t *); | |
1440 +LIBMTP_album_t *LIBMTP_Get_Album_List(LIBMTP_mtpdevice_t *); | |
1441 +LIBMTP_album_t *LIBMTP_Get_Album_List_For_Storage(LIBMTP_mtpdevice_t *, uint32_
t const); | |
1442 +LIBMTP_album_t *LIBMTP_Get_Album(LIBMTP_mtpdevice_t *, uint32_t const); | |
1443 +int LIBMTP_Create_New_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t * const); | |
1444 +int LIBMTP_Update_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t const * const); | |
1445 +int LIBMTP_Set_Album_Name(LIBMTP_mtpdevice_t *, LIBMTP_album_t *, const char *)
; | |
1446 + | |
1447 +/** | |
1448 + * @} | |
1449 + * @defgroup objects The object management API. | |
1450 + * @{ | |
1451 + */ | |
1452 +int LIBMTP_Delete_Object(LIBMTP_mtpdevice_t *, uint32_t); | |
1453 +int LIBMTP_Set_Object_Filename(LIBMTP_mtpdevice_t *, uint32_t , char *); | |
1454 + | |
1455 +/** | |
1456 + * @} | |
1457 + * @defgroup files The events API. | |
1458 + * @{ | |
1459 + */ | |
1460 +int LIBMTP_Read_Event(LIBMTP_mtpdevice_t *, LIBMTP_event_t *, uint32_t *); | |
1461 + | |
1462 + | |
1463 +/** @} */ | |
1464 + | |
1465 +/* End of C++ exports */ | |
1466 +#ifdef __cplusplus | |
1467 +} | |
1468 +#endif | |
1469 + | |
1470 +#endif /* LIBMTP_H_INCLUSION_GUARD */ | |
1471 | |
1472 Property changes on: src/libmtp.h | |
1473 ___________________________________________________________________ | |
1474 Added: svn:eol-style | |
1475 + LF | |
1476 | |
1477 Index: src/_stdint.h | |
1478 =================================================================== | |
1479 --- src/_stdint.h (revision 0) | |
1480 +++ src/_stdint.h (revision 0) | |
1481 @@ -0,0 +1,2 @@ | |
1482 +/* This file is generated automatically by configure */ | |
1483 +#include <stdint.h> | |
1484 | |
1485 Property changes on: src/_stdint.h | |
1486 ___________________________________________________________________ | |
1487 Added: svn:eol-style | |
1488 + LF | |
1489 | |
OLD | NEW |