ed.h (81220) | ed.h (90109) |
---|---|
1/* ed.h: type and constant definitions for the ed editor. */ 2/* 3 * Copyright (c) 1993 Andrew Moore 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * @(#)ed.h,v 1.5 1994/02/01 00:34:39 alm Exp | 1/* ed.h: type and constant definitions for the ed editor. */ 2/* 3 * Copyright (c) 1993 Andrew Moore 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * @(#)ed.h,v 1.5 1994/02/01 00:34:39 alm Exp |
28 * $FreeBSD: head/bin/ed/ed.h 81220 2001-08-06 22:01:31Z mike $ | 28 * $FreeBSD: head/bin/ed/ed.h 90109 2002-02-02 06:36:49Z imp $ |
29 */ 30 31#include <sys/param.h> 32#include <errno.h> 33#include <limits.h> 34#include <regex.h> 35#include <signal.h> 36#include <stdio.h> --- 133 unchanged lines hidden (view full) --- 170#define REMQUE(elem) REQUE((elem)->q_back, (elem)->q_forw); 171 172/* NUL_TO_NEWLINE: overwrite ASCII NULs with newlines */ 173#define NUL_TO_NEWLINE(s, l) translit_text(s, l, '\0', '\n') 174 175/* NEWLINE_TO_NUL: overwrite newlines with ASCII NULs */ 176#define NEWLINE_TO_NUL(s, l) translit_text(s, l, '\n', '\0') 177 | 29 */ 30 31#include <sys/param.h> 32#include <errno.h> 33#include <limits.h> 34#include <regex.h> 35#include <signal.h> 36#include <stdio.h> --- 133 unchanged lines hidden (view full) --- 170#define REMQUE(elem) REQUE((elem)->q_back, (elem)->q_forw); 171 172/* NUL_TO_NEWLINE: overwrite ASCII NULs with newlines */ 173#define NUL_TO_NEWLINE(s, l) translit_text(s, l, '\0', '\n') 174 175/* NEWLINE_TO_NUL: overwrite newlines with ASCII NULs */ 176#define NEWLINE_TO_NUL(s, l) translit_text(s, l, '\n', '\0') 177 |
178#ifdef sun 179# define strerror(n) sys_errlist[n] 180#endif 181 182#ifndef __P 183# ifndef __STDC__ 184# define __P(proto) () 185# else 186# define __P(proto) proto 187# endif 188#endif 189 | |
190/* Local Function Declarations */ | 178/* Local Function Declarations */ |
191void add_line_node __P((line_t *)); 192int append_lines __P((long)); 193int apply_subst_template __P((const char *, regmatch_t *, int, int)); 194int build_active_list __P((int)); 195int cbc_decode __P((char *, FILE *)); 196int cbc_encode __P((char *, int, FILE *)); 197int check_addr_range __P((long, long)); 198void clear_active_list __P((void)); 199void clear_undo_stack __P((void)); 200int close_sbuf __P((void)); 201int copy_lines __P((long)); 202int delete_lines __P((long, long)); 203void des_error __P((const char *)); 204int display_lines __P((long, long, int)); 205line_t *dup_line_node __P((line_t *)); 206int exec_command __P((void)); 207long exec_global __P((int, int)); 208void expand_des_key __P((char *, char *)); 209int extract_addr_range __P((void)); 210char *extract_pattern __P((int)); 211int extract_subst_tail __P((int *, long *)); 212char *extract_subst_template __P((void)); 213int filter_lines __P((long, long, char *)); 214int flush_des_file __P((FILE *)); 215line_t *get_addressed_line_node __P((long)); 216pattern_t *get_compiled_pattern __P((void)); 217int get_des_char __P((FILE *)); 218char *get_extended_line __P((int *, int)); 219char *get_filename __P((void)); 220int get_keyword __P((void)); 221long get_line_node_addr __P((line_t *)); 222long get_matching_node_addr __P((pattern_t *, int)); 223long get_marked_node_addr __P((int)); 224char *get_sbuf_line __P((line_t *)); 225int get_shell_command __P((void)); 226int get_stream_line __P((FILE *)); 227int get_tty_line __P((void)); 228void handle_hup __P((int)); 229void handle_int __P((int)); 230void handle_winch __P((int)); 231int has_trailing_escape __P((char *, char *)); 232int hex_to_binary __P((int, int)); 233void init_buffers __P((void)); 234void init_des_cipher __P((void)); 235int is_legal_filename __P((char *)); 236int join_lines __P((long, long)); 237int mark_line_node __P((line_t *, int)); 238int move_lines __P((long)); 239line_t *next_active_node __P((void)); 240long next_addr __P((void)); 241int open_sbuf __P((void)); 242char *parse_char_class __P((char *)); 243int pop_undo_stack __P((void)); 244undo_t *push_undo_stack __P((int, long, long)); 245int put_des_char __P((int, FILE *)); 246const char *put_sbuf_line __P((const char *)); 247int put_stream_line __P((FILE *, const char *, int)); 248int put_tty_line __P((const char *, int, long, int)); 249void quit __P((int)); 250long read_file __P((char *, long)); 251long read_stream __P((FILE *, long)); 252int search_and_replace __P((pattern_t *, int, int)); 253int set_active_node __P((line_t *)); 254void set_des_key __P((char *)); 255void signal_hup __P((int)); 256void signal_int __P((int)); 257char *strip_escapes __P((char *)); 258int substitute_matching_text __P((pattern_t *, line_t *, int, int)); 259char *translit_text __P((char *, int, int, int)); 260void unmark_line_node __P((line_t *)); 261void unset_active_nodes __P((line_t *, line_t *)); 262long write_file __P((char *, const char *, long, long)); 263long write_stream __P((FILE *, long, long)); | 179void add_line_node(line_t *); 180int append_lines(long); 181int apply_subst_template(const char *, regmatch_t *, int, int); 182int build_active_list(int); 183int cbc_decode(char *, FILE *); 184int cbc_encode(char *, int, FILE *); 185int check_addr_range(long, long); 186void clear_active_list(void); 187void clear_undo_stack(void); 188int close_sbuf(void); 189int copy_lines(long); 190int delete_lines(long, long); 191void des_error(const char *); 192int display_lines(long, long, int); 193line_t *dup_line_node(line_t *); 194int exec_command(void); 195long exec_global(int, int); 196void expand_des_key(char *, char *); 197int extract_addr_range(void); 198char *extract_pattern(int); 199int extract_subst_tail(int *, long *); 200char *extract_subst_template(void); 201int filter_lines(long, long, char *); 202int flush_des_file(FILE *); 203line_t *get_addressed_line_node(long); 204pattern_t *get_compiled_pattern(void); 205int get_des_char(FILE *); 206char *get_extended_line(int *, int); 207char *get_filename(void); 208int get_keyword(void); 209long get_line_node_addr(line_t *); 210long get_matching_node_addr(pattern_t *, int); 211long get_marked_node_addr(int); 212char *get_sbuf_line(line_t *); 213int get_shell_command(void); 214int get_stream_line(FILE *); 215int get_tty_line(void); 216void handle_hup(int); 217void handle_int(int); 218void handle_winch(int); 219int has_trailing_escape(char *, char *); 220int hex_to_binary(int, int); 221void init_buffers(void); 222void init_des_cipher(void); 223int is_legal_filename(char *); 224int join_lines(long, long); 225int mark_line_node(line_t *, int); 226int move_lines(long); 227line_t *next_active_node(void); 228long next_addr(void); 229int open_sbuf(void); 230char *parse_char_class(char *); 231int pop_undo_stack(void); 232undo_t *push_undo_stack(int, long, long); 233int put_des_char(int, FILE *); 234const char *put_sbuf_line(const char *); 235int put_stream_line(FILE *, const char *, int); 236int put_tty_line(const char *, int, long, int); 237void quit(int); 238long read_file(char *, long); 239long read_stream(FILE *, long); 240int search_and_replace(pattern_t *, int, int); 241int set_active_node(line_t *); 242void set_des_key(char *); 243void signal_hup(int); 244void signal_int(int); 245char *strip_escapes(char *); 246int substitute_matching_text(pattern_t *, line_t *, int, int); 247char *translit_text(char *, int, int, int); 248void unmark_line_node(line_t *); 249void unset_active_nodes(line_t *, line_t *); 250long write_file(char *, const char *, long, long); 251long write_stream(FILE *, long, long); |
264 265/* global buffers */ 266extern char stdinbuf[]; 267extern char *ibuf; 268extern char *ibufp; 269extern int ibufsz; 270 271/* global flags */ --- 5 unchanged lines hidden (view full) --- 277 278/* global vars */ 279extern long addr_last; 280extern long current_addr; 281extern const char *errmsg; 282extern long first_addr; 283extern int lineno; 284extern long second_addr; | 252 253/* global buffers */ 254extern char stdinbuf[]; 255extern char *ibuf; 256extern char *ibufp; 257extern int ibufsz; 258 259/* global flags */ --- 5 unchanged lines hidden (view full) --- 265 266/* global vars */ 267extern long addr_last; 268extern long current_addr; 269extern const char *errmsg; 270extern long first_addr; 271extern int lineno; 272extern long second_addr; |
285#ifdef sun 286extern char *sys_errlist[]; 287#endif | |