src/commands/mined/mined.h File Reference

#include <minix/config.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>

Go to the source code of this file.

Classes

struct  Line
struct  regex

Defines

#define YMAX   24
#define X_PLUS   ' '
#define Y_PLUS   ' '
#define XMAX   79
#define SCREENMAX   (YMAX - 1)
#define XBREAK   (XMAX - 0)
#define SHIFT_SIZE   25
#define SHIFT_MARK   '!'
#define MAX_CHARS   1024
#define LINE_START
#define LINE_END   (MAX_CHARS + 1)
#define LINE_LEN   (XMAX + 1)
#define SCREEN_SIZE   (XMAX * YMAX)
#define BLOCK_SIZE   1024
#define ERRORS   -1
#define NO_LINE   (ERRORS - 1)
#define FINE   (ERRORS + 1)
#define NO_INPUT   (ERRORS + 2)
#define STD_OUT   1
#define MEMORY_SIZE   (50 * 1024)
#define REPORT   2
#define FALSE   0
#define TRUE   1
#define NOT_VALID   2
#define VALID   3
#define OFF   4
#define ON   5
#define FORWARD   6
#define REVERSE   7
#define SMALLER   8
#define BIGGER   9
#define SAME   10
#define EMPTY   11
#define NO_DELETE   12
#define DELETE   13
#define READ   14
#define WRITE   15
#define DUMMY   0x80
#define DUMMY_MASK   0x7F
#define NO_MATCH   0
#define MATCH   1
#define REG_ERROR   2
#define BEGIN_LINE   (2 * REG_ERROR)
#define END_LINE   (2 * BEGIN_LINE)
#define NIL_PTR   ((char *) 0)
#define NIL_LINE   ((LINE *) 0)
#define NIL_REG   ((REGEX *) 0)
#define NIL_INT   ((int *) 0)
#define clear_buffer()   (out_count = 0)
#define putchar(c)   (void) write_char(STD_OUT, (c))
#define ring_bell()   putchar('\07')
#define string_print(str)   (void) writeline(STD_OUT, (str))
#define flush()   (void) flush_buffer(STD_OUT)
#define tab(cnt)   (((cnt) + 8) & ~07)
#define is_tab(c)   ((c) == '\t')
#define white_space(c)   ((c) == ' ' || (c) == '\t')
#define alpha(c)   ((c) != ' ' && (c) != '\t' && (c) != '\n')
#define line_print(line)   put_line(line, 0, TRUE)
#define move_to(nx, ny)   move((nx), NIL_PTR, (ny))
#define move_address(address)   move(0, (address), y)
#define status_line(str1, str2)
#define error(str1, str2)
#define get_string(str1, str2, fl)   bottom_line(ON, (str1), NIL_PTR, (str2), fl)
#define clear_status()
#define fstatus(mess, cnt)
#define get_shift(cnt)   ((cnt) & DUMMY_MASK)

Typedefs

typedef int FLAG
typedef struct Line LINE
typedef struct regex REGEX

Functions

 _PROTOTYPE (void FS,(void))
 _PROTOTYPE (int WT,(void))
 _PROTOTYPE (LINE *proceed,(LINE *line, int count))
 _PROTOTYPE (int bottom_line,(FLAG revfl, char *s1, char *s2, char *inbuf, FLAG statfl))
 _PROTOTYPE (int count_chars,(LINE *line))
 _PROTOTYPE (void move,(int new_x, char *new_address, int new_y))
 _PROTOTYPE (int find_x,(LINE *line, char *address))
 _PROTOTYPE (char *find_address,(LINE *line, int x_coord, int *old_x))
 _PROTOTYPE (int length_of,(char *string))
 _PROTOTYPE (void copy_string,(char *to, char *from))
 _PROTOTYPE (void reset,(LINE *head_line, int screen_y))
 _PROTOTYPE (void set_cursor,(int nx, int ny))
 _PROTOTYPE (void display,(int x_coord, int y_coord, LINE *line, int count))
 _PROTOTYPE (int write_char,(int fd, int c))
 _PROTOTYPE (int writeline,(int fd, char *text))
 _PROTOTYPE (void put_line,(LINE *line, int offset, FLAG clear_line))
 _PROTOTYPE (int flush_buffer,(int fd))
 _PROTOTYPE (void bad_write,(int fd))
 _PROTOTYPE (void catch,(int sig))
 _PROTOTYPE (void raw_mode,(FLAG state))
 _PROTOTYPE (void panic,(char *message))
 _PROTOTYPE (char *alloc,(int bytes))
 _PROTOTYPE (void free_space,(char *p))
 _PROTOTYPE (char *basename,(char *path))
 _PROTOTYPE (void load_file,(char *file))
 _PROTOTYPE (int get_line,(int fd, char *buffer))
 _PROTOTYPE (LINE *install_line,(char *buffer, int length))
 _PROTOTYPE (void main,(int argc, char *argv[]))
 _PROTOTYPE (void file_status,(char *message, long count, char *file, int lines, FLAG writefl, FLAG changed))
