xref: /illumos-gate/usr/src/cmd/csh/sh.tconst.c (revision 2a8bcb4e)
17c478bd9Sstevel@tonic-gate /*
21de7ff79Sjonb  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
77c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /*
107c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
117c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley Software License Agreement
127c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
137c478bd9Sstevel@tonic-gate  */
147c478bd9Sstevel@tonic-gate 
157c478bd9Sstevel@tonic-gate /*
167c478bd9Sstevel@tonic-gate  * C shell
177c478bd9Sstevel@tonic-gate  */
187c478bd9Sstevel@tonic-gate 
197c478bd9Sstevel@tonic-gate /*
207c478bd9Sstevel@tonic-gate  * These tchar constants used to be defined as
21*2a8bcb4eSToomas Soome  * character string constants.
227c478bd9Sstevel@tonic-gate  */
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate #include "sh.h"
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate tchar S_[] = {0};
277c478bd9Sstevel@tonic-gate tchar S_0[]={'0', 0};
287c478bd9Sstevel@tonic-gate tchar S_1[]={'1', 0};
297c478bd9Sstevel@tonic-gate tchar S_AND[] = {'&', 0};	/* & */
307c478bd9Sstevel@tonic-gate tchar S_ANDAND[] = {'&', '&', 0};	/* && */
317c478bd9Sstevel@tonic-gate tchar S_AST[]={'*', 0};
327c478bd9Sstevel@tonic-gate tchar S_AT[] = { '@', 0 };
337c478bd9Sstevel@tonic-gate tchar S_BAR[] = {'|', 0};	/* | */
347c478bd9Sstevel@tonic-gate tchar S_BARBAR[] = {'|','|', 0};	/* || */
357c478bd9Sstevel@tonic-gate tchar S_BRABRA[] = {'{', '}', 0};	/* {} */
367c478bd9Sstevel@tonic-gate tchar S_BRAPPPBRA[] = {'{', ' ', '.', '.', '.', ' ', '}', 0};	/* { ... } */
377c478bd9Sstevel@tonic-gate tchar S_COLON[] = {':', 0}; /*:*/
387c478bd9Sstevel@tonic-gate tchar S_DASHl[] = {'-', 'l', 0};	/*-l */
397c478bd9Sstevel@tonic-gate tchar S_DELIM[] = {' ','\'','"','\t',';','&','<','>','(',')','|','`',0};
407c478bd9Sstevel@tonic-gate tchar S_DOT[] = {'.', 0};
417c478bd9Sstevel@tonic-gate tchar S_DOTDOTSLA[]={'.', '.', '/', 0};
427c478bd9Sstevel@tonic-gate tchar S_DOTSLA[]={'.', '/', 0};
437c478bd9Sstevel@tonic-gate tchar S_EQ[] = {'=', 0};	/*=*/
447c478bd9Sstevel@tonic-gate tchar S_EXAS[] = {'!', 0};       /* ! */
457c478bd9Sstevel@tonic-gate tchar S_HAT[] = {'^', 0};	/* ^ */
467c478bd9Sstevel@tonic-gate tchar S_HOME[] = {'H','O','M','E',0};/*HOME*/
477c478bd9Sstevel@tonic-gate tchar S_IOT[] = {'I', 'O', 'T', 0}; /*IOT*/
487c478bd9Sstevel@tonic-gate tchar S_LANG[]={'L', 'A', 'N', 'G', 0}; /*LANG*/
497c478bd9Sstevel@tonic-gate tchar S_LBRA[] = {'{', 0};	/* { */
507c478bd9Sstevel@tonic-gate tchar S_LBRASP[] = {'(', ' ', 0};	/*( */
517c478bd9Sstevel@tonic-gate tchar S_LC_ALL[]={'L', 'C', '_', 'A', 'L', 'L',  0}; /*LC_ALL*/
527c478bd9Sstevel@tonic-gate tchar S_LC_CTYPE[]={'L', 'C', '_', 'C', 'T', 'Y', 'P',  'E', 0}; /*LC_CTYPE*/
53*2a8bcb4eSToomas Soome tchar S_LC_MESSAGES[]={'L', 'C', '_',
547c478bd9Sstevel@tonic-gate 		   'M', 'E', 'S', 'S', 'A', 'G', 'E', 'S', 0}; /*LC_MESSAGES*/
557c478bd9Sstevel@tonic-gate tchar S_LESLES[]={'<', '<', 0};
567c478bd9Sstevel@tonic-gate tchar S_LPAR[] = {'(', 0};	/* ( */
577c478bd9Sstevel@tonic-gate tchar S_MINUS[] = {'-',0};/*"-"*/
587c478bd9Sstevel@tonic-gate tchar S_MINl[]={'-', 'l', 0};
597c478bd9Sstevel@tonic-gate tchar S_NDOThistory[] = {'~','/','.','h','i','s','t','o','r','y',0};
607c478bd9Sstevel@tonic-gate tchar S_OTHERSH[] = {'/','b','i','n','/','s','h',0};
617c478bd9Sstevel@tonic-gate tchar S_PARCENTMINUS[] = {'%', '-', 0}; /*%-*/
627c478bd9Sstevel@tonic-gate tchar S_PARCENTPARCENT[] = {'%', '%', 0}; /*%%*/
637c478bd9Sstevel@tonic-gate tchar S_PARCENTPLUS[] = {'%', '+', 0}; /*%+*/
647c478bd9Sstevel@tonic-gate tchar S_PARCENTSHARP[] = {'%', '#', 0}; /*%#*/
657c478bd9Sstevel@tonic-gate tchar S_PATH[] = {'P','A','T','H',0};/*"PATH"*/
667c478bd9Sstevel@tonic-gate tchar S_PERSENTSP[] = {'%',' ',0};
677c478bd9Sstevel@tonic-gate tchar S_PWD[]={'P', 'W', 'D', 0};
687c478bd9Sstevel@tonic-gate tchar S_Pjob[] = {'%','j','o','b', 0}; /*"%job"*/
697c478bd9Sstevel@tonic-gate tchar S_PjobAND[] = {'%','j','o','b',' ','&',0}; /*"%job &"*/
707c478bd9Sstevel@tonic-gate tchar S_QPPPQ[] = {'`', ' ', '.', '.', '.', ' ', '`', 0}; /*` ... `*/
717c478bd9Sstevel@tonic-gate tchar S_RBRA[] = {'}', 0};	/* } */
727c478bd9Sstevel@tonic-gate tchar S_RPAR[] = {')', 0}; /*)*/
737c478bd9Sstevel@tonic-gate tchar S_SEMICOLONSP[] = {';', ' ', 0};	/* | */
747c478bd9Sstevel@tonic-gate tchar S_SHARPSP[] = {'#',' ',0};
757c478bd9Sstevel@tonic-gate tchar S_SHELLPATH[] = {'/','b','i','n','/','c','s','h',0};
767c478bd9Sstevel@tonic-gate tchar S_SLADOTcshrc[] = {'/','.','c','s','h','r','c', 0};
777c478bd9Sstevel@tonic-gate tchar S_SLADOThistory[] = {'/','.','h','i','s','t','o','r','y', 0};
787c478bd9Sstevel@tonic-gate tchar S_SLADOTlogin[] = {'/','.','l','o','g','i','n', 0};
797c478bd9Sstevel@tonic-gate tchar S_SLADOTlogout[] = {'/','.','l','o','g','o','u','t', 0};
807c478bd9Sstevel@tonic-gate tchar S_SLASH[] = {'/', 0}; /* "/" */
817c478bd9Sstevel@tonic-gate tchar S_SP[] = {' ', 0};	/* */
827c478bd9Sstevel@tonic-gate tchar S_SPANDANDSP[] = {' ', '&', '&', ' ', 0};	/* && */
837c478bd9Sstevel@tonic-gate tchar S_SPBARBARSP[] = {' ', '|', '|', ' ', 0};	/* || */
847c478bd9Sstevel@tonic-gate tchar S_SPBARSP[] = {' ', '|', ' ', 0};	/* | */
857c478bd9Sstevel@tonic-gate tchar S_SPGTRGTRSP[] = {' ', '>', '>', ' ', 0};	/* >> */
867c478bd9Sstevel@tonic-gate tchar S_SPGTR[] = {' ', '>',0};	/* > */
877c478bd9Sstevel@tonic-gate tchar S_SPLESLESSP[] = {' ', '<', '<', ' ', 0};	/* << */
887c478bd9Sstevel@tonic-gate tchar S_SPLESSP[] = {' ', '<', ' ', 0};	/* < */
897c478bd9Sstevel@tonic-gate tchar S_SPPPP[] = {' ', '.', '.', '.', 0};	/* ... */
907c478bd9Sstevel@tonic-gate tchar S_SPRBRA[] = {' ', ')', 0};	/* )*/
911de7ff79Sjonb tchar S_SUNW_VARLEN[] = {'S', 'U', 'N', 'W', '_',
921de7ff79Sjonb 	'V', 'A', 'R', 'L', 'E', 'N', 0};
937c478bd9Sstevel@tonic-gate tchar S_TERM[] = {'T','E','R','M',0};/*TERM*/
947c478bd9Sstevel@tonic-gate tchar S_TIL[] = {'~', 0};	/* ~ */
957c478bd9Sstevel@tonic-gate tchar S_TOPBIT[] = {(tchar)QUOTE, 0};	/* Was "\200".  A hack! */
967c478bd9Sstevel@tonic-gate tchar S_USAGEFORMAT[] = {'%','U','u',' ','%','S','s',' ','%','E',' ','%','P', ' ','%','X','+','%','D','k',' ','%','I','+','%','O','i','o',' ','%','F','p','f','+', '%','W','w',0};
977c478bd9Sstevel@tonic-gate tchar S_USER[] = {'U','S','E','R',0};/*USER*/
987c478bd9Sstevel@tonic-gate tchar S_alias[] = { 'a','l','i','a','s', 0 };
997c478bd9Sstevel@tonic-gate tchar S_alloc[] = { 'a','l','l','o','c', 0};
1007c478bd9Sstevel@tonic-gate tchar S_aout[] = {'a','.','o','u','t',0};
1017c478bd9Sstevel@tonic-gate tchar S_argv[]={'a', 'r', 'g', 'v', 0};
1027c478bd9Sstevel@tonic-gate tchar S_bg[] = { 'b','g', 0};
1037c478bd9Sstevel@tonic-gate tchar S_bin[] = {'/','b','i','n',0};
1047c478bd9Sstevel@tonic-gate tchar S_break[] = { 'b','r','e','a','k', 0};
1057c478bd9Sstevel@tonic-gate tchar S_breaksw[] = { 'b','r','e','a','k','s','w', 0};
1067c478bd9Sstevel@tonic-gate tchar S_bye[] = { 'b','y','e', 0};
1077c478bd9Sstevel@tonic-gate tchar S_case[] = { 'c','a','s','e', 0};
1087c478bd9Sstevel@tonic-gate tchar S_cd[] = { 'c','d', 0};
1097c478bd9Sstevel@tonic-gate tchar S_cdpath[]={'c', 'd', 'p', 'a', 't', 'h', 0};
1107c478bd9Sstevel@tonic-gate tchar S_chdir[] = { 'c','h','d','i','r', 0};
1117c478bd9Sstevel@tonic-gate tchar S_child[] = {'c', 'h', 'i', 'l', 'd', 0};	/*child */
1127c478bd9Sstevel@tonic-gate tchar S_continue[] = { 'c','o','n','t','i','n','u','e', 0};
1137c478bd9Sstevel@tonic-gate tchar S_coredumpsize[] = {'c','o','r','e','d','u','m','p','s','i','z','e',0};/*"coredumpsize"*/
1147c478bd9Sstevel@tonic-gate tchar S_cputime[] = {'c','p','u','t','i','m','e',0};/*"cputime"*/
1157c478bd9Sstevel@tonic-gate tchar S_csh[]={'c', 's', 'h', 0};
1167c478bd9Sstevel@tonic-gate tchar S_cwd[]={'c', 'w', 'd', 0};
1177c478bd9Sstevel@tonic-gate tchar S_datasize[] = {'d','a','t','a','s','i','z','e',0};/*"datasize"*/
1187c478bd9Sstevel@tonic-gate tchar S_default[] =  { 'd','e','f','a','u','l','t', 0 };
1197c478bd9Sstevel@tonic-gate tchar S_descriptors[] = {'d', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 's', 0};
1207c478bd9Sstevel@tonic-gate tchar S_dirs[] =  { 'd','i','r','s', 0 };
1217c478bd9Sstevel@tonic-gate tchar S_echo[] = {'e','c','h','o', 0};
1227c478bd9Sstevel@tonic-gate tchar S_else[] =  { 'e','l','s','e', 0 };
1237c478bd9Sstevel@tonic-gate tchar S_end[] =  { 'e','n','d', 0 };
1247c478bd9Sstevel@tonic-gate tchar S_endif[] =  { 'e','n','d','i','f', 0 };
1257c478bd9Sstevel@tonic-gate tchar S_endsw[] =  { 'e','n','d','s','w', 0 };
1267c478bd9Sstevel@tonic-gate tchar S_erwxfdzo[] = {'e', 'r', 'w', 'x', 'f', 'd', 'z', 'o', 0}; /* erwxfdzo */
1277c478bd9Sstevel@tonic-gate tchar S_eval[] =  { 'e','v','a','l', 0 };
1287c478bd9Sstevel@tonic-gate tchar S_exec[] =  { 'e','x','e','c', 0 };
1297c478bd9Sstevel@tonic-gate tchar S_exit[] =  { 'e','x','i','t', 0 };
1307c478bd9Sstevel@tonic-gate tchar S_fg[] =  { 'f','g', 0 };
1317c478bd9Sstevel@tonic-gate tchar S_fignore[] = {'f','i','g','n','o','r','e',0};
1327c478bd9Sstevel@tonic-gate tchar S_filec[] = {'f','i','l','e','c',0};/*filec*/
1337c478bd9Sstevel@tonic-gate tchar S_filesize[] = {'f','i','l','e','s','i','z','e',0};/*"filesize"*/
1347c478bd9Sstevel@tonic-gate tchar S_foreach[] =  { 'f','o','r','e','a','c','h', 0 };
1357c478bd9Sstevel@tonic-gate tchar S_gd[] =  { 'g','d', 0 };
1367c478bd9Sstevel@tonic-gate tchar S_glob[] =  { 'g','l','o','b', 0 };
1377c478bd9Sstevel@tonic-gate tchar S_goto[] =  { 'g','o','t','o', 0 };
1387c478bd9Sstevel@tonic-gate tchar S_h[] = {'-','h',0};
1397c478bd9Sstevel@tonic-gate tchar S_hardpaths[]={'h', 'a', 'r', 'd', 'p', 'a', 't', 'h', 's', 0};
1407c478bd9Sstevel@tonic-gate tchar S_hashstat[] =  { 'h','a','s','h','s','t','a','t', 0 };
1417c478bd9Sstevel@tonic-gate tchar S_histchars[] = {'h','i','s','t','c','h','a','r','s',0}; /*histchars*/
1427c478bd9Sstevel@tonic-gate tchar S_history[] = {'h','i','s','t','o','r','y',0};
1437c478bd9Sstevel@tonic-gate tchar S_home[]={'h', 'o', 'm', 'e', 0};
1447c478bd9Sstevel@tonic-gate tchar S_hours[] = {'h','o','u','r','s',0};/*"hours"*/
1457c478bd9Sstevel@tonic-gate tchar S_htrqxe[]={'h', 't', 'r', 'q', 'x', 'e', 0};
1467c478bd9Sstevel@tonic-gate tchar S_if[] =  { 'i','f', 0 };
1477c478bd9Sstevel@tonic-gate tchar S_ignoreeof[] = {'i','g','n','o','r','e','e','o','f',0};	/*"ignoreeof"*/
1487c478bd9Sstevel@tonic-gate tchar S_jobs[] = {'j','o','b','s', 0};
1497c478bd9Sstevel@tonic-gate tchar S_kbytes[] = {'k','b','y','t','e','s',0};/*"kbytes"*/
1507c478bd9Sstevel@tonic-gate tchar S_kill[] =  { 'k','i','l','l', 0 };
1517c478bd9Sstevel@tonic-gate tchar S_label[] =  { 'l','a','b','e','l', 0 };
1527c478bd9Sstevel@tonic-gate tchar S_limit[] =  { 'l','i','m','i','t', 0 };
1537c478bd9Sstevel@tonic-gate tchar S_login[] =  { 'l','o','g','i','n', 0 };
1547c478bd9Sstevel@tonic-gate tchar S_logout[] =  { 'l','o','g','o','u','t', 0 };
1557c478bd9Sstevel@tonic-gate tchar S_mail[] = {'m','a','i','l', 0};
1567c478bd9Sstevel@tonic-gate tchar S_megabytes[] = {'m','e','g','a','b','y','t','e','s',0};/*"megabytes"*/
1577c478bd9Sstevel@tonic-gate tchar S_memorysize[] = {'m','e','m','o','r','y','s','i','z','e',0};/*"memorysize"*/
1587c478bd9Sstevel@tonic-gate tchar S_minutes[]={'m','i','n','u','t','e','s',0};/*"minutes"*/
1597c478bd9Sstevel@tonic-gate tchar S_n[] = {'-','n',0};/*"-n"*/
1607c478bd9Sstevel@tonic-gate tchar S_newgrp[] =  { 'n','e','w','g','r','p', 0 };
1617c478bd9Sstevel@tonic-gate tchar S_nice[] =  { 'n','i','c','e', 0 };
1627c478bd9Sstevel@tonic-gate tchar S_nobeep[] = {'n', 'o', 'b', 'e', 'e', 'p', 0};
1637c478bd9Sstevel@tonic-gate tchar S_noclobber[] = {'n','o','c','l','o','b','b','e','r',0};/*noclobber*/
1647c478bd9Sstevel@tonic-gate tchar S_noglob[] = {'n', 'o', 'g', 'l', 'o', 'b', 0}; /*noglob */
1657c478bd9Sstevel@tonic-gate tchar S_nohup[] = {'n', 'o', 'h', 'u', 'p', 0};	/*nohup */
1667c478bd9Sstevel@tonic-gate tchar S_nonomatch[] = {'n', 'o', 'n', 'o', 'm', 'a', 't', 'c', 'h', 0}; /*nonomatch */
1677c478bd9Sstevel@tonic-gate tchar S_notify[] = {'n', 'o', 't', 'i', 'f', 'y', 0};	/*nofify */
1687c478bd9Sstevel@tonic-gate tchar S_onintr[] =  { 'o','n','i','n','t','r', 0 };
1697c478bd9Sstevel@tonic-gate tchar S_path[] = {'p','a','t','h', 0}; /*path*/
1707c478bd9Sstevel@tonic-gate tchar S_popd[] =  { 'p','o','p','d', 0 };
1717c478bd9Sstevel@tonic-gate tchar S_prompt[] = {'p','r','o','m','p','t', 0};
1727c478bd9Sstevel@tonic-gate tchar S_pushd[] =  { 'p','u','s','h','d', 0 };
1737c478bd9Sstevel@tonic-gate tchar S_rd[] =  { 'r','d', 0 };
1747c478bd9Sstevel@tonic-gate tchar S_rehash[] =  { 'r','e','h','a','s','h', 0 };
1757c478bd9Sstevel@tonic-gate tchar S_repeat[] =  { 'r','e','p','e','a','t', 0 };
1767c478bd9Sstevel@tonic-gate tchar S_savehist[] = {'s','a','v','e','h','i','s','t', 0};
1777c478bd9Sstevel@tonic-gate tchar S_seconds[] = {'s','e','c','o','n','d','s',0};/*"seconds"*/
1787c478bd9Sstevel@tonic-gate tchar S_set[] =  { 's','e','t', 0 };
1797c478bd9Sstevel@tonic-gate tchar S_setenv[] =  { 's','e','t','e','n','v', 0 };
1807c478bd9Sstevel@tonic-gate tchar S_shell[] = {'s','h','e','l','l', 0};
1817c478bd9Sstevel@tonic-gate tchar S_shift[] =  { 's','h','i','f','t', 0 };
1827c478bd9Sstevel@tonic-gate tchar S_source[] = {'s','o','u','r','c','e',0};
1837c478bd9Sstevel@tonic-gate tchar S_stacksize[] = {'s','t','a','c','k','s','i','z','e',0};/*"stacksize"*/
1847c478bd9Sstevel@tonic-gate tchar S_status[]={'s', 't', 'a', 't', 'u', 's', 0};
1857c478bd9Sstevel@tonic-gate tchar S_stop[] =  { 's','t','o','p', 0 };
1867c478bd9Sstevel@tonic-gate tchar S_suspend[] =  { 's','u','s','p','e','n','d', 0 };
1877c478bd9Sstevel@tonic-gate tchar S_switch[] =  { 's','w','i','t','c','h', 0 };
1887c478bd9Sstevel@tonic-gate tchar S_term[] = {'t','e','r','m', 0};
1897c478bd9Sstevel@tonic-gate tchar S_then[] = {'t','h','e','n',0}; /*"then"*/
1907c478bd9Sstevel@tonic-gate tchar S_time[] = {'t', 'i', 'm', 'e', 0};	/*time*/
1917c478bd9Sstevel@tonic-gate tchar S_umask[] =  { 'u','m','a','s','k', 0 };
1927c478bd9Sstevel@tonic-gate tchar S_unalias[] =  { 'u','n','a','l','i','a','s', 0 };
1937c478bd9Sstevel@tonic-gate tchar S_unhash[] =  { 'u','n','h','a','s','h', 0 };
1947c478bd9Sstevel@tonic-gate tchar S_unlimit[] =  { 'u','n','l','i','m','i','t', 0 };
1957c478bd9Sstevel@tonic-gate tchar S_unlimited[] = {'u','n','l','i','m','i','t','e','d',0};/*"unlimited"*/
1967c478bd9Sstevel@tonic-gate tchar S_unset[] =  { 'u','n','s','e','t', 0 };
1977c478bd9Sstevel@tonic-gate tchar S_unsetenv[] =  { 'u','n','s','e','t','e','n','v', 0 };
1987c478bd9Sstevel@tonic-gate tchar S_user[] = {'u','s','e','r', 0};
1997c478bd9Sstevel@tonic-gate tchar S_usrbin[] = {'/','u','s','r','/','b','i','n',0};
2007c478bd9Sstevel@tonic-gate tchar S_usrucb[] = {'/','u','s','r','/','u','c','b',0};
2017c478bd9Sstevel@tonic-gate tchar S_verbose[] = {'v','e','r','b','o','s','e', 0};
2027c478bd9Sstevel@tonic-gate tchar S_wait[] =  { 'w','a','i','t', 0 };
2037c478bd9Sstevel@tonic-gate tchar S_while[] =  { 'w','h','i','l','e', 0 };
2047c478bd9Sstevel@tonic-gate /* Dummy search path for just absolute search when no path */
2057c478bd9Sstevel@tonic-gate tchar *justabs[] =      { S_ /* "" */, 0 };
206