| 1 |
/*************************************************************************** |
/* SPDX-License-Identifier: GPL-3.0-or-later */ |
| 2 |
file_loader.h - description |
/* |
| 3 |
------------------- |
* file_loader |
| 4 |
Copyright : (C) 2004-2025 by Leaflet |
* - shared memory based file loader |
| 5 |
Email : leaflet@leafok.com |
* |
| 6 |
***************************************************************************/ |
* Copyright (C) 2004-2026 Leaflet <leaflet@leafok.com> |
| 7 |
|
*/ |
|
/*************************************************************************** |
|
|
* * |
|
|
* This program is free software; you can redistribute it and/or modify * |
|
|
* it under the terms of the GNU General Public License as published by * |
|
|
* the Free Software Foundation; either version 3 of the License, or * |
|
|
* (at your option) any later version. * |
|
|
* * |
|
|
***************************************************************************/ |
|
| 8 |
|
|
| 9 |
#ifndef _FILE_LOADER_H_ |
#ifndef _FILE_LOADER_H_ |
| 10 |
#define _FILE_LOADER_H_ |
#define _FILE_LOADER_H_ |
| 12 |
#include "common.h" |
#include "common.h" |
| 13 |
#include <stddef.h> |
#include <stddef.h> |
| 14 |
|
|
| 15 |
extern int file_loader_init(void); |
extern int load_file(const char *filename); |
| 16 |
extern void file_loader_cleanup(void); |
extern int unload_file(const char *filename); |
|
|
|
|
extern int load_file_shm(const char *filename); |
|
|
extern int unload_file_shm(const char *filename); |
|
| 17 |
|
|
| 18 |
// Returned shared memory should be detached by shmdt() |
extern void *get_file_shm_readonly(const char *filename, size_t *p_data_len, long *p_line_total, const void **pp_data, const long **pp_line_offsets); |
| 19 |
extern const void *get_file_shm(const char *filename); |
extern int detach_file_shm(void *p_shm); |
| 20 |
|
|
| 21 |
#endif //_FILE_LOADER_H_ |
#endif //_FILE_LOADER_H_ |