void build_string ()
 _PROTOTYPE (char *num_out,(long number))
 _PROTOTYPE (int get_number,(char *message, int *result))
 _PROTOTYPE (int input,(char *inbuf, FLAG clearfl))
 _PROTOTYPE (int get_file,(char *message, char *file))
 _PROTOTYPE (void _putchar,(int c))
 _PROTOTYPE (void move_previous_word,(FLAG remove))
 _PROTOTYPE (void S,(int character))
 _PROTOTYPE (LINE *line_insert,(LINE *line, char *string, int len))
 _PROTOTYPE (int insert,(LINE *line, char *location, char *string))
 _PROTOTYPE (LINE *line_delete,(LINE *line))
 _PROTOTYPE (void delete,(LINE *start_line, char *start_textp, LINE *end_line, char *end_textp))
 _PROTOTYPE (void file_insert,(int fd, FLAG old_pos))
 _PROTOTYPE (void yank,(LINE *start_line, char *start_textp, LINE *end_line, char *end_textp, FLAG remove))
 _PROTOTYPE (int scratch_file,(FLAG mode))
 _PROTOTYPE (REGEX *get_expression,(char *message))
 _PROTOTYPE (void change,(char *message, FLAG file))
 _PROTOTYPE (char *substitute,(LINE *line, REGEX *program, char *replacement))
 _PROTOTYPE (void search,(char *message, FLAG method))
 _PROTOTYPE (int find_y,(LINE *match_line))
 _PROTOTYPE (void finished,(REGEX *program, int *last_exp))
 _PROTOTYPE (void compile,(char *pattern, REGEX *program))
 _PROTOTYPE (LINE *match,(REGEX *program, char *string, FLAG method))
 _PROTOTYPE (int line_check,(REGEX *program, char *string, FLAG method))
 _PROTOTYPE (int check_string,(REGEX *program, char *string, int *expression))
 _PROTOTYPE (int star,(REGEX *program, char *end_position, char *string, int *expression))
 _PROTOTYPE (int in_list,(int *list, int c, int list_length, int opcode))

Variables

char * enter_string
char * rev_video
char * normal_video
char * rev_scroll
char * pos_string
int nlines
LINEheader
LINEtail
LINEtop_line
LINEbot_line
LINEcur_line
char * cur_text
int last_y
int ymax
int screenmax
char screen [SCREEN_SIZE]
int x
int y
FLAG modified
FLAG stat_visible
FLAG writable
FLAG quit
FLAG rpipe
int input_fd
FLAG loading
int out_count
char file_name [LINE_LEN]
char text_buffer [MAX_CHARS]
char * blank_line
char yank_file []
FLAG yank_status
long chars_saved


Define Documentation

#define alpha ( c   )     ((c) != ' ' && (c) != '\t' && (c) != '\n')

Definition at line 203 of file mined.h.

#define BEGIN_LINE   (2 * REG_ERROR)

Definition at line 110 of file mined.h.

#define BIGGER   9

Definition at line 79 of file mined.h.

#define BLOCK_SIZE   1024

Definition at line 47 of file mined.h.

 
#define clear_buffer (  )     (out_count = 0)

