1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/include/io.h
Martijn Dekker 807863c29a Update author attributions in all source files
This commit:

1. Updates the COPYRIGHT file with all the contributors to ksh
   93u+m since the reboot, based on the commit history, sorted by
   number of commits in descending order. It also separates the
   authors of backported contributions from direct contributors.

2. Adds missing contributors of source each file to that file's
   copyright header based on that file's commit history.

The script used to maintain this is now up at:
https://github.com/ksh93/ksh/wiki/update-copyright.sh

In addition, the original ast copyright notice is restored to
its EPL 1.0 version -- that is what AT&T Intellectual Property
originally licensed this code under, and we are the ones who
upgraded it to EPL 2.0 (as allowed by EPL 1.0) in 441dcc04.
The history should be accurate.
2022-07-31 00:47:08 +02:00

115 lines
3.9 KiB
C

/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 2.0 *
* *
* A copy of the License is available at *
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html *
* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) *
* *
* David Korn <dgk@research.att.com> *
* Martijn Dekker <martijn@inlv.org> *
* Johnothan King <johnothanking@protonmail.com> *
* *
***********************************************************************/
/*
* UNIX shell
* David Korn
*
*/
#include <ast.h>
#include <sfio.h>
#ifndef IOBSIZE
# define IOBSIZE (SF_BUFSIZE*sizeof(char*))
#endif /* IOBSIZE */
#define IOMAXTRY 20
/* used for output of shell errors */
#define ERRIO 2
#define IOREAD 001
#define IOWRITE 002
#define IODUP 004
#define IOSEEK 010
#define IONOSEEK 020
#define IOTTY 040
#define IOCLEX 0100
#define IOCLOSE (IOSEEK|IONOSEEK)
#define IOSUBSHELL 0x8000 /* must be larger than any file descriptor */
#define IOPICKFD 0x10000 /* file descriptor number was selected automatically */
#define IOHERESTRING 0x20000 /* allow here documents to be string streams */
#ifndef ARG_RAW
struct ionod;
#endif /* !ARG_RAW */
/*
* Check if there is an editor active while avoiding repetitive #if flaggery.
* The 0 definition is used to optimize out code if no editor is compiled in.
* (This is here and not in edit.h because io.h is far more widely included.)
*/
#if SHOPT_ESH && SHOPT_VSH
#define sh_editor_active() (sh_isoption(SH_VI) || sh_isoption(SH_EMACS) || sh_isoption(SH_GMACS))
#elif SHOPT_ESH
#define sh_editor_active() (sh_isoption(SH_EMACS) || sh_isoption(SH_GMACS))
#elif SHOPT_VSH
#define sh_editor_active() (sh_isoption(SH_VI)!=0)
#else
#define sh_editor_active() 0
#endif
extern int sh_iocheckfd(int);
extern void sh_ioinit(void);
extern int sh_iomovefd(int);
extern int sh_iorenumber(int,int);
extern void sh_pclose(int[]);
extern int sh_rpipe(int[]);
extern void sh_iorestore(int,int);
extern Sfio_t *sh_iostream(int);
extern int sh_redirect(struct ionod*,int);
extern void sh_iosave(int,int,char*);
extern int sh_iovalidfd(int);
extern int sh_iosafefd(int);
extern int sh_inuse(int);
extern void sh_iounsave(void);
extern void sh_iounpipe(void);
extern int sh_chkopen(const char*);
extern int sh_ioaccess(int,int);
extern int sh_isdevfd(const char*);
/* the following are readonly */
extern const char e_copexists[];
extern const char e_query[];
extern const char e_history[];
extern const char e_argtype[];
extern const char e_create[];
extern const char e_tmpcreate[];
extern const char e_exists[];
extern const char e_file[];
extern const char e_redirect[];
extern const char e_formspec[];
extern const char e_badregexp[];
extern const char e_open[];
extern const char e_notseek[];
extern const char e_noread[];
extern const char e_badseek[];
extern const char e_badwrite[];
extern const char e_badpattern[];
extern const char e_toomany[];
extern const char e_pipe[];
extern const char e_unknown[];
extern const char e_devnull[];
extern const char e_profile[];
extern const char e_sysprofile[];
#if SHOPT_SYSRC
extern const char e_sysrc[];
#endif
extern const char e_stdprompt[];
extern const char e_supprompt[];
extern const char e_ambiguous[];