/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#ifndef SEARCHSIZE
/*
* edit.h - common data structure for vi and emacs edit options
*
* David Korn
* AT&T Labs
*
*/
#else
#if !KSHELL
# include <setjmp.h>
# include <sig.h>
# include <ctype.h>
#endif /* KSHELL */
#include "terminal.h"
#if SHOPT_MULTIBYTE
# ifndef ESS_MAXCHAR
# include "national.h"
# endif /* ESS_MAXCHAR */
#else
typedef char genchar;
#endif /* SHOPT_MULTIBYTE */
typedef struct _edit_pos
{
unsigned short line;
unsigned short col;
} Edpos_t;
#if SHOPT_EDPREDICT
typedef struct Histmatch
{
int index;
short len;
short count;
} Histmatch_t;
#endif /* SHOPT_EDPREDICT */
typedef struct edit
{
int e_intr;
int e_kill;
int e_erase;
int e_werase;
int e_eof;
int e_lnext;
int e_fchar;
int e_repeat;
int e_saved;
int e_tabcount;
#ifdef _hdr_utime
char *e_tty;
#endif
#if SHOPT_OLDTERMIO
char e_echoctl;
char e_tcgeta;
#endif
#if SHOPT_MULTIBYTE
int e_curchar;
int e_cursize;
#endif
#if KSHELL
#else
#endif /* KSHELL */
#if SHOPT_EDPREDICT
unsigned short nhlist;
unsigned short hoff;
unsigned short hmax;
char *hstak;
#endif /* SHOPT_EDPREDICT */
} Edit_t;
#if ( 'a' == 97) /* ASCII? */
#else
(c=='I'?'\t':(c=='J'?'\n':(c=='T'?60:(c=='U'?61:(c=='V'?50: \
(c=='W'?38:(c=='Z'?63:(c=='['?39:(c==']'?29: \
(c<'J'?c+1-'A':(c+10-'J'))))))))))))))))
#endif
#if !KSHELL
extern char opt_flag;
# ifdef SYSCALL
# else
# endif /* SYSCALL */
#endif /* KSHELL */
extern void ed_putchar(Edit_t*, int);
extern void ed_ringbell(void);
extern int ed_getchar(Edit_t*,int);
extern int ed_window(void);
extern void ed_ungetchar(Edit_t*,int);
extern int ed_viread(void*, int, char*, int, int);
extern int ed_read(void*, int, char*, int, int);
extern int ed_emacsread(void*, int, char*, int, int);
#if KSHELL
extern int ed_fulledit(Edit_t*);
#endif /* KSHELL */
# if SHOPT_MULTIBYTE
extern int ed_internal(const char*, genchar*);
extern int ed_external(const genchar*, char*);
extern int ed_setwidth(const char*);
# endif /* SHOPT_MULTIBYTE */
#if SHOPT_EDPREDICT
extern int ed_histgen(Edit_t*, const char*);
extern void ed_histlist(Edit_t*, int);
#endif /* SHOPT_EDPREDICT */
extern const char e_runvi[];
#if !KSHELL
extern const char e_version[];
#endif /* KSHELL */
#if SHOPT_HISTEXPAND
/* flags */
/* modifier flags */
/* flags to be returned */
extern int hist_expand(const char *, char **);
#endif
#endif
#endif