Definition at line 171 of file mined.h.

 
#define clear_status (  ) 

Value:

Definition at line 228 of file mined.h.

#define DELETE   13

Definition at line 83 of file mined.h.

#define DUMMY   0x80

Definition at line 102 of file mined.h.

#define DUMMY_MASK   0x7F

Definition at line 103 of file mined.h.

#define EMPTY   11

Definition at line 81 of file mined.h.

#define END_LINE   (2 * BEGIN_LINE)

Definition at line 111 of file mined.h.

#define error ( str1,
str2   ) 

Value:

(void) bottom_line(ON, (str1), \
                                                    (str2), NIL_PTR, FALSE)

Definition at line 225 of file mined.h.

#define ERRORS   -1

Definition at line 50 of file mined.h.

#define FALSE   0

Definition at line 66 of file mined.h.

#define FINE   (ERRORS + 1)

Definition at line 52 of file mined.h.

#define flush ( void   )     (void) flush_buffer(STD_OUT)

Definition at line 191 of file mined.h.

#define FORWARD   6

Definition at line 74 of file mined.h.

#define fstatus ( mess,
cnt   ) 

Value:

file_status((mess), (cnt), file_name, \
                                             nlines, writable, modified)

Definition at line 234 of file mined.h.

#define get_shift ( cnt   )     ((cnt) & DUMMY_MASK)

Definition at line 240 of file mined.h.

#define get_string ( str1,
str2,
fl   )     bottom_line(ON, (str1), NIL_PTR, (str2), fl)

Definition at line 227 of file mined.h.

#define is_tab ( c   )     ((c) == '\t')

Definition at line 197 of file mined.h.

#define LINE_END   (MAX_CHARS + 1)

Definition at line 43 of file mined.h.

#define LINE_LEN   (XMAX + 1)

Definition at line 45 of file mined.h.

#define line_print ( line   )     put_line(line, 0, TRUE)

Definition at line 208 of file mined.h.

#define LINE_START

Value:

Definition at line 41 of file mined.h.

#define MATCH   1

Definition at line 107 of file mined.h.

#define MAX_CHARS   1024

Definition at line 38 of file mined.h.

#define MEMORY_SIZE   (50 * 1024)

Definition at line 58 of file mined.h.

#define move_address ( address   )     move(0, (address), y)

Definition at line 218 of file mined.h.

#define move_to ( nx,
ny   )     move((nx), NIL_PTR, (ny))

Definition at line 213 of file mined.h.

#define NIL_INT   ((int *) 0)

Definition at line 134 of file mined.h.

#define NIL_LINE   ((LINE *) 0)

Definition at line 132 of file mined.h.

#define NIL_PTR   ((char *) 0)

Definition at line 131 of file mined.h.

#define NIL_REG   ((REGEX *) 0)

Definition at line 133 of file mined.h.

#define NO_DELETE   12

Definition at line 82 of file mined.h.

#define NO_INPUT   (ERRORS + 2)

Definition at line 53 of file mined.h.

#define NO_LINE   (ERRORS - 1)

Definition at line 51 of file mined.h.

#define NO_MATCH   0

Definition at line 106 of file mined.h.

#define NOT_VALID   2

Definition at line 68 of file mined.h.

#define OFF   4

Definition at line 70 of file mined.h.

#define ON   5

Definition at line 71 of file mined.h.

#define putchar ( c   )     (void) write_char(STD_OUT, (c))

Definition at line 176 of file mined.h.

#define READ   14

Definition at line 84 of file mined.h.

#define REG_ERROR   2

Definition at line 108 of file mined.h.

#define REPORT   2

Definition at line 61 of file mined.h.

#define REVERSE   7

Definition at line 75 of file mined.h.

 
#define ring_bell (  )     putchar('\07')

Definition at line 181 of file mined.h.

#define SAME   10

Definition at line 80 of file mined.h.

#define SCREEN_SIZE   (XMAX * YMAX)

Definition at line 46 of file mined.h.

#define SCREENMAX   (YMAX - 1)

Definition at line 34 of file mined.h.

#define SHIFT_MARK   '!'

Definition at line 37 of file mined.h.

