summaryrefslogtreecommitdiff
path: root/navit/file.h
blob: 25280de3764a73e69b819f5d8e29df2a8caa5be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef NAVIT_FILE_H
#define NAVIT_FILE_H

#include "param.h"

struct file {
	unsigned char *begin;
	unsigned char *end;
	long long size;
	char *name;
	int fd;
#ifdef _WIN32
    long map_handle;
    long map_file;
#endif
	struct file *next;
};

/* prototypes */
struct file;
struct file_wordexp;
struct param_list;
struct file *file_create(char *name);
int file_is_dir(char *name);
int file_mkdir(char *name, int pflag);
int file_mmap(struct file *file);
unsigned char *file_data_read(struct file *file, long long offset, int size);
unsigned char *file_data_read_compressed(struct file *file, long long offset, int size, int size_uncomp);
void file_data_free(struct file *file, unsigned char *data);
int file_exists(char *name);
void file_remap_readonly(struct file *f);
void file_remap_readonly_all(void);
void file_unmap(struct file *f);
void file_unmap_all(void);
void *file_opendir(char *dir);
char *file_readdir(void *hnd);
void file_closedir(void *hnd);
struct file *file_create_caseinsensitive(char *name);
void file_destroy(struct file *f);
struct file_wordexp *file_wordexp_new(const char *pattern);
int file_wordexp_get_count(struct file_wordexp *wexp);
char **file_wordexp_get_array(struct file_wordexp *wexp);
void file_wordexp_destroy(struct file_wordexp *wexp);
int file_get_param(struct file *file, struct param_list *param, int count);
/* end of prototypes */

#endif