37 lines
625 B
C
37 lines
625 B
C
#ifndef TRANSPILE_INTERNAL_H
|
|
# define TRANSPILE_INTERNAL_H
|
|
|
|
# include <stdio.h>
|
|
# include <stdint.h>
|
|
# include "map.h"
|
|
|
|
typedef struct s_state
|
|
{
|
|
FILE *in;
|
|
FILE *out;
|
|
const char *ext;
|
|
t_map *map;
|
|
uint32_t src_line;
|
|
uint32_t dst_line;
|
|
uint32_t block_src_start;
|
|
uint32_t block_dst_start;
|
|
uint8_t in_block;
|
|
uint8_t first_block;
|
|
} t_state;
|
|
|
|
void
|
|
state_init(t_state *s, FILE *in, FILE *out, const char *ext, t_map *map);
|
|
|
|
int8_t
|
|
process_line(t_state *s, char *line);
|
|
|
|
int8_t
|
|
handle_fence_open(t_state *s, char *line);
|
|
|
|
int8_t
|
|
handle_fence_close(t_state *s);
|
|
|
|
int8_t
|
|
handle_code_line(t_state *s, char *line);
|
|
|
|
#endif
|