#define SHIFT_SIZE   25

Definition at line 36 of file mined.h.

#define SMALLER   8

Definition at line 78 of file mined.h.

#define status_line ( str1,
str2   ) 

Value:

(void) bottom_line(ON, (str1), \
                                                    (str2), NIL_PTR, FALSE)

Definition at line 223 of file mined.h.

#define STD_OUT   1

Definition at line 55 of file mined.h.

#define string_print ( str   )     (void) writeline(STD_OUT, (str))

Definition at line 186 of file mined.h.

#define tab ( cnt   )     (((cnt) + 8) & ~07)

Definition at line 196 of file mined.h.

#define TRUE   1

Definition at line 67 of file mined.h.

#define VALID   3

Definition at line 69 of file mined.h.

#define white_space ( c   )     ((c) == ' ' || (c) == '\t')

Definition at line 202 of file mined.h.

#define WRITE   15

Definition at line 85 of file mined.h.

#define X_PLUS   ' '

Definition at line 29 of file mined.h.

#define XBREAK   (XMAX - 0)

Definition at line 35 of file mined.h.

#define XMAX   79

Definition at line 33 of file mined.h.

#define Y_PLUS   ' '

Definition at line 30 of file mined.h.

#define YMAX   24

Definition at line 22 of file mined.h.


Typedef Documentation

typedef int FLAG

Definition at line 63 of file mined.h.

typedef struct Line LINE

Definition at line 99 of file mined.h.

typedef struct regex REGEX

Definition at line 128 of file mined.h.


Function Documentation

