File: SeDecl.h

package info (click to toggle)
seyon 2.20c-37
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,456 kB
  • sloc: ansic: 18,424; yacc: 184; sh: 183; makefile: 9
file content (418 lines) | stat: -rw-r--r-- 11,919 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
/*
 * This file is part of the Seyon, Copyright (c) 1992-1993 by Muhammad M.
 * Saggaf. All rights reserved.
 *
 * See the file COPYING (1-COPYING) or the manual page seyon(1) for a full
 * statement of rights and permissions for this program.
 */

/*                               -*- Mode: C -*- 
 * SeDecl.h --- Declarations header file
 * Author          : Muhammad M. Saggaf
 * Created On      : sometime in 1992
 * Last Modified By: system admin
 * Last Modified On: Wed Jun  9 20:07:26 1993
 * Update Count    : 10
 * Status          : Mostly OK, needs some cleaning up
 */

#include <stdio.h>
#include <X11/Intrinsic.h>

extern Boolean  do_script(),
                DoToggleCapture(),
                SeGetToggleState();
extern char    *str_strip_lead_end_space(),
               *str_strip_lead_space(),
               *str_strip_end_space(),
               *str_stripspc_copy(),
               *StripSpace(),
               *FmtString(),
               *GetFirstWord(),
               *GetNextWord(),
               *expand_fname(),
                itoa(),
               *mport(),
                MdmReadChar(),
                TermReadChar(),
                read_seyon_file();
extern long     mbaud();
extern int      open_modem(),
                trminp(),
                io_get_attr(),
                io_set_attr(),
                io_flush(),
                io_send_break(),
                lock_tty(),
                SeFork(),
                coninp(),
                read_mbyte(),
                dial_number(),
                redial(),
                readbyte(),

                CloseModem(),
                OpenModem(),
                MdmSetGetBaud(),
                MdmSetGetCSize(),
                MdmSetGetParity(),
                MdmSetGetStopBits(),
                MdmSetGetIStrip(),
                MdmSaveRestoreAttr(),
                Online(),

                SuspContTerminal(),
                get_modem_fio();
extern FILE    *open_file(),
               *open_file_va();
extern void     send_break(),
                show(),
                showf(),
                SeyonMessage(),
                SeyonMessagef(),
                StartTerminal(),
                KillTerminal(),
                RestartTerminal(),
                getword(),

                se_warning(),
                se_warningf(),
                SeError(),
                SeErrorF(),
                SePError(),
                SePErrorF(),
                SeNotice(),
                SeNoticeF(),
                ShowOpenModemErrMsg(),

                setup_signal_handlers(),
                exec_close_script(),
                io_set_speed(),
                s_exit(),
                unlock_tty(),
                SeSetUnsetToggle(),
                ProcRequest(),
                write_child_info(),
                writef_child_info(),
                exec_cmd(),
                ShellCommand(),
                ExecShellCommand(),
                sendbyte(),
                send_tbyte(),
                send_slowly(),
                sendf_slowly(),
                cancel_dial(),
                SeBeep(),
                Beep(),
                FancyBell(),
                SeSetViewportDimFromMultiList(),
                get_dial_info(),
                TopDial(),
                SeSetDialogValue(),
                xc_setflow(),
                set_rtscts(),
                RemoveCurrentItem(),
                DialCirculate(),
                DialerEnd(),
                read_file(),
                read_pipe_data(),
                write_pipe_data(),
                read_close_file(),
                dial(),
                sync_modem_attr(),
                PortToTty(),
                do_exit(),
                get_line(),
                seyon_getline(),
                lc_word(),
                toggle_flag(),
                cpmode(),
                set_onoff(),
                SetStatusMessage(),
                set_modem_fio(),
                set_modem_attr(),
                get_modem_attr(),
                mattach(),

                MdmIFlush(),
                MdmPurge(),
                MdmHangup(),
                MdmPutString(),

                DestroyShell(),
                DestroyShellCallBack(),
                EditFile(),
                ExecProcRequest(),
                ExecExit(),
                SePopupNoticeF(),
                SeSetViewportDimFromList(),
                SeSetViewportDimensions(),
                SetStatusMessagef(),
                SeSetWidgetWidth(),
                SeSetWidgetHeight(),
                SeSetValue(),
                SeSetLabel(),
                restore_orig_mode(),
                GetWord(),
                FunMessage(),
                IdleGuard(),
                mprintf(),
                PopupError(),

                kill_w_child(),
                ChildKillInternal(),
                ChildKillExternal(),
                w_exit_up(),
                w_kill_up(),
                PreProcessPrep(),
                PostProcessPrep(),
                PreExecPrep(),
                SetKillButtonSens(),

                ReadCommentedFile(),
                FreeList(),
                UpdateStatusBox(),
                CenterShell(),
                CenterShellOnRoot(),
                PositionShell(),
                ResetFlag(),
                SetSensitiveOn(),
                set_tty_mode();
