#include "node.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <utf8proc.h>

BufferData *init_buffer(void);
void scroll_buffer(Node *buffer, int dy, int dx);
void set_cursor(Node *buffer, int row, int col);
void move_cursor(Node *buffer, int dx, int dy);
void move_cursor_to_mouse(Node *buffer, int mouse_x, int mouse_y);
Coords insert_text(Node *buffer, const char *text, int cx, int cy);
Coords delete_text(Node *buffer, ssize_t count, int cx, int cy);
Coords replace_text(Node *buffer, const char *text, int sx, int sy, int ex,
                    int ey);
Line take_last_clusters(Line *line, size_t n);
void append_line(Line *dest, Line *src);
void insert_line(BufferData *e, size_t index, Line *new_line);
void start_selection(Node *buffer);
void end_selection(Node *buffer);
Line *clone_line(Line *src);
char *get_selection(Node *buffer);
int get_selection_len(Node *buffer);
