File: expWin.h

package info (click to toggle)
gnat-gps 5.3dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 50,360 kB
  • ctags: 11,617
  • sloc: ada: 374,346; ansic: 92,327; python: 15,979; xml: 12,186; sh: 3,277; makefile: 1,113; awk: 154; perl: 128; java: 17
file content (97 lines) | stat: -rw-r--r-- 2,459 bytes parent folder | download | duplicates (5)
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
/*
 * expWin.h --
 *
 *	Useful definitions for Expect on NT.
 *
 * Copyright (c) 2006 AdaCore
 * Copyright (c) 1997 by Mitel, Inc.
 * Copyright (c) 1997 by Gordon Chaffee (chaffee@home.com)
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 */

#ifndef _EXPWIN
#define _EXPWIN

#include <windows.h>

#define EXP_SLAVE_CREATE 'c'
#define EXP_SLAVE_KEY    'k'
#define EXP_SLAVE_MOUSE  'm'
#define EXP_SLAVE_WRITE  'w'
#define EXP_SLAVE_KILL   'x'

/*
 * Define the types of attempts to use to kill the subprocess
 */
#define EXP_KILL_TERMINATE  0x1
#define EXP_KILL_CTRL_C     0x2
#define EXP_KILL_CTRL_BREAK 0x4


#ifdef EXPLAUNCH_DEBUG
#include <stdio.h>
extern FILE *log_file;
#define EXP_BEGIN(filename) \
    log_file=fopen(filename,"w");
#define EXP_LOG(format, args) \
    if (log_file!=NULL) \
      fprintf(log_file, "Expect SlaveDriver %s: %d " format "\n", \
              __FILE__, __LINE__, args)
#define EXP_LOG_FLUSH fflush (log_file)
#define panic(log) \
    if (log_file!=NULL) \
      fprintf(log_file, "Expect SlaveDriver panic at %s: %d %s\n", \
              __FILE__,__LINE__,log)
#define LOG_ENTRY(log) \
    if (log_file!=NULL) \
      fprintf(log_file, ">>>%s\n", log)
#define LOG_EXIT(log) \
    if (log_file!=NULL) \
      fprintf(log_file, "<<<%s\n", log)
#define EXP_END \
    fclose (log_file)
#define EXP_DEBUG 1

#else /* !SLAVEDRV */

#define EXP_BEGIN(filename)
#define EXP_LOG(format, args)
#define EXP_LOG_FLUSH
#define panic(log)
#define LOG_ENTRY(log)
#define LOG_EXIT(log)
#define EXP_END
#endif /* !SLAVEDRV */


#define ckfree free
#define ckalloc malloc

/*
 * The following defines identify the various types of applications that
 * run under windows.  There is special case code for the various types.
 */

#define EXP_APPL_NONE	0
#define EXP_APPL_DOS	1
#define EXP_APPL_WIN3X	2
#define EXP_APPL_WIN32	3

/* typedef struct { */
/*     Tcl_Channel channelPtr; */
/*     int toWrite; */
/* } ExpSpawnState; */

extern DWORD		ExpApplicationType(const char *originalName,
			    char *fullPath, char *imageName);
extern DWORD		ExpCreateProcess(int argc, char **argv,
			    int allocConsole,
			    int hideConsole, int debug, int newProcessGroup,
			    PHANDLE pidPtr, LPPROCESS_INFORMATION globalProcInfo);
extern HANDLE		Exp_WaitPid(HANDLE pid, LPDWORD statPtr, DWORD options);
extern void		Exp_KillProcess(HANDLE pid);

#endif