_PROTOTYPE ( int  in_list,
(int *list, int c, int list_length, int opcode  
)

_PROTOTYPE ( int  star,
(REGEX *program, char *end_position, char *string, int *expression  
)

_PROTOTYPE ( int  check_string,
(REGEX *program, char *string, int *expression  
)

_PROTOTYPE ( int  line_check,
(REGEX *program, char *string, FLAG method)   
)

_PROTOTYPE ( LINE match,
(REGEX *program, char *string, FLAG method)   
)

_PROTOTYPE ( void  compile,
(char *pattern, REGEX *program  
)

_PROTOTYPE ( void  finished,
(REGEX *program, int *last_exp)   
)

_PROTOTYPE ( int  find_y,
(LINE *match_line)   
)

_PROTOTYPE ( void  search,
(char *message, FLAG method)   
)

_PROTOTYPE ( char *  substitute,
(LINE *line, REGEX *program, char *replacement)   
)

_PROTOTYPE ( void  change,
(char *message, FLAG file  
)

_PROTOTYPE ( REGEX get_expression,
(char *message  
)

_PROTOTYPE ( int  scratch_file,
(FLAG mode  
)

_PROTOTYPE ( void  yank,
(LINE *start_line, char *start_textp, LINE *end_line, char *end_textp, FLAG remove)   
)

_PROTOTYPE ( void  file_insert,
(int fd, FLAG old_pos)   
)

_PROTOTYPE ( void  delete,
(LINE *start_line, char *start_textp, LINE *end_line, char *end_textp)   
)

_PROTOTYPE ( LINE line_delete,
(LINE *line  
)

_PROTOTYPE ( int  insert,
(LINE *line, char *location, char *string  
)

_PROTOTYPE ( LINE line_insert,
(LINE *line, char *string, int len  
)

_PROTOTYPE ( void  S,
(int character)   
)

_PROTOTYPE ( void  move_previous_word,
(FLAG remove)   
)

_PROTOTYPE ( void  _putchar,
(int c  
)

_PROTOTYPE ( int  get_file,
(char *message, char *file  
)

_PROTOTYPE ( int  input,
(char *inbuf, FLAG clearfl  
)

_PROTOTYPE ( int  get_number,
(char *message, int *result  
)

_PROTOTYPE ( char *  num_out,
(long number)   
)

_PROTOTYPE ( void  file_status,
(char *message, long count, char *file, int lines, FLAG writefl, FLAG changed  
)

_PROTOTYPE ( void  main,
(int argc, char *argv[])   
)

_PROTOTYPE ( LINE install_line,
(char *buffer, int length)   
)

_PROTOTYPE ( int  get_line,
(int fd, char *buffer  
)

_PROTOTYPE ( void  load_file,
(char *file  
)

_PROTOTYPE ( char *  basename,
(char *path  
)

_PROTOTYPE ( void  free_space,
(char *p  
)

_PROTOTYPE ( char *  alloc,
(int bytes)   
)

_PROTOTYPE ( void  panic,
(char *message  
)

_PROTOTYPE ( void  raw_mode,
(FLAG state  
)

_PROTOTYPE ( void  catch,
(int sig  
)

_PROTOTYPE ( void  bad_write,
(int fd  
)

_PROTOTYPE ( int  flush_buffer,
(int fd  
)

_PROTOTYPE ( void  put_line,
(LINE *line, int offset, FLAG clear_line)   
)

_PROTOTYPE ( int  writeline,
(int fd, char *text  
)

_PROTOTYPE ( int  write_char,
(int fd, int c  
)

_PROTOTYPE ( void  display,
(int x_coord, int y_coord, LINE *line, int count)   
)

_PROTOTYPE ( void  set_cursor,
(int nx, int ny)   
)

_PROTOTYPE ( void  reset,
(LINE *head_line, int screen_y)   
)

_PROTOTYPE ( void  copy_string,
(char *to, char *from)   
)

_PROTOTYPE ( int  length_of,
(char *string  
)

_PROTOTYPE ( char *  find_address,
(LINE *line, int x_coord, int *old_x)   
)

_PROTOTYPE ( int  find_x,
(LINE *line, char *address)   
)

_PROTOTYPE ( void  move,
(int new_x, char *new_address, int new_y)   
)

_PROTOTYPE ( int  count_chars,
(LINE *line  
)

_PROTOTYPE ( int  bottom_line,
(FLAG revfl, char *s1, char *s2, char *inbuf, FLAG statfl)   
)

_PROTOTYPE ( LINE proceed,
(LINE *line, int count)   
)

_PROTOTYPE ( int  WT,
(void)   
)

_PROTOTYPE ( void  FS,
(void)   
)

void build_string (  ) 


Variable Documentation

char* blank_line

Definition at line 1246 of file mined1.c.

Definition at line 1220 of file mined1.c.

Definition at line 1254 of file mined1.c.

Definition at line 1218 of file mined1.c.

char* cur_text

Definition at line 1221 of file mined1.c.

char* enter_string

Definition at line 1241 of file mined1.c.

char file_name[LINE_LEN]

Definition at line 41 of file ctags.c.

Definition at line 49 of file skeleton.c.

int input_fd

Definition at line 1232 of file mined1.c.

int last_y

Definition at line 1222 of file mined1.c.

Definition at line 1229 of file mined1.c.

Definition at line 1226 of file mined1.c.

int nlines

Definition at line 23 of file vars.c.

char* normal_video

Definition at line 1245 of file mined1.c.

int out_count

Definition at line 1233 of file mined1.c.

char* pos_string

Definition at line 1242 of file mined1.c.

void quit

Definition at line 424 of file acd.c.

char* rev_scroll

Definition at line 1243 of file mined1.c.

char* rev_video

Definition at line 1244 of file mined1.c.

FLAG rpipe

Definition at line 1231 of file mined1.c.

static void screen

Definition at line 219 of file ttn.c.

int screenmax

Definition at line 422 of file mined1.c.

Definition at line 1227 of file mined1.c.

LINE* tail

Definition at line 1217 of file mined1.c.

char text_buffer[MAX_CHARS]

Definition at line 1235 of file mined1.c.

Definition at line 1219 of file mined1.c.

FLAG writable

Definition at line 1228 of file mined1.c.

int x

Definition at line 1225 of file mined1.c.

int y

Definition at line 1225 of file mined1.c.

char yank_file[]

Definition at line 1253 of file mined1.c.

Definition at line 1252 of file mined1.c.

int ymax

Definition at line 421 of file mined1.c.


Generated on Tue Mar 9 04:36:35 2010 for Minix by  doxygen 1.5.8