IOSS  2.0
Ioss_Getline.c File Reference
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <termios.h>
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "Ioss_Getline.h"
Include dependency graph for Ioss_Getline.c:

Macros

#define __unix__   1
 
#define HAVE_TERMIOS_H   1
 
#define LOCAL_PATH_DELIM   '/'
 
#define LOCAL_PATH_DELIM_STR   "/"
 
#define _StrFindLocalPathDelim(a)   strchr(a, LOCAL_PATH_DELIM)
 
#define _StrRFindLocalPathDelim(a)   strrchr(a, LOCAL_PATH_DELIM)
 
#define IsLocalPathDelim(c)   (c == LOCAL_PATH_DELIM)
 
#define _getline_c_   1
 
#define HIST_SIZE   100
 
#define GL_COMPLETE_VECTOR_BLOCK_SIZE   64
 

Functions

int kill (pid_t pid, int sig)
 
static int gl_tab (char *buf, int offset, int *loc, size_t bufsize)
 
static void gl_init (void)
 
static void gl_cleanup (void)
 
static void gl_char_init (void)
 
static void gl_char_cleanup (void)
 
static void gl_addchar (int c)
 
static void gl_del (int loc, int)
 
static void gl_error (const char *const buf)
 
static void gl_fixup (const char *prompt, int change, int cursor)
 
static int gl_getc (void)
 
static int gl_getcx (int)
 
static void gl_kill (int pos)
 
static void gl_newline (void)
 
static void gl_putc (int c)
 
static void gl_puts (const char *const buf)
 
static void gl_redraw (void)
 
static void gl_transpose (void)
 
static void gl_yank (void)
 
static void gl_word (int direction)
 
static void gl_killword (int direction)
 
static void hist_init (void)
 
static char * hist_next (void)
 
static char * hist_prev (void)
 
static char * hist_save (const char *p)
 
static void search_addchar (int c)
 
static void search_term (void)
 
static void search_back (int new_search)
 
static void search_forw (int new_search)
 
static void gl_beep (void)
 
static int gl_do_tab_completion (char *buf, int *loc, size_t bufsize, int tabtab)
 
static char * copy_string (char *dest, char const *source, long int elements)
 
void gl_setwidth (int w)
 
char * getline_int (const char *prompt)
 
void gl_histadd (const char *buf)
 
void gl_histsavefile (const char *const path)
 
void gl_histloadfile (const char *const path)
 
static void search_update (int c)
 
void gl_tab_completion (gl_tab_completion_proc proc)
 
void gl_set_home_dir (const char *homedir)
 
char * gl_local_filename_completion_proc (const char *start, int idx)
 

Variables

struct termios new_termios old_termios
 
gl_in_hook_proc gl_in_hook = 0
 
gl_out_hook_proc gl_out_hook = 0
 
gl_tab_hook_proc gl_tab_hook = gl_tab
 
gl_strlen_proc gl_strlen = (gl_strlen_proc)strlen
 
gl_tab_completion_proc gl_completion_proc = 0
 
int gl_filename_quoting_desired = -1
 
const char * gl_filename_quote_characters = " \t*?<>|;&()[]$`"
 
int gl_ellipses_during_completion = 1
 
int gl_completion_exact_match_extra_char
 
char gl_buf [GL_BUF_SIZE]
 
static int gl_init_done = -1
 
static int gl_termw = 80
 
static int gl_scroll = 27
 
static int gl_width = 0
 
static int gl_extent = 0
 
static int gl_overwrite = 0
 
static int gl_pos
 
static int gl_cnt = 0
 
static char gl_killbuf [GL_BUF_SIZE] = ""
 
static const char * gl_prompt
 
static char gl_intrc = 0
 
static char gl_quitc = 0
 
static char gl_suspc = 0
 
static char gl_dsuspc = 0
 
static int gl_search_mode = 0
 
static char ** gl_matchlist = 0
 
static char * gl_home_dir = NULL
 
static int gl_vi_preferred = -1
 
static int gl_vi_mode = 0
 
static int hist_pos = 0
 
static int hist_last = 0
 
static char * hist_buf [HIST_SIZE]
 
static char hist_empty_elem [2] = ""
 
static char search_prompt [101]
 
static char search_string [100]
 
static int search_pos = 0
 
static int search_forw_flg = 0
 
static int search_last = 0
 

Macro Definition Documentation

◆ __unix__

#define __unix__   1

◆ _getline_c_

#define _getline_c_   1

◆ _StrFindLocalPathDelim

#define _StrFindLocalPathDelim (   a)    strchr(a, LOCAL_PATH_DELIM)

◆ _StrRFindLocalPathDelim

#define _StrRFindLocalPathDelim (   a)    strrchr(a, LOCAL_PATH_DELIM)

◆ GL_COMPLETE_VECTOR_BLOCK_SIZE

#define GL_COMPLETE_VECTOR_BLOCK_SIZE   64

◆ HAVE_TERMIOS_H

#define HAVE_TERMIOS_H   1

◆ HIST_SIZE

#define HIST_SIZE   100

◆ IsLocalPathDelim

#define IsLocalPathDelim (   c)    (c == LOCAL_PATH_DELIM)

◆ LOCAL_PATH_DELIM

#define LOCAL_PATH_DELIM   '/'

◆ LOCAL_PATH_DELIM_STR

#define LOCAL_PATH_DELIM_STR   "/"

Function Documentation

◆ copy_string()

static char* copy_string ( char *  dest,
char const *  source,
long int  elements 
)
static

◆ getline_int()

char* getline_int ( const char *  prompt)

