1.1 KiB
1.1 KiB
transpile_internal.h
Include Guard
#ifndef TRANSPILE_INTERNAL_H
# define TRANSPILE_INTERNAL_H
# include <stdio.h>
# include <stdint.h>
# include "map.h"
Types
t_state
Struct to hold the state of the transpilation process.
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;
Functions
state_init
Initializes the transpilation state.
void
state_init(t_state *s, FILE *in, FILE *out, const char *ext, t_map *map);
handle_fence_open
Handles the opening of a code fence in the input.
int8_t
handle_fence_open(t_state *s, char *line);
handle_fence_close
Handles the closing of a code fence in the input.
int8_t
handle_fence_close(t_state *s);
handle_line
Handles a regular line of code in the input.
int8_t
handle_code_line(t_state *s, char *line);
End Guard
#endif