extern Widget   GetShell(),
                SePopupDialogGetString(),
                SeAddButton(),
                AddButton(),
                SeAddButtonWithClientData(),
                SeAddButtonWCD(),
                SeAddLabel(),
                SeAddToggle(),
                SeAddToggleWCD(),
                SeCreatePopup(),
                SeCreateTopLevelPopup(),
                SeAddDialog(),
                AddBox(),
                SeAddBox(),
                SeAddForm(),
                SeAddPaned(),
                AddPaned(),
                SeAddPopupWG(),
                SeAddPopup(),
                AddSimplePopup(),
                SeAddPopupOffset(),
                SeAddPopupUL(),
                SePopupNotice(),
                SePopupRadio(),
                PopupDialogGetValue(),
                SePopupDialogGetString(),
                SePopupDialogGetStringE();
extern Dimension SeWidgetWidth(),
                SeWidgetHeight();

/*
 *   Apprarently these two are not ANSI?
 */
#if __STDC__ == 1 && defined(SVR4)
extern int      kill(),
                fileno();
#endif

#if HAVE_TERMIOS
extern struct termios oldmode,
                newmode;
#else
#if HAVE_TERMIO
extern struct termio oldmode,
                newmode;
#else
#if HAVE_SGTTYB
extern struct sgttyb oldmode,
                newmode;
#endif
#endif
#endif

/*
 * defined constants
 */

#define SUSPEND_TERM              18
#define CONTINUE_TERM             19
#define START_TERM                20
#define START_AUTO_ZM             21
#define SET_MESSAGE               22
#define KILL_TERM                 23
#define EXIT_PROGRAM              24
#define EXEC_SCRIPT               25
#define TOP_DIAL                  26
#define POPUP_ERROR               27
#define TOP_DIAL_START            28
#define DISPATCH_ACTION           29

#define SHELLPOS_HWFH             1

#define TIN_BUF 20				/* number of chars in a tiny buffer */
#define LIT_BUF 40				/* number of chars in a little buffer */
#define SM_BUF  80				/* number of chars in a small buffer */
#define REG_BUF 256				/* number of chars in a regular buffer */
#define LRG_BUF 1024			/* number of chars in a large buffer */

#define MDELAY  50000			/* delay of output to modem in command mode */

#define ERR_MDM_NOMODEM             -1
#define ERR_MDM_LOCKED              -2
#define ERR_MDM_OPENFAILED          -3
#define ERR_MDM_RESETFLAGSFAILED    -4

#define TERM_SUSPEND   0
#define TERM_CONTINUE  1

#define ATTR_SAVE      0
#define ATTR_RESTORE   1

#define ACTION_NEW_ACTION           1
#define ACTION_NEW_ARG              2
#define ACTION_ARGS_END             3
#define ACTION_PARSE_ERROR          4
#define ACTION_DISPATCH            10

/*
 * Modem lines
 */

#define NUM_MDM_STAT 8

