diff options
author | Linus Walleij <triad@df.lth.se> | 2009-05-06 21:14:41 +0000 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2009-05-06 21:14:41 +0000 |
commit | 6f05002d6cfbf22777def1c79d92d4df323e5d48 (patch) | |
tree | ea97ca8deff6f8fa4bde165ed0e5674d67b8e151 /examples | |
parent | 18ed016338da66619a48817e1bcc01548f8c78fb (diff) | |
download | libmtp-6f05002d6cfbf22777def1c79d92d4df323e5d48.tar.gz |
A first host of Windows fixes from Carlo Bramini
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Makefile.am | 10 | ||||
-rw-r--r-- | examples/albumart.c | 2 | ||||
-rw-r--r-- | examples/getfile.c | 2 | ||||
-rw-r--r-- | examples/getplaylist.c | 2 | ||||
-rw-r--r-- | examples/pathutils.c | 6 | ||||
-rw-r--r-- | examples/pathutils.h | 2 | ||||
-rw-r--r-- | examples/thumb.c | 2 | ||||
-rw-r--r-- | examples/trexist.c | 2 |
8 files changed, 18 insertions, 10 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am index d6d4612..101141c 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -27,8 +27,8 @@ LDADD=../src/libmtp.la EXTRA_DIST=evolution-sync.sh install-exec-hook: - ln -f -s mtp-connect $(DESTDIR)$(bindir)/mtp-delfile - ln -f -s mtp-connect $(DESTDIR)$(bindir)/mtp-getfile - ln -f -s mtp-connect $(DESTDIR)$(bindir)/mtp-newfolder - ln -f -s mtp-connect $(DESTDIR)$(bindir)/mtp-sendfile - ln -f -s mtp-connect $(DESTDIR)$(bindir)/mtp-sendtr + ln -f -s $(DESTDIR)$(bindir)/mtp-connect$(EXEEXT) $(DESTDIR)$(bindir)/mtp-delfile$(EXEEXT) + ln -f -s $(DESTDIR)$(bindir)/mtp-connect$(EXEEXT) $(DESTDIR)$(bindir)/mtp-getfile$(EXEEXT) + ln -f -s $(DESTDIR)$(bindir)/mtp-connect$(EXEEXT) $(DESTDIR)$(bindir)/mtp-newfolder$(EXEEXT) + ln -f -s $(DESTDIR)$(bindir)/mtp-connect$(EXEEXT) $(DESTDIR)$(bindir)/mtp-sendfile$(EXEEXT) + ln -f -s $(DESTDIR)$(bindir)/mtp-connect$(EXEEXT) $(DESTDIR)$(bindir)/mtp-sendtr$(EXEEXT) diff --git a/examples/albumart.c b/examples/albumart.c index 7c047d1..bce6415 100644 --- a/examples/albumart.c +++ b/examples/albumart.c @@ -28,7 +28,9 @@ #include <errno.h> #include <sys/stat.h> #include <sys/types.h> +#ifdef HAVE_SYS_UIO_H #include <sys/uio.h> +#endif static void usage(void) { printf("Usage: albumart -i <fileid/trackid> -n <albumname> <imagefile>\n"); diff --git a/examples/getfile.c b/examples/getfile.c index bffe9e6..7df2453 100644 --- a/examples/getfile.c +++ b/examples/getfile.c @@ -55,7 +55,7 @@ getfile_function(char * from_path,char * to_path) void getfile_command(int argc, char **argv) { - u_int32_t id; + uint32_t id; char *endptr; char *file; diff --git a/examples/getplaylist.c b/examples/getplaylist.c index 2997ede..cc9c4ca 100644 --- a/examples/getplaylist.c +++ b/examples/getplaylist.c @@ -50,7 +50,7 @@ int main (int argc, char **argv) { LIBMTP_mtpdevice_t *device; LIBMTP_playlist_t *playlist; - u_int32_t id; + uint32_t id; char *endptr; fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); diff --git a/examples/pathutils.c b/examples/pathutils.c index 72a9e0d..d4f365e 100644 --- a/examples/pathutils.c +++ b/examples/pathutils.c @@ -113,7 +113,7 @@ parse_path (char * path, LIBMTP_file_t * files, LIBMTP_folder_t * folders) return -1; } -int progress (u_int64_t const sent, u_int64_t const total, void const * const data) +int progress (const uint64_t sent, const uint64_t total, void const * const data) { int percent = (sent*100)/total; #ifdef __WIN32__ @@ -132,7 +132,11 @@ find_filetype (const char * filename) char *ptype; LIBMTP_filetype_t filetype; +#ifdef __WIN32__ + ptype = strrchr(filename, '.'); +#else ptype = rindex(filename,'.'); +#endif // This accounts for the case with a filename without any "." (period). if (!ptype) { ptype = ""; diff --git a/examples/pathutils.h b/examples/pathutils.h index dbea719..f40b6d6 100644 --- a/examples/pathutils.h +++ b/examples/pathutils.h @@ -22,7 +22,7 @@ #define PATHUTILS_H_INCLUSION_GUARD int parse_path (char *, LIBMTP_file_t *, LIBMTP_folder_t *); LIBMTP_filetype_t find_filetype (const char *); -int progress (u_int64_t const, u_int64_t const, void const * const); +int progress (const uint64_t, const uint64_t, void const * const); #ifndef HAVE_LIBGEN_H char *basename(char *in); #endif diff --git a/examples/thumb.c b/examples/thumb.c index a86abd6..bd8edf9 100644 --- a/examples/thumb.c +++ b/examples/thumb.c @@ -28,7 +28,9 @@ #include <unistd.h> #include <limits.h> #include <sys/types.h> +#ifdef HAVE_SYS_UIO_H #include <sys/uio.h> +#endif #include <sys/stat.h> static void usage(void) { diff --git a/examples/trexist.c b/examples/trexist.c index 8c3687a..d6159d7 100644 --- a/examples/trexist.c +++ b/examples/trexist.c @@ -31,7 +31,7 @@ static void usage (void) int main (int argc, char **argv) { LIBMTP_mtpdevice_t *device; - u_int32_t id; + uint32_t id; char *endptr; fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); |