navit 0.5.3-trunk
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1
20#ifndef NAVIT_FILE_H
21#define NAVIT_FILE_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#ifndef PATH_MAX
28#define PATH_MAX 4096
29#endif
30#ifndef __CEGCC__
31#include <time.h>
32#endif
33#include "param.h"
34#include <stdio.h>
35
36struct file {
37 struct file *next;
38 unsigned char *begin;
39 unsigned char *end;
40 unsigned char *mmap_end;
41 long long size;
43 int fd;
44#ifndef __CEGCC__
45 time_t mtime;
46 time_t ctime;
48#endif
49#if defined(_WIN32) || defined(__CEGCC__)
50 long map_handle;
51 long map_file;
52#endif
53 char *name;
55 int cache;
57 unsigned char *buffer;
59 GHashTable *headers;
60};
61
62struct attr;
63
64/* prototypes */
65int file_request(struct file *f, struct attr **options);
66char *file_http_header(struct file *f, char *header);
67struct file *file_create(char *name, struct attr **options);
68int file_is_dir(const char *name);
69int file_is_reg(const char *name);
70long long file_size(struct file *file);
71int file_mkdir(char *name, int pflag);
72int file_mmap(struct file *file);
73unsigned char *file_data_read(struct file *file, long long offset, int size);
74unsigned char *file_data_read_special(struct file *file, int size, int *size_ret);
75unsigned char *file_data_read_all(struct file *file);
76void file_data_flush(struct file *file, long long offset, int size);
77int file_data_write(struct file *file, long long offset, int size, const void *data);
78int file_get_contents(char *name, unsigned char **buffer, int *size);
79unsigned char *file_data_read_compressed(struct file *file, long long offset, int size, int size_uncomp);
80void file_data_free(struct file *file, unsigned char *data);
81int file_exists(char const *name);
82void file_remap_readonly(struct file *f);
83void file_unmap(struct file *f);
84void *file_opendir(char *dir);
85char *file_readdir(void *hnd);
86void file_closedir(void *hnd);
87struct file *file_create_caseinsensitive(char *name, struct attr **options);
88void file_fsync(struct file *f);
89void file_destroy(struct file *f);
90struct file_wordexp *file_wordexp_new(const char *pattern);
91int file_wordexp_get_count(struct file_wordexp *wexp);
92char **file_wordexp_get_array(struct file_wordexp *wexp);
93void file_wordexp_destroy(struct file_wordexp *wexp);
94int file_get_param(struct file *file, struct param_list *param, int count);
95int file_version(struct file *file, int byname);
96void *file_get_os_handle(struct file *file);
97int file_set_cache_size(int cache_size);
98void file_init(void);
99void file_data_remove(struct file *file, unsigned char *data);
100/* end of prototypes */
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif
void file_destroy(struct file *f)
Definition file.c:662
unsigned char * file_data_read_all(struct file *file)
Definition file.c:427
unsigned char * file_data_read_compressed(struct file *file, long long offset, int size, int size_uncomp)
Definition file.c:490
int file_set_cache_size(int cache_size)
Definition file.c:753
char * file_readdir(void *hnd)
Definition file.c:590
void file_closedir(void *hnd)
Definition file.c:611
char ** file_wordexp_get_array(struct file_wordexp *wexp)
Definition file.c:704
int file_is_reg(const char *name)
Check if a given path corresponds to a regular file.
Definition file.c:254
void file_fsync(struct file *f)
Definition file.c:656
int file_wordexp_get_count(struct file_wordexp *wexp)
Definition file.c:698
int file_get_contents(char *name, unsigned char **buffer, int *size)
Definition file.c:449
int file_data_write(struct file *file, long long offset, int size, const void *data)
Definition file.c:439
int file_get_param(struct file *file, struct param_list *param, int count)
void * file_opendir(char *dir)
Definition file.c:574
int file_exists(char const *name)
Definition file.c:547
unsigned char * file_data_read(struct file *file, long long offset, int size)
Definition file.c:319
int file_version(struct file *file, int byname)
Definition file.c:718
int file_mmap(struct file *file)
Definition file.c:296
void file_data_flush(struct file *file, long long offset, int size)
Definition file.c:431
void file_data_remove(struct file *file, unsigned char *data)
Definition file.c:534
int file_request(struct file *f, struct attr **options)
Definition file.c:167
struct file_wordexp * file_wordexp_new(const char *pattern)
Definition file.c:688
void file_wordexp_destroy(struct file_wordexp *wexp)
Definition file.c:710
struct file * file_create_caseinsensitive(char *name, struct attr **options)
Definition file.c:621
long long file_size(struct file *file)
Definition file.c:262
void file_init(void)
Definition file.c:762
int file_is_dir(const char *name)
Check if a given path corresponds to a directory.
Definition file.c:239
void * file_get_os_handle(struct file *file)
Definition file.c:749
int file_mkdir(char *name, int pflag)
Definition file.c:266
void file_remap_readonly(struct file *f)
Definition file.c:554
void file_unmap(struct file *f)
Definition file.c:565
struct file * file_create(char *name, struct attr **options)
Definition file.c:182
char * file_http_header(struct file *f, char *header)
Definition file.c:175
unsigned char * file_data_read_special(struct file *file, int size, int *size_ret)
Definition file.c:380
void file_data_free(struct file *file, unsigned char *data)
Definition file.c:521
char data
Definition garmin_img.c:2
int size
Definition garmin_img.c:3
int offset
Definition garmin_img.c:0
char name[0]
Definition street.c:3
Definition attr.h:136
Definition maptool.h:169
Definition file.c:681
char * pattern
Definition file.c:683
Definition file.h:36
int buffer_len
Definition file.h:58
int cache
Definition file.h:55
unsigned char * end
Definition file.h:39
int name_id
Definition file.h:42
struct file * next
Definition file.h:37
unsigned char * mmap_end
Definition file.h:40
time_t mtime
Definition file.h:45
int special
Definition file.h:54
unsigned char * begin
Definition file.h:38
GHashTable * headers
Definition file.h:59
char * name
Definition file.h:53
long long size
Definition file.h:41
int fd
Definition file.h:43
int version
Definition file.h:47
unsigned char * buffer
Definition file.h:57
time_t ctime
Definition file.h:46
FILE * f
Definition garmin_img.c:40
int requests
Definition file.h:56
Definition param.h:23