c-md/srcs/transpile/state.c.md
2026-01-12 16:22:13 +01:00

744 B

state.c

Initialize the transpilation state structure.

Includes

#include "internal/transpile_internal.h"

Function Description

state_init

Initialize the transpilation state structure.

Parameters

  • s: Pointer to the state structure to initialize.
  • in: Input file pointer.
  • out: Output file pointer.
  • ext: Pointer to the extracted code fence extension string.
  • map: Pointer to the mapping structure.

Implementation

void
state_init(t_state *s, FILE *in, FILE *out, const char *ext, t_map *map)
{
	s->in = in;
	s->out = out;
	s->ext = ext;
	s->map = map;
	s->src_line = 0;
	s->dst_line = 0;
	s->block_src_start = 0;
	s->block_dst_start = 0;
	s->in_block = 0;
	s->first_block = 1;
}