summaryrefslogtreecommitdiff
path: root/buff.h
blob: 2ad6e6bd625e36dd47f808eac40e346e48640828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __BUFF_H__
#define __BUFF_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define E fprintf(stderr, "?\n")
#define CHECKADDR  if (addr1 < addr2){ E; break;}


typedef struct line_t {
  char *c;
  unsigned int s;
  struct line_t *prev;
  struct line_t *next;
} line_t;


extern line_t *b_start;
extern line_t *b_end;
extern line_t *cur;
extern int num;
extern int pos;
extern int addr1, addr2;
extern char *fname, mod;
extern line_t *marks[26];


int read_lines(FILE *);
void print_lines(char);
void print_cur_line(char);
int move_to_line(int, char);
void print_lineno();
void append_lines();
void insert_lines();
void delete_lines();
int write_lines(char);
int read_file();
int match(char **, char);
int mark(char *c);
int get_lineno(line_t*);
void transfer_lines(int, char);
void exec_command(char*, FILE*);


#endif /* __BUFF_H__ */