~ubuntu-branches/ubuntu/karmic/libmtp/karmic

« back to all changes in this revision

Viewing changes to src/libmtp.h

  • Committer: Bazaar Package Importer
  • Author(s): Savvas Radevic, Savvas Radevic, Flávio Martins
  • Date: 2009-04-18 19:58:14 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090418195814-lbizx2w4c0mgknc8
Tags: 0.3.7-3ubuntu1
[ Savvas Radevic ]
* Merge from debian unstable, remaining changes:
  + debian/control: Add Breaks to ensure the right udev version gets used.
  + debian/libmtp.install.in, debian/libmtp.preinst.in, 
    debian/libmtp.postinst.in: Clean up the mess where files were still 
    going into the wrong directory.
* debian/libmtp.preinst.in: Dropped check on unsupported 0.2.5-1 (hardy has 
  0.2.6.1-2ubuntu1)

[ Flávio Martins ]
* debian/rules: Append proper prefix 45- to libmtp rules in UDEV variable
* debian/libmtp.install.in: ../../45-libmtp@SOVERSION@.rules lib/udev/rules.d

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifndef LIBMTP_H_INCLUSION_GUARD
30
30
#define LIBMTP_H_INCLUSION_GUARD
31
31
 
32
 
#define LIBMTP_VERSION 0.3.0
33
 
#define LIBMTP_VERSION_STRING "0.3.0"
 
32
#define LIBMTP_VERSION 0.3.7
 
33
#define LIBMTP_VERSION_STRING "0.3.7"
34
34
 
35
35
/* This handles MSVC pecularities */
36
36
#ifdef _MSC_VER
38
38
#define __WIN32__
39
39
#define snprintf _snprintf
40
40
#define ssize_t SSIZE_T
41
 
#endif
42
 
 
43
 
#include <stdio.h>
44
 
#include <usb.h>
45
 
#include <stdint.h>
46
 
 
47
 
#ifdef __WIN32__
48
41
/*
49
 
 * Windows specific code, types that do not exist in Windows
50
 
 * sys/types.h
 
42
 * Types that do not exist in Windows
 
43
 * sys/types.h, but they exist in mingw32
 
44
 * sys/types.h.
51
45
 */
52
46
typedef char int8_t;
53
47
typedef unsigned char uint8_t;
58
52
typedef unsigned __int64 uint64_t;
59
53
#endif
60
54
 
 
55
#include <stdio.h>
 
56
#include <usb.h>
 
57
#include <stdint.h>
 
58
 
61
59
/**
62
60
 * @defgroup types libmtp global type definitions
63
61
 * @{
111
109
} LIBMTP_filetype_t;
112
110
 
113
111
/**
114
 
 * Helpful macros to determine filetype properties
 
112
 * \def LIBMTP_FILETYPE_IS_AUDIO
 
113
 * Audio filetype test.
 
114
 *
 
115
 * For filetypes that can be either audio
 
116
 * or video, use LIBMTP_FILETYPE_IS_AUDIOVIDEO
115
117
 */
116
118
#define LIBMTP_FILETYPE_IS_AUDIO(a)\
117
119
(a == LIBMTP_FILETYPE_WAV ||\
123
125
 a == LIBMTP_FILETYPE_AAC ||\
124
126
 a == LIBMTP_FILETYPE_M4A ||\
125
127
 a == LIBMTP_FILETYPE_UNDEF_AUDIO)
 
128
 
 
129
/**
 
130
 *  \def LIBMTP_FILETYPE_IS_VIDEO
 
131
 *  Video filetype test.
 
132
 *
 
133
 * For filetypes that can be either audio
 
134
 * or video, use LIBMTP_FILETYPE_IS_AUDIOVIDEO
 
135
 */
126
136
#define LIBMTP_FILETYPE_IS_VIDEO(a)\
127
137
(a == LIBMTP_FILETYPE_WMV ||\
128
138
 a == LIBMTP_FILETYPE_AVI ||\
129
139
 a == LIBMTP_FILETYPE_MPEG ||\
130
140
 a == LIBMTP_FILETYPE_UNDEF_VIDEO)
 
141
 
 
142
/**
 
143
 *  \def LIBMTP_FILETYPE_IS_AUDIOVIDEO
 
144
 *  Audio and&slash;or video filetype test.
 
145
 */
131
146
#define LIBMTP_FILETYPE_IS_AUDIOVIDEO(a)\
132
147
(a == LIBMTP_FILETYPE_MP4 ||\
133
148
 a == LIBMTP_FILETYPE_ASF ||\
134
149
 a == LIBMTP_FILETYPE_QT)
 
150
 
 
151
/**
 
152
 *  \def LIBMTP_FILETYPE_IS_TRACK
 
153
 *  Test if filetype is a track.
 
154
 *  Use this to determine if the File API or Track API
 
155
 *  should be used to upload or download an object.
 
156
 */
