#include "common.h"
#include <stdlib.h>
{
printf(
"File ID: %u\n", file->
item_id);
printf(
" Filename: %s\n", file->
filename);
printf(" None. (abstract file, size = -1)\n");
} else {
#ifdef __WIN32__
#else
printf(" File size %llu (0x%016llX) bytes\n",
(
long long unsigned int) file->
filesize,
(
long long unsigned int) file->
filesize);
#endif
}
printf(
" Storage ID: 0x%08X\n", file->
storage_id);
}
int main (int argc, char **argv)
{
fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n");
{
case LIBMTP_ERROR_NO_DEVICE_ATTACHED:
fprintf(stdout, "mtp-files: No Devices have been found\n");
return 0;
case LIBMTP_ERROR_CONNECTING:
fprintf(stderr, "mtp-files: There has been an error connecting. Exit\n");
return 1;
case LIBMTP_ERROR_MEMORY_ALLOCATION:
fprintf(stderr, "mtp-files: Memory Allocation Error. Exit\n");
return 1;
case LIBMTP_ERROR_GENERAL:
default:
fprintf(stderr, "mtp-files: Unknown error, please report "
"this to the libmtp developers\n");
return 1;
case LIBMTP_ERROR_NONE:
fprintf(stdout, "mtp-files: Successfully connected\n");
fflush(stdout);
}
for(device = device_list; device != NULL; device = device->
next)
{
char *friendlyname;
if (friendlyname == NULL) {
printf("Listing File Information on Device with name: (NULL)\n");
} else {
printf("Listing File Information on Device with name: %s\n", friendlyname);
free(friendlyname);
}
if (files == NULL) {
printf("No files.\n");
} else {
file = files;
while (file != NULL) {
dump_fileinfo(file);
tmp = file;
}
}
}
printf("OK.\n");
exit (0);
}