dtksh.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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: dtksh.h /main/4 1996/03/13 13:19:34 rswiston $ */
  24. /* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */
  25. /* All Rights Reserved */
  26. /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
  27. /* UNIX System Laboratories, Inc. */
  28. /* The copyright notice above does not evidence any */
  29. /* actual or intended publication of such source code. */
  30. #ifndef _Dtksh_dtksh_h
  31. #define _Dtksh_dtksh_h
  32. #if !defined(NO_AST)
  33. #include "nval.h"
  34. #endif
  35. #define SUCCESS 0
  36. #define FAIL (-1)
  37. /* bits for the flags field of wtab_t */
  38. #define F_CHILD 1
  39. #define F_TOPLEVEL 2
  40. /*
  41. * Table types
  42. */
  43. #define TAB_EMPTY 0
  44. #define TAB_FIELDS 1
  45. #define TAB_ITEMS 2
  46. #define TAB_WIDGET 3
  47. /*
  48. * Widget entry states
  49. */
  50. #define DT_PENDING_DESTROY 0x01
  51. typedef struct {
  52. char *name;
  53. char *class;
  54. char *type;
  55. int size;
  56. } resfixup_t;
  57. typedef struct {
  58. char * callbackName;
  59. void * discipline;
  60. } discInfo;
  61. typedef struct {
  62. char *cname;
  63. WidgetClass class; /* Class record */
  64. resfixup_t *resfix; /* fixup list for resources */
  65. resfixup_t *confix; /* fixup list for constraint resources */
  66. discInfo * disciplines; /* Callback data environment disciplines */
  67. char *res; /* Hashed list of resources */
  68. char *con; /* Hashed list of constraint resources */
  69. } classtab_t;
  70. typedef struct wtab {
  71. int type; /* entry type (TAB_) */
  72. int size; /* entry size */
  73. Widget w; /* widget pointer */
  74. char *wname; /* name of widget */
  75. char *widid; /* id of widget */
  76. classtab_t *wclass; /* widget's class */
  77. struct wtab *parent; /* pointer to widget's parent wtab_t */
  78. char *envar; /* initial environment variable user gave */
  79. unsigned char mask; /* keeps track of state; i.e. pending destroy */
  80. XtPointer info; /* some widgets use this for any other info */
  81. } wtab_t;
  82. typedef struct {
  83. char *ksh_cmd;
  84. wtab_t *w;
  85. char *cbname;
  86. int refCount;
  87. Atom propAtom;
  88. XtPointer handle;
  89. } dtksh_client_data_t;
  90. typedef struct {
  91. char *ksh_cmd;
  92. wtab_t *w;
  93. EventMask eventMask;
  94. Boolean nonMaskable;
  95. } dtksh_event_handler_data_t;
  96. typedef struct {
  97. char *name;
  98. EventMask mask;
  99. } EventMaskTable;
  100. typedef struct {
  101. char *name;
  102. int value;
  103. } MWMTable;
  104. #define LINESIZE 1024
  105. /* Input buffer modes */
  106. #define LINE_INPUT_MODE (1<<0)
  107. #define RAW_INPUT_MODE (1<<1)
  108. #define INPUT_SOURCE_BUSY (1<<2)
  109. #define INPUT_SOURCE_PENDING_DELETE (1<<3)
  110. typedef struct {
  111. int fd; /* the input source */
  112. char *lnbuf; /* a line being built */
  113. int lnbufsize; /* size of line buffer */
  114. int lnend; /* current end of the line */
  115. char *cmd; /* the ksh command to execute given the line */
  116. unsigned char flags; /* mode flags */
  117. char lastCharIsBackslash; /* Used during backslash processing */
  118. char lineWasTouched; /* Empty line, but had a backslash */
  119. } inputrec_t;
  120. #ifndef CONSTCHAR
  121. #define CONSTCHAR (const char *)
  122. #endif
  123. #define PRINTER_INFO_PROC 0
  124. #define SELECT_FILE_PROC 1
  125. #define SELECT_PRINTER_PROC 2
  126. #define SETUP_PROC 3
  127. #define VERIFY_PRINTER_PROC 4
  128. typedef struct {
  129. String printerInfoProcCommand;
  130. String selectFileProcCommand;
  131. String selectPrinterProcCommand;
  132. String setupProcCommand;
  133. String verifyPrinterProcCommand;
  134. } ProcInfo_t;
  135. #endif /* _Dtksh_dtksh_h */
  136. /* DON'T ADD ANYTHING AFTER THIS #endif */