| 1 |
/***************************************************************************
|
| 2 |
file_loader.h - description
|
| 3 |
-------------------
|
| 4 |
Copyright : (C) 2004-2025 by Leaflet
|
| 5 |
Email : leaflet@leafok.com
|
| 6 |
***************************************************************************/
|
| 7 |
|
| 8 |
/***************************************************************************
|
| 9 |
* *
|
| 10 |
* This program is free software; you can redistribute it and/or modify *
|
| 11 |
* it under the terms of the GNU General Public License as published by *
|
| 12 |
* the Free Software Foundation; either version 3 of the License, or *
|
| 13 |
* (at your option) any later version. *
|
| 14 |
* *
|
| 15 |
***************************************************************************/
|
| 16 |
|
| 17 |
#ifndef _FILE_LOADER_H_
|
| 18 |
#define _FILE_LOADER_H_
|
| 19 |
|
| 20 |
#include "common.h"
|
| 21 |
#include <stddef.h>
|
| 22 |
|
| 23 |
#define FILE_MMAP_COUNT_LIMIT 256
|
| 24 |
|
| 25 |
struct file_mmap_t
|
| 26 |
{
|
| 27 |
size_t size;
|
| 28 |
void *p_data;
|
| 29 |
long line_offsets[MAX_FILE_LINES];
|
| 30 |
long line_total;
|
| 31 |
};
|
| 32 |
typedef struct file_mmap_t FILE_MMAP;
|
| 33 |
|
| 34 |
extern int file_loader_init(int max_file_mmap_count);
|
| 35 |
extern void file_loader_cleanup(void);
|
| 36 |
|
| 37 |
extern int load_file_mmap(const char *filename);
|
| 38 |
extern int unload_file_mmap(const char *filename);
|
| 39 |
|
| 40 |
extern const FILE_MMAP *get_file_mmap(const char *filename);
|
| 41 |
|
| 42 |
#endif //_FILE_LOADER_H_
|