summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/defs.h
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-07-14 10:06:22 +0000
committertjr <tjr@FreeBSD.org>2004-07-14 10:06:22 +0000
commitb7f5e217dda791d61c549a147e0e6ad6cd1b3f3d (patch)
treecebf0634774be08929212c168278981cd54ae195 /usr.bin/sed/defs.h
parent084c37915e361d7646a6eefa02b04a5db5958496 (diff)
downloadFreeBSD-src-b7f5e217dda791d61c549a147e0e6ad6cd1b3f3d.zip
FreeBSD-src-b7f5e217dda791d61c549a147e0e6ad6cd1b3f3d.tar.gz
Make the 'y' (translate) command aware of multibyte characters.
Diffstat (limited to 'usr.bin/sed/defs.h')
-rw-r--r--usr.bin/sed/defs.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.bin/sed/defs.h b/usr.bin/sed/defs.h
index 0e77014..bc487d9 100644
--- a/usr.bin/sed/defs.h
+++ b/usr.bin/sed/defs.h
@@ -35,6 +35,7 @@
* SUCH DAMAGE.
*
* @(#)defs.h 8.1 (Berkeley) 6/6/93
+ * $FreeBSD$
*/
/*
@@ -71,6 +72,19 @@ struct s_subst {
char *new; /* Replacement text */
};
+/*
+ * Translate command.
+ */
+struct s_tr {
+ unsigned char bytetab[256];
+ struct trmulti {
+ int fromlen;
+ char from[MB_LEN_MAX];
+ int tolen;
+ char to[MB_LEN_MAX];
+ } *multis;
+ int nmultis;
+};
/*
* An internally compiled command.
@@ -84,7 +98,7 @@ struct s_command {
union {
struct s_command *c; /* Command(s) for b t { */
struct s_subst *s; /* Substitute command */
- u_char *y; /* Replace command array */
+ struct s_tr *y; /* Replace command array */
int fd; /* File descriptor for w */
} u;
char code; /* Command code */
OpenPOWER on IntegriCloud