diff options
author | 2015-10-04 15:23:24 +0000 | |
---|---|---|
committer | 2015-10-04 15:23:24 +0000 | |
commit | 6cdce3367b1fcfaabff4e1f2f7fcf03f7fc66a4d (patch) | |
tree | 12f8247c37081a00eea7e449397f03bde323bdf1 | |
parent | Apply some style(9), tweak a few things for readability and add some (diff) | |
download | wireguard-openbsd-6cdce3367b1fcfaabff4e1f2f7fcf03f7fc66a4d.tar.xz wireguard-openbsd-6cdce3367b1fcfaabff4e1f2f7fcf03f7fc66a4d.zip |
Remove useless pattern_t typedef, POSIX regex is here to stay so
just use regex_t directly.
-rw-r--r-- | bin/ed/ed.h | 12 | ||||
-rw-r--r-- | bin/ed/glbl.c | 4 | ||||
-rw-r--r-- | bin/ed/main.c | 8 | ||||
-rw-r--r-- | bin/ed/re.c | 8 | ||||
-rw-r--r-- | bin/ed/sub.c | 6 |
5 files changed, 18 insertions, 20 deletions
diff --git a/bin/ed/ed.h b/bin/ed/ed.h index 25dffc6404c..2a5109dccad 100644 --- a/bin/ed/ed.h +++ b/bin/ed/ed.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ed.h,v 1.17 2015/10/04 15:03:24 millert Exp $ */ +/* $OpenBSD: ed.h,v 1.18 2015/10/04 15:23:24 millert Exp $ */ /* $NetBSD: ed.h,v 1.23 1995/03/21 09:04:40 cgd Exp $ */ /* ed.h: type and constant definitions for the ed editor. */ @@ -55,8 +55,6 @@ #define GNP 010 /* enumerate after command */ #define GSG 020 /* global substitute */ -typedef regex_t pattern_t; - /* Line node */ typedef struct line { struct line *q_forw; @@ -170,11 +168,11 @@ char *extract_pattern(int); int extract_subst_tail(int *, int *); char *extract_subst_template(void); line_t *get_addressed_line_node(int); -pattern_t *get_compiled_pattern(void); +regex_t *get_compiled_pattern(void); char *get_extended_line(int *, int); char *get_filename(void); int get_line_node_addr(line_t *); -int get_matching_node_addr(pattern_t *, int); +int get_matching_node_addr(regex_t *, int); int get_marked_node_addr(int); char *get_sbuf_line(line_t *); int get_shell_command(void); @@ -200,13 +198,13 @@ int put_tty_line(char *, int, int, int); void quit(int); int read_file(char *, int); int read_stream(FILE *, int); -int search_and_replace(pattern_t *, int, int); +int search_and_replace(regex_t *, int, int); int set_active_node(line_t *); void seterrmsg(char *); void signal_hup(int); void signal_int(int); char *strip_escapes(char *); -int substitute_matching_text(pattern_t *, line_t *, int, int); +int substitute_matching_text(regex_t *, line_t *, int, int); char *translit_text(char *, int, int, int); void unmark_line_node(line_t *); void unset_active_nodes(line_t *, line_t *); diff --git a/bin/ed/glbl.c b/bin/ed/glbl.c index 923e612acb4..5e4dca9252f 100644 --- a/bin/ed/glbl.c +++ b/bin/ed/glbl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glbl.c,v 1.14 2014/05/18 16:36:42 espie Exp $ */ +/* $OpenBSD: glbl.c,v 1.15 2015/10/04 15:23:24 millert Exp $ */ /* $NetBSD: glbl.c,v 1.2 1995/03/21 09:04:41 cgd Exp $ */ /* glob.c: This file contains the global command routines for the ed line @@ -39,7 +39,7 @@ int build_active_list(int isgcmd) { - pattern_t *pat; + regex_t *pat; line_t *lp; int n; char *s; diff --git a/bin/ed/main.c b/bin/ed/main.c index 37ece8058b7..0674da79b01 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.47 2015/10/04 15:03:24 millert Exp $ */ +/* $OpenBSD: main.c,v 1.48 2015/10/04 15:23:24 millert Exp $ */ /* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */ /* main.c: This file contains the main control and user-interface routines @@ -459,11 +459,11 @@ exec_command(void) extern int u_current_addr; extern int u_addr_last; - static pattern_t *pat = NULL; + static regex_t *pat = NULL; static int sgflag = 0; static int sgnum = 0; - pattern_t *tpat; + regex_t *tpat; char *fnp; int gflag = 0; int sflags = 0; @@ -911,7 +911,7 @@ check_addr_range(int n, int m) pattern in a given direction. wrap around begin/end of editor buffer if necessary */ int -get_matching_node_addr(pattern_t *pat, int dir) +get_matching_node_addr(regex_t *pat, int dir) { char *s; int n = current_addr; diff --git a/bin/ed/re.c b/bin/ed/re.c index d985b79ad8b..29bba37f4f3 100644 --- a/bin/ed/re.c +++ b/bin/ed/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.13 2015/07/28 17:46:52 deraadt Exp $ */ +/* $OpenBSD: re.c,v 1.14 2015/10/04 15:23:24 millert Exp $ */ /* $NetBSD: re.c,v 1.14 1995/03/21 09:04:48 cgd Exp $ */ /* re.c: This file contains the regular expression interface routines for @@ -38,10 +38,10 @@ char errmsg[PATH_MAX + 40] = ""; /* get_compiled_pattern: return pointer to compiled pattern from command buffer */ -pattern_t * +regex_t * get_compiled_pattern(void) { - static pattern_t *exp = NULL; + static regex_t *exp = NULL; char *exps; char delimiter; @@ -59,7 +59,7 @@ get_compiled_pattern(void) /* buffer alloc'd && not reserved */ if (exp && !patlock) regfree(exp); - else if ((exp = malloc(sizeof(pattern_t))) == NULL) { + else if ((exp = malloc(sizeof(regex_t))) == NULL) { perror(NULL); seterrmsg("out of memory"); return NULL; diff --git a/bin/ed/sub.c b/bin/ed/sub.c index c9b91aa9966..3e293d1cec9 100644 --- a/bin/ed/sub.c +++ b/bin/ed/sub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sub.c,v 1.11 2009/10/27 23:59:21 deraadt Exp $ */ +/* $OpenBSD: sub.c,v 1.12 2015/10/04 15:23:24 millert Exp $ */ /* $NetBSD: sub.c,v 1.4 1995/03/21 09:04:50 cgd Exp $ */ /* sub.c: This file contains the substitution routines for the ed @@ -111,7 +111,7 @@ int rbufsz; /* substitute_matching_text buffer size */ /* search_and_replace: for each line in a range, change text matching a pattern according to a substitution template; return status */ int -search_and_replace(pattern_t *pat, int gflag, int kth) +search_and_replace(regex_t *pat, int gflag, int kth) { undo_t *up; char *txt; @@ -165,7 +165,7 @@ search_and_replace(pattern_t *pat, int gflag, int kth) /* substitute_matching_text: replace text matched by a pattern according to a substitution template; return pointer to the modified text */ int -substitute_matching_text(pattern_t *pat, line_t *lp, int gflag, int kth) +substitute_matching_text(regex_t *pat, line_t *lp, int gflag, int kth) { int off = 0; int changed = 0; |