ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbShell.h File Reference
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define USE(x)
 
#define ngcbSHELL_FUNCTION_KEY(x)
 
#define ngcbSHELL_ESC   27
 
#define ngcbSHELL_F_CRSR_UP   65
 
#define ngcbSHELL_F_CRSR_DOWN   66
 
#define ngcbSHELL_F_CRSR_LEFT   68
 
#define ngcbSHELL_F_CRSR_RIGHT   67
 
#define ngcbSHELL_F_END   70
 
#define ngcbSHELL_F_BEGIN   72
 
#define ngcbSHELL_F_INSERT   50
 
#define ngcbSHELL_COMMENT   '#'
 
#define ngcbSHELL_MAX_FILES   32
 
#define ngcbSHELL_MAX_CMDLEN   256
 
#define ngcbSHELL_STACK_SIZE   20
 
#define ngcbSHELL_CR   13
 
#define ngcbSHELL_BS   8
 
#define ngcbSHELL_INSERT   9
 
#define ngcbSHELL_END   5
 
#define ngcbSHELL_BEGIN   1
 
#define ngcbSHELL_LEFT   2
 
#define ngcbSHELL_RIGHT   6
 
#define ngcbSHELL_DEL   4
 
#define ngcbSHELL_DELLINE   11
 

Functions

FILE * ngcbShellOpenRepStream (const char *outDev, char *erms)
 
int ngcbShellTerminate (const char *inDev, char *erms)
 
int ngcbShellGetLine (const char *inDev, char *cmdLine, char *erms)
 
int ngcbShellReadStream (FILE *inputStream, char *cmdLine, char *erms)
 
int ngcbShellReadKeyboard (char *cmdLine, char *erms)
 
int ngcbShellGetKey (char *key, char *erms)
 
int ngcbShellPollKey (char *key, char *erms)
 
int ngcbShellTermTty (char *erms)
 

Detailed Description

Macro Definition Documentation

◆ ngcbSHELL_BEGIN

#define ngcbSHELL_BEGIN   1

goto beginning of line

◆ ngcbSHELL_BS

#define ngcbSHELL_BS   8

back-space

◆ ngcbSHELL_COMMENT

#define ngcbSHELL_COMMENT   '#'

comment

◆ ngcbSHELL_CR

#define ngcbSHELL_CR   13

carriage return

◆ ngcbSHELL_DEL

#define ngcbSHELL_DEL   4

delete character

◆ ngcbSHELL_DELLINE

#define ngcbSHELL_DELLINE   11

delete line

◆ ngcbSHELL_END

#define ngcbSHELL_END   5

goto end of line

◆ ngcbSHELL_ESC

#define ngcbSHELL_ESC   27

escape key

◆ ngcbSHELL_F_BEGIN

#define ngcbSHELL_F_BEGIN   72

goto beginning of line

◆ ngcbSHELL_F_CRSR_DOWN

#define ngcbSHELL_F_CRSR_DOWN   66

cursor down

◆ ngcbSHELL_F_CRSR_LEFT

#define ngcbSHELL_F_CRSR_LEFT   68

cursor left

◆ ngcbSHELL_F_CRSR_RIGHT

#define ngcbSHELL_F_CRSR_RIGHT   67

cursor right

◆ ngcbSHELL_F_CRSR_UP

#define ngcbSHELL_F_CRSR_UP   65

cursor up

◆ ngcbSHELL_F_END

#define ngcbSHELL_F_END   70

goto end of line

◆ ngcbSHELL_F_INSERT

#define ngcbSHELL_F_INSERT   50

toggle insert

◆ ngcbSHELL_FUNCTION_KEY

#define ngcbSHELL_FUNCTION_KEY ( x)
Value:
((x == 91) || (x == 79))

function key

◆ ngcbSHELL_INSERT

#define ngcbSHELL_INSERT   9

toggle insert

◆ ngcbSHELL_LEFT

#define ngcbSHELL_LEFT   2

cursor left

◆ ngcbSHELL_MAX_CMDLEN

#define ngcbSHELL_MAX_CMDLEN   256

maximum command length

◆ ngcbSHELL_MAX_FILES

#define ngcbSHELL_MAX_FILES   32

maximum number of streaming files

◆ ngcbSHELL_RIGHT

#define ngcbSHELL_RIGHT   6

cursor right

◆ ngcbSHELL_STACK_SIZE

#define ngcbSHELL_STACK_SIZE   20

command stack size

◆ USE

#define USE ( x)
Value:
do {(void)(x);} while (0)

Function Documentation

◆ ngcbShellGetKey()

int ngcbShellGetKey ( char * key,
char * erms )

Get next key.

◆ ngcbShellGetLine()

int ngcbShellGetLine ( const char * inDev,
char * cmdLine,
char * erms )

Handle next shell command line.

◆ ngcbShellOpenRepStream()

FILE * ngcbShellOpenRepStream ( const char * outDev,
char * erms )

Open shell reply stream.

◆ ngcbShellPollKey()

int ngcbShellPollKey ( char * key,
char * erms )

Poll keyboard an return next key.

◆ ngcbShellReadKeyboard()

int ngcbShellReadKeyboard ( char * cmdLine,
char * erms )

Read command line from keyboard.

◆ ngcbShellReadStream()

int ngcbShellReadStream ( FILE * inputStream,
char * cmdLine,
char * erms )

Read command line from stream and prepares it for command parsing (i.e deletes suspiciuous spaces etc.).

◆ ngcbShellTerminate()

int ngcbShellTerminate ( const char * inDev,
char * erms )

Terminate shell editor.

◆ ngcbShellTermTty()

int ngcbShellTermTty ( char * erms)

Terminate TTY input.