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