~ubuntu-branches/ubuntu/natty/ibm-3270/natty

« back to all changes in this revision

Viewing changes to wc3270/globals.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2009-12-14 11:48:53 UTC
  • mfrom: (1.1.4 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091214114853-mywixml32hct9jr1
Tags: 3.3.10ga4-2
* Fix section to match override.
* Use debhelper compat level 7.
* Use 3.0 (quilt) source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Modifications Copyright 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2002,
3
 
 *  2003, 2004, 2005, 2006 by Paul Mattes.
4
 
 * RPQNAMES modifications copyright 2005 by Don Russell.
5
 
 * Copyright 1990 by Jeff Sparkes.
6
 
 *  Permission to use, copy, modify, and distribute this software and its
7
 
 *  documentation for any purpose and without fee is hereby granted,
8
 
 *  provided that the above copyright notice appear in all copies and that
9
 
 *  both that copyright notice and this permission notice appear in
10
 
 *  supporting documentation.
11
 
 *
12
 
 * x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will
13
 
 * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the file LICENSE
15
 
 * for more details.
 
2
 * Copyright (c) 1993-2009, Paul Mattes.
 
3
 * Copyright (c) 2005, Don Russell.
 
4
 * Copyright (c) 1990, Jeff Sparkes.
 
5
 * All rights reserved.
 
6
 *
 
7
 * Redistribution and use in source and binary forms, with or without
 
8
 * modification, are permitted provided that the following conditions are met:
 
9
 *     * Redistributions of source code must retain the above copyright
 
10
 *       notice, this list of conditions and the following disclaimer.
 
11
 *     * Redistributions in binary form must reproduce the above copyright
 
12
 *       notice, this list of conditions and the following disclaimer in the
 
13
 *       documentation and/or other materials provided with the distribution.
 
14
 *     * Neither the names of Paul Mattes, Don Russell, Jeff Sparkes nor the
 
15
 *       names of their contributors may be used to endorse or promote
 
16
 *       products derived from this software without specific prior written
 
17
 *       permission.
 
18
 *
 
19
 * THIS SOFTWARE IS PROVIDED BY PAUL MATTES, DON RUSSELL AND JEFF SPARKES
 
20
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 
21
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
22
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, DON RUSSELL OR JEFF
 
23
 * SPARKES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 
24
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
25
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
26
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
27
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
28
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
29
 * POSSIBILITY OF SUCH DAMAGE.
16
30
 */
17
31
 
18
32
/*
50
64
 * Compiler-specific #defines.
51
65
 */
52
66
 
53
 
/* 'unused' explicitly flags an unused parameter */
 
67
/* '_is_unused' explicitly flags an unused parameter */
54
68
#if defined(__GNUC__) /*[*/
55
 
#define unused __attribute__((__unused__))
 
69
#define _is_unused __attribute__((__unused__))
56
70
#define printflike(s,f) __attribute__ ((__format__ (__printf__, s, f)))
57
71
#else /*][*/
58
 
#define unused /* nothing */
 
72
#define _is_unused /* nothing */
59
73
#define printflike(s, f) /* nothing */
60
74
#endif /*]*/
61
75
 
62
 
 
63
 
 
64
76
/*
65
77
 * Prerequisite #includes.
66
78
 */
67
79
#include <stdio.h>                      /* Unix standard I/O library */
68
80
#include <stdlib.h>                     /* Other Unix library functions */
 
81
#if !defined(_MSC_VER) /*[*/
69
82
#include <unistd.h>                     /* Unix system calls */
 
83
#endif /*]*/
70
84
#include <ctype.h>                      /* Character classes */
71
85
#include <string.h>                     /* String manipulations */
72
86
#include <sys/types.h>                  /* Basic system data types */
 
87
#if !defined(_MSC_VER) /*[*/
73
88
#include <sys/time.h>                   /* System time-related data types */
 
89
#endif /*]*/
74
90
#include <time.h>                       /* C library time functions */
75
91
#include "localdefs.h"                  /* {s,tcl,c}3270-specific defines */
76
92
 
77
93
/*
 
94
 * MSC glue.
 
95
 */
 
96
#if defined(_MSC_VER) /*[*/
 
97
#include <winsock2.h>                   /* for struct timeval */
 
98
extern int gettimeofday(struct timeval *, void *);
 
99
#define R_OK    4
 
100
#define strcasecmp      _stricmp
 
101
#define strncasecmp     _strnicmp
 
102
#endif /*]*/
 
103
 
 
104
/*
 
105
 * Locale-related definitions.
 
106
 * Note that USE_ICONV can be used to override __STDC_ISO_10646__, so that
 
107
 * development of iconv-based logic can be done on 10646-compliant systems.
 
108
 */
 
109
#if defined(__STDC_ISO_10646__) && !defined(USE_ICONV) /*[*/
 
110
#define UNICODE_WCHAR   1
 
111
#endif /*]*/
 
112
#if !defined(_WIN32) && !defined(UNICODE_WCHAR) /*[*/
 
113
#undef USE_ICONV
 
114
#define USE_ICONV 1
 
115
#include <iconv.h>
 
116
#endif /*]*/
 
117
 
 
118
/*
 
119
 * Unicode UCS-4 characters are (hopefully) 32 bits.
 
120
 * EBCDIC (including DBCS) is (hopefully) 16 bits.
 
121
 */
 
122
typedef unsigned int ucs4_t;
 
123
typedef unsigned short ebc_t;
 
124
 
 
125
/*
78
126
 * Cancel out contradictory parts.
79
127
 */
80
128
#if !defined(X3270_DISPLAY) /*[*/
81
129
#undef X3270_KEYPAD
82
130
#undef X3270_MENUS
83
131
#endif /*]*/
 
132
#if defined(C3270) && defined(X3270_DBCS) && !defined(CURSES_WIDE) /*[*/
 
133
#undef X3270_DBCS
 
134
#endif /*]*/
84
135
 
85
136
/* Local process (-e) header files. */
86
 
#if defined(X3270_LOCAL_PROCESS) && defined(HAVE_LIBUTIL) /*[*/
 
137
#if defined(X3270_LOCAL_PROCESS) && defined(HAVE_FORKPTY) /*[*/
87
138
#define LOCAL_PROCESS   1
88
139
#include <termios.h>
89
140
#if defined(HAVE_PTY_H) /*[*/
107
158
 
108
159
/* Simple global variables */
109
160
 
110
 
extern int              COLS;
 
161
extern int              COLS;           /* current */
111
162
extern int              ROWS;
 
163
extern int              maxCOLS;        /* maximum */
 
164
extern int              maxROWS;
 
165
extern int              defROWS;        /* default (EraseWrite) */
 
166
extern int              defCOLS;
 
167
extern int              altROWS;        /* alternate (EraseWriteAlternate) */
 
168
extern int              altCOLS;
112
169
#if defined(X3270_DISPLAY) /*[*/
113
170
extern Atom             a_3270, a_registry, a_encoding;
114
171
extern XtAppContext     appcontext;
145
202
extern char             *funky_font;
146
203
extern char             *hostname;
147
204
#if defined(X3270_DBCS) /*[*/
148
 
extern char             *local_encoding;
149
205
#if defined(X3270_DISPLAY) /*[*/
150
206
extern char             *locale_name;
151
207
#endif /*]*/
154
210
#if defined(LOCAL_PROCESS) /*[*/
155
211
extern Boolean          local_process;
156
212
#endif /*]*/
157
 
extern int              maxCOLS;
158
 
extern int              maxROWS;
159
213
extern char             *model_name;
160
214
extern int              model_num;
161
215
extern Boolean          no_login_host;
162
216
extern Boolean          non_tn3270e_host;
163
217
extern int              ov_cols, ov_rows;
 
218
extern Boolean          ov_auto;
164
219
extern Boolean          passthru_host;
165
220
extern const char       *programname;
166
221
extern char             *qualified_host;
189
244
extern XrmDatabase      rdb;
190
245
extern Window           root_window;
191
246
extern char             *user_title;
192
 
extern unsigned char    xk_selector;
193
247
#endif /*]*/
194
248
 
195
 
#if defined(C3270) && defined(_WIN32) /*[*/
 
249
#if defined(_WIN32) && (defined(C3270) || defined(S3270)) /*[*/
196
250
extern char             *instdir;
197
 
extern char             myappdata[];
 
251
extern char             *myappdata;
 
252
#endif /*]*/
 
253
 
 
254
#if defined(_WIN32) && defined(C3270) /*[*/
 
255
extern int              is_installed;
198
256
#endif /*]*/
199
257
 
200
258
/* Data types and complex global variables */