tmus

TUI Music Player
git clone https://git.sinitax.com/sinitax/tmus
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

history.h (1036B)


      1#pragma once 
      2
      3#include "list.h"
      4
      5#define HISTORY_MAX 100
      6
      7struct inputln {
      8	char *buf;
      9	int len, cap;
     10	int cur;
     11	int curpos;
     12
     13	struct list_link link;
     14};
     15
     16struct history {
     17	struct list list;
     18	struct inputln *sel, *input;
     19};
     20
     21void history_init(struct history *history);
     22void history_deinit(struct history *history);
     23
     24void history_submit(struct history *history);
     25
     26void history_prev(struct history *history);
     27void history_next(struct history *history);
     28
     29void history_add(struct history *history, struct inputln *line);
     30
     31void inputln_init(struct inputln *ln);
     32void inputln_deinit(struct inputln *ln);
     33
     34struct inputln *inputln_alloc(void);
     35void inputln_free(struct inputln *ln);
     36
     37void inputln_resize(struct inputln *ln, size_t size);
     38
     39void inputln_left(struct inputln *line);
     40void inputln_right(struct inputln *line);
     41
     42void inputln_addch(struct inputln *line, char c);
     43void inputln_del(struct inputln *line, int n);
     44
     45void inputln_copy(struct inputln *dst, struct inputln *src);
     46void inputln_replace(struct inputln *line, const char *str);
     47