1 /*************************************************************************
2 * Copyright (C) 2024 Francesco Palumbo <phranz.dev@gmail.com>, Naples (Italy)
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *************************************************************************/
18 #ifndef SOURCEDRIVER_H
19 #define SOURCEDRIVER_H
21 typedef struct vec_sourcedata_t vec_sourcedata_t
;
32 typedef struct head_t
{
38 typedef struct sourcedata_t
{
44 struct sourcedata_t
* p
;
45 unsigned long long lineno
;
48 void (*free
)(struct sourcedata_t
*);
51 sourcedata_t
* sourcedata_t_init(sourcedata_t
*);
52 void sourcedata_t_free(sourcedata_t
*);
54 void sourcedriver_init();
55 void sourcedriver_free();
56 void sinfo(const char*, unsigned long long);
57 int new_source(int, void*);
58 sourcedata_t
* evalsrc(char*, unsigned long, char*);
61 int source_exahusted();
64 #define valid_source() (current && current->s != S_NOSRC)