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
36#include "glib.h"
37
38struct file {
39 struct file *next;
40 unsigned char *begin;
41 unsigned char *end;
42 unsigned char *mmap_end;
43 long long size;
45 int fd;
46#ifndef __CEGCC__
47 time_t mtime;
48 time_t ctime;
50#endif
51#if defined(_WIN32) || defined(__CEGCC__)
52 long map_handle;
53 long map_file;
54#endif
55 char *name;
57 int cache;
59 unsigned char *buffer;
61 GHashTable *headers;
62};
63
64struct attr;
65
66/* prototypes */
67int file_request(struct file *f, struct attr **options);
68char *file_http_header(struct file *f, char *header);
69struct file *file_create(char *name, struct attr **options);
70int file_is_dir(const char *name);
71int file_is_reg(const char *name);
72long long file_size(struct file *file);
73int file_mkdir(char *name, int pflag);
74int file_mmap(struct file *file);
75unsigned char *file_data_read(struct file *file, long long offset, int size);
76unsigned char *file_data_read_special(struct file *file, int size, int *size_ret);
77unsigned char *file_data_read_all(struct file *file);
78void file_data_flush(struct file *file, long long offset, int size);
79int file_data_write(struct file *file, long long offset, int size, const void *data);
80int file_get_contents(char *name, unsigned char **buffer, int *size);
81unsigned char *file_data_read_compressed(struct file *file, long long offset, int size, int size_uncomp);
82void file_data_free(struct file *file, unsigned char *data);
83int file_exists(char const *name);
84void file_remap_readonly(struct file *f);
85void file_unmap(struct file *f);
86void *file_opendir(char *dir);
87char *file_readdir(void *hnd);
88void file_closedir(void *hnd);
89struct file *file_create_caseinsensitive(char *name, struct attr **options);
90void file_fsync(struct file *f);
91void file_destroy(struct file *f);
92struct file_wordexp *file_wordexp_new(const char *pattern);
93int file_wordexp_get_count(struct file_wordexp *wexp);
94char **file_wordexp_get_array(struct file_wordexp *wexp);
95void file_wordexp_destroy(struct file_wordexp *wexp);
96int file_get_param(struct file *file, struct param_list *param, int count);
97int file_version(struct file *file, int byname);
98void *file_get_os_handle(struct file *file);
99int file_set_cache_size(int cache_size);
100void file_init(void);
101void file_data_remove(struct file *file, unsigned char *data);
102/* end of prototypes */
103
104#ifdef __cplusplus
105}
106#endif
107
108#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:138
Definition maptool.h:173
Definition file.c:681
char * pattern
Definition file.c:683
Definition file.h:38
int buffer_len
Definition file.h:60
int cache
Definition file.h:57
unsigned char * end
Definition file.h:41
int name_id
Definition file.h:44
struct file * next
Definition file.h:39
unsigned char * mmap_end
Definition file.h:42
time_t mtime
Definition file.h:47
int special
Definition file.h:56
unsigned char * begin
Definition file.h:40
GHashTable * headers
Definition file.h:61
char * name
Definition file.h:55
long long size
Definition file.h:43
int fd
Definition file.h:45
int version
Definition file.h:49
unsigned char * buffer
Definition file.h:59
time_t ctime
Definition file.h:48
FILE * f
Definition garmin_img.c:40
int requests
Definition file.h:58
Definition param.h:23