#include "common.h"
#include <stdlib.h>
{
int i;
if(folderlist==NULL) {
return;
}
for(i=0;i<level;i++) printf(" ");
printf(
"%s\n", folderlist->
name);
dump_folder_list(folderlist->
child, level+1);
dump_folder_list(folderlist->
sibling, level);
}
int main (int argc, char **argv)
{
printf("Attempting to connect device(s)\n");
{
case LIBMTP_ERROR_NO_DEVICE_ATTACHED:
printf("mtp-folders: no devices found\n");
return 0;
case LIBMTP_ERROR_CONNECTING:
fprintf(stderr, "mtp-folders: There has been an error connecting. Exit\n");
return 1;
case LIBMTP_ERROR_MEMORY_ALLOCATION:
fprintf(stderr, "mtp-folders: Memory Allocation Error. Exit\n");
return 1;
case LIBMTP_ERROR_GENERAL:
default:
fprintf(stderr, "mtp-folders: Unknown error, please report "
"this to the libmtp developers\n");
return 1;
case LIBMTP_ERROR_NONE:
printf("mtp-folders: Successfully connected\n");
}
for(device = device_list; device != NULL; device = device->
next)
{
char *friendlyname;
int ret;
if (friendlyname == NULL) {
printf("Friendly name: (NULL)\n");
} else {
printf("Friendly name: %s\n", friendlyname);
free(friendlyname);
}
if (ret != 0) {
perror("LIBMTP_Get_Storage()\n");
continue;
}
for (storage = device->
storage; storage != 0; storage = storage->
next) {
if (folders == NULL) {
fprintf(stdout, "No folders found\n");
} else {
dump_folder_list(folders,0);
}
}
}
printf("OK.\n");
return 0;
}