c-md/includes/map.h
2026-01-12 00:48:09 +01:00

35 lines
530 B
C

#ifndef MAP_H
# define MAP_H
# include <stddef.h>
# include <stdint.h>
typedef struct s_range
{
uint32_t src_start;
uint32_t src_end;
uint32_t dst_start;
uint32_t dst_end;
} t_range;
typedef struct s_map
{
t_range *ranges;
size_t count;
size_t capacity;
} t_map;
void
map_init(t_map *map);
void
map_add(t_map *map, uint32_t src_start, uint32_t src_end,
uint32_t dst_start, uint32_t dst_end);
int8_t
map_write(t_map *map, const char *path, const char *source, const char *target);
void
map_free(t_map *map);
#endif