aboutsummaryrefslogtreecommitdiffstats
path: root/src/ansi.h
blob: bc245243b0eec1a291bb89a6f66ee077dea5c866 (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
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * ansi.h:
 *
 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
 * All rights reserved.
 *
 */

/*
 * $Id$
 */

/*
 * $Log$
 * Revision 1.4  2008/02/07 00:43:27  james
 * *** empty log message ***
 *
 * Revision 1.3  2008/02/07 00:39:13  james
 * *** empty log message ***
 *
 * Revision 1.2  2008/02/06 11:30:37  james
 * *** empty log message ***
 *
 * Revision 1.1  2008/02/03 23:31:25  james
 * *** empty log message ***
 *
 */

#ifndef __ANSI_H__
#define __ANSI_H__

#define ANSI_INVAL -1

#define ANSI_ESCAPE_BUF_LEN 10
#define ANSI_ESCAPE_TIMEOUT	100000 /*in ms */

typedef struct
{
  int in_escape;
  struct timeval last_escape;
  char escape_buf[ANSI_ESCAPE_BUF_LEN];
  int escape_ptr;
} ANSI_Parser;

typedef struct
{
  int fd;

  CRT crt;
  CRT_Pos pos;
  CRT_Pos size;
  int hide_cursor;
  int attr;

  ANSI_Parser parser;
} ANSI;


#endif /* __ANSI_H__ */