2 * Heirloom mailx - a mail user agent derived from Berkeley Mail.
4 * Copyright (c) 2000-2004 Gunnar Ritter, Freiburg i. Br., Germany.
5 * Copyright (c) 2012 Steffen "Daode" Nurpmeso.
8 * Copyright (c) 1980, 1993
9 * The Regents of the University of California. All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 static char sccsid
[] = "@(#)aux.c 2.83 (gritter) 3/4/06";
55 #endif /* HAVE_WCTYPE_H */
58 #endif /* HAVE_WCWIDTH */
70 * Mail -- a mail program
72 * Auxiliary functions.
76 * Return a pointer to a dynamic copy of the argument.
79 savestr(const char *str
)
82 int size
= strlen(str
) + 1;
84 if ((new = salloc(size
)) != NULL
)
85 memcpy(new, str
, size
);
90 * Make a copy of new argument incorporating old one.
93 save2str(const char *str
, const char *old
)
96 int newsize
= strlen(str
) + 1;
97 int oldsize
= old
? strlen(old
) + 1 : 0;
99 if ((new = salloc(newsize
+ oldsize
)) != NULL
) {
101 memcpy(new, old
, oldsize
);
102 new[oldsize
- 1] = ' ';
104 memcpy(new + oldsize
, str
, newsize
);
110 savecat(const char *s1
, const char *s2
)
115 np
= ns
= salloc(strlen(s1
) + strlen(s2
) + 1);
116 for (cp
= s1
; *cp
; cp
++)
118 for (cp
= s2
; *cp
; cp
++)
126 #ifndef HAVE_SNPRINTF
128 * Lazy vsprintf wrapper.
131 snprintf(char *str
, size_t size
, const char *format
, ...)
136 va_start(ap
, format
);
137 ret
= vsprintf(str
, format
, ap
);
141 #endif /* !HAVE_SNPRINTF */
144 * Announce a fatal error and die.
147 panic(const char *format
, ...)
151 va_start(ap
, format
);
152 fprintf(stderr
, catgets(catd
, CATSET
, 1, "panic: "));
153 vfprintf(stderr
, format
, ap
);
155 fprintf(stderr
, catgets(catd
, CATSET
, 2, "\n"));
166 sigaddset(&set
, SIGINT
);
167 sigprocmask(SIG_BLOCK
, &set
, NULL
);
176 sigaddset(&set
, SIGINT
);
177 sigprocmask(SIG_UNBLOCK
, &set
, NULL
);
181 * Touch the named message by setting its MTOUCH flag.
182 * Touched messages have the effect of not being sent
183 * back to the system mailbox on exit.
186 touch(struct message
*mp
)
189 mp
->m_flag
|= MTOUCH
;
190 if ((mp
->m_flag
& MREAD
) == 0)
191 mp
->m_flag
|= MREAD
|MSTATUS
;
195 * Test to see if the passed file name is a directory.
196 * Return true if it is.
203 if (stat(name
, &sbuf
) < 0)
205 return(S_ISDIR(sbuf
.st_mode
));
209 * Count the number of arguments in the given string raw list.
212 argcount(char **argv
)
216 for (ap
= argv
; *ap
++ != NULL
;)
218 return ap
- argv
- 1;
222 * Copy a string, lowercasing it as we go.
225 i_strcpy(char *dest
, const char *src
, int size
)
231 *dest
++ = lowerconv(*src
& 0377);
238 i_strdup(const char *src
)
243 sz
= strlen(src
) + 1;
245 i_strcpy(dest
, src
, sz
);
250 * Convert a string to lowercase, in-place and with multibyte-aware.
255 #if defined (HAVE_MBTOWC) && defined (HAVE_WCTYPE_H)
256 if (mb_cur_max
> 1) {
262 len
= mbtowc(&wc
, cp
, mb_cur_max
);
267 if (wctomb(tp
, wc
) == len
)
268 tp
+= len
, cp
+= len
;
274 #endif /* HAVE_MBTOWC && HAVE_WCTYPE_H */
277 *cp
= tolower(*cp
& 0377);
283 substr(const char *str
, const char *sub
)
285 const char *cp
, *backup
;
289 while (*str
&& *cp
) {
290 #if defined (HAVE_MBTOWC) && defined (HAVE_WCTYPE_H)
291 if (mb_cur_max
> 1) {
295 if ((sz
= mbtowc(&c
, cp
, mb_cur_max
)) < 0)
298 if ((sz
= mbtowc(&c2
, str
, mb_cur_max
)) < 0)
304 if ((sz
= mbtowc(&c
, backup
, mb_cur_max
)) > 0) {
312 #endif /* HAVE_MBTOWC && HAVE_WCTYPE_H */
316 #if defined (HAVE_MBTOWC) && defined (HAVE_WCTYPE_H)
318 #endif /* HAVE_MBTOWC && HAVE_WCTYPE_H */
335 colalign(const char *cp
, int col
, int fill
)
340 np
= nb
= salloc(mb_cur_max
* strlen(cp
) + col
+ 1);
342 #if defined (HAVE_MBTOWC) && defined (HAVE_WCWIDTH)
343 if (mb_cur_max
> 1) {
346 if ((sz
= mbtowc(&wc
, cp
, mb_cur_max
)) < 0) {
349 if ((n
= wcwidth(wc
)) < 0)
353 #endif /* HAVE_MBTOWC && HAVE_WCWIDTH */
360 if (sz
== 1 && spacechar(*cp
&0377)) {
383 while ((c
= getc(fp
)) != EOF
)
387 if (is_a_tty
[0] && is_a_tty
[1] && (cp
= value("crt")) != NULL
&&
388 lines
> (*cp
? atol(cp
) : scrnheight
))
389 run_command(get_pager(), 0, fileno(fp
), -1, NULL
, NULL
, NULL
);
391 while ((c
= getc(fp
)) != EOF
)
396 * The following code deals with input stacking to do source
397 * commands. All but the current file pointer are saved on
401 static int ssp
; /* Top of file stack */
403 FILE *s_file
; /* File we were in. */
404 enum condition s_cond
; /* Saved state of conditionals */
405 int s_loading
; /* Loading .mailrc, etc. */
410 * Pushdown current input file and switch to a new one.
411 * Set the global flag "sourcing" so that others will realize
412 * that they are no longer reading from a tty (in all probability).
421 if ((cp
= expand(*arglist
)) == NULL
)
423 if ((fi
= Fopen(cp
, "r")) == NULL
) {
427 if (ssp
>= SSTACK
- 1) {
428 printf(catgets(catd
, CATSET
, 3,
429 "Too much \"sourcing\" going on.\n"));
433 sstack
[ssp
].s_file
= input
;
434 sstack
[ssp
].s_cond
= cond
;
435 sstack
[ssp
].s_loading
= loading
;
445 * Pop the current input back to the previous level.
446 * Update the "sourcing" flag as appropriate.
452 printf(catgets(catd
, CATSET
, 4,
453 "\"Source\" stack over-pop.\n"));
459 printf(catgets(catd
, CATSET
, 5, "Unmatched \"if\"\n"));
461 cond
= sstack
[ssp
].s_cond
;
462 loading
= sstack
[ssp
].s_loading
;
463 input
= sstack
[ssp
].s_file
;
470 * Touch the indicated file.
471 * This is nifty for the shell.
481 utb
.actime
= time((time_t *)0) + 1;
482 utb
.modtime
= sb
.st_mtime
;
487 * Examine the passed line buffer and
488 * return true if it is all blanks and tabs.
491 blankline(char *linebuf
)
495 for (cp
= linebuf
; *cp
; cp
++)
496 if (!blankchar(*cp
& 0377))
502 * Are any of the characters in the two strings the same?
505 anyof(char *s1
, char *s2
)
509 if (strchr(s2
, *s1
++))
515 * Determine if as1 is a valid prefix of as2.
516 * Return true if yep.
519 is_prefix(const char *as1
, const char *as2
)
528 return(*--s1
== '\0');
532 last_at_before_slash(const char *sp
)
536 for (cp
= sp
; *cp
; cp
++)
539 while (cp
> sp
&& *--cp
!= '@');
540 return *cp
== '@' ? (char *)cp
: NULL
;
544 which_protocol(const char *name
)
546 register const char *cp
;
552 if (name
[0] == '%' && name
[1] == ':')
554 for (cp
= name
; *cp
&& *cp
!= ':'; cp
++)
555 if (!alnumchar(*cp
&0377))
557 if (cp
[0] == ':' && cp
[1] == '/' && cp
[2] == '/') {
558 if (strncmp(name
, "pop3://", 7) == 0)
562 fprintf(stderr
, catgets(catd
, CATSET
, 216,
563 "No POP3 support compiled in.\n"));
565 if (strncmp(name
, "pop3s://", 8) == 0)
569 fprintf(stderr
, catgets(catd
, CATSET
, 225,
570 "No SSL support compiled in.\n"));
571 #endif /* !USE_SSL */
572 if (strncmp(name
, "imap://", 7) == 0)
576 fprintf(stderr
, catgets(catd
, CATSET
, 269,
577 "No IMAP support compiled in.\n"));
579 if (strncmp(name
, "imaps://", 8) == 0)
583 fprintf(stderr
, catgets(catd
, CATSET
, 225,
584 "No SSL support compiled in.\n"));
585 #endif /* !USE_SSL */
586 return PROTO_UNKNOWN
;
588 file
: p
= PROTO_FILE
;
589 np
= ac_alloc((sz
= strlen(name
)) + 5);
591 if (stat(name
, &st
) == 0) {
592 if (S_ISDIR(st
.st_mode
)) {
593 strcpy(&np
[sz
], "/tmp");
594 if (stat(np
, &st
) == 0 && S_ISDIR(st
.st_mode
)) {
595 strcpy(&np
[sz
], "/new");
596 if (stat(np
, &st
) == 0 &&
597 S_ISDIR(st
.st_mode
)) {
598 strcpy(&np
[sz
], "/cur");
599 if (stat(np
, &st
) == 0 &&
606 strcpy(&np
[sz
], ".gz");
607 if (stat(np
, &st
) < 0) {
608 strcpy(&np
[sz
], ".bz2");
609 if (stat(np
, &st
) < 0) {
610 if ((cp
= value("newfolders")) != 0 &&
611 strcmp(cp
, "maildir") == 0)
622 protfile(const char *xcp
)
624 const char *cp
= xcp
;
628 if (cp
[0] == ':' && cp
[1] == '/' && cp
[2] == '/') {
632 if (cp
[0] == '/' && state
== 1)
642 protbase(const char *cp
)
644 char *n
= salloc(strlen(cp
) + 1);
648 if (cp
[0] == ':' && cp
[1] == '/' && cp
[2] == '/') {
652 } else if (cp
[0] == '/')
662 disconnected(const char *file
)
667 if (value("disconnected"))
670 if (strncmp(cp
, "imap://", 7) == 0)
672 else if (strncmp(cp
, "imaps://", 8) == 0)
676 if ((cq
= strchr(cp
, ':')) != NULL
)
678 vp
= ac_alloc(vs
= strlen(cp
) + 14);
679 snprintf(vp
, vs
, "disconnected-%s", cp
);
680 r
= value(vp
) != NULL
;
692 h
= (h
<< 4 & 0xffffffff) + (*cp
&0377);
693 if ((g
= h
& 0xf0000000) != 0) {
704 const long primes
[] = {
705 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521,
706 131071, 262139, 524287, 1048573, 2097143, 4194301,
707 8388593, 16777213, 33554393, 67108859, 134217689,
708 268435399, 536870909, 1073741789, 2147483647
713 for (i
= 0; i
< sizeof primes
/ sizeof *primes
; i
++)
714 if ((mprime
= primes
[i
]) >= (n
< 65536 ? n
*4 :
715 n
< 262144 ? n
*2 : n
))
717 if (i
== sizeof primes
/ sizeof *primes
)
718 mprime
= n
; /* not so prime, but better than failure */
722 #define Hexchar(n) ((n)>9 ? (n)-10+'A' : (n)+'0')
723 #define hexchar(n) ((n)>9 ? (n)-10+'a' : (n)+'0')
726 strenc(const char *cp
)
730 np
= n
= salloc(strlen(cp
) * 3 + 1);
732 if (alnumchar(*cp
&0377) || *cp
== '_' || *cp
== '@' ||
733 (np
> n
&& (*cp
== '.' || *cp
== '-' ||
738 *np
++ = Hexchar((*cp
&0xf0) >> 4);
739 *np
++ = Hexchar(*cp
&0x0f);
748 strdec(const char *cp
)
752 np
= n
= salloc(strlen(cp
) + 1);
754 if (cp
[0] == '%' && cp
[1] && cp
[2]) {
755 *np
= (int)(cp
[1]>'9'?cp
[1]-'A'+10:cp
[1]-'0') << 4;
756 *np
++ |= cp
[2]>'9'?cp
[2]-'A'+10:cp
[2]-'0';
766 md5tohex(const void *vp
)
773 for (i
= 0; i
< 16; i
++) {
774 hex
[2*i
] = hexchar((cp
[i
]&0xf0) >> 4);
775 hex
[2*i
+1] = hexchar(cp
[i
]&0x0f);
782 cram_md5_string(const char *user
, const char *pass
, const char *b64
)
785 char digest
[16], *cp
, *sp
, *rp
, *xp
;
790 mime_fromb64(&in
, &out
, 0);
791 hmac_md5((unsigned char *)out
.s
, out
.l
,
792 (unsigned char *)pass
, strlen(pass
),
795 xp
= md5tohex(digest
);
796 sp
= ac_alloc(ss
= strlen(user
) + strlen(xp
) + 2);
797 snprintf(sp
, ss
, "%s %s", user
, xp
);
800 rp
= salloc(rs
= strlen(cp
) + 3);
801 snprintf(rp
, rs
, "%s\r\n", cp
);
809 char *line
= NULL
, *user
;
813 fputs("User: ", stdout
);
816 if (readline(stdin
, &line
, &linesize
) == 0) {
821 user
= savestr(line
);
827 getpassword(struct termios
*otio
, int *reset_tio
, const char *query
)
830 char *line
= NULL
, *pass
;
835 fputs(query
? query
: "Password:", stdout
);
839 tio
.c_lflag
&= ~(ECHO
| ECHOE
| ECHOK
| ECHONL
);
841 tcsetattr(0, TCSAFLUSH
, &tio
);
843 i
= readline(stdin
, &line
, &linesize
);
846 tcsetattr(0, TCSADRAIN
, otio
);
854 pass
= savestr(line
);
860 transflags(struct message
*omessage
, long omsgCount
, int transparent
)
862 struct message
*omp
, *nmp
, *newdot
, *newprevdot
;
869 while (omp
< &omessage
[omsgCount
] &&
870 nmp
< &message
[msgCount
]) {
871 if (dot
&& nmp
->m_uid
== dot
->m_uid
)
873 if (prevdot
&& nmp
->m_uid
== prevdot
->m_uid
)
875 if (omp
->m_uid
== nmp
->m_uid
) {
876 hf
= nmp
->m_flag
& MHIDDEN
;
877 if (transparent
&& mb
.mb_type
== MB_IMAP
)
878 omp
->m_flag
&= ~MHIDDEN
;
880 if (transparent
&& mb
.mb_type
== MB_CACHE
)
881 nmp
[-1].m_flag
|= hf
;
882 } else if (omp
->m_uid
< nmp
->m_uid
)
889 prevdot
= newprevdot
;
894 getrandstring(size_t length
)
896 static unsigned char nodedigest
[16];
904 data
= salloc(length
);
905 if ((fd
= open("/dev/urandom", O_RDONLY
)) < 0 ||
906 length
!= (size_t)read(fd
, data
, length
)) {
912 MD5Update(&ctx
, (unsigned char *)cp
, strlen(cp
));
913 MD5Final(nodedigest
, &ctx
);
915 for (i
= 0; i
< length
; i
++)
917 ((int)(255 * (rand() / (RAND_MAX
+ 1.0))) ^
918 nodedigest
[i
% sizeof nodedigest
]);
922 cp
= memtob64(data
, length
);
923 rp
= salloc(length
+1);
924 strncpy(rp
, cp
, length
)[length
] = '\0';
942 if ((p
= malloc(s
)) == NULL
)
948 srealloc(void *v
, size_t s
)
956 if ((r
= realloc(v
, s
)) == NULL
)
962 scalloc(size_t nmemb
, size_t size
)
968 if ((vp
= calloc(nmemb
, size
)) == NULL
)
974 sstpcpy(char *dst
, const char *src
)
976 while ((*dst
= *src
++) != '\0')
982 sstrdup(const char *cp
)
987 dp
= smalloc(strlen(cp
) + 1);
995 makedir(const char *name
)
1000 if (mkdir(name
, 0700) < 0) {
1002 if ((e
== EEXIST
|| e
== ENOSYS
) &&
1003 stat(name
, &st
) == 0 &&
1004 (st
.st_mode
&S_IFMT
) == S_IFDIR
)
1013 cwget(struct cw
*cw
)
1015 if ((cw
->cw_fd
= open(".", O_RDONLY
)) < 0)
1017 if (fchdir(cw
->cw_fd
) < 0) {
1025 cwret(struct cw
*cw
)
1027 if (fchdir(cw
->cw_fd
) < 0)
1033 cwrelse(struct cw
*cw
)
1037 #else /* !HAVE_FCHDIR */
1039 cwget(struct cw
*cw
)
1041 if (getcwd(cw
->cw_wd
, sizeof cw
->cw_wd
) == NULL
|| chdir(cw
->cw_wd
) < 0)
1047 cwret(struct cw
*cw
)
1049 if (chdir(cw
->cw_wd
) < 0)
1056 cwrelse(struct cw
*cw
)
1059 #endif /* !HAVE_FCHDIR */
1062 makeprint(struct str
*in
, struct str
*out
)
1064 static int print_all_chars
= -1;
1068 out
->s
= smalloc(msz
= in
->l
+ 1);
1069 if (print_all_chars
== -1)
1070 print_all_chars
= value("print-all-chars") != NULL
;
1071 if (print_all_chars
) {
1072 memcpy(out
->s
, in
->s
, in
->l
);
1074 out
->s
[out
->l
] = '\0';
1079 #if defined (HAVE_MBTOWC) && defined (HAVE_WCTYPE_H)
1080 if (mb_cur_max
> 1) {
1082 char mb
[MB_LEN_MAX
+1];
1085 while (inp
< &in
->s
[in
->l
]) {
1087 n
= mbtowc(&wc
, inp
, &in
->s
[in
->l
] - inp
);
1093 mbtowc(&wc
, NULL
, mb_cur_max
);
1094 wc
= utf8
? 0xFFFD : '?';
1099 if (!iswprint(wc
) && wc
!= '\n' && wc
!= '\r' &&
1100 wc
!= '\b' && wc
!= '\t') {
1101 if ((wc
& ~(wchar_t)037) == 0)
1102 wc
= utf8
? 0x2400 | wc
: '?';
1103 else if (wc
== 0177)
1104 wc
= utf8
? 0x2421 : '?';
1106 wc
= utf8
? 0x2426 : '?';
1108 if ((n
= wctomb(mb
, wc
)) <= 0)
1111 if (out
->l
>= msz
- 1) {
1112 dist
= outp
- out
->s
;
1113 out
->s
= srealloc(out
->s
, msz
+= 32);
1114 outp
= &out
->s
[dist
];
1116 for (i
= 0; i
< n
; i
++)
1120 #endif /* HAVE_MBTOWC && HAVE_WCTYPE_H */
1123 while (inp
< &in
->s
[in
->l
]) {
1125 if (!isprint(c
) && c
!= '\n' && c
!= '\r' &&
1126 c
!= '\b' && c
!= '\t')
1132 out
->s
[out
->l
] = '\0';
1136 prstr(const char *s
)
1143 makeprint(&in
, &out
);
1144 rp
= salloc(out
.l
+ 1);
1145 memcpy(rp
, out
.s
, out
.l
);
1152 prout(const char *s
, size_t sz
, FILE *fp
)
1159 makeprint(&in
, &out
);
1160 n
= fwrite(out
.s
, 1, out
.l
, fp
);
1166 * Print out a Unicode character or a substitute for it.
1169 putuc(int u
, int c
, FILE *fp
)
1171 #if defined (HAVE_MBTOWC) && defined (HAVE_WCTYPE_H)
1172 if (utf8
&& u
& ~(wchar_t)0177) {
1173 char mb
[MB_LEN_MAX
];
1175 if ((n
= wctomb(mb
, u
)) > 0) {
1176 for (i
= 0; i
< n
; i
++)
1177 r
+= putc(mb
[i
] & 0377, fp
) != EOF
;
1180 return putc('\0', fp
) != EOF
;
1184 #endif /* HAVE_MBTOWC && HAVE_WCTYPE_H */
1185 return putc(c
, fp
) != EOF
;
1189 * Locale-independent character class functions.
1192 asccasecmp(const char *s1
, const char *s2
)
1197 if ((cmp
= lowerconv(*s1
& 0377) - lowerconv(*s2
& 0377)) != 0)
1199 while (*s1
++ != '\0' && *s2
++ != '\0');
1204 ascncasecmp(const char *s1
, const char *s2
, size_t sz
)
1212 if ((cmp
= lowerconv(*s1
& 0377) - lowerconv(*s2
& 0377)) != 0)
1214 while (i
++ < sz
&& *s1
++ != '\0' && *s2
++ != '\0');
1219 asccasestr(const char *haystack
, const char *xneedle
)
1221 char *needle
, *NEEDLE
;
1224 sz
= strlen(xneedle
);
1226 return (char *)haystack
;
1227 needle
= ac_alloc(sz
);
1228 NEEDLE
= ac_alloc(sz
);
1229 for (i
= 0; i
< sz
; i
++) {
1230 needle
[i
] = lowerconv(xneedle
[i
]&0377);
1231 NEEDLE
[i
] = upperconv(xneedle
[i
]&0377);
1234 if (*haystack
== *needle
|| *haystack
== *NEEDLE
) {
1235 for (i
= 1; i
< sz
; i
++)
1236 if (haystack
[i
] != needle
[i
] &&
1237 haystack
[i
] != NEEDLE
[i
])
1240 return (char *)haystack
;
1247 const unsigned char class_char
[] = {
1248 /* 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq 006 ack 007 bel */
1249 C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,
1250 /* 010 bs 011 ht 012 nl 013 vt 014 np 015 cr 016 so 017 si */
1251 C_CNTRL
,C_BLANK
,C_WHITE
,C_SPACE
,C_SPACE
,C_SPACE
,C_CNTRL
,C_CNTRL
,
1252 /* 020 dle 021 dc1 022 dc2 023 dc3 024 dc4 025 nak 026 syn 027 etb */
1253 C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,
1254 /* 030 can 031 em 032 sub 033 esc 034 fs 035 gs 036 rs 037 us */
1255 C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,C_CNTRL
,
1256 /* 040 sp 041 ! 042 " 043 # 044 $ 045 % 046 & 047 ' */
1257 C_BLANK
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,
1258 /* 050 ( 051 ) 052 * 053 + 054 , 055 - 056 . 057 / */
1259 C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,
1260 /* 060 0 061 1 062 2 063 3 064 4 065 5 066 6 067 7 */
1261 C_OCTAL
,C_OCTAL
,C_OCTAL
,C_OCTAL
,C_OCTAL
,C_OCTAL
,C_OCTAL
,C_OCTAL
,
1262 /* 070 8 071 9 072 : 073 ; 074 < 075 = 076 > 077 ? */
1263 C_DIGIT
,C_DIGIT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,
1264 /* 100 @ 101 A 102 B 103 C 104 D 105 E 106 F 107 G */
1265 C_PUNCT
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,
1266 /* 110 H 111 I 112 J 113 K 114 L 115 M 116 N 117 O */
1267 C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,
1268 /* 120 P 121 Q 122 R 123 S 124 T 125 U 126 V 127 W */
1269 C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,C_UPPER
,
1270 /* 130 X 131 Y 132 Z 133 [ 134 \ 135 ] 136 ^ 137 _ */
1271 C_UPPER
,C_UPPER
,C_UPPER
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,
1272 /* 140 ` 141 a 142 b 143 c 144 d 145 e 146 f 147 g */
1273 C_PUNCT
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,
1274 /* 150 h 151 i 152 j 153 k 154 l 155 m 156 n 157 o */
1275 C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,
1276 /* 160 p 161 q 162 r 163 s 164 t 165 u 166 v 167 w */
1277 C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,C_LOWER
,
1278 /* 170 x 171 y 172 z 173 { 174 | 175 } 176 ~ 177 del */
1279 C_LOWER
,C_LOWER
,C_LOWER
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_PUNCT
,C_CNTRL