#define MDM_LE    0x001
#define MDM_DTR   0x002
#define MDM_RTS   0x004
#define MDM_ST    0x008
#define MDM_SR    0x010
#define MDM_CTS   0x020
#define MDM_DCD   0x040
#define MDM_RNG   0x080
#define MDM_DSR   0x100

#define CNULL ('\0')

/*
 * macros
 */

#define SSpc(str) str_strip_lead_end_space(str)

#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))

#define ret_if_up(w, up_fl) {if (up_fl) {SeBeep(w);	return;}}
#define ReturnIfTrue(flag) {if (flag) {Beep();	return;}}
#define ErrorIfBusy() {if(inhibit_child) {Beep(); \
  SeyonMessage("Busy with Another Process"); return;}}

#define GET_ARG() {getword(); if (eof_flag) return;}
#define GETTEST_ARG(cmd) {GET_ARG(); if (word[0] == '\0') { \
  SeErrorF("Missing argument to the command `%s'", cmd, "", ""); \
  eof_flag = 1; return;}}

#define PopupCentered(popup,parent) \
  {CenterShell(popup,parent); XtPopupSpringLoaded(popup);}
#define PopupCenteredOnRoot(popup) \
  {CenterShellOnRoot(popup);  XtPopupSpringLoaded(popup);}
#define SimpleError(message) {Beep(); SeyonMessage(message); return;}
#define SimpleErrorF(fmt,a,b,c) {Beep(); SeyonMessagef(fmt,a,b,c); return;}

#define FmtString0(fmt) FmtString(fmt,"","","")
#define FmtString1(fmt,a) FmtString(fmt,a,"","")
#define FmtString2(fmt,a,b) FmtString(fmt,a,b,"")
#define FmtString3(fmt,a,b,c) FmtString(fmt,a,b,c)

/*
 * Resource structures
 */

struct _quickKeyRes {
  Boolean     visible;
  String      action;
};

struct QueryResources {
  String          modems;
  String          script;

  String          defaultBPS;
  int             defaultBits;
  int             defaultParity;
  int             defaultStopBits;
  Boolean         stripHighBit;
  Boolean         backspaceTranslation;
  Boolean         metaKeyTranslation;
  Boolean         xonxoffFlowControl;
  Boolean         rtsctsFlowControl;
  String          newlineTranslation;

  String          dialPrefix;
  String          dialSuffix;
  String          dialCancelString;

  int             dialTimeOut;
  int             dialDelay;
  int             dialRepeat;

  String          connectString;
  String          noConnectString[4];

  Boolean         hangupBeforeDial;
  Boolean         dialAutoStart;
  String          dialDirFormat;
  String          defaultPhoneEntries;

  String          startupAction;
  String          postConnectAction;
  Boolean         autoZmodem;
  String          autoZmodemAction;

  int             modemVMin;
  Boolean         ignoreModemDCD;
  Boolean         hangupViaDTR;
  String          modemAttentionString;
  String          modemHangupString;
  Boolean         hangupConfirm;
  Boolean         exitConfirm;
  Boolean         neverBeep;

  String          defaultDirectory;
  String          scriptDirectory;
  String          startupFile;
  String          phoneFile;
  String          protocolsFile;
  String          captureFile;
  String          helpFile;

  int             modemStatusInterval;
  Boolean         idleGuard;
  int             idleGuardInterval;
  String          idleGuardString;
  Boolean         showFunMessages;
  int             funMessagesInterval;
  String         *funMessages;
};

extern XtAppContext app_con;
extern struct   QueryResources qres;
extern Widget   topLevel,
                genericWidget;
extern Widget   dialWidget;

extern Boolean  inhibit_child;
extern char     captureFile[REG_BUF],
                modem_port[REG_BUF],
               *lptr;
extern int      newlineTrMode;
extern int      child_pipe[2];
extern pid_t    w_child_pid;
extern pid_t    childProcPid;

extern int      quote_flag;
extern int      linkflag,
                eof_flag;
extern char     word[],
               *wptr,
                line[];