libmtp.h | libmtp.h | |||
---|---|---|---|---|
skipping to change at line 13 | skipping to change at line 13 | |||
* | * | |||
* Interface to the Media Transfer Protocol library. | * Interface to the Media Transfer Protocol library. | |||
* | * | |||
* <code> | * <code> | |||
* #include <libmtp.h> | * #include <libmtp.h> | |||
* </code> | * </code> | |||
*/ | */ | |||
#ifndef LIBMTP_H_INCLUSION_GUARD | #ifndef LIBMTP_H_INCLUSION_GUARD | |||
#define LIBMTP_H_INCLUSION_GUARD | #define LIBMTP_H_INCLUSION_GUARD | |||
#define LIBMTP_VERSION 0.0.3 | #define LIBMTP_VERSION 0.0.4 | |||
/* This handles MSVC pecularities */ | /* This handles MSVC pecularities */ | |||
#ifdef _MSC_VER | #ifdef _MSC_VER | |||
#include <windows.h> | #include <windows.h> | |||
#define __WIN32__ | #define __WIN32__ | |||
#define snprintf _snprintf | #define snprintf _snprintf | |||
#define ssize_t SSIZE_T | #define ssize_t SSIZE_T | |||
#endif | #endif | |||
#include <stdio.h> | #include <stdio.h> | |||
skipping to change at line 64 | skipping to change at line 64 | |||
LIBMTP_FILETYPE_MPEG, | LIBMTP_FILETYPE_MPEG, | |||
LIBMTP_FILETYPE_ASF, | LIBMTP_FILETYPE_ASF, | |||
LIBMTP_FILETYPE_QT, | LIBMTP_FILETYPE_QT, | |||
LIBMTP_FILETYPE_UNDEF_VIDEO, | LIBMTP_FILETYPE_UNDEF_VIDEO, | |||
LIBMTP_FILETYPE_JFIF, | LIBMTP_FILETYPE_JFIF, | |||
LIBMTP_FILETYPE_TIFF, | LIBMTP_FILETYPE_TIFF, | |||
LIBMTP_FILETYPE_BMP, | LIBMTP_FILETYPE_BMP, | |||
LIBMTP_FILETYPE_GIF, | LIBMTP_FILETYPE_GIF, | |||
LIBMTP_FILETYPE_PICT, | LIBMTP_FILETYPE_PICT, | |||
LIBMTP_FILETYPE_PNG, | LIBMTP_FILETYPE_PNG, | |||
LIBMTP_FILETYPE_VCALENDAR1, | ||||
LIBMTP_FILETYPE_VCALENDAR2, | ||||
LIBMTP_FILETYPE_VCARD2, | ||||
LIBMTP_FILETYPE_VCARD3, | ||||
LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT, | ||||
LIBMTP_FILETYPE_WINEXEC, | ||||
LIBMTP_FILETYPE_TEXT, | ||||
LIBMTP_FILETYPE_HTML, | ||||
LIBMTP_FILETYPE_UNKNOWN | LIBMTP_FILETYPE_UNKNOWN | |||
} LIBMTP_filetype_t; | } LIBMTP_filetype_t; | |||
typedef struct LIBMTP_device_entry_struct LIBMTP_device_entry_t; /**< @see LIBMTP_device_entry_struct */ | typedef struct LIBMTP_device_entry_struct LIBMTP_device_entry_t; /**< @see LIBMTP_device_entry_struct */ | |||
typedef struct LIBMTP_mtpdevice_struct LIBMTP_mtpdevice_t; /**< @see LIBMTP _mtpdevice_struct */ | typedef struct LIBMTP_mtpdevice_struct LIBMTP_mtpdevice_t; /**< @see LIBMTP _mtpdevice_struct */ | |||
typedef struct LIBMTP_file_struct LIBMTP_file_t; /**< @see LIBMTP_file_stru ct */ | typedef struct LIBMTP_file_struct LIBMTP_file_t; /**< @see LIBMTP_file_stru ct */ | |||
typedef struct LIBMTP_track_struct LIBMTP_track_t; /**< @see LIBMTP_track_s truct */ | typedef struct LIBMTP_track_struct LIBMTP_track_t; /**< @see LIBMTP_track_s truct */ | |||
typedef struct LIBMTP_folder_struct LIBMTP_folder_t; /**< @see LIBMTP_mtpfo lder_t */ | typedef struct LIBMTP_folder_struct LIBMTP_folder_t; /**< @see LIBMTP_mtpfo lder_t */ | |||
/** @} */ | /** @} */ | |||
/** | /** | |||
* A data structure to hold MTP device entries | * A data structure to hold MTP device entries | |||
*/ | */ | |||
struct LIBMTP_device_entry_struct { | struct LIBMTP_device_entry_struct { | |||
char *name; /**< The descriptive name of this device */ | char *name; /**< The descriptive name of this device */ | |||
uint16_t vendor_id; /**< Vendor ID for this device */ | uint16_t vendor_id; /**< Vendor ID for this device */ | |||
uint16_t product_id; /**< Product ID for this device */ | uint16_t product_id; /**< Product ID for this device */ | |||
LIBMTP_device_entry_t *next; /**< Pointer to the next device entry or NUL L if the last one */ | ||||
}; | }; | |||
/** | /** | |||
* Main MTP device object struct | * Main MTP device object struct | |||
*/ | */ | |||
struct LIBMTP_mtpdevice_struct { | struct LIBMTP_mtpdevice_struct { | |||
/** Interface number of this device */ | /** Interface number of this device */ | |||
uint8_t interface_number; | uint8_t interface_number; | |||
/** | /** | |||
* Parameters for this device, must be cast into | * Parameters for this device, must be cast into | |||
skipping to change at line 110 | skipping to change at line 117 | |||
unsigned storage_id; | unsigned storage_id; | |||
/** The maximum battery level for this device */ | /** The maximum battery level for this device */ | |||
uint8_t maximum_battery_level; | uint8_t maximum_battery_level; | |||
}; | }; | |||
/** | /** | |||
* MTP file struct | * MTP file struct | |||
*/ | */ | |||
struct LIBMTP_file_struct { | struct LIBMTP_file_struct { | |||
uint32_t item_id; /**< Unique item ID */ | uint32_t item_id; /**< Unique item ID */ | |||
uint32_t parent_id; /**< ID of parent folder */ | ||||
char *filename; /**< Filename of this file */ | char *filename; /**< Filename of this file */ | |||
uint64_t filesize; /**< Size of file in bytes */ | uint64_t filesize; /**< Size of file in bytes */ | |||
LIBMTP_filetype_t filetype; /**< Filetype used for the current file */ | LIBMTP_filetype_t filetype; /**< Filetype used for the current file */ | |||
LIBMTP_file_t *next; /**< Next file in list or NULL if last file */ | LIBMTP_file_t *next; /**< Next file in list or NULL if last file */ | |||
}; | }; | |||
/** | /** | |||
* MTP track struct | * MTP track struct | |||
*/ | */ | |||
struct LIBMTP_track_struct { | struct LIBMTP_track_struct { | |||
skipping to change at line 176 | skipping to change at line 184 | |||
*/ | */ | |||
void LIBMTP_Init(void); | void LIBMTP_Init(void); | |||
int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const); | int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const); | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup basic The basic device management API. | * @defgroup basic The basic device management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void); | LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void); | |||
void LIBMTP_Release_Device(LIBMTP_mtpdevice_t*); | void LIBMTP_Release_Device(LIBMTP_mtpdevice_t*); | |||
void LIBMTP_Dump_Device_Info(LIBMTP_mtpdevice_t*); | ||||
char *LIBMTP_Get_Modelname(LIBMTP_mtpdevice_t*); | char *LIBMTP_Get_Modelname(LIBMTP_mtpdevice_t*); | |||
char *LIBMTP_Get_Serialnumber(LIBMTP_mtpdevice_t*); | char *LIBMTP_Get_Serialnumber(LIBMTP_mtpdevice_t*); | |||
char *LIBMTP_Get_Deviceversion(LIBMTP_mtpdevice_t*); | char *LIBMTP_Get_Deviceversion(LIBMTP_mtpdevice_t*); | |||
char *LIBMTP_Get_Ownername(LIBMTP_mtpdevice_t*); | char *LIBMTP_Get_Ownername(LIBMTP_mtpdevice_t*); | |||
int LIBMTP_Get_Storageinfo(LIBMTP_mtpdevice_t *, uint64_t * const, | int LIBMTP_Get_Storageinfo(LIBMTP_mtpdevice_t *, uint64_t * const, | |||
uint64_t * const, char ** const storage_description, | uint64_t * const, char ** const storage_description, | |||
char ** const volume_label); | char ** const volume_label); | |||
int LIBMTP_Get_Batterylevel(LIBMTP_mtpdevice_t *, | int LIBMTP_Get_Batterylevel(LIBMTP_mtpdevice_t *, | |||
uint8_t * const, | uint8_t * const, | |||
uint8_t * const); | uint8_t * const); | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup files The file management API. | * @defgroup files The file management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
LIBMTP_file_t *LIBMTP_new_file_t(void); | LIBMTP_file_t *LIBMTP_new_file_t(void); | |||
void LIBMTP_destroy_file_t(LIBMTP_file_t*); | void LIBMTP_destroy_file_t(LIBMTP_file_t*); | |||
char const * LIBMTP_Get_Filetype_Description(LIBMTP_filetype_t); | ||||
LIBMTP_file_t *LIBMTP_Get_Filelisting(LIBMTP_mtpdevice_t *device); | LIBMTP_file_t *LIBMTP_Get_Filelisting(LIBMTP_mtpdevice_t *device); | |||
int LIBMTP_Delete_File(LIBMTP_mtpdevice_t *, uint32_t); | int LIBMTP_Delete_File(LIBMTP_mtpdevice_t *, uint32_t); | |||
int LIBMTP_Get_File_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * con st, | int LIBMTP_Get_File_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * con st, | |||
LIBMTP_progressfunc_t const * const, void const * co nst); | LIBMTP_progressfunc_t const * const, void const * co nst); | |||
int LIBMTP_Get_File_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const, int const, | int LIBMTP_Get_File_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const, int const, | |||
LIBMTP_progressfunc_t const * const, void const * co nst); | LIBMTP_progressfunc_t const * const, void const * co nst); | |||
int LIBMTP_Send_File_From_File(LIBMTP_mtpdevice_t *, char const * const, | ||||
LIBMTP_file_t * const, LIBMTP_progressfunc_t const | ||||
* const, | ||||
void const * const, uint32_t const); | ||||
int LIBMTP_Send_File_From_File_Descriptor(LIBMTP_mtpdevice_t *, int const, | ||||
LIBMTP_file_t * const, LIBMTP_progressfunc_t const * | ||||
const, | ||||
void const * const, uint32_t const); | ||||
/** | /** | |||
* @} | * @} | |||
* @defgroup tracks The track management API. | * @defgroup tracks The track management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
LIBMTP_track_t *LIBMTP_new_track_t(void); | LIBMTP_track_t *LIBMTP_new_track_t(void); | |||
void LIBMTP_destroy_track_t(LIBMTP_track_t*); | void LIBMTP_destroy_track_t(LIBMTP_track_t*); | |||
LIBMTP_track_t *LIBMTP_Get_Tracklisting(LIBMTP_mtpdevice_t*); | LIBMTP_track_t *LIBMTP_Get_Tracklisting(LIBMTP_mtpdevice_t*); | |||
int LIBMTP_Get_Track_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * co nst, | int LIBMTP_Get_Track_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * co nst, | |||
LIBMTP_progressfunc_t const * const, void const * co nst); | LIBMTP_progressfunc_t const * const, void const * co nst); | |||
int LIBMTP_Get_Track_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const , int const, | int LIBMTP_Get_Track_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const , int const, | |||
LIBMTP_progressfunc_t const * const, void const * co nst); | LIBMTP_progressfunc_t const * const, void const * co nst); | |||
int LIBMTP_Send_Track_From_File(LIBMTP_mtpdevice_t *, | int LIBMTP_Send_Track_From_File(LIBMTP_mtpdevice_t *, | |||
char const * const, LIBMTP_track_t * const, | char const * const, LIBMTP_track_t * const, | |||
LIBMTP_progressfunc_t const * const, | LIBMTP_progressfunc_t const * const, | |||
void const * const); | void const * const, uint32_t const); | |||
int LIBMTP_Send_Track_From_File_Descriptor(LIBMTP_mtpdevice_t *, | int LIBMTP_Send_Track_From_File_Descriptor(LIBMTP_mtpdevice_t *, | |||
int const, LIBMTP_track_t * const, | int const, LIBMTP_track_t * const, | |||
LIBMTP_progressfunc_t const * const, | LIBMTP_progressfunc_t const * const, | |||
void const * const); | void const * const, uint32_t const); | |||
int LIBMTP_Update_Track_Metadata(LIBMTP_mtpdevice_t *, | int LIBMTP_Update_Track_Metadata(LIBMTP_mtpdevice_t *, | |||
LIBMTP_track_t const * const); | LIBMTP_track_t const * const); | |||
int LIBMTP_Track_Exists(LIBMTP_mtpdevice_t *, uint32_t); | int LIBMTP_Track_Exists(LIBMTP_mtpdevice_t *, uint32_t); | |||
/** @} */ | /** @} */ | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup folders The folder management API. | * @defgroup folders The folder management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
End of changes. 9 change blocks. | ||||
5 lines changed or deleted | 22 lines changed or added | |||