edline.h File Reference

Go to the source code of this file.

Data Structures

struct  EDITHISTORY
 Line input history. More...
struct  EDLINE
 Edit line information structure. More...

Typedefs

typedef int(* EDLINEGET )(void *)
 Input routine type.
typedef int(* EDLINEPUT )(void *, int)
 Output routine type.
typedef int(* EDLINEMAP )(int, int *)
 Character mapping routine type.

Functions

EDLINEEdLineOpen (uint16_t mode)
void EdLineClose (EDLINE *el)
int EdLineRead (EDLINE *el, char *buf, int siz)
EDITHISTORYEditHistoryCreate (int siz)
void EditHistoryDestroy (EDITHISTORY *hist)
void EditHistorySet (EDITHISTORY *hist, int idx, char *buf)
int EditHistoryGet (EDITHISTORY *hist, int idx, char *buf, int siz)
void EditHistoryInsert (EDITHISTORY *hist, int idx, char *buf)
void EdLineRegisterKeymap (EDLINE *el, EDLINEMAP map)
int EdLineKeyMap (int key, int *seq)
int EdLineKeyMapVt100 (int key, int *seq)
void EdLineRegisterInput (EDLINE *el, EDLINEGET get, void *iparm)
void EdLineRegisterOutput (EDLINE *el, EDLINEPUT put, void *oparm)

Edit mode flags

Used when calling EdLineOpen to enable specific line editor features.

#define EDIT_MODE_ECHO   0x0001
 Enables echoing of input characters.
#define EDIT_MODE_BINARY   0x0002
 Enables binary mode (currently unused).
#define EDIT_MODE_HISTORY   0x0004
 Enables input line history.

Line editor input commands

Special keys which are interpreted by the editor as commands.

#define EDIT_KEY_IGNORE   0x00
 No operation. Default is Ctrl-@.
#define EDIT_KEY_HOME   0x01
 Move cursor to line begin. Default is Ctrl-A.
#define EDIT_KEY_LEFT   0x02
 Move cursor left. Default is Ctrl-B.
#define EDIT_KEY_END   0x05
 Move cursor to line end. Default is Ctrl-E.
#define EDIT_KEY_RIGHT   0x06
 Move cursor right. Default is Ctrl-F.
#define EDIT_KEY_REMOVE   0x08
 Delete left character. Default is Ctrl-H.
#define EDIT_KEY_ENTER   0x0a
 Confirm input. Default is Ctrl-J.
#define EDIT_KEY_UP   0x12
 History upwards. Default is Ctrl-R.
#define EDIT_KEY_DOWN   0x16
 History downwards. Default is Ctrl-V.
#define EDIT_KEY_RESTORE   0x1b
 Restore default. Default is ESC.

Line editor output commands

Special characters used by the editor to update the output.

#define EDIT_CHAR_SPACE   ' '
 Clear character right.
#define EDIT_CHAR_BACKSPACE   '\b'
 Move cursor left.
#define EDIT_CHAR_ALARM   '\a'
 Invoke audible alarm.
#define EDIT_STR_EOL   "\r\n"
 Terminate input.


Function Documentation

EDLINE* EdLineOpen ( uint16_t  mode  ) 

void EdLineClose ( EDLINE el  ) 

int EdLineRead ( EDLINE el,
char *  buf,
int  siz 
)

EDITHISTORY* EditHistoryCreate ( int  siz  ) 

void EditHistoryDestroy ( EDITHISTORY hist  ) 

void EditHistorySet ( EDITHISTORY hist,
int  idx,
char *  buf 
)

int EditHistoryGet ( EDITHISTORY hist,
int  idx,
char *  buf,
int  siz 
)

void EditHistoryInsert ( EDITHISTORY hist,
int  idx,
char *  buf 
)

void EdLineRegisterKeymap ( EDLINE el,
EDLINEMAP  map 
)

int EdLineKeyMap ( int  key,
int *  seq 
)

int EdLineKeyMapVt100 ( int  key,
int *  seq 
)

void EdLineRegisterInput ( EDLINE el,
EDLINEGET  get,
void *  iparm 
)

void EdLineRegisterOutput ( EDLINE el,
EDLINEPUT  put,
void *  oparm 
)


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/