dtksh.h 4.1 KB

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