◆ gl_addchar()

static void gl_addchar ( int  c)
static

◆ gl_beep()

static void gl_beep ( void  )
static

◆ gl_char_cleanup()

static void gl_char_cleanup ( void  )
static

◆ gl_char_init()

static void gl_char_init ( void  )
static

◆ gl_cleanup()

static void gl_cleanup ( void  )
static

◆ gl_del()

static void gl_del ( int  loc,
int  killsave 
)
static

◆ gl_do_tab_completion()

static int gl_do_tab_completion ( char *  buf,
int *  loc,
size_t  bufsize,
int  tabtab 
)
static

◆ gl_error()

static void gl_error ( const char *const  buf)
static

◆ gl_fixup()

static void gl_fixup ( const char *  prompt,
int  change,
int  cursor 
)
static

◆ gl_getc()

static int gl_getc ( void  )
static

◆ gl_getcx()

static int gl_getcx ( int  tlen)
static

◆ gl_histadd()

void gl_histadd ( const char *  buf)

◆ gl_histloadfile()

void gl_histloadfile ( const char *const  path)

◆ gl_histsavefile()

void gl_histsavefile ( const char *const  path)

◆ gl_init()

static void gl_init ( void  )
static

◆ gl_kill()

static void gl_kill ( int  pos)
static

◆ gl_killword()

static void gl_killword ( int  direction)
static

◆ gl_local_filename_completion_proc()

char* gl_local_filename_completion_proc ( const char *  start,
int  idx 
)

◆ gl_newline()

static void gl_newline ( void  )
static

◆ gl_putc()

static void gl_putc ( int  c)
static

◆ gl_puts()

static void gl_puts ( const char *const  buf)
static

◆ gl_redraw()

static void gl_redraw ( void  )
static

◆ gl_set_home_dir()

void gl_set_home_dir ( const char *  homedir)

◆ gl_setwidth()

void gl_setwidth ( int  w)

◆ gl_tab()

static int gl_tab ( char *  buf,
int  offset,
int *  loc,
size_t  bufsize 
)
static

◆ gl_tab_completion()

void gl_tab_completion ( gl_tab_completion_proc  proc)

◆ gl_transpose()

static void gl_transpose ( void  )
static

◆ gl_word()

static void gl_word ( int  direction)
static

◆ gl_yank()

static void gl_yank ( void  )
static

◆ hist_init()

static void hist_init ( void  )
static

◆ hist_next()

static char * hist_next ( void  )
static

◆ hist_prev()

static char * hist_prev ( void  )
static

◆ hist_save()

static char * hist_save ( const char *  p)
static

◆ kill()

int kill ( pid_t  pid,
int  sig 
)

◆ search_addchar()

static void search_addchar ( int  c)
static

◆ search_back()

static void search_back ( int  new_search)
static

◆ search_forw()

static void search_forw ( int  new_search)
static

◆ search_term()

static void search_term ( void  )
static

◆ search_update()

static void search_update ( int  c)
static

Variable Documentation

◆ gl_buf

char gl_buf[GL_BUF_SIZE]

◆ gl_cnt

int gl_cnt = 0
static

◆ gl_completion_exact_match_extra_char

int gl_completion_exact_match_extra_char

◆ gl_completion_proc

gl_tab_completion_proc gl_completion_proc = 0

◆ gl_dsuspc

char gl_dsuspc = 0
static

◆ gl_ellipses_during_completion

int gl_ellipses_during_completion = 1

◆ gl_extent

int gl_extent = 0
static

◆ gl_filename_quote_characters

const char* gl_filename_quote_characters = " \t*?<>|;&()[]$`"

◆ gl_filename_quoting_desired

int gl_filename_quoting_desired = -1

◆ gl_home_dir

char* gl_home_dir = NULL
static

◆ gl_in_hook

gl_in_hook_proc gl_in_hook = 0

◆ gl_init_done

int gl_init_done = -1
static

◆ gl_intrc

char gl_intrc = 0
static

◆ gl_killbuf

char gl_killbuf[GL_BUF_SIZE] = ""
static

◆ gl_matchlist

char** gl_matchlist = 0
static

◆ gl_out_hook

gl_out_hook_proc gl_out_hook = 0

◆ gl_overwrite

int gl_overwrite = 0
static

◆ gl_pos

int gl_pos
static

◆ gl_prompt

const char* gl_prompt
static

◆ gl_quitc

char gl_quitc = 0
static

◆ gl_scroll

int gl_scroll = 27
static

◆ gl_search_mode

int gl_search_mode = 0
static

◆ gl_strlen

gl_strlen_proc gl_strlen = (gl_strlen_proc)strlen

◆ gl_suspc

char gl_suspc = 0
static

◆ gl_tab_hook

gl_tab_hook_proc gl_tab_hook = gl_tab

◆ gl_termw

int gl_termw = 80
static

◆ gl_vi_mode

int gl_vi_mode = 0
static

◆ gl_vi_preferred

int gl_vi_preferred = -1
static

◆ gl_width

int gl_width = 0
static

◆ hist_buf

char* hist_buf[HIST_SIZE]
static

◆ hist_empty_elem

char hist_empty_elem[2] = ""
static

◆ hist_last

int hist_last = 0
static

◆ hist_pos

int hist_pos = 0
static

◆ old_termios

struct termios new_termios old_termios

◆ search_forw_flg

int search_forw_flg = 0
static

◆ search_last

int search_last = 0
static

◆ search_pos

int search_pos = 0
static

◆ search_prompt

char search_prompt[101]
static

◆ search_string

char search_string[100]
static