Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtksh / aliases.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: aliases.c /main/3 1995/11/01 15:50:11 rswiston $ */
24 /***************************************************************
25 *                                                              *
26 *                      AT&T - PROPRIETARY                      *
27 *                                                              *
28 *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF        *
29 *                    AT&T BELL LABORATORIES                    *
30 *         AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN         *
31 *            ACCORDANCE WITH APPLICABLE AGREEMENTS             *
32 *                                                              *
33 *          Copyright (c) 1993 AT&T Bell Laboratories           *
34 *              Unpublished & Not for Publication               *
35 *                     All Rights Reserved                      *
36 *                                                              *
37 *       The copyright notice above does not evidence any       *
38 *      actual or intended publication of such source code      *
39 *                                                              *
40 *               This software was created by the               *
41 *           Advanced Software Technology Department            *
42 *                    AT&T Bell Laboratories                    *
43 *                                                              *
44 *               For further information contact                *
45 *                    {ulysses,attmail}!dgk                     *
46 *                     dgk@ulysses.att.com                      *
47 *                   David Korn 908-582-7975                    *
48 *                                                              *
49 ***************************************************************/
50
51 /* : : generated by proto : : */
52
53
54 #if !defined(__PROTO__)
55 #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
56 #if defined(__cplusplus)
57 #define __MANGLE__      "C"
58 #else
59 #define __MANGLE__
60 #endif
61 #define __STDARG__
62 #define __PROTO__(x)    x
63 #define __OTORP__(x)
64 #define __PARAM__(n,o)  n
65 #if !defined(__STDC__) && !defined(__cplusplus)
66 #if !defined(c_plusplus)
67 #define const
68 #endif
69 #define signed
70 #define void            int
71 #define volatile
72 #define __V_            char
73 #else
74 #define __V_            void
75 #endif
76 #else
77 #define __PROTO__(x)    ()
78 #define __OTORP__(x)    x
79 #define __PARAM__(n,o)  o
80 #define __MANGLE__
81 #define __V_            char
82 #define const
83 #define signed
84 #define void            int
85 #define volatile
86 #endif
87 #if defined(__cplusplus) || defined(c_plusplus)
88 #define __VARARG__      ...
89 #else
90 #define __VARARG__
91 #endif
92 #if defined(__STDARG__)
93 #define __VA_START__(p,a)       va_start(p,a)
94 #else
95 #define __VA_START__(p,a)       va_start(p)
96 #endif
97 #endif
98
99 #include        <ast.h>
100 #include        <signal.h>
101 #include        "FEATURE/options"
102 #include        "FEATURE/dynamic"
103 #include        "shtable.h"
104 #include        "name.h"
105
106 #include <X11/X.h>
107 #include <X11/Intrinsic.h>
108 #include <X11/IntrinsicP.h>
109 #define NO_AST
110 #include "dtksh.h"
111 #undef NO_AST
112 #include "dtextra.h"
113 #include "xmextra.h"
114 #include "msgs.h"
115
116 /*
117  * This is the table of built-in aliases.  These should be exported.
118  */
119
120 const struct shtable2 shtab_aliases[] =
121 {
122 #ifdef SHOPT_FS_3D
123         "2d",           NV_NOFREE|NV_EXPORT,    "set -f;_2d",
124 #endif /* SHOPT_FS_3D */
125         "autoload",     NV_NOFREE|NV_EXPORT,    "typeset -fu",
126         "command",      NV_NOFREE|NV_EXPORT,    "command ",
127         "fc",           NV_NOFREE|NV_EXPORT,    "hist",
128         "float",        NV_NOFREE|NV_EXPORT,    "typeset -E",
129         "functions",    NV_NOFREE|NV_EXPORT,    "typeset -f",
130         "hash",         NV_NOFREE|NV_EXPORT,    "alias -t --",
131         "history",      NV_NOFREE|NV_EXPORT,    "hist -l",
132         "integer",      NV_NOFREE|NV_EXPORT,    "typeset -i",
133         "nameref",      NV_NOFREE|NV_EXPORT,    "typeset -n",
134         "nohup",        NV_NOFREE|NV_EXPORT,    "nohup ",
135         "r",            NV_NOFREE|NV_EXPORT,    "hist -s",
136         "redirect",     NV_NOFREE|NV_EXPORT,    "command exec",
137         "times",        NV_NOFREE|NV_EXPORT,    "{ { time;} 2>&1;}",
138         "type",         NV_NOFREE|NV_EXPORT,    "whence -v",
139 #ifdef SIGTSTP
140         "stop",         NV_NOFREE|NV_EXPORT,    "kill -s STOP",
141         "suspend",      NV_NOFREE|NV_EXPORT,    "kill -s STOP $$",
142 #endif /*SIGTSTP */
143
144 DTK_EXTRA_ALIAS
145
146         "",             0,                      (char*)0
147 };