BRL-CAD
cursor.c File Reference
#include "common.h"
#include "cursor.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for cursor.c:

Go to the source code of this file.

Macros

#define _winsize   winsize /* For compat with _ioctl.h. */
 
#define TBUFSIZ   1024
 
#define MAX_TERM_LEN   80
 

Functions

int PutChr (int c)
 
int InitTermCap (FILE *fp)
 
int HmCursor (void)
 
int ScrollUp (void)
 
int ScrollDn (void)
 
int DeleteLn (void)
 
int MvCursor (int x, int y)
 
int ClrEOL (void)
 
int ClrText (void)
 
int SetScrlReg (int top, int btm)
 
int ResetScrlReg (void)
 
int ClrStandout (void)
 
int SetStandout (void)
 

Variables

char * BC
 
char * UP
 
char * CS
 
char * SO
 
char * SE
 
char * CE
 
char * CL
 
char * HO
 
char * CM
 
char * TI
 
char * DL
 
char * SR
 
char * SF
 
int LI
 
int CO
 

Macro Definition Documentation

#define _winsize   winsize /* For compat with _ioctl.h. */

Definition at line 61 of file cursor.c.

#define TBUFSIZ   1024

Definition at line 63 of file cursor.c.

#define MAX_TERM_LEN   80

Definition at line 64 of file cursor.c.

Referenced by InitTermCap().

Function Documentation

int InitTermCap ( FILE *  fp)

Initialize termcap.

This function must be called first to read the termcap database and to specify the output stream.

Get individual parameters and control strings. Initialize the terminal. Use 'fp' as output stream.

Returns 1 for success, 0 for failure and prints appropriate diagnostic.

Definition at line 115 of file cursor.c.

References MAX_TERM_LEN, PutChr(), and TI.

Here is the call graph for this function:

int HmCursor ( void  )

Home the cursor.

Definition at line 201 of file cursor.c.

References HO, and PutChr().

Here is the call graph for this function:

int ScrollUp ( void  )

Forward scroll 1 line.

Definition at line 213 of file cursor.c.

References PutChr(), and SF.

Here is the call graph for this function:

int ScrollDn ( void  )

Reverse scroll 1 line.

Definition at line 225 of file cursor.c.

References PutChr(), and SR.

Here is the call graph for this function:

int DeleteLn ( void  )

Delete the current line.

Definition at line 237 of file cursor.c.

References DL, and PutChr().

Here is the call graph for this function:

int MvCursor ( int  x,
int  y 
)

Move the cursor to screen coordinates x, y.

Definition at line 249 of file cursor.c.

References CM, and PutChr().

Here is the call graph for this function:

int ClrEOL ( void  )

Clear from the cursor to end of line.

Definition at line 265 of file cursor.c.

References CE, and PutChr().

Here is the call graph for this function:

int ClrText ( void  )

Clear screen and home cursor.

Definition at line 277 of file cursor.c.

References CL, LI, and PutChr().

Here is the call graph for this function:

int SetScrlReg ( int  top,
int  btm 
)

Set the scrolling region to be from "top" to "btm".

Definition at line 289 of file cursor.c.

References CS, and PutChr().

Here is the call graph for this function:

int ResetScrlReg ( void  )

Reset the scrolling region to the entire screen.

Definition at line 301 of file cursor.c.

References CS, LI, and PutChr().

Here is the call graph for this function:

int ClrStandout ( void  )

End standout mode.

Definition at line 313 of file cursor.c.

References PutChr(), and SE.

Here is the call graph for this function:

int SetStandout ( void  )

These below functions output terminal control strings to the file stream specified by the InitTermCap() call which must precede them. They return 0 if the capability is not described in the termcap database and 1 otherwise. Of course if the database entry is wrong, the command will not do its job. Begin standout mode.

Definition at line 325 of file cursor.c.

References PutChr(), and SO.

Here is the call graph for this function:

Variable Documentation

char* BC
char* CS

Definition at line 86 of file cursor.c.

Referenced by ResetScrlReg(), and SetScrlReg().

char* SO

Definition at line 87 of file cursor.c.

Referenced by SetStandout().

char* SE

Definition at line 88 of file cursor.c.

Referenced by ClrStandout().

char* CE

Definition at line 89 of file cursor.c.

Referenced by ClrEOL().

char* CL

Definition at line 90 of file cursor.c.

Referenced by ClrText().

char* HO

Definition at line 91 of file cursor.c.

Referenced by HmCursor().

char* CM

Definition at line 92 of file cursor.c.

Referenced by MvCursor().

char* TI

Definition at line 93 of file cursor.c.

Referenced by InitTermCap().

char* DL

Definition at line 94 of file cursor.c.

Referenced by DeleteLn().

char* SR

Definition at line 95 of file cursor.c.

Referenced by ScrollDn().

char* SF

Definition at line 96 of file cursor.c.

Referenced by ScrollUp().

int LI

Definition at line 99 of file cursor.c.

Referenced by ClrText(), and ResetScrlReg().

int CO

Definition at line 100 of file cursor.c.