135
157
#define LIBMTP_FILETYPE_IS_TRACK(a)\
136
158
(LIBMTP_FILETYPE_IS_AUDIO(a) ||\
137
159
 LIBMTP_FILETYPE_IS_VIDEO(a) ||\
138
160
 LIBMTP_FILETYPE_IS_AUDIOVIDEO(a))
139
161
 
140
162
/**
 
163
 *  \def LIBMTP_FILETYPE_IS_IMAGE
 
164
 *  Image filetype test
 
165
 */
 
166
#define LIBMTP_FILETYPE_IS_IMAGE(a)\
 
167
(a == LIBMTP_FILETYPE_JPEG ||\
 
168
a == LIBMTP_FILETYPE_JFIF ||\
 
169
a == LIBMTP_FILETYPE_TIFF ||\
 
170
a == LIBMTP_FILETYPE_BMP ||\
 
171
a == LIBMTP_FILETYPE_GIF ||\
 
172
a == LIBMTP_FILETYPE_PICT ||\
 
173
a == LIBMTP_FILETYPE_PNG ||\
 
174
a == LIBMTP_FILETYPE_JP2 ||\
 
175
a == LIBMTP_FILETYPE_JPX ||\
 
176
a == LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT)
 
177
 
 
178
/**
 
179
 *  \def LIBMTP_FILETYPE_IS_ADDRESSBOOK
 
180
 *  Addressbook and Business card filetype test
 
181
 */
 
182
#define LIBMTP_FILETYPE_IS_ADDRESSBOOK(a)\
 
183
(a == LIBMTP_FILETYPE_VCARD2 ||\
 
184
a == LIBMTP_FILETYPE_VCARD2)
 
185
 
 
186
/**
 
187
 *  \def LIBMTP_FILETYPE_IS_CALENDAR
 
188
 *  Calendar and Appointment filetype test
 
189
 */
 
190
#define LIBMTP_FILETYPE_IS_CALENDAR(a)\
 
191
(a == LIBMTP_FILETYPE_VCALENDAR1 ||\
 
192
a == LIBMTP_FILETYPE_VCALENDAR2)
 
193
 
 
194
/**
141
195
 * These are the numbered error codes. You can also
142
196
 * get string representations for errors.
143
197
 */
458
512
int LIBMTP_Send_File_From_File_Descriptor(LIBMTP_mtpdevice_t *, int const,
459
513
                        LIBMTP_file_t * const, LIBMTP_progressfunc_t const,
460
514
                        void const * const);
 
515
int LIBMTP_Set_File_Name(LIBMTP_mtpdevice_t *, LIBMTP_file_t *, const char *);
461
516
LIBMTP_filesampledata_t *LIBMTP_new_filesampledata_t(void);
462
517
void LIBMTP_destroy_filesampledata_t(LIBMTP_filesampledata_t *);
463
518
int LIBMTP_Get_Representative_Sample_Format(LIBMTP_mtpdevice_t *,
494
549
int LIBMTP_Update_Track_Metadata(LIBMTP_mtpdevice_t *,
495
550
                        LIBMTP_track_t const * const);
496
551
int LIBMTP_Track_Exists(LIBMTP_mtpdevice_t *, uint32_t);
 
552
int LIBMTP_Set_Track_Name(LIBMTP_mtpdevice_t *, LIBMTP_track_t *, const char *);
497
553
/** @} */
498
554
 
499
555
/**
506
562
LIBMTP_folder_t *LIBMTP_Get_Folder_List(LIBMTP_mtpdevice_t*);
507
563
LIBMTP_folder_t *LIBMTP_Find_Folder(LIBMTP_folder_t*, uint32_t const);
508
564
uint32_t LIBMTP_Create_Folder(LIBMTP_mtpdevice_t*, char *, uint32_t, uint32_t);
 
565
int LIBMTP_Set_Folder_Name(LIBMTP_mtpdevice_t *, LIBMTP_folder_t *, const char *);
509
566
/** @} */
510
567
 
511
568
 
519
576
LIBMTP_playlist_t *LIBMTP_Get_Playlist_List(LIBMTP_mtpdevice_t *);
520
577
LIBMTP_playlist_t *LIBMTP_Get_Playlist(LIBMTP_mtpdevice_t *, uint32_t const);
521
578
int LIBMTP_Create_New_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t * const);
522
 
int LIBMTP_Update_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t const * const);
 
579
int LIBMTP_Update_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t * const);
 
580
int LIBMTP_Set_Playlist_Name(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *, const char *);
523
581
 
524
582
/**
525
583
 * @}
532
590
LIBMTP_album_t *LIBMTP_Get_Album(LIBMTP_mtpdevice_t *, uint32_t const);
533
591
int LIBMTP_Create_New_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t * const);
534
592
int LIBMTP_Update_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t const * const);
 
593
int LIBMTP_Set_Album_Name(LIBMTP_mtpdevice_t *, LIBMTP_album_t *, const char *);
535
594
 
536
595
/**
537
596
 * @}