aliases.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 libraries 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. /* : : generated by proto : : */
  51. #if !defined(__PROTO__)
  52. #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
  53. #if defined(__cplusplus)
  54. #define __MANGLE__ "C"
  55. #else
  56. #define __MANGLE__
  57. #endif
  58. #define __STDARG__
  59. #define __PROTO__(x) x
  60. #define __OTORP__(x)
  61. #define __PARAM__(n,o) n
  62. #if !defined(__STDC__) && !defined(__cplusplus)
  63. #if !defined(c_plusplus)
  64. #define const
  65. #endif
  66. #define signed
  67. #define void int
  68. #define volatile
  69. #define __V_ char
  70. #else
  71. #define __V_ void
  72. #endif
  73. #else
  74. #define __PROTO__(x) ()
  75. #define __OTORP__(x) x
  76. #define __PARAM__(n,o) o
  77. #define __MANGLE__
  78. #define __V_ char
  79. #define const
  80. #define signed
  81. #define void int
  82. #define volatile
  83. #endif
  84. #if defined(__cplusplus) || defined(c_plusplus)
  85. #define __VARARG__ ...
  86. #else
  87. #define __VARARG__
  88. #endif
  89. #if defined(__STDARG__)
  90. #define __VA_START__(p,a) va_start(p,a)
  91. #else
  92. #define __VA_START__(p,a) va_start(p)
  93. #endif
  94. #endif
  95. #include <ast.h>
  96. #include <signal.h>
  97. #include "FEATURE/options"
  98. #include "FEATURE/dynamic"
  99. #include "shtable.h"
  100. #include "name.h"
  101. #include <X11/X.h>
  102. #include <X11/Intrinsic.h>
  103. #include <X11/IntrinsicP.h>
  104. #define NO_AST
  105. #include "dtksh.h"
  106. #undef NO_AST
  107. #include "dtextra.h"
  108. #include "xmextra.h"
  109. #include "msgs.h"
  110. /*
  111. * This is the table of built-in aliases. These should be exported.
  112. */
  113. const struct shtable2 shtab_aliases[] =
  114. {
  115. #ifdef SHOPT_FS_3D
  116. "2d", NV_NOFREE|NV_EXPORT, "set -f;_2d",
  117. #endif /* SHOPT_FS_3D */
  118. "autoload", NV_NOFREE|NV_EXPORT, "typeset -fu",
  119. "command", NV_NOFREE|NV_EXPORT, "command ",
  120. "fc", NV_NOFREE|NV_EXPORT, "hist",
  121. "float", NV_NOFREE|NV_EXPORT, "typeset -E",
  122. "functions", NV_NOFREE|NV_EXPORT, "typeset -f",
  123. "hash", NV_NOFREE|NV_EXPORT, "alias -t --",
  124. "history", NV_NOFREE|NV_EXPORT, "hist -l",
  125. "integer", NV_NOFREE|NV_EXPORT, "typeset -i",
  126. "nameref", NV_NOFREE|NV_EXPORT, "typeset -n",
  127. "nohup", NV_NOFREE|NV_EXPORT, "nohup ",
  128. "r", NV_NOFREE|NV_EXPORT, "hist -s",
  129. "redirect", NV_NOFREE|NV_EXPORT, "command exec",
  130. "times", NV_NOFREE|NV_EXPORT, "{ { time;} 2>&1;}",
  131. "type", NV_NOFREE|NV_EXPORT, "whence -v",
  132. #ifdef SIGTSTP
  133. "stop", NV_NOFREE|NV_EXPORT, "kill -s STOP",
  134. "suspend", NV_NOFREE|NV_EXPORT, "kill -s STOP $$",
  135. #endif /*SIGTSTP */
  136. DTK_EXTRA_ALIAS
  137. "", 0, (char*)0
  138. };