| 1 |
sysadm |
1.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 |
|
|
struct file_mmap_t
|
| 24 |
|
|
{
|
| 25 |
|
|
size_t size;
|
| 26 |
|
|
void *p_data;
|
| 27 |
|
|
long line_offsets[MAX_FILE_LINES];
|
| 28 |
|
|
long line_total;
|
| 29 |
|
|
};
|
| 30 |
|
|
typedef struct file_mmap_t FILE_MMAP;
|
| 31 |
|
|
|
| 32 |
|
|
extern int file_loader_init(int max_file_mmap_count);
|
| 33 |
|
|
extern void file_loader_cleanup(void);
|
| 34 |
|
|
|
| 35 |
|
|
extern int load_file_mmap(const char *filename);
|
| 36 |
|
|
extern int unload_file_mmap(const char *filename);
|
| 37 |
|
|
|
| 38 |
|
|
extern const FILE_MMAP *get_file_mmap(const char *filename);
|
| 39 |
|
|
|
| 40 |
|
|
#endif //_FILE_LOADER_H_
|