~ubuntu-branches/ubuntu/karmic/iterm/karmic

« back to all changes in this revision

Viewing changes to lib/src/vt100.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Fok
  • Date: 2004-02-27 04:13:16 UTC
  • Revision ID: james.westby@ubuntu.com-20040227041316-q0jn37sia8mt0t9u
Tags: upstream-0.5
ImportĀ upstreamĀ versionĀ 0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This software is subject to the terms of the Common Public License
 
2
   You must accept the terms of this license to use this software.
 
3
 
 
4
   Copyright (C) 2002, International Business Machines Corporation
 
5
   and others.  All Rights Reserved.
 
6
 
 
7
   Further information about Common Public License Version 0.5 is obtained
 
8
   from url http://oss.software.ibm.com/developer/opensource/license-cpl.html */
 
9
 
 
10
/**
 
11
 * @file vt100.h
 
12
 */
 
13
#ifndef __VT100__
 
14
#define __VT100__
 
15
#if defined(HAVE_CONFIGH_H)
 
16
# include "../config.h"
 
17
#endif
 
18
#include <limits.h>
 
19
#include "state.h"
 
20
 
 
21
/** enumeration of states VT100 transits */
 
22
typedef enum
 
23
{
 
24
    GROUND_STATE,
 
25
    ESC_STATE,
 
26
    CSI_STATE,
 
27
    IGN_STATE,
 
28
    IES_STATE,
 
29
    SCS_STATE,
 
30
    SCR_STATE,
 
31
    EIG_STATE,
 
32
    DEC_STATE,
 
33
    OSC_STATE,
 
34
    BIDI_STATE,
 
35
    NUM_STATE,
 
36
    NO_MOVE
 
37
}state_t;
 
38
 
 
39
/**
 
40
 * @struct _VT100
 
41
 * VT100 class.
 
42
 * VT100 protocol machine
 
43
 * This struct is typedefed to `VT100'.
 
44
 */
 
45
typedef struct _VT100 {
 
46
  State all_states[NUM_STATE];
 
47
      /**< all of states which VT100 object moves to */
 
48
  State *current_state;
 
49
      /**< reference to current state */
 
50
}VT100;
 
51
/**< typedefed struct of struct _VT100 */
 
52
 
 
53
 
 
54
/** VT100 methods */
 
55
VT100 *VT100_new();
 
56
void VT100_parse(VT100 *vt100, Char *ch);
 
57
void VT100_register_sequence(VT100 *vt100,unsigned char *sequence,
 
58
                             state_t next_state, callback_func func,
 
59
                             void *obj);
 
60
void VT100_destroy(VT100 *vt100);
 
61
/** VT100 methods end */
 
62
 
 
63
 
 
64
#endif