diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-01-09 20:25:11 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-01-09 20:25:11 +0000 |
commit | 512fabd3e06c4b32b948d03325acf9130e4735b5 (patch) | |
tree | 5db6f537e77055e83a3db4553f901281e5463a5c /navit/file.c | |
parent | f0ca7c43e44e1f3ed58f1fef02c35fd8f972d60a (diff) | |
download | navit-512fabd3e06c4b32b948d03325acf9130e4735b5.tar.gz |
Fix:Core:Defined LONGLONG_FMT for android
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3900 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/file.c')
-rw-r--r-- | navit/file.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/navit/file.c b/navit/file.c index 9096a0f5b..e6da9d5bd 100644 --- a/navit/file.c +++ b/navit/file.c @@ -38,6 +38,7 @@ #include "config.h" #include "item.h" #include "util.h" +#include "types.h" #ifdef HAVE_SOCKET #include <sys/socket.h> #include <netdb.h> @@ -228,7 +229,7 @@ file_create(char *name, struct attr **options) dbg(1,"fd=%d\n", file->fd); fstat(file->fd, &stat); file->size=stat.st_size; - dbg(1,"size=%Ld\n", file->size); + dbg(1,"size="LONGLONG_FMT"\n", file->size); file->name_id = (int)atom(name); } #ifdef CACHE_SIZE @@ -434,13 +435,20 @@ file_data_read_all(struct file *file) return file_data_read(file, 0, file->size); } -int -file_data_write(struct file *file, long long offset, int size, unsigned char *data) +void +file_data_flush(struct file *file, long long offset, int size) { if (file_cache) { struct file_cache_id id={offset,size,file->name_id,0}; cache_flush(file_cache,&id); + dbg(1,"Flushing "LONGLONG_FMT" %d bytes\n",offset,size); } +} + +int +file_data_write(struct file *file, long long offset, int size, unsigned char *data) +{ + file_data_flush(file, offset, size); lseek(file->fd, offset, SEEK_SET); if (write(file->fd, data, size) != size) return 0; |