Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- deepseek/include/bzlib.h +282 -0
- deepseek/include/cursesf.h +968 -0
- deepseek/include/cursesm.h +674 -0
- deepseek/include/cursesp.h +271 -0
- deepseek/include/default.h +27 -0
- deepseek/include/eti.h +55 -0
- deepseek/include/etip.h +406 -0
- deepseek/include/fakesql.h +283 -0
- deepseek/include/ffi.h +531 -0
- deepseek/include/ffitarget.h +164 -0
- deepseek/include/form.h +460 -0
- deepseek/include/itcl.h +198 -0
- deepseek/include/itclDecls.h +206 -0
- deepseek/include/itclInt.h +854 -0
- deepseek/include/menu.h +281 -0
- deepseek/include/mysqlStubs.h +101 -0
- deepseek/include/nc_tparm.h +92 -0
- deepseek/include/ncurses_dll.h +99 -0
- deepseek/include/odbcStubs.h +80 -0
- deepseek/include/pqStubs.h +85 -0
- deepseek/include/python3.10/pymem.h +104 -0
- deepseek/include/sqlite3.h +0 -0
- deepseek/include/tcl.h +2642 -0
- deepseek/include/tclIntPlatDecls.h +600 -0
- deepseek/include/tclOOInt.h +607 -0
- deepseek/include/tclPlatDecls.h +144 -0
- deepseek/include/tclTomMath.h +1131 -0
- deepseek/include/tclTomMathDecls.h +685 -0
- deepseek/include/tdbc.h +80 -0
- deepseek/include/tdbcInt.h +55 -0
- deepseek/include/term_entry.h +239 -0
- deepseek/include/termcap.h +73 -0
- deepseek/include/tic.h +396 -0
- deepseek/include/tkCanvas.h +312 -0
- deepseek/include/tkEntry.h +298 -0
- deepseek/include/tkFont.h +224 -0
- deepseek/include/tkIntDecls.h +1235 -0
- deepseek/include/tkMacOSXColor.h +267 -0
- deepseek/include/tkMacOSXConstants.h +123 -0
- deepseek/include/tkMacOSXCursors.h +89 -0
- deepseek/include/tkMacOSXDebug.h +34 -0
- deepseek/include/tkMacOSXDefault.h +570 -0
- deepseek/include/tkMacOSXFont.h +32 -0
- deepseek/include/tkMacOSXInt.h +198 -0
- deepseek/include/tkMacOSXKeysyms.h +1308 -0
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
/*-------------------------------------------------------------*/
|
| 3 |
+
/*--- Public header file for the library. ---*/
|
| 4 |
+
/*--- bzlib.h ---*/
|
| 5 |
+
/*-------------------------------------------------------------*/
|
| 6 |
+
|
| 7 |
+
/* ------------------------------------------------------------------
|
| 8 |
+
This file is part of bzip2/libbzip2, a program and library for
|
| 9 |
+
lossless, block-sorting data compression.
|
| 10 |
+
|
| 11 |
+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
| 12 |
+
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
| 13 |
+
|
| 14 |
+
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
| 15 |
+
README file.
|
| 16 |
+
|
| 17 |
+
This program is released under the terms of the license contained
|
| 18 |
+
in the file LICENSE.
|
| 19 |
+
------------------------------------------------------------------ */
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
#ifndef _BZLIB_H
|
| 23 |
+
#define _BZLIB_H
|
| 24 |
+
|
| 25 |
+
#ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
#define BZ_RUN 0
|
| 30 |
+
#define BZ_FLUSH 1
|
| 31 |
+
#define BZ_FINISH 2
|
| 32 |
+
|
| 33 |
+
#define BZ_OK 0
|
| 34 |
+
#define BZ_RUN_OK 1
|
| 35 |
+
#define BZ_FLUSH_OK 2
|
| 36 |
+
#define BZ_FINISH_OK 3
|
| 37 |
+
#define BZ_STREAM_END 4
|
| 38 |
+
#define BZ_SEQUENCE_ERROR (-1)
|
| 39 |
+
#define BZ_PARAM_ERROR (-2)
|
| 40 |
+
#define BZ_MEM_ERROR (-3)
|
| 41 |
+
#define BZ_DATA_ERROR (-4)
|
| 42 |
+
#define BZ_DATA_ERROR_MAGIC (-5)
|
| 43 |
+
#define BZ_IO_ERROR (-6)
|
| 44 |
+
#define BZ_UNEXPECTED_EOF (-7)
|
| 45 |
+
#define BZ_OUTBUFF_FULL (-8)
|
| 46 |
+
#define BZ_CONFIG_ERROR (-9)
|
| 47 |
+
|
| 48 |
+
typedef
|
| 49 |
+
struct {
|
| 50 |
+
char *next_in;
|
| 51 |
+
unsigned int avail_in;
|
| 52 |
+
unsigned int total_in_lo32;
|
| 53 |
+
unsigned int total_in_hi32;
|
| 54 |
+
|
| 55 |
+
char *next_out;
|
| 56 |
+
unsigned int avail_out;
|
| 57 |
+
unsigned int total_out_lo32;
|
| 58 |
+
unsigned int total_out_hi32;
|
| 59 |
+
|
| 60 |
+
void *state;
|
| 61 |
+
|
| 62 |
+
void *(*bzalloc)(void *,int,int);
|
| 63 |
+
void (*bzfree)(void *,void *);
|
| 64 |
+
void *opaque;
|
| 65 |
+
}
|
| 66 |
+
bz_stream;
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
#ifndef BZ_IMPORT
|
| 70 |
+
#define BZ_EXPORT
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
#ifndef BZ_NO_STDIO
|
| 74 |
+
/* Need a definitition for FILE */
|
| 75 |
+
#include <stdio.h>
|
| 76 |
+
#endif
|
| 77 |
+
|
| 78 |
+
#ifdef _WIN32
|
| 79 |
+
# include <windows.h>
|
| 80 |
+
# ifdef small
|
| 81 |
+
/* windows.h define small to char */
|
| 82 |
+
# undef small
|
| 83 |
+
# endif
|
| 84 |
+
# ifdef BZ_EXPORT
|
| 85 |
+
# define BZ_API(func) WINAPI func
|
| 86 |
+
# define BZ_EXTERN extern
|
| 87 |
+
# else
|
| 88 |
+
/* import windows dll dynamically */
|
| 89 |
+
# define BZ_API(func) (WINAPI * func)
|
| 90 |
+
# define BZ_EXTERN
|
| 91 |
+
# endif
|
| 92 |
+
#else
|
| 93 |
+
# define BZ_API(func) func
|
| 94 |
+
# define BZ_EXTERN extern
|
| 95 |
+
#endif
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
/*-- Core (low-level) library functions --*/
|
| 99 |
+
|
| 100 |
+
BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
|
| 101 |
+
bz_stream* strm,
|
| 102 |
+
int blockSize100k,
|
| 103 |
+
int verbosity,
|
| 104 |
+
int workFactor
|
| 105 |
+
);
|
| 106 |
+
|
| 107 |
+
BZ_EXTERN int BZ_API(BZ2_bzCompress) (
|
| 108 |
+
bz_stream* strm,
|
| 109 |
+
int action
|
| 110 |
+
);
|
| 111 |
+
|
| 112 |
+
BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
|
| 113 |
+
bz_stream* strm
|
| 114 |
+
);
|
| 115 |
+
|
| 116 |
+
BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
|
| 117 |
+
bz_stream *strm,
|
| 118 |
+
int verbosity,
|
| 119 |
+
int small
|
| 120 |
+
);
|
| 121 |
+
|
| 122 |
+
BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
|
| 123 |
+
bz_stream* strm
|
| 124 |
+
);
|
| 125 |
+
|
| 126 |
+
BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
|
| 127 |
+
bz_stream *strm
|
| 128 |
+
);
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
/*-- High(er) level library functions --*/
|
| 133 |
+
|
| 134 |
+
#ifndef BZ_NO_STDIO
|
| 135 |
+
#define BZ_MAX_UNUSED 5000
|
| 136 |
+
|
| 137 |
+
typedef void BZFILE;
|
| 138 |
+
|
| 139 |
+
BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
|
| 140 |
+
int* bzerror,
|
| 141 |
+
FILE* f,
|
| 142 |
+
int verbosity,
|
| 143 |
+
int small,
|
| 144 |
+
void* unused,
|
| 145 |
+
int nUnused
|
| 146 |
+
);
|
| 147 |
+
|
| 148 |
+
BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
|
| 149 |
+
int* bzerror,
|
| 150 |
+
BZFILE* b
|
| 151 |
+
);
|
| 152 |
+
|
| 153 |
+
BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
|
| 154 |
+
int* bzerror,
|
| 155 |
+
BZFILE* b,
|
| 156 |
+
void** unused,
|
| 157 |
+
int* nUnused
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
BZ_EXTERN int BZ_API(BZ2_bzRead) (
|
| 161 |
+
int* bzerror,
|
| 162 |
+
BZFILE* b,
|
| 163 |
+
void* buf,
|
| 164 |
+
int len
|
| 165 |
+
);
|
| 166 |
+
|
| 167 |
+
BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
|
| 168 |
+
int* bzerror,
|
| 169 |
+
FILE* f,
|
| 170 |
+
int blockSize100k,
|
| 171 |
+
int verbosity,
|
| 172 |
+
int workFactor
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
BZ_EXTERN void BZ_API(BZ2_bzWrite) (
|
| 176 |
+
int* bzerror,
|
| 177 |
+
BZFILE* b,
|
| 178 |
+
void* buf,
|
| 179 |
+
int len
|
| 180 |
+
);
|
| 181 |
+
|
| 182 |
+
BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
|
| 183 |
+
int* bzerror,
|
| 184 |
+
BZFILE* b,
|
| 185 |
+
int abandon,
|
| 186 |
+
unsigned int* nbytes_in,
|
| 187 |
+
unsigned int* nbytes_out
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
|
| 191 |
+
int* bzerror,
|
| 192 |
+
BZFILE* b,
|
| 193 |
+
int abandon,
|
| 194 |
+
unsigned int* nbytes_in_lo32,
|
| 195 |
+
unsigned int* nbytes_in_hi32,
|
| 196 |
+
unsigned int* nbytes_out_lo32,
|
| 197 |
+
unsigned int* nbytes_out_hi32
|
| 198 |
+
);
|
| 199 |
+
#endif
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
/*-- Utility functions --*/
|
| 203 |
+
|
| 204 |
+
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
|
| 205 |
+
char* dest,
|
| 206 |
+
unsigned int* destLen,
|
| 207 |
+
char* source,
|
| 208 |
+
unsigned int sourceLen,
|
| 209 |
+
int blockSize100k,
|
| 210 |
+
int verbosity,
|
| 211 |
+
int workFactor
|
| 212 |
+
);
|
| 213 |
+
|
| 214 |
+
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
|
| 215 |
+
char* dest,
|
| 216 |
+
unsigned int* destLen,
|
| 217 |
+
char* source,
|
| 218 |
+
unsigned int sourceLen,
|
| 219 |
+
int small,
|
| 220 |
+
int verbosity
|
| 221 |
+
);
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
/*--
|
| 225 |
+
Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
|
| 226 |
+
to support better zlib compatibility.
|
| 227 |
+
This code is not _officially_ part of libbzip2 (yet);
|
| 228 |
+
I haven't tested it, documented it, or considered the
|
| 229 |
+
threading-safeness of it.
|
| 230 |
+
If this code breaks, please contact both Yoshioka and me.
|
| 231 |
+
--*/
|
| 232 |
+
|
| 233 |
+
BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
|
| 234 |
+
void
|
| 235 |
+
);
|
| 236 |
+
|
| 237 |
+
#ifndef BZ_NO_STDIO
|
| 238 |
+
BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
|
| 239 |
+
const char *path,
|
| 240 |
+
const char *mode
|
| 241 |
+
);
|
| 242 |
+
|
| 243 |
+
BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
|
| 244 |
+
int fd,
|
| 245 |
+
const char *mode
|
| 246 |
+
);
|
| 247 |
+
|
| 248 |
+
BZ_EXTERN int BZ_API(BZ2_bzread) (
|
| 249 |
+
BZFILE* b,
|
| 250 |
+
void* buf,
|
| 251 |
+
int len
|
| 252 |
+
);
|
| 253 |
+
|
| 254 |
+
BZ_EXTERN int BZ_API(BZ2_bzwrite) (
|
| 255 |
+
BZFILE* b,
|
| 256 |
+
void* buf,
|
| 257 |
+
int len
|
| 258 |
+
);
|
| 259 |
+
|
| 260 |
+
BZ_EXTERN int BZ_API(BZ2_bzflush) (
|
| 261 |
+
BZFILE* b
|
| 262 |
+
);
|
| 263 |
+
|
| 264 |
+
BZ_EXTERN void BZ_API(BZ2_bzclose) (
|
| 265 |
+
BZFILE* b
|
| 266 |
+
);
|
| 267 |
+
|
| 268 |
+
BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
|
| 269 |
+
BZFILE *b,
|
| 270 |
+
int *errnum
|
| 271 |
+
);
|
| 272 |
+
#endif
|
| 273 |
+
|
| 274 |
+
#ifdef __cplusplus
|
| 275 |
+
}
|
| 276 |
+
#endif
|
| 277 |
+
|
| 278 |
+
#endif
|
| 279 |
+
|
| 280 |
+
/*-------------------------------------------------------------*/
|
| 281 |
+
/*--- end bzlib.h ---*/
|
| 282 |
+
/*-------------------------------------------------------------*/
|
deepseek/include/cursesf.h
ADDED
|
@@ -0,0 +1,968 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
| 3 |
+
/****************************************************************************
|
| 4 |
+
* Copyright 2019-2021,2022 Thomas E. Dickey *
|
| 5 |
+
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
| 6 |
+
* *
|
| 7 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 8 |
+
* copy of this software and associated documentation files (the *
|
| 9 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 10 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 11 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 12 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 13 |
+
* furnished to do so, subject to the following conditions: *
|
| 14 |
+
* *
|
| 15 |
+
* The above copyright notice and this permission notice shall be included *
|
| 16 |
+
* in all copies or substantial portions of the Software. *
|
| 17 |
+
* *
|
| 18 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 19 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 20 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 21 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 22 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 23 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 24 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 25 |
+
* *
|
| 26 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 27 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 28 |
+
* sale, use or other dealings in this Software without prior written *
|
| 29 |
+
* authorization. *
|
| 30 |
+
****************************************************************************/
|
| 31 |
+
|
| 32 |
+
/****************************************************************************
|
| 33 |
+
* Author: Juergen Pfeifer, 1997 *
|
| 34 |
+
****************************************************************************/
|
| 35 |
+
|
| 36 |
+
// $Id: cursesf.h,v 1.39 2022/08/20 20:52:15 tom Exp $
|
| 37 |
+
|
| 38 |
+
#ifndef NCURSES_CURSESF_H_incl
|
| 39 |
+
#define NCURSES_CURSESF_H_incl 1
|
| 40 |
+
|
| 41 |
+
#include <ncursesw/cursesp.h>
|
| 42 |
+
|
| 43 |
+
#ifndef __EXT_QNX
|
| 44 |
+
#include <string.h>
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
extern "C" {
|
| 48 |
+
# include <ncursesw/form.h>
|
| 49 |
+
}
|
| 50 |
+
//
|
| 51 |
+
// -------------------------------------------------------------------------
|
| 52 |
+
// The abstract base class for builtin and user defined Fieldtypes.
|
| 53 |
+
// -------------------------------------------------------------------------
|
| 54 |
+
//
|
| 55 |
+
class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration
|
| 56 |
+
|
| 57 |
+
// Class to represent builtin field types as well as C++ written new
|
| 58 |
+
// fieldtypes (see classes UserDefineFieldType...
|
| 59 |
+
class NCURSES_CXX_IMPEXP NCursesFieldType
|
| 60 |
+
{
|
| 61 |
+
friend class NCursesFormField;
|
| 62 |
+
|
| 63 |
+
protected:
|
| 64 |
+
FIELDTYPE* fieldtype;
|
| 65 |
+
|
| 66 |
+
inline void OnError(int err) const THROW2(NCursesException const, NCursesFormException) {
|
| 67 |
+
if (err!=E_OK)
|
| 68 |
+
THROW(new NCursesFormException (err));
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
NCursesFieldType(FIELDTYPE *f) : fieldtype(f) {
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
virtual ~NCursesFieldType() {}
|
| 75 |
+
|
| 76 |
+
// Set the fields f fieldtype to this one.
|
| 77 |
+
virtual void set(NCursesFormField& f) = 0;
|
| 78 |
+
|
| 79 |
+
public:
|
| 80 |
+
NCursesFieldType()
|
| 81 |
+
: fieldtype(STATIC_CAST(FIELDTYPE*)(0))
|
| 82 |
+
{
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
NCursesFieldType& operator=(const NCursesFieldType& rhs)
|
| 86 |
+
{
|
| 87 |
+
if (this != &rhs) {
|
| 88 |
+
*this = rhs;
|
| 89 |
+
}
|
| 90 |
+
return *this;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
NCursesFieldType(const NCursesFieldType& rhs)
|
| 94 |
+
: fieldtype(rhs.fieldtype)
|
| 95 |
+
{
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
};
|
| 99 |
+
|
| 100 |
+
//
|
| 101 |
+
// -------------------------------------------------------------------------
|
| 102 |
+
// The class representing a forms field, wrapping the lowlevel FIELD struct
|
| 103 |
+
// -------------------------------------------------------------------------
|
| 104 |
+
//
|
| 105 |
+
class NCURSES_CXX_IMPEXP NCursesFormField
|
| 106 |
+
{
|
| 107 |
+
friend class NCursesForm;
|
| 108 |
+
|
| 109 |
+
protected:
|
| 110 |
+
FIELD *field; // lowlevel structure
|
| 111 |
+
NCursesFieldType* ftype; // Associated field type
|
| 112 |
+
|
| 113 |
+
// Error handler
|
| 114 |
+
inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
|
| 115 |
+
if (err != E_OK)
|
| 116 |
+
THROW(new NCursesFormException (err));
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
public:
|
| 120 |
+
// Create a 'Null' field. Can be used to delimit a field list
|
| 121 |
+
NCursesFormField()
|
| 122 |
+
: field(STATIC_CAST(FIELD*)(0)),
|
| 123 |
+
ftype(STATIC_CAST(NCursesFieldType*)(0))
|
| 124 |
+
{
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
// Create a new field
|
| 128 |
+
NCursesFormField (int rows,
|
| 129 |
+
int ncols,
|
| 130 |
+
int first_row = 0,
|
| 131 |
+
int first_col = 0,
|
| 132 |
+
int offscreen_rows = 0,
|
| 133 |
+
int additional_buffers = 0)
|
| 134 |
+
: field(0),
|
| 135 |
+
ftype(STATIC_CAST(NCursesFieldType*)(0))
|
| 136 |
+
{
|
| 137 |
+
field = ::new_field(rows, ncols, first_row, first_col,
|
| 138 |
+
offscreen_rows, additional_buffers);
|
| 139 |
+
if (!field)
|
| 140 |
+
OnError(errno);
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
NCursesFormField& operator=(const NCursesFormField& rhs)
|
| 144 |
+
{
|
| 145 |
+
if (this != &rhs) {
|
| 146 |
+
*this = rhs;
|
| 147 |
+
}
|
| 148 |
+
return *this;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
NCursesFormField(const NCursesFormField& rhs)
|
| 152 |
+
: field(rhs.field), ftype(rhs.ftype)
|
| 153 |
+
{
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
virtual ~NCursesFormField () THROWS(NCursesException);
|
| 157 |
+
|
| 158 |
+
// Duplicate the field at a new position
|
| 159 |
+
inline NCursesFormField* dup(int first_row, int first_col)
|
| 160 |
+
{
|
| 161 |
+
NCursesFormField* f = new NCursesFormField();
|
| 162 |
+
if (!f)
|
| 163 |
+
OnError(E_SYSTEM_ERROR);
|
| 164 |
+
else {
|
| 165 |
+
f->ftype = ftype;
|
| 166 |
+
f->field = ::dup_field(field,first_row,first_col);
|
| 167 |
+
if (!f->field)
|
| 168 |
+
OnError(errno);
|
| 169 |
+
}
|
| 170 |
+
return f;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
// Link the field to a new location
|
| 174 |
+
inline NCursesFormField* link(int first_row, int first_col) {
|
| 175 |
+
NCursesFormField* f = new NCursesFormField();
|
| 176 |
+
if (!f)
|
| 177 |
+
OnError(E_SYSTEM_ERROR);
|
| 178 |
+
else {
|
| 179 |
+
f->ftype = ftype;
|
| 180 |
+
f->field = ::link_field(field,first_row,first_col);
|
| 181 |
+
if (!f->field)
|
| 182 |
+
OnError(errno);
|
| 183 |
+
}
|
| 184 |
+
return f;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
// Get the lowlevel field representation
|
| 188 |
+
inline FIELD* get_field() const {
|
| 189 |
+
return field;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
// Retrieve info about the field
|
| 193 |
+
inline void info(int& rows, int& ncols,
|
| 194 |
+
int& first_row, int& first_col,
|
| 195 |
+
int& offscreen_rows, int& additional_buffers) const {
|
| 196 |
+
OnError(::field_info(field, &rows, &ncols,
|
| 197 |
+
&first_row, &first_col,
|
| 198 |
+
&offscreen_rows, &additional_buffers));
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
// Retrieve info about the fields dynamic properties.
|
| 202 |
+
inline void dynamic_info(int& dynamic_rows, int& dynamic_cols,
|
| 203 |
+
int& max_growth) const {
|
| 204 |
+
OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols,
|
| 205 |
+
&max_growth));
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
// For a dynamic field you may set the maximum growth limit.
|
| 209 |
+
// A zero means unlimited growth.
|
| 210 |
+
inline void set_maximum_growth(int growth = 0) {
|
| 211 |
+
OnError(::set_max_field(field,growth));
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
// Move the field to a new position
|
| 215 |
+
inline void move(int row, int col) {
|
| 216 |
+
OnError(::move_field(field,row,col));
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
// Mark the field to start a new page
|
| 220 |
+
inline void new_page(bool pageFlag = FALSE) {
|
| 221 |
+
OnError(::set_new_page(field,pageFlag));
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
// Retrieve whether or not the field starts a new page.
|
| 225 |
+
inline bool is_new_page() const {
|
| 226 |
+
return ::new_page(field);
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
// Set the justification for the field
|
| 230 |
+
inline void set_justification(int just) {
|
| 231 |
+
OnError(::set_field_just(field,just));
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
// Retrieve the fields justification
|
| 235 |
+
inline int justification() const {
|
| 236 |
+
return ::field_just(field);
|
| 237 |
+
}
|
| 238 |
+
// Set the foreground attribute for the field
|
| 239 |
+
inline void set_foreground(chtype foreground) {
|
| 240 |
+
OnError(::set_field_fore(field,foreground));
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
// Retrieve the fields foreground attribute
|
| 244 |
+
inline chtype fore() const {
|
| 245 |
+
return ::field_fore(field);
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
// Set the background attribute for the field
|
| 249 |
+
inline void set_background(chtype background) {
|
| 250 |
+
OnError(::set_field_back(field,background));
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
// Retrieve the fields background attribute
|
| 254 |
+
inline chtype back() const {
|
| 255 |
+
return ::field_back(field);
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
// Set the padding character for the field
|
| 259 |
+
inline void set_pad_character(int padding) {
|
| 260 |
+
OnError(::set_field_pad(field, padding));
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
// Retrieve the fields padding character
|
| 264 |
+
inline int pad() const {
|
| 265 |
+
return ::field_pad(field);
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
// Switch on the fields options
|
| 269 |
+
inline void options_on (Field_Options opts) {
|
| 270 |
+
OnError (::field_opts_on (field, opts));
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
// Switch off the fields options
|
| 274 |
+
inline void options_off (Field_Options opts) {
|
| 275 |
+
OnError (::field_opts_off (field, opts));
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
// Retrieve the fields options
|
| 279 |
+
inline Field_Options options () const {
|
| 280 |
+
return ::field_opts (field);
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
// Set the fields options
|
| 284 |
+
inline void set_options (Field_Options opts) {
|
| 285 |
+
OnError (::set_field_opts (field, opts));
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
// Mark the field as changed
|
| 289 |
+
inline void set_changed(bool changeFlag = TRUE) {
|
| 290 |
+
OnError(::set_field_status(field,changeFlag));
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
// Test whether or not the field is marked as changed
|
| 294 |
+
inline bool changed() const {
|
| 295 |
+
return ::field_status(field);
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
// Return the index of the field in the field array of a form
|
| 299 |
+
// or -1 if the field is not associated to a form
|
| 300 |
+
inline int (index)() const {
|
| 301 |
+
return ::field_index(field);
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
// Store a value in a fields buffer. The default buffer is nr. 0
|
| 305 |
+
inline void set_value(const char *val, int buffer = 0) {
|
| 306 |
+
OnError(::set_field_buffer(field,buffer,val));
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
// Retrieve the value of a fields buffer. The default buffer is nr. 0
|
| 310 |
+
inline char* value(int buffer = 0) const {
|
| 311 |
+
return ::field_buffer(field,buffer);
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
// Set the validation type of the field.
|
| 315 |
+
inline void set_fieldtype(NCursesFieldType& f) {
|
| 316 |
+
ftype = &f;
|
| 317 |
+
f.set(*this); // A good friend may do that...
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
// Retrieve the validation type of the field.
|
| 321 |
+
inline NCursesFieldType* fieldtype() const {
|
| 322 |
+
return ftype;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
};
|
| 326 |
+
|
| 327 |
+
// This are the built-in hook functions in this C++ binding. In C++ we use
|
| 328 |
+
// virtual member functions (see below On_..._Init and On_..._Termination)
|
| 329 |
+
// to provide this functionality in an object oriented manner.
|
| 330 |
+
extern "C" {
|
| 331 |
+
void _nc_xx_frm_init(FORM *);
|
| 332 |
+
void _nc_xx_frm_term(FORM *);
|
| 333 |
+
void _nc_xx_fld_init(FORM *);
|
| 334 |
+
void _nc_xx_fld_term(FORM *);
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
//
|
| 338 |
+
// -------------------------------------------------------------------------
|
| 339 |
+
// The class representing a form, wrapping the lowlevel FORM struct
|
| 340 |
+
// -------------------------------------------------------------------------
|
| 341 |
+
//
|
| 342 |
+
class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel
|
| 343 |
+
{
|
| 344 |
+
protected:
|
| 345 |
+
FORM* form; // the lowlevel structure
|
| 346 |
+
|
| 347 |
+
private:
|
| 348 |
+
NCursesWindow* sub; // the subwindow object
|
| 349 |
+
bool b_sub_owner; // is this our own subwindow?
|
| 350 |
+
bool b_framed; // has the form a border?
|
| 351 |
+
bool b_autoDelete; // Delete fields when deleting form?
|
| 352 |
+
|
| 353 |
+
NCursesFormField** my_fields; // The array of fields for this form
|
| 354 |
+
|
| 355 |
+
// This structure is used for the form's user data field to link the
|
| 356 |
+
// FORM* to the C++ object and to provide extra space for a user pointer.
|
| 357 |
+
typedef struct {
|
| 358 |
+
void* m_user; // the pointer for the user's data
|
| 359 |
+
const NCursesForm* m_back; // backward pointer to C++ object
|
| 360 |
+
const FORM* m_owner;
|
| 361 |
+
} UserHook;
|
| 362 |
+
|
| 363 |
+
// Get the backward pointer to the C++ object from a FORM
|
| 364 |
+
static inline NCursesForm* getHook(const FORM *f) {
|
| 365 |
+
UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(f));
|
| 366 |
+
assert(hook != 0 && hook->m_owner==f);
|
| 367 |
+
return const_cast<NCursesForm*>(hook->m_back);
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
friend void _nc_xx_frm_init(FORM *);
|
| 371 |
+
friend void _nc_xx_frm_term(FORM *);
|
| 372 |
+
friend void _nc_xx_fld_init(FORM *);
|
| 373 |
+
friend void _nc_xx_fld_term(FORM *);
|
| 374 |
+
|
| 375 |
+
// Calculate FIELD* array for the menu
|
| 376 |
+
FIELD** mapFields(NCursesFormField* nfields[]);
|
| 377 |
+
|
| 378 |
+
protected:
|
| 379 |
+
// internal routines
|
| 380 |
+
inline void set_user(void *user) {
|
| 381 |
+
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
|
| 382 |
+
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
|
| 383 |
+
uptr->m_user = user;
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
inline void *get_user() {
|
| 387 |
+
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
|
| 388 |
+
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
|
| 389 |
+
return uptr->m_user;
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
void InitForm (NCursesFormField* Fields[],
|
| 393 |
+
bool with_frame,
|
| 394 |
+
bool autoDeleteFields);
|
| 395 |
+
|
| 396 |
+
inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
|
| 397 |
+
if (err != E_OK)
|
| 398 |
+
THROW(new NCursesFormException (err));
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
// this wraps the form_driver call.
|
| 402 |
+
virtual int driver (int c) ;
|
| 403 |
+
|
| 404 |
+
// 'Internal' constructor, builds an object without association to a
|
| 405 |
+
// field array.
|
| 406 |
+
NCursesForm( int nlines,
|
| 407 |
+
int ncols,
|
| 408 |
+
int begin_y = 0,
|
| 409 |
+
int begin_x = 0)
|
| 410 |
+
: NCursesPanel(nlines, ncols, begin_y, begin_x),
|
| 411 |
+
form (STATIC_CAST(FORM*)(0)),
|
| 412 |
+
sub(0),
|
| 413 |
+
b_sub_owner(0),
|
| 414 |
+
b_framed(0),
|
| 415 |
+
b_autoDelete(0),
|
| 416 |
+
my_fields(0)
|
| 417 |
+
{
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
public:
|
| 421 |
+
// Create form for the default panel.
|
| 422 |
+
NCursesForm (NCursesFormField* Fields[],
|
| 423 |
+
bool with_frame=FALSE, // reserve space for a frame?
|
| 424 |
+
bool autoDelete_Fields=FALSE) // do automatic cleanup?
|
| 425 |
+
: NCursesPanel(),
|
| 426 |
+
form(0),
|
| 427 |
+
sub(0),
|
| 428 |
+
b_sub_owner(0),
|
| 429 |
+
b_framed(0),
|
| 430 |
+
b_autoDelete(0),
|
| 431 |
+
my_fields(0)
|
| 432 |
+
{
|
| 433 |
+
InitForm(Fields, with_frame, autoDelete_Fields);
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
// Create a form in a panel with the given position and size.
|
| 437 |
+
NCursesForm (NCursesFormField* Fields[],
|
| 438 |
+
int nlines,
|
| 439 |
+
int ncols,
|
| 440 |
+
int begin_y,
|
| 441 |
+
int begin_x,
|
| 442 |
+
bool with_frame=FALSE, // reserve space for a frame?
|
| 443 |
+
bool autoDelete_Fields=FALSE) // do automatic cleanup?
|
| 444 |
+
: NCursesPanel(nlines, ncols, begin_y, begin_x),
|
| 445 |
+
form(0),
|
| 446 |
+
sub(0),
|
| 447 |
+
b_sub_owner(0),
|
| 448 |
+
b_framed(0),
|
| 449 |
+
b_autoDelete(0),
|
| 450 |
+
my_fields(0)
|
| 451 |
+
{
|
| 452 |
+
InitForm(Fields, with_frame, autoDelete_Fields);
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
NCursesForm& operator=(const NCursesForm& rhs)
|
| 456 |
+
{
|
| 457 |
+
if (this != &rhs) {
|
| 458 |
+
*this = rhs;
|
| 459 |
+
NCursesPanel::operator=(rhs);
|
| 460 |
+
}
|
| 461 |
+
return *this;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
NCursesForm(const NCursesForm& rhs)
|
| 465 |
+
: NCursesPanel(rhs),
|
| 466 |
+
form(rhs.form),
|
| 467 |
+
sub(rhs.sub),
|
| 468 |
+
b_sub_owner(rhs.b_sub_owner),
|
| 469 |
+
b_framed(rhs.b_framed),
|
| 470 |
+
b_autoDelete(rhs.b_autoDelete),
|
| 471 |
+
my_fields(rhs.my_fields)
|
| 472 |
+
{
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
virtual ~NCursesForm() THROWS(NCursesException);
|
| 476 |
+
|
| 477 |
+
// Set the default attributes for the form
|
| 478 |
+
virtual void setDefaultAttributes();
|
| 479 |
+
|
| 480 |
+
// Retrieve current field of the form.
|
| 481 |
+
inline NCursesFormField* current_field() const {
|
| 482 |
+
return my_fields[::field_index(::current_field(form))];
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
// Set the forms subwindow
|
| 486 |
+
void setSubWindow(NCursesWindow& sub);
|
| 487 |
+
|
| 488 |
+
// Set these fields for the form
|
| 489 |
+
inline void setFields(NCursesFormField* Fields[]) {
|
| 490 |
+
OnError(::set_form_fields(form,mapFields(Fields)));
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
// Remove the form from the screen
|
| 494 |
+
inline void unpost (void) {
|
| 495 |
+
OnError (::unpost_form (form));
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
// Post the form to the screen if flag is true, unpost it otherwise
|
| 499 |
+
inline void post(bool flag = TRUE) {
|
| 500 |
+
OnError (flag ? ::post_form(form) : ::unpost_form (form));
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
// Decorations
|
| 504 |
+
inline void frame(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
|
| 505 |
+
if (b_framed)
|
| 506 |
+
NCursesPanel::frame(title,btitle);
|
| 507 |
+
else
|
| 508 |
+
OnError(E_SYSTEM_ERROR);
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
inline void boldframe(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
|
| 512 |
+
if (b_framed)
|
| 513 |
+
NCursesPanel::boldframe(title,btitle);
|
| 514 |
+
else
|
| 515 |
+
OnError(E_SYSTEM_ERROR);
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
inline void label(const char *topLabel, const char *bottomLabel) NCURSES_OVERRIDE {
|
| 519 |
+
if (b_framed)
|
| 520 |
+
NCursesPanel::label(topLabel,bottomLabel);
|
| 521 |
+
else
|
| 522 |
+
OnError(E_SYSTEM_ERROR);
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
// -----
|
| 526 |
+
// Hooks
|
| 527 |
+
// -----
|
| 528 |
+
|
| 529 |
+
// Called after the form gets repositioned in its window.
|
| 530 |
+
// This is especially true if the form is posted.
|
| 531 |
+
virtual void On_Form_Init();
|
| 532 |
+
|
| 533 |
+
// Called before the form gets repositioned in its window.
|
| 534 |
+
// This is especially true if the form is unposted.
|
| 535 |
+
virtual void On_Form_Termination();
|
| 536 |
+
|
| 537 |
+
// Called after the field became the current field
|
| 538 |
+
virtual void On_Field_Init(NCursesFormField& field);
|
| 539 |
+
|
| 540 |
+
// Called before this field is left as current field.
|
| 541 |
+
virtual void On_Field_Termination(NCursesFormField& field);
|
| 542 |
+
|
| 543 |
+
// Calculate required window size for the form.
|
| 544 |
+
void scale(int& rows, int& ncols) const {
|
| 545 |
+
OnError(::scale_form(form,&rows,&ncols));
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
// Retrieve number of fields in the form.
|
| 549 |
+
int count() const {
|
| 550 |
+
return ::field_count(form);
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
// Make the page the current page of the form.
|
| 554 |
+
void set_page(int pageNum) {
|
| 555 |
+
OnError(::set_form_page(form, pageNum));
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
// Retrieve current page number
|
| 559 |
+
int page() const {
|
| 560 |
+
return ::form_page(form);
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
// Switch on the forms options
|
| 564 |
+
inline void options_on (Form_Options opts) {
|
| 565 |
+
OnError (::form_opts_on (form, opts));
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
// Switch off the forms options
|
| 569 |
+
inline void options_off (Form_Options opts) {
|
| 570 |
+
OnError (::form_opts_off (form, opts));
|
| 571 |
+
}
|
| 572 |
+
|
| 573 |
+
// Retrieve the forms options
|
| 574 |
+
inline Form_Options options () const {
|
| 575 |
+
return ::form_opts (form);
|
| 576 |
+
}
|
| 577 |
+
|
| 578 |
+
// Set the forms options
|
| 579 |
+
inline void set_options (Form_Options opts) {
|
| 580 |
+
OnError (::set_form_opts (form, opts));
|
| 581 |
+
}
|
| 582 |
+
|
| 583 |
+
// Are there more data in the current field after the data shown
|
| 584 |
+
inline bool data_ahead() const {
|
| 585 |
+
return ::data_ahead(form);
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
// Are there more data in the current field before the data shown
|
| 589 |
+
inline bool data_behind() const {
|
| 590 |
+
return ::data_behind(form);
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
// Position the cursor to the current field
|
| 594 |
+
inline void position_cursor () {
|
| 595 |
+
OnError (::pos_form_cursor (form));
|
| 596 |
+
}
|
| 597 |
+
// Set the current field
|
| 598 |
+
inline void set_current(NCursesFormField& F) {
|
| 599 |
+
OnError (::set_current_field(form, F.field));
|
| 600 |
+
}
|
| 601 |
+
|
| 602 |
+
// Provide a default key virtualization. Translate the keyboard
|
| 603 |
+
// code c into a form request code.
|
| 604 |
+
// The default implementation provides a hopefully straightforward
|
| 605 |
+
// mapping for the most common keystrokes and form requests.
|
| 606 |
+
virtual int virtualize(int c);
|
| 607 |
+
|
| 608 |
+
// Operators
|
| 609 |
+
inline NCursesFormField* operator[](int i) const {
|
| 610 |
+
if ( (i < 0) || (i >= ::field_count (form)) )
|
| 611 |
+
OnError (E_BAD_ARGUMENT);
|
| 612 |
+
return my_fields[i];
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
// Perform the menu's operation
|
| 616 |
+
// Return the field where you left the form.
|
| 617 |
+
virtual NCursesFormField* operator()(void);
|
| 618 |
+
|
| 619 |
+
// Exception handlers. The default is a Beep.
|
| 620 |
+
virtual void On_Request_Denied(int c) const;
|
| 621 |
+
virtual void On_Invalid_Field(int c) const;
|
| 622 |
+
virtual void On_Unknown_Command(int c) const;
|
| 623 |
+
|
| 624 |
+
};
|
| 625 |
+
|
| 626 |
+
//
|
| 627 |
+
// -------------------------------------------------------------------------
|
| 628 |
+
// This is the typical C++ typesafe way to allow to attach
|
| 629 |
+
// user data to a field of a form. Its assumed that the user
|
| 630 |
+
// data belongs to some class T. Use T as template argument
|
| 631 |
+
// to create a UserField.
|
| 632 |
+
// -------------------------------------------------------------------------
|
| 633 |
+
template<class T> class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField
|
| 634 |
+
{
|
| 635 |
+
public:
|
| 636 |
+
NCursesUserField (int rows,
|
| 637 |
+
int ncols,
|
| 638 |
+
int first_row = 0,
|
| 639 |
+
int first_col = 0,
|
| 640 |
+
const T* p_UserData = STATIC_CAST(T*)(0),
|
| 641 |
+
int offscreen_rows = 0,
|
| 642 |
+
int additional_buffers = 0)
|
| 643 |
+
: NCursesFormField (rows, ncols,
|
| 644 |
+
first_row, first_col,
|
| 645 |
+
offscreen_rows, additional_buffers) {
|
| 646 |
+
if (field)
|
| 647 |
+
OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData)));
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
virtual ~NCursesUserField() THROWS(NCursesException) {};
|
| 651 |
+
|
| 652 |
+
inline const T* UserData (void) const {
|
| 653 |
+
return reinterpret_cast<const T*>(::field_userptr (field));
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
inline virtual void setUserData(const T* p_UserData) {
|
| 657 |
+
if (field)
|
| 658 |
+
OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData)));
|
| 659 |
+
}
|
| 660 |
+
};
|
| 661 |
+
//
|
| 662 |
+
// -------------------------------------------------------------------------
|
| 663 |
+
// The same mechanism is used to attach user data to a form
|
| 664 |
+
// -------------------------------------------------------------------------
|
| 665 |
+
//
|
| 666 |
+
template<class T> class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm
|
| 667 |
+
{
|
| 668 |
+
protected:
|
| 669 |
+
// 'Internal' constructor, builds an object without association to a
|
| 670 |
+
// field array.
|
| 671 |
+
NCursesUserForm( int nlines,
|
| 672 |
+
int ncols,
|
| 673 |
+
int begin_y = 0,
|
| 674 |
+
int begin_x = 0,
|
| 675 |
+
const T* p_UserData = STATIC_CAST(T*)(0))
|
| 676 |
+
: NCursesForm(nlines,ncols,begin_y,begin_x) {
|
| 677 |
+
if (form)
|
| 678 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>
|
| 679 |
+
(p_UserData)));
|
| 680 |
+
}
|
| 681 |
+
|
| 682 |
+
public:
|
| 683 |
+
NCursesUserForm (NCursesFormField* Fields[],
|
| 684 |
+
const T* p_UserData = STATIC_CAST(T*)(0),
|
| 685 |
+
bool with_frame=FALSE,
|
| 686 |
+
bool autoDelete_Fields=FALSE)
|
| 687 |
+
: NCursesForm (&Fields, with_frame, autoDelete_Fields) {
|
| 688 |
+
if (form)
|
| 689 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 690 |
+
};
|
| 691 |
+
|
| 692 |
+
NCursesUserForm (NCursesFormField* Fields[],
|
| 693 |
+
int nlines,
|
| 694 |
+
int ncols,
|
| 695 |
+
int begin_y = 0,
|
| 696 |
+
int begin_x = 0,
|
| 697 |
+
const T* p_UserData = STATIC_CAST(T*)(0),
|
| 698 |
+
bool with_frame=FALSE,
|
| 699 |
+
bool autoDelete_Fields=FALSE)
|
| 700 |
+
: NCursesForm (&Fields, nlines, ncols, begin_y, begin_x,
|
| 701 |
+
with_frame, autoDelete_Fields) {
|
| 702 |
+
if (form)
|
| 703 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>
|
| 704 |
+
(p_UserData)));
|
| 705 |
+
};
|
| 706 |
+
|
| 707 |
+
virtual ~NCursesUserForm() THROWS(NCursesException) {
|
| 708 |
+
};
|
| 709 |
+
|
| 710 |
+
inline T* UserData (void) {
|
| 711 |
+
return reinterpret_cast<T*>(get_user ());
|
| 712 |
+
};
|
| 713 |
+
|
| 714 |
+
inline virtual void setUserData (const T* p_UserData) {
|
| 715 |
+
if (form)
|
| 716 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 717 |
+
}
|
| 718 |
+
|
| 719 |
+
};
|
| 720 |
+
//
|
| 721 |
+
// -------------------------------------------------------------------------
|
| 722 |
+
// Builtin Fieldtypes
|
| 723 |
+
// -------------------------------------------------------------------------
|
| 724 |
+
//
|
| 725 |
+
class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType
|
| 726 |
+
{
|
| 727 |
+
private:
|
| 728 |
+
int min_field_width;
|
| 729 |
+
|
| 730 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 731 |
+
OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
|
| 732 |
+
}
|
| 733 |
+
|
| 734 |
+
public:
|
| 735 |
+
explicit Alpha_Field(int width)
|
| 736 |
+
: NCursesFieldType(TYPE_ALPHA),
|
| 737 |
+
min_field_width(width) {
|
| 738 |
+
}
|
| 739 |
+
};
|
| 740 |
+
|
| 741 |
+
class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType
|
| 742 |
+
{
|
| 743 |
+
private:
|
| 744 |
+
int min_field_width;
|
| 745 |
+
|
| 746 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 747 |
+
OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
|
| 748 |
+
}
|
| 749 |
+
|
| 750 |
+
public:
|
| 751 |
+
explicit Alphanumeric_Field(int width)
|
| 752 |
+
: NCursesFieldType(TYPE_ALNUM),
|
| 753 |
+
min_field_width(width) {
|
| 754 |
+
}
|
| 755 |
+
};
|
| 756 |
+
|
| 757 |
+
class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType
|
| 758 |
+
{
|
| 759 |
+
private:
|
| 760 |
+
int precision;
|
| 761 |
+
long lower_limit, upper_limit;
|
| 762 |
+
|
| 763 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 764 |
+
OnError(::set_field_type(f.get_field(),fieldtype,
|
| 765 |
+
precision,lower_limit,upper_limit));
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
public:
|
| 769 |
+
Integer_Field(int prec, long low=0L, long high=0L)
|
| 770 |
+
: NCursesFieldType(TYPE_INTEGER),
|
| 771 |
+
precision(prec), lower_limit(low), upper_limit(high) {
|
| 772 |
+
}
|
| 773 |
+
};
|
| 774 |
+
|
| 775 |
+
class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType
|
| 776 |
+
{
|
| 777 |
+
private:
|
| 778 |
+
int precision;
|
| 779 |
+
double lower_limit, upper_limit;
|
| 780 |
+
|
| 781 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 782 |
+
OnError(::set_field_type(f.get_field(),fieldtype,
|
| 783 |
+
precision,lower_limit,upper_limit));
|
| 784 |
+
}
|
| 785 |
+
|
| 786 |
+
public:
|
| 787 |
+
Numeric_Field(int prec, double low=0.0, double high=0.0)
|
| 788 |
+
: NCursesFieldType(TYPE_NUMERIC),
|
| 789 |
+
precision(prec), lower_limit(low), upper_limit(high) {
|
| 790 |
+
}
|
| 791 |
+
};
|
| 792 |
+
|
| 793 |
+
class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType
|
| 794 |
+
{
|
| 795 |
+
private:
|
| 796 |
+
char* regex;
|
| 797 |
+
|
| 798 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 799 |
+
OnError(::set_field_type(f.get_field(),fieldtype,regex));
|
| 800 |
+
}
|
| 801 |
+
|
| 802 |
+
void copy_regex(const char *source)
|
| 803 |
+
{
|
| 804 |
+
regex = new char[1 + ::strlen(source)];
|
| 805 |
+
(::strcpy)(regex, source);
|
| 806 |
+
}
|
| 807 |
+
|
| 808 |
+
public:
|
| 809 |
+
explicit Regular_Expression_Field(const char *expr)
|
| 810 |
+
: NCursesFieldType(TYPE_REGEXP),
|
| 811 |
+
regex(NULL)
|
| 812 |
+
{
|
| 813 |
+
copy_regex(expr);
|
| 814 |
+
}
|
| 815 |
+
|
| 816 |
+
Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs)
|
| 817 |
+
{
|
| 818 |
+
if (this != &rhs) {
|
| 819 |
+
*this = rhs;
|
| 820 |
+
copy_regex(rhs.regex);
|
| 821 |
+
NCursesFieldType::operator=(rhs);
|
| 822 |
+
}
|
| 823 |
+
return *this;
|
| 824 |
+
}
|
| 825 |
+
|
| 826 |
+
Regular_Expression_Field(const Regular_Expression_Field& rhs)
|
| 827 |
+
: NCursesFieldType(rhs),
|
| 828 |
+
regex(NULL)
|
| 829 |
+
{
|
| 830 |
+
copy_regex(rhs.regex);
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
~Regular_Expression_Field() {
|
| 834 |
+
delete[] regex;
|
| 835 |
+
}
|
| 836 |
+
};
|
| 837 |
+
|
| 838 |
+
class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType
|
| 839 |
+
{
|
| 840 |
+
private:
|
| 841 |
+
const char** list;
|
| 842 |
+
int case_sensitive;
|
| 843 |
+
int non_unique_matches;
|
| 844 |
+
|
| 845 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 846 |
+
OnError(::set_field_type(f.get_field(),fieldtype,
|
| 847 |
+
list,case_sensitive,non_unique_matches));
|
| 848 |
+
}
|
| 849 |
+
public:
|
| 850 |
+
Enumeration_Field(const char* enums[],
|
| 851 |
+
bool case_sens=FALSE,
|
| 852 |
+
bool non_unique=FALSE)
|
| 853 |
+
: NCursesFieldType(TYPE_ENUM),
|
| 854 |
+
list(enums),
|
| 855 |
+
case_sensitive(case_sens ? -1 : 0),
|
| 856 |
+
non_unique_matches(non_unique ? -1 : 0) {
|
| 857 |
+
}
|
| 858 |
+
|
| 859 |
+
Enumeration_Field& operator=(const Enumeration_Field& rhs)
|
| 860 |
+
{
|
| 861 |
+
if (this != &rhs) {
|
| 862 |
+
*this = rhs;
|
| 863 |
+
NCursesFieldType::operator=(rhs);
|
| 864 |
+
}
|
| 865 |
+
return *this;
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
Enumeration_Field(const Enumeration_Field& rhs)
|
| 869 |
+
: NCursesFieldType(rhs),
|
| 870 |
+
list(rhs.list),
|
| 871 |
+
case_sensitive(rhs.case_sensitive),
|
| 872 |
+
non_unique_matches(rhs.non_unique_matches)
|
| 873 |
+
{
|
| 874 |
+
}
|
| 875 |
+
};
|
| 876 |
+
|
| 877 |
+
class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType
|
| 878 |
+
{
|
| 879 |
+
private:
|
| 880 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 881 |
+
OnError(::set_field_type(f.get_field(),fieldtype));
|
| 882 |
+
}
|
| 883 |
+
|
| 884 |
+
public:
|
| 885 |
+
IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) {
|
| 886 |
+
}
|
| 887 |
+
};
|
| 888 |
+
|
| 889 |
+
extern "C" {
|
| 890 |
+
bool _nc_xx_fld_fcheck(FIELD *, const void*);
|
| 891 |
+
bool _nc_xx_fld_ccheck(int c, const void *);
|
| 892 |
+
void* _nc_xx_fld_makearg(va_list*);
|
| 893 |
+
}
|
| 894 |
+
|
| 895 |
+
//
|
| 896 |
+
// -------------------------------------------------------------------------
|
| 897 |
+
// Abstract base class for User-Defined Fieldtypes
|
| 898 |
+
// -------------------------------------------------------------------------
|
| 899 |
+
//
|
| 900 |
+
class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType
|
| 901 |
+
{
|
| 902 |
+
friend class UDF_Init; // Internal helper to set up statics
|
| 903 |
+
private:
|
| 904 |
+
// For all C++ defined fieldtypes we need only one generic lowlevel
|
| 905 |
+
// FIELDTYPE* element.
|
| 906 |
+
static FIELDTYPE* generic_fieldtype;
|
| 907 |
+
|
| 908 |
+
protected:
|
| 909 |
+
// This are the functions required by the low level libforms functions
|
| 910 |
+
// to construct a fieldtype.
|
| 911 |
+
friend bool _nc_xx_fld_fcheck(FIELD *, const void*);
|
| 912 |
+
friend bool _nc_xx_fld_ccheck(int c, const void *);
|
| 913 |
+
friend void* _nc_xx_fld_makearg(va_list*);
|
| 914 |
+
|
| 915 |
+
void set(NCursesFormField& f) NCURSES_OVERRIDE {
|
| 916 |
+
OnError(::set_field_type(f.get_field(),fieldtype,&f));
|
| 917 |
+
}
|
| 918 |
+
|
| 919 |
+
protected:
|
| 920 |
+
// Redefine this function to do a field validation. The argument
|
| 921 |
+
// is a reference to the field you should validate.
|
| 922 |
+
virtual bool field_check(NCursesFormField& f) = 0;
|
| 923 |
+
|
| 924 |
+
// Redefine this function to do a character validation. The argument
|
| 925 |
+
// is the character to be validated.
|
| 926 |
+
virtual bool char_check (int c) = 0;
|
| 927 |
+
|
| 928 |
+
public:
|
| 929 |
+
UserDefinedFieldType();
|
| 930 |
+
};
|
| 931 |
+
|
| 932 |
+
extern "C" {
|
| 933 |
+
bool _nc_xx_next_choice(FIELD*, const void *);
|
| 934 |
+
bool _nc_xx_prev_choice(FIELD*, const void *);
|
| 935 |
+
}
|
| 936 |
+
|
| 937 |
+
//
|
| 938 |
+
// -------------------------------------------------------------------------
|
| 939 |
+
// Abstract base class for User-Defined Fieldtypes with Choice functions
|
| 940 |
+
// -------------------------------------------------------------------------
|
| 941 |
+
//
|
| 942 |
+
class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType
|
| 943 |
+
{
|
| 944 |
+
friend class UDF_Init; // Internal helper to set up statics
|
| 945 |
+
private:
|
| 946 |
+
// For all C++ defined fieldtypes with choice functions we need only one
|
| 947 |
+
// generic lowlevel FIELDTYPE* element.
|
| 948 |
+
static FIELDTYPE* generic_fieldtype_with_choice;
|
| 949 |
+
|
| 950 |
+
// This are the functions required by the low level libforms functions
|
| 951 |
+
// to construct a fieldtype with choice functions.
|
| 952 |
+
friend bool _nc_xx_next_choice(FIELD*, const void *);
|
| 953 |
+
friend bool _nc_xx_prev_choice(FIELD*, const void *);
|
| 954 |
+
|
| 955 |
+
protected:
|
| 956 |
+
// Redefine this function to do the retrieval of the next choice value.
|
| 957 |
+
// The argument is a reference to the field tobe examined.
|
| 958 |
+
virtual bool next (NCursesFormField& f) = 0;
|
| 959 |
+
|
| 960 |
+
// Redefine this function to do the retrieval of the previous choice value.
|
| 961 |
+
// The argument is a reference to the field tobe examined.
|
| 962 |
+
virtual bool previous(NCursesFormField& f) = 0;
|
| 963 |
+
|
| 964 |
+
public:
|
| 965 |
+
UserDefinedFieldType_With_Choice();
|
| 966 |
+
};
|
| 967 |
+
|
| 968 |
+
#endif /* NCURSES_CURSESF_H_incl */
|
deepseek/include/cursesm.h
ADDED
|
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// * This makes emacs happy -*-Mode: C++;-*-
|
| 2 |
+
/****************************************************************************
|
| 3 |
+
* Copyright 2019-2020,2022 Thomas E. Dickey *
|
| 4 |
+
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
| 5 |
+
* *
|
| 6 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 7 |
+
* copy of this software and associated documentation files (the *
|
| 8 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 9 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 10 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 11 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 12 |
+
* furnished to do so, subject to the following conditions: *
|
| 13 |
+
* *
|
| 14 |
+
* The above copyright notice and this permission notice shall be included *
|
| 15 |
+
* in all copies or substantial portions of the Software. *
|
| 16 |
+
* *
|
| 17 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 18 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 19 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 20 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 21 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 22 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 23 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 24 |
+
* *
|
| 25 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 26 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 27 |
+
* sale, use or other dealings in this Software without prior written *
|
| 28 |
+
* authorization. *
|
| 29 |
+
****************************************************************************/
|
| 30 |
+
|
| 31 |
+
/****************************************************************************
|
| 32 |
+
* Author: Juergen Pfeifer, 1997 *
|
| 33 |
+
****************************************************************************/
|
| 34 |
+
|
| 35 |
+
// $Id: cursesm.h,v 1.35 2022/08/20 20:52:15 tom Exp $
|
| 36 |
+
|
| 37 |
+
#ifndef NCURSES_CURSESM_H_incl
|
| 38 |
+
#define NCURSES_CURSESM_H_incl 1
|
| 39 |
+
|
| 40 |
+
#include <ncursesw/cursesp.h>
|
| 41 |
+
|
| 42 |
+
extern "C" {
|
| 43 |
+
# include <ncursesw/menu.h>
|
| 44 |
+
}
|
| 45 |
+
//
|
| 46 |
+
// -------------------------------------------------------------------------
|
| 47 |
+
// This wraps the ITEM type of <ncursesw/menu.h>
|
| 48 |
+
// -------------------------------------------------------------------------
|
| 49 |
+
//
|
| 50 |
+
class NCURSES_CXX_IMPEXP NCursesMenuItem
|
| 51 |
+
{
|
| 52 |
+
friend class NCursesMenu;
|
| 53 |
+
|
| 54 |
+
protected:
|
| 55 |
+
ITEM *item;
|
| 56 |
+
|
| 57 |
+
inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) {
|
| 58 |
+
if (err != E_OK)
|
| 59 |
+
THROW(new NCursesMenuException (err));
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
public:
|
| 63 |
+
NCursesMenuItem (const char* p_name = NULL,
|
| 64 |
+
const char* p_descript = NULL)
|
| 65 |
+
: item(0)
|
| 66 |
+
{
|
| 67 |
+
item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0);
|
| 68 |
+
if (p_name && !item)
|
| 69 |
+
OnError (E_SYSTEM_ERROR);
|
| 70 |
+
}
|
| 71 |
+
// Create an item. If you pass both parameters as NULL, a delimiting
|
| 72 |
+
// item is constructed which can be used to terminate a list of
|
| 73 |
+
// NCursesMenu objects.
|
| 74 |
+
|
| 75 |
+
NCursesMenuItem& operator=(const NCursesMenuItem& rhs)
|
| 76 |
+
{
|
| 77 |
+
if (this != &rhs) {
|
| 78 |
+
*this = rhs;
|
| 79 |
+
}
|
| 80 |
+
return *this;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
NCursesMenuItem(const NCursesMenuItem& rhs)
|
| 84 |
+
: item(0)
|
| 85 |
+
{
|
| 86 |
+
(void) rhs;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
virtual ~NCursesMenuItem () THROWS(NCursesException);
|
| 90 |
+
// Release the items memory
|
| 91 |
+
|
| 92 |
+
inline const char* name () const {
|
| 93 |
+
return ::item_name (item);
|
| 94 |
+
}
|
| 95 |
+
// Name of the item
|
| 96 |
+
|
| 97 |
+
inline const char* description () const {
|
| 98 |
+
return ::item_description (item);
|
| 99 |
+
}
|
| 100 |
+
// Description of the item
|
| 101 |
+
|
| 102 |
+
inline int (index) (void) const {
|
| 103 |
+
return ::item_index (item);
|
| 104 |
+
}
|
| 105 |
+
// Index of the item in an item array (or -1)
|
| 106 |
+
|
| 107 |
+
inline void options_on (Item_Options opts) {
|
| 108 |
+
OnError (::item_opts_on (item, opts));
|
| 109 |
+
}
|
| 110 |
+
// Switch on the items options
|
| 111 |
+
|
| 112 |
+
inline void options_off (Item_Options opts) {
|
| 113 |
+
OnError (::item_opts_off (item, opts));
|
| 114 |
+
}
|
| 115 |
+
// Switch off the item's option
|
| 116 |
+
|
| 117 |
+
inline Item_Options options () const {
|
| 118 |
+
return ::item_opts (item);
|
| 119 |
+
}
|
| 120 |
+
// Retrieve the items options
|
| 121 |
+
|
| 122 |
+
inline void set_options (Item_Options opts) {
|
| 123 |
+
OnError (::set_item_opts (item, opts));
|
| 124 |
+
}
|
| 125 |
+
// Set the items options
|
| 126 |
+
|
| 127 |
+
inline void set_value (bool f) {
|
| 128 |
+
OnError (::set_item_value (item,f));
|
| 129 |
+
}
|
| 130 |
+
// Set/Reset the items selection state
|
| 131 |
+
|
| 132 |
+
inline bool value () const {
|
| 133 |
+
return ::item_value (item);
|
| 134 |
+
}
|
| 135 |
+
// Retrieve the items selection state
|
| 136 |
+
|
| 137 |
+
inline bool visible () const {
|
| 138 |
+
return ::item_visible (item);
|
| 139 |
+
}
|
| 140 |
+
// Retrieve visibility of the item
|
| 141 |
+
|
| 142 |
+
virtual bool action();
|
| 143 |
+
// Perform an action associated with this item; you may use this in an
|
| 144 |
+
// user supplied driver for a menu; you may derive from this class and
|
| 145 |
+
// overload action() to supply items with different actions.
|
| 146 |
+
// If an action returns true, the menu will be exited. The default action
|
| 147 |
+
// is to do nothing.
|
| 148 |
+
};
|
| 149 |
+
|
| 150 |
+
// Prototype for an items callback function.
|
| 151 |
+
typedef bool ITEMCALLBACK(NCursesMenuItem&);
|
| 152 |
+
|
| 153 |
+
// If you don't like to create a child class for individual items to
|
| 154 |
+
// overload action(), you may use this class and provide a callback
|
| 155 |
+
// function pointer for items.
|
| 156 |
+
class NCURSES_CXX_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem
|
| 157 |
+
{
|
| 158 |
+
private:
|
| 159 |
+
ITEMCALLBACK* p_fct;
|
| 160 |
+
|
| 161 |
+
public:
|
| 162 |
+
NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL,
|
| 163 |
+
const char* p_name = NULL,
|
| 164 |
+
const char* p_descript = NULL )
|
| 165 |
+
: NCursesMenuItem (p_name, p_descript),
|
| 166 |
+
p_fct (fct) {
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs)
|
| 170 |
+
{
|
| 171 |
+
if (this != &rhs) {
|
| 172 |
+
*this = rhs;
|
| 173 |
+
}
|
| 174 |
+
return *this;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs)
|
| 178 |
+
: NCursesMenuItem(rhs),
|
| 179 |
+
p_fct(0)
|
| 180 |
+
{
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
virtual ~NCursesMenuCallbackItem() THROWS(NCursesException);
|
| 184 |
+
|
| 185 |
+
bool action() NCURSES_OVERRIDE;
|
| 186 |
+
};
|
| 187 |
+
|
| 188 |
+
// This are the built-in hook functions in this C++ binding. In C++ we use
|
| 189 |
+
// virtual member functions (see below On_..._Init and On_..._Termination)
|
| 190 |
+
// to provide this functionality in an object oriented manner.
|
| 191 |
+
extern "C" {
|
| 192 |
+
void _nc_xx_mnu_init(MENU *);
|
| 193 |
+
void _nc_xx_mnu_term(MENU *);
|
| 194 |
+
void _nc_xx_itm_init(MENU *);
|
| 195 |
+
void _nc_xx_itm_term(MENU *);
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
//
|
| 199 |
+
// -------------------------------------------------------------------------
|
| 200 |
+
// This wraps the MENU type of <ncursesw/menu.h>
|
| 201 |
+
// -------------------------------------------------------------------------
|
| 202 |
+
//
|
| 203 |
+
class NCURSES_CXX_IMPEXP NCursesMenu : public NCursesPanel
|
| 204 |
+
{
|
| 205 |
+
protected:
|
| 206 |
+
MENU *menu;
|
| 207 |
+
|
| 208 |
+
private:
|
| 209 |
+
NCursesWindow* sub; // the subwindow object
|
| 210 |
+
bool b_sub_owner; // is this our own subwindow?
|
| 211 |
+
bool b_framed; // has the menu a border?
|
| 212 |
+
bool b_autoDelete; // Delete items when deleting menu?
|
| 213 |
+
|
| 214 |
+
NCursesMenuItem** my_items; // The array of items for this menu
|
| 215 |
+
|
| 216 |
+
// This structure is used for the menu's user data field to link the
|
| 217 |
+
// MENU* to the C++ object and to provide extra space for a user pointer.
|
| 218 |
+
typedef struct {
|
| 219 |
+
void* m_user; // the pointer for the user's data
|
| 220 |
+
const NCursesMenu* m_back; // backward pointer to C++ object
|
| 221 |
+
const MENU* m_owner;
|
| 222 |
+
} UserHook;
|
| 223 |
+
|
| 224 |
+
// Get the backward pointer to the C++ object from a MENU
|
| 225 |
+
static inline NCursesMenu* getHook(const MENU *m) {
|
| 226 |
+
UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m));
|
| 227 |
+
assert(hook != 0 && hook->m_owner==m);
|
| 228 |
+
return const_cast<NCursesMenu*>(hook->m_back);
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
friend void _nc_xx_mnu_init(MENU *);
|
| 232 |
+
friend void _nc_xx_mnu_term(MENU *);
|
| 233 |
+
friend void _nc_xx_itm_init(MENU *);
|
| 234 |
+
friend void _nc_xx_itm_term(MENU *);
|
| 235 |
+
|
| 236 |
+
// Calculate ITEM* array for the menu
|
| 237 |
+
ITEM** mapItems(NCursesMenuItem* nitems[]);
|
| 238 |
+
|
| 239 |
+
protected:
|
| 240 |
+
// internal routines
|
| 241 |
+
inline void set_user(void *user) {
|
| 242 |
+
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
|
| 243 |
+
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
|
| 244 |
+
uptr->m_user = user;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
inline void *get_user() {
|
| 248 |
+
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
|
| 249 |
+
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
|
| 250 |
+
return uptr->m_user;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
void InitMenu (NCursesMenuItem* menu[],
|
| 254 |
+
bool with_frame,
|
| 255 |
+
bool autoDeleteItems);
|
| 256 |
+
|
| 257 |
+
inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) {
|
| 258 |
+
if (err != E_OK)
|
| 259 |
+
THROW(new NCursesMenuException (this, err));
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
// this wraps the menu_driver call.
|
| 263 |
+
virtual int driver (int c) ;
|
| 264 |
+
|
| 265 |
+
// 'Internal' constructor to create a menu without association to
|
| 266 |
+
// an array of items.
|
| 267 |
+
NCursesMenu( int nlines,
|
| 268 |
+
int ncols,
|
| 269 |
+
int begin_y = 0,
|
| 270 |
+
int begin_x = 0)
|
| 271 |
+
: NCursesPanel(nlines,ncols,begin_y,begin_x),
|
| 272 |
+
menu (STATIC_CAST(MENU*)(0)),
|
| 273 |
+
sub(0),
|
| 274 |
+
b_sub_owner(0),
|
| 275 |
+
b_framed(0),
|
| 276 |
+
b_autoDelete(0),
|
| 277 |
+
my_items(0)
|
| 278 |
+
{
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
public:
|
| 282 |
+
// Make a full window size menu
|
| 283 |
+
NCursesMenu (NCursesMenuItem* Items[],
|
| 284 |
+
bool with_frame=FALSE, // Reserve space for a frame?
|
| 285 |
+
bool autoDelete_Items=FALSE) // Autocleanup of Items?
|
| 286 |
+
: NCursesPanel(),
|
| 287 |
+
menu(0),
|
| 288 |
+
sub(0),
|
| 289 |
+
b_sub_owner(0),
|
| 290 |
+
b_framed(0),
|
| 291 |
+
b_autoDelete(0),
|
| 292 |
+
my_items(0)
|
| 293 |
+
{
|
| 294 |
+
InitMenu(Items, with_frame, autoDelete_Items);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
// Make a menu with a window of this size.
|
| 298 |
+
NCursesMenu (NCursesMenuItem* Items[],
|
| 299 |
+
int nlines,
|
| 300 |
+
int ncols,
|
| 301 |
+
int begin_y = 0,
|
| 302 |
+
int begin_x = 0,
|
| 303 |
+
bool with_frame=FALSE, // Reserve space for a frame?
|
| 304 |
+
bool autoDelete_Items=FALSE) // Autocleanup of Items?
|
| 305 |
+
: NCursesPanel(nlines, ncols, begin_y, begin_x),
|
| 306 |
+
menu(0),
|
| 307 |
+
sub(0),
|
| 308 |
+
b_sub_owner(0),
|
| 309 |
+
b_framed(0),
|
| 310 |
+
b_autoDelete(0),
|
| 311 |
+
my_items(0)
|
| 312 |
+
{
|
| 313 |
+
InitMenu(Items, with_frame, autoDelete_Items);
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
NCursesMenu& operator=(const NCursesMenu& rhs)
|
| 317 |
+
{
|
| 318 |
+
if (this != &rhs) {
|
| 319 |
+
*this = rhs;
|
| 320 |
+
NCursesPanel::operator=(rhs);
|
| 321 |
+
}
|
| 322 |
+
return *this;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
NCursesMenu(const NCursesMenu& rhs)
|
| 326 |
+
: NCursesPanel(rhs),
|
| 327 |
+
menu(rhs.menu),
|
| 328 |
+
sub(rhs.sub),
|
| 329 |
+
b_sub_owner(rhs.b_sub_owner),
|
| 330 |
+
b_framed(rhs.b_framed),
|
| 331 |
+
b_autoDelete(rhs.b_autoDelete),
|
| 332 |
+
my_items(rhs.my_items)
|
| 333 |
+
{
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
virtual ~NCursesMenu () THROWS(NCursesException);
|
| 337 |
+
|
| 338 |
+
// Retrieve the menus subwindow
|
| 339 |
+
inline NCursesWindow& subWindow() const {
|
| 340 |
+
assert(sub!=NULL);
|
| 341 |
+
return *sub;
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
// Set the menus subwindow
|
| 345 |
+
void setSubWindow(NCursesWindow& sub);
|
| 346 |
+
|
| 347 |
+
// Set these items for the menu
|
| 348 |
+
inline void setItems(NCursesMenuItem* Items[]) {
|
| 349 |
+
OnError(::set_menu_items(menu,mapItems(Items)));
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
// Remove the menu from the screen
|
| 353 |
+
inline void unpost (void) {
|
| 354 |
+
OnError (::unpost_menu (menu));
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
// Post the menu to the screen if flag is true, unpost it otherwise
|
| 358 |
+
inline void post(bool flag = TRUE) {
|
| 359 |
+
flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu));
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
// Get the number of rows and columns for this menu
|
| 363 |
+
inline void scale (int& mrows, int& mcols) const {
|
| 364 |
+
OnError (::scale_menu (menu, &mrows, &mcols));
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
// Set the format of this menu
|
| 368 |
+
inline void set_format(int mrows, int mcols) {
|
| 369 |
+
OnError (::set_menu_format(menu, mrows, mcols));
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
// Get the format of this menu
|
| 373 |
+
inline void menu_format(int& rows,int& ncols) {
|
| 374 |
+
::menu_format(menu,&rows,&ncols);
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
// Items of the menu
|
| 378 |
+
inline NCursesMenuItem* items() const {
|
| 379 |
+
return *my_items;
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
// Get the number of items in this menu
|
| 383 |
+
inline int count() const {
|
| 384 |
+
return ::item_count(menu);
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
// Get the current item (i.e. the one the cursor is located)
|
| 388 |
+
inline NCursesMenuItem* current_item() const {
|
| 389 |
+
return my_items[::item_index(::current_item(menu))];
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
// Get the marker string
|
| 393 |
+
inline const char* mark() const {
|
| 394 |
+
return ::menu_mark(menu);
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
// Set the marker string
|
| 398 |
+
inline void set_mark(const char *marker) {
|
| 399 |
+
OnError (::set_menu_mark (menu, marker));
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
// Get the name of the request code c
|
| 403 |
+
inline static const char* request_name(int c) {
|
| 404 |
+
return ::menu_request_name(c);
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
// Get the current pattern
|
| 408 |
+
inline char* pattern() const {
|
| 409 |
+
return ::menu_pattern(menu);
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
// true if there is a pattern match, false otherwise.
|
| 413 |
+
bool set_pattern (const char *pat);
|
| 414 |
+
|
| 415 |
+
// set the default attributes for the menu
|
| 416 |
+
// i.e. set fore, back and grey attribute
|
| 417 |
+
virtual void setDefaultAttributes();
|
| 418 |
+
|
| 419 |
+
// Get the menus background attributes
|
| 420 |
+
inline chtype back() const {
|
| 421 |
+
return ::menu_back(menu);
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
// Get the menus foreground attributes
|
| 425 |
+
inline chtype fore() const {
|
| 426 |
+
return ::menu_fore(menu);
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
// Get the menus grey attributes (used for unselectable items)
|
| 430 |
+
inline chtype grey() const {
|
| 431 |
+
return ::menu_grey(menu);
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
// Set the menus background attributes
|
| 435 |
+
inline chtype set_background(chtype a) {
|
| 436 |
+
return ::set_menu_back(menu,a);
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
// Set the menus foreground attributes
|
| 440 |
+
inline chtype set_foreground(chtype a) {
|
| 441 |
+
return ::set_menu_fore(menu,a);
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
// Set the menus grey attributes (used for unselectable items)
|
| 445 |
+
inline chtype set_grey(chtype a) {
|
| 446 |
+
return ::set_menu_grey(menu,a);
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
inline void options_on (Menu_Options opts) {
|
| 450 |
+
OnError (::menu_opts_on (menu,opts));
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
inline void options_off(Menu_Options opts) {
|
| 454 |
+
OnError (::menu_opts_off(menu,opts));
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
inline Menu_Options options() const {
|
| 458 |
+
return ::menu_opts(menu);
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
inline void set_options (Menu_Options opts) {
|
| 462 |
+
OnError (::set_menu_opts (menu,opts));
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
inline int pad() const {
|
| 466 |
+
return ::menu_pad(menu);
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
inline void set_pad (int padch) {
|
| 470 |
+
OnError (::set_menu_pad (menu, padch));
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
// Position the cursor to the current item
|
| 474 |
+
inline void position_cursor () const {
|
| 475 |
+
OnError (::pos_menu_cursor (menu));
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
// Set the current item
|
| 479 |
+
inline void set_current(NCursesMenuItem& I) {
|
| 480 |
+
OnError (::set_current_item(menu, I.item));
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
// Get the current top row of the menu
|
| 484 |
+
inline int top_row (void) const {
|
| 485 |
+
return ::top_row (menu);
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
// Set the current top row of the menu
|
| 489 |
+
inline void set_top_row (int row) {
|
| 490 |
+
OnError (::set_top_row (menu, row));
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
// spacing control
|
| 494 |
+
// Set the spacing for the menu
|
| 495 |
+
inline void setSpacing(int spc_description,
|
| 496 |
+
int spc_rows,
|
| 497 |
+
int spc_columns) {
|
| 498 |
+
OnError(::set_menu_spacing(menu,
|
| 499 |
+
spc_description,
|
| 500 |
+
spc_rows,
|
| 501 |
+
spc_columns));
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
// Get the spacing info for the menu
|
| 505 |
+
inline void Spacing(int& spc_description,
|
| 506 |
+
int& spc_rows,
|
| 507 |
+
int& spc_columns) const {
|
| 508 |
+
OnError(::menu_spacing(menu,
|
| 509 |
+
&spc_description,
|
| 510 |
+
&spc_rows,
|
| 511 |
+
&spc_columns));
|
| 512 |
+
}
|
| 513 |
+
|
| 514 |
+
// Decorations
|
| 515 |
+
inline void frame(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
|
| 516 |
+
if (b_framed)
|
| 517 |
+
NCursesPanel::frame(title,btitle);
|
| 518 |
+
else
|
| 519 |
+
OnError(E_SYSTEM_ERROR);
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
inline void boldframe(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
|
| 523 |
+
if (b_framed)
|
| 524 |
+
NCursesPanel::boldframe(title,btitle);
|
| 525 |
+
else
|
| 526 |
+
OnError(E_SYSTEM_ERROR);
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
inline void label(const char *topLabel, const char *bottomLabel) NCURSES_OVERRIDE {
|
| 530 |
+
if (b_framed)
|
| 531 |
+
NCursesPanel::label(topLabel,bottomLabel);
|
| 532 |
+
else
|
| 533 |
+
OnError(E_SYSTEM_ERROR);
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
// -----
|
| 537 |
+
// Hooks
|
| 538 |
+
// -----
|
| 539 |
+
|
| 540 |
+
// Called after the menu gets repositioned in its window.
|
| 541 |
+
// This is especially true if the menu is posted.
|
| 542 |
+
virtual void On_Menu_Init();
|
| 543 |
+
|
| 544 |
+
// Called before the menu gets repositioned in its window.
|
| 545 |
+
// This is especially true if the menu is unposted.
|
| 546 |
+
virtual void On_Menu_Termination();
|
| 547 |
+
|
| 548 |
+
// Called after the item became the current item
|
| 549 |
+
virtual void On_Item_Init(NCursesMenuItem& item);
|
| 550 |
+
|
| 551 |
+
// Called before this item is left as current item.
|
| 552 |
+
virtual void On_Item_Termination(NCursesMenuItem& item);
|
| 553 |
+
|
| 554 |
+
// Provide a default key virtualization. Translate the keyboard
|
| 555 |
+
// code c into a menu request code.
|
| 556 |
+
// The default implementation provides a hopefully straightforward
|
| 557 |
+
// mapping for the most common keystrokes and menu requests.
|
| 558 |
+
virtual int virtualize(int c);
|
| 559 |
+
|
| 560 |
+
|
| 561 |
+
// Operators
|
| 562 |
+
inline NCursesMenuItem* operator[](int i) const {
|
| 563 |
+
if ( (i < 0) || (i >= ::item_count (menu)) )
|
| 564 |
+
OnError (E_BAD_ARGUMENT);
|
| 565 |
+
return (my_items[i]);
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
// Perform the menu's operation
|
| 569 |
+
// Return the item where you left the selection mark for a single
|
| 570 |
+
// selection menu, or NULL for a multivalued menu.
|
| 571 |
+
virtual NCursesMenuItem* operator()(void);
|
| 572 |
+
|
| 573 |
+
// --------------------
|
| 574 |
+
// Exception handlers
|
| 575 |
+
// Called by operator()
|
| 576 |
+
// --------------------
|
| 577 |
+
|
| 578 |
+
// Called if the request is denied
|
| 579 |
+
virtual void On_Request_Denied(int c) const;
|
| 580 |
+
|
| 581 |
+
// Called if the item is not selectable
|
| 582 |
+
virtual void On_Not_Selectable(int c) const;
|
| 583 |
+
|
| 584 |
+
// Called if pattern doesn't match
|
| 585 |
+
virtual void On_No_Match(int c) const;
|
| 586 |
+
|
| 587 |
+
// Called if the command is unknown
|
| 588 |
+
virtual void On_Unknown_Command(int c) const;
|
| 589 |
+
|
| 590 |
+
};
|
| 591 |
+
//
|
| 592 |
+
// -------------------------------------------------------------------------
|
| 593 |
+
// This is the typical C++ typesafe way to allow to attach
|
| 594 |
+
// user data to an item of a menu. Its assumed that the user
|
| 595 |
+
// data belongs to some class T. Use T as template argument
|
| 596 |
+
// to create a UserItem.
|
| 597 |
+
// -------------------------------------------------------------------------
|
| 598 |
+
//
|
| 599 |
+
template<class T> class NCURSES_CXX_IMPEXP NCursesUserItem : public NCursesMenuItem
|
| 600 |
+
{
|
| 601 |
+
public:
|
| 602 |
+
NCursesUserItem (const char* p_name,
|
| 603 |
+
const char* p_descript = NULL,
|
| 604 |
+
const T* p_UserData = STATIC_CAST(T*)(0))
|
| 605 |
+
: NCursesMenuItem (p_name, p_descript) {
|
| 606 |
+
if (item)
|
| 607 |
+
OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void*>(p_UserData))));
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
virtual ~NCursesUserItem() THROWS(NCursesException) {}
|
| 611 |
+
|
| 612 |
+
inline const T* UserData (void) const {
|
| 613 |
+
return reinterpret_cast<const T*>(::item_userptr (item));
|
| 614 |
+
};
|
| 615 |
+
|
| 616 |
+
inline virtual void setUserData(const T* p_UserData) {
|
| 617 |
+
if (item)
|
| 618 |
+
OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void *>(p_UserData))));
|
| 619 |
+
}
|
| 620 |
+
};
|
| 621 |
+
//
|
| 622 |
+
// -------------------------------------------------------------------------
|
| 623 |
+
// The same mechanism is used to attach user data to a menu
|
| 624 |
+
// -------------------------------------------------------------------------
|
| 625 |
+
//
|
| 626 |
+
template<class T> class NCURSES_CXX_IMPEXP NCursesUserMenu : public NCursesMenu
|
| 627 |
+
{
|
| 628 |
+
protected:
|
| 629 |
+
NCursesUserMenu( int nlines,
|
| 630 |
+
int ncols,
|
| 631 |
+
int begin_y = 0,
|
| 632 |
+
int begin_x = 0,
|
| 633 |
+
const T* p_UserData = STATIC_CAST(T*)(0))
|
| 634 |
+
: NCursesMenu(nlines,ncols,begin_y,begin_x) {
|
| 635 |
+
if (menu)
|
| 636 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 637 |
+
}
|
| 638 |
+
|
| 639 |
+
public:
|
| 640 |
+
NCursesUserMenu (NCursesMenuItem* Items[],
|
| 641 |
+
const T* p_UserData = STATIC_CAST(T*)(0),
|
| 642 |
+
bool with_frame=FALSE,
|
| 643 |
+
bool autoDelete_Items=FALSE)
|
| 644 |
+
: NCursesMenu (&Items, with_frame, autoDelete_Items) {
|
| 645 |
+
if (menu)
|
| 646 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 647 |
+
};
|
| 648 |
+
|
| 649 |
+
NCursesUserMenu (NCursesMenuItem* Items[],
|
| 650 |
+
int nlines,
|
| 651 |
+
int ncols,
|
| 652 |
+
int begin_y = 0,
|
| 653 |
+
int begin_x = 0,
|
| 654 |
+
const T* p_UserData = STATIC_CAST(T*)(0),
|
| 655 |
+
bool with_frame=FALSE)
|
| 656 |
+
: NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) {
|
| 657 |
+
if (menu)
|
| 658 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 659 |
+
};
|
| 660 |
+
|
| 661 |
+
virtual ~NCursesUserMenu() THROWS(NCursesException) {
|
| 662 |
+
};
|
| 663 |
+
|
| 664 |
+
inline T* UserData (void) {
|
| 665 |
+
return reinterpret_cast<T*>(get_user ());
|
| 666 |
+
};
|
| 667 |
+
|
| 668 |
+
inline virtual void setUserData (const T* p_UserData) {
|
| 669 |
+
if (menu)
|
| 670 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 671 |
+
}
|
| 672 |
+
};
|
| 673 |
+
|
| 674 |
+
#endif /* NCURSES_CURSESM_H_incl */
|
deepseek/include/cursesp.h
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-
|
| 2 |
+
// vile:cppmode
|
| 3 |
+
/****************************************************************************
|
| 4 |
+
* Copyright 2019-2021,2022 Thomas E. Dickey *
|
| 5 |
+
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
| 6 |
+
* *
|
| 7 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 8 |
+
* copy of this software and associated documentation files (the *
|
| 9 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 10 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 11 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 12 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 13 |
+
* furnished to do so, subject to the following conditions: *
|
| 14 |
+
* *
|
| 15 |
+
* The above copyright notice and this permission notice shall be included *
|
| 16 |
+
* in all copies or substantial portions of the Software. *
|
| 17 |
+
* *
|
| 18 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 19 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 20 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 21 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 22 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 23 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 24 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 25 |
+
* *
|
| 26 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 27 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 28 |
+
* sale, use or other dealings in this Software without prior written *
|
| 29 |
+
* authorization. *
|
| 30 |
+
****************************************************************************/
|
| 31 |
+
|
| 32 |
+
/****************************************************************************
|
| 33 |
+
* Author: Juergen Pfeifer, 1997 *
|
| 34 |
+
****************************************************************************/
|
| 35 |
+
|
| 36 |
+
#ifndef NCURSES_CURSESP_H_incl
|
| 37 |
+
#define NCURSES_CURSESP_H_incl 1
|
| 38 |
+
|
| 39 |
+
// $Id: cursesp.h,v 1.36 2022/08/20 20:52:15 tom Exp $
|
| 40 |
+
|
| 41 |
+
#include <ncursesw/cursesw.h>
|
| 42 |
+
|
| 43 |
+
extern "C" {
|
| 44 |
+
# include <ncursesw/panel.h>
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
class NCURSES_CXX_IMPEXP NCursesPanel
|
| 48 |
+
: public NCursesWindow
|
| 49 |
+
{
|
| 50 |
+
protected:
|
| 51 |
+
PANEL *p;
|
| 52 |
+
static NCursesPanel *dummy;
|
| 53 |
+
|
| 54 |
+
private:
|
| 55 |
+
// This structure is used for the panel's user data field to link the
|
| 56 |
+
// PANEL* to the C++ object and to provide extra space for a user pointer.
|
| 57 |
+
typedef struct {
|
| 58 |
+
void* m_user; // the pointer for the user's data
|
| 59 |
+
const NCursesPanel* m_back; // backward pointer to C++ object
|
| 60 |
+
const PANEL* m_owner; // the panel itself
|
| 61 |
+
} UserHook;
|
| 62 |
+
|
| 63 |
+
inline UserHook *UserPointer()
|
| 64 |
+
{
|
| 65 |
+
UserHook* uptr = reinterpret_cast<UserHook*>(
|
| 66 |
+
const_cast<void *>(::panel_userptr (p)));
|
| 67 |
+
return uptr;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
void init(); // Initialize the panel object
|
| 71 |
+
|
| 72 |
+
protected:
|
| 73 |
+
void set_user(void *user)
|
| 74 |
+
{
|
| 75 |
+
UserHook* uptr = UserPointer();
|
| 76 |
+
if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) {
|
| 77 |
+
uptr->m_user = user;
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
// Set the user pointer of the panel.
|
| 81 |
+
|
| 82 |
+
void *get_user()
|
| 83 |
+
{
|
| 84 |
+
UserHook* uptr = UserPointer();
|
| 85 |
+
void *result = 0;
|
| 86 |
+
if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p)
|
| 87 |
+
result = uptr->m_user;
|
| 88 |
+
return result;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
void OnError (int err) const THROW2(NCursesException const, NCursesPanelException)
|
| 92 |
+
{
|
| 93 |
+
if (err==ERR)
|
| 94 |
+
THROW(new NCursesPanelException (this, err));
|
| 95 |
+
}
|
| 96 |
+
// If err is equal to the curses error indicator ERR, an error handler
|
| 97 |
+
// is called.
|
| 98 |
+
|
| 99 |
+
// Get a keystroke. Default implementation calls getch()
|
| 100 |
+
virtual int getKey(void);
|
| 101 |
+
|
| 102 |
+
public:
|
| 103 |
+
NCursesPanel(int nlines,
|
| 104 |
+
int ncols,
|
| 105 |
+
int begin_y = 0,
|
| 106 |
+
int begin_x = 0)
|
| 107 |
+
: NCursesWindow(nlines,ncols,begin_y,begin_x), p(0)
|
| 108 |
+
{
|
| 109 |
+
init();
|
| 110 |
+
}
|
| 111 |
+
// Create a panel with this size starting at the requested position.
|
| 112 |
+
|
| 113 |
+
NCursesPanel()
|
| 114 |
+
: NCursesWindow(::stdscr), p(0)
|
| 115 |
+
{
|
| 116 |
+
init();
|
| 117 |
+
}
|
| 118 |
+
// This constructor creates the default Panel associated with the
|
| 119 |
+
// ::stdscr window
|
| 120 |
+
|
| 121 |
+
NCursesPanel& operator=(const NCursesPanel& rhs)
|
| 122 |
+
{
|
| 123 |
+
if (this != &rhs) {
|
| 124 |
+
*this = rhs;
|
| 125 |
+
NCursesWindow::operator=(rhs);
|
| 126 |
+
}
|
| 127 |
+
return *this;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
NCursesPanel(const NCursesPanel& rhs)
|
| 131 |
+
: NCursesWindow(rhs),
|
| 132 |
+
p(rhs.p)
|
| 133 |
+
{
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
virtual ~NCursesPanel() THROWS(NCursesException);
|
| 137 |
+
|
| 138 |
+
// basic manipulation
|
| 139 |
+
inline void hide()
|
| 140 |
+
{
|
| 141 |
+
OnError (::hide_panel(p));
|
| 142 |
+
}
|
| 143 |
+
// Hide the panel. It stays in the stack but becomes invisible.
|
| 144 |
+
|
| 145 |
+
inline void show()
|
| 146 |
+
{
|
| 147 |
+
OnError (::show_panel(p));
|
| 148 |
+
}
|
| 149 |
+
// Show the panel, i.e. make it visible.
|
| 150 |
+
|
| 151 |
+
inline void top()
|
| 152 |
+
{
|
| 153 |
+
OnError (::top_panel(p));
|
| 154 |
+
}
|
| 155 |
+
// Make this panel the top panel in the stack.
|
| 156 |
+
|
| 157 |
+
inline void bottom()
|
| 158 |
+
{
|
| 159 |
+
OnError (::bottom_panel(p));
|
| 160 |
+
}
|
| 161 |
+
// Make this panel the bottom panel in the stack.
|
| 162 |
+
// N.B.: The panel associated with ::stdscr is always on the bottom. So
|
| 163 |
+
// actually bottom() makes the panel the first above ::stdscr.
|
| 164 |
+
|
| 165 |
+
virtual int mvwin(int y, int x) NCURSES_OVERRIDE
|
| 166 |
+
{
|
| 167 |
+
OnError(::move_panel(p, y, x));
|
| 168 |
+
return OK;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
inline bool hidden() const
|
| 172 |
+
{
|
| 173 |
+
return (::panel_hidden (p) ? TRUE : FALSE);
|
| 174 |
+
}
|
| 175 |
+
// Return TRUE if the panel is hidden, FALSE otherwise.
|
| 176 |
+
|
| 177 |
+
/* The functions panel_above() and panel_below() are not reflected in
|
| 178 |
+
the NCursesPanel class. The reason for this is, that we cannot
|
| 179 |
+
assume that a panel retrieved by those operations is one wrapped
|
| 180 |
+
by a C++ class. Although this situation might be handled, we also
|
| 181 |
+
need a reverse mapping from PANEL to NCursesPanel which needs some
|
| 182 |
+
redesign of the low level stuff. At the moment, we define them in the
|
| 183 |
+
interface but they will always produce an error. */
|
| 184 |
+
inline NCursesPanel& above() const
|
| 185 |
+
{
|
| 186 |
+
OnError(ERR);
|
| 187 |
+
return *dummy;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
inline NCursesPanel& below() const
|
| 191 |
+
{
|
| 192 |
+
OnError(ERR);
|
| 193 |
+
return *dummy;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
// Those two are rewrites of the corresponding virtual members of
|
| 197 |
+
// NCursesWindow
|
| 198 |
+
virtual int refresh() NCURSES_OVERRIDE;
|
| 199 |
+
// Propagate all panel changes to the virtual screen and update the
|
| 200 |
+
// physical screen.
|
| 201 |
+
|
| 202 |
+
virtual int noutrefresh() NCURSES_OVERRIDE;
|
| 203 |
+
// Propagate all panel changes to the virtual screen.
|
| 204 |
+
|
| 205 |
+
static void redraw();
|
| 206 |
+
// Redraw all panels.
|
| 207 |
+
|
| 208 |
+
// decorations
|
| 209 |
+
virtual void frame(const char* title=NULL,
|
| 210 |
+
const char* btitle=NULL);
|
| 211 |
+
// Put a frame around the panel and put the title centered in the top line
|
| 212 |
+
// and btitle in the bottom line.
|
| 213 |
+
|
| 214 |
+
virtual void boldframe(const char* title=NULL,
|
| 215 |
+
const char* btitle=NULL);
|
| 216 |
+
// Same as frame(), but use highlighted attributes.
|
| 217 |
+
|
| 218 |
+
virtual void label(const char* topLabel,
|
| 219 |
+
const char* bottomLabel);
|
| 220 |
+
// Put the title centered in the top line and btitle in the bottom line.
|
| 221 |
+
|
| 222 |
+
virtual void centertext(int row,const char* label);
|
| 223 |
+
// Put the label text centered in the specified row.
|
| 224 |
+
};
|
| 225 |
+
|
| 226 |
+
/* We use templates to provide a typesafe mechanism to associate
|
| 227 |
+
* user data with a panel. A NCursesUserPanel<T> is a panel
|
| 228 |
+
* associated with some user data of type T.
|
| 229 |
+
*/
|
| 230 |
+
template<class T> class NCursesUserPanel : public NCursesPanel
|
| 231 |
+
{
|
| 232 |
+
public:
|
| 233 |
+
NCursesUserPanel (int nlines,
|
| 234 |
+
int ncols,
|
| 235 |
+
int begin_y = 0,
|
| 236 |
+
int begin_x = 0,
|
| 237 |
+
const T* p_UserData = STATIC_CAST(T*)(0))
|
| 238 |
+
: NCursesPanel (nlines, ncols, begin_y, begin_x)
|
| 239 |
+
{
|
| 240 |
+
if (p)
|
| 241 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>
|
| 242 |
+
(p_UserData)));
|
| 243 |
+
};
|
| 244 |
+
// This creates an user panel of the requested size with associated
|
| 245 |
+
// user data pointed to by p_UserData.
|
| 246 |
+
|
| 247 |
+
explicit NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel()
|
| 248 |
+
{
|
| 249 |
+
if (p)
|
| 250 |
+
set_user(const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 251 |
+
};
|
| 252 |
+
// This creates an user panel associated with the ::stdscr and user data
|
| 253 |
+
// pointed to by p_UserData.
|
| 254 |
+
|
| 255 |
+
virtual ~NCursesUserPanel() THROWS(NCursesException) {};
|
| 256 |
+
|
| 257 |
+
T* UserData (void)
|
| 258 |
+
{
|
| 259 |
+
return reinterpret_cast<T*>(get_user ());
|
| 260 |
+
};
|
| 261 |
+
// Retrieve the user data associated with the panel.
|
| 262 |
+
|
| 263 |
+
virtual void setUserData (const T* p_UserData)
|
| 264 |
+
{
|
| 265 |
+
if (p)
|
| 266 |
+
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
| 267 |
+
}
|
| 268 |
+
// Associate the user panel with the user data pointed to by p_UserData.
|
| 269 |
+
};
|
| 270 |
+
|
| 271 |
+
#endif /* NCURSES_CURSESP_H_incl */
|
deepseek/include/default.h
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* default.h --
|
| 3 |
+
*
|
| 4 |
+
* This file defines the defaults for all options for all of
|
| 5 |
+
* the Tk widgets.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1991-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1994 Sun Microsystems, Inc.
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 11 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _DEFAULT
|
| 15 |
+
#define _DEFAULT
|
| 16 |
+
|
| 17 |
+
#ifdef _WIN32
|
| 18 |
+
# include "tkWinDefault.h"
|
| 19 |
+
#else
|
| 20 |
+
# if defined(MAC_OSX_TK)
|
| 21 |
+
# include "tkMacOSXDefault.h"
|
| 22 |
+
# else
|
| 23 |
+
# include "tkUnixDefault.h"
|
| 24 |
+
# endif
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#endif /* _DEFAULT */
|
deepseek/include/eti.h
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2020 Thomas E. Dickey *
|
| 3 |
+
* Copyright 1998-2002,2003 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Juergen Pfeifer, 1995,1997 *
|
| 32 |
+
****************************************************************************/
|
| 33 |
+
|
| 34 |
+
/* $Id: eti.h,v 1.9 2020/02/02 23:34:34 tom Exp $ */
|
| 35 |
+
|
| 36 |
+
#ifndef NCURSES_ETI_H_incl
|
| 37 |
+
#define NCURSES_ETI_H_incl 1
|
| 38 |
+
|
| 39 |
+
#define E_OK (0)
|
| 40 |
+
#define E_SYSTEM_ERROR (-1)
|
| 41 |
+
#define E_BAD_ARGUMENT (-2)
|
| 42 |
+
#define E_POSTED (-3)
|
| 43 |
+
#define E_CONNECTED (-4)
|
| 44 |
+
#define E_BAD_STATE (-5)
|
| 45 |
+
#define E_NO_ROOM (-6)
|
| 46 |
+
#define E_NOT_POSTED (-7)
|
| 47 |
+
#define E_UNKNOWN_COMMAND (-8)
|
| 48 |
+
#define E_NO_MATCH (-9)
|
| 49 |
+
#define E_NOT_SELECTABLE (-10)
|
| 50 |
+
#define E_NOT_CONNECTED (-11)
|
| 51 |
+
#define E_REQUEST_DENIED (-12)
|
| 52 |
+
#define E_INVALID_FIELD (-13)
|
| 53 |
+
#define E_CURRENT (-14)
|
| 54 |
+
|
| 55 |
+
#endif
|
deepseek/include/etip.h
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// * This makes emacs happy -*-Mode: C++;-*-
|
| 2 |
+
/****************************************************************************
|
| 3 |
+
* Copyright 2018-2021,2022 Thomas E. Dickey *
|
| 4 |
+
* Copyright 1998-2012,2017 Free Software Foundation, Inc. *
|
| 5 |
+
* *
|
| 6 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 7 |
+
* copy of this software and associated documentation files (the *
|
| 8 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 9 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 10 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 11 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 12 |
+
* furnished to do so, subject to the following conditions: *
|
| 13 |
+
* *
|
| 14 |
+
* The above copyright notice and this permission notice shall be included *
|
| 15 |
+
* in all copies or substantial portions of the Software. *
|
| 16 |
+
* *
|
| 17 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 18 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 19 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 20 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 21 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 22 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 23 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 24 |
+
* *
|
| 25 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 26 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 27 |
+
* sale, use or other dealings in this Software without prior written *
|
| 28 |
+
* authorization. *
|
| 29 |
+
****************************************************************************/
|
| 30 |
+
|
| 31 |
+
/****************************************************************************
|
| 32 |
+
* Author: Juergen Pfeifer, 1997 *
|
| 33 |
+
****************************************************************************/
|
| 34 |
+
|
| 35 |
+
// $Id: etip.h.in,v 1.50 2022/08/20 20:50:00 tom Exp $
|
| 36 |
+
|
| 37 |
+
#ifndef NCURSES_ETIP_H_incl
|
| 38 |
+
#define NCURSES_ETIP_H_incl 1
|
| 39 |
+
|
| 40 |
+
// These are substituted at configure/build time
|
| 41 |
+
#ifndef HAVE_BUILTIN_H
|
| 42 |
+
#define HAVE_BUILTIN_H 0
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#ifndef HAVE_GXX_BUILTIN_H
|
| 46 |
+
#define HAVE_GXX_BUILTIN_H 0
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
#ifndef HAVE_GPP_BUILTIN_H
|
| 50 |
+
#define HAVE_GPP_BUILTIN_H 0
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
#ifndef HAVE_IOSTREAM
|
| 54 |
+
#define HAVE_IOSTREAM 1
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#ifndef HAVE_TYPEINFO
|
| 58 |
+
#define HAVE_TYPEINFO 1
|
| 59 |
+
#endif
|
| 60 |
+
|
| 61 |
+
#ifndef HAVE_VALUES_H
|
| 62 |
+
#define HAVE_VALUES_H 0
|
| 63 |
+
#endif
|
| 64 |
+
|
| 65 |
+
#ifndef ETIP_NEEDS_MATH_H
|
| 66 |
+
#define ETIP_NEEDS_MATH_H 0
|
| 67 |
+
#endif
|
| 68 |
+
|
| 69 |
+
#ifndef ETIP_NEEDS_MATH_EXCEPTION
|
| 70 |
+
#define ETIP_NEEDS_MATH_EXCEPTION 0
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
#ifndef CPP_HAS_OVERRIDE
|
| 74 |
+
#define CPP_HAS_OVERRIDE 0
|
| 75 |
+
#endif
|
| 76 |
+
|
| 77 |
+
#ifndef CPP_HAS_PARAM_INIT
|
| 78 |
+
#define CPP_HAS_PARAM_INIT 0
|
| 79 |
+
#endif
|
| 80 |
+
|
| 81 |
+
#ifndef CPP_HAS_STATIC_CAST
|
| 82 |
+
#define CPP_HAS_STATIC_CAST 1
|
| 83 |
+
#endif
|
| 84 |
+
|
| 85 |
+
#ifndef IOSTREAM_NAMESPACE
|
| 86 |
+
#define IOSTREAM_NAMESPACE 1
|
| 87 |
+
#endif
|
| 88 |
+
|
| 89 |
+
#ifdef __GNUG__
|
| 90 |
+
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
|
| 91 |
+
# if HAVE_TYPEINFO
|
| 92 |
+
# include <typeinfo>
|
| 93 |
+
# endif
|
| 94 |
+
# endif
|
| 95 |
+
#endif
|
| 96 |
+
|
| 97 |
+
#if defined(__GNUG__)
|
| 98 |
+
# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H
|
| 99 |
+
# if ETIP_NEEDS_MATH_H
|
| 100 |
+
# if ETIP_NEEDS_MATH_EXCEPTION
|
| 101 |
+
# undef exception
|
| 102 |
+
# define exception math_exception
|
| 103 |
+
# endif
|
| 104 |
+
# include <math.h>
|
| 105 |
+
# endif
|
| 106 |
+
# undef exception
|
| 107 |
+
# define exception builtin_exception
|
| 108 |
+
# if HAVE_GPP_BUILTIN_H
|
| 109 |
+
# include <gpp/builtin.h>
|
| 110 |
+
# elif HAVE_GXX_BUILTIN_H
|
| 111 |
+
# include <g++/builtin.h>
|
| 112 |
+
# else
|
| 113 |
+
# include <builtin.h>
|
| 114 |
+
# endif
|
| 115 |
+
# undef exception
|
| 116 |
+
# endif
|
| 117 |
+
#elif defined (__SUNPRO_CC)
|
| 118 |
+
# include <generic.h>
|
| 119 |
+
#endif
|
| 120 |
+
|
| 121 |
+
#include <ncursesw/curses.h>
|
| 122 |
+
|
| 123 |
+
extern "C" {
|
| 124 |
+
#if HAVE_VALUES_H
|
| 125 |
+
# include <values.h>
|
| 126 |
+
#endif
|
| 127 |
+
|
| 128 |
+
#include <assert.h>
|
| 129 |
+
#include <ncursesw/eti.h>
|
| 130 |
+
#include <errno.h>
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
// Language features
|
| 134 |
+
#if CPP_HAS_OVERRIDE
|
| 135 |
+
#define NCURSES_OVERRIDE override
|
| 136 |
+
#else
|
| 137 |
+
#define NCURSES_OVERRIDE /*nothing*/
|
| 138 |
+
#endif
|
| 139 |
+
|
| 140 |
+
#if CPP_HAS_PARAM_INIT
|
| 141 |
+
#define NCURSES_PARAM_INIT(value) = value
|
| 142 |
+
#else
|
| 143 |
+
#define NCURSES_PARAM_INIT(value) /*nothing*/
|
| 144 |
+
#endif
|
| 145 |
+
|
| 146 |
+
#if CPP_HAS_STATIC_CAST
|
| 147 |
+
#define STATIC_CAST(s) static_cast<s>
|
| 148 |
+
#else
|
| 149 |
+
#define STATIC_CAST(s) (s)
|
| 150 |
+
#endif
|
| 151 |
+
|
| 152 |
+
#ifndef NCURSES_CXX_IMPEXP
|
| 153 |
+
#define NCURSES_CXX_IMPEXP /* nothing */
|
| 154 |
+
#endif
|
| 155 |
+
|
| 156 |
+
// Forward Declarations
|
| 157 |
+
class NCURSES_CXX_IMPEXP NCursesPanel;
|
| 158 |
+
class NCURSES_CXX_IMPEXP NCursesMenu;
|
| 159 |
+
class NCURSES_CXX_IMPEXP NCursesForm;
|
| 160 |
+
|
| 161 |
+
class NCURSES_CXX_IMPEXP NCursesException
|
| 162 |
+
{
|
| 163 |
+
public:
|
| 164 |
+
const char *message;
|
| 165 |
+
int errorno;
|
| 166 |
+
|
| 167 |
+
NCursesException (const char* msg, int err)
|
| 168 |
+
: message(msg), errorno (err)
|
| 169 |
+
{};
|
| 170 |
+
|
| 171 |
+
explicit NCursesException (const char* msg)
|
| 172 |
+
: message(msg), errorno (E_SYSTEM_ERROR)
|
| 173 |
+
{};
|
| 174 |
+
|
| 175 |
+
NCursesException& operator=(const NCursesException& rhs)
|
| 176 |
+
{
|
| 177 |
+
message = rhs.message;
|
| 178 |
+
errorno = rhs.errorno;
|
| 179 |
+
return *this;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
NCursesException(const NCursesException& rhs)
|
| 183 |
+
: message(rhs.message), errorno(rhs.errorno)
|
| 184 |
+
{
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
virtual const char *classname() const {
|
| 188 |
+
return "NCursesWindow";
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
virtual ~NCursesException()
|
| 192 |
+
{
|
| 193 |
+
}
|
| 194 |
+
};
|
| 195 |
+
|
| 196 |
+
class NCURSES_CXX_IMPEXP NCursesPanelException : public NCursesException
|
| 197 |
+
{
|
| 198 |
+
public:
|
| 199 |
+
const NCursesPanel* p;
|
| 200 |
+
|
| 201 |
+
NCursesPanelException (const char *msg, int err) :
|
| 202 |
+
NCursesException (msg, err),
|
| 203 |
+
p (0)
|
| 204 |
+
{};
|
| 205 |
+
|
| 206 |
+
NCursesPanelException (const NCursesPanel* panel,
|
| 207 |
+
const char *msg,
|
| 208 |
+
int err) :
|
| 209 |
+
NCursesException (msg, err),
|
| 210 |
+
p (panel)
|
| 211 |
+
{};
|
| 212 |
+
|
| 213 |
+
explicit NCursesPanelException (int err) :
|
| 214 |
+
NCursesException ("panel library error", err),
|
| 215 |
+
p (0)
|
| 216 |
+
{};
|
| 217 |
+
|
| 218 |
+
NCursesPanelException (const NCursesPanel* panel,
|
| 219 |
+
int err) :
|
| 220 |
+
NCursesException ("panel library error", err),
|
| 221 |
+
p (panel)
|
| 222 |
+
{};
|
| 223 |
+
|
| 224 |
+
NCursesPanelException& operator=(const NCursesPanelException& rhs)
|
| 225 |
+
{
|
| 226 |
+
if (this != &rhs) {
|
| 227 |
+
NCursesException::operator=(rhs);
|
| 228 |
+
p = rhs.p;
|
| 229 |
+
}
|
| 230 |
+
return *this;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
NCursesPanelException(const NCursesPanelException& rhs)
|
| 234 |
+
: NCursesException(rhs), p(rhs.p)
|
| 235 |
+
{
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
virtual const char *classname() const NCURSES_OVERRIDE {
|
| 239 |
+
return "NCursesPanel";
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
virtual ~NCursesPanelException()
|
| 243 |
+
{
|
| 244 |
+
}
|
| 245 |
+
};
|
| 246 |
+
|
| 247 |
+
class NCURSES_CXX_IMPEXP NCursesMenuException : public NCursesException
|
| 248 |
+
{
|
| 249 |
+
public:
|
| 250 |
+
const NCursesMenu* m;
|
| 251 |
+
|
| 252 |
+
NCursesMenuException (const char *msg, int err) :
|
| 253 |
+
NCursesException (msg, err),
|
| 254 |
+
m (0)
|
| 255 |
+
{};
|
| 256 |
+
|
| 257 |
+
NCursesMenuException (const NCursesMenu* menu,
|
| 258 |
+
const char *msg,
|
| 259 |
+
int err) :
|
| 260 |
+
NCursesException (msg, err),
|
| 261 |
+
m (menu)
|
| 262 |
+
{};
|
| 263 |
+
|
| 264 |
+
explicit NCursesMenuException (int err) :
|
| 265 |
+
NCursesException ("menu library error", err),
|
| 266 |
+
m (0)
|
| 267 |
+
{};
|
| 268 |
+
|
| 269 |
+
NCursesMenuException (const NCursesMenu* menu,
|
| 270 |
+
int err) :
|
| 271 |
+
NCursesException ("menu library error", err),
|
| 272 |
+
m (menu)
|
| 273 |
+
{};
|
| 274 |
+
|
| 275 |
+
NCursesMenuException& operator=(const NCursesMenuException& rhs)
|
| 276 |
+
{
|
| 277 |
+
if (this != &rhs) {
|
| 278 |
+
NCursesException::operator=(rhs);
|
| 279 |
+
m = rhs.m;
|
| 280 |
+
}
|
| 281 |
+
return *this;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
NCursesMenuException(const NCursesMenuException& rhs)
|
| 285 |
+
: NCursesException(rhs), m(rhs.m)
|
| 286 |
+
{
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
virtual const char *classname() const NCURSES_OVERRIDE {
|
| 290 |
+
return "NCursesMenu";
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
virtual ~NCursesMenuException()
|
| 294 |
+
{
|
| 295 |
+
}
|
| 296 |
+
};
|
| 297 |
+
|
| 298 |
+
class NCURSES_CXX_IMPEXP NCursesFormException : public NCursesException
|
| 299 |
+
{
|
| 300 |
+
public:
|
| 301 |
+
const NCursesForm* f;
|
| 302 |
+
|
| 303 |
+
NCursesFormException (const char *msg, int err) :
|
| 304 |
+
NCursesException (msg, err),
|
| 305 |
+
f (0)
|
| 306 |
+
{};
|
| 307 |
+
|
| 308 |
+
NCursesFormException (const NCursesForm* form,
|
| 309 |
+
const char *msg,
|
| 310 |
+
int err) :
|
| 311 |
+
NCursesException (msg, err),
|
| 312 |
+
f (form)
|
| 313 |
+
{};
|
| 314 |
+
|
| 315 |
+
explicit NCursesFormException (int err) :
|
| 316 |
+
NCursesException ("form library error", err),
|
| 317 |
+
f (0)
|
| 318 |
+
{};
|
| 319 |
+
|
| 320 |
+
NCursesFormException (const NCursesForm* form,
|
| 321 |
+
int err) :
|
| 322 |
+
NCursesException ("form library error", err),
|
| 323 |
+
f (form)
|
| 324 |
+
{};
|
| 325 |
+
|
| 326 |
+
NCursesFormException& operator=(const NCursesFormException& rhs)
|
| 327 |
+
{
|
| 328 |
+
if (this != &rhs) {
|
| 329 |
+
NCursesException::operator=(rhs);
|
| 330 |
+
f = rhs.f;
|
| 331 |
+
}
|
| 332 |
+
return *this;
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
NCursesFormException(const NCursesFormException& rhs)
|
| 336 |
+
: NCursesException(rhs), f(rhs.f)
|
| 337 |
+
{
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
virtual const char *classname() const NCURSES_OVERRIDE {
|
| 341 |
+
return "NCursesForm";
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
virtual ~NCursesFormException()
|
| 345 |
+
{
|
| 346 |
+
}
|
| 347 |
+
};
|
| 348 |
+
|
| 349 |
+
#if !((defined(__GNUG__) && defined(__EXCEPTIONS) && (__GNUG__ < 7)) || defined(__SUNPRO_CC))
|
| 350 |
+
# if HAVE_IOSTREAM
|
| 351 |
+
# include <iostream>
|
| 352 |
+
# if IOSTREAM_NAMESPACE
|
| 353 |
+
using std::cerr;
|
| 354 |
+
using std::endl;
|
| 355 |
+
# endif
|
| 356 |
+
# else
|
| 357 |
+
# include <iostream.h>
|
| 358 |
+
# endif
|
| 359 |
+
#endif
|
| 360 |
+
|
| 361 |
+
inline void THROW(const NCursesException *e) {
|
| 362 |
+
#if defined(__GNUG__) && defined(__EXCEPTIONS)
|
| 363 |
+
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
|
| 364 |
+
(*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
|
| 365 |
+
# elif (__GNUG__ >= 7)
|
| 366 |
+
// g++ 7.0 warns about deprecation, but lacks the predefined symbols
|
| 367 |
+
::endwin();
|
| 368 |
+
std::cerr << "Found a problem - goodbye" << std::endl;
|
| 369 |
+
exit(EXIT_FAILURE);
|
| 370 |
+
# else
|
| 371 |
+
# define CPP_HAS_TRY_CATCH 1
|
| 372 |
+
# endif
|
| 373 |
+
#elif defined(__SUNPRO_CC)
|
| 374 |
+
# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
|
| 375 |
+
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
|
| 376 |
+
# else
|
| 377 |
+
# define CPP_HAS_TRY_CATCH 1
|
| 378 |
+
# endif
|
| 379 |
+
#else
|
| 380 |
+
if (e)
|
| 381 |
+
cerr << e->message << endl;
|
| 382 |
+
exit(0);
|
| 383 |
+
#endif
|
| 384 |
+
|
| 385 |
+
#ifndef CPP_HAS_TRY_CATCH
|
| 386 |
+
#define CPP_HAS_TRY_CATCH 0
|
| 387 |
+
#define NCURSES_CPP_TRY /* nothing */
|
| 388 |
+
#define NCURSES_CPP_CATCH(e) if (false)
|
| 389 |
+
#define THROWS(s) /* nothing */
|
| 390 |
+
#define THROW2(s,t) /* nothing */
|
| 391 |
+
#elif CPP_HAS_TRY_CATCH
|
| 392 |
+
throw *e;
|
| 393 |
+
#define NCURSES_CPP_TRY try
|
| 394 |
+
#define NCURSES_CPP_CATCH(e) catch(e)
|
| 395 |
+
#if defined(__cpp_noexcept_function_type) && (__cpp_noexcept_function_type >= 201510)
|
| 396 |
+
// C++17 deprecates the usage of throw().
|
| 397 |
+
#define THROWS(s) /* nothing */
|
| 398 |
+
#define THROW2(s,t) /* nothing */
|
| 399 |
+
#else
|
| 400 |
+
#define THROWS(s) throw(s)
|
| 401 |
+
#define THROW2(s,t) throw(s,t)
|
| 402 |
+
#endif
|
| 403 |
+
#endif
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
#endif /* NCURSES_ETIP_H_incl */
|
deepseek/include/fakesql.h
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.h --
|
| 3 |
+
*
|
| 4 |
+
* Include file that defines the subset of SQL/CLI that TDBC
|
| 5 |
+
* uses, so that tdbc::odbc can build without an explicit ODBC
|
| 6 |
+
* dependency. It comprises only data type, constant and
|
| 7 |
+
* function declarations.
|
| 8 |
+
*
|
| 9 |
+
* The programmers of this file believe that it contains material not
|
| 10 |
+
* subject to copyright under the doctrines of scenes a faire and
|
| 11 |
+
* of merger of idea and expression. Accordingly, this file is in the
|
| 12 |
+
* public domain.
|
| 13 |
+
*
|
| 14 |
+
*-----------------------------------------------------------------------------
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef FAKESQL_H_INCLUDED
|
| 18 |
+
#define FAKESQL_H_INCLUDED
|
| 19 |
+
|
| 20 |
+
#include <stddef.h>
|
| 21 |
+
|
| 22 |
+
#ifndef MODULE_SCOPE
|
| 23 |
+
#define MODULE_SCOPE extern
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
/* Limits */
|
| 27 |
+
|
| 28 |
+
#define SQL_MAX_DSN_LENGTH 32
|
| 29 |
+
#define SQL_MAX_MESSAGE_LENGTH 512
|
| 30 |
+
|
| 31 |
+
/* Fundamental data types */
|
| 32 |
+
|
| 33 |
+
#ifndef _WIN32
|
| 34 |
+
typedef int BOOL;
|
| 35 |
+
typedef unsigned int DWORD;
|
| 36 |
+
typedef void* HANDLE;
|
| 37 |
+
typedef HANDLE HWND;
|
| 38 |
+
typedef unsigned short WCHAR;
|
| 39 |
+
typedef char* LPSTR;
|
| 40 |
+
typedef WCHAR* LPWSTR;
|
| 41 |
+
typedef const char* LPCSTR;
|
| 42 |
+
typedef const WCHAR* LPCWSTR;
|
| 43 |
+
typedef unsigned short WORD;
|
| 44 |
+
#endif
|
| 45 |
+
typedef void* PVOID;
|
| 46 |
+
typedef short RETCODE;
|
| 47 |
+
typedef long SDWORD;
|
| 48 |
+
typedef short SWORD;
|
| 49 |
+
typedef unsigned short USHORT;
|
| 50 |
+
typedef USHORT UWORD;
|
| 51 |
+
|
| 52 |
+
/* ODBC data types */
|
| 53 |
+
|
| 54 |
+
typedef Tcl_WideInt SQLBIGINT;
|
| 55 |
+
typedef unsigned char SQLCHAR;
|
| 56 |
+
typedef double SQLDOUBLE;
|
| 57 |
+
typedef void* SQLHANDLE;
|
| 58 |
+
typedef SDWORD SQLINTEGER;
|
| 59 |
+
typedef PVOID SQLPOINTER;
|
| 60 |
+
typedef SWORD SQLSMALLINT;
|
| 61 |
+
typedef Tcl_WideUInt SQLUBIGINT;
|
| 62 |
+
typedef unsigned char SQLUCHAR;
|
| 63 |
+
typedef unsigned int SQLUINTEGER;
|
| 64 |
+
typedef UWORD SQLUSMALLINT;
|
| 65 |
+
typedef WCHAR SQLWCHAR;
|
| 66 |
+
|
| 67 |
+
typedef SQLSMALLINT SQLRETURN;
|
| 68 |
+
|
| 69 |
+
/* TODO - Check how the SQLLEN and SQLULEN types are handled on
|
| 70 |
+
* 64-bit Unix. */
|
| 71 |
+
|
| 72 |
+
#if defined(_WIN64)
|
| 73 |
+
typedef Tcl_WideInt SQLLEN;
|
| 74 |
+
typedef Tcl_WideUInt SQLULEN;
|
| 75 |
+
#else
|
| 76 |
+
typedef SQLINTEGER SQLLEN;
|
| 77 |
+
typedef SQLUINTEGER SQLULEN;
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
/* Handle types */
|
| 81 |
+
|
| 82 |
+
typedef SQLHANDLE SQLHENV;
|
| 83 |
+
typedef SQLHANDLE SQLHDBC;
|
| 84 |
+
typedef SQLHANDLE SQLHSTMT;
|
| 85 |
+
typedef HWND SQLHWND;
|
| 86 |
+
|
| 87 |
+
#define SQL_HANDLE_DBC 2
|
| 88 |
+
#define SQL_HANDLE_ENV 1
|
| 89 |
+
#define SQL_HANDLE_STMT 3
|
| 90 |
+
|
| 91 |
+
/* Null handles */
|
| 92 |
+
|
| 93 |
+
#define SQL_NULL_HANDLE ((SQLHANDLE) 0)
|
| 94 |
+
#define SQL_NULL_HENV ((SQLHENV) 0)
|
| 95 |
+
#define SQL_NULL_HDBC ((SQLHDBC) 0)
|
| 96 |
+
#define SQL_NULL_HSTMT ((SQLHSTMT) 0)
|
| 97 |
+
|
| 98 |
+
/* SQL data types */
|
| 99 |
+
|
| 100 |
+
enum _SQL_DATATYPE {
|
| 101 |
+
SQL_BIGINT = -5,
|
| 102 |
+
SQL_BINARY = -2,
|
| 103 |
+
SQL_BIT = -7,
|
| 104 |
+
SQL_CHAR = 1,
|
| 105 |
+
SQL_DATE = 9,
|
| 106 |
+
SQL_DECIMAL = 3,
|
| 107 |
+
SQL_DOUBLE = 8,
|
| 108 |
+
SQL_FLOAT = 6,
|
| 109 |
+
SQL_INTEGER = 4,
|
| 110 |
+
SQL_LONGVARBINARY = -4,
|
| 111 |
+
SQL_LONGVARCHAR = -1,
|
| 112 |
+
SQL_NUMERIC = 2,
|
| 113 |
+
SQL_REAL = 7,
|
| 114 |
+
SQL_SMALLINT = 5,
|
| 115 |
+
SQL_TIME = 10,
|
| 116 |
+
SQL_TIMESTAMP = 11,
|
| 117 |
+
SQL_TINYINT = -6,
|
| 118 |
+
SQL_VARBINARY = -3,
|
| 119 |
+
SQL_VARCHAR = 12,
|
| 120 |
+
SQL_WCHAR = -8,
|
| 121 |
+
SQL_WVARCHAR = -9,
|
| 122 |
+
SQL_WLONGVARCHAR = -10,
|
| 123 |
+
};
|
| 124 |
+
|
| 125 |
+
/* C data types */
|
| 126 |
+
|
| 127 |
+
#define SQL_SIGNED_OFFSET (-20)
|
| 128 |
+
|
| 129 |
+
#define SQL_C_BINARY SQL_BINARY
|
| 130 |
+
#define SQL_C_CHAR SQL_CHAR
|
| 131 |
+
#define SQL_C_DOUBLE SQL_DOUBLE
|
| 132 |
+
#define SQL_C_LONG SQL_INTEGER
|
| 133 |
+
#define SQL_C_SBIGINT SQL_BIGINT + SQL_SIGNED_OFFSET
|
| 134 |
+
#define SQL_C_SLONG SQL_INTEGER + SQL_SIGNED_OFFSET
|
| 135 |
+
#define SQL_C_WCHAR SQL_WCHAR
|
| 136 |
+
|
| 137 |
+
/* Parameter transmission diretions */
|
| 138 |
+
|
| 139 |
+
#define SQL_PARAM_INPUT 1
|
| 140 |
+
|
| 141 |
+
/* Status returns */
|
| 142 |
+
|
| 143 |
+
#define SQL_ERROR (-1)
|
| 144 |
+
#define SQL_NO_DATA 100
|
| 145 |
+
#define SQL_NO_TOTAL (-4)
|
| 146 |
+
#define SQL_SUCCESS 0
|
| 147 |
+
#define SQL_SUCCESS_WITH_INFO 1
|
| 148 |
+
#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
|
| 149 |
+
|
| 150 |
+
/* Diagnostic fields */
|
| 151 |
+
|
| 152 |
+
enum _SQL_DIAG {
|
| 153 |
+
SQL_DIAG_NUMBER = 2,
|
| 154 |
+
SQL_DIAG_SQLSTATE = 4
|
| 155 |
+
};
|
| 156 |
+
|
| 157 |
+
/* Transaction isolation levels */
|
| 158 |
+
|
| 159 |
+
#define SQL_TXN_READ_COMMITTED 2
|
| 160 |
+
#define SQL_TXN_READ_UNCOMMITTED 1
|
| 161 |
+
#define SQL_TXN_REPEATABLE_READ 4
|
| 162 |
+
#define SQL_TXN_SERIALIZABLE 8
|
| 163 |
+
|
| 164 |
+
/* Access modes */
|
| 165 |
+
|
| 166 |
+
#define SQL_MODE_READ_ONLY 1UL
|
| 167 |
+
#define SQL_MODE_READ_WRITE 0UL
|
| 168 |
+
|
| 169 |
+
/* ODBC properties */
|
| 170 |
+
|
| 171 |
+
#define SQL_ACCESS_MODE 101
|
| 172 |
+
#define SQL_AUTOCOMMIT 102
|
| 173 |
+
#define SQL_TXN_ISOLATION 108
|
| 174 |
+
|
| 175 |
+
/* ODBC attributes */
|
| 176 |
+
|
| 177 |
+
#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
|
| 178 |
+
#define SQL_ATTR_CONNECTION_TIMEOUT 113
|
| 179 |
+
#define SQL_ATTR_ODBC_VERSION 200
|
| 180 |
+
#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
|
| 181 |
+
#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
|
| 182 |
+
|
| 183 |
+
/* Nullable? */
|
| 184 |
+
|
| 185 |
+
#define SQL_NULLABLE_UNKNOWN 2
|
| 186 |
+
|
| 187 |
+
/* Placeholder for length of missing data */
|
| 188 |
+
|
| 189 |
+
#define SQL_NULL_DATA (-1)
|
| 190 |
+
|
| 191 |
+
/* ODBC versions */
|
| 192 |
+
|
| 193 |
+
#define SQL_OV_ODBC3 3UL
|
| 194 |
+
#define SQL_ODBC_VER 10
|
| 195 |
+
|
| 196 |
+
/* SQLDriverConnect flags */
|
| 197 |
+
|
| 198 |
+
#define SQL_DRIVER_COMPLETE_REQUIRED 3
|
| 199 |
+
#define SQL_DRIVER_NOPROMPT 0
|
| 200 |
+
|
| 201 |
+
/* SQLGetTypeInfo flags */
|
| 202 |
+
|
| 203 |
+
#define SQL_ALL_TYPES 0
|
| 204 |
+
|
| 205 |
+
/* Transaction actions */
|
| 206 |
+
|
| 207 |
+
#define SQL_COMMIT 0
|
| 208 |
+
#define SQL_ROLLBACK 1
|
| 209 |
+
|
| 210 |
+
/* Data source fetch flags */
|
| 211 |
+
|
| 212 |
+
#define SQL_FETCH_FIRST 2
|
| 213 |
+
#define SQL_FETCH_FIRST_SYSTEM 32
|
| 214 |
+
#define SQL_FETCH_FIRST_USER 31
|
| 215 |
+
#define SQL_FETCH_NEXT 1
|
| 216 |
+
|
| 217 |
+
/* ODBCINST actions */
|
| 218 |
+
|
| 219 |
+
#define ODBC_ADD_DSN 1
|
| 220 |
+
#define ODBC_CONFIG_DSN 2
|
| 221 |
+
#define ODBC_REMOVE_DSN 3
|
| 222 |
+
#define ODBC_ADD_SYS_DSN 4
|
| 223 |
+
#define ODBC_CONFIG_SYS_DSN 5
|
| 224 |
+
#define ODBC_REMOVE_SYS_DSN 6
|
| 225 |
+
|
| 226 |
+
/* ODBCINST errors */
|
| 227 |
+
|
| 228 |
+
#define ODBC_ERROR_GENERAL_ERR 1
|
| 229 |
+
#define ODBC_ERROR_INVALID_BUFF_LEN 2
|
| 230 |
+
#define ODBC_ERROR_INVALID_HWND 3
|
| 231 |
+
#define ODBC_ERROR_INVALID_STR 4
|
| 232 |
+
#define ODBC_ERROR_INVALID_REQUEST_TYPE 5
|
| 233 |
+
#define ODBC_ERROR_COMPONENT_NOT_FOUND 6
|
| 234 |
+
#define ODBC_ERROR_INVALID_NAME 7
|
| 235 |
+
#define ODBC_ERROR_INVALID_KEYWORD_VALUE 8
|
| 236 |
+
#define ODBC_ERROR_INVALID_DSN 9
|
| 237 |
+
#define ODBC_ERROR_INVALID_INF 10
|
| 238 |
+
#define ODBC_ERROR_REQUEST_FAILED 11
|
| 239 |
+
#define ODBC_ERROR_INVALID_PATH 12
|
| 240 |
+
#define ODBC_ERROR_LOAD_LIB_FAILED 13
|
| 241 |
+
#define ODBC_ERROR_INVALID_PARAM_SEQUENCE 14
|
| 242 |
+
#define ODBC_ERROR_INVALID_LOG_FILE 15
|
| 243 |
+
#define ODBC_ERROR_USER_CANCELED 16
|
| 244 |
+
#define ODBC_ERROR_USAGE_UPDATE_FAILED 17
|
| 245 |
+
#define ODBC_ERROR_CREATE_DSN_FAILED 18
|
| 246 |
+
#define ODBC_ERROR_WRITING_SYSINFO_FAILED 19
|
| 247 |
+
#define ODBC_ERROR_REMOVE_DSN_FAILED 20
|
| 248 |
+
#define ODBC_ERROR_OUT_OF_MEM 21
|
| 249 |
+
#define ODBC_ERROR_OUTPUT_STRING_TRUNCATED 22
|
| 250 |
+
|
| 251 |
+
/* ODBC client library entry points */
|
| 252 |
+
|
| 253 |
+
#ifdef _WIN32
|
| 254 |
+
#define SQL_API __stdcall
|
| 255 |
+
#define INSTAPI __stdcall
|
| 256 |
+
#else
|
| 257 |
+
#define SQL_API /* nothing */
|
| 258 |
+
#define INSTAPI /* nothing */
|
| 259 |
+
#endif
|
| 260 |
+
|
| 261 |
+
#include "odbcStubs.h"
|
| 262 |
+
MODULE_SCOPE const odbcStubDefs* odbcStubs;
|
| 263 |
+
|
| 264 |
+
/*
|
| 265 |
+
* Additional entry points in ODBCINST - all of these are optional
|
| 266 |
+
* and resolved with Tcl_FindSymbol, not directly in Tcl_LoadLibrary.
|
| 267 |
+
*/
|
| 268 |
+
|
| 269 |
+
MODULE_SCOPE BOOL (INSTAPI* SQLConfigDataSourceW)(HWND, WORD, LPCWSTR,
|
| 270 |
+
LPCWSTR);
|
| 271 |
+
MODULE_SCOPE BOOL (INSTAPI* SQLConfigDataSource)(HWND, WORD, LPCSTR, LPCSTR);
|
| 272 |
+
MODULE_SCOPE BOOL (INSTAPI* SQLInstallerErrorW)(WORD, DWORD*, LPWSTR, WORD,
|
| 273 |
+
WORD*);
|
| 274 |
+
MODULE_SCOPE BOOL (INSTAPI* SQLInstallerError)(WORD, DWORD*, LPSTR, WORD,
|
| 275 |
+
WORD*);
|
| 276 |
+
|
| 277 |
+
/*
|
| 278 |
+
* Function that initialises the stubs
|
| 279 |
+
*/
|
| 280 |
+
|
| 281 |
+
MODULE_SCOPE Tcl_LoadHandle OdbcInitStubs(Tcl_Interp*, Tcl_LoadHandle*);
|
| 282 |
+
|
| 283 |
+
#endif
|
deepseek/include/ffi.h
ADDED
|
@@ -0,0 +1,531 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* -----------------------------------------------------------------*-C-*-
|
| 2 |
+
libffi 3.4.4
|
| 3 |
+
- Copyright (c) 2011, 2014, 2019, 2021, 2022 Anthony Green
|
| 4 |
+
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
|
| 5 |
+
|
| 6 |
+
Permission is hereby granted, free of charge, to any person
|
| 7 |
+
obtaining a copy of this software and associated documentation
|
| 8 |
+
files (the ``Software''), to deal in the Software without
|
| 9 |
+
restriction, including without limitation the rights to use, copy,
|
| 10 |
+
modify, merge, publish, distribute, sublicense, and/or sell copies
|
| 11 |
+
of the Software, and to permit persons to whom the Software is
|
| 12 |
+
furnished to do so, subject to the following conditions:
|
| 13 |
+
|
| 14 |
+
The above copyright notice and this permission notice shall be
|
| 15 |
+
included in all copies or substantial portions of the Software.
|
| 16 |
+
|
| 17 |
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
| 18 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 19 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 20 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
| 21 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
| 22 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 23 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
| 24 |
+
DEALINGS IN THE SOFTWARE.
|
| 25 |
+
|
| 26 |
+
----------------------------------------------------------------------- */
|
| 27 |
+
|
| 28 |
+
/* -------------------------------------------------------------------
|
| 29 |
+
Most of the API is documented in doc/libffi.texi.
|
| 30 |
+
|
| 31 |
+
The raw API is designed to bypass some of the argument packing and
|
| 32 |
+
unpacking on architectures for which it can be avoided. Routines
|
| 33 |
+
are provided to emulate the raw API if the underlying platform
|
| 34 |
+
doesn't allow faster implementation.
|
| 35 |
+
|
| 36 |
+
More details on the raw API can be found in:
|
| 37 |
+
|
| 38 |
+
http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
|
| 39 |
+
|
| 40 |
+
and
|
| 41 |
+
|
| 42 |
+
http://gcc.gnu.org/ml/java/1999-q3/msg00174.html
|
| 43 |
+
-------------------------------------------------------------------- */
|
| 44 |
+
|
| 45 |
+
#ifndef LIBFFI_H
|
| 46 |
+
#define LIBFFI_H
|
| 47 |
+
|
| 48 |
+
#ifdef __cplusplus
|
| 49 |
+
extern "C" {
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
/* Specify which architecture libffi is configured for. */
|
| 53 |
+
#ifndef X86_64
|
| 54 |
+
#define X86_64
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
/* ---- System configuration information --------------------------------- */
|
| 58 |
+
|
| 59 |
+
/* If these change, update src/mips/ffitarget.h. */
|
| 60 |
+
#define FFI_TYPE_VOID 0
|
| 61 |
+
#define FFI_TYPE_INT 1
|
| 62 |
+
#define FFI_TYPE_FLOAT 2
|
| 63 |
+
#define FFI_TYPE_DOUBLE 3
|
| 64 |
+
#if 1
|
| 65 |
+
#define FFI_TYPE_LONGDOUBLE 4
|
| 66 |
+
#else
|
| 67 |
+
#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
|
| 68 |
+
#endif
|
| 69 |
+
#define FFI_TYPE_UINT8 5
|
| 70 |
+
#define FFI_TYPE_SINT8 6
|
| 71 |
+
#define FFI_TYPE_UINT16 7
|
| 72 |
+
#define FFI_TYPE_SINT16 8
|
| 73 |
+
#define FFI_TYPE_UINT32 9
|
| 74 |
+
#define FFI_TYPE_SINT32 10
|
| 75 |
+
#define FFI_TYPE_UINT64 11
|
| 76 |
+
#define FFI_TYPE_SINT64 12
|
| 77 |
+
#define FFI_TYPE_STRUCT 13
|
| 78 |
+
#define FFI_TYPE_POINTER 14
|
| 79 |
+
#define FFI_TYPE_COMPLEX 15
|
| 80 |
+
|
| 81 |
+
/* This should always refer to the last type code (for sanity checks). */
|
| 82 |
+
#define FFI_TYPE_LAST FFI_TYPE_COMPLEX
|
| 83 |
+
|
| 84 |
+
#include <ffitarget.h>
|
| 85 |
+
|
| 86 |
+
#ifndef LIBFFI_ASM
|
| 87 |
+
|
| 88 |
+
#if defined(_MSC_VER) && !defined(__clang__)
|
| 89 |
+
#define __attribute__(X)
|
| 90 |
+
#endif
|
| 91 |
+
|
| 92 |
+
#include <stddef.h>
|
| 93 |
+
#include <limits.h>
|
| 94 |
+
|
| 95 |
+
/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example).
|
| 96 |
+
But we can find it either under the correct ANSI name, or under GNU
|
| 97 |
+
C's internal name. */
|
| 98 |
+
|
| 99 |
+
#define FFI_64_BIT_MAX 9223372036854775807
|
| 100 |
+
|
| 101 |
+
#ifdef LONG_LONG_MAX
|
| 102 |
+
# define FFI_LONG_LONG_MAX LONG_LONG_MAX
|
| 103 |
+
#else
|
| 104 |
+
# ifdef LLONG_MAX
|
| 105 |
+
# define FFI_LONG_LONG_MAX LLONG_MAX
|
| 106 |
+
# ifdef _AIX52 /* or newer has C99 LLONG_MAX */
|
| 107 |
+
# undef FFI_64_BIT_MAX
|
| 108 |
+
# define FFI_64_BIT_MAX 9223372036854775807LL
|
| 109 |
+
# endif /* _AIX52 or newer */
|
| 110 |
+
# else
|
| 111 |
+
# ifdef __GNUC__
|
| 112 |
+
# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
|
| 113 |
+
# endif
|
| 114 |
+
# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */
|
| 115 |
+
# ifndef __PPC64__
|
| 116 |
+
# if defined (__IBMC__) || defined (__IBMCPP__)
|
| 117 |
+
# define FFI_LONG_LONG_MAX LONGLONG_MAX
|
| 118 |
+
# endif
|
| 119 |
+
# endif /* __PPC64__ */
|
| 120 |
+
# undef FFI_64_BIT_MAX
|
| 121 |
+
# define FFI_64_BIT_MAX 9223372036854775807LL
|
| 122 |
+
# endif
|
| 123 |
+
# endif
|
| 124 |
+
#endif
|
| 125 |
+
|
| 126 |
+
/* The closure code assumes that this works on pointers, i.e. a size_t
|
| 127 |
+
can hold a pointer. */
|
| 128 |
+
|
| 129 |
+
typedef struct _ffi_type
|
| 130 |
+
{
|
| 131 |
+
size_t size;
|
| 132 |
+
unsigned short alignment;
|
| 133 |
+
unsigned short type;
|
| 134 |
+
struct _ffi_type **elements;
|
| 135 |
+
} ffi_type;
|
| 136 |
+
|
| 137 |
+
/* Need minimal decorations for DLLs to work on Windows. GCC has
|
| 138 |
+
autoimport and autoexport. Always mark externally visible symbols
|
| 139 |
+
as dllimport for MSVC clients, even if it means an extra indirection
|
| 140 |
+
when using the static version of the library.
|
| 141 |
+
Besides, as a workaround, they can define FFI_BUILDING if they
|
| 142 |
+
*know* they are going to link with the static library. */
|
| 143 |
+
#if defined _MSC_VER
|
| 144 |
+
# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */
|
| 145 |
+
# define FFI_API __declspec(dllexport)
|
| 146 |
+
# elif !defined FFI_BUILDING /* Importing libffi.DLL */
|
| 147 |
+
# define FFI_API __declspec(dllimport)
|
| 148 |
+
# else /* Building/linking static library */
|
| 149 |
+
# define FFI_API
|
| 150 |
+
# endif
|
| 151 |
+
#else
|
| 152 |
+
# define FFI_API
|
| 153 |
+
#endif
|
| 154 |
+
|
| 155 |
+
/* The externally visible type declarations also need the MSVC DLL
|
| 156 |
+
decorations, or they will not be exported from the object file. */
|
| 157 |
+
#if defined LIBFFI_HIDE_BASIC_TYPES
|
| 158 |
+
# define FFI_EXTERN FFI_API
|
| 159 |
+
#else
|
| 160 |
+
# define FFI_EXTERN extern FFI_API
|
| 161 |
+
#endif
|
| 162 |
+
|
| 163 |
+
#ifndef LIBFFI_HIDE_BASIC_TYPES
|
| 164 |
+
#if SCHAR_MAX == 127
|
| 165 |
+
# define ffi_type_uchar ffi_type_uint8
|
| 166 |
+
# define ffi_type_schar ffi_type_sint8
|
| 167 |
+
#else
|
| 168 |
+
#error "char size not supported"
|
| 169 |
+
#endif
|
| 170 |
+
|
| 171 |
+
#if SHRT_MAX == 32767
|
| 172 |
+
# define ffi_type_ushort ffi_type_uint16
|
| 173 |
+
# define ffi_type_sshort ffi_type_sint16
|
| 174 |
+
#elif SHRT_MAX == 2147483647
|
| 175 |
+
# define ffi_type_ushort ffi_type_uint32
|
| 176 |
+
# define ffi_type_sshort ffi_type_sint32
|
| 177 |
+
#else
|
| 178 |
+
#error "short size not supported"
|
| 179 |
+
#endif
|
| 180 |
+
|
| 181 |
+
#if INT_MAX == 32767
|
| 182 |
+
# define ffi_type_uint ffi_type_uint16
|
| 183 |
+
# define ffi_type_sint ffi_type_sint16
|
| 184 |
+
#elif INT_MAX == 2147483647
|
| 185 |
+
# define ffi_type_uint ffi_type_uint32
|
| 186 |
+
# define ffi_type_sint ffi_type_sint32
|
| 187 |
+
#elif INT_MAX == 9223372036854775807
|
| 188 |
+
# define ffi_type_uint ffi_type_uint64
|
| 189 |
+
# define ffi_type_sint ffi_type_sint64
|
| 190 |
+
#else
|
| 191 |
+
#error "int size not supported"
|
| 192 |
+
#endif
|
| 193 |
+
|
| 194 |
+
#if LONG_MAX == 2147483647
|
| 195 |
+
# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX
|
| 196 |
+
#error "no 64-bit data type supported"
|
| 197 |
+
# endif
|
| 198 |
+
#elif LONG_MAX != FFI_64_BIT_MAX
|
| 199 |
+
#error "long size not supported"
|
| 200 |
+
#endif
|
| 201 |
+
|
| 202 |
+
#if LONG_MAX == 2147483647
|
| 203 |
+
# define ffi_type_ulong ffi_type_uint32
|
| 204 |
+
# define ffi_type_slong ffi_type_sint32
|
| 205 |
+
#elif LONG_MAX == FFI_64_BIT_MAX
|
| 206 |
+
# define ffi_type_ulong ffi_type_uint64
|
| 207 |
+
# define ffi_type_slong ffi_type_sint64
|
| 208 |
+
#else
|
| 209 |
+
#error "long size not supported"
|
| 210 |
+
#endif
|
| 211 |
+
|
| 212 |
+
/* These are defined in types.c. */
|
| 213 |
+
FFI_EXTERN ffi_type ffi_type_void;
|
| 214 |
+
FFI_EXTERN ffi_type ffi_type_uint8;
|
| 215 |
+
FFI_EXTERN ffi_type ffi_type_sint8;
|
| 216 |
+
FFI_EXTERN ffi_type ffi_type_uint16;
|
| 217 |
+
FFI_EXTERN ffi_type ffi_type_sint16;
|
| 218 |
+
FFI_EXTERN ffi_type ffi_type_uint32;
|
| 219 |
+
FFI_EXTERN ffi_type ffi_type_sint32;
|
| 220 |
+
FFI_EXTERN ffi_type ffi_type_uint64;
|
| 221 |
+
FFI_EXTERN ffi_type ffi_type_sint64;
|
| 222 |
+
FFI_EXTERN ffi_type ffi_type_float;
|
| 223 |
+
FFI_EXTERN ffi_type ffi_type_double;
|
| 224 |
+
FFI_EXTERN ffi_type ffi_type_pointer;
|
| 225 |
+
|
| 226 |
+
#if 1
|
| 227 |
+
FFI_EXTERN ffi_type ffi_type_longdouble;
|
| 228 |
+
#else
|
| 229 |
+
#define ffi_type_longdouble ffi_type_double
|
| 230 |
+
#endif
|
| 231 |
+
|
| 232 |
+
#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
|
| 233 |
+
FFI_EXTERN ffi_type ffi_type_complex_float;
|
| 234 |
+
FFI_EXTERN ffi_type ffi_type_complex_double;
|
| 235 |
+
#if 1
|
| 236 |
+
FFI_EXTERN ffi_type ffi_type_complex_longdouble;
|
| 237 |
+
#else
|
| 238 |
+
#define ffi_type_complex_longdouble ffi_type_complex_double
|
| 239 |
+
#endif
|
| 240 |
+
#endif
|
| 241 |
+
#endif /* LIBFFI_HIDE_BASIC_TYPES */
|
| 242 |
+
|
| 243 |
+
typedef enum {
|
| 244 |
+
FFI_OK = 0,
|
| 245 |
+
FFI_BAD_TYPEDEF,
|
| 246 |
+
FFI_BAD_ABI,
|
| 247 |
+
FFI_BAD_ARGTYPE
|
| 248 |
+
} ffi_status;
|
| 249 |
+
|
| 250 |
+
typedef struct {
|
| 251 |
+
ffi_abi abi;
|
| 252 |
+
unsigned nargs;
|
| 253 |
+
ffi_type **arg_types;
|
| 254 |
+
ffi_type *rtype;
|
| 255 |
+
unsigned bytes;
|
| 256 |
+
unsigned flags;
|
| 257 |
+
#ifdef FFI_EXTRA_CIF_FIELDS
|
| 258 |
+
FFI_EXTRA_CIF_FIELDS;
|
| 259 |
+
#endif
|
| 260 |
+
} ffi_cif;
|
| 261 |
+
|
| 262 |
+
/* ---- Definitions for the raw API -------------------------------------- */
|
| 263 |
+
|
| 264 |
+
#ifndef FFI_SIZEOF_ARG
|
| 265 |
+
# if LONG_MAX == 2147483647
|
| 266 |
+
# define FFI_SIZEOF_ARG 4
|
| 267 |
+
# elif LONG_MAX == FFI_64_BIT_MAX
|
| 268 |
+
# define FFI_SIZEOF_ARG 8
|
| 269 |
+
# endif
|
| 270 |
+
#endif
|
| 271 |
+
|
| 272 |
+
#ifndef FFI_SIZEOF_JAVA_RAW
|
| 273 |
+
# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG
|
| 274 |
+
#endif
|
| 275 |
+
|
| 276 |
+
typedef union {
|
| 277 |
+
ffi_sarg sint;
|
| 278 |
+
ffi_arg uint;
|
| 279 |
+
float flt;
|
| 280 |
+
char data[FFI_SIZEOF_ARG];
|
| 281 |
+
void* ptr;
|
| 282 |
+
} ffi_raw;
|
| 283 |
+
|
| 284 |
+
#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8
|
| 285 |
+
/* This is a special case for mips64/n32 ABI (and perhaps others) where
|
| 286 |
+
sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */
|
| 287 |
+
typedef union {
|
| 288 |
+
signed int sint;
|
| 289 |
+
unsigned int uint;
|
| 290 |
+
float flt;
|
| 291 |
+
char data[FFI_SIZEOF_JAVA_RAW];
|
| 292 |
+
void* ptr;
|
| 293 |
+
} ffi_java_raw;
|
| 294 |
+
#else
|
| 295 |
+
typedef ffi_raw ffi_java_raw;
|
| 296 |
+
#endif
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
FFI_API
|
| 300 |
+
void ffi_raw_call (ffi_cif *cif,
|
| 301 |
+
void (*fn)(void),
|
| 302 |
+
void *rvalue,
|
| 303 |
+
ffi_raw *avalue);
|
| 304 |
+
|
| 305 |
+
FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
|
| 306 |
+
FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
|
| 307 |
+
FFI_API size_t ffi_raw_size (ffi_cif *cif);
|
| 308 |
+
|
| 309 |
+
/* This is analogous to the raw API, except it uses Java parameter
|
| 310 |
+
packing, even on 64-bit machines. I.e. on 64-bit machines longs
|
| 311 |
+
and doubles are followed by an empty 64-bit word. */
|
| 312 |
+
|
| 313 |
+
#if !FFI_NATIVE_RAW_API
|
| 314 |
+
FFI_API
|
| 315 |
+
void ffi_java_raw_call (ffi_cif *cif,
|
| 316 |
+
void (*fn)(void),
|
| 317 |
+
void *rvalue,
|
| 318 |
+
ffi_java_raw *avalue) __attribute__((deprecated));
|
| 319 |
+
#endif
|
| 320 |
+
|
| 321 |
+
FFI_API
|
| 322 |
+
void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
|
| 323 |
+
FFI_API
|
| 324 |
+
void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated));
|
| 325 |
+
FFI_API
|
| 326 |
+
size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
|
| 327 |
+
|
| 328 |
+
/* ---- Definitions for closures ----------------------------------------- */
|
| 329 |
+
|
| 330 |
+
#if FFI_CLOSURES
|
| 331 |
+
|
| 332 |
+
#ifdef _MSC_VER
|
| 333 |
+
__declspec(align(8))
|
| 334 |
+
#endif
|
| 335 |
+
typedef struct {
|
| 336 |
+
#if 0
|
| 337 |
+
void *trampoline_table;
|
| 338 |
+
void *trampoline_table_entry;
|
| 339 |
+
#else
|
| 340 |
+
union {
|
| 341 |
+
char tramp[FFI_TRAMPOLINE_SIZE];
|
| 342 |
+
void *ftramp;
|
| 343 |
+
};
|
| 344 |
+
#endif
|
| 345 |
+
ffi_cif *cif;
|
| 346 |
+
void (*fun)(ffi_cif*,void*,void**,void*);
|
| 347 |
+
void *user_data;
|
| 348 |
+
#if defined(_MSC_VER) && defined(_M_IX86)
|
| 349 |
+
void *padding;
|
| 350 |
+
#endif
|
| 351 |
+
} ffi_closure
|
| 352 |
+
#ifdef __GNUC__
|
| 353 |
+
__attribute__((aligned (8)))
|
| 354 |
+
#endif
|
| 355 |
+
;
|
| 356 |
+
|
| 357 |
+
#ifndef __GNUC__
|
| 358 |
+
# ifdef __sgi
|
| 359 |
+
# pragma pack 0
|
| 360 |
+
# endif
|
| 361 |
+
#endif
|
| 362 |
+
|
| 363 |
+
FFI_API void *ffi_closure_alloc (size_t size, void **code);
|
| 364 |
+
FFI_API void ffi_closure_free (void *);
|
| 365 |
+
|
| 366 |
+
#if defined(PA_LINUX) || defined(PA_HPUX)
|
| 367 |
+
#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
|
| 368 |
+
#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
|
| 369 |
+
#else
|
| 370 |
+
#define FFI_CLOSURE_PTR(X) (X)
|
| 371 |
+
#define FFI_RESTORE_PTR(X) (X)
|
| 372 |
+
#endif
|
| 373 |
+
|
| 374 |
+
FFI_API ffi_status
|
| 375 |
+
ffi_prep_closure (ffi_closure*,
|
| 376 |
+
ffi_cif *,
|
| 377 |
+
void (*fun)(ffi_cif*,void*,void**,void*),
|
| 378 |
+
void *user_data)
|
| 379 |
+
#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405)
|
| 380 |
+
__attribute__((deprecated ("use ffi_prep_closure_loc instead")))
|
| 381 |
+
#elif defined(__GNUC__) && __GNUC__ >= 3
|
| 382 |
+
__attribute__((deprecated))
|
| 383 |
+
#endif
|
| 384 |
+
;
|
| 385 |
+
|
| 386 |
+
FFI_API ffi_status
|
| 387 |
+
ffi_prep_closure_loc (ffi_closure*,
|
| 388 |
+
ffi_cif *,
|
| 389 |
+
void (*fun)(ffi_cif*,void*,void**,void*),
|
| 390 |
+
void *user_data,
|
| 391 |
+
void *codeloc);
|
| 392 |
+
|
| 393 |
+
#ifdef __sgi
|
| 394 |
+
# pragma pack 8
|
| 395 |
+
#endif
|
| 396 |
+
typedef struct {
|
| 397 |
+
#if 0
|
| 398 |
+
void *trampoline_table;
|
| 399 |
+
void *trampoline_table_entry;
|
| 400 |
+
#else
|
| 401 |
+
char tramp[FFI_TRAMPOLINE_SIZE];
|
| 402 |
+
#endif
|
| 403 |
+
ffi_cif *cif;
|
| 404 |
+
|
| 405 |
+
#if !FFI_NATIVE_RAW_API
|
| 406 |
+
|
| 407 |
+
/* If this is enabled, then a raw closure has the same layout
|
| 408 |
+
as a regular closure. We use this to install an intermediate
|
| 409 |
+
handler to do the translation, void** -> ffi_raw*. */
|
| 410 |
+
|
| 411 |
+
void (*translate_args)(ffi_cif*,void*,void**,void*);
|
| 412 |
+
void *this_closure;
|
| 413 |
+
|
| 414 |
+
#endif
|
| 415 |
+
|
| 416 |
+
void (*fun)(ffi_cif*,void*,ffi_raw*,void*);
|
| 417 |
+
void *user_data;
|
| 418 |
+
|
| 419 |
+
} ffi_raw_closure;
|
| 420 |
+
|
| 421 |
+
typedef struct {
|
| 422 |
+
#if 0
|
| 423 |
+
void *trampoline_table;
|
| 424 |
+
void *trampoline_table_entry;
|
| 425 |
+
#else
|
| 426 |
+
char tramp[FFI_TRAMPOLINE_SIZE];
|
| 427 |
+
#endif
|
| 428 |
+
|
| 429 |
+
ffi_cif *cif;
|
| 430 |
+
|
| 431 |
+
#if !FFI_NATIVE_RAW_API
|
| 432 |
+
|
| 433 |
+
/* If this is enabled, then a raw closure has the same layout
|
| 434 |
+
as a regular closure. We use this to install an intermediate
|
| 435 |
+
handler to do the translation, void** -> ffi_raw*. */
|
| 436 |
+
|
| 437 |
+
void (*translate_args)(ffi_cif*,void*,void**,void*);
|
| 438 |
+
void *this_closure;
|
| 439 |
+
|
| 440 |
+
#endif
|
| 441 |
+
|
| 442 |
+
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*);
|
| 443 |
+
void *user_data;
|
| 444 |
+
|
| 445 |
+
} ffi_java_raw_closure;
|
| 446 |
+
|
| 447 |
+
FFI_API ffi_status
|
| 448 |
+
ffi_prep_raw_closure (ffi_raw_closure*,
|
| 449 |
+
ffi_cif *cif,
|
| 450 |
+
void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
|
| 451 |
+
void *user_data);
|
| 452 |
+
|
| 453 |
+
FFI_API ffi_status
|
| 454 |
+
ffi_prep_raw_closure_loc (ffi_raw_closure*,
|
| 455 |
+
ffi_cif *cif,
|
| 456 |
+
void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
|
| 457 |
+
void *user_data,
|
| 458 |
+
void *codeloc);
|
| 459 |
+
|
| 460 |
+
#if !FFI_NATIVE_RAW_API
|
| 461 |
+
FFI_API ffi_status
|
| 462 |
+
ffi_prep_java_raw_closure (ffi_java_raw_closure*,
|
| 463 |
+
ffi_cif *cif,
|
| 464 |
+
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
|
| 465 |
+
void *user_data) __attribute__((deprecated));
|
| 466 |
+
|
| 467 |
+
FFI_API ffi_status
|
| 468 |
+
ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
|
| 469 |
+
ffi_cif *cif,
|
| 470 |
+
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
|
| 471 |
+
void *user_data,
|
| 472 |
+
void *codeloc) __attribute__((deprecated));
|
| 473 |
+
#endif
|
| 474 |
+
|
| 475 |
+
#endif /* FFI_CLOSURES */
|
| 476 |
+
|
| 477 |
+
#if FFI_GO_CLOSURES
|
| 478 |
+
|
| 479 |
+
typedef struct {
|
| 480 |
+
void *tramp;
|
| 481 |
+
ffi_cif *cif;
|
| 482 |
+
void (*fun)(ffi_cif*,void*,void**,void*);
|
| 483 |
+
} ffi_go_closure;
|
| 484 |
+
|
| 485 |
+
FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *,
|
| 486 |
+
void (*fun)(ffi_cif*,void*,void**,void*));
|
| 487 |
+
|
| 488 |
+
FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
| 489 |
+
void **avalue, void *closure);
|
| 490 |
+
|
| 491 |
+
#endif /* FFI_GO_CLOSURES */
|
| 492 |
+
|
| 493 |
+
/* ---- Public interface definition -------------------------------------- */
|
| 494 |
+
|
| 495 |
+
FFI_API
|
| 496 |
+
ffi_status ffi_prep_cif(ffi_cif *cif,
|
| 497 |
+
ffi_abi abi,
|
| 498 |
+
unsigned int nargs,
|
| 499 |
+
ffi_type *rtype,
|
| 500 |
+
ffi_type **atypes);
|
| 501 |
+
|
| 502 |
+
FFI_API
|
| 503 |
+
ffi_status ffi_prep_cif_var(ffi_cif *cif,
|
| 504 |
+
ffi_abi abi,
|
| 505 |
+
unsigned int nfixedargs,
|
| 506 |
+
unsigned int ntotalargs,
|
| 507 |
+
ffi_type *rtype,
|
| 508 |
+
ffi_type **atypes);
|
| 509 |
+
|
| 510 |
+
FFI_API
|
| 511 |
+
void ffi_call(ffi_cif *cif,
|
| 512 |
+
void (*fn)(void),
|
| 513 |
+
void *rvalue,
|
| 514 |
+
void **avalue);
|
| 515 |
+
|
| 516 |
+
FFI_API
|
| 517 |
+
ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
|
| 518 |
+
size_t *offsets);
|
| 519 |
+
|
| 520 |
+
/* Useful for eliminating compiler warnings. */
|
| 521 |
+
#define FFI_FN(f) ((void (*)(void))f)
|
| 522 |
+
|
| 523 |
+
/* ---- Definitions shared with assembly code ---------------------------- */
|
| 524 |
+
|
| 525 |
+
#endif
|
| 526 |
+
|
| 527 |
+
#ifdef __cplusplus
|
| 528 |
+
}
|
| 529 |
+
#endif
|
| 530 |
+
|
| 531 |
+
#endif
|
deepseek/include/ffitarget.h
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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| 4 |
+
Copyright (C) 2008 Free Software Foundation, Inc.
|
| 5 |
+
|
| 6 |
+
Target configuration macros for x86 and x86-64.
|
| 7 |
+
|
| 8 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 9 |
+
a copy of this software and associated documentation files (the
|
| 10 |
+
``Software''), to deal in the Software without restriction, including
|
| 11 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 12 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 13 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 14 |
+
the following conditions:
|
| 15 |
+
|
| 16 |
+
The above copyright notice and this permission notice shall be included
|
| 17 |
+
in all copies or substantial portions of the Software.
|
| 18 |
+
|
| 19 |
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
| 20 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 21 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 22 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
| 23 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
| 24 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
| 26 |
+
DEALINGS IN THE SOFTWARE.
|
| 27 |
+
|
| 28 |
+
----------------------------------------------------------------------- */
|
| 29 |
+
|
| 30 |
+
#ifndef LIBFFI_TARGET_H
|
| 31 |
+
#define LIBFFI_TARGET_H
|
| 32 |
+
|
| 33 |
+
#ifndef LIBFFI_H
|
| 34 |
+
#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
/* ---- System specific configurations ----------------------------------- */
|
| 38 |
+
|
| 39 |
+
/* For code common to all platforms on x86 and x86_64. */
|
| 40 |
+
#define X86_ANY
|
| 41 |
+
|
| 42 |
+
#if defined (X86_64) && defined (__i386__)
|
| 43 |
+
#undef X86_64
|
| 44 |
+
#warning ******************************************************
|
| 45 |
+
#warning ********** X86 IS DEFINED ****************************
|
| 46 |
+
#warning ******************************************************
|
| 47 |
+
#define X86
|
| 48 |
+
#endif
|
| 49 |
+
|
| 50 |
+
#ifdef X86_WIN64
|
| 51 |
+
#define FFI_SIZEOF_ARG 8
|
| 52 |
+
#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
|
| 56 |
+
#ifndef _MSC_VER
|
| 57 |
+
#define FFI_TARGET_HAS_COMPLEX_TYPE
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
/* ---- Generic type definitions ----------------------------------------- */
|
| 61 |
+
|
| 62 |
+
#ifndef LIBFFI_ASM
|
| 63 |
+
#ifdef X86_WIN64
|
| 64 |
+
#ifdef _MSC_VER
|
| 65 |
+
typedef unsigned __int64 ffi_arg;
|
| 66 |
+
typedef __int64 ffi_sarg;
|
| 67 |
+
#else
|
| 68 |
+
typedef unsigned long long ffi_arg;
|
| 69 |
+
typedef long long ffi_sarg;
|
| 70 |
+
#endif
|
| 71 |
+
#else
|
| 72 |
+
#if defined __x86_64__ && defined __ILP32__
|
| 73 |
+
#define FFI_SIZEOF_ARG 8
|
| 74 |
+
#define FFI_SIZEOF_JAVA_RAW 4
|
| 75 |
+
typedef unsigned long long ffi_arg;
|
| 76 |
+
typedef long long ffi_sarg;
|
| 77 |
+
#else
|
| 78 |
+
typedef unsigned long ffi_arg;
|
| 79 |
+
typedef signed long ffi_sarg;
|
| 80 |
+
#endif
|
| 81 |
+
#endif
|
| 82 |
+
|
| 83 |
+
typedef enum ffi_abi {
|
| 84 |
+
#if defined(X86_WIN64)
|
| 85 |
+
FFI_FIRST_ABI = 0,
|
| 86 |
+
FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */
|
| 87 |
+
FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */
|
| 88 |
+
FFI_LAST_ABI,
|
| 89 |
+
#ifdef __GNUC__
|
| 90 |
+
FFI_DEFAULT_ABI = FFI_GNUW64
|
| 91 |
+
#else
|
| 92 |
+
FFI_DEFAULT_ABI = FFI_WIN64
|
| 93 |
+
#endif
|
| 94 |
+
|
| 95 |
+
#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
|
| 96 |
+
FFI_FIRST_ABI = 1,
|
| 97 |
+
FFI_UNIX64,
|
| 98 |
+
FFI_WIN64,
|
| 99 |
+
FFI_EFI64 = FFI_WIN64,
|
| 100 |
+
FFI_GNUW64,
|
| 101 |
+
FFI_LAST_ABI,
|
| 102 |
+
FFI_DEFAULT_ABI = FFI_UNIX64
|
| 103 |
+
|
| 104 |
+
#elif defined(X86_WIN32)
|
| 105 |
+
FFI_FIRST_ABI = 0,
|
| 106 |
+
FFI_SYSV = 1,
|
| 107 |
+
FFI_STDCALL = 2,
|
| 108 |
+
FFI_THISCALL = 3,
|
| 109 |
+
FFI_FASTCALL = 4,
|
| 110 |
+
FFI_MS_CDECL = 5,
|
| 111 |
+
FFI_PASCAL = 6,
|
| 112 |
+
FFI_REGISTER = 7,
|
| 113 |
+
FFI_LAST_ABI,
|
| 114 |
+
FFI_DEFAULT_ABI = FFI_MS_CDECL
|
| 115 |
+
#else
|
| 116 |
+
FFI_FIRST_ABI = 0,
|
| 117 |
+
FFI_SYSV = 1,
|
| 118 |
+
FFI_THISCALL = 3,
|
| 119 |
+
FFI_FASTCALL = 4,
|
| 120 |
+
FFI_STDCALL = 5,
|
| 121 |
+
FFI_PASCAL = 6,
|
| 122 |
+
FFI_REGISTER = 7,
|
| 123 |
+
FFI_MS_CDECL = 8,
|
| 124 |
+
FFI_LAST_ABI,
|
| 125 |
+
FFI_DEFAULT_ABI = FFI_SYSV
|
| 126 |
+
#endif
|
| 127 |
+
} ffi_abi;
|
| 128 |
+
#endif
|
| 129 |
+
|
| 130 |
+
/* ---- Definitions for closures ----------------------------------------- */
|
| 131 |
+
|
| 132 |
+
#define FFI_CLOSURES 1
|
| 133 |
+
#define FFI_GO_CLOSURES 1
|
| 134 |
+
|
| 135 |
+
#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
|
| 136 |
+
#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
|
| 137 |
+
#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
|
| 138 |
+
#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4)
|
| 139 |
+
|
| 140 |
+
#if defined (X86_64) || defined(X86_WIN64) \
|
| 141 |
+
|| (defined (__x86_64__) && defined (X86_DARWIN))
|
| 142 |
+
/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP
|
| 143 |
+
+ 8 bytes of pointer. */
|
| 144 |
+
# define FFI_TRAMPOLINE_SIZE 32
|
| 145 |
+
# define FFI_NATIVE_RAW_API 0
|
| 146 |
+
#else
|
| 147 |
+
/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused
|
| 148 |
+
bytes. */
|
| 149 |
+
# define FFI_TRAMPOLINE_SIZE 16
|
| 150 |
+
# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
|
| 151 |
+
#endif
|
| 152 |
+
|
| 153 |
+
#if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__)
|
| 154 |
+
# include <cet.h>
|
| 155 |
+
# if (__CET__ & 1) != 0
|
| 156 |
+
# define ENDBR_PRESENT
|
| 157 |
+
# endif
|
| 158 |
+
# define _CET_NOTRACK notrack
|
| 159 |
+
#else
|
| 160 |
+
# define _CET_ENDBR
|
| 161 |
+
# define _CET_NOTRACK
|
| 162 |
+
#endif
|
| 163 |
+
|
| 164 |
+
#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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2018-2019-2020,2021 Thomas E. Dickey *
|
| 3 |
+
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Juergen Pfeifer, 1995,1997 *
|
| 32 |
+
****************************************************************************/
|
| 33 |
+
|
| 34 |
+
/* $Id: form.h,v 0.32 2021/06/17 21:26:02 tom Exp $ */
|
| 35 |
+
|
| 36 |
+
#ifndef FORM_H
|
| 37 |
+
#define FORM_H
|
| 38 |
+
/* *INDENT-OFF*/
|
| 39 |
+
|
| 40 |
+
#include <ncursesw/curses.h>
|
| 41 |
+
#include <ncursesw/eti.h>
|
| 42 |
+
|
| 43 |
+
#ifdef __cplusplus
|
| 44 |
+
extern "C" {
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
#if defined(BUILDING_FORM)
|
| 48 |
+
# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
|
| 49 |
+
#else
|
| 50 |
+
# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
#define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
|
| 54 |
+
|
| 55 |
+
#define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API
|
| 56 |
+
#define FORM_EXPORT_VAR(type) FORM_IMPEXP type
|
| 57 |
+
|
| 58 |
+
#ifndef FORM_PRIV_H
|
| 59 |
+
typedef void *FIELD_CELL;
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
#ifndef NCURSES_FIELD_INTERNALS
|
| 63 |
+
#define NCURSES_FIELD_INTERNALS /* nothing */
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
typedef int Form_Options;
|
| 67 |
+
typedef int Field_Options;
|
| 68 |
+
|
| 69 |
+
/**********
|
| 70 |
+
* _PAGE *
|
| 71 |
+
**********/
|
| 72 |
+
|
| 73 |
+
typedef struct pagenode
|
| 74 |
+
#if !NCURSES_OPAQUE_FORM
|
| 75 |
+
{
|
| 76 |
+
short pmin; /* index of first field on page */
|
| 77 |
+
short pmax; /* index of last field on page */
|
| 78 |
+
short smin; /* index of top leftmost field on page */
|
| 79 |
+
short smax; /* index of bottom rightmost field on page */
|
| 80 |
+
}
|
| 81 |
+
#endif /* !NCURSES_OPAQUE_FORM */
|
| 82 |
+
_PAGE;
|
| 83 |
+
|
| 84 |
+
/**********
|
| 85 |
+
* FIELD *
|
| 86 |
+
**********/
|
| 87 |
+
|
| 88 |
+
typedef struct fieldnode
|
| 89 |
+
#if 1 /* not yet: !NCURSES_OPAQUE_FORM */
|
| 90 |
+
{
|
| 91 |
+
unsigned short status; /* flags */
|
| 92 |
+
short rows; /* size in rows */
|
| 93 |
+
short cols; /* size in cols */
|
| 94 |
+
short frow; /* first row */
|
| 95 |
+
short fcol; /* first col */
|
| 96 |
+
int drows; /* dynamic rows */
|
| 97 |
+
int dcols; /* dynamic cols */
|
| 98 |
+
int maxgrow; /* maximum field growth */
|
| 99 |
+
int nrow; /* off-screen rows */
|
| 100 |
+
short nbuf; /* additional buffers */
|
| 101 |
+
short just; /* justification */
|
| 102 |
+
short page; /* page on form */
|
| 103 |
+
short index; /* into form -> field */
|
| 104 |
+
int pad; /* pad character */
|
| 105 |
+
chtype fore; /* foreground attribute */
|
| 106 |
+
chtype back; /* background attribute */
|
| 107 |
+
Field_Options opts; /* options */
|
| 108 |
+
struct fieldnode * snext; /* sorted order pointer */
|
| 109 |
+
struct fieldnode * sprev; /* sorted order pointer */
|
| 110 |
+
struct fieldnode * link; /* linked field chain */
|
| 111 |
+
struct formnode * form; /* containing form */
|
| 112 |
+
struct typenode * type; /* field type */
|
| 113 |
+
void * arg; /* argument for type */
|
| 114 |
+
FIELD_CELL * buf; /* field buffers */
|
| 115 |
+
void * usrptr; /* user pointer */
|
| 116 |
+
/*
|
| 117 |
+
* The wide-character configuration requires extra information. Because
|
| 118 |
+
* there are existing applications that manipulate the members of FIELD
|
| 119 |
+
* directly, we cannot make the struct opaque, except by changing the ABI.
|
| 120 |
+
* Offsets of members up to this point are the same in the narrow- and
|
| 121 |
+
* wide-character configuration. But note that the type of buf depends on
|
| 122 |
+
* the configuration, and is made opaque for that reason.
|
| 123 |
+
*/
|
| 124 |
+
NCURSES_FIELD_INTERNALS
|
| 125 |
+
}
|
| 126 |
+
#endif /* NCURSES_OPAQUE_FORM */
|
| 127 |
+
FIELD;
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
/*********
|
| 131 |
+
* FORM *
|
| 132 |
+
*********/
|
| 133 |
+
|
| 134 |
+
typedef struct formnode
|
| 135 |
+
#if 1 /* not yet: !NCURSES_OPAQUE_FORM */
|
| 136 |
+
{
|
| 137 |
+
unsigned short status; /* flags */
|
| 138 |
+
short rows; /* size in rows */
|
| 139 |
+
short cols; /* size in cols */
|
| 140 |
+
int currow; /* current row in field window */
|
| 141 |
+
int curcol; /* current col in field window */
|
| 142 |
+
int toprow; /* in scrollable field window */
|
| 143 |
+
int begincol; /* in horiz. scrollable field */
|
| 144 |
+
short maxfield; /* number of fields */
|
| 145 |
+
short maxpage; /* number of pages */
|
| 146 |
+
short curpage; /* index into page */
|
| 147 |
+
Form_Options opts; /* options */
|
| 148 |
+
WINDOW * win; /* window */
|
| 149 |
+
WINDOW * sub; /* subwindow */
|
| 150 |
+
WINDOW * w; /* window for current field */
|
| 151 |
+
FIELD ** field; /* field [maxfield] */
|
| 152 |
+
FIELD * current; /* current field */
|
| 153 |
+
_PAGE * page; /* page [maxpage] */
|
| 154 |
+
void * usrptr; /* user pointer */
|
| 155 |
+
|
| 156 |
+
void (*forminit)(struct formnode *);
|
| 157 |
+
void (*formterm)(struct formnode *);
|
| 158 |
+
void (*fieldinit)(struct formnode *);
|
| 159 |
+
void (*fieldterm)(struct formnode *);
|
| 160 |
+
|
| 161 |
+
}
|
| 162 |
+
#endif /* !NCURSES_OPAQUE_FORM */
|
| 163 |
+
FORM;
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
/**************
|
| 167 |
+
* FIELDTYPE *
|
| 168 |
+
**************/
|
| 169 |
+
|
| 170 |
+
typedef struct typenode
|
| 171 |
+
#if !NCURSES_OPAQUE_FORM
|
| 172 |
+
{
|
| 173 |
+
unsigned short status; /* flags */
|
| 174 |
+
long ref; /* reference count */
|
| 175 |
+
struct typenode * left; /* ptr to operand for | */
|
| 176 |
+
struct typenode * right; /* ptr to operand for | */
|
| 177 |
+
|
| 178 |
+
void* (*makearg)(va_list *); /* make fieldtype arg */
|
| 179 |
+
void* (*copyarg)(const void *); /* copy fieldtype arg */
|
| 180 |
+
void (*freearg)(void *); /* free fieldtype arg */
|
| 181 |
+
|
| 182 |
+
#if NCURSES_INTEROP_FUNCS
|
| 183 |
+
union {
|
| 184 |
+
bool (*ofcheck)(FIELD *,const void *); /* field validation */
|
| 185 |
+
bool (*gfcheck)(FORM*,FIELD *,const void*); /* generic field validation */
|
| 186 |
+
} fieldcheck;
|
| 187 |
+
union {
|
| 188 |
+
bool (*occheck)(int,const void *); /* character validation */
|
| 189 |
+
bool (*gccheck)(int,FORM*,
|
| 190 |
+
FIELD*,const void*); /* generic char validation */
|
| 191 |
+
} charcheck;
|
| 192 |
+
union {
|
| 193 |
+
bool (*onext)(FIELD *,const void *); /* enumerate next value */
|
| 194 |
+
bool (*gnext)(FORM*,FIELD*,const void*); /* generic enumerate next */
|
| 195 |
+
} enum_next;
|
| 196 |
+
union {
|
| 197 |
+
bool (*oprev)(FIELD *,const void *); /* enumerate prev value */
|
| 198 |
+
bool (*gprev)(FORM*,FIELD*,const void*); /* generic enumerate prev */
|
| 199 |
+
} enum_prev;
|
| 200 |
+
void* (*genericarg)(void*); /* Alternate Arg method */
|
| 201 |
+
#else
|
| 202 |
+
bool (*fcheck)(FIELD *,const void *); /* field validation */
|
| 203 |
+
bool (*ccheck)(int,const void *); /* character validation */
|
| 204 |
+
|
| 205 |
+
bool (*next)(FIELD *,const void *); /* enumerate next value */
|
| 206 |
+
bool (*prev)(FIELD *,const void *); /* enumerate prev value */
|
| 207 |
+
#endif
|
| 208 |
+
}
|
| 209 |
+
#endif /* !NCURSES_OPAQUE_FORM */
|
| 210 |
+
FIELDTYPE;
|
| 211 |
+
|
| 212 |
+
typedef void (*Form_Hook)(FORM *);
|
| 213 |
+
|
| 214 |
+
/***************************
|
| 215 |
+
* miscellaneous #defines *
|
| 216 |
+
***************************/
|
| 217 |
+
|
| 218 |
+
/* field justification */
|
| 219 |
+
#define NO_JUSTIFICATION (0)
|
| 220 |
+
#define JUSTIFY_LEFT (1)
|
| 221 |
+
#define JUSTIFY_CENTER (2)
|
| 222 |
+
#define JUSTIFY_RIGHT (3)
|
| 223 |
+
|
| 224 |
+
/* field options */
|
| 225 |
+
#define O_VISIBLE (0x0001U)
|
| 226 |
+
#define O_ACTIVE (0x0002U)
|
| 227 |
+
#define O_PUBLIC (0x0004U)
|
| 228 |
+
#define O_EDIT (0x0008U)
|
| 229 |
+
#define O_WRAP (0x0010U)
|
| 230 |
+
#define O_BLANK (0x0020U)
|
| 231 |
+
#define O_AUTOSKIP (0x0040U)
|
| 232 |
+
#define O_NULLOK (0x0080U)
|
| 233 |
+
#define O_PASSOK (0x0100U)
|
| 234 |
+
#define O_STATIC (0x0200U)
|
| 235 |
+
#define O_DYNAMIC_JUSTIFY (0x0400U) /* ncurses extension */
|
| 236 |
+
#define O_NO_LEFT_STRIP (0x0800U) /* ncurses extension */
|
| 237 |
+
#define O_EDGE_INSERT_STAY (0x1000U) /* ncurses extension */
|
| 238 |
+
#define O_INPUT_LIMIT (0x2000U) /* ncurses extension */
|
| 239 |
+
|
| 240 |
+
/* form options */
|
| 241 |
+
#define O_NL_OVERLOAD (0x0001U)
|
| 242 |
+
#define O_BS_OVERLOAD (0x0002U)
|
| 243 |
+
|
| 244 |
+
/* form driver commands */
|
| 245 |
+
#define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */
|
| 246 |
+
#define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */
|
| 247 |
+
#define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */
|
| 248 |
+
#define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */
|
| 249 |
+
|
| 250 |
+
#define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */
|
| 251 |
+
#define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */
|
| 252 |
+
#define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */
|
| 253 |
+
#define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */
|
| 254 |
+
#define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */
|
| 255 |
+
#define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */
|
| 256 |
+
#define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */
|
| 257 |
+
#define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */
|
| 258 |
+
#define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */
|
| 259 |
+
#define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */
|
| 260 |
+
#define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */
|
| 261 |
+
#define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */
|
| 262 |
+
|
| 263 |
+
#define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */
|
| 264 |
+
#define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */
|
| 265 |
+
#define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */
|
| 266 |
+
#define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */
|
| 267 |
+
#define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */
|
| 268 |
+
#define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */
|
| 269 |
+
#define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */
|
| 270 |
+
#define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */
|
| 271 |
+
#define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */
|
| 272 |
+
#define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */
|
| 273 |
+
#define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */
|
| 274 |
+
#define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */
|
| 275 |
+
#define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */
|
| 276 |
+
#define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */
|
| 277 |
+
|
| 278 |
+
#define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */
|
| 279 |
+
#define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */
|
| 280 |
+
#define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */
|
| 281 |
+
#define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */
|
| 282 |
+
#define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */
|
| 283 |
+
#define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */
|
| 284 |
+
#define REQ_DEL_WORD (KEY_MAX + 37) /* delete word at cursor */
|
| 285 |
+
#define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */
|
| 286 |
+
#define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */
|
| 287 |
+
#define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */
|
| 288 |
+
#define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */
|
| 289 |
+
#define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */
|
| 290 |
+
#define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */
|
| 291 |
+
#define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */
|
| 292 |
+
#define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */
|
| 293 |
+
#define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */
|
| 294 |
+
#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
|
| 295 |
+
#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
|
| 296 |
+
#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
|
| 297 |
+
#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
|
| 298 |
+
#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
|
| 299 |
+
#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
|
| 300 |
+
#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
|
| 301 |
+
#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
|
| 302 |
+
|
| 303 |
+
#define REQ_VALIDATION (KEY_MAX + 55) /* validate field */
|
| 304 |
+
#define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */
|
| 305 |
+
#define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */
|
| 306 |
+
|
| 307 |
+
#define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */
|
| 308 |
+
#define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */
|
| 309 |
+
|
| 310 |
+
#if defined(MAX_COMMAND)
|
| 311 |
+
# if (MAX_FORM_COMMAND > MAX_COMMAND)
|
| 312 |
+
# error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND
|
| 313 |
+
# elif (MAX_COMMAND != (KEY_MAX + 128))
|
| 314 |
+
# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
|
| 315 |
+
# endif
|
| 316 |
+
#else
|
| 317 |
+
# define MAX_COMMAND (KEY_MAX + 128)
|
| 318 |
+
#endif
|
| 319 |
+
|
| 320 |
+
/*************************
|
| 321 |
+
* standard field types *
|
| 322 |
+
*************************/
|
| 323 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
|
| 324 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
|
| 325 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
|
| 326 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
|
| 327 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
|
| 328 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
|
| 329 |
+
|
| 330 |
+
/************************************
|
| 331 |
+
* built-in additional field types *
|
| 332 |
+
* They are not defined in SVr4 *
|
| 333 |
+
************************************/
|
| 334 |
+
extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
|
| 335 |
+
|
| 336 |
+
/***********************
|
| 337 |
+
* FIELDTYPE routines *
|
| 338 |
+
***********************/
|
| 339 |
+
extern FORM_EXPORT(FIELDTYPE *) new_fieldtype (
|
| 340 |
+
bool (* const field_check)(FIELD *,const void *),
|
| 341 |
+
bool (* const char_check)(int,const void *));
|
| 342 |
+
extern FORM_EXPORT(FIELDTYPE *) link_fieldtype(
|
| 343 |
+
FIELDTYPE *, FIELDTYPE *);
|
| 344 |
+
|
| 345 |
+
extern FORM_EXPORT(int) free_fieldtype (FIELDTYPE *);
|
| 346 |
+
extern FORM_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
|
| 347 |
+
void * (* const make_arg)(va_list *),
|
| 348 |
+
void * (* const copy_arg)(const void *),
|
| 349 |
+
void (* const free_arg)(void *));
|
| 350 |
+
extern FORM_EXPORT(int) set_fieldtype_choice (FIELDTYPE *,
|
| 351 |
+
bool (* const next_choice)(FIELD *,const void *),
|
| 352 |
+
bool (* const prev_choice)(FIELD *,const void *));
|
| 353 |
+
|
| 354 |
+
/*******************
|
| 355 |
+
* FIELD routines *
|
| 356 |
+
*******************/
|
| 357 |
+
extern FORM_EXPORT(FIELD *) new_field (int,int,int,int,int,int);
|
| 358 |
+
extern FORM_EXPORT(FIELD *) dup_field (FIELD *,int,int);
|
| 359 |
+
extern FORM_EXPORT(FIELD *) link_field (FIELD *,int,int);
|
| 360 |
+
|
| 361 |
+
extern FORM_EXPORT(int) free_field (FIELD *);
|
| 362 |
+
extern FORM_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *);
|
| 363 |
+
extern FORM_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *);
|
| 364 |
+
extern FORM_EXPORT(int) set_max_field ( FIELD *,int);
|
| 365 |
+
extern FORM_EXPORT(int) move_field (FIELD *,int,int);
|
| 366 |
+
extern FORM_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...);
|
| 367 |
+
extern FORM_EXPORT(int) set_new_page (FIELD *,bool);
|
| 368 |
+
extern FORM_EXPORT(int) set_field_just (FIELD *,int);
|
| 369 |
+
extern FORM_EXPORT(int) field_just (const FIELD *);
|
| 370 |
+
extern FORM_EXPORT(int) set_field_fore (FIELD *,chtype);
|
| 371 |
+
extern FORM_EXPORT(int) set_field_back (FIELD *,chtype);
|
| 372 |
+
extern FORM_EXPORT(int) set_field_pad (FIELD *,int);
|
| 373 |
+
extern FORM_EXPORT(int) field_pad (const FIELD *);
|
| 374 |
+
extern FORM_EXPORT(int) set_field_buffer (FIELD *,int,const char *);
|
| 375 |
+
extern FORM_EXPORT(int) set_field_status (FIELD *,bool);
|
| 376 |
+
extern FORM_EXPORT(int) set_field_userptr (FIELD *, void *);
|
| 377 |
+
extern FORM_EXPORT(int) set_field_opts (FIELD *,Field_Options);
|
| 378 |
+
extern FORM_EXPORT(int) field_opts_on (FIELD *,Field_Options);
|
| 379 |
+
extern FORM_EXPORT(int) field_opts_off (FIELD *,Field_Options);
|
| 380 |
+
|
| 381 |
+
extern FORM_EXPORT(chtype) field_fore (const FIELD *);
|
| 382 |
+
extern FORM_EXPORT(chtype) field_back (const FIELD *);
|
| 383 |
+
|
| 384 |
+
extern FORM_EXPORT(bool) new_page (const FIELD *);
|
| 385 |
+
extern FORM_EXPORT(bool) field_status (const FIELD *);
|
| 386 |
+
|
| 387 |
+
extern FORM_EXPORT(void *) field_arg (const FIELD *);
|
| 388 |
+
|
| 389 |
+
extern FORM_EXPORT(void *) field_userptr (const FIELD *);
|
| 390 |
+
|
| 391 |
+
extern FORM_EXPORT(FIELDTYPE *) field_type (const FIELD *);
|
| 392 |
+
|
| 393 |
+
extern FORM_EXPORT(char *) field_buffer (const FIELD *,int);
|
| 394 |
+
|
| 395 |
+
extern FORM_EXPORT(Field_Options) field_opts (const FIELD *);
|
| 396 |
+
|
| 397 |
+
/******************
|
| 398 |
+
* FORM routines *
|
| 399 |
+
******************/
|
| 400 |
+
|
| 401 |
+
extern FORM_EXPORT(FORM *) new_form (FIELD **);
|
| 402 |
+
|
| 403 |
+
extern FORM_EXPORT(FIELD **) form_fields (const FORM *);
|
| 404 |
+
extern FORM_EXPORT(FIELD *) current_field (const FORM *);
|
| 405 |
+
|
| 406 |
+
extern FORM_EXPORT(WINDOW *) form_win (const FORM *);
|
| 407 |
+
extern FORM_EXPORT(WINDOW *) form_sub (const FORM *);
|
| 408 |
+
|
| 409 |
+
extern FORM_EXPORT(Form_Hook) form_init (const FORM *);
|
| 410 |
+
extern FORM_EXPORT(Form_Hook) form_term (const FORM *);
|
| 411 |
+
extern FORM_EXPORT(Form_Hook) field_init (const FORM *);
|
| 412 |
+
extern FORM_EXPORT(Form_Hook) field_term (const FORM *);
|
| 413 |
+
|
| 414 |
+
extern FORM_EXPORT(int) free_form (FORM *);
|
| 415 |
+
extern FORM_EXPORT(int) set_form_fields (FORM *,FIELD **);
|
| 416 |
+
extern FORM_EXPORT(int) field_count (const FORM *);
|
| 417 |
+
extern FORM_EXPORT(int) set_form_win (FORM *,WINDOW *);
|
| 418 |
+
extern FORM_EXPORT(int) set_form_sub (FORM *,WINDOW *);
|
| 419 |
+
extern FORM_EXPORT(int) set_current_field (FORM *,FIELD *);
|
| 420 |
+
extern FORM_EXPORT(int) unfocus_current_field (FORM *);
|
| 421 |
+
extern FORM_EXPORT(int) field_index (const FIELD *);
|
| 422 |
+
extern FORM_EXPORT(int) set_form_page (FORM *,int);
|
| 423 |
+
extern FORM_EXPORT(int) form_page (const FORM *);
|
| 424 |
+
extern FORM_EXPORT(int) scale_form (const FORM *,int *,int *);
|
| 425 |
+
extern FORM_EXPORT(int) set_form_init (FORM *,Form_Hook);
|
| 426 |
+
extern FORM_EXPORT(int) set_form_term (FORM *,Form_Hook);
|
| 427 |
+
extern FORM_EXPORT(int) set_field_init (FORM *,Form_Hook);
|
| 428 |
+
extern FORM_EXPORT(int) set_field_term (FORM *,Form_Hook);
|
| 429 |
+
extern FORM_EXPORT(int) post_form (FORM *);
|
| 430 |
+
extern FORM_EXPORT(int) unpost_form (FORM *);
|
| 431 |
+
extern FORM_EXPORT(int) pos_form_cursor (FORM *);
|
| 432 |
+
extern FORM_EXPORT(int) form_driver (FORM *,int);
|
| 433 |
+
# if NCURSES_WIDECHAR
|
| 434 |
+
extern FORM_EXPORT(int) form_driver_w (FORM *,int,wchar_t);
|
| 435 |
+
# endif
|
| 436 |
+
extern FORM_EXPORT(int) set_form_userptr (FORM *,void *);
|
| 437 |
+
extern FORM_EXPORT(int) set_form_opts (FORM *,Form_Options);
|
| 438 |
+
extern FORM_EXPORT(int) form_opts_on (FORM *,Form_Options);
|
| 439 |
+
extern FORM_EXPORT(int) form_opts_off (FORM *,Form_Options);
|
| 440 |
+
extern FORM_EXPORT(int) form_request_by_name (const char *);
|
| 441 |
+
|
| 442 |
+
extern FORM_EXPORT(const char *) form_request_name (int);
|
| 443 |
+
|
| 444 |
+
extern FORM_EXPORT(void *) form_userptr (const FORM *);
|
| 445 |
+
|
| 446 |
+
extern FORM_EXPORT(Form_Options) form_opts (const FORM *);
|
| 447 |
+
|
| 448 |
+
extern FORM_EXPORT(bool) data_ahead (const FORM *);
|
| 449 |
+
extern FORM_EXPORT(bool) data_behind (const FORM *);
|
| 450 |
+
|
| 451 |
+
#if NCURSES_SP_FUNCS
|
| 452 |
+
extern FORM_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **);
|
| 453 |
+
#endif
|
| 454 |
+
|
| 455 |
+
#ifdef __cplusplus
|
| 456 |
+
}
|
| 457 |
+
#endif
|
| 458 |
+
/* *INDENT-ON*/
|
| 459 |
+
|
| 460 |
+
#endif /* FORM_H */
|
deepseek/include/itcl.h
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* itcl.h --
|
| 3 |
+
*
|
| 4 |
+
* This file contains definitions for the C-implemeted part of a Itcl
|
| 5 |
+
* this version of [incr Tcl] (Itcl) is a completely new implementation
|
| 6 |
+
* based on TclOO extension of Tcl 8.5
|
| 7 |
+
* It tries to provide the same interfaces as the original implementation
|
| 8 |
+
* of Michael J. McLennan
|
| 9 |
+
* Some small pieces of code are taken from that implementation
|
| 10 |
+
*
|
| 11 |
+
* Copyright (c) 2007 by Arnulf P. Wiedemann
|
| 12 |
+
*
|
| 13 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 14 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*
|
| 18 |
+
* ------------------------------------------------------------------------
|
| 19 |
+
* PACKAGE: [incr Tcl]
|
| 20 |
+
* DESCRIPTION: Object-Oriented Extensions to Tcl
|
| 21 |
+
*
|
| 22 |
+
* [incr Tcl] provides object-oriented extensions to Tcl, much as
|
| 23 |
+
* C++ provides object-oriented extensions to C. It provides a means
|
| 24 |
+
* of encapsulating related procedures together with their shared data
|
| 25 |
+
* in a local namespace that is hidden from the outside world. It
|
| 26 |
+
* promotes code re-use through inheritance. More than anything else,
|
| 27 |
+
* it encourages better organization of Tcl applications through the
|
| 28 |
+
* object-oriented paradigm, leading to code that is easier to
|
| 29 |
+
* understand and maintain.
|
| 30 |
+
*
|
| 31 |
+
* ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
|
| 32 |
+
*
|
| 33 |
+
* To add [incr Tcl] facilities to a Tcl application, modify the
|
| 34 |
+
* Tcl_AppInit() routine as follows:
|
| 35 |
+
*
|
| 36 |
+
* 1) Include this header file near the top of the file containing
|
| 37 |
+
* Tcl_AppInit():
|
| 38 |
+
*
|
| 39 |
+
* #include "itcl.h"
|
| 40 |
+
*
|
| 41 |
+
* 2) Within the body of Tcl_AppInit(), add the following lines:
|
| 42 |
+
*
|
| 43 |
+
* if (Itcl_Init(interp) == TCL_ERROR) {
|
| 44 |
+
* return TCL_ERROR;
|
| 45 |
+
* }
|
| 46 |
+
*
|
| 47 |
+
* 3) Link your application with libitcl.a
|
| 48 |
+
*
|
| 49 |
+
* NOTE: An example file "tclAppInit.c" containing the changes shown
|
| 50 |
+
* above is included in this distribution.
|
| 51 |
+
*
|
| 52 |
+
*---------------------------------------------------------------------
|
| 53 |
+
*/
|
| 54 |
+
|
| 55 |
+
#ifndef ITCL_H_INCLUDED
|
| 56 |
+
#define ITCL_H_INCLUDED
|
| 57 |
+
|
| 58 |
+
#include <tcl.h>
|
| 59 |
+
|
| 60 |
+
#if (TCL_MAJOR_VERSION == 8) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 6)
|
| 61 |
+
# error Itcl 4 build requires tcl.h from Tcl 8.6 or later
|
| 62 |
+
#endif
|
| 63 |
+
|
| 64 |
+
/*
|
| 65 |
+
* For C++ compilers, use extern "C"
|
| 66 |
+
*/
|
| 67 |
+
|
| 68 |
+
#ifdef __cplusplus
|
| 69 |
+
extern "C" {
|
| 70 |
+
#endif
|
| 71 |
+
|
| 72 |
+
#ifndef TCL_ALPHA_RELEASE
|
| 73 |
+
# define TCL_ALPHA_RELEASE 0
|
| 74 |
+
#endif
|
| 75 |
+
#ifndef TCL_BETA_RELEASE
|
| 76 |
+
# define TCL_BETA_RELEASE 1
|
| 77 |
+
#endif
|
| 78 |
+
#ifndef TCL_FINAL_RELEASE
|
| 79 |
+
# define TCL_FINAL_RELEASE 2
|
| 80 |
+
#endif
|
| 81 |
+
|
| 82 |
+
#define ITCL_MAJOR_VERSION 4
|
| 83 |
+
#define ITCL_MINOR_VERSION 2
|
| 84 |
+
#define ITCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
| 85 |
+
#define ITCL_RELEASE_SERIAL 4
|
| 86 |
+
|
| 87 |
+
#define ITCL_VERSION "4.2"
|
| 88 |
+
#define ITCL_PATCH_LEVEL "4.2.4"
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
/*
|
| 92 |
+
* A special definition used to allow this header file to be included from
|
| 93 |
+
* windows resource files so that they can obtain version information.
|
| 94 |
+
* RC_INVOKED is defined by default by the windows RC tool.
|
| 95 |
+
*
|
| 96 |
+
* Resource compilers don't like all the C stuff, like typedefs and function
|
| 97 |
+
* declarations, that occur below, so block them out.
|
| 98 |
+
*/
|
| 99 |
+
|
| 100 |
+
#ifndef RC_INVOKED
|
| 101 |
+
|
| 102 |
+
#define ITCL_NAMESPACE "::itcl"
|
| 103 |
+
|
| 104 |
+
#ifndef ITCLAPI
|
| 105 |
+
# if defined(BUILD_itcl)
|
| 106 |
+
# define ITCLAPI MODULE_SCOPE
|
| 107 |
+
# else
|
| 108 |
+
# define ITCLAPI extern
|
| 109 |
+
# undef USE_ITCL_STUBS
|
| 110 |
+
# define USE_ITCL_STUBS 1
|
| 111 |
+
# endif
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
#if defined(BUILD_itcl) && !defined(STATIC_BUILD)
|
| 115 |
+
# define ITCL_EXTERN extern DLLEXPORT
|
| 116 |
+
#else
|
| 117 |
+
# define ITCL_EXTERN extern
|
| 118 |
+
#endif
|
| 119 |
+
|
| 120 |
+
ITCL_EXTERN int Itcl_Init(Tcl_Interp *interp);
|
| 121 |
+
ITCL_EXTERN int Itcl_SafeInit(Tcl_Interp *interp);
|
| 122 |
+
|
| 123 |
+
/*
|
| 124 |
+
* Protection levels:
|
| 125 |
+
*
|
| 126 |
+
* ITCL_PUBLIC - accessible from any namespace
|
| 127 |
+
* ITCL_PROTECTED - accessible from namespace that imports in "protected" mode
|
| 128 |
+
* ITCL_PRIVATE - accessible only within the namespace that contains it
|
| 129 |
+
*/
|
| 130 |
+
#define ITCL_PUBLIC 1
|
| 131 |
+
#define ITCL_PROTECTED 2
|
| 132 |
+
#define ITCL_PRIVATE 3
|
| 133 |
+
#define ITCL_DEFAULT_PROTECT 4
|
| 134 |
+
|
| 135 |
+
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) && !defined(Tcl_Size)
|
| 136 |
+
# define Tcl_Size int
|
| 137 |
+
#endif
|
| 138 |
+
|
| 139 |
+
/*
|
| 140 |
+
* Generic stack.
|
| 141 |
+
*/
|
| 142 |
+
typedef struct Itcl_Stack {
|
| 143 |
+
void **values; /* values on stack */
|
| 144 |
+
Tcl_Size len; /* number of values on stack */
|
| 145 |
+
Tcl_Size max; /* maximum size of stack */
|
| 146 |
+
void *space[5]; /* initial space for stack data */
|
| 147 |
+
} Itcl_Stack;
|
| 148 |
+
|
| 149 |
+
#define Itcl_GetStackSize(stackPtr) ((stackPtr)->len)
|
| 150 |
+
|
| 151 |
+
/*
|
| 152 |
+
* Generic linked list.
|
| 153 |
+
*/
|
| 154 |
+
struct Itcl_List;
|
| 155 |
+
typedef struct Itcl_ListElem {
|
| 156 |
+
struct Itcl_List* owner; /* list containing this element */
|
| 157 |
+
void *value; /* value associated with this element */
|
| 158 |
+
struct Itcl_ListElem *prev; /* previous element in linked list */
|
| 159 |
+
struct Itcl_ListElem *next; /* next element in linked list */
|
| 160 |
+
} Itcl_ListElem;
|
| 161 |
+
|
| 162 |
+
typedef struct Itcl_List {
|
| 163 |
+
int validate; /* validation stamp */
|
| 164 |
+
Tcl_Size num; /* number of elements */
|
| 165 |
+
struct Itcl_ListElem *head; /* previous element in linked list */
|
| 166 |
+
struct Itcl_ListElem *tail; /* next element in linked list */
|
| 167 |
+
} Itcl_List;
|
| 168 |
+
|
| 169 |
+
#define Itcl_FirstListElem(listPtr) ((listPtr)->head)
|
| 170 |
+
#define Itcl_LastListElem(listPtr) ((listPtr)->tail)
|
| 171 |
+
#define Itcl_NextListElem(elemPtr) ((elemPtr)->next)
|
| 172 |
+
#define Itcl_PrevListElem(elemPtr) ((elemPtr)->prev)
|
| 173 |
+
#define Itcl_GetListLength(listPtr) ((listPtr)->num)
|
| 174 |
+
#define Itcl_GetListValue(elemPtr) ((elemPtr)->value)
|
| 175 |
+
|
| 176 |
+
/*
|
| 177 |
+
* Token representing the state of an interpreter.
|
| 178 |
+
*/
|
| 179 |
+
typedef struct Itcl_InterpState_ *Itcl_InterpState;
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
/*
|
| 183 |
+
* Include all the public API, generated from itcl.decls.
|
| 184 |
+
*/
|
| 185 |
+
|
| 186 |
+
#include "itclDecls.h"
|
| 187 |
+
|
| 188 |
+
#endif /* RC_INVOKED */
|
| 189 |
+
|
| 190 |
+
/*
|
| 191 |
+
* end block for C++
|
| 192 |
+
*/
|
| 193 |
+
|
| 194 |
+
#ifdef __cplusplus
|
| 195 |
+
}
|
| 196 |
+
#endif
|
| 197 |
+
|
| 198 |
+
#endif /* ITCL_H_INCLUDED */
|
deepseek/include/itclDecls.h
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* This file is (mostly) automatically generated from itcl.decls.
|
| 3 |
+
*/
|
| 4 |
+
|
| 5 |
+
#ifndef _ITCLDECLS
|
| 6 |
+
#define _ITCLDECLS
|
| 7 |
+
|
| 8 |
+
#if defined(USE_ITCL_STUBS)
|
| 9 |
+
|
| 10 |
+
ITCLAPI const char *Itcl_InitStubs(
|
| 11 |
+
Tcl_Interp *, const char *version, int exact);
|
| 12 |
+
#else
|
| 13 |
+
|
| 14 |
+
#define Itcl_InitStubs(interp, version, exact) Tcl_PkgRequireEx(interp,"itcl",version,exact,NULL)
|
| 15 |
+
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 20 |
+
|
| 21 |
+
#define ITCL_STUBS_EPOCH 0
|
| 22 |
+
#define ITCL_STUBS_REVISION 152
|
| 23 |
+
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
* Exported function declarations:
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
/* Slot 0 is reserved */
|
| 33 |
+
/* Slot 1 is reserved */
|
| 34 |
+
/* 2 */
|
| 35 |
+
ITCLAPI int Itcl_RegisterC(Tcl_Interp *interp, const char *name,
|
| 36 |
+
Tcl_CmdProc *proc, void *clientData,
|
| 37 |
+
Tcl_CmdDeleteProc *deleteProc);
|
| 38 |
+
/* 3 */
|
| 39 |
+
ITCLAPI int Itcl_RegisterObjC(Tcl_Interp *interp,
|
| 40 |
+
const char *name, Tcl_ObjCmdProc *proc,
|
| 41 |
+
void *clientData,
|
| 42 |
+
Tcl_CmdDeleteProc *deleteProc);
|
| 43 |
+
/* 4 */
|
| 44 |
+
ITCLAPI int Itcl_FindC(Tcl_Interp *interp, const char *name,
|
| 45 |
+
Tcl_CmdProc **argProcPtr,
|
| 46 |
+
Tcl_ObjCmdProc **objProcPtr, void **cDataPtr);
|
| 47 |
+
/* 5 */
|
| 48 |
+
ITCLAPI void Itcl_InitStack(Itcl_Stack *stack);
|
| 49 |
+
/* 6 */
|
| 50 |
+
ITCLAPI void Itcl_DeleteStack(Itcl_Stack *stack);
|
| 51 |
+
/* 7 */
|
| 52 |
+
ITCLAPI void Itcl_PushStack(void *cdata, Itcl_Stack *stack);
|
| 53 |
+
/* 8 */
|
| 54 |
+
ITCLAPI void * Itcl_PopStack(Itcl_Stack *stack);
|
| 55 |
+
/* 9 */
|
| 56 |
+
ITCLAPI void * Itcl_PeekStack(Itcl_Stack *stack);
|
| 57 |
+
/* 10 */
|
| 58 |
+
ITCLAPI void * Itcl_GetStackValue(Itcl_Stack *stack, Tcl_Size pos);
|
| 59 |
+
/* 11 */
|
| 60 |
+
ITCLAPI void Itcl_InitList(Itcl_List *listPtr);
|
| 61 |
+
/* 12 */
|
| 62 |
+
ITCLAPI void Itcl_DeleteList(Itcl_List *listPtr);
|
| 63 |
+
/* 13 */
|
| 64 |
+
ITCLAPI Itcl_ListElem * Itcl_CreateListElem(Itcl_List *listPtr);
|
| 65 |
+
/* 14 */
|
| 66 |
+
ITCLAPI Itcl_ListElem * Itcl_DeleteListElem(Itcl_ListElem *elemPtr);
|
| 67 |
+
/* 15 */
|
| 68 |
+
ITCLAPI Itcl_ListElem * Itcl_InsertList(Itcl_List *listPtr, void *val);
|
| 69 |
+
/* 16 */
|
| 70 |
+
ITCLAPI Itcl_ListElem * Itcl_InsertListElem(Itcl_ListElem *pos, void *val);
|
| 71 |
+
/* 17 */
|
| 72 |
+
ITCLAPI Itcl_ListElem * Itcl_AppendList(Itcl_List *listPtr, void *val);
|
| 73 |
+
/* 18 */
|
| 74 |
+
ITCLAPI Itcl_ListElem * Itcl_AppendListElem(Itcl_ListElem *pos, void *val);
|
| 75 |
+
/* 19 */
|
| 76 |
+
ITCLAPI void Itcl_SetListValue(Itcl_ListElem *elemPtr, void *val);
|
| 77 |
+
/* 20 */
|
| 78 |
+
ITCLAPI void Itcl_EventuallyFree(void *cdata, Tcl_FreeProc *fproc);
|
| 79 |
+
/* 21 */
|
| 80 |
+
ITCLAPI void Itcl_PreserveData(void *cdata);
|
| 81 |
+
/* 22 */
|
| 82 |
+
ITCLAPI void Itcl_ReleaseData(void *cdata);
|
| 83 |
+
/* 23 */
|
| 84 |
+
ITCLAPI Itcl_InterpState Itcl_SaveInterpState(Tcl_Interp *interp, int status);
|
| 85 |
+
/* 24 */
|
| 86 |
+
ITCLAPI int Itcl_RestoreInterpState(Tcl_Interp *interp,
|
| 87 |
+
Itcl_InterpState state);
|
| 88 |
+
/* 25 */
|
| 89 |
+
ITCLAPI void Itcl_DiscardInterpState(Itcl_InterpState state);
|
| 90 |
+
/* 26 */
|
| 91 |
+
ITCLAPI void * Itcl_Alloc(size_t size);
|
| 92 |
+
/* 27 */
|
| 93 |
+
ITCLAPI void Itcl_Free(void *ptr);
|
| 94 |
+
|
| 95 |
+
typedef struct {
|
| 96 |
+
const struct ItclIntStubs *itclIntStubs;
|
| 97 |
+
} ItclStubHooks;
|
| 98 |
+
|
| 99 |
+
typedef struct ItclStubs {
|
| 100 |
+
int magic;
|
| 101 |
+
int epoch;
|
| 102 |
+
int revision;
|
| 103 |
+
const ItclStubHooks *hooks;
|
| 104 |
+
|
| 105 |
+
void (*reserved0)(void);
|
| 106 |
+
void (*reserved1)(void);
|
| 107 |
+
int (*itcl_RegisterC) (Tcl_Interp *interp, const char *name, Tcl_CmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 2 */
|
| 108 |
+
int (*itcl_RegisterObjC) (Tcl_Interp *interp, const char *name, Tcl_ObjCmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 3 */
|
| 109 |
+
int (*itcl_FindC) (Tcl_Interp *interp, const char *name, Tcl_CmdProc **argProcPtr, Tcl_ObjCmdProc **objProcPtr, void **cDataPtr); /* 4 */
|
| 110 |
+
void (*itcl_InitStack) (Itcl_Stack *stack); /* 5 */
|
| 111 |
+
void (*itcl_DeleteStack) (Itcl_Stack *stack); /* 6 */
|
| 112 |
+
void (*itcl_PushStack) (void *cdata, Itcl_Stack *stack); /* 7 */
|
| 113 |
+
void * (*itcl_PopStack) (Itcl_Stack *stack); /* 8 */
|
| 114 |
+
void * (*itcl_PeekStack) (Itcl_Stack *stack); /* 9 */
|
| 115 |
+
void * (*itcl_GetStackValue) (Itcl_Stack *stack, Tcl_Size pos); /* 10 */
|
| 116 |
+
void (*itcl_InitList) (Itcl_List *listPtr); /* 11 */
|
| 117 |
+
void (*itcl_DeleteList) (Itcl_List *listPtr); /* 12 */
|
| 118 |
+
Itcl_ListElem * (*itcl_CreateListElem) (Itcl_List *listPtr); /* 13 */
|
| 119 |
+
Itcl_ListElem * (*itcl_DeleteListElem) (Itcl_ListElem *elemPtr); /* 14 */
|
| 120 |
+
Itcl_ListElem * (*itcl_InsertList) (Itcl_List *listPtr, void *val); /* 15 */
|
| 121 |
+
Itcl_ListElem * (*itcl_InsertListElem) (Itcl_ListElem *pos, void *val); /* 16 */
|
| 122 |
+
Itcl_ListElem * (*itcl_AppendList) (Itcl_List *listPtr, void *val); /* 17 */
|
| 123 |
+
Itcl_ListElem * (*itcl_AppendListElem) (Itcl_ListElem *pos, void *val); /* 18 */
|
| 124 |
+
void (*itcl_SetListValue) (Itcl_ListElem *elemPtr, void *val); /* 19 */
|
| 125 |
+
void (*itcl_EventuallyFree) (void *cdata, Tcl_FreeProc *fproc); /* 20 */
|
| 126 |
+
void (*itcl_PreserveData) (void *cdata); /* 21 */
|
| 127 |
+
void (*itcl_ReleaseData) (void *cdata); /* 22 */
|
| 128 |
+
Itcl_InterpState (*itcl_SaveInterpState) (Tcl_Interp *interp, int status); /* 23 */
|
| 129 |
+
int (*itcl_RestoreInterpState) (Tcl_Interp *interp, Itcl_InterpState state); /* 24 */
|
| 130 |
+
void (*itcl_DiscardInterpState) (Itcl_InterpState state); /* 25 */
|
| 131 |
+
void * (*itcl_Alloc) (size_t size); /* 26 */
|
| 132 |
+
void (*itcl_Free) (void *ptr); /* 27 */
|
| 133 |
+
} ItclStubs;
|
| 134 |
+
|
| 135 |
+
extern const ItclStubs *itclStubsPtr;
|
| 136 |
+
|
| 137 |
+
#ifdef __cplusplus
|
| 138 |
+
}
|
| 139 |
+
#endif
|
| 140 |
+
|
| 141 |
+
#if defined(USE_ITCL_STUBS)
|
| 142 |
+
|
| 143 |
+
/*
|
| 144 |
+
* Inline function declarations:
|
| 145 |
+
*/
|
| 146 |
+
|
| 147 |
+
/* Slot 0 is reserved */
|
| 148 |
+
/* Slot 1 is reserved */
|
| 149 |
+
#define Itcl_RegisterC \
|
| 150 |
+
(itclStubsPtr->itcl_RegisterC) /* 2 */
|
| 151 |
+
#define Itcl_RegisterObjC \
|
| 152 |
+
(itclStubsPtr->itcl_RegisterObjC) /* 3 */
|
| 153 |
+
#define Itcl_FindC \
|
| 154 |
+
(itclStubsPtr->itcl_FindC) /* 4 */
|
| 155 |
+
#define Itcl_InitStack \
|
| 156 |
+
(itclStubsPtr->itcl_InitStack) /* 5 */
|
| 157 |
+
#define Itcl_DeleteStack \
|
| 158 |
+
(itclStubsPtr->itcl_DeleteStack) /* 6 */
|
| 159 |
+
#define Itcl_PushStack \
|
| 160 |
+
(itclStubsPtr->itcl_PushStack) /* 7 */
|
| 161 |
+
#define Itcl_PopStack \
|
| 162 |
+
(itclStubsPtr->itcl_PopStack) /* 8 */
|
| 163 |
+
#define Itcl_PeekStack \
|
| 164 |
+
(itclStubsPtr->itcl_PeekStack) /* 9 */
|
| 165 |
+
#define Itcl_GetStackValue \
|
| 166 |
+
(itclStubsPtr->itcl_GetStackValue) /* 10 */
|
| 167 |
+
#define Itcl_InitList \
|
| 168 |
+
(itclStubsPtr->itcl_InitList) /* 11 */
|
| 169 |
+
#define Itcl_DeleteList \
|
| 170 |
+
(itclStubsPtr->itcl_DeleteList) /* 12 */
|
| 171 |
+
#define Itcl_CreateListElem \
|
| 172 |
+
(itclStubsPtr->itcl_CreateListElem) /* 13 */
|
| 173 |
+
#define Itcl_DeleteListElem \
|
| 174 |
+
(itclStubsPtr->itcl_DeleteListElem) /* 14 */
|
| 175 |
+
#define Itcl_InsertList \
|
| 176 |
+
(itclStubsPtr->itcl_InsertList) /* 15 */
|
| 177 |
+
#define Itcl_InsertListElem \
|
| 178 |
+
(itclStubsPtr->itcl_InsertListElem) /* 16 */
|
| 179 |
+
#define Itcl_AppendList \
|
| 180 |
+
(itclStubsPtr->itcl_AppendList) /* 17 */
|
| 181 |
+
#define Itcl_AppendListElem \
|
| 182 |
+
(itclStubsPtr->itcl_AppendListElem) /* 18 */
|
| 183 |
+
#define Itcl_SetListValue \
|
| 184 |
+
(itclStubsPtr->itcl_SetListValue) /* 19 */
|
| 185 |
+
#define Itcl_EventuallyFree \
|
| 186 |
+
(itclStubsPtr->itcl_EventuallyFree) /* 20 */
|
| 187 |
+
#define Itcl_PreserveData \
|
| 188 |
+
(itclStubsPtr->itcl_PreserveData) /* 21 */
|
| 189 |
+
#define Itcl_ReleaseData \
|
| 190 |
+
(itclStubsPtr->itcl_ReleaseData) /* 22 */
|
| 191 |
+
#define Itcl_SaveInterpState \
|
| 192 |
+
(itclStubsPtr->itcl_SaveInterpState) /* 23 */
|
| 193 |
+
#define Itcl_RestoreInterpState \
|
| 194 |
+
(itclStubsPtr->itcl_RestoreInterpState) /* 24 */
|
| 195 |
+
#define Itcl_DiscardInterpState \
|
| 196 |
+
(itclStubsPtr->itcl_DiscardInterpState) /* 25 */
|
| 197 |
+
#define Itcl_Alloc \
|
| 198 |
+
(itclStubsPtr->itcl_Alloc) /* 26 */
|
| 199 |
+
#define Itcl_Free \
|
| 200 |
+
(itclStubsPtr->itcl_Free) /* 27 */
|
| 201 |
+
|
| 202 |
+
#endif /* defined(USE_ITCL_STUBS) */
|
| 203 |
+
|
| 204 |
+
/* !END!: Do not edit above this line. */
|
| 205 |
+
|
| 206 |
+
#endif /* _ITCLDECLS */
|
deepseek/include/itclInt.h
ADDED
|
@@ -0,0 +1,854 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* itclInt.h --
|
| 3 |
+
*
|
| 4 |
+
* This file contains internal definitions for the C-implemented part of a
|
| 5 |
+
* Itcl
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 2007 by Arnulf P. Wiedemann
|
| 8 |
+
*
|
| 9 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 10 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifdef HAVE_UNISTD_H
|
| 14 |
+
#include <unistd.h>
|
| 15 |
+
#endif
|
| 16 |
+
#ifdef HAVE_STDINT_H
|
| 17 |
+
#include <stdint.h>
|
| 18 |
+
#endif
|
| 19 |
+
#include <stddef.h>
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* Used to tag functions that are only to be visible within the module being
|
| 23 |
+
* built and not outside it (where this is supported by the linker).
|
| 24 |
+
*/
|
| 25 |
+
|
| 26 |
+
#ifndef MODULE_SCOPE
|
| 27 |
+
# ifdef __cplusplus
|
| 28 |
+
# define MODULE_SCOPE extern "C"
|
| 29 |
+
# else
|
| 30 |
+
# define MODULE_SCOPE extern
|
| 31 |
+
# endif
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#include <string.h>
|
| 35 |
+
#include <ctype.h>
|
| 36 |
+
#include <tclOO.h>
|
| 37 |
+
#include "itcl.h"
|
| 38 |
+
#include "itclMigrate2TclCore.h"
|
| 39 |
+
#include "itclTclIntStubsFcn.h"
|
| 40 |
+
|
| 41 |
+
/*
|
| 42 |
+
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
| 43 |
+
* quotation marks).
|
| 44 |
+
*/
|
| 45 |
+
|
| 46 |
+
#ifndef STRINGIFY
|
| 47 |
+
# define STRINGIFY(x) STRINGIFY1(x)
|
| 48 |
+
# define STRINGIFY1(x) #x
|
| 49 |
+
#endif
|
| 50 |
+
|
| 51 |
+
/*
|
| 52 |
+
* MSVC 8.0 started to mark many standard C library functions depreciated
|
| 53 |
+
* including the *printf family and others. Tell it to shut up.
|
| 54 |
+
* (_MSC_VER is 1200 for VC6, 1300 or 1310 for vc7.net, 1400 for 8.0)
|
| 55 |
+
*/
|
| 56 |
+
#if defined(_MSC_VER)
|
| 57 |
+
# pragma warning(disable:4244)
|
| 58 |
+
# if _MSC_VER >= 1400
|
| 59 |
+
# pragma warning(disable:4267)
|
| 60 |
+
# pragma warning(disable:4996)
|
| 61 |
+
# endif
|
| 62 |
+
#endif
|
| 63 |
+
|
| 64 |
+
#ifndef TCL_INDEX_NONE
|
| 65 |
+
# define TCL_INDEX_NONE (-1)
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
#ifndef JOIN
|
| 69 |
+
# define JOIN(a,b) JOIN1(a,b)
|
| 70 |
+
# define JOIN1(a,b) a##b
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
#ifndef TCL_UNUSED
|
| 74 |
+
# if defined(__cplusplus)
|
| 75 |
+
# define TCL_UNUSED(T) T
|
| 76 |
+
# elif defined(__GNUC__) && (__GNUC__ > 2)
|
| 77 |
+
# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused))
|
| 78 |
+
# else
|
| 79 |
+
# define TCL_UNUSED(T) T JOIN(dummy, __LINE__)
|
| 80 |
+
# endif
|
| 81 |
+
#endif
|
| 82 |
+
|
| 83 |
+
#if TCL_MAJOR_VERSION == 8
|
| 84 |
+
# define ITCL_Z_MODIFIER ""
|
| 85 |
+
#else
|
| 86 |
+
# define ITCL_Z_MODIFIER TCL_Z_MODIFIER
|
| 87 |
+
#endif
|
| 88 |
+
|
| 89 |
+
/*
|
| 90 |
+
* Since the Tcl/Tk distribution doesn't perform any asserts,
|
| 91 |
+
* dynamic loading can fail to find the __assert function.
|
| 92 |
+
* As a workaround, we'll include our own.
|
| 93 |
+
*/
|
| 94 |
+
|
| 95 |
+
#undef assert
|
| 96 |
+
#if defined(NDEBUG) && !defined(DEBUG)
|
| 97 |
+
#define assert(EX) ((void)0)
|
| 98 |
+
#else /* !NDEBUG || DEBUG */
|
| 99 |
+
#define assert(EX) (void)((EX) || (Itcl_Assert(STRINGIFY(EX), __FILE__, __LINE__), 0))
|
| 100 |
+
#endif
|
| 101 |
+
|
| 102 |
+
#define ITCL_INTERP_DATA "itcl_data"
|
| 103 |
+
#define ITCL_TK_VERSION "8.6"
|
| 104 |
+
|
| 105 |
+
/*
|
| 106 |
+
* Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
|
| 107 |
+
* sets up the declarations needed for the main macro, FOREACH_HASH, which
|
| 108 |
+
* does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
|
| 109 |
+
* only iterates over values.
|
| 110 |
+
*/
|
| 111 |
+
|
| 112 |
+
#define FOREACH_HASH_DECLS \
|
| 113 |
+
Tcl_HashEntry *hPtr;Tcl_HashSearch search
|
| 114 |
+
#define FOREACH_HASH(key,val,tablePtr) \
|
| 115 |
+
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
|
| 116 |
+
(*(void **)&(key)=Tcl_GetHashKey((tablePtr),hPtr),\
|
| 117 |
+
*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search))
|
| 118 |
+
#define FOREACH_HASH_VALUE(val,tablePtr) \
|
| 119 |
+
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
|
| 120 |
+
(*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search))
|
| 121 |
+
|
| 122 |
+
/*
|
| 123 |
+
* What sort of size of things we like to allocate.
|
| 124 |
+
*/
|
| 125 |
+
|
| 126 |
+
#define ALLOC_CHUNK 8
|
| 127 |
+
|
| 128 |
+
#define ITCL_INT_NAMESPACE ITCL_NAMESPACE"::internal"
|
| 129 |
+
#define ITCL_INTDICTS_NAMESPACE ITCL_INT_NAMESPACE"::dicts"
|
| 130 |
+
#define ITCL_VARIABLES_NAMESPACE ITCL_INT_NAMESPACE"::variables"
|
| 131 |
+
#define ITCL_COMMANDS_NAMESPACE ITCL_INT_NAMESPACE"::commands"
|
| 132 |
+
|
| 133 |
+
typedef struct ItclFoundation {
|
| 134 |
+
Itcl_Stack methodCallStack;
|
| 135 |
+
Tcl_Command dispatchCommand;
|
| 136 |
+
} ItclFoundation;
|
| 137 |
+
|
| 138 |
+
typedef struct ItclArgList {
|
| 139 |
+
struct ItclArgList *nextPtr; /* pointer to next argument */
|
| 140 |
+
Tcl_Obj *namePtr; /* name of the argument */
|
| 141 |
+
Tcl_Obj *defaultValuePtr; /* default value or NULL if none */
|
| 142 |
+
} ItclArgList;
|
| 143 |
+
|
| 144 |
+
/*
|
| 145 |
+
* Common info for managing all known objects.
|
| 146 |
+
* Each interpreter has one of these data structures stored as
|
| 147 |
+
* clientData in the "itcl" namespace. It is also accessible
|
| 148 |
+
* as associated data via the key ITCL_INTERP_DATA.
|
| 149 |
+
*/
|
| 150 |
+
struct ItclClass;
|
| 151 |
+
struct ItclObject;
|
| 152 |
+
struct ItclMemberFunc;
|
| 153 |
+
struct EnsembleInfo;
|
| 154 |
+
struct ItclDelegatedOption;
|
| 155 |
+
struct ItclDelegatedFunction;
|
| 156 |
+
|
| 157 |
+
typedef struct ItclObjectInfo {
|
| 158 |
+
Tcl_Interp *interp; /* interpreter that manages this info */
|
| 159 |
+
Tcl_HashTable objects; /* list of all known objects key is
|
| 160 |
+
* ioPtr */
|
| 161 |
+
Tcl_HashTable objectCmds; /* list of known objects using accessCmd */
|
| 162 |
+
Tcl_HashTable unused5; /* list of known objects using namePtr */
|
| 163 |
+
Tcl_HashTable classes; /* list of all known classes,
|
| 164 |
+
* key is iclsPtr */
|
| 165 |
+
Tcl_HashTable nameClasses; /* maps from fullNamePtr to iclsPtr */
|
| 166 |
+
Tcl_HashTable namespaceClasses; /* maps from nsPtr to iclsPtr */
|
| 167 |
+
Tcl_HashTable procMethods; /* maps from procPtr to mFunc */
|
| 168 |
+
Tcl_HashTable instances; /* maps from instanceNumber to ioPtr */
|
| 169 |
+
Tcl_HashTable unused8; /* maps from ioPtr to instanceNumber */
|
| 170 |
+
Tcl_HashTable frameContext; /* maps frame to context stack */
|
| 171 |
+
Tcl_HashTable classTypes; /* maps from class type i.e. "widget"
|
| 172 |
+
* to define value i.e. ITCL_WIDGET */
|
| 173 |
+
int protection; /* protection level currently in effect */
|
| 174 |
+
int useOldResolvers; /* whether to use the "old" style
|
| 175 |
+
* resolvers or the CallFrame resolvers */
|
| 176 |
+
Itcl_Stack clsStack; /* stack of class definitions currently
|
| 177 |
+
* being parsed */
|
| 178 |
+
Itcl_Stack unused; /* Removed */
|
| 179 |
+
Itcl_Stack unused6; /* obsolete field */
|
| 180 |
+
struct ItclObject *currIoPtr; /* object currently being constructed
|
| 181 |
+
* set only during calling of constructors
|
| 182 |
+
* otherwise NULL */
|
| 183 |
+
Tcl_ObjectMetadataType *class_meta_type;
|
| 184 |
+
/* type for getting the Itcl class info
|
| 185 |
+
* from a TclOO Tcl_Object */
|
| 186 |
+
const Tcl_ObjectMetadataType *object_meta_type;
|
| 187 |
+
/* type for getting the Itcl object info
|
| 188 |
+
* from a TclOO Tcl_Object */
|
| 189 |
+
Tcl_Object clazzObjectPtr; /* the root object of Itcl */
|
| 190 |
+
Tcl_Class clazzClassPtr; /* the root class of Itcl */
|
| 191 |
+
struct EnsembleInfo *ensembleInfo;
|
| 192 |
+
struct ItclClass *currContextIclsPtr;
|
| 193 |
+
/* context class for delegated option
|
| 194 |
+
* handling */
|
| 195 |
+
int currClassFlags; /* flags for the class just in creation */
|
| 196 |
+
int buildingWidget; /* set if in construction of a widget */
|
| 197 |
+
Tcl_Size unparsedObjc; /* number options not parsed by
|
| 198 |
+
ItclExtendedConfigure/-Cget function */
|
| 199 |
+
Tcl_Obj **unparsedObjv; /* options not parsed by
|
| 200 |
+
ItclExtendedConfigure/-Cget function */
|
| 201 |
+
int functionFlags; /* used for creating of ItclMemberCode */
|
| 202 |
+
int unused7;
|
| 203 |
+
struct ItclDelegatedOption *currIdoPtr;
|
| 204 |
+
/* the current delegated option info */
|
| 205 |
+
int inOptionHandling; /* used to indicate for type/widget ...
|
| 206 |
+
* that there is an option processing
|
| 207 |
+
* and methods are allowed to be called */
|
| 208 |
+
/* these are the Tcl_Obj Ptrs for the clazz unknown procedure */
|
| 209 |
+
/* need to store them to be able to free them at the end */
|
| 210 |
+
int itclWidgetInitted; /* set to 1 if itclWidget.tcl has already
|
| 211 |
+
* been called
|
| 212 |
+
*/
|
| 213 |
+
int itclHullCmdsInitted; /* set to 1 if itclHullCmds.tcl has already
|
| 214 |
+
* been called
|
| 215 |
+
*/
|
| 216 |
+
Tcl_Obj *unused2;
|
| 217 |
+
Tcl_Obj *unused3;
|
| 218 |
+
Tcl_Obj *unused4;
|
| 219 |
+
Tcl_Obj *infoVarsPtr;
|
| 220 |
+
Tcl_Obj *unused9;
|
| 221 |
+
Tcl_Obj *infoVars4Ptr;
|
| 222 |
+
Tcl_Obj *typeDestructorArgumentPtr;
|
| 223 |
+
struct ItclObject *lastIoPtr; /* last object constructed */
|
| 224 |
+
Tcl_Command infoCmd;
|
| 225 |
+
} ItclObjectInfo;
|
| 226 |
+
|
| 227 |
+
typedef struct EnsembleInfo {
|
| 228 |
+
Tcl_HashTable ensembles; /* list of all known ensembles */
|
| 229 |
+
Tcl_HashTable subEnsembles; /* list of all known subensembles */
|
| 230 |
+
Tcl_Size numEnsembles;
|
| 231 |
+
Tcl_Namespace *ensembleNsPtr;
|
| 232 |
+
} EnsembleInfo;
|
| 233 |
+
/*
|
| 234 |
+
* Representation for each [incr Tcl] class.
|
| 235 |
+
*/
|
| 236 |
+
#define ITCL_CLASS 0x1
|
| 237 |
+
#define ITCL_TYPE 0x2
|
| 238 |
+
#define ITCL_WIDGET 0x4
|
| 239 |
+
#define ITCL_WIDGETADAPTOR 0x8
|
| 240 |
+
#define ITCL_ECLASS 0x10
|
| 241 |
+
#define ITCL_NWIDGET 0x20
|
| 242 |
+
#define ITCL_WIDGET_FRAME 0x40
|
| 243 |
+
#define ITCL_WIDGET_LABEL_FRAME 0x80
|
| 244 |
+
#define ITCL_WIDGET_TOPLEVEL 0x100
|
| 245 |
+
#define ITCL_WIDGET_TTK_FRAME 0x200
|
| 246 |
+
#define ITCL_WIDGET_TTK_LABEL_FRAME 0x400
|
| 247 |
+
#define ITCL_WIDGET_TTK_TOPLEVEL 0x800
|
| 248 |
+
#define ITCL_CLASS_IS_DELETED 0x1000
|
| 249 |
+
#define ITCL_CLASS_IS_DESTROYED 0x2000
|
| 250 |
+
#define ITCL_CLASS_NS_IS_DESTROYED 0x4000
|
| 251 |
+
#define ITCL_CLASS_IS_RENAMED 0x8000 /* unused */
|
| 252 |
+
#define ITCL_CLASS_IS_FREED 0x10000
|
| 253 |
+
#define ITCL_CLASS_DERIVED_RELEASED 0x20000
|
| 254 |
+
#define ITCL_CLASS_NS_TEARDOWN 0x40000
|
| 255 |
+
#define ITCL_CLASS_NO_VARNS_DELETE 0x80000
|
| 256 |
+
#define ITCL_CLASS_SHOULD_VARNS_DELETE 0x100000
|
| 257 |
+
#define ITCL_CLASS_DESTRUCTOR_CALLED 0x400000
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
typedef struct ItclClass {
|
| 261 |
+
Tcl_Obj *namePtr; /* class name */
|
| 262 |
+
Tcl_Obj *fullNamePtr; /* fully qualified class name */
|
| 263 |
+
Tcl_Interp *interp; /* interpreter that manages this info */
|
| 264 |
+
Tcl_Namespace *nsPtr; /* namespace representing class scope */
|
| 265 |
+
Tcl_Command accessCmd; /* access command for creating instances */
|
| 266 |
+
Tcl_Command thisCmd; /* needed for deletion of class */
|
| 267 |
+
|
| 268 |
+
struct ItclObjectInfo *infoPtr;
|
| 269 |
+
/* info about all known objects
|
| 270 |
+
* and other stuff like stacks */
|
| 271 |
+
Itcl_List bases; /* list of base classes */
|
| 272 |
+
Itcl_List derived; /* list of all derived classes */
|
| 273 |
+
Tcl_HashTable heritage; /* table of all base classes. Look up
|
| 274 |
+
* by pointer to class definition. This
|
| 275 |
+
* provides fast lookup for inheritance
|
| 276 |
+
* tests. */
|
| 277 |
+
Tcl_Obj *initCode; /* initialization code for new objs */
|
| 278 |
+
Tcl_HashTable variables; /* definitions for all data members
|
| 279 |
+
in this class. Look up simple string
|
| 280 |
+
names and get back ItclVariable* ptrs */
|
| 281 |
+
Tcl_HashTable options; /* definitions for all option members
|
| 282 |
+
in this class. Look up simple string
|
| 283 |
+
names and get back ItclOption* ptrs */
|
| 284 |
+
Tcl_HashTable components; /* definitions for all component members
|
| 285 |
+
in this class. Look up simple string
|
| 286 |
+
names and get back ItclComponent* ptrs */
|
| 287 |
+
Tcl_HashTable functions; /* definitions for all member functions
|
| 288 |
+
in this class. Look up simple string
|
| 289 |
+
names and get back ItclMemberFunc* ptrs */
|
| 290 |
+
Tcl_HashTable delegatedOptions; /* definitions for all delegated options
|
| 291 |
+
in this class. Look up simple string
|
| 292 |
+
names and get back
|
| 293 |
+
ItclDelegatedOption * ptrs */
|
| 294 |
+
Tcl_HashTable delegatedFunctions; /* definitions for all delegated methods
|
| 295 |
+
or procs in this class. Look up simple
|
| 296 |
+
string names and get back
|
| 297 |
+
ItclDelegatedFunction * ptrs */
|
| 298 |
+
Tcl_HashTable methodVariables; /* definitions for all methodvariable members
|
| 299 |
+
in this class. Look up simple string
|
| 300 |
+
names and get back
|
| 301 |
+
ItclMethodVariable* ptrs */
|
| 302 |
+
Tcl_Size numInstanceVars; /* number of instance vars in variables
|
| 303 |
+
table */
|
| 304 |
+
Tcl_HashTable classCommons; /* used for storing variable namespace
|
| 305 |
+
* string for Tcl_Resolve */
|
| 306 |
+
Tcl_HashTable resolveVars; /* all possible names for variables in
|
| 307 |
+
* this class (e.g., x, foo::x, etc.) */
|
| 308 |
+
Tcl_HashTable resolveCmds; /* all possible names for functions in
|
| 309 |
+
* this class (e.g., x, foo::x, etc.) */
|
| 310 |
+
Tcl_HashTable contextCache; /* cache for function contexts */
|
| 311 |
+
struct ItclMemberFunc *unused2;
|
| 312 |
+
/* the class constructor or NULL */
|
| 313 |
+
struct ItclMemberFunc *unused3;
|
| 314 |
+
/* the class destructor or NULL */
|
| 315 |
+
struct ItclMemberFunc *unused1;
|
| 316 |
+
Tcl_Resolve *resolvePtr;
|
| 317 |
+
Tcl_Obj *widgetClassPtr; /* class name for widget if class is a
|
| 318 |
+
* ::itcl::widget */
|
| 319 |
+
Tcl_Obj *hullTypePtr; /* hulltype name for widget if class is a
|
| 320 |
+
* ::itcl::widget */
|
| 321 |
+
Tcl_Object oPtr; /* TclOO class object */
|
| 322 |
+
Tcl_Class clsPtr; /* TclOO class */
|
| 323 |
+
Tcl_Size numCommons; /* number of commons in this class */
|
| 324 |
+
Tcl_Size numVariables; /* number of variables in this class */
|
| 325 |
+
Tcl_Size numOptions; /* number of options in this class */
|
| 326 |
+
Tcl_Size unique; /* unique number for #auto generation */
|
| 327 |
+
int flags; /* maintains class status */
|
| 328 |
+
Tcl_Size callRefCount; /* prevent deleting of class if refcount>1 */
|
| 329 |
+
Tcl_Obj *typeConstructorPtr; /* initialization for types */
|
| 330 |
+
int destructorHasBeenCalled; /* prevent multiple invocations of destrcutor */
|
| 331 |
+
Tcl_Size refCount;
|
| 332 |
+
} ItclClass;
|
| 333 |
+
|
| 334 |
+
typedef struct ItclHierIter {
|
| 335 |
+
ItclClass *current; /* current position in hierarchy */
|
| 336 |
+
Itcl_Stack stack; /* stack used for traversal */
|
| 337 |
+
} ItclHierIter;
|
| 338 |
+
|
| 339 |
+
#define ITCL_OBJECT_IS_DELETED 0x01
|
| 340 |
+
#define ITCL_OBJECT_IS_DESTRUCTED 0x02
|
| 341 |
+
#define ITCL_OBJECT_IS_DESTROYED 0x04
|
| 342 |
+
#define ITCL_OBJECT_IS_RENAMED 0x08
|
| 343 |
+
#define ITCL_OBJECT_CLASS_DESTRUCTED 0x10
|
| 344 |
+
#define ITCL_TCLOO_OBJECT_IS_DELETED 0x20
|
| 345 |
+
#define ITCL_OBJECT_DESTRUCT_ERROR 0x40
|
| 346 |
+
#define ITCL_OBJECT_SHOULD_VARNS_DELETE 0x80
|
| 347 |
+
#define ITCL_OBJECT_ROOT_METHOD 0x8000
|
| 348 |
+
|
| 349 |
+
/*
|
| 350 |
+
* Representation for each [incr Tcl] object.
|
| 351 |
+
*/
|
| 352 |
+
typedef struct ItclObject {
|
| 353 |
+
ItclClass *iclsPtr; /* most-specific class */
|
| 354 |
+
Tcl_Command accessCmd; /* object access command */
|
| 355 |
+
|
| 356 |
+
Tcl_HashTable *constructed; /* temp storage used during construction */
|
| 357 |
+
Tcl_HashTable *destructed; /* temp storage used during destruction */
|
| 358 |
+
Tcl_HashTable objectVariables;
|
| 359 |
+
/* used for storing Tcl_Var entries for
|
| 360 |
+
* variable resolving, key is ivPtr of
|
| 361 |
+
* variable, value is varPtr */
|
| 362 |
+
Tcl_HashTable objectOptions; /* definitions for all option members
|
| 363 |
+
in this object. Look up option namePtr
|
| 364 |
+
names and get back ItclOption* ptrs */
|
| 365 |
+
Tcl_HashTable objectComponents; /* definitions for all component members
|
| 366 |
+
in this object. Look up component namePtr
|
| 367 |
+
names and get back ItclComponent* ptrs */
|
| 368 |
+
Tcl_HashTable objectMethodVariables;
|
| 369 |
+
/* definitions for all methodvariable members
|
| 370 |
+
in this object. Look up methodvariable
|
| 371 |
+
namePtr names and get back
|
| 372 |
+
ItclMethodVariable* ptrs */
|
| 373 |
+
Tcl_HashTable objectDelegatedOptions;
|
| 374 |
+
/* definitions for all delegated option
|
| 375 |
+
members in this object. Look up option
|
| 376 |
+
namePtr names and get back
|
| 377 |
+
ItclOption* ptrs */
|
| 378 |
+
Tcl_HashTable objectDelegatedFunctions;
|
| 379 |
+
/* definitions for all delegated function
|
| 380 |
+
members in this object. Look up function
|
| 381 |
+
namePtr names and get back
|
| 382 |
+
ItclMemberFunc * ptrs */
|
| 383 |
+
Tcl_HashTable contextCache; /* cache for function contexts */
|
| 384 |
+
Tcl_Obj *namePtr;
|
| 385 |
+
Tcl_Obj *origNamePtr; /* the original name before any rename */
|
| 386 |
+
Tcl_Obj *createNamePtr; /* the temp name before any rename
|
| 387 |
+
* mostly used for widgetadaptor
|
| 388 |
+
* because that hijackes the name
|
| 389 |
+
* often when installing the hull */
|
| 390 |
+
Tcl_Interp *interp;
|
| 391 |
+
ItclObjectInfo *infoPtr;
|
| 392 |
+
Tcl_Obj *varNsNamePtr;
|
| 393 |
+
Tcl_Object oPtr; /* the TclOO object */
|
| 394 |
+
Tcl_Resolve *resolvePtr;
|
| 395 |
+
int flags;
|
| 396 |
+
Tcl_Size callRefCount; /* prevent deleting of object if refcount > 1 */
|
| 397 |
+
Tcl_Obj *hullWindowNamePtr; /* the window path name for the hull
|
| 398 |
+
* (before renaming in installhull) */
|
| 399 |
+
int destructorHasBeenCalled; /* is set when the destructor is called
|
| 400 |
+
* to avoid callin destructor twice */
|
| 401 |
+
int noComponentTrace; /* don't call component traces if
|
| 402 |
+
* setting components in DelegationInstall */
|
| 403 |
+
int hadConstructorError; /* needed for multiple calls of CallItclObjectCmd */
|
| 404 |
+
} ItclObject;
|
| 405 |
+
|
| 406 |
+
#define ITCL_IGNORE_ERRS 0x002 /* useful for construction/destruction */
|
| 407 |
+
|
| 408 |
+
typedef struct ItclResolveInfo {
|
| 409 |
+
int flags;
|
| 410 |
+
ItclClass *iclsPtr;
|
| 411 |
+
ItclObject *ioPtr;
|
| 412 |
+
} ItclResolveInfo;
|
| 413 |
+
|
| 414 |
+
#define ITCL_RESOLVE_CLASS 0x01
|
| 415 |
+
#define ITCL_RESOLVE_OBJECT 0x02
|
| 416 |
+
|
| 417 |
+
/*
|
| 418 |
+
* Implementation for any code body in an [incr Tcl] class.
|
| 419 |
+
*/
|
| 420 |
+
typedef struct ItclMemberCode {
|
| 421 |
+
int flags; /* flags describing implementation */
|
| 422 |
+
Tcl_Size argcount; /* number of args in arglist */
|
| 423 |
+
Tcl_Size maxargcount; /* max number of args in arglist */
|
| 424 |
+
Tcl_Obj *usagePtr; /* usage string for error messages */
|
| 425 |
+
Tcl_Obj *argumentPtr; /* the function arguments */
|
| 426 |
+
Tcl_Obj *bodyPtr; /* the function body */
|
| 427 |
+
ItclArgList *argListPtr; /* the parsed arguments */
|
| 428 |
+
union {
|
| 429 |
+
Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */
|
| 430 |
+
Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */
|
| 431 |
+
} cfunc;
|
| 432 |
+
void *clientData; /* client data for C implementations */
|
| 433 |
+
} ItclMemberCode;
|
| 434 |
+
|
| 435 |
+
/*
|
| 436 |
+
* Flag bits for ItclMemberCode:
|
| 437 |
+
*/
|
| 438 |
+
#define ITCL_IMPLEMENT_NONE 0x001 /* no implementation */
|
| 439 |
+
#define ITCL_IMPLEMENT_TCL 0x002 /* Tcl implementation */
|
| 440 |
+
#define ITCL_IMPLEMENT_ARGCMD 0x004 /* (argc,argv) C implementation */
|
| 441 |
+
#define ITCL_IMPLEMENT_OBJCMD 0x008 /* (objc,objv) C implementation */
|
| 442 |
+
#define ITCL_IMPLEMENT_C 0x00c /* either kind of C implementation */
|
| 443 |
+
|
| 444 |
+
#define Itcl_IsMemberCodeImplemented(mcode) \
|
| 445 |
+
(((mcode)->flags & ITCL_IMPLEMENT_NONE) == 0)
|
| 446 |
+
|
| 447 |
+
/*
|
| 448 |
+
* Flag bits for ItclMember: functions and variables
|
| 449 |
+
*/
|
| 450 |
+
#define ITCL_COMMON 0x010 /* non-zero => is a "proc" or common
|
| 451 |
+
* variable */
|
| 452 |
+
|
| 453 |
+
/*
|
| 454 |
+
* Flag bits for ItclMember: functions
|
| 455 |
+
*/
|
| 456 |
+
#define ITCL_CONSTRUCTOR 0x020 /* non-zero => is a constructor */
|
| 457 |
+
#define ITCL_DESTRUCTOR 0x040 /* non-zero => is a destructor */
|
| 458 |
+
#define ITCL_ARG_SPEC 0x080 /* non-zero => has an argument spec */
|
| 459 |
+
#define ITCL_BODY_SPEC 0x100 /* non-zero => has an body spec */
|
| 460 |
+
#define ITCL_BUILTIN 0x400 /* non-zero => built-in method */
|
| 461 |
+
#define ITCL_COMPONENT 0x800 /* non-zero => component */
|
| 462 |
+
#define ITCL_TYPE_METHOD 0x1000 /* non-zero => typemethod */
|
| 463 |
+
#define ITCL_METHOD 0x2000 /* non-zero => method */
|
| 464 |
+
|
| 465 |
+
/*
|
| 466 |
+
* Flag bits for ItclMember: variables
|
| 467 |
+
*/
|
| 468 |
+
#define ITCL_THIS_VAR 0x20 /* non-zero => built-in "this" variable */
|
| 469 |
+
#define ITCL_OPTIONS_VAR 0x40 /* non-zero => built-in "itcl_options"
|
| 470 |
+
* variable */
|
| 471 |
+
#define ITCL_TYPE_VAR 0x80 /* non-zero => built-in "type" variable */
|
| 472 |
+
/* no longer used ??? */
|
| 473 |
+
#define ITCL_SELF_VAR 0x100 /* non-zero => built-in "self" variable */
|
| 474 |
+
#define ITCL_SELFNS_VAR 0x200 /* non-zero => built-in "selfns"
|
| 475 |
+
* variable */
|
| 476 |
+
#define ITCL_WIN_VAR 0x400 /* non-zero => built-in "win" variable */
|
| 477 |
+
#define ITCL_COMPONENT_VAR 0x800 /* non-zero => component variable */
|
| 478 |
+
#define ITCL_HULL_VAR 0x1000 /* non-zero => built-in "itcl_hull"
|
| 479 |
+
* variable */
|
| 480 |
+
#define ITCL_OPTION_READONLY 0x2000 /* non-zero => readonly */
|
| 481 |
+
#define ITCL_VARIABLE 0x4000 /* non-zero => normal variable */
|
| 482 |
+
#define ITCL_TYPE_VARIABLE 0x8000 /* non-zero => typevariable */
|
| 483 |
+
#define ITCL_OPTION_INITTED 0x10000 /* non-zero => option has been initialized */
|
| 484 |
+
#define ITCL_OPTION_COMP_VAR 0x20000 /* variable to collect option components of extendedclass */
|
| 485 |
+
|
| 486 |
+
/*
|
| 487 |
+
* Instance components.
|
| 488 |
+
*/
|
| 489 |
+
struct ItclVariable;
|
| 490 |
+
typedef struct ItclComponent {
|
| 491 |
+
Tcl_Obj *namePtr; /* member name */
|
| 492 |
+
struct ItclVariable *ivPtr; /* variable for this component */
|
| 493 |
+
int flags;
|
| 494 |
+
int haveKeptOptions;
|
| 495 |
+
Tcl_HashTable keptOptions; /* table of options to keep */
|
| 496 |
+
} ItclComponent;
|
| 497 |
+
|
| 498 |
+
#define ITCL_COMPONENT_INHERIT 0x01
|
| 499 |
+
#define ITCL_COMPONENT_PUBLIC 0x02
|
| 500 |
+
|
| 501 |
+
typedef struct ItclDelegatedFunction {
|
| 502 |
+
Tcl_Obj *namePtr;
|
| 503 |
+
ItclComponent *icPtr;
|
| 504 |
+
Tcl_Obj *asPtr;
|
| 505 |
+
Tcl_Obj *usingPtr;
|
| 506 |
+
Tcl_HashTable exceptions;
|
| 507 |
+
int flags;
|
| 508 |
+
} ItclDelegatedFunction;
|
| 509 |
+
|
| 510 |
+
/*
|
| 511 |
+
* Representation of member functions in an [incr Tcl] class.
|
| 512 |
+
*/
|
| 513 |
+
typedef struct ItclMemberFunc {
|
| 514 |
+
Tcl_Obj* namePtr; /* member name */
|
| 515 |
+
Tcl_Obj* fullNamePtr; /* member name with "class::" qualifier */
|
| 516 |
+
ItclClass* iclsPtr; /* class containing this member */
|
| 517 |
+
int protection; /* protection level */
|
| 518 |
+
int flags; /* flags describing member (see above) */
|
| 519 |
+
ItclObjectInfo *infoPtr;
|
| 520 |
+
ItclMemberCode *codePtr; /* code associated with member */
|
| 521 |
+
Tcl_Command accessCmd; /* Tcl command installed for this function */
|
| 522 |
+
Tcl_Size argcount; /* number of args in arglist */
|
| 523 |
+
Tcl_Size maxargcount; /* max number of args in arglist */
|
| 524 |
+
Tcl_Obj *usagePtr; /* usage string for error messages */
|
| 525 |
+
Tcl_Obj *argumentPtr; /* the function arguments */
|
| 526 |
+
Tcl_Obj *builtinArgumentPtr; /* the function arguments for builtin functions */
|
| 527 |
+
Tcl_Obj *origArgsPtr; /* the argument string of the original definition */
|
| 528 |
+
Tcl_Obj *bodyPtr; /* the function body */
|
| 529 |
+
ItclArgList *argListPtr; /* the parsed arguments */
|
| 530 |
+
ItclClass *declaringClassPtr; /* the class which declared the method/proc */
|
| 531 |
+
void *tmPtr; /* TclOO methodPtr */
|
| 532 |
+
ItclDelegatedFunction *idmPtr;
|
| 533 |
+
/* if the function is delegated != NULL */
|
| 534 |
+
} ItclMemberFunc;
|
| 535 |
+
|
| 536 |
+
/*
|
| 537 |
+
* Instance variables.
|
| 538 |
+
*/
|
| 539 |
+
typedef struct ItclVariable {
|
| 540 |
+
Tcl_Obj *namePtr; /* member name */
|
| 541 |
+
Tcl_Obj *fullNamePtr; /* member name with "class::" qualifier */
|
| 542 |
+
ItclClass *iclsPtr; /* class containing this member */
|
| 543 |
+
ItclObjectInfo *infoPtr;
|
| 544 |
+
ItclMemberCode *codePtr; /* code associated with member */
|
| 545 |
+
Tcl_Obj *init; /* initial value */
|
| 546 |
+
Tcl_Obj *arrayInitPtr; /* initial value if variable should be array */
|
| 547 |
+
int protection; /* protection level */
|
| 548 |
+
int flags; /* flags describing member (see below) */
|
| 549 |
+
int initted; /* is set when first time initted, to check
|
| 550 |
+
* for example itcl_hull var, which can be only
|
| 551 |
+
* initialized once */
|
| 552 |
+
} ItclVariable;
|
| 553 |
+
|
| 554 |
+
|
| 555 |
+
struct ItclOption;
|
| 556 |
+
|
| 557 |
+
typedef struct ItclDelegatedOption {
|
| 558 |
+
Tcl_Obj *namePtr;
|
| 559 |
+
Tcl_Obj *resourceNamePtr;
|
| 560 |
+
Tcl_Obj *classNamePtr;
|
| 561 |
+
struct ItclOption *ioptPtr; /* the option name or null for "*" */
|
| 562 |
+
ItclComponent *icPtr; /* the component where the delegation goes
|
| 563 |
+
* to */
|
| 564 |
+
Tcl_Obj *asPtr;
|
| 565 |
+
Tcl_HashTable exceptions; /* exceptions from delegation */
|
| 566 |
+
} ItclDelegatedOption;
|
| 567 |
+
|
| 568 |
+
/*
|
| 569 |
+
* Instance options.
|
| 570 |
+
*/
|
| 571 |
+
typedef struct ItclOption {
|
| 572 |
+
/* within a class hierarchy there must be only
|
| 573 |
+
* one option with the same name !! */
|
| 574 |
+
Tcl_Obj *namePtr; /* member name */
|
| 575 |
+
Tcl_Obj *fullNamePtr; /* member name with "class::" qualifier */
|
| 576 |
+
Tcl_Obj *resourceNamePtr;
|
| 577 |
+
Tcl_Obj *classNamePtr;
|
| 578 |
+
ItclClass *iclsPtr; /* class containing this member */
|
| 579 |
+
int protection; /* protection level */
|
| 580 |
+
int flags; /* flags describing member (see below) */
|
| 581 |
+
ItclMemberCode *codePtr; /* code associated with member */
|
| 582 |
+
Tcl_Obj *defaultValuePtr; /* initial value */
|
| 583 |
+
Tcl_Obj *cgetMethodPtr;
|
| 584 |
+
Tcl_Obj *cgetMethodVarPtr;
|
| 585 |
+
Tcl_Obj *configureMethodPtr;
|
| 586 |
+
Tcl_Obj *configureMethodVarPtr;
|
| 587 |
+
Tcl_Obj *validateMethodPtr;
|
| 588 |
+
Tcl_Obj *validateMethodVarPtr;
|
| 589 |
+
ItclDelegatedOption *idoPtr;
|
| 590 |
+
/* if the option is delegated != NULL */
|
| 591 |
+
} ItclOption;
|
| 592 |
+
|
| 593 |
+
/*
|
| 594 |
+
* Instance methodvariables.
|
| 595 |
+
*/
|
| 596 |
+
typedef struct ItclMethodVariable {
|
| 597 |
+
Tcl_Obj *namePtr; /* member name */
|
| 598 |
+
Tcl_Obj *fullNamePtr; /* member name with "class::" qualifier */
|
| 599 |
+
ItclClass *iclsPtr; /* class containing this member */
|
| 600 |
+
int protection; /* protection level */
|
| 601 |
+
int flags; /* flags describing member (see below) */
|
| 602 |
+
Tcl_Obj *defaultValuePtr;
|
| 603 |
+
Tcl_Obj *callbackPtr;
|
| 604 |
+
} ItclMethodVariable;
|
| 605 |
+
|
| 606 |
+
#define VAR_TYPE_VARIABLE 1
|
| 607 |
+
#define VAR_TYPE_COMMON 2
|
| 608 |
+
|
| 609 |
+
#define CMD_TYPE_METHOD 1
|
| 610 |
+
#define CMD_TYPE_PROC 2
|
| 611 |
+
|
| 612 |
+
typedef struct ItclClassCmdInfo {
|
| 613 |
+
int type;
|
| 614 |
+
int protection;
|
| 615 |
+
#if TCL_MAJOR_VERSION == 8
|
| 616 |
+
int cmdNum; /* not actually used */
|
| 617 |
+
#endif
|
| 618 |
+
Tcl_Namespace *nsPtr;
|
| 619 |
+
Tcl_Namespace *declaringNsPtr;
|
| 620 |
+
} ItclClassCmdInfo;
|
| 621 |
+
|
| 622 |
+
/*
|
| 623 |
+
* Instance variable lookup entry.
|
| 624 |
+
*/
|
| 625 |
+
typedef struct ItclVarLookup {
|
| 626 |
+
ItclVariable* ivPtr; /* variable definition */
|
| 627 |
+
int usage; /* number of uses for this record */
|
| 628 |
+
int accessible; /* non-zero => accessible from class with
|
| 629 |
+
* this lookup record in its resolveVars */
|
| 630 |
+
char *leastQualName; /* simplist name for this variable, with
|
| 631 |
+
* the fewest qualifiers. This string is
|
| 632 |
+
* taken from the resolveVars table, so
|
| 633 |
+
* it shouldn't be freed. */
|
| 634 |
+
Tcl_Size varNum;
|
| 635 |
+
Tcl_Var varPtr;
|
| 636 |
+
} ItclVarLookup;
|
| 637 |
+
|
| 638 |
+
/*
|
| 639 |
+
* Instance command lookup entry.
|
| 640 |
+
*/
|
| 641 |
+
typedef struct ItclCmdLookup {
|
| 642 |
+
ItclMemberFunc* imPtr; /* function definition */
|
| 643 |
+
#if TCL_MAJOR_VERSION == 8
|
| 644 |
+
int cmdNum; /* not actually used */
|
| 645 |
+
#endif
|
| 646 |
+
ItclClassCmdInfo *classCmdInfoPtr;
|
| 647 |
+
Tcl_Command cmdPtr;
|
| 648 |
+
} ItclCmdLookup;
|
| 649 |
+
|
| 650 |
+
typedef struct ItclCallContext {
|
| 651 |
+
int objectFlags;
|
| 652 |
+
Tcl_Namespace *nsPtr;
|
| 653 |
+
ItclObject *ioPtr;
|
| 654 |
+
ItclMemberFunc *imPtr;
|
| 655 |
+
Tcl_Size refCount;
|
| 656 |
+
} ItclCallContext;
|
| 657 |
+
|
| 658 |
+
/*
|
| 659 |
+
* The macro below is used to modify a "char" value (e.g. by casting
|
| 660 |
+
* it to an unsigned character) so that it can be used safely with
|
| 661 |
+
* macros such as isspace.
|
| 662 |
+
*/
|
| 663 |
+
|
| 664 |
+
#define UCHAR(c) ((unsigned char) (c))
|
| 665 |
+
/*
|
| 666 |
+
* Macros used to cast between pointers and integers (e.g. when storing an int
|
| 667 |
+
* in ClientData), on 64-bit architectures they avoid gcc warning about "cast
|
| 668 |
+
* to/from pointer from/to integer of different size".
|
| 669 |
+
*/
|
| 670 |
+
|
| 671 |
+
#if !defined(INT2PTR)
|
| 672 |
+
# define INT2PTR(p) ((void *)(ptrdiff_t)(p))
|
| 673 |
+
#endif
|
| 674 |
+
#if !defined(PTR2INT)
|
| 675 |
+
# define PTR2INT(p) ((ptrdiff_t)(p))
|
| 676 |
+
#endif
|
| 677 |
+
|
| 678 |
+
#ifdef ITCL_DEBUG
|
| 679 |
+
MODULE_SCOPE int _itcl_debug_level;
|
| 680 |
+
MODULE_SCOPE void ItclShowArgs(int level, const char *str, size_t objc,
|
| 681 |
+
Tcl_Obj *const *objv);
|
| 682 |
+
#else
|
| 683 |
+
#define ItclShowArgs(a,b,c,d) do {(void)(c);(void)(d);} while(0)
|
| 684 |
+
#endif
|
| 685 |
+
|
| 686 |
+
MODULE_SCOPE Tcl_ObjCmdProc ItclCallCCommand;
|
| 687 |
+
MODULE_SCOPE Tcl_ObjCmdProc ItclObjectUnknownCommand;
|
| 688 |
+
MODULE_SCOPE int ItclCheckCallProc(void *clientData, Tcl_Interp *interp,
|
| 689 |
+
Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished);
|
| 690 |
+
|
| 691 |
+
MODULE_SCOPE void ItclPreserveClass(ItclClass *iclsPtr);
|
| 692 |
+
MODULE_SCOPE void ItclReleaseClass(void *iclsPtr);
|
| 693 |
+
|
| 694 |
+
MODULE_SCOPE ItclFoundation *ItclGetFoundation(Tcl_Interp *interp);
|
| 695 |
+
MODULE_SCOPE Tcl_ObjCmdProc ItclClassCommandDispatcher;
|
| 696 |
+
MODULE_SCOPE Tcl_Command Itcl_CmdAliasProc(Tcl_Interp *interp,
|
| 697 |
+
Tcl_Namespace *nsPtr, const char *cmdName, void *clientData);
|
| 698 |
+
MODULE_SCOPE Tcl_Var Itcl_VarAliasProc(Tcl_Interp *interp,
|
| 699 |
+
Tcl_Namespace *nsPtr, const char *VarName, void *clientData);
|
| 700 |
+
MODULE_SCOPE int ItclIsClass(Tcl_Interp *interp, Tcl_Command cmd);
|
| 701 |
+
MODULE_SCOPE int ItclCheckCallMethod(void *clientData, Tcl_Interp *interp,
|
| 702 |
+
Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished);
|
| 703 |
+
MODULE_SCOPE int ItclAfterCallMethod(void *clientData, Tcl_Interp *interp,
|
| 704 |
+
Tcl_ObjectContext contextPtr, Tcl_Namespace *nsPtr, int result);
|
| 705 |
+
MODULE_SCOPE void ItclReportObjectUsage(Tcl_Interp *interp,
|
| 706 |
+
ItclObject *contextIoPtr, Tcl_Namespace *callerNsPtr,
|
| 707 |
+
Tcl_Namespace *contextNsPtr);
|
| 708 |
+
MODULE_SCOPE int ItclMapMethodNameProc(Tcl_Interp *interp, Tcl_Object oPtr,
|
| 709 |
+
Tcl_Class *startClsPtr, Tcl_Obj *methodObj);
|
| 710 |
+
MODULE_SCOPE int ItclCreateArgList(Tcl_Interp *interp, const char *str,
|
| 711 |
+
Tcl_Size *argcPtr, Tcl_Size *maxArgcPtr, Tcl_Obj **usagePtr,
|
| 712 |
+
ItclArgList **arglistPtrPtr, ItclMemberFunc *imPtr,
|
| 713 |
+
const char *commandName);
|
| 714 |
+
MODULE_SCOPE int ItclObjectCmd(void *clientData, Tcl_Interp *interp,
|
| 715 |
+
Tcl_Object oPtr, Tcl_Class clsPtr, size_t objc, Tcl_Obj *const *objv);
|
| 716 |
+
MODULE_SCOPE int ItclCreateObject (Tcl_Interp *interp, const char* name,
|
| 717 |
+
ItclClass *iclsPtr, size_t objc, Tcl_Obj *const objv[]);
|
| 718 |
+
MODULE_SCOPE void ItclDeleteObjectVariablesNamespace(Tcl_Interp *interp,
|
| 719 |
+
ItclObject *ioPtr);
|
| 720 |
+
MODULE_SCOPE void ItclDeleteClassVariablesNamespace(Tcl_Interp *interp,
|
| 721 |
+
ItclClass *iclsPtr);
|
| 722 |
+
MODULE_SCOPE int ItclInfoInit(Tcl_Interp *interp, ItclObjectInfo *infoPtr);
|
| 723 |
+
|
| 724 |
+
MODULE_SCOPE Tcl_HashEntry *ItclResolveVarEntry(
|
| 725 |
+
ItclClass* iclsPtr, const char *varName);
|
| 726 |
+
|
| 727 |
+
struct Tcl_ResolvedVarInfo;
|
| 728 |
+
MODULE_SCOPE int Itcl_ClassCmdResolver(Tcl_Interp *interp, const char* name,
|
| 729 |
+
Tcl_Namespace *nsPtr, int flags, Tcl_Command *rPtr);
|
| 730 |
+
MODULE_SCOPE int Itcl_ClassVarResolver(Tcl_Interp *interp, const char* name,
|
| 731 |
+
Tcl_Namespace *nsPtr, int flags, Tcl_Var *rPtr);
|
| 732 |
+
MODULE_SCOPE int Itcl_ClassCompiledVarResolver(Tcl_Interp *interp,
|
| 733 |
+
const char* name, Tcl_Size length, Tcl_Namespace *nsPtr,
|
| 734 |
+
struct Tcl_ResolvedVarInfo **rPtr);
|
| 735 |
+
MODULE_SCOPE int Itcl_ClassCmdResolver2(Tcl_Interp *interp, const char* name,
|
| 736 |
+
Tcl_Namespace *nsPtr, int flags, Tcl_Command *rPtr);
|
| 737 |
+
MODULE_SCOPE int Itcl_ClassVarResolver2(Tcl_Interp *interp, const char* name,
|
| 738 |
+
Tcl_Namespace *nsPtr, int flags, Tcl_Var *rPtr);
|
| 739 |
+
MODULE_SCOPE int ItclSetParserResolver(Tcl_Namespace *nsPtr);
|
| 740 |
+
MODULE_SCOPE void ItclProcErrorProc(Tcl_Interp *interp, Tcl_Obj *procNameObj);
|
| 741 |
+
MODULE_SCOPE int Itcl_CreateOption (Tcl_Interp *interp, ItclClass *iclsPtr,
|
| 742 |
+
ItclOption *ioptPtr);
|
| 743 |
+
MODULE_SCOPE int ItclCreateMethodVariable(Tcl_Interp *interp,
|
| 744 |
+
ItclVariable *ivPtr, Tcl_Obj* defaultPtr, Tcl_Obj* callbackPtr,
|
| 745 |
+
ItclMethodVariable** imvPtrPtr);
|
| 746 |
+
MODULE_SCOPE int DelegationInstall(Tcl_Interp *interp, ItclObject *ioPtr,
|
| 747 |
+
ItclClass *iclsPtr);
|
| 748 |
+
MODULE_SCOPE ItclClass *ItclNamespace2Class(Tcl_Namespace *nsPtr);
|
| 749 |
+
MODULE_SCOPE const char* ItclGetCommonInstanceVar(Tcl_Interp *interp,
|
| 750 |
+
const char *name, const char *name2, ItclObject *contextIoPtr,
|
| 751 |
+
ItclClass *contextIclsPtr);
|
| 752 |
+
MODULE_SCOPE int ItclCreateMethod(Tcl_Interp* interp, ItclClass *iclsPtr,
|
| 753 |
+
Tcl_Obj *namePtr, const char* arglist, const char* body,
|
| 754 |
+
ItclMemberFunc **imPtrPtr);
|
| 755 |
+
MODULE_SCOPE int Itcl_WidgetParseInit(Tcl_Interp *interp,
|
| 756 |
+
ItclObjectInfo *infoPtr);
|
| 757 |
+
MODULE_SCOPE void ItclDeleteObjectMetadata(void *clientData);
|
| 758 |
+
MODULE_SCOPE void ItclDeleteClassMetadata(void *clientData);
|
| 759 |
+
MODULE_SCOPE void ItclDeleteArgList(ItclArgList *arglistPtr);
|
| 760 |
+
MODULE_SCOPE int Itcl_ClassOptionCmd(void *clientData, Tcl_Interp *interp,
|
| 761 |
+
int objc, Tcl_Obj *const objv[]);
|
| 762 |
+
MODULE_SCOPE int DelegatedOptionsInstall(Tcl_Interp *interp,
|
| 763 |
+
ItclClass *iclsPtr);
|
| 764 |
+
MODULE_SCOPE int Itcl_HandleDelegateOptionCmd(Tcl_Interp *interp,
|
| 765 |
+
ItclObject *ioPtr, ItclClass *iclsPtr, ItclDelegatedOption **idoPtrPtr,
|
| 766 |
+
Tcl_Size objc, Tcl_Obj *const objv[]);
|
| 767 |
+
MODULE_SCOPE int Itcl_HandleDelegateMethodCmd(Tcl_Interp *interp,
|
| 768 |
+
ItclObject *ioPtr, ItclClass *iclsPtr,
|
| 769 |
+
ItclDelegatedFunction **idmPtrPtr, Tcl_Size objc, Tcl_Obj *const objv[]);
|
| 770 |
+
MODULE_SCOPE int DelegateFunction(Tcl_Interp *interp, ItclObject *ioPtr,
|
| 771 |
+
ItclClass *iclsPtr, Tcl_Obj *componentNamePtr,
|
| 772 |
+
ItclDelegatedFunction *idmPtr);
|
| 773 |
+
MODULE_SCOPE int ItclInitObjectMethodVariables(Tcl_Interp *interp,
|
| 774 |
+
ItclObject *ioPtr, ItclClass *iclsPtr, const char *name);
|
| 775 |
+
MODULE_SCOPE int InitTclOOFunctionPointers(Tcl_Interp *interp);
|
| 776 |
+
MODULE_SCOPE ItclOption* ItclNewOption(Tcl_Interp *interp, ItclObject *ioPtr,
|
| 777 |
+
ItclClass *iclsPtr, Tcl_Obj *namePtr, const char *resourceName,
|
| 778 |
+
const char *className, char *init, ItclMemberCode *mCodePtr);
|
| 779 |
+
MODULE_SCOPE int ItclParseOption(ItclObjectInfo *infoPtr, Tcl_Interp *interp,
|
| 780 |
+
size_t objc, Tcl_Obj *const objv[], ItclClass *iclsPtr,
|
| 781 |
+
ItclObject *ioPtr, ItclOption **ioptPtrPtr);
|
| 782 |
+
MODULE_SCOPE void ItclDestroyClassNamesp(void *cdata);
|
| 783 |
+
MODULE_SCOPE int ExpandDelegateAs(Tcl_Interp *interp, ItclObject *ioPtr,
|
| 784 |
+
ItclClass *iclsPtr, ItclDelegatedFunction *idmPtr,
|
| 785 |
+
const char *funcName, Tcl_Obj *listPtr);
|
| 786 |
+
MODULE_SCOPE int ItclCheckForInitializedComponents(Tcl_Interp *interp,
|
| 787 |
+
ItclClass *iclsPtr, ItclObject *ioPtr);
|
| 788 |
+
MODULE_SCOPE int ItclCreateDelegatedFunction(Tcl_Interp *interp,
|
| 789 |
+
ItclClass *iclsPtr, Tcl_Obj *methodNamePtr, ItclComponent *icPtr,
|
| 790 |
+
Tcl_Obj *targetPtr, Tcl_Obj *usingPtr, Tcl_Obj *exceptionsPtr,
|
| 791 |
+
ItclDelegatedFunction **idmPtrPtr);
|
| 792 |
+
MODULE_SCOPE void ItclDeleteDelegatedOption(char *cdata);
|
| 793 |
+
MODULE_SCOPE void Itcl_FinishList();
|
| 794 |
+
MODULE_SCOPE void ItclDeleteDelegatedFunction(ItclDelegatedFunction *idmPtr);
|
| 795 |
+
MODULE_SCOPE void ItclFinishEnsemble(ItclObjectInfo *infoPtr);
|
| 796 |
+
MODULE_SCOPE int Itcl_EnsembleDeleteCmd(void *clientData,
|
| 797 |
+
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
|
| 798 |
+
MODULE_SCOPE int ItclAddClassesDictInfo(Tcl_Interp *interp, ItclClass *iclsPtr);
|
| 799 |
+
MODULE_SCOPE int ItclDeleteClassesDictInfo(Tcl_Interp *interp,
|
| 800 |
+
ItclClass *iclsPtr);
|
| 801 |
+
MODULE_SCOPE int ItclAddObjectsDictInfo(Tcl_Interp *interp, ItclObject *ioPtr);
|
| 802 |
+
MODULE_SCOPE int ItclDeleteObjectsDictInfo(Tcl_Interp *interp,
|
| 803 |
+
ItclObject *ioPtr);
|
| 804 |
+
MODULE_SCOPE int ItclAddOptionDictInfo(Tcl_Interp *interp, ItclClass *iclsPtr,
|
| 805 |
+
ItclOption *ioptPtr);
|
| 806 |
+
MODULE_SCOPE int ItclAddDelegatedOptionDictInfo(Tcl_Interp *interp,
|
| 807 |
+
ItclClass *iclsPtr, ItclDelegatedOption *idoPtr);
|
| 808 |
+
MODULE_SCOPE int ItclAddClassComponentDictInfo(Tcl_Interp *interp,
|
| 809 |
+
ItclClass *iclsPtr, ItclComponent *icPtr);
|
| 810 |
+
MODULE_SCOPE int ItclAddClassVariableDictInfo(Tcl_Interp *interp,
|
| 811 |
+
ItclClass *iclsPtr, ItclVariable *ivPtr);
|
| 812 |
+
MODULE_SCOPE int ItclAddClassFunctionDictInfo(Tcl_Interp *interp,
|
| 813 |
+
ItclClass *iclsPtr, ItclMemberFunc *imPtr);
|
| 814 |
+
MODULE_SCOPE int ItclAddClassDelegatedFunctionDictInfo(Tcl_Interp *interp,
|
| 815 |
+
ItclClass *iclsPtr, ItclDelegatedFunction *idmPtr);
|
| 816 |
+
MODULE_SCOPE int ItclClassCreateObject(void *clientData, Tcl_Interp *interp,
|
| 817 |
+
Tcl_Size objc, Tcl_Obj *const objv[]);
|
| 818 |
+
|
| 819 |
+
MODULE_SCOPE void ItclRestoreInfoVars(void *clientData);
|
| 820 |
+
|
| 821 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyProcCmd;
|
| 822 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiInstallComponentCmd;
|
| 823 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiCallInstanceCmd;
|
| 824 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiGetInstanceVarCmd;
|
| 825 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyTypeMethodCmd;
|
| 826 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyMethodCmd;
|
| 827 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyTypeVarCmd;
|
| 828 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyVarCmd;
|
| 829 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiItclHullCmd;
|
| 830 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ThisCmd;
|
| 831 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ExtendedClassCmd;
|
| 832 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_TypeClassCmd;
|
| 833 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddObjectOptionCmd;
|
| 834 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddDelegatedOptionCmd;
|
| 835 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddDelegatedFunctionCmd;
|
| 836 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_SetComponentCmd;
|
| 837 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ClassHullTypeCmd;
|
| 838 |
+
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ClassWidgetClassCmd;
|
| 839 |
+
|
| 840 |
+
typedef int (ItclRootMethodProc)(ItclObject *ioPtr, Tcl_Interp *interp,
|
| 841 |
+
int objc, Tcl_Obj *const objv[]);
|
| 842 |
+
|
| 843 |
+
MODULE_SCOPE const Tcl_MethodType itclRootMethodType;
|
| 844 |
+
MODULE_SCOPE ItclRootMethodProc ItclUnknownGuts;
|
| 845 |
+
MODULE_SCOPE ItclRootMethodProc ItclConstructGuts;
|
| 846 |
+
MODULE_SCOPE ItclRootMethodProc ItclInfoGuts;
|
| 847 |
+
|
| 848 |
+
#include "itcl2TclOO.h"
|
| 849 |
+
|
| 850 |
+
/*
|
| 851 |
+
* Include all the private API, generated from itcl.decls.
|
| 852 |
+
*/
|
| 853 |
+
|
| 854 |
+
#include "itclIntDecls.h"
|
deepseek/include/menu.h
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2020 Thomas E. Dickey *
|
| 3 |
+
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Juergen Pfeifer, 1995,1997 *
|
| 32 |
+
****************************************************************************/
|
| 33 |
+
|
| 34 |
+
/* $Id: menu.h,v 1.26 2020/12/12 00:38:02 tom Exp $ */
|
| 35 |
+
|
| 36 |
+
#ifndef ETI_MENU
|
| 37 |
+
#define ETI_MENU
|
| 38 |
+
|
| 39 |
+
#ifdef AMIGA
|
| 40 |
+
#define TEXT TEXT_ncurses
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <ncursesw/curses.h>
|
| 44 |
+
#include <ncursesw/eti.h>
|
| 45 |
+
|
| 46 |
+
#ifdef __cplusplus
|
| 47 |
+
extern "C"
|
| 48 |
+
{
|
| 49 |
+
#endif
|
| 50 |
+
|
| 51 |
+
#if defined(BUILDING_MENU)
|
| 52 |
+
# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
|
| 53 |
+
#else
|
| 54 |
+
# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
|
| 58 |
+
|
| 59 |
+
#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API
|
| 60 |
+
#define MENU_EXPORT_VAR(type) MENU_IMPEXP type
|
| 61 |
+
|
| 62 |
+
typedef int Menu_Options;
|
| 63 |
+
typedef int Item_Options;
|
| 64 |
+
|
| 65 |
+
/* Menu options: */
|
| 66 |
+
#define O_ONEVALUE (0x01)
|
| 67 |
+
#define O_SHOWDESC (0x02)
|
| 68 |
+
#define O_ROWMAJOR (0x04)
|
| 69 |
+
#define O_IGNORECASE (0x08)
|
| 70 |
+
#define O_SHOWMATCH (0x10)
|
| 71 |
+
#define O_NONCYCLIC (0x20)
|
| 72 |
+
#define O_MOUSE_MENU (0x40)
|
| 73 |
+
|
| 74 |
+
/* Item options: */
|
| 75 |
+
#define O_SELECTABLE (0x01)
|
| 76 |
+
|
| 77 |
+
#if !NCURSES_OPAQUE_MENU
|
| 78 |
+
typedef struct
|
| 79 |
+
{
|
| 80 |
+
const char *str;
|
| 81 |
+
unsigned short length;
|
| 82 |
+
}
|
| 83 |
+
TEXT;
|
| 84 |
+
#endif /* !NCURSES_OPAQUE_MENU */
|
| 85 |
+
|
| 86 |
+
struct tagMENU;
|
| 87 |
+
|
| 88 |
+
typedef struct tagITEM
|
| 89 |
+
#if !NCURSES_OPAQUE_MENU
|
| 90 |
+
{
|
| 91 |
+
TEXT name; /* name of menu item */
|
| 92 |
+
TEXT description; /* description of item, optional in display */
|
| 93 |
+
struct tagMENU *imenu; /* Pointer to parent menu */
|
| 94 |
+
void *userptr; /* Pointer to user defined per item data */
|
| 95 |
+
Item_Options opt; /* Item options */
|
| 96 |
+
short index; /* Item number if connected to a menu */
|
| 97 |
+
short y; /* y and x location of item in menu */
|
| 98 |
+
short x;
|
| 99 |
+
bool value; /* Selection value */
|
| 100 |
+
|
| 101 |
+
struct tagITEM *left; /* neighbor items */
|
| 102 |
+
struct tagITEM *right;
|
| 103 |
+
struct tagITEM *up;
|
| 104 |
+
struct tagITEM *down;
|
| 105 |
+
|
| 106 |
+
}
|
| 107 |
+
#endif /* !NCURSES_OPAQUE_MENU */
|
| 108 |
+
ITEM;
|
| 109 |
+
|
| 110 |
+
typedef void (*Menu_Hook) (struct tagMENU *);
|
| 111 |
+
|
| 112 |
+
typedef struct tagMENU
|
| 113 |
+
#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
|
| 114 |
+
{
|
| 115 |
+
short height; /* Nr. of chars high */
|
| 116 |
+
short width; /* Nr. of chars wide */
|
| 117 |
+
short rows; /* Nr. of items high */
|
| 118 |
+
short cols; /* Nr. of items wide */
|
| 119 |
+
short frows; /* Nr. of formatted items high */
|
| 120 |
+
short fcols; /* Nr. of formatted items wide */
|
| 121 |
+
short arows; /* Nr. of items high (actual) */
|
| 122 |
+
short namelen; /* Max. name length */
|
| 123 |
+
short desclen; /* Max. description length */
|
| 124 |
+
short marklen; /* Length of mark, if any */
|
| 125 |
+
short itemlen; /* Length of one item */
|
| 126 |
+
short spc_desc; /* Spacing for descriptor */
|
| 127 |
+
short spc_cols; /* Spacing for columns */
|
| 128 |
+
short spc_rows; /* Spacing for rows */
|
| 129 |
+
char *pattern; /* Buffer to store match chars */
|
| 130 |
+
short pindex; /* Index into pattern buffer */
|
| 131 |
+
WINDOW *win; /* Window containing menu */
|
| 132 |
+
WINDOW *sub; /* Subwindow for menu display */
|
| 133 |
+
WINDOW *userwin; /* User's window */
|
| 134 |
+
WINDOW *usersub; /* User's subwindow */
|
| 135 |
+
ITEM **items; /* array of items */
|
| 136 |
+
short nitems; /* Nr. of items in menu */
|
| 137 |
+
ITEM *curitem; /* Current item */
|
| 138 |
+
short toprow; /* Top row of menu */
|
| 139 |
+
chtype fore; /* Selection attribute */
|
| 140 |
+
chtype back; /* Nonselection attribute */
|
| 141 |
+
chtype grey; /* Inactive attribute */
|
| 142 |
+
unsigned char pad; /* Pad character */
|
| 143 |
+
|
| 144 |
+
Menu_Hook menuinit; /* User hooks */
|
| 145 |
+
Menu_Hook menuterm;
|
| 146 |
+
Menu_Hook iteminit;
|
| 147 |
+
Menu_Hook itemterm;
|
| 148 |
+
|
| 149 |
+
void *userptr; /* Pointer to menus user data */
|
| 150 |
+
char *mark; /* Pointer to marker string */
|
| 151 |
+
|
| 152 |
+
Menu_Options opt; /* Menu options */
|
| 153 |
+
unsigned short status; /* Internal state of menu */
|
| 154 |
+
}
|
| 155 |
+
#endif /* !NCURSES_OPAQUE_MENU */
|
| 156 |
+
MENU;
|
| 157 |
+
|
| 158 |
+
/* Define keys */
|
| 159 |
+
|
| 160 |
+
#define REQ_LEFT_ITEM (KEY_MAX + 1)
|
| 161 |
+
#define REQ_RIGHT_ITEM (KEY_MAX + 2)
|
| 162 |
+
#define REQ_UP_ITEM (KEY_MAX + 3)
|
| 163 |
+
#define REQ_DOWN_ITEM (KEY_MAX + 4)
|
| 164 |
+
#define REQ_SCR_ULINE (KEY_MAX + 5)
|
| 165 |
+
#define REQ_SCR_DLINE (KEY_MAX + 6)
|
| 166 |
+
#define REQ_SCR_DPAGE (KEY_MAX + 7)
|
| 167 |
+
#define REQ_SCR_UPAGE (KEY_MAX + 8)
|
| 168 |
+
#define REQ_FIRST_ITEM (KEY_MAX + 9)
|
| 169 |
+
#define REQ_LAST_ITEM (KEY_MAX + 10)
|
| 170 |
+
#define REQ_NEXT_ITEM (KEY_MAX + 11)
|
| 171 |
+
#define REQ_PREV_ITEM (KEY_MAX + 12)
|
| 172 |
+
#define REQ_TOGGLE_ITEM (KEY_MAX + 13)
|
| 173 |
+
#define REQ_CLEAR_PATTERN (KEY_MAX + 14)
|
| 174 |
+
#define REQ_BACK_PATTERN (KEY_MAX + 15)
|
| 175 |
+
#define REQ_NEXT_MATCH (KEY_MAX + 16)
|
| 176 |
+
#define REQ_PREV_MATCH (KEY_MAX + 17)
|
| 177 |
+
|
| 178 |
+
#define MIN_MENU_COMMAND (KEY_MAX + 1)
|
| 179 |
+
#define MAX_MENU_COMMAND (KEY_MAX + 17)
|
| 180 |
+
|
| 181 |
+
/*
|
| 182 |
+
* Some AT&T code expects MAX_COMMAND to be out-of-band not
|
| 183 |
+
* just for menu commands but for forms ones as well.
|
| 184 |
+
*/
|
| 185 |
+
#if defined(MAX_COMMAND)
|
| 186 |
+
# if (MAX_MENU_COMMAND > MAX_COMMAND)
|
| 187 |
+
# error Something is wrong -- MAX_MENU_COMMAND is greater than MAX_COMMAND
|
| 188 |
+
# elif (MAX_COMMAND != (KEY_MAX + 128))
|
| 189 |
+
# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
|
| 190 |
+
# endif
|
| 191 |
+
#else
|
| 192 |
+
# define MAX_COMMAND (KEY_MAX + 128)
|
| 193 |
+
#endif
|
| 194 |
+
|
| 195 |
+
/* --------- prototypes for libmenu functions ----------------------------- */
|
| 196 |
+
|
| 197 |
+
extern MENU_EXPORT(ITEM **) menu_items(const MENU *);
|
| 198 |
+
extern MENU_EXPORT(ITEM *) current_item(const MENU *);
|
| 199 |
+
extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);
|
| 200 |
+
|
| 201 |
+
extern MENU_EXPORT(MENU *) new_menu(ITEM **);
|
| 202 |
+
|
| 203 |
+
extern MENU_EXPORT(Item_Options) item_opts(const ITEM *);
|
| 204 |
+
extern MENU_EXPORT(Menu_Options) menu_opts(const MENU *);
|
| 205 |
+
|
| 206 |
+
extern MENU_EXPORT(Menu_Hook) item_init(const MENU *);
|
| 207 |
+
extern MENU_EXPORT(Menu_Hook) item_term(const MENU *);
|
| 208 |
+
extern MENU_EXPORT(Menu_Hook) menu_init(const MENU *);
|
| 209 |
+
extern MENU_EXPORT(Menu_Hook) menu_term(const MENU *);
|
| 210 |
+
|
| 211 |
+
extern MENU_EXPORT(WINDOW *) menu_sub(const MENU *);
|
| 212 |
+
extern MENU_EXPORT(WINDOW *) menu_win(const MENU *);
|
| 213 |
+
|
| 214 |
+
extern MENU_EXPORT(const char *) item_description(const ITEM *);
|
| 215 |
+
extern MENU_EXPORT(const char *) item_name(const ITEM *);
|
| 216 |
+
extern MENU_EXPORT(const char *) menu_mark(const MENU *);
|
| 217 |
+
extern MENU_EXPORT(const char *) menu_request_name(int);
|
| 218 |
+
|
| 219 |
+
extern MENU_EXPORT(char *) menu_pattern(const MENU *);
|
| 220 |
+
|
| 221 |
+
extern MENU_EXPORT(void *) menu_userptr(const MENU *);
|
| 222 |
+
extern MENU_EXPORT(void *) item_userptr(const ITEM *);
|
| 223 |
+
|
| 224 |
+
extern MENU_EXPORT(chtype) menu_back(const MENU *);
|
| 225 |
+
extern MENU_EXPORT(chtype) menu_fore(const MENU *);
|
| 226 |
+
extern MENU_EXPORT(chtype) menu_grey(const MENU *);
|
| 227 |
+
|
| 228 |
+
extern MENU_EXPORT(int) free_item(ITEM *);
|
| 229 |
+
extern MENU_EXPORT(int) free_menu(MENU *);
|
| 230 |
+
extern MENU_EXPORT(int) item_count(const MENU *);
|
| 231 |
+
extern MENU_EXPORT(int) item_index(const ITEM *);
|
| 232 |
+
extern MENU_EXPORT(int) item_opts_off(ITEM *, Item_Options);
|
| 233 |
+
extern MENU_EXPORT(int) item_opts_on(ITEM *, Item_Options);
|
| 234 |
+
extern MENU_EXPORT(int) menu_driver(MENU *, int);
|
| 235 |
+
extern MENU_EXPORT(int) menu_opts_off(MENU *, Menu_Options);
|
| 236 |
+
extern MENU_EXPORT(int) menu_opts_on(MENU *, Menu_Options);
|
| 237 |
+
extern MENU_EXPORT(int) menu_pad(const MENU *);
|
| 238 |
+
extern MENU_EXPORT(int) pos_menu_cursor(const MENU *);
|
| 239 |
+
extern MENU_EXPORT(int) post_menu(MENU *);
|
| 240 |
+
extern MENU_EXPORT(int) scale_menu(const MENU *, int *, int *);
|
| 241 |
+
extern MENU_EXPORT(int) set_current_item(MENU *menu, ITEM *item);
|
| 242 |
+
extern MENU_EXPORT(int) set_item_init(MENU *, Menu_Hook);
|
| 243 |
+
extern MENU_EXPORT(int) set_item_opts(ITEM *, Item_Options);
|
| 244 |
+
extern MENU_EXPORT(int) set_item_term(MENU *, Menu_Hook);
|
| 245 |
+
extern MENU_EXPORT(int) set_item_userptr(ITEM *, void *);
|
| 246 |
+
extern MENU_EXPORT(int) set_item_value(ITEM *, bool);
|
| 247 |
+
extern MENU_EXPORT(int) set_menu_back(MENU *, chtype);
|
| 248 |
+
extern MENU_EXPORT(int) set_menu_fore(MENU *, chtype);
|
| 249 |
+
extern MENU_EXPORT(int) set_menu_format(MENU *, int, int);
|
| 250 |
+
extern MENU_EXPORT(int) set_menu_grey(MENU *, chtype);
|
| 251 |
+
extern MENU_EXPORT(int) set_menu_init(MENU *, Menu_Hook);
|
| 252 |
+
extern MENU_EXPORT(int) set_menu_items(MENU *, ITEM **);
|
| 253 |
+
extern MENU_EXPORT(int) set_menu_mark(MENU *, const char *);
|
| 254 |
+
extern MENU_EXPORT(int) set_menu_opts(MENU *, Menu_Options);
|
| 255 |
+
extern MENU_EXPORT(int) set_menu_pad(MENU *, int);
|
| 256 |
+
extern MENU_EXPORT(int) set_menu_pattern(MENU *, const char *);
|
| 257 |
+
extern MENU_EXPORT(int) set_menu_sub(MENU *, WINDOW *);
|
| 258 |
+
extern MENU_EXPORT(int) set_menu_term(MENU *, Menu_Hook);
|
| 259 |
+
extern MENU_EXPORT(int) set_menu_userptr(MENU *, void *);
|
| 260 |
+
extern MENU_EXPORT(int) set_menu_win(MENU *, WINDOW *);
|
| 261 |
+
extern MENU_EXPORT(int) set_top_row(MENU *, int);
|
| 262 |
+
extern MENU_EXPORT(int) top_row(const MENU *);
|
| 263 |
+
extern MENU_EXPORT(int) unpost_menu(MENU *);
|
| 264 |
+
extern MENU_EXPORT(int) menu_request_by_name(const char *);
|
| 265 |
+
extern MENU_EXPORT(int) set_menu_spacing(MENU *, int, int, int);
|
| 266 |
+
extern MENU_EXPORT(int) menu_spacing(const MENU *, int *, int *, int *);
|
| 267 |
+
|
| 268 |
+
extern MENU_EXPORT(bool) item_value(const ITEM *);
|
| 269 |
+
extern MENU_EXPORT(bool) item_visible(const ITEM *);
|
| 270 |
+
|
| 271 |
+
extern MENU_EXPORT(void) menu_format(const MENU *, int *, int *);
|
| 272 |
+
|
| 273 |
+
#if NCURSES_SP_FUNCS
|
| 274 |
+
extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN *, ITEM **);
|
| 275 |
+
#endif
|
| 276 |
+
|
| 277 |
+
#ifdef __cplusplus
|
| 278 |
+
}
|
| 279 |
+
#endif
|
| 280 |
+
|
| 281 |
+
#endif /* ETI_MENU */
|
deepseek/include/mysqlStubs.h
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*-----------------------------------------------------------------------------
|
| 3 |
+
*
|
| 4 |
+
* ./generic/mysqlStubs.h --
|
| 5 |
+
*
|
| 6 |
+
* Stubs for procedures in mysqlStubDefs.txt
|
| 7 |
+
*
|
| 8 |
+
* Generated by genExtStubs.tcl: DO NOT EDIT
|
| 9 |
+
* 2022-09-17 18:18:42Z
|
| 10 |
+
*
|
| 11 |
+
*-----------------------------------------------------------------------------
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
typedef struct mysqlStubDefs {
|
| 15 |
+
|
| 16 |
+
/* Functions from libraries: mariadbclient mariadb mysqlclient_r mysqlclient mysql */
|
| 17 |
+
|
| 18 |
+
int (STDCALL*mysql_server_initPtr)(int, char**, char**);
|
| 19 |
+
void (STDCALL*mysql_server_endPtr)(void);
|
| 20 |
+
my_ulonglong (STDCALL*mysql_affected_rowsPtr)(MYSQL*);
|
| 21 |
+
my_bool (STDCALL*mysql_autocommitPtr)(MYSQL*, my_bool);
|
| 22 |
+
my_bool (STDCALL*mysql_change_userPtr)(MYSQL*, const char*, const char*, const char*);
|
| 23 |
+
my_bool (STDCALL*mysql_closePtr)(MYSQL*);
|
| 24 |
+
my_bool (STDCALL*mysql_commitPtr)(MYSQL*);
|
| 25 |
+
unsigned int (STDCALL*mysql_errnoPtr)(MYSQL*);
|
| 26 |
+
const char* (STDCALL*mysql_errorPtr)(MYSQL*);
|
| 27 |
+
MYSQL_FIELD* (STDCALL*mysql_fetch_fieldsPtr)(MYSQL_RES*);
|
| 28 |
+
unsigned long* (STDCALL*mysql_fetch_lengthsPtr)(MYSQL_RES*);
|
| 29 |
+
MYSQL_ROW (STDCALL*mysql_fetch_rowPtr)(MYSQL_RES*);
|
| 30 |
+
unsigned int (STDCALL*mysql_field_countPtr)(MYSQL*);
|
| 31 |
+
void (STDCALL*mysql_free_resultPtr)(MYSQL_RES*);
|
| 32 |
+
unsigned long (STDCALL*mysql_get_client_versionPtr)(void);
|
| 33 |
+
MYSQL* (STDCALL*mysql_initPtr)(MYSQL*);
|
| 34 |
+
MYSQL_RES* (STDCALL*mysql_list_fieldsPtr)(MYSQL*, const char*, const char*);
|
| 35 |
+
MYSQL_RES* (STDCALL*mysql_list_tablesPtr)(MYSQL*, const char*);
|
| 36 |
+
unsigned int (STDCALL*mysql_num_fieldsPtr)(MYSQL_RES*);
|
| 37 |
+
int (STDCALL*mysql_optionsPtr)(MYSQL*, enum mysql_option, const void*);
|
| 38 |
+
int (STDCALL*mysql_queryPtr)(MYSQL*, const char*);
|
| 39 |
+
MYSQL* (STDCALL*mysql_real_connectPtr)(MYSQL*, const char*, const char*, const char*, const char*, unsigned int, const char*, unsigned long);
|
| 40 |
+
my_bool (STDCALL*mysql_rollbackPtr)(MYSQL*);
|
| 41 |
+
int (STDCALL*mysql_select_dbPtr)(MYSQL*, const char*);
|
| 42 |
+
const char* (STDCALL*mysql_sqlstatePtr)(MYSQL*);
|
| 43 |
+
my_bool (STDCALL*mysql_ssl_setPtr)(MYSQL*, const char*, const char*, const char*, const char*, const char*);
|
| 44 |
+
my_ulonglong (STDCALL*mysql_stmt_affected_rowsPtr)(MYSQL_STMT*);
|
| 45 |
+
my_bool (STDCALL*mysql_stmt_bind_paramPtr)(MYSQL_STMT*, MYSQL_BIND*);
|
| 46 |
+
my_bool (STDCALL*mysql_stmt_bind_resultPtr)(MYSQL_STMT*, MYSQL_BIND*);
|
| 47 |
+
my_bool (STDCALL*mysql_stmt_closePtr)(MYSQL_STMT*);
|
| 48 |
+
unsigned int (STDCALL*mysql_stmt_errnoPtr)(MYSQL_STMT*);
|
| 49 |
+
const char* (STDCALL*mysql_stmt_errorPtr)(MYSQL_STMT*);
|
| 50 |
+
int (STDCALL*mysql_stmt_executePtr)(MYSQL_STMT*);
|
| 51 |
+
int (STDCALL*mysql_stmt_fetchPtr)(MYSQL_STMT*);
|
| 52 |
+
int (STDCALL*mysql_stmt_fetch_columnPtr)(MYSQL_STMT*, MYSQL_BIND*, unsigned int, unsigned long);
|
| 53 |
+
MYSQL_STMT* (STDCALL*mysql_stmt_initPtr)(MYSQL*);
|
| 54 |
+
int (STDCALL*mysql_stmt_preparePtr)(MYSQL_STMT*, const char*, unsigned long);
|
| 55 |
+
MYSQL_RES* (STDCALL*mysql_stmt_result_metadataPtr)(MYSQL_STMT*);
|
| 56 |
+
const char* (STDCALL*mysql_stmt_sqlstatePtr)(MYSQL_STMT*);
|
| 57 |
+
int (STDCALL*mysql_stmt_store_resultPtr)(MYSQL_STMT*);
|
| 58 |
+
MYSQL_RES* (STDCALL*mysql_store_resultPtr)(MYSQL*);
|
| 59 |
+
} mysqlStubDefs;
|
| 60 |
+
#define mysql_server_init (mysqlStubs->mysql_server_initPtr)
|
| 61 |
+
#define mysql_server_end (mysqlStubs->mysql_server_endPtr)
|
| 62 |
+
#define mysql_affected_rows (mysqlStubs->mysql_affected_rowsPtr)
|
| 63 |
+
#define mysql_autocommit (mysqlStubs->mysql_autocommitPtr)
|
| 64 |
+
#define mysql_change_user (mysqlStubs->mysql_change_userPtr)
|
| 65 |
+
#define mysql_close (mysqlStubs->mysql_closePtr)
|
| 66 |
+
#define mysql_commit (mysqlStubs->mysql_commitPtr)
|
| 67 |
+
#define mysql_errno (mysqlStubs->mysql_errnoPtr)
|
| 68 |
+
#define mysql_error (mysqlStubs->mysql_errorPtr)
|
| 69 |
+
#define mysql_fetch_fields (mysqlStubs->mysql_fetch_fieldsPtr)
|
| 70 |
+
#define mysql_fetch_lengths (mysqlStubs->mysql_fetch_lengthsPtr)
|
| 71 |
+
#define mysql_fetch_row (mysqlStubs->mysql_fetch_rowPtr)
|
| 72 |
+
#define mysql_field_count (mysqlStubs->mysql_field_countPtr)
|
| 73 |
+
#define mysql_free_result (mysqlStubs->mysql_free_resultPtr)
|
| 74 |
+
#define mysql_get_client_version (mysqlStubs->mysql_get_client_versionPtr)
|
| 75 |
+
#define mysql_init (mysqlStubs->mysql_initPtr)
|
| 76 |
+
#define mysql_list_fields (mysqlStubs->mysql_list_fieldsPtr)
|
| 77 |
+
#define mysql_list_tables (mysqlStubs->mysql_list_tablesPtr)
|
| 78 |
+
#define mysql_num_fields (mysqlStubs->mysql_num_fieldsPtr)
|
| 79 |
+
#define mysql_options (mysqlStubs->mysql_optionsPtr)
|
| 80 |
+
#define mysql_query (mysqlStubs->mysql_queryPtr)
|
| 81 |
+
#define mysql_real_connect (mysqlStubs->mysql_real_connectPtr)
|
| 82 |
+
#define mysql_rollback (mysqlStubs->mysql_rollbackPtr)
|
| 83 |
+
#define mysql_select_db (mysqlStubs->mysql_select_dbPtr)
|
| 84 |
+
#define mysql_sqlstate (mysqlStubs->mysql_sqlstatePtr)
|
| 85 |
+
#define mysql_ssl_set (mysqlStubs->mysql_ssl_setPtr)
|
| 86 |
+
#define mysql_stmt_affected_rows (mysqlStubs->mysql_stmt_affected_rowsPtr)
|
| 87 |
+
#define mysql_stmt_bind_param (mysqlStubs->mysql_stmt_bind_paramPtr)
|
| 88 |
+
#define mysql_stmt_bind_result (mysqlStubs->mysql_stmt_bind_resultPtr)
|
| 89 |
+
#define mysql_stmt_close (mysqlStubs->mysql_stmt_closePtr)
|
| 90 |
+
#define mysql_stmt_errno (mysqlStubs->mysql_stmt_errnoPtr)
|
| 91 |
+
#define mysql_stmt_error (mysqlStubs->mysql_stmt_errorPtr)
|
| 92 |
+
#define mysql_stmt_execute (mysqlStubs->mysql_stmt_executePtr)
|
| 93 |
+
#define mysql_stmt_fetch (mysqlStubs->mysql_stmt_fetchPtr)
|
| 94 |
+
#define mysql_stmt_fetch_column (mysqlStubs->mysql_stmt_fetch_columnPtr)
|
| 95 |
+
#define mysql_stmt_init (mysqlStubs->mysql_stmt_initPtr)
|
| 96 |
+
#define mysql_stmt_prepare (mysqlStubs->mysql_stmt_preparePtr)
|
| 97 |
+
#define mysql_stmt_result_metadata (mysqlStubs->mysql_stmt_result_metadataPtr)
|
| 98 |
+
#define mysql_stmt_sqlstate (mysqlStubs->mysql_stmt_sqlstatePtr)
|
| 99 |
+
#define mysql_stmt_store_result (mysqlStubs->mysql_stmt_store_resultPtr)
|
| 100 |
+
#define mysql_store_result (mysqlStubs->mysql_store_resultPtr)
|
| 101 |
+
MODULE_SCOPE const mysqlStubDefs *mysqlStubs;
|
deepseek/include/nc_tparm.h
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2018,2020 Thomas E. Dickey *
|
| 3 |
+
* Copyright 2006-2012,2017 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Thomas E. Dickey 2006 *
|
| 32 |
+
****************************************************************************/
|
| 33 |
+
|
| 34 |
+
/* $Id: nc_tparm.h,v 1.11 2020/05/27 23:33:31 tom Exp $ */
|
| 35 |
+
|
| 36 |
+
#ifndef NC_TPARM_included
|
| 37 |
+
#define NC_TPARM_included 1
|
| 38 |
+
|
| 39 |
+
#include <ncurses_cfg.h>
|
| 40 |
+
#include <ncursesw/curses.h>
|
| 41 |
+
|
| 42 |
+
/*
|
| 43 |
+
* Cast parameters past the formatting-string for tparm() to match the
|
| 44 |
+
* assumption of the varargs code.
|
| 45 |
+
*/
|
| 46 |
+
#ifndef TPARM_ARG
|
| 47 |
+
#ifdef NCURSES_TPARM_ARG
|
| 48 |
+
#define TPARM_ARG NCURSES_TPARM_ARG
|
| 49 |
+
#else
|
| 50 |
+
#define TPARM_ARG long
|
| 51 |
+
#endif
|
| 52 |
+
#endif /* TPARAM_ARG */
|
| 53 |
+
|
| 54 |
+
#define TPARM_N(n) (TPARM_ARG)(n)
|
| 55 |
+
|
| 56 |
+
#define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
|
| 57 |
+
|
| 58 |
+
#if NCURSES_TPARM_VARARGS
|
| 59 |
+
#define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i))
|
| 60 |
+
#define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h))
|
| 61 |
+
#define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g))
|
| 62 |
+
#define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f))
|
| 63 |
+
#define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
|
| 64 |
+
#define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
|
| 65 |
+
#define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
|
| 66 |
+
#define TPARM_1(a,b) tparm(a,TPARM_N(b))
|
| 67 |
+
#define TPARM_0(a) tparm(a)
|
| 68 |
+
#else
|
| 69 |
+
#define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
|
| 70 |
+
#define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
|
| 71 |
+
#define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
|
| 72 |
+
#define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
|
| 73 |
+
#define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
|
| 74 |
+
#define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
|
| 75 |
+
#define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
|
| 76 |
+
#define TPARM_1(a,b) TPARM_2(a,b,0)
|
| 77 |
+
#define TPARM_0(a) TPARM_1(a,0)
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
#ifdef NCURSES_INTERNALS
|
| 81 |
+
#define TIPARM_1(s,a) _nc_tiparm(1,s,a)
|
| 82 |
+
#define TIPARM_2(s,a,b) _nc_tiparm(2,s,a,b)
|
| 83 |
+
#define TIPARM_3(s,a,b,c) _nc_tiparm(3,s,a,b,c)
|
| 84 |
+
#define TIPARM_4(s,a,b,c,d) _nc_tiparm(4,s,a,b,c,d)
|
| 85 |
+
#define TIPARM_5(s,a,b,c,d,e) _nc_tiparm(5,s,a,b,c,d,e)
|
| 86 |
+
#define TIPARM_6(s,a,b,c,d,e,f) _nc_tiparm(6,s,a,b,c,d,e,f)
|
| 87 |
+
#define TIPARM_7(s,a,b,c,d,e,f,g) _nc_tiparm(7,s,a,b,c,d,e,f,g)
|
| 88 |
+
#define TIPARM_8(s,a,b,c,d,e,f,g,h) _nc_tiparm(8,s,a,b,c,d,e,f,g,h)
|
| 89 |
+
#define TIPARM_9(s,a,b,c,d,e,f,g,h,i) _nc_tiparm(9,s,a,b,c,d,e,f,g,h,i)
|
| 90 |
+
#endif
|
| 91 |
+
|
| 92 |
+
#endif /* NC_TPARM_included */
|
deepseek/include/ncurses_dll.h
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2018,2020 Thomas E. Dickey *
|
| 3 |
+
* Copyright 2009,2014 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
/* $Id: ncurses_dll.h.in,v 1.17 2020/09/05 17:58:47 juergen Exp $ */
|
| 30 |
+
|
| 31 |
+
#ifndef NCURSES_DLL_H_incl
|
| 32 |
+
#define NCURSES_DLL_H_incl 1
|
| 33 |
+
|
| 34 |
+
/*
|
| 35 |
+
* MinGW gcc (unlike MSYS2 and Cygwin) should define _WIN32 and possibly _WIN64.
|
| 36 |
+
*/
|
| 37 |
+
#if defined(__MINGW64__)
|
| 38 |
+
|
| 39 |
+
#ifndef _WIN64
|
| 40 |
+
#define _WIN64 1
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#elif defined(__MINGW32__)
|
| 44 |
+
|
| 45 |
+
#ifndef _WIN32
|
| 46 |
+
#define _WIN32 1
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
/* 2014-08-02 workaround for broken MinGW compiler.
|
| 50 |
+
* Oddly, only TRACE is mapped to trace - the other -D's are okay.
|
| 51 |
+
* suggest TDM as an alternative.
|
| 52 |
+
*/
|
| 53 |
+
#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
|
| 54 |
+
|
| 55 |
+
#ifdef trace
|
| 56 |
+
#undef trace
|
| 57 |
+
#define TRACE
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
#endif /* broken compiler */
|
| 61 |
+
|
| 62 |
+
#endif /* MingW */
|
| 63 |
+
|
| 64 |
+
/*
|
| 65 |
+
* For reentrant code, we map the various global variables into SCREEN by
|
| 66 |
+
* using functions to access them.
|
| 67 |
+
*/
|
| 68 |
+
#define NCURSES_PUBLIC_VAR(name) _nc_##name
|
| 69 |
+
|
| 70 |
+
#if defined(BUILDING_NCURSES)
|
| 71 |
+
# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
|
| 72 |
+
#else
|
| 73 |
+
# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
|
| 74 |
+
#endif
|
| 75 |
+
|
| 76 |
+
#define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
|
| 77 |
+
|
| 78 |
+
#define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
|
| 79 |
+
#define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
|
| 80 |
+
|
| 81 |
+
/*
|
| 82 |
+
* These symbols hide dllimport/dllexport, for compilers which care about it.
|
| 83 |
+
*/
|
| 84 |
+
#if defined(__CYGWIN__) || (defined(_WIN32) || defined(_WIN64))
|
| 85 |
+
# if defined(NCURSES_STATIC) /* "static" here only implies "not-a-DLL" */
|
| 86 |
+
# define NCURSES_EXPORT_GENERAL_IMPORT
|
| 87 |
+
# define NCURSES_EXPORT_GENERAL_EXPORT
|
| 88 |
+
# else
|
| 89 |
+
# define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport)
|
| 90 |
+
# define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport)
|
| 91 |
+
# endif
|
| 92 |
+
# define NCURSES_API __cdecl
|
| 93 |
+
#else
|
| 94 |
+
# define NCURSES_EXPORT_GENERAL_IMPORT
|
| 95 |
+
# define NCURSES_EXPORT_GENERAL_EXPORT
|
| 96 |
+
# define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
#endif /* NCURSES_DLL_H_incl */
|
deepseek/include/odbcStubs.h
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*-----------------------------------------------------------------------------
|
| 3 |
+
*
|
| 4 |
+
* odbcStubs.h --
|
| 5 |
+
*
|
| 6 |
+
* Stubs for procedures in odbcStubDefs.txt
|
| 7 |
+
*
|
| 8 |
+
* Generated by genExtStubs.tcl: DO NOT EDIT
|
| 9 |
+
* 2018-05-12 16:18:48Z
|
| 10 |
+
*
|
| 11 |
+
*-----------------------------------------------------------------------------
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
typedef struct odbcStubDefs {
|
| 15 |
+
SQLRETURN (SQL_API*SQLAllocHandlePtr)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
|
| 16 |
+
SQLRETURN (SQL_API*SQLBindParameterPtr)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
|
| 17 |
+
SQLRETURN (SQL_API*SQLCloseCursorPtr)(SQLHSTMT);
|
| 18 |
+
SQLRETURN (SQL_API*SQLColumnsWPtr)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT ,SQLWCHAR*,SQLSMALLINT );
|
| 19 |
+
SQLRETURN (SQL_API*SQLDataSourcesWPtr)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
| 20 |
+
SQLRETURN (SQL_API*SQLDescribeColWPtr)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
|
| 21 |
+
SQLRETURN (SQL_API*SQLDescribeParamPtr)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
|
| 22 |
+
SQLRETURN (SQL_API*SQLDisconnectPtr)(SQLHDBC);
|
| 23 |
+
SQLRETURN (SQL_API*SQLDriverConnectWPtr)(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
|
| 24 |
+
SQLRETURN (SQL_API*SQLDriversWPtr)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
| 25 |
+
SQLRETURN (SQL_API*SQLEndTranPtr)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT);
|
| 26 |
+
SQLRETURN (SQL_API*SQLExecutePtr)(SQLHSTMT);
|
| 27 |
+
SQLRETURN (SQL_API*SQLFetchPtr)(SQLHSTMT);
|
| 28 |
+
SQLRETURN (SQL_API*SQLForeignKeysWPtr)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
| 29 |
+
SQLRETURN (SQL_API*SQLFreeHandlePtr)(SQLSMALLINT,SQLHANDLE);
|
| 30 |
+
SQLRETURN (SQL_API*SQLGetConnectAttrPtr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
| 31 |
+
SQLRETURN (SQL_API*SQLGetDataPtr)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
|
| 32 |
+
SQLRETURN (SQL_API*SQLGetDiagFieldAPtr)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
|
| 33 |
+
SQLRETURN (SQL_API*SQLGetDiagRecWPtr)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
| 34 |
+
SQLRETURN (SQL_API*SQLGetInfoWPtr)(SQLHANDLE,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
|
| 35 |
+
SQLRETURN (SQL_API*SQLGetTypeInfoPtr)(SQLHSTMT,SQLSMALLINT);
|
| 36 |
+
SQLRETURN (SQL_API*SQLMoreResultsPtr)(SQLHSTMT);
|
| 37 |
+
SQLRETURN (SQL_API*SQLNumParamsPtr)(SQLHSTMT,SQLSMALLINT*);
|
| 38 |
+
SQLRETURN (SQL_API*SQLNumResultColsPtr)(SQLHSTMT,SQLSMALLINT*);
|
| 39 |
+
SQLRETURN (SQL_API*SQLPrepareWPtr)(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
|
| 40 |
+
SQLRETURN (SQL_API*SQLPrimaryKeysWPtr)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
| 41 |
+
SQLRETURN (SQL_API*SQLRowCountPtr)(SQLHSTMT,SQLLEN*);
|
| 42 |
+
SQLRETURN (SQL_API*SQLSetConnectAttrPtr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
| 43 |
+
SQLRETURN (SQL_API*SQLSetConnectOptionPtr)(SQLHDBC,SQLUSMALLINT,SQLULEN);
|
| 44 |
+
SQLRETURN (SQL_API*SQLSetEnvAttrPtr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
| 45 |
+
SQLRETURN (SQL_API*SQLTablesWPtr)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
| 46 |
+
SQLRETURN (SQL_API*SQLExecDirectWPtr)(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
|
| 47 |
+
} odbcStubDefs;
|
| 48 |
+
#define SQLAllocHandle (odbcStubs->SQLAllocHandlePtr)
|
| 49 |
+
#define SQLBindParameter (odbcStubs->SQLBindParameterPtr)
|
| 50 |
+
#define SQLCloseCursor (odbcStubs->SQLCloseCursorPtr)
|
| 51 |
+
#define SQLColumnsW (odbcStubs->SQLColumnsWPtr)
|
| 52 |
+
#define SQLDataSourcesW (odbcStubs->SQLDataSourcesWPtr)
|
| 53 |
+
#define SQLDescribeColW (odbcStubs->SQLDescribeColWPtr)
|
| 54 |
+
#define SQLDescribeParam (odbcStubs->SQLDescribeParamPtr)
|
| 55 |
+
#define SQLDisconnect (odbcStubs->SQLDisconnectPtr)
|
| 56 |
+
#define SQLDriverConnectW (odbcStubs->SQLDriverConnectWPtr)
|
| 57 |
+
#define SQLDriversW (odbcStubs->SQLDriversWPtr)
|
| 58 |
+
#define SQLEndTran (odbcStubs->SQLEndTranPtr)
|
| 59 |
+
#define SQLExecute (odbcStubs->SQLExecutePtr)
|
| 60 |
+
#define SQLFetch (odbcStubs->SQLFetchPtr)
|
| 61 |
+
#define SQLForeignKeysW (odbcStubs->SQLForeignKeysWPtr)
|
| 62 |
+
#define SQLFreeHandle (odbcStubs->SQLFreeHandlePtr)
|
| 63 |
+
#define SQLGetConnectAttr (odbcStubs->SQLGetConnectAttrPtr)
|
| 64 |
+
#define SQLGetData (odbcStubs->SQLGetDataPtr)
|
| 65 |
+
#define SQLGetDiagFieldA (odbcStubs->SQLGetDiagFieldAPtr)
|
| 66 |
+
#define SQLGetDiagRecW (odbcStubs->SQLGetDiagRecWPtr)
|
| 67 |
+
#define SQLGetInfoW (odbcStubs->SQLGetInfoWPtr)
|
| 68 |
+
#define SQLGetTypeInfo (odbcStubs->SQLGetTypeInfoPtr)
|
| 69 |
+
#define SQLMoreResults (odbcStubs->SQLMoreResultsPtr)
|
| 70 |
+
#define SQLNumParams (odbcStubs->SQLNumParamsPtr)
|
| 71 |
+
#define SQLNumResultCols (odbcStubs->SQLNumResultColsPtr)
|
| 72 |
+
#define SQLPrepareW (odbcStubs->SQLPrepareWPtr)
|
| 73 |
+
#define SQLPrimaryKeysW (odbcStubs->SQLPrimaryKeysWPtr)
|
| 74 |
+
#define SQLRowCount (odbcStubs->SQLRowCountPtr)
|
| 75 |
+
#define SQLSetConnectAttr (odbcStubs->SQLSetConnectAttrPtr)
|
| 76 |
+
#define SQLSetConnectOption (odbcStubs->SQLSetConnectOptionPtr)
|
| 77 |
+
#define SQLSetEnvAttr (odbcStubs->SQLSetEnvAttrPtr)
|
| 78 |
+
#define SQLTablesW (odbcStubs->SQLTablesWPtr)
|
| 79 |
+
#define SQLExecDirectW (odbcStubs->SQLExecDirectWPtr)
|
| 80 |
+
MODULE_SCOPE const odbcStubDefs *odbcStubs;
|
deepseek/include/pqStubs.h
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*-----------------------------------------------------------------------------
|
| 3 |
+
*
|
| 4 |
+
* ../generic/pqStubs.h --
|
| 5 |
+
*
|
| 6 |
+
* Stubs for procedures in pqStubDefs.txt
|
| 7 |
+
*
|
| 8 |
+
* Generated by genExtStubs.tcl: DO NOT EDIT
|
| 9 |
+
* 2015-06-26 12:55:15Z
|
| 10 |
+
*
|
| 11 |
+
*-----------------------------------------------------------------------------
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
typedef struct pqStubDefs {
|
| 15 |
+
|
| 16 |
+
/* Functions from libraries: pq */
|
| 17 |
+
|
| 18 |
+
const char* (*pg_encoding_to_charPtr)(int);
|
| 19 |
+
void (*PQclearPtr)(PGresult*);
|
| 20 |
+
int (*PQclientEncodingPtr)(const PGconn*);
|
| 21 |
+
char* (*PQcmdTuplesPtr)(PGresult*);
|
| 22 |
+
PGconn* (*PQconnectdbPtr)(const char*);
|
| 23 |
+
char* (*PQerrorMessagePtr)(const PGconn*);
|
| 24 |
+
PGresult* (*PQdescribePreparedPtr)(PGconn*, const char*);
|
| 25 |
+
PGresult* (*PQexecPtr)(PGconn*, const char*);
|
| 26 |
+
PGresult* (*PQexecPreparedPtr)(PGconn*, const char*, int, const char *const*, const int*, const int*, int);
|
| 27 |
+
char* (*PQdbPtr)(const PGconn *);
|
| 28 |
+
void (*PQfinishPtr)(PGconn*);
|
| 29 |
+
char* (*PQfnamePtr)(PGresult*, int);
|
| 30 |
+
int (*PQfnumberPtr)(const PGresult*, const char*);
|
| 31 |
+
Oid (*PQftypePtr)(const PGresult*, int);
|
| 32 |
+
int (*PQgetisnullPtr)(const PGresult*, int, int);
|
| 33 |
+
int (*PQgetlengthPtr)(const PGresult*, int, int);
|
| 34 |
+
char* (*PQgetvaluePtr)(const PGresult*, int, int);
|
| 35 |
+
char* (*PQhostPtr)(const PGconn*);
|
| 36 |
+
int (*PQnfieldsPtr)(const PGresult*);
|
| 37 |
+
int (*PQnparamsPtr)(const PGresult*);
|
| 38 |
+
int (*PQntuplesPtr)(const PGresult*);
|
| 39 |
+
char* (*PQoptionsPtr)(const PGconn*);
|
| 40 |
+
Oid (*PQparamtypePtr)(const PGresult*, int);
|
| 41 |
+
char* (*PQpassPtr)(const PGconn*);
|
| 42 |
+
char* (*PQportPtr)(const PGconn*);
|
| 43 |
+
PGresult* (*PQpreparePtr)(PGconn*, const char*, const char*, int, const Oid*);
|
| 44 |
+
char* (*PQresultErrorFieldPtr)(const PGresult*, int);
|
| 45 |
+
ExecStatusType (*PQresultStatusPtr)(const PGresult*);
|
| 46 |
+
int (*PQsetClientEncodingPtr)(PGconn*, const char*);
|
| 47 |
+
PQnoticeProcessor (*PQsetNoticeProcessorPtr)(PGconn*, PQnoticeProcessor, void*);
|
| 48 |
+
ConnStatusType (*PQstatusPtr)(PGconn*);
|
| 49 |
+
char* (*PQuserPtr)(const PGconn*);
|
| 50 |
+
char* (*PQttyPtr)(const PGconn*);
|
| 51 |
+
} pqStubDefs;
|
| 52 |
+
#define pg_encoding_to_char (pqStubs->pg_encoding_to_charPtr)
|
| 53 |
+
#define PQclear (pqStubs->PQclearPtr)
|
| 54 |
+
#define PQclientEncoding (pqStubs->PQclientEncodingPtr)
|
| 55 |
+
#define PQcmdTuples (pqStubs->PQcmdTuplesPtr)
|
| 56 |
+
#define PQconnectdb (pqStubs->PQconnectdbPtr)
|
| 57 |
+
#define PQerrorMessage (pqStubs->PQerrorMessagePtr)
|
| 58 |
+
#define PQdescribePrepared (pqStubs->PQdescribePreparedPtr)
|
| 59 |
+
#define PQexec (pqStubs->PQexecPtr)
|
| 60 |
+
#define PQexecPrepared (pqStubs->PQexecPreparedPtr)
|
| 61 |
+
#define PQdb (pqStubs->PQdbPtr)
|
| 62 |
+
#define PQfinish (pqStubs->PQfinishPtr)
|
| 63 |
+
#define PQfname (pqStubs->PQfnamePtr)
|
| 64 |
+
#define PQfnumber (pqStubs->PQfnumberPtr)
|
| 65 |
+
#define PQftype (pqStubs->PQftypePtr)
|
| 66 |
+
#define PQgetisnull (pqStubs->PQgetisnullPtr)
|
| 67 |
+
#define PQgetlength (pqStubs->PQgetlengthPtr)
|
| 68 |
+
#define PQgetvalue (pqStubs->PQgetvaluePtr)
|
| 69 |
+
#define PQhost (pqStubs->PQhostPtr)
|
| 70 |
+
#define PQnfields (pqStubs->PQnfieldsPtr)
|
| 71 |
+
#define PQnparams (pqStubs->PQnparamsPtr)
|
| 72 |
+
#define PQntuples (pqStubs->PQntuplesPtr)
|
| 73 |
+
#define PQoptions (pqStubs->PQoptionsPtr)
|
| 74 |
+
#define PQparamtype (pqStubs->PQparamtypePtr)
|
| 75 |
+
#define PQpass (pqStubs->PQpassPtr)
|
| 76 |
+
#define PQport (pqStubs->PQportPtr)
|
| 77 |
+
#define PQprepare (pqStubs->PQpreparePtr)
|
| 78 |
+
#define PQresultErrorField (pqStubs->PQresultErrorFieldPtr)
|
| 79 |
+
#define PQresultStatus (pqStubs->PQresultStatusPtr)
|
| 80 |
+
#define PQsetClientEncoding (pqStubs->PQsetClientEncodingPtr)
|
| 81 |
+
#define PQsetNoticeProcessor (pqStubs->PQsetNoticeProcessorPtr)
|
| 82 |
+
#define PQstatus (pqStubs->PQstatusPtr)
|
| 83 |
+
#define PQuser (pqStubs->PQuserPtr)
|
| 84 |
+
#define PQtty (pqStubs->PQttyPtr)
|
| 85 |
+
MODULE_SCOPE const pqStubDefs *pqStubs;
|
deepseek/include/python3.10/pymem.h
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* The PyMem_ family: low-level memory allocation interfaces.
|
| 2 |
+
See objimpl.h for the PyObject_ memory family.
|
| 3 |
+
*/
|
| 4 |
+
|
| 5 |
+
#ifndef Py_PYMEM_H
|
| 6 |
+
#define Py_PYMEM_H
|
| 7 |
+
|
| 8 |
+
#include "pyport.h"
|
| 9 |
+
|
| 10 |
+
#ifdef __cplusplus
|
| 11 |
+
extern "C" {
|
| 12 |
+
#endif
|
| 13 |
+
|
| 14 |
+
/* BEWARE:
|
| 15 |
+
|
| 16 |
+
Each interface exports both functions and macros. Extension modules should
|
| 17 |
+
use the functions, to ensure binary compatibility across Python versions.
|
| 18 |
+
Because the Python implementation is free to change internal details, and
|
| 19 |
+
the macros may (or may not) expose details for speed, if you do use the
|
| 20 |
+
macros you must recompile your extensions with each Python release.
|
| 21 |
+
|
| 22 |
+
Never mix calls to PyMem_ with calls to the platform malloc/realloc/
|
| 23 |
+
calloc/free. For example, on Windows different DLLs may end up using
|
| 24 |
+
different heaps, and if you use PyMem_Malloc you'll get the memory from the
|
| 25 |
+
heap used by the Python DLL; it could be a disaster if you free()'ed that
|
| 26 |
+
directly in your own extension. Using PyMem_Free instead ensures Python
|
| 27 |
+
can return the memory to the proper heap. As another example, in
|
| 28 |
+
a debug build (Py_DEBUG macro), Python wraps all calls to all PyMem_ and
|
| 29 |
+
PyObject_ memory functions in special debugging wrappers that add additional
|
| 30 |
+
debugging info to dynamic memory blocks. The system routines have no idea
|
| 31 |
+
what to do with that stuff, and the Python wrappers have no idea what to do
|
| 32 |
+
with raw blocks obtained directly by the system routines then.
|
| 33 |
+
|
| 34 |
+
The GIL must be held when using these APIs.
|
| 35 |
+
*/
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
* Raw memory interface
|
| 39 |
+
* ====================
|
| 40 |
+
*/
|
| 41 |
+
|
| 42 |
+
/* Functions
|
| 43 |
+
|
| 44 |
+
Functions supplying platform-independent semantics for malloc/realloc/
|
| 45 |
+
free. These functions make sure that allocating 0 bytes returns a distinct
|
| 46 |
+
non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
|
| 47 |
+
may be returned), even if the platform malloc and realloc don't.
|
| 48 |
+
Returned pointers must be checked for NULL explicitly. No action is
|
| 49 |
+
performed on failure (no exception is set, no warning is printed, etc).
|
| 50 |
+
*/
|
| 51 |
+
|
| 52 |
+
PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
|
| 53 |
+
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
|
| 54 |
+
PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
|
| 55 |
+
PyAPI_FUNC(void) PyMem_Free(void *ptr);
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* Type-oriented memory interface
|
| 59 |
+
* ==============================
|
| 60 |
+
*
|
| 61 |
+
* Allocate memory for n objects of the given type. Returns a new pointer
|
| 62 |
+
* or NULL if the request was too large or memory allocation failed. Use
|
| 63 |
+
* these macros rather than doing the multiplication yourself so that proper
|
| 64 |
+
* overflow checking is always done.
|
| 65 |
+
*/
|
| 66 |
+
|
| 67 |
+
#define PyMem_New(type, n) \
|
| 68 |
+
( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
|
| 69 |
+
( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
|
| 70 |
+
|
| 71 |
+
/*
|
| 72 |
+
* The value of (p) is always clobbered by this macro regardless of success.
|
| 73 |
+
* The caller MUST check if (p) is NULL afterwards and deal with the memory
|
| 74 |
+
* error if so. This means the original value of (p) MUST be saved for the
|
| 75 |
+
* caller's memory error handler to not lose track of it.
|
| 76 |
+
*/
|
| 77 |
+
#define PyMem_Resize(p, type, n) \
|
| 78 |
+
( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
|
| 79 |
+
(type *) PyMem_Realloc((p), (n) * sizeof(type)) )
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
// Deprecated aliases only kept for backward compatibility.
|
| 83 |
+
// PyMem_Del and PyMem_DEL are defined with no parameter to be able to use
|
| 84 |
+
// them as function pointers (ex: dealloc = PyMem_Del).
|
| 85 |
+
#define PyMem_MALLOC(n) PyMem_Malloc(n)
|
| 86 |
+
#define PyMem_NEW(type, n) PyMem_New(type, n)
|
| 87 |
+
#define PyMem_REALLOC(p, n) PyMem_Realloc(p, n)
|
| 88 |
+
#define PyMem_RESIZE(p, type, n) PyMem_Resize(p, type, n)
|
| 89 |
+
#define PyMem_FREE(p) PyMem_Free(p)
|
| 90 |
+
#define PyMem_Del PyMem_Free
|
| 91 |
+
#define PyMem_DEL PyMem_Free
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
#ifndef Py_LIMITED_API
|
| 95 |
+
# define Py_CPYTHON_PYMEM_H
|
| 96 |
+
# include "cpython/pymem.h"
|
| 97 |
+
# undef Py_CPYTHON_PYMEM_H
|
| 98 |
+
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tcl.h --
|
| 3 |
+
*
|
| 4 |
+
* This header file describes the externally-visible facilities of the
|
| 5 |
+
* Tcl interpreter.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1987-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1993-1996 Lucent Technologies.
|
| 9 |
+
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
| 10 |
+
* Copyright (c) 1998-2000 by Scriptics Corporation.
|
| 11 |
+
* Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
|
| 12 |
+
*
|
| 13 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 14 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef _TCL
|
| 18 |
+
#define _TCL
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* For C++ compilers, use extern "C"
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
* The following defines are used to indicate the various release levels.
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
#define TCL_ALPHA_RELEASE 0
|
| 33 |
+
#define TCL_BETA_RELEASE 1
|
| 34 |
+
#define TCL_FINAL_RELEASE 2
|
| 35 |
+
|
| 36 |
+
/*
|
| 37 |
+
* When version numbers change here, must also go into the following files and
|
| 38 |
+
* update the version numbers:
|
| 39 |
+
*
|
| 40 |
+
* library/init.tcl (1 LOC patch)
|
| 41 |
+
* unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
|
| 42 |
+
* win/configure.in (as above)
|
| 43 |
+
* win/tcl.m4 (not patchlevel)
|
| 44 |
+
* README.md (sections 0 and 2, with and without separator)
|
| 45 |
+
* macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC
|
| 46 |
+
* win/README (not patchlevel) (sections 0 and 2)
|
| 47 |
+
* unix/tcl.spec (1 LOC patch)
|
| 48 |
+
* tools/tcl.hpj.in (not patchlevel, for windows installer)
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
#if !defined(TCL_MAJOR_VERSION)
|
| 52 |
+
# define TCL_MAJOR_VERSION 8
|
| 53 |
+
#endif
|
| 54 |
+
#if TCL_MAJOR_VERSION != 8
|
| 55 |
+
# error "This header-file is for Tcl 8 only"
|
| 56 |
+
#endif
|
| 57 |
+
#define TCL_MINOR_VERSION 6
|
| 58 |
+
#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
| 59 |
+
#define TCL_RELEASE_SERIAL 14
|
| 60 |
+
|
| 61 |
+
#define TCL_VERSION "8.6"
|
| 62 |
+
#define TCL_PATCH_LEVEL "8.6.14"
|
| 63 |
+
|
| 64 |
+
/*
|
| 65 |
+
*----------------------------------------------------------------------------
|
| 66 |
+
* The following definitions set up the proper options for Windows compilers.
|
| 67 |
+
* We use this method because there is no autoconf equivalent.
|
| 68 |
+
*/
|
| 69 |
+
|
| 70 |
+
#ifdef _WIN32
|
| 71 |
+
# ifndef __WIN32__
|
| 72 |
+
# define __WIN32__
|
| 73 |
+
# endif
|
| 74 |
+
# ifndef WIN32
|
| 75 |
+
# define WIN32
|
| 76 |
+
# endif
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
| 81 |
+
* quotation marks), JOIN joins two arguments.
|
| 82 |
+
*/
|
| 83 |
+
|
| 84 |
+
#ifndef STRINGIFY
|
| 85 |
+
# define STRINGIFY(x) STRINGIFY1(x)
|
| 86 |
+
# define STRINGIFY1(x) #x
|
| 87 |
+
#endif
|
| 88 |
+
#ifndef JOIN
|
| 89 |
+
# define JOIN(a,b) JOIN1(a,b)
|
| 90 |
+
# define JOIN1(a,b) a##b
|
| 91 |
+
#endif
|
| 92 |
+
|
| 93 |
+
/*
|
| 94 |
+
* A special definition used to allow this header file to be included from
|
| 95 |
+
* windows resource files so that they can obtain version information.
|
| 96 |
+
* RC_INVOKED is defined by default by the windows RC tool.
|
| 97 |
+
*
|
| 98 |
+
* Resource compilers don't like all the C stuff, like typedefs and function
|
| 99 |
+
* declarations, that occur below, so block them out.
|
| 100 |
+
*/
|
| 101 |
+
|
| 102 |
+
#ifndef RC_INVOKED
|
| 103 |
+
|
| 104 |
+
/*
|
| 105 |
+
* Special macro to define mutexes, that doesn't do anything if we are not
|
| 106 |
+
* using threads.
|
| 107 |
+
*/
|
| 108 |
+
|
| 109 |
+
#ifdef TCL_THREADS
|
| 110 |
+
#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
|
| 111 |
+
#else
|
| 112 |
+
#define TCL_DECLARE_MUTEX(name)
|
| 113 |
+
#endif
|
| 114 |
+
|
| 115 |
+
/*
|
| 116 |
+
* Tcl's public routine Tcl_FSSeek() uses the values SEEK_SET, SEEK_CUR, and
|
| 117 |
+
* SEEK_END, all #define'd by stdio.h .
|
| 118 |
+
*
|
| 119 |
+
* Also, many extensions need stdio.h, and they've grown accustomed to tcl.h
|
| 120 |
+
* providing it for them rather than #include-ing it themselves as they
|
| 121 |
+
* should, so also for their sake, we keep the #include to be consistent with
|
| 122 |
+
* prior Tcl releases.
|
| 123 |
+
*/
|
| 124 |
+
|
| 125 |
+
#include <stdio.h>
|
| 126 |
+
|
| 127 |
+
/*
|
| 128 |
+
*----------------------------------------------------------------------------
|
| 129 |
+
* Support for functions with a variable number of arguments.
|
| 130 |
+
*
|
| 131 |
+
* The following TCL_VARARGS* macros are to support old extensions
|
| 132 |
+
* written for older versions of Tcl where the macros permitted
|
| 133 |
+
* support for the varargs.h system as well as stdarg.h .
|
| 134 |
+
*
|
| 135 |
+
* New code should just directly be written to use stdarg.h conventions.
|
| 136 |
+
*/
|
| 137 |
+
|
| 138 |
+
#include <stdarg.h>
|
| 139 |
+
#if !defined(TCL_NO_DEPRECATED)
|
| 140 |
+
# define TCL_VARARGS(type, name) (type name, ...)
|
| 141 |
+
# define TCL_VARARGS_DEF(type, name) (type name, ...)
|
| 142 |
+
# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
|
| 143 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 144 |
+
#if defined(__GNUC__) && (__GNUC__ > 2)
|
| 145 |
+
# if defined(_WIN32) && defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO
|
| 146 |
+
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__MINGW_PRINTF_FORMAT, a, b)))
|
| 147 |
+
# else
|
| 148 |
+
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
| 149 |
+
# endif
|
| 150 |
+
# define TCL_NORETURN __attribute__ ((noreturn))
|
| 151 |
+
# if defined(BUILD_tcl) || defined(BUILD_tk)
|
| 152 |
+
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
| 153 |
+
# else
|
| 154 |
+
# define TCL_NORETURN1 /* nothing */
|
| 155 |
+
# endif
|
| 156 |
+
#else
|
| 157 |
+
# define TCL_FORMAT_PRINTF(a,b)
|
| 158 |
+
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
|
| 159 |
+
# define TCL_NORETURN _declspec(noreturn)
|
| 160 |
+
# else
|
| 161 |
+
# define TCL_NORETURN /* nothing */
|
| 162 |
+
# endif
|
| 163 |
+
# define TCL_NORETURN1 /* nothing */
|
| 164 |
+
#endif
|
| 165 |
+
|
| 166 |
+
/*
|
| 167 |
+
* Allow a part of Tcl's API to be explicitly marked as deprecated.
|
| 168 |
+
*
|
| 169 |
+
* Used to make TIP 330/336 generate moans even if people use the
|
| 170 |
+
* compatibility macros. Change your code, guys! We won't support you forever.
|
| 171 |
+
*/
|
| 172 |
+
|
| 173 |
+
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
| 174 |
+
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
|
| 175 |
+
# define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__ (msg)))
|
| 176 |
+
# else
|
| 177 |
+
# define TCL_DEPRECATED_API(msg) __attribute__ ((__deprecated__))
|
| 178 |
+
# endif
|
| 179 |
+
#else
|
| 180 |
+
# define TCL_DEPRECATED_API(msg) /* nothing portable */
|
| 181 |
+
#endif
|
| 182 |
+
|
| 183 |
+
/*
|
| 184 |
+
*----------------------------------------------------------------------------
|
| 185 |
+
* Macros used to declare a function to be exported by a DLL. Used by Windows,
|
| 186 |
+
* maps to no-op declarations on non-Windows systems. The default build on
|
| 187 |
+
* windows is for a DLL, which causes the DLLIMPORT and DLLEXPORT macros to be
|
| 188 |
+
* nonempty. To build a static library, the macro STATIC_BUILD should be
|
| 189 |
+
* defined.
|
| 190 |
+
*
|
| 191 |
+
* Note: when building static but linking dynamically to MSVCRT we must still
|
| 192 |
+
* correctly decorate the C library imported function. Use CRTIMPORT
|
| 193 |
+
* for this purpose. _DLL is defined by the compiler when linking to
|
| 194 |
+
* MSVCRT.
|
| 195 |
+
*/
|
| 196 |
+
|
| 197 |
+
#if (defined(_WIN32) && (defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0550)) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
|
| 198 |
+
# define HAVE_DECLSPEC 1
|
| 199 |
+
# ifdef STATIC_BUILD
|
| 200 |
+
# define DLLIMPORT
|
| 201 |
+
# define DLLEXPORT
|
| 202 |
+
# ifdef _DLL
|
| 203 |
+
# define CRTIMPORT __declspec(dllimport)
|
| 204 |
+
# else
|
| 205 |
+
# define CRTIMPORT
|
| 206 |
+
# endif
|
| 207 |
+
# else
|
| 208 |
+
# define DLLIMPORT __declspec(dllimport)
|
| 209 |
+
# define DLLEXPORT __declspec(dllexport)
|
| 210 |
+
# define CRTIMPORT __declspec(dllimport)
|
| 211 |
+
# endif
|
| 212 |
+
#else
|
| 213 |
+
# define DLLIMPORT
|
| 214 |
+
# if defined(__GNUC__) && __GNUC__ > 3
|
| 215 |
+
# define DLLEXPORT __attribute__ ((visibility("default")))
|
| 216 |
+
# else
|
| 217 |
+
# define DLLEXPORT
|
| 218 |
+
# endif
|
| 219 |
+
# define CRTIMPORT
|
| 220 |
+
#endif
|
| 221 |
+
|
| 222 |
+
/*
|
| 223 |
+
* These macros are used to control whether functions are being declared for
|
| 224 |
+
* import or export. If a function is being declared while it is being built
|
| 225 |
+
* to be included in a shared library, then it should have the DLLEXPORT
|
| 226 |
+
* storage class. If is being declared for use by a module that is going to
|
| 227 |
+
* link against the shared library, then it should have the DLLIMPORT storage
|
| 228 |
+
* class. If the symbol is being declared for a static build or for use from a
|
| 229 |
+
* stub library, then the storage class should be empty.
|
| 230 |
+
*
|
| 231 |
+
* The convention is that a macro called BUILD_xxxx, where xxxx is the name of
|
| 232 |
+
* a library we are building, is set on the compile line for sources that are
|
| 233 |
+
* to be placed in the library. When this macro is set, the storage class will
|
| 234 |
+
* be set to DLLEXPORT. At the end of the header file, the storage class will
|
| 235 |
+
* be reset to DLLIMPORT.
|
| 236 |
+
*/
|
| 237 |
+
|
| 238 |
+
#undef TCL_STORAGE_CLASS
|
| 239 |
+
#ifdef BUILD_tcl
|
| 240 |
+
# define TCL_STORAGE_CLASS DLLEXPORT
|
| 241 |
+
#else
|
| 242 |
+
# ifdef USE_TCL_STUBS
|
| 243 |
+
# define TCL_STORAGE_CLASS
|
| 244 |
+
# else
|
| 245 |
+
# define TCL_STORAGE_CLASS DLLIMPORT
|
| 246 |
+
# endif
|
| 247 |
+
#endif
|
| 248 |
+
|
| 249 |
+
/*
|
| 250 |
+
* The following _ANSI_ARGS_ macro is to support old extensions
|
| 251 |
+
* written for older versions of Tcl where it permitted support
|
| 252 |
+
* for compilers written in the pre-prototype era of C.
|
| 253 |
+
*
|
| 254 |
+
* New code should use prototypes.
|
| 255 |
+
*/
|
| 256 |
+
|
| 257 |
+
#ifndef TCL_NO_DEPRECATED
|
| 258 |
+
# undef _ANSI_ARGS_
|
| 259 |
+
# define _ANSI_ARGS_(x) x
|
| 260 |
+
#endif
|
| 261 |
+
|
| 262 |
+
/*
|
| 263 |
+
* Definitions that allow this header file to be used either with or without
|
| 264 |
+
* ANSI C features.
|
| 265 |
+
*/
|
| 266 |
+
|
| 267 |
+
#ifndef INLINE
|
| 268 |
+
# define INLINE
|
| 269 |
+
#endif
|
| 270 |
+
|
| 271 |
+
#ifdef NO_CONST
|
| 272 |
+
# ifndef const
|
| 273 |
+
# define const
|
| 274 |
+
# endif
|
| 275 |
+
#endif
|
| 276 |
+
#ifndef CONST
|
| 277 |
+
# define CONST const
|
| 278 |
+
#endif
|
| 279 |
+
|
| 280 |
+
#ifdef USE_NON_CONST
|
| 281 |
+
# ifdef USE_COMPAT_CONST
|
| 282 |
+
# error define at most one of USE_NON_CONST and USE_COMPAT_CONST
|
| 283 |
+
# endif
|
| 284 |
+
# define CONST84
|
| 285 |
+
# define CONST84_RETURN
|
| 286 |
+
#else
|
| 287 |
+
# ifdef USE_COMPAT_CONST
|
| 288 |
+
# define CONST84
|
| 289 |
+
# define CONST84_RETURN const
|
| 290 |
+
# else
|
| 291 |
+
# define CONST84 const
|
| 292 |
+
# define CONST84_RETURN const
|
| 293 |
+
# endif
|
| 294 |
+
#endif
|
| 295 |
+
|
| 296 |
+
#ifndef CONST86
|
| 297 |
+
# define CONST86 CONST84
|
| 298 |
+
#endif
|
| 299 |
+
|
| 300 |
+
/*
|
| 301 |
+
* Make sure EXTERN isn't defined elsewhere.
|
| 302 |
+
*/
|
| 303 |
+
|
| 304 |
+
#ifdef EXTERN
|
| 305 |
+
# undef EXTERN
|
| 306 |
+
#endif /* EXTERN */
|
| 307 |
+
|
| 308 |
+
#ifdef __cplusplus
|
| 309 |
+
# define EXTERN extern "C" TCL_STORAGE_CLASS
|
| 310 |
+
#else
|
| 311 |
+
# define EXTERN extern TCL_STORAGE_CLASS
|
| 312 |
+
#endif
|
| 313 |
+
|
| 314 |
+
/*
|
| 315 |
+
*----------------------------------------------------------------------------
|
| 316 |
+
* The following code is copied from winnt.h. If we don't replicate it here,
|
| 317 |
+
* then <windows.h> can't be included after tcl.h, since tcl.h also defines
|
| 318 |
+
* VOID. This block is skipped under Cygwin and Mingw.
|
| 319 |
+
*/
|
| 320 |
+
|
| 321 |
+
#if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID)
|
| 322 |
+
#ifndef VOID
|
| 323 |
+
#define VOID void
|
| 324 |
+
typedef char CHAR;
|
| 325 |
+
typedef short SHORT;
|
| 326 |
+
typedef long LONG;
|
| 327 |
+
#endif
|
| 328 |
+
#endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */
|
| 329 |
+
|
| 330 |
+
/*
|
| 331 |
+
* Macro to use instead of "void" for arguments that must have type "void *"
|
| 332 |
+
* in ANSI C; maps them to type "char *" in non-ANSI systems.
|
| 333 |
+
*/
|
| 334 |
+
|
| 335 |
+
#ifndef __VXWORKS__
|
| 336 |
+
# ifndef NO_VOID
|
| 337 |
+
# define VOID void
|
| 338 |
+
# else
|
| 339 |
+
# define VOID char
|
| 340 |
+
# endif
|
| 341 |
+
#endif
|
| 342 |
+
|
| 343 |
+
/*
|
| 344 |
+
* Miscellaneous declarations.
|
| 345 |
+
*/
|
| 346 |
+
|
| 347 |
+
#ifndef _CLIENTDATA
|
| 348 |
+
# ifndef NO_VOID
|
| 349 |
+
typedef void *ClientData;
|
| 350 |
+
# else
|
| 351 |
+
typedef int *ClientData;
|
| 352 |
+
# endif
|
| 353 |
+
# define _CLIENTDATA
|
| 354 |
+
#endif
|
| 355 |
+
|
| 356 |
+
/*
|
| 357 |
+
* Darwin specific configure overrides (to support fat compiles, where
|
| 358 |
+
* configure runs only once for multiple architectures):
|
| 359 |
+
*/
|
| 360 |
+
|
| 361 |
+
#ifdef __APPLE__
|
| 362 |
+
# ifdef __LP64__
|
| 363 |
+
# undef TCL_WIDE_INT_TYPE
|
| 364 |
+
# define TCL_WIDE_INT_IS_LONG 1
|
| 365 |
+
# define TCL_CFG_DO64BIT 1
|
| 366 |
+
# else /* !__LP64__ */
|
| 367 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 368 |
+
# undef TCL_WIDE_INT_IS_LONG
|
| 369 |
+
# undef TCL_CFG_DO64BIT
|
| 370 |
+
# endif /* __LP64__ */
|
| 371 |
+
# undef HAVE_STRUCT_STAT64
|
| 372 |
+
#endif /* __APPLE__ */
|
| 373 |
+
|
| 374 |
+
/* Cross-compiling 32-bit on a 64-bit platform? Then our
|
| 375 |
+
* configure script does the wrong thing. Correct that here.
|
| 376 |
+
*/
|
| 377 |
+
#if defined(__GNUC__) && !defined(_WIN32) && !defined(__LP64__)
|
| 378 |
+
# undef TCL_WIDE_INT_IS_LONG
|
| 379 |
+
# undef TCL_WIDE_INT_TYPE
|
| 380 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 381 |
+
#endif
|
| 382 |
+
|
| 383 |
+
/*
|
| 384 |
+
* Define Tcl_WideInt to be a type that is (at least) 64-bits wide, and define
|
| 385 |
+
* Tcl_WideUInt to be the unsigned variant of that type (assuming that where
|
| 386 |
+
* we have one, we can have the other.)
|
| 387 |
+
*
|
| 388 |
+
* Also defines the following macros:
|
| 389 |
+
* TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a
|
| 390 |
+
* LP64 system such as modern Solaris or Linux ... not including Win64)
|
| 391 |
+
* Tcl_WideAsLong - forgetful converter from wideInt to long.
|
| 392 |
+
* Tcl_LongAsWide - sign-extending converter from long to wideInt.
|
| 393 |
+
* Tcl_WideAsDouble - converter from wideInt to double.
|
| 394 |
+
* Tcl_DoubleAsWide - converter from double to wideInt.
|
| 395 |
+
*
|
| 396 |
+
* The following invariant should hold for any long value 'longVal':
|
| 397 |
+
* longVal == Tcl_WideAsLong(Tcl_LongAsWide(longVal))
|
| 398 |
+
*
|
| 399 |
+
* Note on converting between Tcl_WideInt and strings. This implementation (in
|
| 400 |
+
* tclObj.c) depends on the function
|
| 401 |
+
* snprintf(...,"%" TCL_LL_MODIFIER "d",...).
|
| 402 |
+
*/
|
| 403 |
+
|
| 404 |
+
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
|
| 405 |
+
# ifdef _WIN32
|
| 406 |
+
# define TCL_WIDE_INT_TYPE __int64
|
| 407 |
+
# ifdef __BORLANDC__
|
| 408 |
+
# define TCL_LL_MODIFIER "L"
|
| 409 |
+
# elif defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
|
| 410 |
+
# define TCL_LL_MODIFIER "I64"
|
| 411 |
+
# else
|
| 412 |
+
# define TCL_LL_MODIFIER "ll"
|
| 413 |
+
# endif
|
| 414 |
+
# elif defined(__GNUC__)
|
| 415 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 416 |
+
# define TCL_LL_MODIFIER "ll"
|
| 417 |
+
# else /* ! _WIN32 && ! __GNUC__ */
|
| 418 |
+
/*
|
| 419 |
+
* Don't know what platform it is and configure hasn't discovered what is
|
| 420 |
+
* going on for us. Try to guess...
|
| 421 |
+
*/
|
| 422 |
+
# include <limits.h>
|
| 423 |
+
# if (INT_MAX < LONG_MAX)
|
| 424 |
+
# define TCL_WIDE_INT_IS_LONG 1
|
| 425 |
+
# else
|
| 426 |
+
# define TCL_WIDE_INT_TYPE long long
|
| 427 |
+
# endif
|
| 428 |
+
# endif /* _WIN32 */
|
| 429 |
+
#endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
|
| 430 |
+
#ifdef TCL_WIDE_INT_IS_LONG
|
| 431 |
+
# undef TCL_WIDE_INT_TYPE
|
| 432 |
+
# define TCL_WIDE_INT_TYPE long
|
| 433 |
+
#endif /* TCL_WIDE_INT_IS_LONG */
|
| 434 |
+
|
| 435 |
+
typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
|
| 436 |
+
typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
|
| 437 |
+
|
| 438 |
+
#ifdef TCL_WIDE_INT_IS_LONG
|
| 439 |
+
# define Tcl_WideAsLong(val) ((long)(val))
|
| 440 |
+
# define Tcl_LongAsWide(val) ((long)(val))
|
| 441 |
+
# define Tcl_WideAsDouble(val) ((double)((long)(val)))
|
| 442 |
+
# define Tcl_DoubleAsWide(val) ((long)((double)(val)))
|
| 443 |
+
# ifndef TCL_LL_MODIFIER
|
| 444 |
+
# define TCL_LL_MODIFIER "l"
|
| 445 |
+
# endif /* !TCL_LL_MODIFIER */
|
| 446 |
+
#else /* TCL_WIDE_INT_IS_LONG */
|
| 447 |
+
/*
|
| 448 |
+
* The next short section of defines are only done when not running on Windows
|
| 449 |
+
* or some other strange platform.
|
| 450 |
+
*/
|
| 451 |
+
# ifndef TCL_LL_MODIFIER
|
| 452 |
+
# define TCL_LL_MODIFIER "ll"
|
| 453 |
+
# endif /* !TCL_LL_MODIFIER */
|
| 454 |
+
# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
|
| 455 |
+
# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
|
| 456 |
+
# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
|
| 457 |
+
# define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
|
| 458 |
+
#endif /* TCL_WIDE_INT_IS_LONG */
|
| 459 |
+
|
| 460 |
+
#ifdef _WIN32
|
| 461 |
+
# ifdef __BORLANDC__
|
| 462 |
+
typedef struct stati64 Tcl_StatBuf;
|
| 463 |
+
# elif defined(_WIN64) || defined(_USE_64BIT_TIME_T)
|
| 464 |
+
typedef struct __stat64 Tcl_StatBuf;
|
| 465 |
+
# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
|
| 466 |
+
typedef struct _stati64 Tcl_StatBuf;
|
| 467 |
+
# else
|
| 468 |
+
typedef struct _stat32i64 Tcl_StatBuf;
|
| 469 |
+
# endif /* _MSC_VER < 1400 */
|
| 470 |
+
#elif defined(__CYGWIN__)
|
| 471 |
+
typedef struct {
|
| 472 |
+
unsigned st_dev;
|
| 473 |
+
unsigned short st_ino;
|
| 474 |
+
unsigned short st_mode;
|
| 475 |
+
short st_nlink;
|
| 476 |
+
short st_uid;
|
| 477 |
+
short st_gid;
|
| 478 |
+
/* Here is a 2-byte gap */
|
| 479 |
+
unsigned st_rdev;
|
| 480 |
+
/* Here is a 4-byte gap */
|
| 481 |
+
long long st_size;
|
| 482 |
+
struct {long tv_sec;} st_atim;
|
| 483 |
+
struct {long tv_sec;} st_mtim;
|
| 484 |
+
struct {long tv_sec;} st_ctim;
|
| 485 |
+
} Tcl_StatBuf;
|
| 486 |
+
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
|
| 487 |
+
typedef struct stat64 Tcl_StatBuf;
|
| 488 |
+
#else
|
| 489 |
+
typedef struct stat Tcl_StatBuf;
|
| 490 |
+
#endif
|
| 491 |
+
|
| 492 |
+
/*
|
| 493 |
+
*----------------------------------------------------------------------------
|
| 494 |
+
* Data structures defined opaquely in this module. The definitions below just
|
| 495 |
+
* provide dummy types. A few fields are made visible in Tcl_Interp
|
| 496 |
+
* structures, namely those used for returning a string result from commands.
|
| 497 |
+
* Direct access to the result field is discouraged in Tcl 8.0. The
|
| 498 |
+
* interpreter result is either an object or a string, and the two values are
|
| 499 |
+
* kept consistent unless some C code sets interp->result directly.
|
| 500 |
+
* Programmers should use either the function Tcl_GetObjResult() or
|
| 501 |
+
* Tcl_GetStringResult() to read the interpreter's result. See the SetResult
|
| 502 |
+
* man page for details.
|
| 503 |
+
*
|
| 504 |
+
* Note: any change to the Tcl_Interp definition below must be mirrored in the
|
| 505 |
+
* "real" definition in tclInt.h.
|
| 506 |
+
*
|
| 507 |
+
* Note: Tcl_ObjCmdProc functions do not directly set result and freeProc.
|
| 508 |
+
* Instead, they set a Tcl_Obj member in the "real" structure that can be
|
| 509 |
+
* accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
|
| 510 |
+
*/
|
| 511 |
+
|
| 512 |
+
typedef struct Tcl_Interp
|
| 513 |
+
#if !defined(TCL_NO_DEPRECATED)
|
| 514 |
+
{
|
| 515 |
+
/* TIP #330: Strongly discourage extensions from using the string
|
| 516 |
+
* result. */
|
| 517 |
+
#ifdef USE_INTERP_RESULT
|
| 518 |
+
char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
|
| 519 |
+
/* If the last command returned a string
|
| 520 |
+
* result, this points to it. */
|
| 521 |
+
void (*freeProc) (char *blockPtr)
|
| 522 |
+
TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
|
| 523 |
+
/* Zero means the string result is statically
|
| 524 |
+
* allocated. TCL_DYNAMIC means it was
|
| 525 |
+
* allocated with ckalloc and should be freed
|
| 526 |
+
* with ckfree. Other values give the address
|
| 527 |
+
* of function to invoke to free the result.
|
| 528 |
+
* Tcl_Eval must free it before executing next
|
| 529 |
+
* command. */
|
| 530 |
+
#else
|
| 531 |
+
char *resultDontUse; /* Don't use in extensions! */
|
| 532 |
+
void (*freeProcDontUse) (char *); /* Don't use in extensions! */
|
| 533 |
+
#endif
|
| 534 |
+
#ifdef USE_INTERP_ERRORLINE
|
| 535 |
+
int errorLine TCL_DEPRECATED_API("use Tcl_GetErrorLine/Tcl_SetErrorLine");
|
| 536 |
+
/* When TCL_ERROR is returned, this gives the
|
| 537 |
+
* line number within the command where the
|
| 538 |
+
* error occurred (1 if first line). */
|
| 539 |
+
#else
|
| 540 |
+
int errorLineDontUse; /* Don't use in extensions! */
|
| 541 |
+
#endif
|
| 542 |
+
}
|
| 543 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 544 |
+
Tcl_Interp;
|
| 545 |
+
|
| 546 |
+
typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
|
| 547 |
+
typedef struct Tcl_Channel_ *Tcl_Channel;
|
| 548 |
+
typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
|
| 549 |
+
typedef struct Tcl_Command_ *Tcl_Command;
|
| 550 |
+
typedef struct Tcl_Condition_ *Tcl_Condition;
|
| 551 |
+
typedef struct Tcl_Dict_ *Tcl_Dict;
|
| 552 |
+
typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
|
| 553 |
+
typedef struct Tcl_Encoding_ *Tcl_Encoding;
|
| 554 |
+
typedef struct Tcl_Event Tcl_Event;
|
| 555 |
+
typedef struct Tcl_InterpState_ *Tcl_InterpState;
|
| 556 |
+
typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
|
| 557 |
+
typedef struct Tcl_Mutex_ *Tcl_Mutex;
|
| 558 |
+
typedef struct Tcl_Pid_ *Tcl_Pid;
|
| 559 |
+
typedef struct Tcl_RegExp_ *Tcl_RegExp;
|
| 560 |
+
typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
|
| 561 |
+
typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
|
| 562 |
+
typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
|
| 563 |
+
typedef struct Tcl_Trace_ *Tcl_Trace;
|
| 564 |
+
typedef struct Tcl_Var_ *Tcl_Var;
|
| 565 |
+
typedef struct Tcl_ZLibStream_ *Tcl_ZlibStream;
|
| 566 |
+
|
| 567 |
+
/*
|
| 568 |
+
*----------------------------------------------------------------------------
|
| 569 |
+
* Definition of the interface to functions implementing threads. A function
|
| 570 |
+
* following this definition is given to each call of 'Tcl_CreateThread' and
|
| 571 |
+
* will be called as the main fuction of the new thread created by that call.
|
| 572 |
+
*/
|
| 573 |
+
|
| 574 |
+
#if defined _WIN32
|
| 575 |
+
typedef unsigned (__stdcall Tcl_ThreadCreateProc) (ClientData clientData);
|
| 576 |
+
#else
|
| 577 |
+
typedef void (Tcl_ThreadCreateProc) (ClientData clientData);
|
| 578 |
+
#endif
|
| 579 |
+
|
| 580 |
+
/*
|
| 581 |
+
* Threading function return types used for abstracting away platform
|
| 582 |
+
* differences when writing a Tcl_ThreadCreateProc. See the NewThread function
|
| 583 |
+
* in generic/tclThreadTest.c for it's usage.
|
| 584 |
+
*/
|
| 585 |
+
|
| 586 |
+
#if defined _WIN32
|
| 587 |
+
# define Tcl_ThreadCreateType unsigned __stdcall
|
| 588 |
+
# define TCL_THREAD_CREATE_RETURN return 0
|
| 589 |
+
#else
|
| 590 |
+
# define Tcl_ThreadCreateType void
|
| 591 |
+
# define TCL_THREAD_CREATE_RETURN
|
| 592 |
+
#endif
|
| 593 |
+
|
| 594 |
+
/*
|
| 595 |
+
* Definition of values for default stacksize and the possible flags to be
|
| 596 |
+
* given to Tcl_CreateThread.
|
| 597 |
+
*/
|
| 598 |
+
|
| 599 |
+
#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack. */
|
| 600 |
+
#define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default
|
| 601 |
+
* behaviour. */
|
| 602 |
+
#define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable. */
|
| 603 |
+
|
| 604 |
+
/*
|
| 605 |
+
* Flag values passed to Tcl_StringCaseMatch.
|
| 606 |
+
*/
|
| 607 |
+
|
| 608 |
+
#define TCL_MATCH_NOCASE (1<<0)
|
| 609 |
+
|
| 610 |
+
/*
|
| 611 |
+
* Flag values passed to Tcl_GetRegExpFromObj.
|
| 612 |
+
*/
|
| 613 |
+
|
| 614 |
+
#define TCL_REG_BASIC 000000 /* BREs (convenience). */
|
| 615 |
+
#define TCL_REG_EXTENDED 000001 /* EREs. */
|
| 616 |
+
#define TCL_REG_ADVF 000002 /* Advanced features in EREs. */
|
| 617 |
+
#define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs). */
|
| 618 |
+
#define TCL_REG_QUOTE 000004 /* No special characters, none. */
|
| 619 |
+
#define TCL_REG_NOCASE 000010 /* Ignore case. */
|
| 620 |
+
#define TCL_REG_NOSUB 000020 /* Don't care about subexpressions. */
|
| 621 |
+
#define TCL_REG_EXPANDED 000040 /* Expanded format, white space &
|
| 622 |
+
* comments. */
|
| 623 |
+
#define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */
|
| 624 |
+
#define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before. */
|
| 625 |
+
#define TCL_REG_NEWLINE 000300 /* Newlines are line terminators. */
|
| 626 |
+
#define TCL_REG_CANMATCH 001000 /* Report details on partial/limited
|
| 627 |
+
* matches. */
|
| 628 |
+
|
| 629 |
+
/*
|
| 630 |
+
* Flags values passed to Tcl_RegExpExecObj.
|
| 631 |
+
*/
|
| 632 |
+
|
| 633 |
+
#define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */
|
| 634 |
+
#define TCL_REG_NOTEOL 0002 /* End of string does not match $. */
|
| 635 |
+
|
| 636 |
+
/*
|
| 637 |
+
* Structures filled in by Tcl_RegExpInfo. Note that all offset values are
|
| 638 |
+
* relative to the start of the match string, not the beginning of the entire
|
| 639 |
+
* string.
|
| 640 |
+
*/
|
| 641 |
+
|
| 642 |
+
typedef struct Tcl_RegExpIndices {
|
| 643 |
+
long start; /* Character offset of first character in
|
| 644 |
+
* match. */
|
| 645 |
+
long end; /* Character offset of first character after
|
| 646 |
+
* the match. */
|
| 647 |
+
} Tcl_RegExpIndices;
|
| 648 |
+
|
| 649 |
+
typedef struct Tcl_RegExpInfo {
|
| 650 |
+
int nsubs; /* Number of subexpressions in the compiled
|
| 651 |
+
* expression. */
|
| 652 |
+
Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */
|
| 653 |
+
long extendStart; /* The offset at which a subsequent match
|
| 654 |
+
* might begin. */
|
| 655 |
+
long reserved; /* Reserved for later use. */
|
| 656 |
+
} Tcl_RegExpInfo;
|
| 657 |
+
|
| 658 |
+
/*
|
| 659 |
+
* Picky compilers complain if this typdef doesn't appear before the struct's
|
| 660 |
+
* reference in tclDecls.h.
|
| 661 |
+
*/
|
| 662 |
+
|
| 663 |
+
typedef Tcl_StatBuf *Tcl_Stat_;
|
| 664 |
+
typedef struct stat *Tcl_OldStat_;
|
| 665 |
+
|
| 666 |
+
/*
|
| 667 |
+
*----------------------------------------------------------------------------
|
| 668 |
+
* When a TCL command returns, the interpreter contains a result from the
|
| 669 |
+
* command. Programmers are strongly encouraged to use one of the functions
|
| 670 |
+
* Tcl_GetObjResult() or Tcl_GetStringResult() to read the interpreter's
|
| 671 |
+
* result. See the SetResult man page for details. Besides this result, the
|
| 672 |
+
* command function returns an integer code, which is one of the following:
|
| 673 |
+
*
|
| 674 |
+
* TCL_OK Command completed normally; the interpreter's result
|
| 675 |
+
* contains the command's result.
|
| 676 |
+
* TCL_ERROR The command couldn't be completed successfully; the
|
| 677 |
+
* interpreter's result describes what went wrong.
|
| 678 |
+
* TCL_RETURN The command requests that the current function return;
|
| 679 |
+
* the interpreter's result contains the function's
|
| 680 |
+
* return value.
|
| 681 |
+
* TCL_BREAK The command requests that the innermost loop be
|
| 682 |
+
* exited; the interpreter's result is meaningless.
|
| 683 |
+
* TCL_CONTINUE Go on to the next iteration of the current loop; the
|
| 684 |
+
* interpreter's result is meaningless.
|
| 685 |
+
*/
|
| 686 |
+
|
| 687 |
+
#define TCL_OK 0
|
| 688 |
+
#define TCL_ERROR 1
|
| 689 |
+
#define TCL_RETURN 2
|
| 690 |
+
#define TCL_BREAK 3
|
| 691 |
+
#define TCL_CONTINUE 4
|
| 692 |
+
|
| 693 |
+
#define TCL_RESULT_SIZE 200
|
| 694 |
+
|
| 695 |
+
/*
|
| 696 |
+
*----------------------------------------------------------------------------
|
| 697 |
+
* Flags to control what substitutions are performed by Tcl_SubstObj():
|
| 698 |
+
*/
|
| 699 |
+
|
| 700 |
+
#define TCL_SUBST_COMMANDS 001
|
| 701 |
+
#define TCL_SUBST_VARIABLES 002
|
| 702 |
+
#define TCL_SUBST_BACKSLASHES 004
|
| 703 |
+
#define TCL_SUBST_ALL 007
|
| 704 |
+
|
| 705 |
+
/*
|
| 706 |
+
* Argument descriptors for math function callbacks in expressions:
|
| 707 |
+
*/
|
| 708 |
+
|
| 709 |
+
typedef enum {
|
| 710 |
+
TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT
|
| 711 |
+
} Tcl_ValueType;
|
| 712 |
+
|
| 713 |
+
typedef struct Tcl_Value {
|
| 714 |
+
Tcl_ValueType type; /* Indicates intValue or doubleValue is valid,
|
| 715 |
+
* or both. */
|
| 716 |
+
long intValue; /* Integer value. */
|
| 717 |
+
double doubleValue; /* Double-precision floating value. */
|
| 718 |
+
Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
|
| 719 |
+
} Tcl_Value;
|
| 720 |
+
|
| 721 |
+
/*
|
| 722 |
+
* Forward declaration of Tcl_Obj to prevent an error when the forward
|
| 723 |
+
* reference to Tcl_Obj is encountered in the function types declared below.
|
| 724 |
+
*/
|
| 725 |
+
|
| 726 |
+
struct Tcl_Obj;
|
| 727 |
+
|
| 728 |
+
/*
|
| 729 |
+
*----------------------------------------------------------------------------
|
| 730 |
+
* Function types defined by Tcl:
|
| 731 |
+
*/
|
| 732 |
+
|
| 733 |
+
typedef int (Tcl_AppInitProc) (Tcl_Interp *interp);
|
| 734 |
+
typedef int (Tcl_AsyncProc) (ClientData clientData, Tcl_Interp *interp,
|
| 735 |
+
int code);
|
| 736 |
+
typedef void (Tcl_ChannelProc) (ClientData clientData, int mask);
|
| 737 |
+
typedef void (Tcl_CloseProc) (ClientData data);
|
| 738 |
+
typedef void (Tcl_CmdDeleteProc) (ClientData clientData);
|
| 739 |
+
typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp,
|
| 740 |
+
int argc, CONST84 char *argv[]);
|
| 741 |
+
typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 742 |
+
int level, char *command, Tcl_CmdProc *proc,
|
| 743 |
+
ClientData cmdClientData, int argc, CONST84 char *argv[]);
|
| 744 |
+
typedef int (Tcl_CmdObjTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 745 |
+
int level, const char *command, Tcl_Command commandInfo, int objc,
|
| 746 |
+
struct Tcl_Obj *const *objv);
|
| 747 |
+
typedef void (Tcl_CmdObjTraceDeleteProc) (ClientData clientData);
|
| 748 |
+
typedef void (Tcl_DupInternalRepProc) (struct Tcl_Obj *srcPtr,
|
| 749 |
+
struct Tcl_Obj *dupPtr);
|
| 750 |
+
typedef int (Tcl_EncodingConvertProc) (ClientData clientData, const char *src,
|
| 751 |
+
int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst,
|
| 752 |
+
int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr);
|
| 753 |
+
typedef void (Tcl_EncodingFreeProc) (ClientData clientData);
|
| 754 |
+
typedef int (Tcl_EventProc) (Tcl_Event *evPtr, int flags);
|
| 755 |
+
typedef void (Tcl_EventCheckProc) (ClientData clientData, int flags);
|
| 756 |
+
typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, ClientData clientData);
|
| 757 |
+
typedef void (Tcl_EventSetupProc) (ClientData clientData, int flags);
|
| 758 |
+
typedef void (Tcl_ExitProc) (ClientData clientData);
|
| 759 |
+
typedef void (Tcl_FileProc) (ClientData clientData, int mask);
|
| 760 |
+
typedef void (Tcl_FileFreeProc) (ClientData clientData);
|
| 761 |
+
typedef void (Tcl_FreeInternalRepProc) (struct Tcl_Obj *objPtr);
|
| 762 |
+
typedef void (Tcl_FreeProc) (char *blockPtr);
|
| 763 |
+
typedef void (Tcl_IdleProc) (ClientData clientData);
|
| 764 |
+
typedef void (Tcl_InterpDeleteProc) (ClientData clientData,
|
| 765 |
+
Tcl_Interp *interp);
|
| 766 |
+
typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp,
|
| 767 |
+
Tcl_Value *args, Tcl_Value *resultPtr);
|
| 768 |
+
typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
|
| 769 |
+
typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp,
|
| 770 |
+
int objc, struct Tcl_Obj *const *objv);
|
| 771 |
+
typedef int (Tcl_PackageInitProc) (Tcl_Interp *interp);
|
| 772 |
+
typedef int (Tcl_PackageUnloadProc) (Tcl_Interp *interp, int flags);
|
| 773 |
+
typedef void (Tcl_PanicProc) (const char *format, ...);
|
| 774 |
+
typedef void (Tcl_TcpAcceptProc) (ClientData callbackData, Tcl_Channel chan,
|
| 775 |
+
char *address, int port);
|
| 776 |
+
typedef void (Tcl_TimerProc) (ClientData clientData);
|
| 777 |
+
typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *interp, struct Tcl_Obj *objPtr);
|
| 778 |
+
typedef void (Tcl_UpdateStringProc) (struct Tcl_Obj *objPtr);
|
| 779 |
+
typedef char * (Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 780 |
+
CONST84 char *part1, CONST84 char *part2, int flags);
|
| 781 |
+
typedef void (Tcl_CommandTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
| 782 |
+
const char *oldName, const char *newName, int flags);
|
| 783 |
+
typedef void (Tcl_CreateFileHandlerProc) (int fd, int mask, Tcl_FileProc *proc,
|
| 784 |
+
ClientData clientData);
|
| 785 |
+
typedef void (Tcl_DeleteFileHandlerProc) (int fd);
|
| 786 |
+
typedef void (Tcl_AlertNotifierProc) (ClientData clientData);
|
| 787 |
+
typedef void (Tcl_ServiceModeHookProc) (int mode);
|
| 788 |
+
typedef ClientData (Tcl_InitNotifierProc) (void);
|
| 789 |
+
typedef void (Tcl_FinalizeNotifierProc) (ClientData clientData);
|
| 790 |
+
typedef void (Tcl_MainLoopProc) (void);
|
| 791 |
+
|
| 792 |
+
/*
|
| 793 |
+
*----------------------------------------------------------------------------
|
| 794 |
+
* The following structure represents a type of object, which is a particular
|
| 795 |
+
* internal representation for an object plus a set of functions that provide
|
| 796 |
+
* standard operations on objects of that type.
|
| 797 |
+
*/
|
| 798 |
+
|
| 799 |
+
typedef struct Tcl_ObjType {
|
| 800 |
+
const char *name; /* Name of the type, e.g. "int". */
|
| 801 |
+
Tcl_FreeInternalRepProc *freeIntRepProc;
|
| 802 |
+
/* Called to free any storage for the type's
|
| 803 |
+
* internal rep. NULL if the internal rep does
|
| 804 |
+
* not need freeing. */
|
| 805 |
+
Tcl_DupInternalRepProc *dupIntRepProc;
|
| 806 |
+
/* Called to create a new object as a copy of
|
| 807 |
+
* an existing object. */
|
| 808 |
+
Tcl_UpdateStringProc *updateStringProc;
|
| 809 |
+
/* Called to update the string rep from the
|
| 810 |
+
* type's internal representation. */
|
| 811 |
+
Tcl_SetFromAnyProc *setFromAnyProc;
|
| 812 |
+
/* Called to convert the object's internal rep
|
| 813 |
+
* to this type. Frees the internal rep of the
|
| 814 |
+
* old type. Returns TCL_ERROR on failure. */
|
| 815 |
+
} Tcl_ObjType;
|
| 816 |
+
|
| 817 |
+
/*
|
| 818 |
+
* One of the following structures exists for each object in the Tcl system.
|
| 819 |
+
* An object stores a value as either a string, some internal representation,
|
| 820 |
+
* or both.
|
| 821 |
+
*/
|
| 822 |
+
|
| 823 |
+
typedef struct Tcl_Obj {
|
| 824 |
+
int refCount; /* When 0 the object will be freed. */
|
| 825 |
+
char *bytes; /* This points to the first byte of the
|
| 826 |
+
* object's string representation. The array
|
| 827 |
+
* must be followed by a null byte (i.e., at
|
| 828 |
+
* offset length) but may also contain
|
| 829 |
+
* embedded null characters. The array's
|
| 830 |
+
* storage is allocated by ckalloc. NULL means
|
| 831 |
+
* the string rep is invalid and must be
|
| 832 |
+
* regenerated from the internal rep. Clients
|
| 833 |
+
* should use Tcl_GetStringFromObj or
|
| 834 |
+
* Tcl_GetString to get a pointer to the byte
|
| 835 |
+
* array as a readonly value. */
|
| 836 |
+
int length; /* The number of bytes at *bytes, not
|
| 837 |
+
* including the terminating null. */
|
| 838 |
+
const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
|
| 839 |
+
* corresponds to the type of the object's
|
| 840 |
+
* internal rep. NULL indicates the object has
|
| 841 |
+
* no internal rep (has no type). */
|
| 842 |
+
union { /* The internal representation: */
|
| 843 |
+
long longValue; /* - an long integer value. */
|
| 844 |
+
double doubleValue; /* - a double-precision floating value. */
|
| 845 |
+
void *otherValuePtr; /* - another, type-specific value,
|
| 846 |
+
not used internally any more. */
|
| 847 |
+
Tcl_WideInt wideValue; /* - a long long value. */
|
| 848 |
+
struct { /* - internal rep as two pointers.
|
| 849 |
+
* the main use of which is a bignum's
|
| 850 |
+
* tightly packed fields, where the alloc,
|
| 851 |
+
* used and signum flags are packed into
|
| 852 |
+
* ptr2 with everything else hung off ptr1. */
|
| 853 |
+
void *ptr1;
|
| 854 |
+
void *ptr2;
|
| 855 |
+
} twoPtrValue;
|
| 856 |
+
struct { /* - internal rep as a pointer and a long,
|
| 857 |
+
not used internally any more. */
|
| 858 |
+
void *ptr;
|
| 859 |
+
unsigned long value;
|
| 860 |
+
} ptrAndLongRep;
|
| 861 |
+
} internalRep;
|
| 862 |
+
} Tcl_Obj;
|
| 863 |
+
|
| 864 |
+
/*
|
| 865 |
+
* Macros to increment and decrement a Tcl_Obj's reference count, and to test
|
| 866 |
+
* whether an object is shared (i.e. has reference count > 1). Note: clients
|
| 867 |
+
* should use Tcl_DecrRefCount() when they are finished using an object, and
|
| 868 |
+
* should never call TclFreeObj() directly. TclFreeObj() is only defined and
|
| 869 |
+
* made public in tcl.h to support Tcl_DecrRefCount's macro definition.
|
| 870 |
+
*/
|
| 871 |
+
|
| 872 |
+
void Tcl_IncrRefCount(Tcl_Obj *objPtr);
|
| 873 |
+
void Tcl_DecrRefCount(Tcl_Obj *objPtr);
|
| 874 |
+
int Tcl_IsShared(Tcl_Obj *objPtr);
|
| 875 |
+
|
| 876 |
+
/*
|
| 877 |
+
*----------------------------------------------------------------------------
|
| 878 |
+
* The following structure contains the state needed by Tcl_SaveResult. No-one
|
| 879 |
+
* outside of Tcl should access any of these fields. This structure is
|
| 880 |
+
* typically allocated on the stack.
|
| 881 |
+
*/
|
| 882 |
+
|
| 883 |
+
typedef struct Tcl_SavedResult {
|
| 884 |
+
char *result;
|
| 885 |
+
Tcl_FreeProc *freeProc;
|
| 886 |
+
Tcl_Obj *objResultPtr;
|
| 887 |
+
char *appendResult;
|
| 888 |
+
int appendAvl;
|
| 889 |
+
int appendUsed;
|
| 890 |
+
char resultSpace[TCL_RESULT_SIZE+1];
|
| 891 |
+
} Tcl_SavedResult;
|
| 892 |
+
|
| 893 |
+
/*
|
| 894 |
+
*----------------------------------------------------------------------------
|
| 895 |
+
* The following definitions support Tcl's namespace facility. Note: the first
|
| 896 |
+
* five fields must match exactly the fields in a Namespace structure (see
|
| 897 |
+
* tclInt.h).
|
| 898 |
+
*/
|
| 899 |
+
|
| 900 |
+
typedef struct Tcl_Namespace {
|
| 901 |
+
char *name; /* The namespace's name within its parent
|
| 902 |
+
* namespace. This contains no ::'s. The name
|
| 903 |
+
* of the global namespace is "" although "::"
|
| 904 |
+
* is an synonym. */
|
| 905 |
+
char *fullName; /* The namespace's fully qualified name. This
|
| 906 |
+
* starts with ::. */
|
| 907 |
+
ClientData clientData; /* Arbitrary value associated with this
|
| 908 |
+
* namespace. */
|
| 909 |
+
Tcl_NamespaceDeleteProc *deleteProc;
|
| 910 |
+
/* Function invoked when deleting the
|
| 911 |
+
* namespace to, e.g., free clientData. */
|
| 912 |
+
struct Tcl_Namespace *parentPtr;
|
| 913 |
+
/* Points to the namespace that contains this
|
| 914 |
+
* one. NULL if this is the global
|
| 915 |
+
* namespace. */
|
| 916 |
+
} Tcl_Namespace;
|
| 917 |
+
|
| 918 |
+
/*
|
| 919 |
+
*----------------------------------------------------------------------------
|
| 920 |
+
* The following structure represents a call frame, or activation record. A
|
| 921 |
+
* call frame defines a naming context for a procedure call: its local scope
|
| 922 |
+
* (for local variables) and its namespace scope (used for non-local
|
| 923 |
+
* variables; often the global :: namespace). A call frame can also define the
|
| 924 |
+
* naming context for a namespace eval or namespace inscope command: the
|
| 925 |
+
* namespace in which the command's code should execute. The Tcl_CallFrame
|
| 926 |
+
* structures exist only while procedures or namespace eval/inscope's are
|
| 927 |
+
* being executed, and provide a Tcl call stack.
|
| 928 |
+
*
|
| 929 |
+
* A call frame is initialized and pushed using Tcl_PushCallFrame and popped
|
| 930 |
+
* using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be provided by the
|
| 931 |
+
* Tcl_PushCallFrame caller, and callers typically allocate them on the C call
|
| 932 |
+
* stack for efficiency. For this reason, Tcl_CallFrame is defined as a
|
| 933 |
+
* structure and not as an opaque token. However, most Tcl_CallFrame fields
|
| 934 |
+
* are hidden since applications should not access them directly; others are
|
| 935 |
+
* declared as "dummyX".
|
| 936 |
+
*
|
| 937 |
+
* WARNING!! The structure definition must be kept consistent with the
|
| 938 |
+
* CallFrame structure in tclInt.h. If you change one, change the other.
|
| 939 |
+
*/
|
| 940 |
+
|
| 941 |
+
typedef struct Tcl_CallFrame {
|
| 942 |
+
Tcl_Namespace *nsPtr;
|
| 943 |
+
int dummy1;
|
| 944 |
+
int dummy2;
|
| 945 |
+
void *dummy3;
|
| 946 |
+
void *dummy4;
|
| 947 |
+
void *dummy5;
|
| 948 |
+
int dummy6;
|
| 949 |
+
void *dummy7;
|
| 950 |
+
void *dummy8;
|
| 951 |
+
int dummy9;
|
| 952 |
+
void *dummy10;
|
| 953 |
+
void *dummy11;
|
| 954 |
+
void *dummy12;
|
| 955 |
+
void *dummy13;
|
| 956 |
+
} Tcl_CallFrame;
|
| 957 |
+
|
| 958 |
+
/*
|
| 959 |
+
*----------------------------------------------------------------------------
|
| 960 |
+
* Information about commands that is returned by Tcl_GetCommandInfo and
|
| 961 |
+
* passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based command
|
| 962 |
+
* function while proc is a traditional Tcl argc/argv string-based function.
|
| 963 |
+
* Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
|
| 964 |
+
* proc are non-NULL and can be called to execute the command. However, it may
|
| 965 |
+
* be faster to call one instead of the other. The member isNativeObjectProc
|
| 966 |
+
* is set to 1 if an object-based function was registered by
|
| 967 |
+
* Tcl_CreateObjCommand, and to 0 if a string-based function was registered by
|
| 968 |
+
* Tcl_CreateCommand. The other function is typically set to a compatibility
|
| 969 |
+
* wrapper that does string-to-object or object-to-string argument conversions
|
| 970 |
+
* then calls the other function.
|
| 971 |
+
*/
|
| 972 |
+
|
| 973 |
+
typedef struct Tcl_CmdInfo {
|
| 974 |
+
int isNativeObjectProc; /* 1 if objProc was registered by a call to
|
| 975 |
+
* Tcl_CreateObjCommand; 0 otherwise.
|
| 976 |
+
* Tcl_SetCmdInfo does not modify this
|
| 977 |
+
* field. */
|
| 978 |
+
Tcl_ObjCmdProc *objProc; /* Command's object-based function. */
|
| 979 |
+
ClientData objClientData; /* ClientData for object proc. */
|
| 980 |
+
Tcl_CmdProc *proc; /* Command's string-based function. */
|
| 981 |
+
ClientData clientData; /* ClientData for string proc. */
|
| 982 |
+
Tcl_CmdDeleteProc *deleteProc;
|
| 983 |
+
/* Function to call when command is
|
| 984 |
+
* deleted. */
|
| 985 |
+
ClientData deleteData; /* Value to pass to deleteProc (usually the
|
| 986 |
+
* same as clientData). */
|
| 987 |
+
Tcl_Namespace *namespacePtr;/* Points to the namespace that contains this
|
| 988 |
+
* command. Note that Tcl_SetCmdInfo will not
|
| 989 |
+
* change a command's namespace; use
|
| 990 |
+
* TclRenameCommand or Tcl_Eval (of 'rename')
|
| 991 |
+
* to do that. */
|
| 992 |
+
} Tcl_CmdInfo;
|
| 993 |
+
|
| 994 |
+
/*
|
| 995 |
+
*----------------------------------------------------------------------------
|
| 996 |
+
* The structure defined below is used to hold dynamic strings. The only
|
| 997 |
+
* fields that clients should use are string and length, accessible via the
|
| 998 |
+
* macros Tcl_DStringValue and Tcl_DStringLength.
|
| 999 |
+
*/
|
| 1000 |
+
|
| 1001 |
+
#define TCL_DSTRING_STATIC_SIZE 200
|
| 1002 |
+
typedef struct Tcl_DString {
|
| 1003 |
+
char *string; /* Points to beginning of string: either
|
| 1004 |
+
* staticSpace below or a malloced array. */
|
| 1005 |
+
int length; /* Number of non-NULL characters in the
|
| 1006 |
+
* string. */
|
| 1007 |
+
int spaceAvl; /* Total number of bytes available for the
|
| 1008 |
+
* string and its terminating NULL char. */
|
| 1009 |
+
char staticSpace[TCL_DSTRING_STATIC_SIZE];
|
| 1010 |
+
/* Space to use in common case where string is
|
| 1011 |
+
* small. */
|
| 1012 |
+
} Tcl_DString;
|
| 1013 |
+
|
| 1014 |
+
#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
|
| 1015 |
+
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
|
| 1016 |
+
#define Tcl_DStringTrunc Tcl_DStringSetLength
|
| 1017 |
+
|
| 1018 |
+
/*
|
| 1019 |
+
* Definitions for the maximum number of digits of precision that may be
|
| 1020 |
+
* specified in the "tcl_precision" variable, and the number of bytes of
|
| 1021 |
+
* buffer space required by Tcl_PrintDouble.
|
| 1022 |
+
*/
|
| 1023 |
+
|
| 1024 |
+
#define TCL_MAX_PREC 17
|
| 1025 |
+
#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
|
| 1026 |
+
|
| 1027 |
+
/*
|
| 1028 |
+
* Definition for a number of bytes of buffer space sufficient to hold the
|
| 1029 |
+
* string representation of an integer in base 10 (assuming the existence of
|
| 1030 |
+
* 64-bit integers).
|
| 1031 |
+
*/
|
| 1032 |
+
|
| 1033 |
+
#define TCL_INTEGER_SPACE 24
|
| 1034 |
+
|
| 1035 |
+
/*
|
| 1036 |
+
* Flag values passed to Tcl_ConvertElement.
|
| 1037 |
+
* TCL_DONT_USE_BRACES forces it not to enclose the element in braces, but to
|
| 1038 |
+
* use backslash quoting instead.
|
| 1039 |
+
* TCL_DONT_QUOTE_HASH disables the default quoting of the '#' character. It
|
| 1040 |
+
* is safe to leave the hash unquoted when the element is not the first
|
| 1041 |
+
* element of a list, and this flag can be used by the caller to indicate
|
| 1042 |
+
* that condition.
|
| 1043 |
+
*/
|
| 1044 |
+
|
| 1045 |
+
#define TCL_DONT_USE_BRACES 1
|
| 1046 |
+
#define TCL_DONT_QUOTE_HASH 8
|
| 1047 |
+
|
| 1048 |
+
/*
|
| 1049 |
+
* Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
|
| 1050 |
+
* abbreviated strings.
|
| 1051 |
+
*/
|
| 1052 |
+
|
| 1053 |
+
#define TCL_EXACT 1
|
| 1054 |
+
|
| 1055 |
+
/*
|
| 1056 |
+
*----------------------------------------------------------------------------
|
| 1057 |
+
* Flag values passed to Tcl_RecordAndEval, Tcl_EvalObj, Tcl_EvalObjv.
|
| 1058 |
+
* WARNING: these bit choices must not conflict with the bit choices for
|
| 1059 |
+
* evalFlag bits in tclInt.h!
|
| 1060 |
+
*
|
| 1061 |
+
* Meanings:
|
| 1062 |
+
* TCL_NO_EVAL: Just record this command
|
| 1063 |
+
* TCL_EVAL_GLOBAL: Execute script in global namespace
|
| 1064 |
+
* TCL_EVAL_DIRECT: Do not compile this script
|
| 1065 |
+
* TCL_EVAL_INVOKE: Magical Tcl_EvalObjv mode for aliases/ensembles
|
| 1066 |
+
* o Run in iPtr->lookupNsPtr or global namespace
|
| 1067 |
+
* o Cut out of error traces
|
| 1068 |
+
* o Don't reset the flags controlling ensemble
|
| 1069 |
+
* error message rewriting.
|
| 1070 |
+
* TCL_CANCEL_UNWIND: Magical Tcl_CancelEval mode that causes the
|
| 1071 |
+
* stack for the script in progress to be
|
| 1072 |
+
* completely unwound.
|
| 1073 |
+
* TCL_EVAL_NOERR: Do no exception reporting at all, just return
|
| 1074 |
+
* as the caller will report.
|
| 1075 |
+
*/
|
| 1076 |
+
|
| 1077 |
+
#define TCL_NO_EVAL 0x010000
|
| 1078 |
+
#define TCL_EVAL_GLOBAL 0x020000
|
| 1079 |
+
#define TCL_EVAL_DIRECT 0x040000
|
| 1080 |
+
#define TCL_EVAL_INVOKE 0x080000
|
| 1081 |
+
#define TCL_CANCEL_UNWIND 0x100000
|
| 1082 |
+
#define TCL_EVAL_NOERR 0x200000
|
| 1083 |
+
|
| 1084 |
+
/*
|
| 1085 |
+
* Special freeProc values that may be passed to Tcl_SetResult (see the man
|
| 1086 |
+
* page for details):
|
| 1087 |
+
*/
|
| 1088 |
+
|
| 1089 |
+
#define TCL_VOLATILE ((Tcl_FreeProc *) 1)
|
| 1090 |
+
#define TCL_STATIC ((Tcl_FreeProc *) 0)
|
| 1091 |
+
#define TCL_DYNAMIC ((Tcl_FreeProc *) 3)
|
| 1092 |
+
|
| 1093 |
+
/*
|
| 1094 |
+
* Flag values passed to variable-related functions.
|
| 1095 |
+
* WARNING: these bit choices must not conflict with the bit choice for
|
| 1096 |
+
* TCL_CANCEL_UNWIND, above.
|
| 1097 |
+
*/
|
| 1098 |
+
|
| 1099 |
+
#define TCL_GLOBAL_ONLY 1
|
| 1100 |
+
#define TCL_NAMESPACE_ONLY 2
|
| 1101 |
+
#define TCL_APPEND_VALUE 4
|
| 1102 |
+
#define TCL_LIST_ELEMENT 8
|
| 1103 |
+
#define TCL_TRACE_READS 0x10
|
| 1104 |
+
#define TCL_TRACE_WRITES 0x20
|
| 1105 |
+
#define TCL_TRACE_UNSETS 0x40
|
| 1106 |
+
#define TCL_TRACE_DESTROYED 0x80
|
| 1107 |
+
#define TCL_INTERP_DESTROYED 0x100
|
| 1108 |
+
#define TCL_LEAVE_ERR_MSG 0x200
|
| 1109 |
+
#define TCL_TRACE_ARRAY 0x800
|
| 1110 |
+
#ifndef TCL_REMOVE_OBSOLETE_TRACES
|
| 1111 |
+
/* Required to support old variable/vdelete/vinfo traces. */
|
| 1112 |
+
#define TCL_TRACE_OLD_STYLE 0x1000
|
| 1113 |
+
#endif
|
| 1114 |
+
/* Indicate the semantics of the result of a trace. */
|
| 1115 |
+
#define TCL_TRACE_RESULT_DYNAMIC 0x8000
|
| 1116 |
+
#define TCL_TRACE_RESULT_OBJECT 0x10000
|
| 1117 |
+
|
| 1118 |
+
/*
|
| 1119 |
+
* Flag values for ensemble commands.
|
| 1120 |
+
*/
|
| 1121 |
+
|
| 1122 |
+
#define TCL_ENSEMBLE_PREFIX 0x02/* Flag value to say whether to allow
|
| 1123 |
+
* unambiguous prefixes of commands or to
|
| 1124 |
+
* require exact matches for command names. */
|
| 1125 |
+
|
| 1126 |
+
/*
|
| 1127 |
+
* Flag values passed to command-related functions.
|
| 1128 |
+
*/
|
| 1129 |
+
|
| 1130 |
+
#define TCL_TRACE_RENAME 0x2000
|
| 1131 |
+
#define TCL_TRACE_DELETE 0x4000
|
| 1132 |
+
|
| 1133 |
+
#define TCL_ALLOW_INLINE_COMPILATION 0x20000
|
| 1134 |
+
|
| 1135 |
+
/*
|
| 1136 |
+
* The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
|
| 1137 |
+
* always parsed whenever the part2 is NULL. (This is to avoid a common error
|
| 1138 |
+
* when converting code to use the new object based APIs and forgetting to
|
| 1139 |
+
* give the flag)
|
| 1140 |
+
*/
|
| 1141 |
+
|
| 1142 |
+
#if !defined(TCL_NO_DEPRECATED)
|
| 1143 |
+
# define TCL_PARSE_PART1 0x400
|
| 1144 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 1145 |
+
|
| 1146 |
+
/*
|
| 1147 |
+
* Types for linked variables:
|
| 1148 |
+
*/
|
| 1149 |
+
|
| 1150 |
+
#define TCL_LINK_INT 1
|
| 1151 |
+
#define TCL_LINK_DOUBLE 2
|
| 1152 |
+
#define TCL_LINK_BOOLEAN 3
|
| 1153 |
+
#define TCL_LINK_STRING 4
|
| 1154 |
+
#define TCL_LINK_WIDE_INT 5
|
| 1155 |
+
#define TCL_LINK_CHAR 6
|
| 1156 |
+
#define TCL_LINK_UCHAR 7
|
| 1157 |
+
#define TCL_LINK_SHORT 8
|
| 1158 |
+
#define TCL_LINK_USHORT 9
|
| 1159 |
+
#define TCL_LINK_UINT 10
|
| 1160 |
+
#define TCL_LINK_LONG 11
|
| 1161 |
+
#define TCL_LINK_ULONG 12
|
| 1162 |
+
#define TCL_LINK_FLOAT 13
|
| 1163 |
+
#define TCL_LINK_WIDE_UINT 14
|
| 1164 |
+
#define TCL_LINK_READ_ONLY 0x80
|
| 1165 |
+
|
| 1166 |
+
/*
|
| 1167 |
+
*----------------------------------------------------------------------------
|
| 1168 |
+
* Forward declarations of Tcl_HashTable and related types.
|
| 1169 |
+
*/
|
| 1170 |
+
|
| 1171 |
+
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
|
| 1172 |
+
typedef struct Tcl_HashTable Tcl_HashTable;
|
| 1173 |
+
typedef struct Tcl_HashEntry Tcl_HashEntry;
|
| 1174 |
+
|
| 1175 |
+
typedef unsigned (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
|
| 1176 |
+
typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
|
| 1177 |
+
typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
|
| 1178 |
+
void *keyPtr);
|
| 1179 |
+
typedef void (Tcl_FreeHashEntryProc) (Tcl_HashEntry *hPtr);
|
| 1180 |
+
|
| 1181 |
+
/*
|
| 1182 |
+
* This flag controls whether the hash table stores the hash of a key, or
|
| 1183 |
+
* recalculates it. There should be no reason for turning this flag off as it
|
| 1184 |
+
* is completely binary and source compatible unless you directly access the
|
| 1185 |
+
* bucketPtr member of the Tcl_HashTableEntry structure. This member has been
|
| 1186 |
+
* removed and the space used to store the hash value.
|
| 1187 |
+
*/
|
| 1188 |
+
|
| 1189 |
+
#ifndef TCL_HASH_KEY_STORE_HASH
|
| 1190 |
+
# define TCL_HASH_KEY_STORE_HASH 1
|
| 1191 |
+
#endif
|
| 1192 |
+
|
| 1193 |
+
/*
|
| 1194 |
+
* Structure definition for an entry in a hash table. No-one outside Tcl
|
| 1195 |
+
* should access any of these fields directly; use the macros defined below.
|
| 1196 |
+
*/
|
| 1197 |
+
|
| 1198 |
+
struct Tcl_HashEntry {
|
| 1199 |
+
Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
|
| 1200 |
+
* or NULL for end of chain. */
|
| 1201 |
+
Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
|
| 1202 |
+
#if TCL_HASH_KEY_STORE_HASH
|
| 1203 |
+
void *hash; /* Hash value, stored as pointer to ensure
|
| 1204 |
+
* that the offsets of the fields in this
|
| 1205 |
+
* structure are not changed. */
|
| 1206 |
+
#else
|
| 1207 |
+
Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to first
|
| 1208 |
+
* entry in this entry's chain: used for
|
| 1209 |
+
* deleting the entry. */
|
| 1210 |
+
#endif
|
| 1211 |
+
ClientData clientData; /* Application stores something here with
|
| 1212 |
+
* Tcl_SetHashValue. */
|
| 1213 |
+
union { /* Key has one of these forms: */
|
| 1214 |
+
char *oneWordValue; /* One-word value for key. */
|
| 1215 |
+
Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
|
| 1216 |
+
int words[1]; /* Multiple integer words for key. The actual
|
| 1217 |
+
* size will be as large as necessary for this
|
| 1218 |
+
* table's keys. */
|
| 1219 |
+
char string[1]; /* String for key. The actual size will be as
|
| 1220 |
+
* large as needed to hold the key. */
|
| 1221 |
+
} key; /* MUST BE LAST FIELD IN RECORD!! */
|
| 1222 |
+
};
|
| 1223 |
+
|
| 1224 |
+
/*
|
| 1225 |
+
* Flags used in Tcl_HashKeyType.
|
| 1226 |
+
*
|
| 1227 |
+
* TCL_HASH_KEY_RANDOMIZE_HASH -
|
| 1228 |
+
* There are some things, pointers for example
|
| 1229 |
+
* which don't hash well because they do not use
|
| 1230 |
+
* the lower bits. If this flag is set then the
|
| 1231 |
+
* hash table will attempt to rectify this by
|
| 1232 |
+
* randomising the bits and then using the upper
|
| 1233 |
+
* N bits as the index into the table.
|
| 1234 |
+
* TCL_HASH_KEY_SYSTEM_HASH - If this flag is set then all memory internally
|
| 1235 |
+
* allocated for the hash table that is not for an
|
| 1236 |
+
* entry will use the system heap.
|
| 1237 |
+
*/
|
| 1238 |
+
|
| 1239 |
+
#define TCL_HASH_KEY_RANDOMIZE_HASH 0x1
|
| 1240 |
+
#define TCL_HASH_KEY_SYSTEM_HASH 0x2
|
| 1241 |
+
|
| 1242 |
+
/*
|
| 1243 |
+
* Structure definition for the methods associated with a hash table key type.
|
| 1244 |
+
*/
|
| 1245 |
+
|
| 1246 |
+
#define TCL_HASH_KEY_TYPE_VERSION 1
|
| 1247 |
+
struct Tcl_HashKeyType {
|
| 1248 |
+
int version; /* Version of the table. If this structure is
|
| 1249 |
+
* extended in future then the version can be
|
| 1250 |
+
* used to distinguish between different
|
| 1251 |
+
* structures. */
|
| 1252 |
+
int flags; /* Flags, see above for details. */
|
| 1253 |
+
Tcl_HashKeyProc *hashKeyProc;
|
| 1254 |
+
/* Calculates a hash value for the key. If
|
| 1255 |
+
* this is NULL then the pointer itself is
|
| 1256 |
+
* used as a hash value. */
|
| 1257 |
+
Tcl_CompareHashKeysProc *compareKeysProc;
|
| 1258 |
+
/* Compares two keys and returns zero if they
|
| 1259 |
+
* do not match, and non-zero if they do. If
|
| 1260 |
+
* this is NULL then the pointers are
|
| 1261 |
+
* compared. */
|
| 1262 |
+
Tcl_AllocHashEntryProc *allocEntryProc;
|
| 1263 |
+
/* Called to allocate memory for a new entry,
|
| 1264 |
+
* i.e. if the key is a string then this could
|
| 1265 |
+
* allocate a single block which contains
|
| 1266 |
+
* enough space for both the entry and the
|
| 1267 |
+
* string. Only the key field of the allocated
|
| 1268 |
+
* Tcl_HashEntry structure needs to be filled
|
| 1269 |
+
* in. If something else needs to be done to
|
| 1270 |
+
* the key, i.e. incrementing a reference
|
| 1271 |
+
* count then that should be done by this
|
| 1272 |
+
* function. If this is NULL then Tcl_Alloc is
|
| 1273 |
+
* used to allocate enough space for a
|
| 1274 |
+
* Tcl_HashEntry and the key pointer is
|
| 1275 |
+
* assigned to key.oneWordValue. */
|
| 1276 |
+
Tcl_FreeHashEntryProc *freeEntryProc;
|
| 1277 |
+
/* Called to free memory associated with an
|
| 1278 |
+
* entry. If something else needs to be done
|
| 1279 |
+
* to the key, i.e. decrementing a reference
|
| 1280 |
+
* count then that should be done by this
|
| 1281 |
+
* function. If this is NULL then Tcl_Free is
|
| 1282 |
+
* used to free the Tcl_HashEntry. */
|
| 1283 |
+
};
|
| 1284 |
+
|
| 1285 |
+
/*
|
| 1286 |
+
* Structure definition for a hash table. Must be in tcl.h so clients can
|
| 1287 |
+
* allocate space for these structures, but clients should never access any
|
| 1288 |
+
* fields in this structure.
|
| 1289 |
+
*/
|
| 1290 |
+
|
| 1291 |
+
#define TCL_SMALL_HASH_TABLE 4
|
| 1292 |
+
struct Tcl_HashTable {
|
| 1293 |
+
Tcl_HashEntry **buckets; /* Pointer to bucket array. Each element
|
| 1294 |
+
* points to first entry in bucket's hash
|
| 1295 |
+
* chain, or NULL. */
|
| 1296 |
+
Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
|
| 1297 |
+
/* Bucket array used for small tables (to
|
| 1298 |
+
* avoid mallocs and frees). */
|
| 1299 |
+
int numBuckets; /* Total number of buckets allocated at
|
| 1300 |
+
* **bucketPtr. */
|
| 1301 |
+
int numEntries; /* Total number of entries present in
|
| 1302 |
+
* table. */
|
| 1303 |
+
int rebuildSize; /* Enlarge table when numEntries gets to be
|
| 1304 |
+
* this large. */
|
| 1305 |
+
int downShift; /* Shift count used in hashing function.
|
| 1306 |
+
* Designed to use high-order bits of
|
| 1307 |
+
* randomized keys. */
|
| 1308 |
+
int mask; /* Mask value used in hashing function. */
|
| 1309 |
+
int keyType; /* Type of keys used in this table. It's
|
| 1310 |
+
* either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
|
| 1311 |
+
* TCL_ONE_WORD_KEYS, or an integer giving the
|
| 1312 |
+
* number of ints that is the size of the
|
| 1313 |
+
* key. */
|
| 1314 |
+
Tcl_HashEntry *(*findProc) (Tcl_HashTable *tablePtr, const char *key);
|
| 1315 |
+
Tcl_HashEntry *(*createProc) (Tcl_HashTable *tablePtr, const char *key,
|
| 1316 |
+
int *newPtr);
|
| 1317 |
+
const Tcl_HashKeyType *typePtr;
|
| 1318 |
+
/* Type of the keys used in the
|
| 1319 |
+
* Tcl_HashTable. */
|
| 1320 |
+
};
|
| 1321 |
+
|
| 1322 |
+
/*
|
| 1323 |
+
* Structure definition for information used to keep track of searches through
|
| 1324 |
+
* hash tables:
|
| 1325 |
+
*/
|
| 1326 |
+
|
| 1327 |
+
typedef struct Tcl_HashSearch {
|
| 1328 |
+
Tcl_HashTable *tablePtr; /* Table being searched. */
|
| 1329 |
+
int nextIndex; /* Index of next bucket to be enumerated after
|
| 1330 |
+
* present one. */
|
| 1331 |
+
Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current
|
| 1332 |
+
* bucket. */
|
| 1333 |
+
} Tcl_HashSearch;
|
| 1334 |
+
|
| 1335 |
+
/*
|
| 1336 |
+
* Acceptable key types for hash tables:
|
| 1337 |
+
*
|
| 1338 |
+
* TCL_STRING_KEYS: The keys are strings, they are copied into the
|
| 1339 |
+
* entry.
|
| 1340 |
+
* TCL_ONE_WORD_KEYS: The keys are pointers, the pointer is stored
|
| 1341 |
+
* in the entry.
|
| 1342 |
+
* TCL_CUSTOM_TYPE_KEYS: The keys are arbitrary types which are copied
|
| 1343 |
+
* into the entry.
|
| 1344 |
+
* TCL_CUSTOM_PTR_KEYS: The keys are pointers to arbitrary types, the
|
| 1345 |
+
* pointer is stored in the entry.
|
| 1346 |
+
*
|
| 1347 |
+
* While maintaining binary compatibility the above have to be distinct values
|
| 1348 |
+
* as they are used to differentiate between old versions of the hash table
|
| 1349 |
+
* which don't have a typePtr and new ones which do. Once binary compatibility
|
| 1350 |
+
* is discarded in favour of making more wide spread changes TCL_STRING_KEYS
|
| 1351 |
+
* can be the same as TCL_CUSTOM_TYPE_KEYS, and TCL_ONE_WORD_KEYS can be the
|
| 1352 |
+
* same as TCL_CUSTOM_PTR_KEYS because they simply determine how the key is
|
| 1353 |
+
* accessed from the entry and not the behaviour.
|
| 1354 |
+
*/
|
| 1355 |
+
|
| 1356 |
+
#define TCL_STRING_KEYS (0)
|
| 1357 |
+
#define TCL_ONE_WORD_KEYS (1)
|
| 1358 |
+
#define TCL_CUSTOM_TYPE_KEYS (-2)
|
| 1359 |
+
#define TCL_CUSTOM_PTR_KEYS (-1)
|
| 1360 |
+
|
| 1361 |
+
/*
|
| 1362 |
+
* Structure definition for information used to keep track of searches through
|
| 1363 |
+
* dictionaries. These fields should not be accessed by code outside
|
| 1364 |
+
* tclDictObj.c
|
| 1365 |
+
*/
|
| 1366 |
+
|
| 1367 |
+
typedef struct {
|
| 1368 |
+
void *next; /* Search position for underlying hash
|
| 1369 |
+
* table. */
|
| 1370 |
+
int epoch; /* Epoch marker for dictionary being searched,
|
| 1371 |
+
* or -1 if search has terminated. */
|
| 1372 |
+
Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
|
| 1373 |
+
} Tcl_DictSearch;
|
| 1374 |
+
|
| 1375 |
+
/*
|
| 1376 |
+
*----------------------------------------------------------------------------
|
| 1377 |
+
* Flag values to pass to Tcl_DoOneEvent to disable searches for some kinds of
|
| 1378 |
+
* events:
|
| 1379 |
+
*/
|
| 1380 |
+
|
| 1381 |
+
#define TCL_DONT_WAIT (1<<1)
|
| 1382 |
+
#define TCL_WINDOW_EVENTS (1<<2)
|
| 1383 |
+
#define TCL_FILE_EVENTS (1<<3)
|
| 1384 |
+
#define TCL_TIMER_EVENTS (1<<4)
|
| 1385 |
+
#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */
|
| 1386 |
+
#define TCL_ALL_EVENTS (~TCL_DONT_WAIT)
|
| 1387 |
+
|
| 1388 |
+
/*
|
| 1389 |
+
* The following structure defines a generic event for the Tcl event system.
|
| 1390 |
+
* These are the things that are queued in calls to Tcl_QueueEvent and
|
| 1391 |
+
* serviced later by Tcl_DoOneEvent. There can be many different kinds of
|
| 1392 |
+
* events with different fields, corresponding to window events, timer events,
|
| 1393 |
+
* etc. The structure for a particular event consists of a Tcl_Event header
|
| 1394 |
+
* followed by additional information specific to that event.
|
| 1395 |
+
*/
|
| 1396 |
+
|
| 1397 |
+
struct Tcl_Event {
|
| 1398 |
+
Tcl_EventProc *proc; /* Function to call to service this event. */
|
| 1399 |
+
struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */
|
| 1400 |
+
};
|
| 1401 |
+
|
| 1402 |
+
/*
|
| 1403 |
+
* Positions to pass to Tcl_QueueEvent:
|
| 1404 |
+
*/
|
| 1405 |
+
|
| 1406 |
+
typedef enum {
|
| 1407 |
+
TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK
|
| 1408 |
+
} Tcl_QueuePosition;
|
| 1409 |
+
|
| 1410 |
+
/*
|
| 1411 |
+
* Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
|
| 1412 |
+
* event routines.
|
| 1413 |
+
*/
|
| 1414 |
+
|
| 1415 |
+
#define TCL_SERVICE_NONE 0
|
| 1416 |
+
#define TCL_SERVICE_ALL 1
|
| 1417 |
+
|
| 1418 |
+
/*
|
| 1419 |
+
* The following structure keeps is used to hold a time value, either as an
|
| 1420 |
+
* absolute time (the number of seconds from the epoch) or as an elapsed time.
|
| 1421 |
+
* On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
|
| 1422 |
+
*/
|
| 1423 |
+
|
| 1424 |
+
typedef struct Tcl_Time {
|
| 1425 |
+
long sec; /* Seconds. */
|
| 1426 |
+
long usec; /* Microseconds. */
|
| 1427 |
+
} Tcl_Time;
|
| 1428 |
+
|
| 1429 |
+
typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
|
| 1430 |
+
typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr);
|
| 1431 |
+
|
| 1432 |
+
/*
|
| 1433 |
+
* TIP #233 (Virtualized Time)
|
| 1434 |
+
*/
|
| 1435 |
+
|
| 1436 |
+
typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
| 1437 |
+
typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
| 1438 |
+
|
| 1439 |
+
/*
|
| 1440 |
+
*----------------------------------------------------------------------------
|
| 1441 |
+
* Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler to
|
| 1442 |
+
* indicate what sorts of events are of interest:
|
| 1443 |
+
*/
|
| 1444 |
+
|
| 1445 |
+
#define TCL_READABLE (1<<1)
|
| 1446 |
+
#define TCL_WRITABLE (1<<2)
|
| 1447 |
+
#define TCL_EXCEPTION (1<<3)
|
| 1448 |
+
|
| 1449 |
+
/*
|
| 1450 |
+
* Flag values to pass to Tcl_OpenCommandChannel to indicate the disposition
|
| 1451 |
+
* of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, are also used in
|
| 1452 |
+
* Tcl_GetStdChannel.
|
| 1453 |
+
*/
|
| 1454 |
+
|
| 1455 |
+
#define TCL_STDIN (1<<1)
|
| 1456 |
+
#define TCL_STDOUT (1<<2)
|
| 1457 |
+
#define TCL_STDERR (1<<3)
|
| 1458 |
+
#define TCL_ENFORCE_MODE (1<<4)
|
| 1459 |
+
|
| 1460 |
+
/*
|
| 1461 |
+
* Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel
|
| 1462 |
+
* should be closed.
|
| 1463 |
+
*/
|
| 1464 |
+
|
| 1465 |
+
#define TCL_CLOSE_READ (1<<1)
|
| 1466 |
+
#define TCL_CLOSE_WRITE (1<<2)
|
| 1467 |
+
|
| 1468 |
+
/*
|
| 1469 |
+
* Value to use as the closeProc for a channel that supports the close2Proc
|
| 1470 |
+
* interface.
|
| 1471 |
+
*/
|
| 1472 |
+
|
| 1473 |
+
#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *) 1)
|
| 1474 |
+
|
| 1475 |
+
/*
|
| 1476 |
+
* Channel version tag. This was introduced in 8.3.2/8.4.
|
| 1477 |
+
*/
|
| 1478 |
+
|
| 1479 |
+
#define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1)
|
| 1480 |
+
#define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2)
|
| 1481 |
+
#define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3)
|
| 1482 |
+
#define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4)
|
| 1483 |
+
#define TCL_CHANNEL_VERSION_5 ((Tcl_ChannelTypeVersion) 0x5)
|
| 1484 |
+
|
| 1485 |
+
/*
|
| 1486 |
+
* TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc.
|
| 1487 |
+
*/
|
| 1488 |
+
|
| 1489 |
+
#define TCL_CHANNEL_THREAD_INSERT (0)
|
| 1490 |
+
#define TCL_CHANNEL_THREAD_REMOVE (1)
|
| 1491 |
+
|
| 1492 |
+
/*
|
| 1493 |
+
* Typedefs for the various operations in a channel type:
|
| 1494 |
+
*/
|
| 1495 |
+
|
| 1496 |
+
typedef int (Tcl_DriverBlockModeProc) (ClientData instanceData, int mode);
|
| 1497 |
+
typedef int (Tcl_DriverCloseProc) (ClientData instanceData,
|
| 1498 |
+
Tcl_Interp *interp);
|
| 1499 |
+
typedef int (Tcl_DriverClose2Proc) (ClientData instanceData,
|
| 1500 |
+
Tcl_Interp *interp, int flags);
|
| 1501 |
+
typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf,
|
| 1502 |
+
int toRead, int *errorCodePtr);
|
| 1503 |
+
typedef int (Tcl_DriverOutputProc) (ClientData instanceData,
|
| 1504 |
+
CONST84 char *buf, int toWrite, int *errorCodePtr);
|
| 1505 |
+
typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset,
|
| 1506 |
+
int mode, int *errorCodePtr);
|
| 1507 |
+
typedef int (Tcl_DriverSetOptionProc) (ClientData instanceData,
|
| 1508 |
+
Tcl_Interp *interp, const char *optionName,
|
| 1509 |
+
const char *value);
|
| 1510 |
+
typedef int (Tcl_DriverGetOptionProc) (ClientData instanceData,
|
| 1511 |
+
Tcl_Interp *interp, CONST84 char *optionName,
|
| 1512 |
+
Tcl_DString *dsPtr);
|
| 1513 |
+
typedef void (Tcl_DriverWatchProc) (ClientData instanceData, int mask);
|
| 1514 |
+
typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData,
|
| 1515 |
+
int direction, ClientData *handlePtr);
|
| 1516 |
+
typedef int (Tcl_DriverFlushProc) (ClientData instanceData);
|
| 1517 |
+
typedef int (Tcl_DriverHandlerProc) (ClientData instanceData,
|
| 1518 |
+
int interestMask);
|
| 1519 |
+
typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (ClientData instanceData,
|
| 1520 |
+
Tcl_WideInt offset, int mode, int *errorCodePtr);
|
| 1521 |
+
/*
|
| 1522 |
+
* TIP #218, Channel Thread Actions
|
| 1523 |
+
*/
|
| 1524 |
+
typedef void (Tcl_DriverThreadActionProc) (ClientData instanceData,
|
| 1525 |
+
int action);
|
| 1526 |
+
/*
|
| 1527 |
+
* TIP #208, File Truncation (etc.)
|
| 1528 |
+
*/
|
| 1529 |
+
typedef int (Tcl_DriverTruncateProc) (ClientData instanceData,
|
| 1530 |
+
Tcl_WideInt length);
|
| 1531 |
+
|
| 1532 |
+
/*
|
| 1533 |
+
* struct Tcl_ChannelType:
|
| 1534 |
+
*
|
| 1535 |
+
* One such structure exists for each type (kind) of channel. It collects
|
| 1536 |
+
* together in one place all the functions that are part of the specific
|
| 1537 |
+
* channel type.
|
| 1538 |
+
*
|
| 1539 |
+
* It is recommend that the Tcl_Channel* functions are used to access elements
|
| 1540 |
+
* of this structure, instead of direct accessing.
|
| 1541 |
+
*/
|
| 1542 |
+
|
| 1543 |
+
typedef struct Tcl_ChannelType {
|
| 1544 |
+
const char *typeName; /* The name of the channel type in Tcl
|
| 1545 |
+
* commands. This storage is owned by channel
|
| 1546 |
+
* type. */
|
| 1547 |
+
Tcl_ChannelTypeVersion version;
|
| 1548 |
+
/* Version of the channel type. */
|
| 1549 |
+
Tcl_DriverCloseProc *closeProc;
|
| 1550 |
+
/* Function to call to close the channel, or
|
| 1551 |
+
* TCL_CLOSE2PROC if the close2Proc should be
|
| 1552 |
+
* used instead. */
|
| 1553 |
+
Tcl_DriverInputProc *inputProc;
|
| 1554 |
+
/* Function to call for input on channel. */
|
| 1555 |
+
Tcl_DriverOutputProc *outputProc;
|
| 1556 |
+
/* Function to call for output on channel. */
|
| 1557 |
+
Tcl_DriverSeekProc *seekProc;
|
| 1558 |
+
/* Function to call to seek on the channel.
|
| 1559 |
+
* May be NULL. */
|
| 1560 |
+
Tcl_DriverSetOptionProc *setOptionProc;
|
| 1561 |
+
/* Set an option on a channel. */
|
| 1562 |
+
Tcl_DriverGetOptionProc *getOptionProc;
|
| 1563 |
+
/* Get an option from a channel. */
|
| 1564 |
+
Tcl_DriverWatchProc *watchProc;
|
| 1565 |
+
/* Set up the notifier to watch for events on
|
| 1566 |
+
* this channel. */
|
| 1567 |
+
Tcl_DriverGetHandleProc *getHandleProc;
|
| 1568 |
+
/* Get an OS handle from the channel or NULL
|
| 1569 |
+
* if not supported. */
|
| 1570 |
+
Tcl_DriverClose2Proc *close2Proc;
|
| 1571 |
+
/* Function to call to close the channel if
|
| 1572 |
+
* the device supports closing the read &
|
| 1573 |
+
* write sides independently. */
|
| 1574 |
+
Tcl_DriverBlockModeProc *blockModeProc;
|
| 1575 |
+
/* Set blocking mode for the raw channel. May
|
| 1576 |
+
* be NULL. */
|
| 1577 |
+
/*
|
| 1578 |
+
* Only valid in TCL_CHANNEL_VERSION_2 channels or later.
|
| 1579 |
+
*/
|
| 1580 |
+
Tcl_DriverFlushProc *flushProc;
|
| 1581 |
+
/* Function to call to flush a channel. May be
|
| 1582 |
+
* NULL. */
|
| 1583 |
+
Tcl_DriverHandlerProc *handlerProc;
|
| 1584 |
+
/* Function to call to handle a channel event.
|
| 1585 |
+
* This will be passed up the stacked channel
|
| 1586 |
+
* chain. */
|
| 1587 |
+
/*
|
| 1588 |
+
* Only valid in TCL_CHANNEL_VERSION_3 channels or later.
|
| 1589 |
+
*/
|
| 1590 |
+
Tcl_DriverWideSeekProc *wideSeekProc;
|
| 1591 |
+
/* Function to call to seek on the channel
|
| 1592 |
+
* which can handle 64-bit offsets. May be
|
| 1593 |
+
* NULL, and must be NULL if seekProc is
|
| 1594 |
+
* NULL. */
|
| 1595 |
+
/*
|
| 1596 |
+
* Only valid in TCL_CHANNEL_VERSION_4 channels or later.
|
| 1597 |
+
* TIP #218, Channel Thread Actions.
|
| 1598 |
+
*/
|
| 1599 |
+
Tcl_DriverThreadActionProc *threadActionProc;
|
| 1600 |
+
/* Function to call to notify the driver of
|
| 1601 |
+
* thread specific activity for a channel. May
|
| 1602 |
+
* be NULL. */
|
| 1603 |
+
/*
|
| 1604 |
+
* Only valid in TCL_CHANNEL_VERSION_5 channels or later.
|
| 1605 |
+
* TIP #208, File Truncation.
|
| 1606 |
+
*/
|
| 1607 |
+
Tcl_DriverTruncateProc *truncateProc;
|
| 1608 |
+
/* Function to call to truncate the underlying
|
| 1609 |
+
* file to a particular length. May be NULL if
|
| 1610 |
+
* the channel does not support truncation. */
|
| 1611 |
+
} Tcl_ChannelType;
|
| 1612 |
+
|
| 1613 |
+
/*
|
| 1614 |
+
* The following flags determine whether the blockModeProc above should set
|
| 1615 |
+
* the channel into blocking or nonblocking mode. They are passed as arguments
|
| 1616 |
+
* to the blockModeProc function in the above structure.
|
| 1617 |
+
*/
|
| 1618 |
+
|
| 1619 |
+
#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */
|
| 1620 |
+
#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
|
| 1621 |
+
* mode. */
|
| 1622 |
+
|
| 1623 |
+
/*
|
| 1624 |
+
*----------------------------------------------------------------------------
|
| 1625 |
+
* Enum for different types of file paths.
|
| 1626 |
+
*/
|
| 1627 |
+
|
| 1628 |
+
typedef enum Tcl_PathType {
|
| 1629 |
+
TCL_PATH_ABSOLUTE,
|
| 1630 |
+
TCL_PATH_RELATIVE,
|
| 1631 |
+
TCL_PATH_VOLUME_RELATIVE
|
| 1632 |
+
} Tcl_PathType;
|
| 1633 |
+
|
| 1634 |
+
/*
|
| 1635 |
+
* The following structure is used to pass glob type data amongst the various
|
| 1636 |
+
* glob routines and Tcl_FSMatchInDirectory.
|
| 1637 |
+
*/
|
| 1638 |
+
|
| 1639 |
+
typedef struct Tcl_GlobTypeData {
|
| 1640 |
+
int type; /* Corresponds to bcdpfls as in 'find -t'. */
|
| 1641 |
+
int perm; /* Corresponds to file permissions. */
|
| 1642 |
+
Tcl_Obj *macType; /* Acceptable Mac type. */
|
| 1643 |
+
Tcl_Obj *macCreator; /* Acceptable Mac creator. */
|
| 1644 |
+
} Tcl_GlobTypeData;
|
| 1645 |
+
|
| 1646 |
+
/*
|
| 1647 |
+
* Type and permission definitions for glob command.
|
| 1648 |
+
*/
|
| 1649 |
+
|
| 1650 |
+
#define TCL_GLOB_TYPE_BLOCK (1<<0)
|
| 1651 |
+
#define TCL_GLOB_TYPE_CHAR (1<<1)
|
| 1652 |
+
#define TCL_GLOB_TYPE_DIR (1<<2)
|
| 1653 |
+
#define TCL_GLOB_TYPE_PIPE (1<<3)
|
| 1654 |
+
#define TCL_GLOB_TYPE_FILE (1<<4)
|
| 1655 |
+
#define TCL_GLOB_TYPE_LINK (1<<5)
|
| 1656 |
+
#define TCL_GLOB_TYPE_SOCK (1<<6)
|
| 1657 |
+
#define TCL_GLOB_TYPE_MOUNT (1<<7)
|
| 1658 |
+
|
| 1659 |
+
#define TCL_GLOB_PERM_RONLY (1<<0)
|
| 1660 |
+
#define TCL_GLOB_PERM_HIDDEN (1<<1)
|
| 1661 |
+
#define TCL_GLOB_PERM_R (1<<2)
|
| 1662 |
+
#define TCL_GLOB_PERM_W (1<<3)
|
| 1663 |
+
#define TCL_GLOB_PERM_X (1<<4)
|
| 1664 |
+
|
| 1665 |
+
/*
|
| 1666 |
+
* Flags for the unload callback function.
|
| 1667 |
+
*/
|
| 1668 |
+
|
| 1669 |
+
#define TCL_UNLOAD_DETACH_FROM_INTERPRETER (1<<0)
|
| 1670 |
+
#define TCL_UNLOAD_DETACH_FROM_PROCESS (1<<1)
|
| 1671 |
+
|
| 1672 |
+
/*
|
| 1673 |
+
* Typedefs for the various filesystem operations:
|
| 1674 |
+
*/
|
| 1675 |
+
|
| 1676 |
+
typedef int (Tcl_FSStatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
|
| 1677 |
+
typedef int (Tcl_FSAccessProc) (Tcl_Obj *pathPtr, int mode);
|
| 1678 |
+
typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) (Tcl_Interp *interp,
|
| 1679 |
+
Tcl_Obj *pathPtr, int mode, int permissions);
|
| 1680 |
+
typedef int (Tcl_FSMatchInDirectoryProc) (Tcl_Interp *interp, Tcl_Obj *result,
|
| 1681 |
+
Tcl_Obj *pathPtr, const char *pattern, Tcl_GlobTypeData *types);
|
| 1682 |
+
typedef Tcl_Obj * (Tcl_FSGetCwdProc) (Tcl_Interp *interp);
|
| 1683 |
+
typedef int (Tcl_FSChdirProc) (Tcl_Obj *pathPtr);
|
| 1684 |
+
typedef int (Tcl_FSLstatProc) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
|
| 1685 |
+
typedef int (Tcl_FSCreateDirectoryProc) (Tcl_Obj *pathPtr);
|
| 1686 |
+
typedef int (Tcl_FSDeleteFileProc) (Tcl_Obj *pathPtr);
|
| 1687 |
+
typedef int (Tcl_FSCopyDirectoryProc) (Tcl_Obj *srcPathPtr,
|
| 1688 |
+
Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr);
|
| 1689 |
+
typedef int (Tcl_FSCopyFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
|
| 1690 |
+
typedef int (Tcl_FSRemoveDirectoryProc) (Tcl_Obj *pathPtr, int recursive,
|
| 1691 |
+
Tcl_Obj **errorPtr);
|
| 1692 |
+
typedef int (Tcl_FSRenameFileProc) (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr);
|
| 1693 |
+
typedef void (Tcl_FSUnloadFileProc) (Tcl_LoadHandle loadHandle);
|
| 1694 |
+
typedef Tcl_Obj * (Tcl_FSListVolumesProc) (void);
|
| 1695 |
+
/* We have to declare the utime structure here. */
|
| 1696 |
+
struct utimbuf;
|
| 1697 |
+
typedef int (Tcl_FSUtimeProc) (Tcl_Obj *pathPtr, struct utimbuf *tval);
|
| 1698 |
+
typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
| 1699 |
+
int nextCheckpoint);
|
| 1700 |
+
typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index,
|
| 1701 |
+
Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef);
|
| 1702 |
+
typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
|
| 1703 |
+
Tcl_Obj **objPtrRef);
|
| 1704 |
+
typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index,
|
| 1705 |
+
Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
|
| 1706 |
+
typedef Tcl_Obj * (Tcl_FSLinkProc) (Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
|
| 1707 |
+
int linkType);
|
| 1708 |
+
typedef int (Tcl_FSLoadFileProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
| 1709 |
+
Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr);
|
| 1710 |
+
typedef int (Tcl_FSPathInFilesystemProc) (Tcl_Obj *pathPtr,
|
| 1711 |
+
ClientData *clientDataPtr);
|
| 1712 |
+
typedef Tcl_Obj * (Tcl_FSFilesystemPathTypeProc) (Tcl_Obj *pathPtr);
|
| 1713 |
+
typedef Tcl_Obj * (Tcl_FSFilesystemSeparatorProc) (Tcl_Obj *pathPtr);
|
| 1714 |
+
typedef void (Tcl_FSFreeInternalRepProc) (ClientData clientData);
|
| 1715 |
+
typedef ClientData (Tcl_FSDupInternalRepProc) (ClientData clientData);
|
| 1716 |
+
typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) (ClientData clientData);
|
| 1717 |
+
typedef ClientData (Tcl_FSCreateInternalRepProc) (Tcl_Obj *pathPtr);
|
| 1718 |
+
|
| 1719 |
+
typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
|
| 1720 |
+
|
| 1721 |
+
/*
|
| 1722 |
+
*----------------------------------------------------------------------------
|
| 1723 |
+
* Data structures related to hooking into the filesystem
|
| 1724 |
+
*/
|
| 1725 |
+
|
| 1726 |
+
/*
|
| 1727 |
+
* Filesystem version tag. This was introduced in 8.4.
|
| 1728 |
+
*/
|
| 1729 |
+
|
| 1730 |
+
#define TCL_FILESYSTEM_VERSION_1 ((Tcl_FSVersion) 0x1)
|
| 1731 |
+
|
| 1732 |
+
/*
|
| 1733 |
+
* struct Tcl_Filesystem:
|
| 1734 |
+
*
|
| 1735 |
+
* One such structure exists for each type (kind) of filesystem. It collects
|
| 1736 |
+
* together the functions that form the interface for a particulr the
|
| 1737 |
+
* filesystem. Tcl always accesses the filesystem through one of these
|
| 1738 |
+
* structures.
|
| 1739 |
+
*
|
| 1740 |
+
* Not all entries need be non-NULL; any which are NULL are simply ignored.
|
| 1741 |
+
* However, a complete filesystem should provide all of these functions. The
|
| 1742 |
+
* explanations in the structure show the importance of each function.
|
| 1743 |
+
*/
|
| 1744 |
+
|
| 1745 |
+
typedef struct Tcl_Filesystem {
|
| 1746 |
+
const char *typeName; /* The name of the filesystem. */
|
| 1747 |
+
int structureLength; /* Length of this structure, so future binary
|
| 1748 |
+
* compatibility can be assured. */
|
| 1749 |
+
Tcl_FSVersion version; /* Version of the filesystem type. */
|
| 1750 |
+
Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
|
| 1751 |
+
/* Determines whether the pathname is in this
|
| 1752 |
+
* filesystem. This is the most important
|
| 1753 |
+
* filesystem function. */
|
| 1754 |
+
Tcl_FSDupInternalRepProc *dupInternalRepProc;
|
| 1755 |
+
/* Duplicates the internal handle of the node.
|
| 1756 |
+
* If it is NULL, the filesystem is less
|
| 1757 |
+
* performant. */
|
| 1758 |
+
Tcl_FSFreeInternalRepProc *freeInternalRepProc;
|
| 1759 |
+
/* Frees the internal handle of the node. NULL
|
| 1760 |
+
* only if there is no need to free resources
|
| 1761 |
+
* used for the internal handle. */
|
| 1762 |
+
Tcl_FSInternalToNormalizedProc *internalToNormalizedProc;
|
| 1763 |
+
/* Converts the internal handle to a normalized
|
| 1764 |
+
* path. NULL if the filesystem creates nodes
|
| 1765 |
+
* having no pathname. */
|
| 1766 |
+
Tcl_FSCreateInternalRepProc *createInternalRepProc;
|
| 1767 |
+
/* Creates an internal handle for a pathname.
|
| 1768 |
+
* May be NULL if pathnames have no internal
|
| 1769 |
+
* handle or if pathInFilesystemProc always
|
| 1770 |
+
* immediately creates an internal
|
| 1771 |
+
* representation for pathnames in the
|
| 1772 |
+
* filesystem. */
|
| 1773 |
+
Tcl_FSNormalizePathProc *normalizePathProc;
|
| 1774 |
+
/* Normalizes a path. Should be implemented if
|
| 1775 |
+
* the filesystems supports multiple paths to
|
| 1776 |
+
* the same node. */
|
| 1777 |
+
Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc;
|
| 1778 |
+
/* Determines the type of a path in this
|
| 1779 |
+
* filesystem. May be NULL. */
|
| 1780 |
+
Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc;
|
| 1781 |
+
/* Produces the separator character(s) for this
|
| 1782 |
+
* filesystem. Must not be NULL. */
|
| 1783 |
+
Tcl_FSStatProc *statProc; /* Called by 'Tcl_FSStat()'. Provided by any
|
| 1784 |
+
* reasonable filesystem. */
|
| 1785 |
+
Tcl_FSAccessProc *accessProc;
|
| 1786 |
+
/* Called by 'Tcl_FSAccess()'. Implemented by
|
| 1787 |
+
* any reasonable filesystem. */
|
| 1788 |
+
Tcl_FSOpenFileChannelProc *openFileChannelProc;
|
| 1789 |
+
/* Called by 'Tcl_FSOpenFileChannel()'.
|
| 1790 |
+
* Provided by any reasonable filesystem. */
|
| 1791 |
+
Tcl_FSMatchInDirectoryProc *matchInDirectoryProc;
|
| 1792 |
+
/* Called by 'Tcl_FSMatchInDirectory()'. NULL
|
| 1793 |
+
* if the filesystem does not support glob or
|
| 1794 |
+
* recursive copy. */
|
| 1795 |
+
Tcl_FSUtimeProc *utimeProc; /* Called by 'Tcl_FSUtime()', by 'file
|
| 1796 |
+
* mtime' to set (not read) times, 'file
|
| 1797 |
+
* atime', and the open-r/open-w/fcopy variant
|
| 1798 |
+
* of 'file copy'. */
|
| 1799 |
+
Tcl_FSLinkProc *linkProc; /* Called by 'Tcl_FSLink()'. NULL if reading or
|
| 1800 |
+
* creating links is not supported. */
|
| 1801 |
+
Tcl_FSListVolumesProc *listVolumesProc;
|
| 1802 |
+
/* Lists filesystem volumes added by this
|
| 1803 |
+
* filesystem. NULL if the filesystem does not
|
| 1804 |
+
* use volumes. */
|
| 1805 |
+
Tcl_FSFileAttrStringsProc *fileAttrStringsProc;
|
| 1806 |
+
/* List all valid attributes strings. NULL if
|
| 1807 |
+
* the filesystem does not support the 'file
|
| 1808 |
+
* attributes' command. Can be used to attach
|
| 1809 |
+
* arbitrary additional data to files in a
|
| 1810 |
+
* filesystem. */
|
| 1811 |
+
Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
|
| 1812 |
+
/* Called by 'Tcl_FSFileAttrsGet()' and by
|
| 1813 |
+
* 'file attributes'. */
|
| 1814 |
+
Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
|
| 1815 |
+
/* Called by 'Tcl_FSFileAttrsSet()' and by
|
| 1816 |
+
* 'file attributes'. */
|
| 1817 |
+
Tcl_FSCreateDirectoryProc *createDirectoryProc;
|
| 1818 |
+
/* Called by 'Tcl_FSCreateDirectory()'. May be
|
| 1819 |
+
* NULL if the filesystem is read-only. */
|
| 1820 |
+
Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
|
| 1821 |
+
/* Called by 'Tcl_FSRemoveDirectory()'. May be
|
| 1822 |
+
* NULL if the filesystem is read-only. */
|
| 1823 |
+
Tcl_FSDeleteFileProc *deleteFileProc;
|
| 1824 |
+
/* Called by 'Tcl_FSDeleteFile()' May be NULL
|
| 1825 |
+
* if the filesystem is is read-only. */
|
| 1826 |
+
Tcl_FSCopyFileProc *copyFileProc;
|
| 1827 |
+
/* Called by 'Tcl_FSCopyFile()'. If NULL, for
|
| 1828 |
+
* a copy operation at the script level (not
|
| 1829 |
+
* C) Tcl uses open-r, open-w and fcopy. */
|
| 1830 |
+
Tcl_FSRenameFileProc *renameFileProc;
|
| 1831 |
+
/* Called by 'Tcl_FSRenameFile()'. If NULL, for
|
| 1832 |
+
* a rename operation at the script level (not
|
| 1833 |
+
* C) Tcl performs a copy operation followed
|
| 1834 |
+
* by a delete operation. */
|
| 1835 |
+
Tcl_FSCopyDirectoryProc *copyDirectoryProc;
|
| 1836 |
+
/* Called by 'Tcl_FSCopyDirectory()'. If NULL,
|
| 1837 |
+
* for a copy operation at the script level
|
| 1838 |
+
* (not C) Tcl recursively creates directories
|
| 1839 |
+
* and copies files. */
|
| 1840 |
+
Tcl_FSLstatProc *lstatProc; /* Called by 'Tcl_FSLstat()'. If NULL, Tcl
|
| 1841 |
+
* attempts to use 'statProc' instead. */
|
| 1842 |
+
Tcl_FSLoadFileProc *loadFileProc;
|
| 1843 |
+
/* Called by 'Tcl_FSLoadFile()'. If NULL, Tcl
|
| 1844 |
+
* performs a copy to a temporary file in the
|
| 1845 |
+
* native filesystem and then calls
|
| 1846 |
+
* Tcl_FSLoadFile() on that temporary copy. */
|
| 1847 |
+
Tcl_FSGetCwdProc *getCwdProc;
|
| 1848 |
+
/* Called by 'Tcl_FSGetCwd()'. Normally NULL.
|
| 1849 |
+
* Usually only called once: If 'getcwd' is
|
| 1850 |
+
* called before 'chdir' is ever called. */
|
| 1851 |
+
Tcl_FSChdirProc *chdirProc; /* Called by 'Tcl_FSChdir()'. For a virtual
|
| 1852 |
+
* filesystem, chdirProc just returns zero
|
| 1853 |
+
* (success) if the pathname is a valid
|
| 1854 |
+
* directory, and some other value otherwise.
|
| 1855 |
+
* For A real filesystem, chdirProc performs
|
| 1856 |
+
* the correct action, e.g. calls the system
|
| 1857 |
+
* 'chdir' function. If not implemented, then
|
| 1858 |
+
* 'cd' and 'pwd' fail for a pathname in this
|
| 1859 |
+
* filesystem. On success Tcl stores the
|
| 1860 |
+
* pathname for use by GetCwd. If NULL, Tcl
|
| 1861 |
+
* performs records the pathname as the new
|
| 1862 |
+
* current directory if it passes a series of
|
| 1863 |
+
* directory access checks. */
|
| 1864 |
+
} Tcl_Filesystem;
|
| 1865 |
+
|
| 1866 |
+
/*
|
| 1867 |
+
* The following definitions are used as values for the 'linkAction' flag to
|
| 1868 |
+
* Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can
|
| 1869 |
+
* be given. For link creation, the linkProc should create a link which
|
| 1870 |
+
* matches any of the types given.
|
| 1871 |
+
*
|
| 1872 |
+
* TCL_CREATE_SYMBOLIC_LINK - Create a symbolic or soft link.
|
| 1873 |
+
* TCL_CREATE_HARD_LINK - Create a hard link.
|
| 1874 |
+
*/
|
| 1875 |
+
|
| 1876 |
+
#define TCL_CREATE_SYMBOLIC_LINK 0x01
|
| 1877 |
+
#define TCL_CREATE_HARD_LINK 0x02
|
| 1878 |
+
|
| 1879 |
+
/*
|
| 1880 |
+
*----------------------------------------------------------------------------
|
| 1881 |
+
* The following structure represents the Notifier functions that you can
|
| 1882 |
+
* override with the Tcl_SetNotifier call.
|
| 1883 |
+
*/
|
| 1884 |
+
|
| 1885 |
+
typedef struct Tcl_NotifierProcs {
|
| 1886 |
+
Tcl_SetTimerProc *setTimerProc;
|
| 1887 |
+
Tcl_WaitForEventProc *waitForEventProc;
|
| 1888 |
+
Tcl_CreateFileHandlerProc *createFileHandlerProc;
|
| 1889 |
+
Tcl_DeleteFileHandlerProc *deleteFileHandlerProc;
|
| 1890 |
+
Tcl_InitNotifierProc *initNotifierProc;
|
| 1891 |
+
Tcl_FinalizeNotifierProc *finalizeNotifierProc;
|
| 1892 |
+
Tcl_AlertNotifierProc *alertNotifierProc;
|
| 1893 |
+
Tcl_ServiceModeHookProc *serviceModeHookProc;
|
| 1894 |
+
} Tcl_NotifierProcs;
|
| 1895 |
+
|
| 1896 |
+
/*
|
| 1897 |
+
*----------------------------------------------------------------------------
|
| 1898 |
+
* The following data structures and declarations are for the new Tcl parser.
|
| 1899 |
+
*
|
| 1900 |
+
* For each word of a command, and for each piece of a word such as a variable
|
| 1901 |
+
* reference, one of the following structures is created to describe the
|
| 1902 |
+
* token.
|
| 1903 |
+
*/
|
| 1904 |
+
|
| 1905 |
+
typedef struct Tcl_Token {
|
| 1906 |
+
int type; /* Type of token, such as TCL_TOKEN_WORD; see
|
| 1907 |
+
* below for valid types. */
|
| 1908 |
+
const char *start; /* First character in token. */
|
| 1909 |
+
int size; /* Number of bytes in token. */
|
| 1910 |
+
int numComponents; /* If this token is composed of other tokens,
|
| 1911 |
+
* this field tells how many of them there are
|
| 1912 |
+
* (including components of components, etc.).
|
| 1913 |
+
* The component tokens immediately follow
|
| 1914 |
+
* this one. */
|
| 1915 |
+
} Tcl_Token;
|
| 1916 |
+
|
| 1917 |
+
/*
|
| 1918 |
+
* Type values defined for Tcl_Token structures. These values are defined as
|
| 1919 |
+
* mask bits so that it's easy to check for collections of types.
|
| 1920 |
+
*
|
| 1921 |
+
* TCL_TOKEN_WORD - The token describes one word of a command,
|
| 1922 |
+
* from the first non-blank character of the word
|
| 1923 |
+
* (which may be " or {) up to but not including
|
| 1924 |
+
* the space, semicolon, or bracket that
|
| 1925 |
+
* terminates the word. NumComponents counts the
|
| 1926 |
+
* total number of sub-tokens that make up the
|
| 1927 |
+
* word. This includes, for example, sub-tokens
|
| 1928 |
+
* of TCL_TOKEN_VARIABLE tokens.
|
| 1929 |
+
* TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD except
|
| 1930 |
+
* that the word is guaranteed to consist of a
|
| 1931 |
+
* single TCL_TOKEN_TEXT sub-token.
|
| 1932 |
+
* TCL_TOKEN_TEXT - The token describes a range of literal text
|
| 1933 |
+
* that is part of a word. NumComponents is
|
| 1934 |
+
* always 0.
|
| 1935 |
+
* TCL_TOKEN_BS - The token describes a backslash sequence that
|
| 1936 |
+
* must be collapsed. NumComponents is always 0.
|
| 1937 |
+
* TCL_TOKEN_COMMAND - The token describes a command whose result
|
| 1938 |
+
* must be substituted into the word. The token
|
| 1939 |
+
* includes the enclosing brackets. NumComponents
|
| 1940 |
+
* is always 0.
|
| 1941 |
+
* TCL_TOKEN_VARIABLE - The token describes a variable substitution,
|
| 1942 |
+
* including the dollar sign, variable name, and
|
| 1943 |
+
* array index (if there is one) up through the
|
| 1944 |
+
* right parentheses. NumComponents tells how
|
| 1945 |
+
* many additional tokens follow to represent the
|
| 1946 |
+
* variable name. The first token will be a
|
| 1947 |
+
* TCL_TOKEN_TEXT token that describes the
|
| 1948 |
+
* variable name. If the variable is an array
|
| 1949 |
+
* reference then there will be one or more
|
| 1950 |
+
* additional tokens, of type TCL_TOKEN_TEXT,
|
| 1951 |
+
* TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
|
| 1952 |
+
* TCL_TOKEN_VARIABLE, that describe the array
|
| 1953 |
+
* index; numComponents counts the total number
|
| 1954 |
+
* of nested tokens that make up the variable
|
| 1955 |
+
* reference, including sub-tokens of
|
| 1956 |
+
* TCL_TOKEN_VARIABLE tokens.
|
| 1957 |
+
* TCL_TOKEN_SUB_EXPR - The token describes one subexpression of an
|
| 1958 |
+
* expression, from the first non-blank character
|
| 1959 |
+
* of the subexpression up to but not including
|
| 1960 |
+
* the space, brace, or bracket that terminates
|
| 1961 |
+
* the subexpression. NumComponents counts the
|
| 1962 |
+
* total number of following subtokens that make
|
| 1963 |
+
* up the subexpression; this includes all
|
| 1964 |
+
* subtokens for any nested TCL_TOKEN_SUB_EXPR
|
| 1965 |
+
* tokens. For example, a numeric value used as a
|
| 1966 |
+
* primitive operand is described by a
|
| 1967 |
+
* TCL_TOKEN_SUB_EXPR token followed by a
|
| 1968 |
+
* TCL_TOKEN_TEXT token. A binary subexpression
|
| 1969 |
+
* is described by a TCL_TOKEN_SUB_EXPR token
|
| 1970 |
+
* followed by the TCL_TOKEN_OPERATOR token for
|
| 1971 |
+
* the operator, then TCL_TOKEN_SUB_EXPR tokens
|
| 1972 |
+
* for the left then the right operands.
|
| 1973 |
+
* TCL_TOKEN_OPERATOR - The token describes one expression operator.
|
| 1974 |
+
* An operator might be the name of a math
|
| 1975 |
+
* function such as "abs". A TCL_TOKEN_OPERATOR
|
| 1976 |
+
* token is always preceded by one
|
| 1977 |
+
* TCL_TOKEN_SUB_EXPR token for the operator's
|
| 1978 |
+
* subexpression, and is followed by zero or more
|
| 1979 |
+
* TCL_TOKEN_SUB_EXPR tokens for the operator's
|
| 1980 |
+
* operands. NumComponents is always 0.
|
| 1981 |
+
* TCL_TOKEN_EXPAND_WORD - This token is just like TCL_TOKEN_WORD except
|
| 1982 |
+
* that it marks a word that began with the
|
| 1983 |
+
* literal character prefix "{*}". This word is
|
| 1984 |
+
* marked to be expanded - that is, broken into
|
| 1985 |
+
* words after substitution is complete.
|
| 1986 |
+
*/
|
| 1987 |
+
|
| 1988 |
+
#define TCL_TOKEN_WORD 1
|
| 1989 |
+
#define TCL_TOKEN_SIMPLE_WORD 2
|
| 1990 |
+
#define TCL_TOKEN_TEXT 4
|
| 1991 |
+
#define TCL_TOKEN_BS 8
|
| 1992 |
+
#define TCL_TOKEN_COMMAND 16
|
| 1993 |
+
#define TCL_TOKEN_VARIABLE 32
|
| 1994 |
+
#define TCL_TOKEN_SUB_EXPR 64
|
| 1995 |
+
#define TCL_TOKEN_OPERATOR 128
|
| 1996 |
+
#define TCL_TOKEN_EXPAND_WORD 256
|
| 1997 |
+
|
| 1998 |
+
/*
|
| 1999 |
+
* Parsing error types. On any parsing error, one of these values will be
|
| 2000 |
+
* stored in the error field of the Tcl_Parse structure defined below.
|
| 2001 |
+
*/
|
| 2002 |
+
|
| 2003 |
+
#define TCL_PARSE_SUCCESS 0
|
| 2004 |
+
#define TCL_PARSE_QUOTE_EXTRA 1
|
| 2005 |
+
#define TCL_PARSE_BRACE_EXTRA 2
|
| 2006 |
+
#define TCL_PARSE_MISSING_BRACE 3
|
| 2007 |
+
#define TCL_PARSE_MISSING_BRACKET 4
|
| 2008 |
+
#define TCL_PARSE_MISSING_PAREN 5
|
| 2009 |
+
#define TCL_PARSE_MISSING_QUOTE 6
|
| 2010 |
+
#define TCL_PARSE_MISSING_VAR_BRACE 7
|
| 2011 |
+
#define TCL_PARSE_SYNTAX 8
|
| 2012 |
+
#define TCL_PARSE_BAD_NUMBER 9
|
| 2013 |
+
|
| 2014 |
+
/*
|
| 2015 |
+
* A structure of the following type is filled in by Tcl_ParseCommand. It
|
| 2016 |
+
* describes a single command parsed from an input string.
|
| 2017 |
+
*/
|
| 2018 |
+
|
| 2019 |
+
#define NUM_STATIC_TOKENS 20
|
| 2020 |
+
|
| 2021 |
+
typedef struct Tcl_Parse {
|
| 2022 |
+
const char *commentStart; /* Pointer to # that begins the first of one
|
| 2023 |
+
* or more comments preceding the command. */
|
| 2024 |
+
int commentSize; /* Number of bytes in comments (up through
|
| 2025 |
+
* newline character that terminates the last
|
| 2026 |
+
* comment). If there were no comments, this
|
| 2027 |
+
* field is 0. */
|
| 2028 |
+
const char *commandStart; /* First character in first word of
|
| 2029 |
+
* command. */
|
| 2030 |
+
int commandSize; /* Number of bytes in command, including first
|
| 2031 |
+
* character of first word, up through the
|
| 2032 |
+
* terminating newline, close bracket, or
|
| 2033 |
+
* semicolon. */
|
| 2034 |
+
int numWords; /* Total number of words in command. May be
|
| 2035 |
+
* 0. */
|
| 2036 |
+
Tcl_Token *tokenPtr; /* Pointer to first token representing the
|
| 2037 |
+
* words of the command. Initially points to
|
| 2038 |
+
* staticTokens, but may change to point to
|
| 2039 |
+
* malloc-ed space if command exceeds space in
|
| 2040 |
+
* staticTokens. */
|
| 2041 |
+
int numTokens; /* Total number of tokens in command. */
|
| 2042 |
+
int tokensAvailable; /* Total number of tokens available at
|
| 2043 |
+
* *tokenPtr. */
|
| 2044 |
+
int errorType; /* One of the parsing error types defined
|
| 2045 |
+
* above. */
|
| 2046 |
+
|
| 2047 |
+
/*
|
| 2048 |
+
* The fields below are intended only for the private use of the parser.
|
| 2049 |
+
* They should not be used by functions that invoke Tcl_ParseCommand.
|
| 2050 |
+
*/
|
| 2051 |
+
|
| 2052 |
+
const char *string; /* The original command string passed to
|
| 2053 |
+
* Tcl_ParseCommand. */
|
| 2054 |
+
const char *end; /* Points to the character just after the last
|
| 2055 |
+
* one in the command string. */
|
| 2056 |
+
Tcl_Interp *interp; /* Interpreter to use for error reporting, or
|
| 2057 |
+
* NULL. */
|
| 2058 |
+
const char *term; /* Points to character in string that
|
| 2059 |
+
* terminated most recent token. Filled in by
|
| 2060 |
+
* ParseTokens. If an error occurs, points to
|
| 2061 |
+
* beginning of region where the error
|
| 2062 |
+
* occurred (e.g. the open brace if the close
|
| 2063 |
+
* brace is missing). */
|
| 2064 |
+
int incomplete; /* This field is set to 1 by Tcl_ParseCommand
|
| 2065 |
+
* if the command appears to be incomplete.
|
| 2066 |
+
* This information is used by
|
| 2067 |
+
* Tcl_CommandComplete. */
|
| 2068 |
+
Tcl_Token staticTokens[NUM_STATIC_TOKENS];
|
| 2069 |
+
/* Initial space for tokens for command. This
|
| 2070 |
+
* space should be large enough to accommodate
|
| 2071 |
+
* most commands; dynamic space is allocated
|
| 2072 |
+
* for very large commands that don't fit
|
| 2073 |
+
* here. */
|
| 2074 |
+
} Tcl_Parse;
|
| 2075 |
+
|
| 2076 |
+
/*
|
| 2077 |
+
*----------------------------------------------------------------------------
|
| 2078 |
+
* The following structure represents a user-defined encoding. It collects
|
| 2079 |
+
* together all the functions that are used by the specific encoding.
|
| 2080 |
+
*/
|
| 2081 |
+
|
| 2082 |
+
typedef struct Tcl_EncodingType {
|
| 2083 |
+
const char *encodingName; /* The name of the encoding, e.g. "euc-jp".
|
| 2084 |
+
* This name is the unique key for this
|
| 2085 |
+
* encoding type. */
|
| 2086 |
+
Tcl_EncodingConvertProc *toUtfProc;
|
| 2087 |
+
/* Function to convert from external encoding
|
| 2088 |
+
* into UTF-8. */
|
| 2089 |
+
Tcl_EncodingConvertProc *fromUtfProc;
|
| 2090 |
+
/* Function to convert from UTF-8 into
|
| 2091 |
+
* external encoding. */
|
| 2092 |
+
Tcl_EncodingFreeProc *freeProc;
|
| 2093 |
+
/* If non-NULL, function to call when this
|
| 2094 |
+
* encoding is deleted. */
|
| 2095 |
+
ClientData clientData; /* Arbitrary value associated with encoding
|
| 2096 |
+
* type. Passed to conversion functions. */
|
| 2097 |
+
int nullSize; /* Number of zero bytes that signify
|
| 2098 |
+
* end-of-string in this encoding. This number
|
| 2099 |
+
* is used to determine the source string
|
| 2100 |
+
* length when the srcLen argument is
|
| 2101 |
+
* negative. Must be 1 or 2. */
|
| 2102 |
+
} Tcl_EncodingType;
|
| 2103 |
+
|
| 2104 |
+
/*
|
| 2105 |
+
* The following definitions are used as values for the conversion control
|
| 2106 |
+
* flags argument when converting text from one character set to another:
|
| 2107 |
+
*
|
| 2108 |
+
* TCL_ENCODING_START - Signifies that the source buffer is the first
|
| 2109 |
+
* block in a (potentially multi-block) input
|
| 2110 |
+
* stream. Tells the conversion function to reset
|
| 2111 |
+
* to an initial state and perform any
|
| 2112 |
+
* initialization that needs to occur before the
|
| 2113 |
+
* first byte is converted. If the source buffer
|
| 2114 |
+
* contains the entire input stream to be
|
| 2115 |
+
* converted, this flag should be set.
|
| 2116 |
+
* TCL_ENCODING_END - Signifies that the source buffer is the last
|
| 2117 |
+
* block in a (potentially multi-block) input
|
| 2118 |
+
* stream. Tells the conversion routine to
|
| 2119 |
+
* perform any finalization that needs to occur
|
| 2120 |
+
* after the last byte is converted and then to
|
| 2121 |
+
* reset to an initial state. If the source
|
| 2122 |
+
* buffer contains the entire input stream to be
|
| 2123 |
+
* converted, this flag should be set.
|
| 2124 |
+
* TCL_ENCODING_STOPONERROR - If set, the converter returns immediately upon
|
| 2125 |
+
* encountering an invalid byte sequence or a
|
| 2126 |
+
* source character that has no mapping in the
|
| 2127 |
+
* target encoding. If clear, the converter
|
| 2128 |
+
* substitues the problematic character(s) with
|
| 2129 |
+
* one or more "close" characters in the
|
| 2130 |
+
* destination buffer and then continues to
|
| 2131 |
+
* convert the source.
|
| 2132 |
+
* TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf does not append a
|
| 2133 |
+
* terminating NUL byte. Since it does not need
|
| 2134 |
+
* an extra byte for a terminating NUL, it fills
|
| 2135 |
+
* all dstLen bytes with encoded UTF-8 content if
|
| 2136 |
+
* needed. If clear, a byte is reserved in the
|
| 2137 |
+
* dst space for NUL termination, and a
|
| 2138 |
+
* terminating NUL is appended.
|
| 2139 |
+
* TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
|
| 2140 |
+
* Tcl_ExternalToUtf takes the initial value of
|
| 2141 |
+
* *dstCharsPtr as a limit of the maximum number
|
| 2142 |
+
* of chars to produce in the encoded UTF-8
|
| 2143 |
+
* content. Otherwise, the number of chars
|
| 2144 |
+
* produced is controlled only by other limiting
|
| 2145 |
+
* factors.
|
| 2146 |
+
*/
|
| 2147 |
+
|
| 2148 |
+
#define TCL_ENCODING_START 0x01
|
| 2149 |
+
#define TCL_ENCODING_END 0x02
|
| 2150 |
+
#define TCL_ENCODING_STOPONERROR 0x04
|
| 2151 |
+
#define TCL_ENCODING_NO_TERMINATE 0x08
|
| 2152 |
+
#define TCL_ENCODING_CHAR_LIMIT 0x10
|
| 2153 |
+
|
| 2154 |
+
/*
|
| 2155 |
+
* The following definitions are the error codes returned by the conversion
|
| 2156 |
+
* routines:
|
| 2157 |
+
*
|
| 2158 |
+
* TCL_OK - All characters were converted.
|
| 2159 |
+
* TCL_CONVERT_NOSPACE - The output buffer would not have been large
|
| 2160 |
+
* enough for all of the converted data; as many
|
| 2161 |
+
* characters as could fit were converted though.
|
| 2162 |
+
* TCL_CONVERT_MULTIBYTE - The last few bytes in the source string were
|
| 2163 |
+
* the beginning of a multibyte sequence, but
|
| 2164 |
+
* more bytes were needed to complete this
|
| 2165 |
+
* sequence. A subsequent call to the conversion
|
| 2166 |
+
* routine should pass the beginning of this
|
| 2167 |
+
* unconverted sequence plus additional bytes
|
| 2168 |
+
* from the source stream to properly convert the
|
| 2169 |
+
* formerly split-up multibyte sequence.
|
| 2170 |
+
* TCL_CONVERT_SYNTAX - The source stream contained an invalid
|
| 2171 |
+
* character sequence. This may occur if the
|
| 2172 |
+
* input stream has been damaged or if the input
|
| 2173 |
+
* encoding method was misidentified. This error
|
| 2174 |
+
* is reported only if TCL_ENCODING_STOPONERROR
|
| 2175 |
+
* was specified.
|
| 2176 |
+
* TCL_CONVERT_UNKNOWN - The source string contained a character that
|
| 2177 |
+
* could not be represented in the target
|
| 2178 |
+
* encoding. This error is reported only if
|
| 2179 |
+
* TCL_ENCODING_STOPONERROR was specified.
|
| 2180 |
+
*/
|
| 2181 |
+
|
| 2182 |
+
#define TCL_CONVERT_MULTIBYTE (-1)
|
| 2183 |
+
#define TCL_CONVERT_SYNTAX (-2)
|
| 2184 |
+
#define TCL_CONVERT_UNKNOWN (-3)
|
| 2185 |
+
#define TCL_CONVERT_NOSPACE (-4)
|
| 2186 |
+
|
| 2187 |
+
/*
|
| 2188 |
+
* The maximum number of bytes that are necessary to represent a single
|
| 2189 |
+
* Unicode character in UTF-8. The valid values should be 3, 4 or 6. If 3 or
|
| 2190 |
+
* 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6,
|
| 2191 |
+
* then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode
|
| 2192 |
+
* is the default and recommended mode. UCS-4 is experimental and not
|
| 2193 |
+
* recommended. It works for the core, but most extensions expect UCS-2.
|
| 2194 |
+
*/
|
| 2195 |
+
|
| 2196 |
+
#ifndef TCL_UTF_MAX
|
| 2197 |
+
#define TCL_UTF_MAX 3
|
| 2198 |
+
#endif
|
| 2199 |
+
|
| 2200 |
+
/*
|
| 2201 |
+
* This represents a Unicode character. Any changes to this should also be
|
| 2202 |
+
* reflected in regcustom.h.
|
| 2203 |
+
*/
|
| 2204 |
+
|
| 2205 |
+
#if TCL_UTF_MAX > 4
|
| 2206 |
+
/*
|
| 2207 |
+
* unsigned int isn't 100% accurate as it should be a strict 4-byte value.
|
| 2208 |
+
* The size of this value must be reflected correctly in regcustom.h.
|
| 2209 |
+
* XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
|
| 2210 |
+
* XXX: string rep that Tcl_UniChar represents. Changing the size
|
| 2211 |
+
* XXX: of Tcl_UniChar is /not/ supported.
|
| 2212 |
+
*/
|
| 2213 |
+
typedef unsigned int Tcl_UniChar;
|
| 2214 |
+
#else
|
| 2215 |
+
typedef unsigned short Tcl_UniChar;
|
| 2216 |
+
#endif
|
| 2217 |
+
|
| 2218 |
+
/*
|
| 2219 |
+
*----------------------------------------------------------------------------
|
| 2220 |
+
* TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to
|
| 2221 |
+
* provide the system with the embedded configuration data.
|
| 2222 |
+
*/
|
| 2223 |
+
|
| 2224 |
+
typedef struct Tcl_Config {
|
| 2225 |
+
const char *key; /* Configuration key to register. ASCII
|
| 2226 |
+
* encoded, thus UTF-8. */
|
| 2227 |
+
const char *value; /* The value associated with the key. System
|
| 2228 |
+
* encoding. */
|
| 2229 |
+
} Tcl_Config;
|
| 2230 |
+
|
| 2231 |
+
/*
|
| 2232 |
+
*----------------------------------------------------------------------------
|
| 2233 |
+
* Flags for TIP#143 limits, detailing which limits are active in an
|
| 2234 |
+
* interpreter. Used for Tcl_{Add,Remove}LimitHandler type argument.
|
| 2235 |
+
*/
|
| 2236 |
+
|
| 2237 |
+
#define TCL_LIMIT_COMMANDS 0x01
|
| 2238 |
+
#define TCL_LIMIT_TIME 0x02
|
| 2239 |
+
|
| 2240 |
+
/*
|
| 2241 |
+
* Structure containing information about a limit handler to be called when a
|
| 2242 |
+
* command- or time-limit is exceeded by an interpreter.
|
| 2243 |
+
*/
|
| 2244 |
+
|
| 2245 |
+
typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
|
| 2246 |
+
typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
|
| 2247 |
+
|
| 2248 |
+
/*
|
| 2249 |
+
*----------------------------------------------------------------------------
|
| 2250 |
+
* Override definitions for libtommath.
|
| 2251 |
+
*/
|
| 2252 |
+
|
| 2253 |
+
typedef struct mp_int mp_int;
|
| 2254 |
+
#define MP_INT_DECLARED
|
| 2255 |
+
typedef unsigned int mp_digit;
|
| 2256 |
+
#define MP_DIGIT_DECLARED
|
| 2257 |
+
|
| 2258 |
+
/*
|
| 2259 |
+
*----------------------------------------------------------------------------
|
| 2260 |
+
* Definitions needed for Tcl_ParseArgvObj routines.
|
| 2261 |
+
* Based on tkArgv.c.
|
| 2262 |
+
* Modifications from the original are copyright (c) Sam Bromley 2006
|
| 2263 |
+
*/
|
| 2264 |
+
|
| 2265 |
+
typedef struct {
|
| 2266 |
+
int type; /* Indicates the option type; see below. */
|
| 2267 |
+
const char *keyStr; /* The key string that flags the option in the
|
| 2268 |
+
* argv array. */
|
| 2269 |
+
void *srcPtr; /* Value to be used in setting dst; usage
|
| 2270 |
+
* depends on type.*/
|
| 2271 |
+
void *dstPtr; /* Address of value to be modified; usage
|
| 2272 |
+
* depends on type.*/
|
| 2273 |
+
const char *helpStr; /* Documentation message describing this
|
| 2274 |
+
* option. */
|
| 2275 |
+
ClientData clientData; /* Word to pass to function callbacks. */
|
| 2276 |
+
} Tcl_ArgvInfo;
|
| 2277 |
+
|
| 2278 |
+
/*
|
| 2279 |
+
* Legal values for the type field of a Tcl_ArgInfo: see the user
|
| 2280 |
+
* documentation for details.
|
| 2281 |
+
*/
|
| 2282 |
+
|
| 2283 |
+
#define TCL_ARGV_CONSTANT 15
|
| 2284 |
+
#define TCL_ARGV_INT 16
|
| 2285 |
+
#define TCL_ARGV_STRING 17
|
| 2286 |
+
#define TCL_ARGV_REST 18
|
| 2287 |
+
#define TCL_ARGV_FLOAT 19
|
| 2288 |
+
#define TCL_ARGV_FUNC 20
|
| 2289 |
+
#define TCL_ARGV_GENFUNC 21
|
| 2290 |
+
#define TCL_ARGV_HELP 22
|
| 2291 |
+
#define TCL_ARGV_END 23
|
| 2292 |
+
|
| 2293 |
+
/*
|
| 2294 |
+
* Types of callback functions for the TCL_ARGV_FUNC and TCL_ARGV_GENFUNC
|
| 2295 |
+
* argument types:
|
| 2296 |
+
*/
|
| 2297 |
+
|
| 2298 |
+
typedef int (Tcl_ArgvFuncProc)(ClientData clientData, Tcl_Obj *objPtr,
|
| 2299 |
+
void *dstPtr);
|
| 2300 |
+
typedef int (Tcl_ArgvGenFuncProc)(ClientData clientData, Tcl_Interp *interp,
|
| 2301 |
+
int objc, Tcl_Obj *const *objv, void *dstPtr);
|
| 2302 |
+
|
| 2303 |
+
/*
|
| 2304 |
+
* Shorthand for commonly used argTable entries.
|
| 2305 |
+
*/
|
| 2306 |
+
|
| 2307 |
+
#define TCL_ARGV_AUTO_HELP \
|
| 2308 |
+
{TCL_ARGV_HELP, "-help", NULL, NULL, \
|
| 2309 |
+
"Print summary of command-line options and abort", NULL}
|
| 2310 |
+
#define TCL_ARGV_AUTO_REST \
|
| 2311 |
+
{TCL_ARGV_REST, "--", NULL, NULL, \
|
| 2312 |
+
"Marks the end of the options", NULL}
|
| 2313 |
+
#define TCL_ARGV_TABLE_END \
|
| 2314 |
+
{TCL_ARGV_END, NULL, NULL, NULL, NULL, NULL}
|
| 2315 |
+
|
| 2316 |
+
/*
|
| 2317 |
+
*----------------------------------------------------------------------------
|
| 2318 |
+
* Definitions needed for Tcl_Zlib routines. [TIP #234]
|
| 2319 |
+
*
|
| 2320 |
+
* Constants for the format flags describing what sort of data format is
|
| 2321 |
+
* desired/expected for the Tcl_ZlibDeflate, Tcl_ZlibInflate and
|
| 2322 |
+
* Tcl_ZlibStreamInit functions.
|
| 2323 |
+
*/
|
| 2324 |
+
|
| 2325 |
+
#define TCL_ZLIB_FORMAT_RAW 1
|
| 2326 |
+
#define TCL_ZLIB_FORMAT_ZLIB 2
|
| 2327 |
+
#define TCL_ZLIB_FORMAT_GZIP 4
|
| 2328 |
+
#define TCL_ZLIB_FORMAT_AUTO 8
|
| 2329 |
+
|
| 2330 |
+
/*
|
| 2331 |
+
* Constants that describe whether the stream is to operate in compressing or
|
| 2332 |
+
* decompressing mode.
|
| 2333 |
+
*/
|
| 2334 |
+
|
| 2335 |
+
#define TCL_ZLIB_STREAM_DEFLATE 16
|
| 2336 |
+
#define TCL_ZLIB_STREAM_INFLATE 32
|
| 2337 |
+
|
| 2338 |
+
/*
|
| 2339 |
+
* Constants giving compression levels. Use of TCL_ZLIB_COMPRESS_DEFAULT is
|
| 2340 |
+
* recommended.
|
| 2341 |
+
*/
|
| 2342 |
+
|
| 2343 |
+
#define TCL_ZLIB_COMPRESS_NONE 0
|
| 2344 |
+
#define TCL_ZLIB_COMPRESS_FAST 1
|
| 2345 |
+
#define TCL_ZLIB_COMPRESS_BEST 9
|
| 2346 |
+
#define TCL_ZLIB_COMPRESS_DEFAULT (-1)
|
| 2347 |
+
|
| 2348 |
+
/*
|
| 2349 |
+
* Constants for types of flushing, used with Tcl_ZlibFlush.
|
| 2350 |
+
*/
|
| 2351 |
+
|
| 2352 |
+
#define TCL_ZLIB_NO_FLUSH 0
|
| 2353 |
+
#define TCL_ZLIB_FLUSH 2
|
| 2354 |
+
#define TCL_ZLIB_FULLFLUSH 3
|
| 2355 |
+
#define TCL_ZLIB_FINALIZE 4
|
| 2356 |
+
|
| 2357 |
+
/*
|
| 2358 |
+
*----------------------------------------------------------------------------
|
| 2359 |
+
* Definitions needed for the Tcl_LoadFile function. [TIP #416]
|
| 2360 |
+
*/
|
| 2361 |
+
|
| 2362 |
+
#define TCL_LOAD_GLOBAL 1
|
| 2363 |
+
#define TCL_LOAD_LAZY 2
|
| 2364 |
+
|
| 2365 |
+
/*
|
| 2366 |
+
*----------------------------------------------------------------------------
|
| 2367 |
+
* Single public declaration for NRE.
|
| 2368 |
+
*/
|
| 2369 |
+
|
| 2370 |
+
typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
|
| 2371 |
+
int result);
|
| 2372 |
+
|
| 2373 |
+
/*
|
| 2374 |
+
*----------------------------------------------------------------------------
|
| 2375 |
+
* The following constant is used to test for older versions of Tcl in the
|
| 2376 |
+
* stubs tables.
|
| 2377 |
+
*/
|
| 2378 |
+
|
| 2379 |
+
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
|
| 2380 |
+
|
| 2381 |
+
/*
|
| 2382 |
+
* The following function is required to be defined in all stubs aware
|
| 2383 |
+
* extensions. The function is actually implemented in the stub library, not
|
| 2384 |
+
* the main Tcl library, although there is a trivial implementation in the
|
| 2385 |
+
* main library in case an extension is statically linked into an application.
|
| 2386 |
+
*/
|
| 2387 |
+
|
| 2388 |
+
const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
|
| 2389 |
+
int exact);
|
| 2390 |
+
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
|
| 2391 |
+
const char *version, int epoch, int revision);
|
| 2392 |
+
|
| 2393 |
+
/*
|
| 2394 |
+
* When not using stubs, make it a macro.
|
| 2395 |
+
*/
|
| 2396 |
+
|
| 2397 |
+
#ifndef USE_TCL_STUBS
|
| 2398 |
+
#define Tcl_InitStubs(interp, version, exact) \
|
| 2399 |
+
Tcl_PkgInitStubsCheck(interp, version, exact)
|
| 2400 |
+
#endif
|
| 2401 |
+
|
| 2402 |
+
/*
|
| 2403 |
+
* Public functions that are not accessible via the stubs table.
|
| 2404 |
+
* Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
|
| 2405 |
+
*/
|
| 2406 |
+
|
| 2407 |
+
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
|
| 2408 |
+
((Tcl_CreateInterp)()))
|
| 2409 |
+
EXTERN void Tcl_MainEx(int argc, char **argv,
|
| 2410 |
+
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
| 2411 |
+
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
|
| 2412 |
+
const char *version, int exact);
|
| 2413 |
+
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
| 2414 |
+
|
| 2415 |
+
/*
|
| 2416 |
+
*----------------------------------------------------------------------------
|
| 2417 |
+
* Include the public function declarations that are accessible via the stubs
|
| 2418 |
+
* table.
|
| 2419 |
+
*/
|
| 2420 |
+
|
| 2421 |
+
#include "tclDecls.h"
|
| 2422 |
+
|
| 2423 |
+
/*
|
| 2424 |
+
* Include platform specific public function declarations that are accessible
|
| 2425 |
+
* via the stubs table. Make all TclOO symbols MODULE_SCOPE (which only
|
| 2426 |
+
* has effect on building it as a shared library). See ticket [3010352].
|
| 2427 |
+
*/
|
| 2428 |
+
|
| 2429 |
+
#if defined(BUILD_tcl)
|
| 2430 |
+
# undef TCLAPI
|
| 2431 |
+
# define TCLAPI MODULE_SCOPE
|
| 2432 |
+
#endif
|
| 2433 |
+
|
| 2434 |
+
#include "tclPlatDecls.h"
|
| 2435 |
+
|
| 2436 |
+
/*
|
| 2437 |
+
*----------------------------------------------------------------------------
|
| 2438 |
+
* The following declarations either map ckalloc and ckfree to malloc and
|
| 2439 |
+
* free, or they map them to functions with all sorts of debugging hooks
|
| 2440 |
+
* defined in tclCkalloc.c.
|
| 2441 |
+
*/
|
| 2442 |
+
|
| 2443 |
+
#ifdef TCL_MEM_DEBUG
|
| 2444 |
+
|
| 2445 |
+
# define ckalloc(x) \
|
| 2446 |
+
((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__))
|
| 2447 |
+
# define ckfree(x) \
|
| 2448 |
+
Tcl_DbCkfree((char *)(x), __FILE__, __LINE__)
|
| 2449 |
+
# define ckrealloc(x,y) \
|
| 2450 |
+
((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
|
| 2451 |
+
# define attemptckalloc(x) \
|
| 2452 |
+
((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__))
|
| 2453 |
+
# define attemptckrealloc(x,y) \
|
| 2454 |
+
((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
|
| 2455 |
+
|
| 2456 |
+
#else /* !TCL_MEM_DEBUG */
|
| 2457 |
+
|
| 2458 |
+
/*
|
| 2459 |
+
* If we are not using the debugging allocator, we should call the Tcl_Alloc,
|
| 2460 |
+
* et al. routines in order to guarantee that every module is using the same
|
| 2461 |
+
* memory allocator both inside and outside of the Tcl library.
|
| 2462 |
+
*/
|
| 2463 |
+
|
| 2464 |
+
# define ckalloc(x) \
|
| 2465 |
+
((void *) Tcl_Alloc((unsigned)(x)))
|
| 2466 |
+
# define ckfree(x) \
|
| 2467 |
+
Tcl_Free((char *)(x))
|
| 2468 |
+
# define ckrealloc(x,y) \
|
| 2469 |
+
((void *) Tcl_Realloc((char *)(x), (unsigned)(y)))
|
| 2470 |
+
# define attemptckalloc(x) \
|
| 2471 |
+
((void *) Tcl_AttemptAlloc((unsigned)(x)))
|
| 2472 |
+
# define attemptckrealloc(x,y) \
|
| 2473 |
+
((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y)))
|
| 2474 |
+
# undef Tcl_InitMemory
|
| 2475 |
+
# define Tcl_InitMemory(x)
|
| 2476 |
+
# undef Tcl_DumpActiveMemory
|
| 2477 |
+
# define Tcl_DumpActiveMemory(x)
|
| 2478 |
+
# undef Tcl_ValidateAllMemory
|
| 2479 |
+
# define Tcl_ValidateAllMemory(x,y)
|
| 2480 |
+
|
| 2481 |
+
#endif /* !TCL_MEM_DEBUG */
|
| 2482 |
+
|
| 2483 |
+
#ifdef TCL_MEM_DEBUG
|
| 2484 |
+
# define Tcl_IncrRefCount(objPtr) \
|
| 2485 |
+
Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
|
| 2486 |
+
# define Tcl_DecrRefCount(objPtr) \
|
| 2487 |
+
Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
|
| 2488 |
+
# define Tcl_IsShared(objPtr) \
|
| 2489 |
+
Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
|
| 2490 |
+
#else
|
| 2491 |
+
# define Tcl_IncrRefCount(objPtr) \
|
| 2492 |
+
++(objPtr)->refCount
|
| 2493 |
+
/*
|
| 2494 |
+
* Use do/while0 idiom for optimum correctness without compiler warnings.
|
| 2495 |
+
* https://wiki.c2.com/?TrivialDoWhileLoop
|
| 2496 |
+
*/
|
| 2497 |
+
# define Tcl_DecrRefCount(objPtr) \
|
| 2498 |
+
do { \
|
| 2499 |
+
Tcl_Obj *_objPtr = (objPtr); \
|
| 2500 |
+
if (_objPtr->refCount-- <= 1) { \
|
| 2501 |
+
TclFreeObj(_objPtr); \
|
| 2502 |
+
} \
|
| 2503 |
+
} while(0)
|
| 2504 |
+
# define Tcl_IsShared(objPtr) \
|
| 2505 |
+
((objPtr)->refCount > 1)
|
| 2506 |
+
#endif
|
| 2507 |
+
|
| 2508 |
+
/*
|
| 2509 |
+
* Macros and definitions that help to debug the use of Tcl objects. When
|
| 2510 |
+
* TCL_MEM_DEBUG is defined, the Tcl_New declarations are overridden to call
|
| 2511 |
+
* debugging versions of the object creation functions.
|
| 2512 |
+
*/
|
| 2513 |
+
|
| 2514 |
+
#ifdef TCL_MEM_DEBUG
|
| 2515 |
+
# undef Tcl_NewBignumObj
|
| 2516 |
+
# define Tcl_NewBignumObj(val) \
|
| 2517 |
+
Tcl_DbNewBignumObj(val, __FILE__, __LINE__)
|
| 2518 |
+
# undef Tcl_NewBooleanObj
|
| 2519 |
+
# define Tcl_NewBooleanObj(val) \
|
| 2520 |
+
Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
|
| 2521 |
+
# undef Tcl_NewByteArrayObj
|
| 2522 |
+
# define Tcl_NewByteArrayObj(bytes, len) \
|
| 2523 |
+
Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
|
| 2524 |
+
# undef Tcl_NewDoubleObj
|
| 2525 |
+
# define Tcl_NewDoubleObj(val) \
|
| 2526 |
+
Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
|
| 2527 |
+
# undef Tcl_NewIntObj
|
| 2528 |
+
# define Tcl_NewIntObj(val) \
|
| 2529 |
+
Tcl_DbNewLongObj(val, __FILE__, __LINE__)
|
| 2530 |
+
# undef Tcl_NewListObj
|
| 2531 |
+
# define Tcl_NewListObj(objc, objv) \
|
| 2532 |
+
Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
|
| 2533 |
+
# undef Tcl_NewLongObj
|
| 2534 |
+
# define Tcl_NewLongObj(val) \
|
| 2535 |
+
Tcl_DbNewLongObj(val, __FILE__, __LINE__)
|
| 2536 |
+
# undef Tcl_NewObj
|
| 2537 |
+
# define Tcl_NewObj() \
|
| 2538 |
+
Tcl_DbNewObj(__FILE__, __LINE__)
|
| 2539 |
+
# undef Tcl_NewStringObj
|
| 2540 |
+
# define Tcl_NewStringObj(bytes, len) \
|
| 2541 |
+
Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
|
| 2542 |
+
# undef Tcl_NewWideIntObj
|
| 2543 |
+
# define Tcl_NewWideIntObj(val) \
|
| 2544 |
+
Tcl_DbNewWideIntObj(val, __FILE__, __LINE__)
|
| 2545 |
+
#endif /* TCL_MEM_DEBUG */
|
| 2546 |
+
|
| 2547 |
+
/*
|
| 2548 |
+
*----------------------------------------------------------------------------
|
| 2549 |
+
* Macros for clients to use to access fields of hash entries:
|
| 2550 |
+
*/
|
| 2551 |
+
|
| 2552 |
+
#define Tcl_GetHashValue(h) ((h)->clientData)
|
| 2553 |
+
#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
|
| 2554 |
+
#define Tcl_GetHashKey(tablePtr, h) \
|
| 2555 |
+
((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
|
| 2556 |
+
(tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
|
| 2557 |
+
? (h)->key.oneWordValue \
|
| 2558 |
+
: (h)->key.string))
|
| 2559 |
+
|
| 2560 |
+
/*
|
| 2561 |
+
* Macros to use for clients to use to invoke find and create functions for
|
| 2562 |
+
* hash tables:
|
| 2563 |
+
*/
|
| 2564 |
+
|
| 2565 |
+
#undef Tcl_FindHashEntry
|
| 2566 |
+
#define Tcl_FindHashEntry(tablePtr, key) \
|
| 2567 |
+
(*((tablePtr)->findProc))(tablePtr, (const char *)(key))
|
| 2568 |
+
#undef Tcl_CreateHashEntry
|
| 2569 |
+
#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
|
| 2570 |
+
(*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)
|
| 2571 |
+
|
| 2572 |
+
/*
|
| 2573 |
+
*----------------------------------------------------------------------------
|
| 2574 |
+
* Macros that eliminate the overhead of the thread synchronization functions
|
| 2575 |
+
* when compiling without thread support.
|
| 2576 |
+
*/
|
| 2577 |
+
|
| 2578 |
+
#ifndef TCL_THREADS
|
| 2579 |
+
#undef Tcl_MutexLock
|
| 2580 |
+
#define Tcl_MutexLock(mutexPtr)
|
| 2581 |
+
#undef Tcl_MutexUnlock
|
| 2582 |
+
#define Tcl_MutexUnlock(mutexPtr)
|
| 2583 |
+
#undef Tcl_MutexFinalize
|
| 2584 |
+
#define Tcl_MutexFinalize(mutexPtr)
|
| 2585 |
+
#undef Tcl_ConditionNotify
|
| 2586 |
+
#define Tcl_ConditionNotify(condPtr)
|
| 2587 |
+
#undef Tcl_ConditionWait
|
| 2588 |
+
#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
|
| 2589 |
+
#undef Tcl_ConditionFinalize
|
| 2590 |
+
#define Tcl_ConditionFinalize(condPtr)
|
| 2591 |
+
#endif /* TCL_THREADS */
|
| 2592 |
+
|
| 2593 |
+
/*
|
| 2594 |
+
*----------------------------------------------------------------------------
|
| 2595 |
+
* Deprecated Tcl functions:
|
| 2596 |
+
*/
|
| 2597 |
+
|
| 2598 |
+
#ifndef TCL_NO_DEPRECATED
|
| 2599 |
+
/*
|
| 2600 |
+
* These function have been renamed. The old names are deprecated, but we
|
| 2601 |
+
* define these macros for backwards compatibility.
|
| 2602 |
+
*/
|
| 2603 |
+
|
| 2604 |
+
# define Tcl_Ckalloc Tcl_Alloc
|
| 2605 |
+
# define Tcl_Ckfree Tcl_Free
|
| 2606 |
+
# define Tcl_Ckrealloc Tcl_Realloc
|
| 2607 |
+
# define Tcl_Return Tcl_SetResult
|
| 2608 |
+
# define Tcl_TildeSubst Tcl_TranslateFileName
|
| 2609 |
+
#if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */
|
| 2610 |
+
# define panic Tcl_Panic
|
| 2611 |
+
#endif
|
| 2612 |
+
# define panicVA Tcl_PanicVA
|
| 2613 |
+
#endif /* !TCL_NO_DEPRECATED */
|
| 2614 |
+
|
| 2615 |
+
/*
|
| 2616 |
+
*----------------------------------------------------------------------------
|
| 2617 |
+
* Convenience declaration of Tcl_AppInit for backwards compatibility. This
|
| 2618 |
+
* function is not *implemented* by the tcl library, so the storage class is
|
| 2619 |
+
* neither DLLEXPORT nor DLLIMPORT.
|
| 2620 |
+
*/
|
| 2621 |
+
|
| 2622 |
+
extern Tcl_AppInitProc Tcl_AppInit;
|
| 2623 |
+
|
| 2624 |
+
#endif /* RC_INVOKED */
|
| 2625 |
+
|
| 2626 |
+
/*
|
| 2627 |
+
* end block for C++
|
| 2628 |
+
*/
|
| 2629 |
+
|
| 2630 |
+
#ifdef __cplusplus
|
| 2631 |
+
}
|
| 2632 |
+
#endif
|
| 2633 |
+
|
| 2634 |
+
#endif /* _TCL */
|
| 2635 |
+
|
| 2636 |
+
/*
|
| 2637 |
+
* Local Variables:
|
| 2638 |
+
* mode: c
|
| 2639 |
+
* c-basic-offset: 4
|
| 2640 |
+
* fill-column: 78
|
| 2641 |
+
* End:
|
| 2642 |
+
*/
|
deepseek/include/tclIntPlatDecls.h
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tclIntPlatDecls.h --
|
| 3 |
+
*
|
| 4 |
+
* This file contains the declarations for all platform dependent
|
| 5 |
+
* unsupported functions that are exported by the Tcl library. These
|
| 6 |
+
* interfaces are not guaranteed to remain the same between
|
| 7 |
+
* versions. Use at your own risk.
|
| 8 |
+
*
|
| 9 |
+
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
| 10 |
+
* All rights reserved.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef _TCLINTPLATDECLS
|
| 14 |
+
#define _TCLINTPLATDECLS
|
| 15 |
+
|
| 16 |
+
#undef TCL_STORAGE_CLASS
|
| 17 |
+
#ifdef BUILD_tcl
|
| 18 |
+
# define TCL_STORAGE_CLASS DLLEXPORT
|
| 19 |
+
#else
|
| 20 |
+
# ifdef USE_TCL_STUBS
|
| 21 |
+
# define TCL_STORAGE_CLASS
|
| 22 |
+
# else
|
| 23 |
+
# define TCL_STORAGE_CLASS DLLIMPORT
|
| 24 |
+
# endif
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
/*
|
| 28 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 29 |
+
* script. Any modifications to the function declarations below should be made
|
| 30 |
+
* in the generic/tclInt.decls script.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 34 |
+
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/*
|
| 40 |
+
* Exported function declarations:
|
| 41 |
+
*/
|
| 42 |
+
|
| 43 |
+
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
| 44 |
+
/* 0 */
|
| 45 |
+
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
| 46 |
+
Tcl_Channel chan);
|
| 47 |
+
/* 1 */
|
| 48 |
+
EXTERN int TclpCloseFile(TclFile file);
|
| 49 |
+
/* 2 */
|
| 50 |
+
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
| 51 |
+
TclFile writeFile, TclFile errorFile,
|
| 52 |
+
int numPids, Tcl_Pid *pidPtr);
|
| 53 |
+
/* 3 */
|
| 54 |
+
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
| 55 |
+
/* 4 */
|
| 56 |
+
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
| 57 |
+
const char **argv, TclFile inputFile,
|
| 58 |
+
TclFile outputFile, TclFile errorFile,
|
| 59 |
+
Tcl_Pid *pidPtr);
|
| 60 |
+
/* 5 */
|
| 61 |
+
EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
|
| 62 |
+
/* 6 */
|
| 63 |
+
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
| 64 |
+
/* 7 */
|
| 65 |
+
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
| 66 |
+
/* 8 */
|
| 67 |
+
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
| 68 |
+
/* 9 */
|
| 69 |
+
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
| 70 |
+
/* 10 */
|
| 71 |
+
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
| 72 |
+
/* 11 */
|
| 73 |
+
EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
|
| 74 |
+
/* 12 */
|
| 75 |
+
EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
|
| 76 |
+
/* 13 */
|
| 77 |
+
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
| 78 |
+
/* 14 */
|
| 79 |
+
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
| 80 |
+
const Tcl_StatBuf *statBufPtr,
|
| 81 |
+
int dontCopyAtts);
|
| 82 |
+
/* 15 */
|
| 83 |
+
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
|
| 84 |
+
int objIndex, Tcl_Obj *fileName,
|
| 85 |
+
Tcl_Obj **attributePtrPtr);
|
| 86 |
+
/* 16 */
|
| 87 |
+
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
|
| 88 |
+
int objIndex, Tcl_Obj *fileName,
|
| 89 |
+
Tcl_Obj *attributePtr);
|
| 90 |
+
/* 17 */
|
| 91 |
+
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
|
| 92 |
+
const char *dst,
|
| 93 |
+
const Tcl_StatBuf *statBufPtr);
|
| 94 |
+
/* 18 */
|
| 95 |
+
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
|
| 96 |
+
const char *pathName, const char *fileName,
|
| 97 |
+
Tcl_StatBuf *statBufPtr,
|
| 98 |
+
Tcl_GlobTypeData *types);
|
| 99 |
+
/* 19 */
|
| 100 |
+
EXTERN void TclMacOSXNotifierAddRunLoopMode(
|
| 101 |
+
const void *runLoopMode);
|
| 102 |
+
/* Slot 20 is reserved */
|
| 103 |
+
/* Slot 21 is reserved */
|
| 104 |
+
/* 22 */
|
| 105 |
+
EXTERN TclFile TclpCreateTempFile_(const char *contents);
|
| 106 |
+
/* Slot 23 is reserved */
|
| 107 |
+
/* Slot 24 is reserved */
|
| 108 |
+
/* Slot 25 is reserved */
|
| 109 |
+
/* Slot 26 is reserved */
|
| 110 |
+
/* Slot 27 is reserved */
|
| 111 |
+
/* Slot 28 is reserved */
|
| 112 |
+
/* 29 */
|
| 113 |
+
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
| 114 |
+
/* 30 */
|
| 115 |
+
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
| 116 |
+
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
| 117 |
+
Tcl_Obj *resultingNameObj);
|
| 118 |
+
#endif /* UNIX */
|
| 119 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 120 |
+
/* 0 */
|
| 121 |
+
EXTERN void TclWinConvertError(DWORD errCode);
|
| 122 |
+
/* 1 */
|
| 123 |
+
EXTERN void TclWinConvertWSAError(DWORD errCode);
|
| 124 |
+
/* 2 */
|
| 125 |
+
EXTERN struct servent * TclWinGetServByName(const char *nm,
|
| 126 |
+
const char *proto);
|
| 127 |
+
/* 3 */
|
| 128 |
+
EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname,
|
| 129 |
+
char *optval, int *optlen);
|
| 130 |
+
/* 4 */
|
| 131 |
+
EXTERN HINSTANCE TclWinGetTclInstance(void);
|
| 132 |
+
/* 5 */
|
| 133 |
+
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
| 134 |
+
/* 6 */
|
| 135 |
+
EXTERN unsigned short TclWinNToHS(unsigned short ns);
|
| 136 |
+
/* 7 */
|
| 137 |
+
EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
|
| 138 |
+
const char *optval, int optlen);
|
| 139 |
+
/* 8 */
|
| 140 |
+
EXTERN int TclpGetPid(Tcl_Pid pid);
|
| 141 |
+
/* 9 */
|
| 142 |
+
EXTERN int TclWinGetPlatformId(void);
|
| 143 |
+
/* 10 */
|
| 144 |
+
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
| 145 |
+
/* 11 */
|
| 146 |
+
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
| 147 |
+
Tcl_Channel chan);
|
| 148 |
+
/* 12 */
|
| 149 |
+
EXTERN int TclpCloseFile(TclFile file);
|
| 150 |
+
/* 13 */
|
| 151 |
+
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
| 152 |
+
TclFile writeFile, TclFile errorFile,
|
| 153 |
+
int numPids, Tcl_Pid *pidPtr);
|
| 154 |
+
/* 14 */
|
| 155 |
+
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
| 156 |
+
/* 15 */
|
| 157 |
+
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
| 158 |
+
const char **argv, TclFile inputFile,
|
| 159 |
+
TclFile outputFile, TclFile errorFile,
|
| 160 |
+
Tcl_Pid *pidPtr);
|
| 161 |
+
/* 16 */
|
| 162 |
+
EXTERN int TclpIsAtty(int fd);
|
| 163 |
+
/* 17 */
|
| 164 |
+
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
| 165 |
+
const Tcl_StatBuf *statBufPtr,
|
| 166 |
+
int dontCopyAtts);
|
| 167 |
+
/* 18 */
|
| 168 |
+
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
| 169 |
+
/* 19 */
|
| 170 |
+
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
| 171 |
+
/* 20 */
|
| 172 |
+
EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id);
|
| 173 |
+
/* 21 */
|
| 174 |
+
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
| 175 |
+
/* 22 */
|
| 176 |
+
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
| 177 |
+
/* Slot 23 is reserved */
|
| 178 |
+
/* 24 */
|
| 179 |
+
EXTERN char * TclWinNoBackslash(char *path);
|
| 180 |
+
/* Slot 25 is reserved */
|
| 181 |
+
/* 26 */
|
| 182 |
+
EXTERN void TclWinSetInterfaces(int wide);
|
| 183 |
+
/* 27 */
|
| 184 |
+
EXTERN void TclWinFlushDirtyChannels(void);
|
| 185 |
+
/* 28 */
|
| 186 |
+
EXTERN void TclWinResetInterfaces(void);
|
| 187 |
+
/* 29 */
|
| 188 |
+
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
| 189 |
+
/* 30 */
|
| 190 |
+
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
| 191 |
+
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
| 192 |
+
Tcl_Obj *resultingNameObj);
|
| 193 |
+
#endif /* WIN */
|
| 194 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 195 |
+
/* 0 */
|
| 196 |
+
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
| 197 |
+
Tcl_Channel chan);
|
| 198 |
+
/* 1 */
|
| 199 |
+
EXTERN int TclpCloseFile(TclFile file);
|
| 200 |
+
/* 2 */
|
| 201 |
+
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
| 202 |
+
TclFile writeFile, TclFile errorFile,
|
| 203 |
+
int numPids, Tcl_Pid *pidPtr);
|
| 204 |
+
/* 3 */
|
| 205 |
+
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
| 206 |
+
/* 4 */
|
| 207 |
+
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
| 208 |
+
const char **argv, TclFile inputFile,
|
| 209 |
+
TclFile outputFile, TclFile errorFile,
|
| 210 |
+
Tcl_Pid *pidPtr);
|
| 211 |
+
/* 5 */
|
| 212 |
+
EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
|
| 213 |
+
/* 6 */
|
| 214 |
+
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
| 215 |
+
/* 7 */
|
| 216 |
+
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
| 217 |
+
/* 8 */
|
| 218 |
+
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
| 219 |
+
/* 9 */
|
| 220 |
+
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
| 221 |
+
/* 10 */
|
| 222 |
+
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
| 223 |
+
/* 11 */
|
| 224 |
+
EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
|
| 225 |
+
/* 12 */
|
| 226 |
+
EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
|
| 227 |
+
/* 13 */
|
| 228 |
+
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
| 229 |
+
/* 14 */
|
| 230 |
+
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
| 231 |
+
const Tcl_StatBuf *statBufPtr,
|
| 232 |
+
int dontCopyAtts);
|
| 233 |
+
/* 15 */
|
| 234 |
+
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
|
| 235 |
+
int objIndex, Tcl_Obj *fileName,
|
| 236 |
+
Tcl_Obj **attributePtrPtr);
|
| 237 |
+
/* 16 */
|
| 238 |
+
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
|
| 239 |
+
int objIndex, Tcl_Obj *fileName,
|
| 240 |
+
Tcl_Obj *attributePtr);
|
| 241 |
+
/* 17 */
|
| 242 |
+
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
|
| 243 |
+
const char *dst,
|
| 244 |
+
const Tcl_StatBuf *statBufPtr);
|
| 245 |
+
/* 18 */
|
| 246 |
+
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
|
| 247 |
+
const char *pathName, const char *fileName,
|
| 248 |
+
Tcl_StatBuf *statBufPtr,
|
| 249 |
+
Tcl_GlobTypeData *types);
|
| 250 |
+
/* 19 */
|
| 251 |
+
EXTERN void TclMacOSXNotifierAddRunLoopMode(
|
| 252 |
+
const void *runLoopMode);
|
| 253 |
+
/* Slot 20 is reserved */
|
| 254 |
+
/* Slot 21 is reserved */
|
| 255 |
+
/* 22 */
|
| 256 |
+
EXTERN TclFile TclpCreateTempFile_(const char *contents);
|
| 257 |
+
/* Slot 23 is reserved */
|
| 258 |
+
/* Slot 24 is reserved */
|
| 259 |
+
/* Slot 25 is reserved */
|
| 260 |
+
/* Slot 26 is reserved */
|
| 261 |
+
/* Slot 27 is reserved */
|
| 262 |
+
/* Slot 28 is reserved */
|
| 263 |
+
/* 29 */
|
| 264 |
+
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
| 265 |
+
/* 30 */
|
| 266 |
+
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
| 267 |
+
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
| 268 |
+
Tcl_Obj *resultingNameObj);
|
| 269 |
+
#endif /* MACOSX */
|
| 270 |
+
|
| 271 |
+
typedef struct TclIntPlatStubs {
|
| 272 |
+
int magic;
|
| 273 |
+
void *hooks;
|
| 274 |
+
|
| 275 |
+
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
| 276 |
+
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
|
| 277 |
+
int (*tclpCloseFile) (TclFile file); /* 1 */
|
| 278 |
+
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
|
| 279 |
+
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
| 280 |
+
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
|
| 281 |
+
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
|
| 282 |
+
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
|
| 283 |
+
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
| 284 |
+
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
| 285 |
+
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
| 286 |
+
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
| 287 |
+
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
| 288 |
+
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
| 289 |
+
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
| 290 |
+
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
| 291 |
+
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
|
| 292 |
+
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
|
| 293 |
+
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
|
| 294 |
+
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
|
| 295 |
+
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
|
| 296 |
+
void (*reserved20)(void);
|
| 297 |
+
void (*reserved21)(void);
|
| 298 |
+
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
|
| 299 |
+
void (*reserved23)(void);
|
| 300 |
+
void (*reserved24)(void);
|
| 301 |
+
void (*reserved25)(void);
|
| 302 |
+
void (*reserved26)(void);
|
| 303 |
+
void (*reserved27)(void);
|
| 304 |
+
void (*reserved28)(void);
|
| 305 |
+
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
| 306 |
+
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
| 307 |
+
#endif /* UNIX */
|
| 308 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 309 |
+
void (*tclWinConvertError) (DWORD errCode); /* 0 */
|
| 310 |
+
void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
|
| 311 |
+
struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
|
| 312 |
+
int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */
|
| 313 |
+
HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */
|
| 314 |
+
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */
|
| 315 |
+
unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
|
| 316 |
+
int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, const char *optval, int optlen); /* 7 */
|
| 317 |
+
int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
|
| 318 |
+
int (*tclWinGetPlatformId) (void); /* 9 */
|
| 319 |
+
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
| 320 |
+
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
|
| 321 |
+
int (*tclpCloseFile) (TclFile file); /* 12 */
|
| 322 |
+
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
|
| 323 |
+
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
|
| 324 |
+
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
|
| 325 |
+
int (*tclpIsAtty) (int fd); /* 16 */
|
| 326 |
+
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */
|
| 327 |
+
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
|
| 328 |
+
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
|
| 329 |
+
void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */
|
| 330 |
+
char * (*tclpInetNtoa) (struct in_addr addr); /* 21 */
|
| 331 |
+
TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
|
| 332 |
+
void (*reserved23)(void);
|
| 333 |
+
char * (*tclWinNoBackslash) (char *path); /* 24 */
|
| 334 |
+
void (*reserved25)(void);
|
| 335 |
+
void (*tclWinSetInterfaces) (int wide); /* 26 */
|
| 336 |
+
void (*tclWinFlushDirtyChannels) (void); /* 27 */
|
| 337 |
+
void (*tclWinResetInterfaces) (void); /* 28 */
|
| 338 |
+
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
| 339 |
+
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
| 340 |
+
#endif /* WIN */
|
| 341 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 342 |
+
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
|
| 343 |
+
int (*tclpCloseFile) (TclFile file); /* 1 */
|
| 344 |
+
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
|
| 345 |
+
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
| 346 |
+
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
|
| 347 |
+
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
|
| 348 |
+
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
|
| 349 |
+
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
| 350 |
+
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
| 351 |
+
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
| 352 |
+
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
| 353 |
+
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
| 354 |
+
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
| 355 |
+
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
| 356 |
+
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
| 357 |
+
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
|
| 358 |
+
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
|
| 359 |
+
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
|
| 360 |
+
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
|
| 361 |
+
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
|
| 362 |
+
void (*reserved20)(void);
|
| 363 |
+
void (*reserved21)(void);
|
| 364 |
+
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
|
| 365 |
+
void (*reserved23)(void);
|
| 366 |
+
void (*reserved24)(void);
|
| 367 |
+
void (*reserved25)(void);
|
| 368 |
+
void (*reserved26)(void);
|
| 369 |
+
void (*reserved27)(void);
|
| 370 |
+
void (*reserved28)(void);
|
| 371 |
+
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
| 372 |
+
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
| 373 |
+
#endif /* MACOSX */
|
| 374 |
+
} TclIntPlatStubs;
|
| 375 |
+
|
| 376 |
+
extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
| 377 |
+
|
| 378 |
+
#ifdef __cplusplus
|
| 379 |
+
}
|
| 380 |
+
#endif
|
| 381 |
+
|
| 382 |
+
#if defined(USE_TCL_STUBS)
|
| 383 |
+
|
| 384 |
+
/*
|
| 385 |
+
* Inline function declarations:
|
| 386 |
+
*/
|
| 387 |
+
|
| 388 |
+
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
| 389 |
+
#define TclGetAndDetachPids \
|
| 390 |
+
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
|
| 391 |
+
#define TclpCloseFile \
|
| 392 |
+
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
|
| 393 |
+
#define TclpCreateCommandChannel \
|
| 394 |
+
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
|
| 395 |
+
#define TclpCreatePipe \
|
| 396 |
+
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
|
| 397 |
+
#define TclpCreateProcess \
|
| 398 |
+
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
|
| 399 |
+
#define TclUnixWaitForFile_ \
|
| 400 |
+
(tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
|
| 401 |
+
#define TclpMakeFile \
|
| 402 |
+
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
|
| 403 |
+
#define TclpOpenFile \
|
| 404 |
+
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
|
| 405 |
+
#define TclUnixWaitForFile \
|
| 406 |
+
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
|
| 407 |
+
#define TclpCreateTempFile \
|
| 408 |
+
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
|
| 409 |
+
#define TclpReaddir \
|
| 410 |
+
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
| 411 |
+
#define TclpLocaltime_unix \
|
| 412 |
+
(tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
|
| 413 |
+
#define TclpGmtime_unix \
|
| 414 |
+
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
|
| 415 |
+
#define TclpInetNtoa \
|
| 416 |
+
(tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
|
| 417 |
+
#define TclUnixCopyFile \
|
| 418 |
+
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
| 419 |
+
#define TclMacOSXGetFileAttribute \
|
| 420 |
+
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
|
| 421 |
+
#define TclMacOSXSetFileAttribute \
|
| 422 |
+
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
|
| 423 |
+
#define TclMacOSXCopyFileAttributes \
|
| 424 |
+
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
|
| 425 |
+
#define TclMacOSXMatchType \
|
| 426 |
+
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
|
| 427 |
+
#define TclMacOSXNotifierAddRunLoopMode \
|
| 428 |
+
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
|
| 429 |
+
/* Slot 20 is reserved */
|
| 430 |
+
/* Slot 21 is reserved */
|
| 431 |
+
#define TclpCreateTempFile_ \
|
| 432 |
+
(tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
|
| 433 |
+
/* Slot 23 is reserved */
|
| 434 |
+
/* Slot 24 is reserved */
|
| 435 |
+
/* Slot 25 is reserved */
|
| 436 |
+
/* Slot 26 is reserved */
|
| 437 |
+
/* Slot 27 is reserved */
|
| 438 |
+
/* Slot 28 is reserved */
|
| 439 |
+
#define TclWinCPUID \
|
| 440 |
+
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
| 441 |
+
#define TclUnixOpenTemporaryFile \
|
| 442 |
+
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
| 443 |
+
#endif /* UNIX */
|
| 444 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 445 |
+
#define TclWinConvertError \
|
| 446 |
+
(tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
|
| 447 |
+
#define TclWinConvertWSAError \
|
| 448 |
+
(tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
|
| 449 |
+
#define TclWinGetServByName \
|
| 450 |
+
(tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
|
| 451 |
+
#define TclWinGetSockOpt \
|
| 452 |
+
(tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
|
| 453 |
+
#define TclWinGetTclInstance \
|
| 454 |
+
(tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
|
| 455 |
+
#define TclUnixWaitForFile \
|
| 456 |
+
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
|
| 457 |
+
#define TclWinNToHS \
|
| 458 |
+
(tclIntPlatStubsPtr->tclWinNToHS) /* 6 */
|
| 459 |
+
#define TclWinSetSockOpt \
|
| 460 |
+
(tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
|
| 461 |
+
#define TclpGetPid \
|
| 462 |
+
(tclIntPlatStubsPtr->tclpGetPid) /* 8 */
|
| 463 |
+
#define TclWinGetPlatformId \
|
| 464 |
+
(tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */
|
| 465 |
+
#define TclpReaddir \
|
| 466 |
+
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
| 467 |
+
#define TclGetAndDetachPids \
|
| 468 |
+
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
|
| 469 |
+
#define TclpCloseFile \
|
| 470 |
+
(tclIntPlatStubsPtr->tclpCloseFile) /* 12 */
|
| 471 |
+
#define TclpCreateCommandChannel \
|
| 472 |
+
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */
|
| 473 |
+
#define TclpCreatePipe \
|
| 474 |
+
(tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
|
| 475 |
+
#define TclpCreateProcess \
|
| 476 |
+
(tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
|
| 477 |
+
#define TclpIsAtty \
|
| 478 |
+
(tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
|
| 479 |
+
#define TclUnixCopyFile \
|
| 480 |
+
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */
|
| 481 |
+
#define TclpMakeFile \
|
| 482 |
+
(tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
|
| 483 |
+
#define TclpOpenFile \
|
| 484 |
+
(tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
|
| 485 |
+
#define TclWinAddProcess \
|
| 486 |
+
(tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
|
| 487 |
+
#define TclpInetNtoa \
|
| 488 |
+
(tclIntPlatStubsPtr->tclpInetNtoa) /* 21 */
|
| 489 |
+
#define TclpCreateTempFile \
|
| 490 |
+
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
|
| 491 |
+
/* Slot 23 is reserved */
|
| 492 |
+
#define TclWinNoBackslash \
|
| 493 |
+
(tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
|
| 494 |
+
/* Slot 25 is reserved */
|
| 495 |
+
#define TclWinSetInterfaces \
|
| 496 |
+
(tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
|
| 497 |
+
#define TclWinFlushDirtyChannels \
|
| 498 |
+
(tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
|
| 499 |
+
#define TclWinResetInterfaces \
|
| 500 |
+
(tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */
|
| 501 |
+
#define TclWinCPUID \
|
| 502 |
+
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
| 503 |
+
#define TclUnixOpenTemporaryFile \
|
| 504 |
+
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
| 505 |
+
#endif /* WIN */
|
| 506 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 507 |
+
#define TclGetAndDetachPids \
|
| 508 |
+
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
|
| 509 |
+
#define TclpCloseFile \
|
| 510 |
+
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
|
| 511 |
+
#define TclpCreateCommandChannel \
|
| 512 |
+
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
|
| 513 |
+
#define TclpCreatePipe \
|
| 514 |
+
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
|
| 515 |
+
#define TclpCreateProcess \
|
| 516 |
+
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
|
| 517 |
+
#define TclUnixWaitForFile_ \
|
| 518 |
+
(tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
|
| 519 |
+
#define TclpMakeFile \
|
| 520 |
+
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
|
| 521 |
+
#define TclpOpenFile \
|
| 522 |
+
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
|
| 523 |
+
#define TclUnixWaitForFile \
|
| 524 |
+
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
|
| 525 |
+
#define TclpCreateTempFile \
|
| 526 |
+
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
|
| 527 |
+
#define TclpReaddir \
|
| 528 |
+
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
| 529 |
+
#define TclpLocaltime_unix \
|
| 530 |
+
(tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
|
| 531 |
+
#define TclpGmtime_unix \
|
| 532 |
+
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
|
| 533 |
+
#define TclpInetNtoa \
|
| 534 |
+
(tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
|
| 535 |
+
#define TclUnixCopyFile \
|
| 536 |
+
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
| 537 |
+
#define TclMacOSXGetFileAttribute \
|
| 538 |
+
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
|
| 539 |
+
#define TclMacOSXSetFileAttribute \
|
| 540 |
+
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
|
| 541 |
+
#define TclMacOSXCopyFileAttributes \
|
| 542 |
+
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
|
| 543 |
+
#define TclMacOSXMatchType \
|
| 544 |
+
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
|
| 545 |
+
#define TclMacOSXNotifierAddRunLoopMode \
|
| 546 |
+
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
|
| 547 |
+
/* Slot 20 is reserved */
|
| 548 |
+
/* Slot 21 is reserved */
|
| 549 |
+
#define TclpCreateTempFile_ \
|
| 550 |
+
(tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
|
| 551 |
+
/* Slot 23 is reserved */
|
| 552 |
+
/* Slot 24 is reserved */
|
| 553 |
+
/* Slot 25 is reserved */
|
| 554 |
+
/* Slot 26 is reserved */
|
| 555 |
+
/* Slot 27 is reserved */
|
| 556 |
+
/* Slot 28 is reserved */
|
| 557 |
+
#define TclWinCPUID \
|
| 558 |
+
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
| 559 |
+
#define TclUnixOpenTemporaryFile \
|
| 560 |
+
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
| 561 |
+
#endif /* MACOSX */
|
| 562 |
+
|
| 563 |
+
#endif /* defined(USE_TCL_STUBS) */
|
| 564 |
+
|
| 565 |
+
/* !END!: Do not edit above this line. */
|
| 566 |
+
|
| 567 |
+
#undef TCL_STORAGE_CLASS
|
| 568 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 569 |
+
#undef TclpLocaltime_unix
|
| 570 |
+
#undef TclpGmtime_unix
|
| 571 |
+
#undef TclWinConvertWSAError
|
| 572 |
+
#define TclWinConvertWSAError TclWinConvertError
|
| 573 |
+
#undef TclpInetNtoa
|
| 574 |
+
#define TclpInetNtoa inet_ntoa
|
| 575 |
+
|
| 576 |
+
#undef TclpCreateTempFile_
|
| 577 |
+
#undef TclUnixWaitForFile_
|
| 578 |
+
#ifndef MAC_OSX_TCL /* not accessible on Win32/UNIX */
|
| 579 |
+
#undef TclMacOSXGetFileAttribute /* 15 */
|
| 580 |
+
#undef TclMacOSXSetFileAttribute /* 16 */
|
| 581 |
+
#undef TclMacOSXCopyFileAttributes /* 17 */
|
| 582 |
+
#undef TclMacOSXMatchType /* 18 */
|
| 583 |
+
#undef TclMacOSXNotifierAddRunLoopMode /* 19 */
|
| 584 |
+
#endif
|
| 585 |
+
|
| 586 |
+
#if defined(_WIN32)
|
| 587 |
+
# undef TclWinNToHS
|
| 588 |
+
# undef TclWinGetServByName
|
| 589 |
+
# undef TclWinGetSockOpt
|
| 590 |
+
# undef TclWinSetSockOpt
|
| 591 |
+
# define TclWinNToHS ntohs
|
| 592 |
+
# define TclWinGetServByName getservbyname
|
| 593 |
+
# define TclWinGetSockOpt getsockopt
|
| 594 |
+
# define TclWinSetSockOpt setsockopt
|
| 595 |
+
#else
|
| 596 |
+
# undef TclpGetPid
|
| 597 |
+
# define TclpGetPid(pid) ((unsigned long) (pid))
|
| 598 |
+
#endif
|
| 599 |
+
|
| 600 |
+
#endif /* _TCLINTPLATDECLS */
|
deepseek/include/tclOOInt.h
ADDED
|
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tclOOInt.h --
|
| 3 |
+
*
|
| 4 |
+
* This file contains the structure definitions and some of the function
|
| 5 |
+
* declarations for the object-system (NB: not Tcl_Obj, but ::oo).
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 2006-2012 by Donal K. Fellows
|
| 8 |
+
*
|
| 9 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 10 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef TCL_OO_INTERNAL_H
|
| 14 |
+
#define TCL_OO_INTERNAL_H 1
|
| 15 |
+
|
| 16 |
+
#include "tclInt.h"
|
| 17 |
+
#include "tclOO.h"
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* Hack to make things work with Objective C. Note that ObjC isn't really
|
| 21 |
+
* supported, but we don't want to to be actively hostile to it. [Bug 2163447]
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
#ifdef __OBJC__
|
| 25 |
+
#define Class TclOOClass
|
| 26 |
+
#define Object TclOOObject
|
| 27 |
+
#endif /* __OBJC__ */
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
* Forward declarations.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
struct CallChain;
|
| 34 |
+
struct Class;
|
| 35 |
+
struct Foundation;
|
| 36 |
+
struct Object;
|
| 37 |
+
|
| 38 |
+
/*
|
| 39 |
+
* The data that needs to be stored per method. This record is used to collect
|
| 40 |
+
* information about all sorts of methods, including forwards, constructors
|
| 41 |
+
* and destructors.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
typedef struct Method {
|
| 45 |
+
const Tcl_MethodType *typePtr;
|
| 46 |
+
/* The type of method. If NULL, this is a
|
| 47 |
+
* special flag record which is just used for
|
| 48 |
+
* the setting of the flags field. */
|
| 49 |
+
int refCount;
|
| 50 |
+
void *clientData; /* Type-specific data. */
|
| 51 |
+
Tcl_Obj *namePtr; /* Name of the method. */
|
| 52 |
+
struct Object *declaringObjectPtr;
|
| 53 |
+
/* The object that declares this method, or
|
| 54 |
+
* NULL if it was declared by a class. */
|
| 55 |
+
struct Class *declaringClassPtr;
|
| 56 |
+
/* The class that declares this method, or
|
| 57 |
+
* NULL if it was declared directly on an
|
| 58 |
+
* object. */
|
| 59 |
+
int flags; /* Assorted flags. Includes whether this
|
| 60 |
+
* method is public/exported or not. */
|
| 61 |
+
} Method;
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* Pre- and post-call callbacks, to allow procedure-like methods to be fine
|
| 65 |
+
* tuned in their behaviour.
|
| 66 |
+
*/
|
| 67 |
+
|
| 68 |
+
typedef int (TclOO_PreCallProc)(void *clientData, Tcl_Interp *interp,
|
| 69 |
+
Tcl_ObjectContext context, Tcl_CallFrame *framePtr, int *isFinished);
|
| 70 |
+
typedef int (TclOO_PostCallProc)(void *clientData, Tcl_Interp *interp,
|
| 71 |
+
Tcl_ObjectContext context, Tcl_Namespace *namespacePtr, int result);
|
| 72 |
+
typedef void (TclOO_PmCDDeleteProc)(void *clientData);
|
| 73 |
+
typedef void *(TclOO_PmCDCloneProc)(void *clientData);
|
| 74 |
+
|
| 75 |
+
/*
|
| 76 |
+
* Procedure-like methods have the following extra information.
|
| 77 |
+
*/
|
| 78 |
+
|
| 79 |
+
typedef struct ProcedureMethod {
|
| 80 |
+
int version; /* Version of this structure. Currently must
|
| 81 |
+
* be 0. */
|
| 82 |
+
Proc *procPtr; /* Core of the implementation of the method;
|
| 83 |
+
* includes the argument definition and the
|
| 84 |
+
* body bytecodes. */
|
| 85 |
+
int flags; /* Flags to control features. */
|
| 86 |
+
int refCount;
|
| 87 |
+
void *clientData;
|
| 88 |
+
TclOO_PmCDDeleteProc *deleteClientdataProc;
|
| 89 |
+
TclOO_PmCDCloneProc *cloneClientdataProc;
|
| 90 |
+
ProcErrorProc *errProc; /* Replacement error handler. */
|
| 91 |
+
TclOO_PreCallProc *preCallProc;
|
| 92 |
+
/* Callback to allow for additional setup
|
| 93 |
+
* before the method executes. */
|
| 94 |
+
TclOO_PostCallProc *postCallProc;
|
| 95 |
+
/* Callback to allow for additional cleanup
|
| 96 |
+
* after the method executes. */
|
| 97 |
+
GetFrameInfoValueProc *gfivProc;
|
| 98 |
+
/* Callback to allow for fine tuning of how
|
| 99 |
+
* the method reports itself. */
|
| 100 |
+
} ProcedureMethod;
|
| 101 |
+
|
| 102 |
+
#define TCLOO_PROCEDURE_METHOD_VERSION 0
|
| 103 |
+
|
| 104 |
+
/*
|
| 105 |
+
* Flags for use in a ProcedureMethod.
|
| 106 |
+
*
|
| 107 |
+
* When the USE_DECLARER_NS flag is set, the method will use the namespace of
|
| 108 |
+
* the object or class that declared it (or the clone of it, if it was from
|
| 109 |
+
* such that the implementation of the method came to the particular use)
|
| 110 |
+
* instead of the namespace of the object on which the method was invoked.
|
| 111 |
+
* This flag must be distinct from all others that are associated with
|
| 112 |
+
* methods.
|
| 113 |
+
*/
|
| 114 |
+
|
| 115 |
+
#define USE_DECLARER_NS 0x80
|
| 116 |
+
|
| 117 |
+
/*
|
| 118 |
+
* Forwarded methods have the following extra information.
|
| 119 |
+
*/
|
| 120 |
+
|
| 121 |
+
typedef struct ForwardMethod {
|
| 122 |
+
Tcl_Obj *prefixObj; /* The list of values to use to replace the
|
| 123 |
+
* object and method name with. Will be a
|
| 124 |
+
* non-empty list. */
|
| 125 |
+
} ForwardMethod;
|
| 126 |
+
|
| 127 |
+
/*
|
| 128 |
+
* Helper definitions that declare a "list" array. The two varieties are
|
| 129 |
+
* either optimized for simplicity (in the case that the whole array is
|
| 130 |
+
* typically assigned at once) or efficiency (in the case that the array is
|
| 131 |
+
* expected to be expanded over time). These lists are designed to be iterated
|
| 132 |
+
* over with the help of the FOREACH macro (see later in this file).
|
| 133 |
+
*
|
| 134 |
+
* The "num" field always counts the number of listType_t elements used in the
|
| 135 |
+
* "list" field. When a "size" field exists, it describes how many elements
|
| 136 |
+
* are present in the list; when absent, exactly "num" elements are present.
|
| 137 |
+
*/
|
| 138 |
+
|
| 139 |
+
#define LIST_STATIC(listType_t) \
|
| 140 |
+
struct { int num; listType_t *list; }
|
| 141 |
+
#define LIST_DYNAMIC(listType_t) \
|
| 142 |
+
struct { int num, size; listType_t *list; }
|
| 143 |
+
|
| 144 |
+
/*
|
| 145 |
+
* Now, the definition of what an object actually is.
|
| 146 |
+
*/
|
| 147 |
+
|
| 148 |
+
typedef struct Object {
|
| 149 |
+
struct Foundation *fPtr; /* The basis for the object system. Putting
|
| 150 |
+
* this here allows the avoidance of quite a
|
| 151 |
+
* lot of hash lookups on the critical path
|
| 152 |
+
* for object invocation and creation. */
|
| 153 |
+
Tcl_Namespace *namespacePtr;/* This object's namespace. */
|
| 154 |
+
Tcl_Command command; /* Reference to this object's public
|
| 155 |
+
* command. */
|
| 156 |
+
Tcl_Command myCommand; /* Reference to this object's internal
|
| 157 |
+
* command. */
|
| 158 |
+
struct Class *selfCls; /* This object's class. */
|
| 159 |
+
Tcl_HashTable *methodsPtr; /* Object-local Tcl_Obj (method name) to
|
| 160 |
+
* Method* mapping. */
|
| 161 |
+
LIST_STATIC(struct Class *) mixins;
|
| 162 |
+
/* Classes mixed into this object. */
|
| 163 |
+
LIST_STATIC(Tcl_Obj *) filters;
|
| 164 |
+
/* List of filter names. */
|
| 165 |
+
struct Class *classPtr; /* This is non-NULL for all classes, and NULL
|
| 166 |
+
* for everything else. It points to the class
|
| 167 |
+
* structure. */
|
| 168 |
+
int refCount; /* Number of strong references to this object.
|
| 169 |
+
* Note that there may be many more weak
|
| 170 |
+
* references; this mechanism exists to
|
| 171 |
+
* avoid Tcl_Preserve. */
|
| 172 |
+
int flags;
|
| 173 |
+
int creationEpoch; /* Unique value to make comparisons of objects
|
| 174 |
+
* easier. */
|
| 175 |
+
int epoch; /* Per-object epoch, incremented when the way
|
| 176 |
+
* an object should resolve call chains is
|
| 177 |
+
* changed. */
|
| 178 |
+
Tcl_HashTable *metadataPtr; /* Mapping from pointers to metadata type to
|
| 179 |
+
* the ClientData values that are the values
|
| 180 |
+
* of each piece of attached metadata. This
|
| 181 |
+
* field starts out as NULL and is only
|
| 182 |
+
* allocated if metadata is attached. */
|
| 183 |
+
Tcl_Obj *cachedNameObj; /* Cache of the name of the object. */
|
| 184 |
+
Tcl_HashTable *chainCache; /* Place to keep unused contexts. This table
|
| 185 |
+
* is indexed by method name as Tcl_Obj. */
|
| 186 |
+
Tcl_ObjectMapMethodNameProc *mapMethodNameProc;
|
| 187 |
+
/* Function to allow remapping of method
|
| 188 |
+
* names. For itcl-ng. */
|
| 189 |
+
LIST_STATIC(Tcl_Obj *) variables;
|
| 190 |
+
} Object;
|
| 191 |
+
|
| 192 |
+
#define OBJECT_DESTRUCTING 1 /* Indicates that an object is being or has
|
| 193 |
+
* been destroyed */
|
| 194 |
+
#define DESTRUCTOR_CALLED 2 /* Indicates that evaluation of destructor script for the
|
| 195 |
+
object has began */
|
| 196 |
+
#define OO_UNUSED_4 4 /* No longer used. */
|
| 197 |
+
#define ROOT_OBJECT 0x1000 /* Flag to say that this object is the root of
|
| 198 |
+
* the class hierarchy and should be treated
|
| 199 |
+
* specially during teardown. */
|
| 200 |
+
#define FILTER_HANDLING 0x2000 /* Flag set when the object is processing a
|
| 201 |
+
* filter; when set, filters are *not*
|
| 202 |
+
* processed on the object, preventing nasty
|
| 203 |
+
* recursive filtering problems. */
|
| 204 |
+
#define USE_CLASS_CACHE 0x4000 /* Flag set to say that the object is a pure
|
| 205 |
+
* instance of the class, and has had nothing
|
| 206 |
+
* added that changes the dispatch chain (i.e.
|
| 207 |
+
* no methods, mixins, or filters. */
|
| 208 |
+
#define ROOT_CLASS 0x8000 /* Flag to say that this object is the root
|
| 209 |
+
* class of classes, and should be treated
|
| 210 |
+
* specially during teardown (and in a few
|
| 211 |
+
* other spots). */
|
| 212 |
+
#define FORCE_UNKNOWN 0x10000 /* States that we are *really* looking up the
|
| 213 |
+
* unknown method handler at that point. */
|
| 214 |
+
#define DONT_DELETE 0x20000 /* Inhibit deletion of this object. */
|
| 215 |
+
|
| 216 |
+
/*
|
| 217 |
+
* And the definition of a class. Note that every class also has an associated
|
| 218 |
+
* object, through which it is manipulated.
|
| 219 |
+
*/
|
| 220 |
+
|
| 221 |
+
typedef struct Class {
|
| 222 |
+
Object *thisPtr; /* Reference to the object associated with
|
| 223 |
+
* this class. */
|
| 224 |
+
int flags; /* Assorted flags. */
|
| 225 |
+
LIST_STATIC(struct Class *) superclasses;
|
| 226 |
+
/* List of superclasses, used for generation
|
| 227 |
+
* of method call chains. */
|
| 228 |
+
LIST_DYNAMIC(struct Class *) subclasses;
|
| 229 |
+
/* List of subclasses, used to ensure deletion
|
| 230 |
+
* of dependent entities happens properly when
|
| 231 |
+
* the class itself is deleted. */
|
| 232 |
+
LIST_DYNAMIC(Object *) instances;
|
| 233 |
+
/* List of instances, used to ensure deletion
|
| 234 |
+
* of dependent entities happens properly when
|
| 235 |
+
* the class itself is deleted. */
|
| 236 |
+
LIST_STATIC(Tcl_Obj *) filters;
|
| 237 |
+
/* List of filter names, used for generation
|
| 238 |
+
* of method call chains. */
|
| 239 |
+
LIST_STATIC(struct Class *) mixins;
|
| 240 |
+
/* List of mixin classes, used for generation
|
| 241 |
+
* of method call chains. */
|
| 242 |
+
LIST_DYNAMIC(struct Class *) mixinSubs;
|
| 243 |
+
/* List of classes that this class is mixed
|
| 244 |
+
* into, used to ensure deletion of dependent
|
| 245 |
+
* entities happens properly when the class
|
| 246 |
+
* itself is deleted. */
|
| 247 |
+
Tcl_HashTable classMethods; /* Hash table of all methods. Hash maps from
|
| 248 |
+
* the (Tcl_Obj*) method name to the (Method*)
|
| 249 |
+
* method record. */
|
| 250 |
+
Method *constructorPtr; /* Method record of the class constructor (if
|
| 251 |
+
* any). */
|
| 252 |
+
Method *destructorPtr; /* Method record of the class destructor (if
|
| 253 |
+
* any). */
|
| 254 |
+
Tcl_HashTable *metadataPtr; /* Mapping from pointers to metadata type to
|
| 255 |
+
* the ClientData values that are the values
|
| 256 |
+
* of each piece of attached metadata. This
|
| 257 |
+
* field starts out as NULL and is only
|
| 258 |
+
* allocated if metadata is attached. */
|
| 259 |
+
struct CallChain *constructorChainPtr;
|
| 260 |
+
struct CallChain *destructorChainPtr;
|
| 261 |
+
Tcl_HashTable *classChainCache;
|
| 262 |
+
/* Places where call chains are stored. For
|
| 263 |
+
* constructors, the class chain is always
|
| 264 |
+
* used. For destructors and ordinary methods,
|
| 265 |
+
* the class chain is only used when the
|
| 266 |
+
* object doesn't override with its own mixins
|
| 267 |
+
* (and filters and method implementations for
|
| 268 |
+
* when getting method chains). */
|
| 269 |
+
LIST_STATIC(Tcl_Obj *) variables;
|
| 270 |
+
} Class;
|
| 271 |
+
|
| 272 |
+
/*
|
| 273 |
+
* The foundation of the object system within an interpreter contains
|
| 274 |
+
* references to the key classes and namespaces, together with a few other
|
| 275 |
+
* useful bits and pieces. Probably ought to eventually go in the Interp
|
| 276 |
+
* structure itself.
|
| 277 |
+
*/
|
| 278 |
+
|
| 279 |
+
typedef struct ThreadLocalData {
|
| 280 |
+
int nsCount; /* Epoch counter is used for keeping
|
| 281 |
+
* the values used in Tcl_Obj internal
|
| 282 |
+
* representations sane. Must be thread-local
|
| 283 |
+
* because Tcl_Objs can cross interpreter
|
| 284 |
+
* boundaries within a thread (objects don't
|
| 285 |
+
* generally cross threads). */
|
| 286 |
+
} ThreadLocalData;
|
| 287 |
+
|
| 288 |
+
typedef struct Foundation {
|
| 289 |
+
Tcl_Interp *interp;
|
| 290 |
+
Class *objectCls; /* The root of the object system. */
|
| 291 |
+
Class *classCls; /* The class of all classes. */
|
| 292 |
+
Tcl_Namespace *ooNs; /* ::oo namespace. */
|
| 293 |
+
Tcl_Namespace *defineNs; /* Namespace containing special commands for
|
| 294 |
+
* manipulating objects and classes. The
|
| 295 |
+
* "oo::define" command acts as a special kind
|
| 296 |
+
* of ensemble for this namespace. */
|
| 297 |
+
Tcl_Namespace *objdefNs; /* Namespace containing special commands for
|
| 298 |
+
* manipulating objects and classes. The
|
| 299 |
+
* "oo::objdefine" command acts as a special
|
| 300 |
+
* kind of ensemble for this namespace. */
|
| 301 |
+
Tcl_Namespace *helpersNs; /* Namespace containing the commands that are
|
| 302 |
+
* only valid when executing inside a
|
| 303 |
+
* procedural method. */
|
| 304 |
+
int epoch; /* Used to invalidate method chains when the
|
| 305 |
+
* class structure changes. */
|
| 306 |
+
ThreadLocalData *tsdPtr; /* Counter so we can allocate a unique
|
| 307 |
+
* namespace to each object. */
|
| 308 |
+
Tcl_Obj *unknownMethodNameObj;
|
| 309 |
+
/* Shared object containing the name of the
|
| 310 |
+
* unknown method handler method. */
|
| 311 |
+
Tcl_Obj *constructorName; /* Shared object containing the "name" of a
|
| 312 |
+
* constructor. */
|
| 313 |
+
Tcl_Obj *destructorName; /* Shared object containing the "name" of a
|
| 314 |
+
* destructor. */
|
| 315 |
+
Tcl_Obj *clonedName; /* Shared object containing the name of a
|
| 316 |
+
* "<cloned>" pseudo-constructor. */
|
| 317 |
+
Tcl_Obj *defineName; /* Fully qualified name of oo::define. */
|
| 318 |
+
} Foundation;
|
| 319 |
+
|
| 320 |
+
/*
|
| 321 |
+
* A call context structure is built when a method is called. It contains the
|
| 322 |
+
* chain of method implementations that are to be invoked by a particular
|
| 323 |
+
* call, and the process of calling walks the chain, with the [next] command
|
| 324 |
+
* proceeding to the next entry in the chain.
|
| 325 |
+
*/
|
| 326 |
+
|
| 327 |
+
#define CALL_CHAIN_STATIC_SIZE 4
|
| 328 |
+
|
| 329 |
+
struct MInvoke {
|
| 330 |
+
Method *mPtr; /* Reference to the method implementation
|
| 331 |
+
* record. */
|
| 332 |
+
int isFilter; /* Whether this is a filter invocation. */
|
| 333 |
+
Class *filterDeclarer; /* What class decided to add the filter; if
|
| 334 |
+
* NULL, it was added by the object. */
|
| 335 |
+
};
|
| 336 |
+
|
| 337 |
+
typedef struct CallChain {
|
| 338 |
+
int objectCreationEpoch; /* The object's creation epoch. Note that the
|
| 339 |
+
* object reference is not stored in the call
|
| 340 |
+
* chain; it is in the call context. */
|
| 341 |
+
int objectEpoch; /* Local (object structure) epoch counter
|
| 342 |
+
* snapshot. */
|
| 343 |
+
int epoch; /* Global (class structure) epoch counter
|
| 344 |
+
* snapshot. */
|
| 345 |
+
int flags; /* Assorted flags, see below. */
|
| 346 |
+
int refCount; /* Reference count. */
|
| 347 |
+
int numChain; /* Size of the call chain. */
|
| 348 |
+
struct MInvoke *chain; /* Array of call chain entries. May point to
|
| 349 |
+
* staticChain if the number of entries is
|
| 350 |
+
* small. */
|
| 351 |
+
struct MInvoke staticChain[CALL_CHAIN_STATIC_SIZE];
|
| 352 |
+
} CallChain;
|
| 353 |
+
|
| 354 |
+
typedef struct CallContext {
|
| 355 |
+
Object *oPtr; /* The object associated with this call. */
|
| 356 |
+
int index; /* Index into the call chain of the currently
|
| 357 |
+
* executing method implementation. */
|
| 358 |
+
int skip; /* Current number of arguments to skip; can
|
| 359 |
+
* vary depending on whether it is a direct
|
| 360 |
+
* method call or a continuation via the
|
| 361 |
+
* [next] command. */
|
| 362 |
+
CallChain *callPtr; /* The actual call chain. */
|
| 363 |
+
} CallContext;
|
| 364 |
+
|
| 365 |
+
/*
|
| 366 |
+
* Bits for the 'flags' field of the call chain.
|
| 367 |
+
*/
|
| 368 |
+
|
| 369 |
+
#define PUBLIC_METHOD 0x01 /* This is a public (exported) method. */
|
| 370 |
+
#define PRIVATE_METHOD 0x02 /* This is a private (class's direct instances
|
| 371 |
+
* only) method. Supports itcl. */
|
| 372 |
+
#define OO_UNKNOWN_METHOD 0x04 /* This is an unknown method. */
|
| 373 |
+
#define CONSTRUCTOR 0x08 /* This is a constructor. */
|
| 374 |
+
#define DESTRUCTOR 0x10 /* This is a destructor. */
|
| 375 |
+
|
| 376 |
+
/*
|
| 377 |
+
* Structure containing definition information about basic class methods.
|
| 378 |
+
*/
|
| 379 |
+
|
| 380 |
+
typedef struct {
|
| 381 |
+
const char *name; /* Name of the method in question. */
|
| 382 |
+
int isPublic; /* Whether the method is public by default. */
|
| 383 |
+
Tcl_MethodType definition; /* How to call the method. */
|
| 384 |
+
} DeclaredClassMethod;
|
| 385 |
+
|
| 386 |
+
/*
|
| 387 |
+
*----------------------------------------------------------------
|
| 388 |
+
* Commands relating to OO support.
|
| 389 |
+
*----------------------------------------------------------------
|
| 390 |
+
*/
|
| 391 |
+
|
| 392 |
+
MODULE_SCOPE int TclOOInit(Tcl_Interp *interp);
|
| 393 |
+
MODULE_SCOPE int TclOODefineObjCmd(void *clientData,
|
| 394 |
+
Tcl_Interp *interp, int objc,
|
| 395 |
+
Tcl_Obj *const *objv);
|
| 396 |
+
MODULE_SCOPE int TclOOObjDefObjCmd(void *clientData,
|
| 397 |
+
Tcl_Interp *interp, int objc,
|
| 398 |
+
Tcl_Obj *const *objv);
|
| 399 |
+
MODULE_SCOPE int TclOODefineConstructorObjCmd(void *clientData,
|
| 400 |
+
Tcl_Interp *interp, int objc,
|
| 401 |
+
Tcl_Obj *const *objv);
|
| 402 |
+
MODULE_SCOPE int TclOODefineDeleteMethodObjCmd(void *clientData,
|
| 403 |
+
Tcl_Interp *interp, int objc,
|
| 404 |
+
Tcl_Obj *const *objv);
|
| 405 |
+
MODULE_SCOPE int TclOODefineDestructorObjCmd(void *clientData,
|
| 406 |
+
Tcl_Interp *interp, int objc,
|
| 407 |
+
Tcl_Obj *const *objv);
|
| 408 |
+
MODULE_SCOPE int TclOODefineExportObjCmd(void *clientData,
|
| 409 |
+
Tcl_Interp *interp, int objc,
|
| 410 |
+
Tcl_Obj *const *objv);
|
| 411 |
+
MODULE_SCOPE int TclOODefineForwardObjCmd(void *clientData,
|
| 412 |
+
Tcl_Interp *interp, int objc,
|
| 413 |
+
Tcl_Obj *const *objv);
|
| 414 |
+
MODULE_SCOPE int TclOODefineMethodObjCmd(void *clientData,
|
| 415 |
+
Tcl_Interp *interp, int objc,
|
| 416 |
+
Tcl_Obj *const *objv);
|
| 417 |
+
MODULE_SCOPE int TclOODefineRenameMethodObjCmd(void *clientData,
|
| 418 |
+
Tcl_Interp *interp, int objc,
|
| 419 |
+
Tcl_Obj *const *objv);
|
| 420 |
+
MODULE_SCOPE int TclOODefineUnexportObjCmd(void *clientData,
|
| 421 |
+
Tcl_Interp *interp, int objc,
|
| 422 |
+
Tcl_Obj *const *objv);
|
| 423 |
+
MODULE_SCOPE int TclOODefineClassObjCmd(void *clientData,
|
| 424 |
+
Tcl_Interp *interp, int objc,
|
| 425 |
+
Tcl_Obj *const *objv);
|
| 426 |
+
MODULE_SCOPE int TclOODefineSelfObjCmd(void *clientData,
|
| 427 |
+
Tcl_Interp *interp, int objc,
|
| 428 |
+
Tcl_Obj *const *objv);
|
| 429 |
+
MODULE_SCOPE int TclOOUnknownDefinition(void *clientData,
|
| 430 |
+
Tcl_Interp *interp, int objc,
|
| 431 |
+
Tcl_Obj *const *objv);
|
| 432 |
+
MODULE_SCOPE int TclOOCopyObjectCmd(void *clientData,
|
| 433 |
+
Tcl_Interp *interp, int objc,
|
| 434 |
+
Tcl_Obj *const *objv);
|
| 435 |
+
MODULE_SCOPE int TclOONextObjCmd(void *clientData,
|
| 436 |
+
Tcl_Interp *interp, int objc,
|
| 437 |
+
Tcl_Obj *const *objv);
|
| 438 |
+
MODULE_SCOPE int TclOONextToObjCmd(void *clientData,
|
| 439 |
+
Tcl_Interp *interp, int objc,
|
| 440 |
+
Tcl_Obj *const *objv);
|
| 441 |
+
MODULE_SCOPE int TclOOSelfObjCmd(void *clientData,
|
| 442 |
+
Tcl_Interp *interp, int objc,
|
| 443 |
+
Tcl_Obj *const *objv);
|
| 444 |
+
|
| 445 |
+
/*
|
| 446 |
+
* Method implementations (in tclOOBasic.c).
|
| 447 |
+
*/
|
| 448 |
+
|
| 449 |
+
MODULE_SCOPE int TclOO_Class_Constructor(void *clientData,
|
| 450 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 451 |
+
int objc, Tcl_Obj *const *objv);
|
| 452 |
+
MODULE_SCOPE int TclOO_Class_Create(void *clientData,
|
| 453 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 454 |
+
int objc, Tcl_Obj *const *objv);
|
| 455 |
+
MODULE_SCOPE int TclOO_Class_CreateNs(void *clientData,
|
| 456 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 457 |
+
int objc, Tcl_Obj *const *objv);
|
| 458 |
+
MODULE_SCOPE int TclOO_Class_New(void *clientData,
|
| 459 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 460 |
+
int objc, Tcl_Obj *const *objv);
|
| 461 |
+
MODULE_SCOPE int TclOO_Object_Destroy(void *clientData,
|
| 462 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 463 |
+
int objc, Tcl_Obj *const *objv);
|
| 464 |
+
MODULE_SCOPE int TclOO_Object_Eval(void *clientData,
|
| 465 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 466 |
+
int objc, Tcl_Obj *const *objv);
|
| 467 |
+
MODULE_SCOPE int TclOO_Object_LinkVar(void *clientData,
|
| 468 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 469 |
+
int objc, Tcl_Obj *const *objv);
|
| 470 |
+
MODULE_SCOPE int TclOO_Object_Unknown(void *clientData,
|
| 471 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 472 |
+
int objc, Tcl_Obj *const *objv);
|
| 473 |
+
MODULE_SCOPE int TclOO_Object_VarName(void *clientData,
|
| 474 |
+
Tcl_Interp *interp, Tcl_ObjectContext context,
|
| 475 |
+
int objc, Tcl_Obj *const *objv);
|
| 476 |
+
|
| 477 |
+
/*
|
| 478 |
+
* Private definitions, some of which perhaps ought to be exposed properly or
|
| 479 |
+
* maybe just put in the internal stubs table.
|
| 480 |
+
*/
|
| 481 |
+
|
| 482 |
+
MODULE_SCOPE void TclOOAddToInstances(Object *oPtr, Class *clsPtr);
|
| 483 |
+
MODULE_SCOPE void TclOOAddToMixinSubs(Class *subPtr, Class *mixinPtr);
|
| 484 |
+
MODULE_SCOPE void TclOOAddToSubclasses(Class *subPtr, Class *superPtr);
|
| 485 |
+
MODULE_SCOPE Class * TclOOAllocClass(Tcl_Interp *interp,
|
| 486 |
+
Object *useThisObj);
|
| 487 |
+
MODULE_SCOPE int TclNRNewObjectInstance(Tcl_Interp *interp,
|
| 488 |
+
Tcl_Class cls, const char *nameStr,
|
| 489 |
+
const char *nsNameStr, int objc,
|
| 490 |
+
Tcl_Obj *const *objv, int skip,
|
| 491 |
+
Tcl_Object *objectPtr);
|
| 492 |
+
MODULE_SCOPE Object * TclNewObjectInstanceCommon(Tcl_Interp *interp,
|
| 493 |
+
Class *classPtr,
|
| 494 |
+
const char *nameStr,
|
| 495 |
+
const char *nsNameStr);
|
| 496 |
+
MODULE_SCOPE int TclOODecrRefCount(Object *oPtr);
|
| 497 |
+
MODULE_SCOPE int TclOOObjectDestroyed(Object *oPtr);
|
| 498 |
+
MODULE_SCOPE int TclOODefineSlots(Foundation *fPtr);
|
| 499 |
+
MODULE_SCOPE void TclOODeleteChain(CallChain *callPtr);
|
| 500 |
+
MODULE_SCOPE void TclOODeleteChainCache(Tcl_HashTable *tablePtr);
|
| 501 |
+
MODULE_SCOPE void TclOODeleteContext(CallContext *contextPtr);
|
| 502 |
+
MODULE_SCOPE void TclOODeleteDescendants(Tcl_Interp *interp,
|
| 503 |
+
Object *oPtr);
|
| 504 |
+
MODULE_SCOPE void TclOODelMethodRef(Method *method);
|
| 505 |
+
MODULE_SCOPE CallContext *TclOOGetCallContext(Object *oPtr,
|
| 506 |
+
Tcl_Obj *methodNameObj, int flags,
|
| 507 |
+
Tcl_Obj *cacheInThisObj);
|
| 508 |
+
MODULE_SCOPE CallChain *TclOOGetStereotypeCallChain(Class *clsPtr,
|
| 509 |
+
Tcl_Obj *methodNameObj, int flags);
|
| 510 |
+
MODULE_SCOPE Foundation *TclOOGetFoundation(Tcl_Interp *interp);
|
| 511 |
+
MODULE_SCOPE Tcl_Obj * TclOOGetFwdFromMethod(Method *mPtr);
|
| 512 |
+
MODULE_SCOPE Proc * TclOOGetProcFromMethod(Method *mPtr);
|
| 513 |
+
MODULE_SCOPE Tcl_Obj * TclOOGetMethodBody(Method *mPtr);
|
| 514 |
+
MODULE_SCOPE int TclOOGetSortedClassMethodList(Class *clsPtr,
|
| 515 |
+
int flags, const char ***stringsPtr);
|
| 516 |
+
MODULE_SCOPE int TclOOGetSortedMethodList(Object *oPtr, int flags,
|
| 517 |
+
const char ***stringsPtr);
|
| 518 |
+
MODULE_SCOPE int TclOOInit(Tcl_Interp *interp);
|
| 519 |
+
MODULE_SCOPE void TclOOInitInfo(Tcl_Interp *interp);
|
| 520 |
+
MODULE_SCOPE int TclOOInvokeContext(void *clientData,
|
| 521 |
+
Tcl_Interp *interp, int objc,
|
| 522 |
+
Tcl_Obj *const objv[]);
|
| 523 |
+
MODULE_SCOPE int TclNRObjectContextInvokeNext(Tcl_Interp *interp,
|
| 524 |
+
Tcl_ObjectContext context, int objc,
|
| 525 |
+
Tcl_Obj *const *objv, int skip);
|
| 526 |
+
MODULE_SCOPE void TclOONewBasicMethod(Tcl_Interp *interp, Class *clsPtr,
|
| 527 |
+
const DeclaredClassMethod *dcm);
|
| 528 |
+
MODULE_SCOPE Tcl_Obj * TclOOObjectName(Tcl_Interp *interp, Object *oPtr);
|
| 529 |
+
MODULE_SCOPE void TclOOReleaseClassContents(Tcl_Interp *interp,
|
| 530 |
+
Object *oPtr);
|
| 531 |
+
MODULE_SCOPE int TclOORemoveFromInstances(Object *oPtr, Class *clsPtr);
|
| 532 |
+
MODULE_SCOPE int TclOORemoveFromMixins(Class *mixinPtr, Object *oPtr);
|
| 533 |
+
MODULE_SCOPE int TclOORemoveFromMixinSubs(Class *subPtr,
|
| 534 |
+
Class *mixinPtr);
|
| 535 |
+
MODULE_SCOPE int TclOORemoveFromSubclasses(Class *subPtr,
|
| 536 |
+
Class *superPtr);
|
| 537 |
+
MODULE_SCOPE Tcl_Obj * TclOORenderCallChain(Tcl_Interp *interp,
|
| 538 |
+
CallChain *callPtr);
|
| 539 |
+
MODULE_SCOPE void TclOOStashContext(Tcl_Obj *objPtr,
|
| 540 |
+
CallContext *contextPtr);
|
| 541 |
+
MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr);
|
| 542 |
+
|
| 543 |
+
/*
|
| 544 |
+
* Include all the private API, generated from tclOO.decls.
|
| 545 |
+
*/
|
| 546 |
+
|
| 547 |
+
#include "tclOOIntDecls.h"
|
| 548 |
+
|
| 549 |
+
/*
|
| 550 |
+
* Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.
|
| 551 |
+
*/
|
| 552 |
+
|
| 553 |
+
#define AddRef(ptr) ((ptr)->refCount++)
|
| 554 |
+
|
| 555 |
+
/*
|
| 556 |
+
* A convenience macro for iterating through the lists used in the internal
|
| 557 |
+
* memory management of objects.
|
| 558 |
+
* REQUIRES DECLARATION: int i;
|
| 559 |
+
*/
|
| 560 |
+
|
| 561 |
+
#define FOREACH(var,ary) \
|
| 562 |
+
for(i=0 ; i<(ary).num; i++) if ((ary).list[i] == NULL) { \
|
| 563 |
+
continue; \
|
| 564 |
+
} else if ((var) = (ary).list[i], 1)
|
| 565 |
+
|
| 566 |
+
/*
|
| 567 |
+
* Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
|
| 568 |
+
* sets up the declarations needed for the main macro, FOREACH_HASH, which
|
| 569 |
+
* does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
|
| 570 |
+
* only iterates over values.
|
| 571 |
+
*/
|
| 572 |
+
|
| 573 |
+
#define FOREACH_HASH_DECLS \
|
| 574 |
+
Tcl_HashEntry *hPtr;Tcl_HashSearch search
|
| 575 |
+
#define FOREACH_HASH(key,val,tablePtr) \
|
| 576 |
+
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
|
| 577 |
+
((key)=(void *)Tcl_GetHashKey((tablePtr),hPtr),\
|
| 578 |
+
(val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search))
|
| 579 |
+
#define FOREACH_HASH_VALUE(val,tablePtr) \
|
| 580 |
+
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
|
| 581 |
+
((val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search))
|
| 582 |
+
|
| 583 |
+
/*
|
| 584 |
+
* Convenience macro for duplicating a list. Needs no external declaration,
|
| 585 |
+
* but all arguments are used multiple times and so must have no side effects.
|
| 586 |
+
*/
|
| 587 |
+
|
| 588 |
+
#undef DUPLICATE /* prevent possible conflict with definition in WINAPI nb30.h */
|
| 589 |
+
#define DUPLICATE(target,source,type) \
|
| 590 |
+
do { \
|
| 591 |
+
size_t len = sizeof(type) * ((target).num=(source).num);\
|
| 592 |
+
if (len != 0) { \
|
| 593 |
+
memcpy(((target).list=(type*)ckalloc(len)), (source).list, len); \
|
| 594 |
+
} else { \
|
| 595 |
+
(target).list = NULL; \
|
| 596 |
+
} \
|
| 597 |
+
} while(0)
|
| 598 |
+
|
| 599 |
+
#endif /* TCL_OO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
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tclPlatDecls.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of platform specific Tcl APIs.
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
| 7 |
+
* All rights reserved.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef _TCLPLATDECLS
|
| 11 |
+
#define _TCLPLATDECLS
|
| 12 |
+
|
| 13 |
+
#undef TCL_STORAGE_CLASS
|
| 14 |
+
#ifdef BUILD_tcl
|
| 15 |
+
# define TCL_STORAGE_CLASS DLLEXPORT
|
| 16 |
+
#else
|
| 17 |
+
# ifdef USE_TCL_STUBS
|
| 18 |
+
# define TCL_STORAGE_CLASS
|
| 19 |
+
# else
|
| 20 |
+
# define TCL_STORAGE_CLASS DLLIMPORT
|
| 21 |
+
# endif
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 26 |
+
* script. Any modifications to the function declarations below should be made
|
| 27 |
+
* in the generic/tcl.decls script.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
* TCHAR is needed here for win32, so if it is not defined yet do it here.
|
| 32 |
+
* This way, we don't need to include <tchar.h> just for one define.
|
| 33 |
+
*/
|
| 34 |
+
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(_TCHAR_DEFINED)
|
| 35 |
+
# if defined(_UNICODE)
|
| 36 |
+
typedef wchar_t TCHAR;
|
| 37 |
+
# else
|
| 38 |
+
typedef char TCHAR;
|
| 39 |
+
# endif
|
| 40 |
+
# define _TCHAR_DEFINED
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
/*
|
| 50 |
+
* Exported function declarations:
|
| 51 |
+
*/
|
| 52 |
+
|
| 53 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 54 |
+
/* 0 */
|
| 55 |
+
EXTERN TCHAR * Tcl_WinUtfToTChar(const char *str, int len,
|
| 56 |
+
Tcl_DString *dsPtr);
|
| 57 |
+
/* 1 */
|
| 58 |
+
EXTERN char * Tcl_WinTCharToUtf(const TCHAR *str, int len,
|
| 59 |
+
Tcl_DString *dsPtr);
|
| 60 |
+
/* Slot 2 is reserved */
|
| 61 |
+
/* 3 */
|
| 62 |
+
EXTERN void TclWinConvertError_(unsigned errCode);
|
| 63 |
+
#endif /* WIN */
|
| 64 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 65 |
+
/* 0 */
|
| 66 |
+
EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp,
|
| 67 |
+
const char *bundleName, int hasResourceFile,
|
| 68 |
+
int maxPathLen, char *libraryPath);
|
| 69 |
+
/* 1 */
|
| 70 |
+
EXTERN int Tcl_MacOSXOpenVersionedBundleResources(
|
| 71 |
+
Tcl_Interp *interp, const char *bundleName,
|
| 72 |
+
const char *bundleVersion,
|
| 73 |
+
int hasResourceFile, int maxPathLen,
|
| 74 |
+
char *libraryPath);
|
| 75 |
+
/* 2 */
|
| 76 |
+
EXTERN void TclMacOSXNotifierAddRunLoopMode_(
|
| 77 |
+
const void *runLoopMode);
|
| 78 |
+
#endif /* MACOSX */
|
| 79 |
+
|
| 80 |
+
typedef struct TclPlatStubs {
|
| 81 |
+
int magic;
|
| 82 |
+
void *hooks;
|
| 83 |
+
|
| 84 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 85 |
+
TCHAR * (*tcl_WinUtfToTChar) (const char *str, int len, Tcl_DString *dsPtr); /* 0 */
|
| 86 |
+
char * (*tcl_WinTCharToUtf) (const TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */
|
| 87 |
+
void (*reserved2)(void);
|
| 88 |
+
void (*tclWinConvertError_) (unsigned errCode); /* 3 */
|
| 89 |
+
#endif /* WIN */
|
| 90 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 91 |
+
int (*tcl_MacOSXOpenBundleResources) (Tcl_Interp *interp, const char *bundleName, int hasResourceFile, int maxPathLen, char *libraryPath); /* 0 */
|
| 92 |
+
int (*tcl_MacOSXOpenVersionedBundleResources) (Tcl_Interp *interp, const char *bundleName, const char *bundleVersion, int hasResourceFile, int maxPathLen, char *libraryPath); /* 1 */
|
| 93 |
+
void (*tclMacOSXNotifierAddRunLoopMode_) (const void *runLoopMode); /* 2 */
|
| 94 |
+
#endif /* MACOSX */
|
| 95 |
+
} TclPlatStubs;
|
| 96 |
+
|
| 97 |
+
extern const TclPlatStubs *tclPlatStubsPtr;
|
| 98 |
+
|
| 99 |
+
#ifdef __cplusplus
|
| 100 |
+
}
|
| 101 |
+
#endif
|
| 102 |
+
|
| 103 |
+
#if defined(USE_TCL_STUBS)
|
| 104 |
+
|
| 105 |
+
/*
|
| 106 |
+
* Inline function declarations:
|
| 107 |
+
*/
|
| 108 |
+
|
| 109 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 110 |
+
#define Tcl_WinUtfToTChar \
|
| 111 |
+
(tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
|
| 112 |
+
#define Tcl_WinTCharToUtf \
|
| 113 |
+
(tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
|
| 114 |
+
/* Slot 2 is reserved */
|
| 115 |
+
#define TclWinConvertError_ \
|
| 116 |
+
(tclPlatStubsPtr->tclWinConvertError_) /* 3 */
|
| 117 |
+
#endif /* WIN */
|
| 118 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 119 |
+
#define Tcl_MacOSXOpenBundleResources \
|
| 120 |
+
(tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
|
| 121 |
+
#define Tcl_MacOSXOpenVersionedBundleResources \
|
| 122 |
+
(tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
|
| 123 |
+
#define TclMacOSXNotifierAddRunLoopMode_ \
|
| 124 |
+
(tclPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode_) /* 2 */
|
| 125 |
+
#endif /* MACOSX */
|
| 126 |
+
|
| 127 |
+
#endif /* defined(USE_TCL_STUBS) */
|
| 128 |
+
|
| 129 |
+
/* !END!: Do not edit above this line. */
|
| 130 |
+
|
| 131 |
+
#undef TclUnusedStubEntry
|
| 132 |
+
#undef TclMacOSXNotifierAddRunLoopMode_
|
| 133 |
+
#undef TclWinConvertError_
|
| 134 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 135 |
+
#undef Tcl_MacOSXOpenBundleResources
|
| 136 |
+
#define Tcl_MacOSXOpenBundleResources(a,b,c,d,e) Tcl_MacOSXOpenVersionedBundleResources(a,b,NULL,c,d,e)
|
| 137 |
+
#endif
|
| 138 |
+
|
| 139 |
+
#undef TCL_STORAGE_CLASS
|
| 140 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 141 |
+
|
| 142 |
+
#endif /* _TCLPLATDECLS */
|
| 143 |
+
|
| 144 |
+
|
deepseek/include/tclTomMath.h
ADDED
|
@@ -0,0 +1,1131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
| 2 |
+
/* SPDX-License-Identifier: Unlicense */
|
| 3 |
+
|
| 4 |
+
#ifndef BN_H_
|
| 5 |
+
#define BN_H_
|
| 6 |
+
|
| 7 |
+
#ifndef MODULE_SCOPE
|
| 8 |
+
#define MODULE_SCOPE extern
|
| 9 |
+
#endif
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
#ifdef __cplusplus
|
| 14 |
+
extern "C" {
|
| 15 |
+
#endif
|
| 16 |
+
|
| 17 |
+
/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
|
| 18 |
+
#if (defined(_WIN32) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)) && !defined(MP_64BIT)
|
| 19 |
+
# define MP_32BIT
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
/* detect 64-bit mode if possible */
|
| 23 |
+
#if defined(NEVER)
|
| 24 |
+
# if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
|
| 25 |
+
# if defined(__GNUC__)
|
| 26 |
+
/* we support 128bit integers only via: __attribute__((mode(TI))) */
|
| 27 |
+
# define MP_64BIT
|
| 28 |
+
# else
|
| 29 |
+
/* otherwise we fall back to MP_32BIT even on 64bit platforms */
|
| 30 |
+
# define MP_32BIT
|
| 31 |
+
# endif
|
| 32 |
+
# endif
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
#ifdef MP_DIGIT_BIT
|
| 36 |
+
# error Defining MP_DIGIT_BIT is disallowed, use MP_8/16/31/32/64BIT
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/* some default configurations.
|
| 40 |
+
*
|
| 41 |
+
* A "mp_digit" must be able to hold MP_DIGIT_BIT + 1 bits
|
| 42 |
+
* A "mp_word" must be able to hold 2*MP_DIGIT_BIT + 1 bits
|
| 43 |
+
*
|
| 44 |
+
* At the very least a mp_digit must be able to hold 7 bits
|
| 45 |
+
* [any size beyond that is ok provided it doesn't overflow the data type]
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#ifdef MP_8BIT
|
| 49 |
+
#ifndef MP_DIGIT_DECLARED
|
| 50 |
+
typedef unsigned char mp_digit;
|
| 51 |
+
#define MP_DIGIT_DECLARED
|
| 52 |
+
#endif
|
| 53 |
+
#ifndef MP_WORD_DECLARED
|
| 54 |
+
typedef unsigned short private_mp_word;
|
| 55 |
+
#define MP_WORD_DECLARED
|
| 56 |
+
#endif
|
| 57 |
+
# define MP_SIZEOF_MP_DIGIT 1
|
| 58 |
+
# ifdef MP_DIGIT_BIT
|
| 59 |
+
# error You must not define MP_DIGIT_BIT when using MP_8BIT
|
| 60 |
+
# endif
|
| 61 |
+
#elif defined(MP_16BIT)
|
| 62 |
+
#ifndef MP_DIGIT_DECLARED
|
| 63 |
+
typedef unsigned short mp_digit;
|
| 64 |
+
#define MP_DIGIT_DECLARED
|
| 65 |
+
#endif
|
| 66 |
+
#ifndef MP_WORD_DECLARED
|
| 67 |
+
typedef unsigned int private_mp_word;
|
| 68 |
+
#define MP_WORD_DECLARED
|
| 69 |
+
#endif
|
| 70 |
+
# define MP_SIZEOF_MP_DIGIT 2
|
| 71 |
+
# ifdef MP_DIGIT_BIT
|
| 72 |
+
# error You must not define MP_DIGIT_BIT when using MP_16BIT
|
| 73 |
+
# endif
|
| 74 |
+
#elif defined(MP_64BIT)
|
| 75 |
+
/* for GCC only on supported platforms */
|
| 76 |
+
#ifndef MP_DIGIT_DECLARED
|
| 77 |
+
typedef unsigned long long mp_digit;
|
| 78 |
+
#define MP_DIGIT_DECLARED
|
| 79 |
+
#endif
|
| 80 |
+
typedef unsigned long private_mp_word __attribute__((mode(TI)));
|
| 81 |
+
# define MP_DIGIT_BIT 60
|
| 82 |
+
#else
|
| 83 |
+
/* this is the default case, 28-bit digits */
|
| 84 |
+
|
| 85 |
+
/* this is to make porting into LibTomCrypt easier :-) */
|
| 86 |
+
#ifndef MP_DIGIT_DECLARED
|
| 87 |
+
typedef unsigned int mp_digit;
|
| 88 |
+
#define MP_DIGIT_DECLARED
|
| 89 |
+
#endif
|
| 90 |
+
#ifndef MP_WORD_DECLARED
|
| 91 |
+
#ifdef _WIN32
|
| 92 |
+
typedef unsigned __int64 private_mp_word;
|
| 93 |
+
#else
|
| 94 |
+
typedef unsigned long long private_mp_word;
|
| 95 |
+
#endif
|
| 96 |
+
#define MP_WORD_DECLARED
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
# ifdef MP_31BIT
|
| 100 |
+
/*
|
| 101 |
+
* This is an extension that uses 31-bit digits.
|
| 102 |
+
* Please be aware that not all functions support this size, especially s_mp_mul_digs_fast
|
| 103 |
+
* will be reduced to work on small numbers only:
|
| 104 |
+
* Up to 8 limbs, 248 bits instead of up to 512 limbs, 15872 bits with MP_28BIT.
|
| 105 |
+
*/
|
| 106 |
+
# define MP_DIGIT_BIT 31
|
| 107 |
+
# else
|
| 108 |
+
/* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */
|
| 109 |
+
# define MP_DIGIT_BIT 28
|
| 110 |
+
# define MP_28BIT
|
| 111 |
+
# endif
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
|
| 115 |
+
#ifndef MP_DIGIT_BIT
|
| 116 |
+
# define MP_DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
|
| 117 |
+
#endif
|
| 118 |
+
|
| 119 |
+
#define MP_MASK ((((mp_digit)1)<<((mp_digit)MP_DIGIT_BIT))-((mp_digit)1))
|
| 120 |
+
#define MP_DIGIT_MAX MP_MASK
|
| 121 |
+
|
| 122 |
+
/* Primality generation flags */
|
| 123 |
+
#define MP_PRIME_BBS 0x0001 /* BBS style prime */
|
| 124 |
+
#define MP_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
|
| 125 |
+
#define MP_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
|
| 126 |
+
|
| 127 |
+
#define LTM_PRIME_BBS (MP_DEPRECATED_PRAGMA("LTM_PRIME_BBS has been deprecated, use MP_PRIME_BBS") MP_PRIME_BBS)
|
| 128 |
+
#define LTM_PRIME_SAFE (MP_DEPRECATED_PRAGMA("LTM_PRIME_SAFE has been deprecated, use MP_PRIME_SAFE") MP_PRIME_SAFE)
|
| 129 |
+
#define LTM_PRIME_2MSB_ON (MP_DEPRECATED_PRAGMA("LTM_PRIME_2MSB_ON has been deprecated, use MP_PRIME_2MSB_ON") MP_PRIME_2MSB_ON)
|
| 130 |
+
|
| 131 |
+
#ifdef MP_USE_ENUMS
|
| 132 |
+
typedef enum {
|
| 133 |
+
MP_ZPOS = 0, /* positive */
|
| 134 |
+
MP_NEG = 1 /* negative */
|
| 135 |
+
} mp_sign;
|
| 136 |
+
typedef enum {
|
| 137 |
+
MP_LT = -1, /* less than */
|
| 138 |
+
MP_EQ = 0, /* equal */
|
| 139 |
+
MP_GT = 1 /* greater than */
|
| 140 |
+
} mp_ord;
|
| 141 |
+
typedef enum {
|
| 142 |
+
MP_NO = 0,
|
| 143 |
+
MP_YES = 1
|
| 144 |
+
} mp_bool;
|
| 145 |
+
typedef enum {
|
| 146 |
+
MP_OKAY = 0, /* no error */
|
| 147 |
+
MP_ERR = -1, /* unknown error */
|
| 148 |
+
MP_MEM = -2, /* out of mem */
|
| 149 |
+
MP_VAL = -3, /* invalid input */
|
| 150 |
+
MP_ITER = -4, /* maximum iterations reached */
|
| 151 |
+
MP_BUF = -5 /* buffer overflow, supplied buffer too small */
|
| 152 |
+
} mp_err;
|
| 153 |
+
typedef enum {
|
| 154 |
+
MP_LSB_FIRST = -1,
|
| 155 |
+
MP_MSB_FIRST = 1
|
| 156 |
+
} mp_order;
|
| 157 |
+
typedef enum {
|
| 158 |
+
MP_LITTLE_ENDIAN = -1,
|
| 159 |
+
MP_NATIVE_ENDIAN = 0,
|
| 160 |
+
MP_BIG_ENDIAN = 1
|
| 161 |
+
} mp_endian;
|
| 162 |
+
#else
|
| 163 |
+
typedef int mp_sign;
|
| 164 |
+
#define MP_ZPOS 0 /* positive integer */
|
| 165 |
+
#define MP_NEG 1 /* negative */
|
| 166 |
+
typedef int mp_ord;
|
| 167 |
+
#define MP_LT -1 /* less than */
|
| 168 |
+
#define MP_EQ 0 /* equal to */
|
| 169 |
+
#define MP_GT 1 /* greater than */
|
| 170 |
+
typedef int mp_bool;
|
| 171 |
+
#define MP_YES 1
|
| 172 |
+
#define MP_NO 0
|
| 173 |
+
typedef int mp_err;
|
| 174 |
+
#define MP_OKAY 0 /* no error */
|
| 175 |
+
#define MP_ERR -1 /* unknown error */
|
| 176 |
+
#define MP_MEM -2 /* out of mem */
|
| 177 |
+
#define MP_VAL -3 /* invalid input */
|
| 178 |
+
#define MP_RANGE (MP_DEPRECATED_PRAGMA("MP_RANGE has been deprecated in favor of MP_VAL") MP_VAL)
|
| 179 |
+
#define MP_ITER -4 /* maximum iterations reached */
|
| 180 |
+
#define MP_BUF -5 /* buffer overflow, supplied buffer too small */
|
| 181 |
+
typedef int mp_order;
|
| 182 |
+
#define MP_LSB_FIRST -1
|
| 183 |
+
#define MP_MSB_FIRST 1
|
| 184 |
+
typedef int mp_endian;
|
| 185 |
+
#define MP_LITTLE_ENDIAN -1
|
| 186 |
+
#define MP_NATIVE_ENDIAN 0
|
| 187 |
+
#define MP_BIG_ENDIAN 1
|
| 188 |
+
#endif
|
| 189 |
+
|
| 190 |
+
/* tunable cutoffs */
|
| 191 |
+
|
| 192 |
+
#ifndef MP_FIXED_CUTOFFS
|
| 193 |
+
extern int
|
| 194 |
+
KARATSUBA_MUL_CUTOFF,
|
| 195 |
+
KARATSUBA_SQR_CUTOFF,
|
| 196 |
+
TOOM_MUL_CUTOFF,
|
| 197 |
+
TOOM_SQR_CUTOFF;
|
| 198 |
+
#endif
|
| 199 |
+
|
| 200 |
+
/* define this to use lower memory usage routines (exptmods mostly) */
|
| 201 |
+
/* #define MP_LOW_MEM */
|
| 202 |
+
|
| 203 |
+
/* default precision */
|
| 204 |
+
#ifndef MP_PREC
|
| 205 |
+
# ifndef MP_LOW_MEM
|
| 206 |
+
# define MP_PREC 32 /* default digits of precision */
|
| 207 |
+
# elif defined(MP_8BIT)
|
| 208 |
+
# define MP_PREC 16 /* default digits of precision */
|
| 209 |
+
# else
|
| 210 |
+
# define MP_PREC 8 /* default digits of precision */
|
| 211 |
+
# endif
|
| 212 |
+
#endif
|
| 213 |
+
|
| 214 |
+
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
|
| 215 |
+
#define PRIVATE_MP_WARRAY (int)(1 << (((CHAR_BIT * sizeof(private_mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
|
| 216 |
+
|
| 217 |
+
#if defined(__GNUC__) && __GNUC__ >= 4
|
| 218 |
+
# define MP_NULL_TERMINATED __attribute__((sentinel))
|
| 219 |
+
#else
|
| 220 |
+
# define MP_NULL_TERMINATED
|
| 221 |
+
#endif
|
| 222 |
+
|
| 223 |
+
/*
|
| 224 |
+
* MP_WUR - warn unused result
|
| 225 |
+
* ---------------------------
|
| 226 |
+
*
|
| 227 |
+
* The result of functions annotated with MP_WUR must be
|
| 228 |
+
* checked and cannot be ignored.
|
| 229 |
+
*
|
| 230 |
+
* Most functions in libtommath return an error code.
|
| 231 |
+
* This error code must be checked in order to prevent crashes or invalid
|
| 232 |
+
* results.
|
| 233 |
+
*
|
| 234 |
+
* If you still want to avoid the error checks for quick and dirty programs
|
| 235 |
+
* without robustness guarantees, you can `#define MP_WUR` before including
|
| 236 |
+
* tommath.h, disabling the warnings.
|
| 237 |
+
*/
|
| 238 |
+
#ifndef MP_WUR
|
| 239 |
+
# if defined(__GNUC__) && __GNUC__ >= 4
|
| 240 |
+
# define MP_WUR __attribute__((warn_unused_result))
|
| 241 |
+
# else
|
| 242 |
+
# define MP_WUR
|
| 243 |
+
# endif
|
| 244 |
+
#endif
|
| 245 |
+
|
| 246 |
+
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
|
| 247 |
+
# define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
|
| 248 |
+
#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
| 249 |
+
# define MP_DEPRECATED(x) __declspec(deprecated("replaced by " #x))
|
| 250 |
+
#else
|
| 251 |
+
# define MP_DEPRECATED(x)
|
| 252 |
+
#endif
|
| 253 |
+
|
| 254 |
+
#ifndef MP_NO_DEPRECATED_PRAGMA
|
| 255 |
+
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
|
| 256 |
+
# define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
|
| 257 |
+
# define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
|
| 258 |
+
#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
| 259 |
+
# define MP_DEPRECATED_PRAGMA(s) __pragma(message(s))
|
| 260 |
+
#endif
|
| 261 |
+
#endif
|
| 262 |
+
|
| 263 |
+
#ifndef MP_DEPRECATED_PRAGMA
|
| 264 |
+
# define MP_DEPRECATED_PRAGMA(s)
|
| 265 |
+
#endif
|
| 266 |
+
|
| 267 |
+
#define DIGIT_BIT MP_DIGIT_BIT
|
| 268 |
+
#define USED(m) ((m)->used)
|
| 269 |
+
#define DIGIT(m,k) ((m)->dp[(k)])
|
| 270 |
+
#define SIGN(m) ((m)->sign)
|
| 271 |
+
|
| 272 |
+
/* the infamous mp_int structure */
|
| 273 |
+
#ifndef MP_INT_DECLARED
|
| 274 |
+
#define MP_INT_DECLARED
|
| 275 |
+
typedef struct mp_int mp_int;
|
| 276 |
+
#endif
|
| 277 |
+
struct mp_int {
|
| 278 |
+
int used, alloc;
|
| 279 |
+
mp_sign sign;
|
| 280 |
+
mp_digit *dp;
|
| 281 |
+
};
|
| 282 |
+
|
| 283 |
+
/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
|
| 284 |
+
typedef int private_mp_prime_callback(unsigned char *dst, int len, void *dat);
|
| 285 |
+
typedef private_mp_prime_callback MP_DEPRECATED(mp_rand_source) ltm_prime_callback;
|
| 286 |
+
|
| 287 |
+
/* error code to char* string */
|
| 288 |
+
/*
|
| 289 |
+
const char *mp_error_to_string(mp_err code) MP_WUR;
|
| 290 |
+
*/
|
| 291 |
+
|
| 292 |
+
/* ---> init and deinit bignum functions <--- */
|
| 293 |
+
/* init a bignum */
|
| 294 |
+
/*
|
| 295 |
+
mp_err mp_init(mp_int *a) MP_WUR;
|
| 296 |
+
*/
|
| 297 |
+
|
| 298 |
+
/* free a bignum */
|
| 299 |
+
/*
|
| 300 |
+
void mp_clear(mp_int *a);
|
| 301 |
+
*/
|
| 302 |
+
|
| 303 |
+
/* init a null terminated series of arguments */
|
| 304 |
+
/*
|
| 305 |
+
mp_err mp_init_multi(mp_int *mp, ...) MP_NULL_TERMINATED MP_WUR;
|
| 306 |
+
*/
|
| 307 |
+
|
| 308 |
+
/* clear a null terminated series of arguments */
|
| 309 |
+
/*
|
| 310 |
+
void mp_clear_multi(mp_int *mp, ...) MP_NULL_TERMINATED;
|
| 311 |
+
*/
|
| 312 |
+
|
| 313 |
+
/* exchange two ints */
|
| 314 |
+
/*
|
| 315 |
+
void mp_exch(mp_int *a, mp_int *b);
|
| 316 |
+
*/
|
| 317 |
+
|
| 318 |
+
/* shrink ram required for a bignum */
|
| 319 |
+
/*
|
| 320 |
+
mp_err mp_shrink(mp_int *a) MP_WUR;
|
| 321 |
+
*/
|
| 322 |
+
|
| 323 |
+
/* grow an int to a given size */
|
| 324 |
+
/*
|
| 325 |
+
mp_err mp_grow(mp_int *a, int size) MP_WUR;
|
| 326 |
+
*/
|
| 327 |
+
|
| 328 |
+
/* init to a given number of digits */
|
| 329 |
+
/*
|
| 330 |
+
mp_err mp_init_size(mp_int *a, int size) MP_WUR;
|
| 331 |
+
*/
|
| 332 |
+
|
| 333 |
+
/* ---> Basic Manipulations <--- */
|
| 334 |
+
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
|
| 335 |
+
#define mp_isodd(a) (((a)->used != 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
|
| 336 |
+
#define mp_iseven(a) (((a)->used == 0 || (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
|
| 337 |
+
#define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
|
| 338 |
+
|
| 339 |
+
/* set to zero */
|
| 340 |
+
/*
|
| 341 |
+
void mp_zero(mp_int *a);
|
| 342 |
+
*/
|
| 343 |
+
|
| 344 |
+
/* get and set doubles */
|
| 345 |
+
/*
|
| 346 |
+
double mp_get_double(const mp_int *a) MP_WUR;
|
| 347 |
+
*/
|
| 348 |
+
/*
|
| 349 |
+
mp_err mp_set_double(mp_int *a, double b) MP_WUR;
|
| 350 |
+
*/
|
| 351 |
+
|
| 352 |
+
/* get integer, set integer and init with integer (int32_t) */
|
| 353 |
+
#ifndef MP_NO_STDINT
|
| 354 |
+
/*
|
| 355 |
+
int32_t mp_get_i32(const mp_int *a) MP_WUR;
|
| 356 |
+
*/
|
| 357 |
+
/*
|
| 358 |
+
void mp_set_i32(mp_int *a, int32_t b);
|
| 359 |
+
*/
|
| 360 |
+
/*
|
| 361 |
+
mp_err mp_init_i32(mp_int *a, int32_t b) MP_WUR;
|
| 362 |
+
*/
|
| 363 |
+
|
| 364 |
+
/* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint32_t) */
|
| 365 |
+
#define mp_get_u32(a) ((uint32_t)mp_get_i32(a))
|
| 366 |
+
/*
|
| 367 |
+
void mp_set_u32(mp_int *a, uint32_t b);
|
| 368 |
+
*/
|
| 369 |
+
/*
|
| 370 |
+
mp_err mp_init_u32(mp_int *a, uint32_t b) MP_WUR;
|
| 371 |
+
*/
|
| 372 |
+
|
| 373 |
+
/* get integer, set integer and init with integer (int64_t) */
|
| 374 |
+
/*
|
| 375 |
+
int64_t mp_get_i64(const mp_int *a) MP_WUR;
|
| 376 |
+
*/
|
| 377 |
+
/*
|
| 378 |
+
void mp_set_i64(mp_int *a, int64_t b);
|
| 379 |
+
*/
|
| 380 |
+
/*
|
| 381 |
+
mp_err mp_init_i64(mp_int *a, int64_t b) MP_WUR;
|
| 382 |
+
*/
|
| 383 |
+
|
| 384 |
+
/* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint64_t) */
|
| 385 |
+
#define mp_get_u64(a) ((uint64_t)mp_get_i64(a))
|
| 386 |
+
/*
|
| 387 |
+
void mp_set_u64(mp_int *a, uint64_t b);
|
| 388 |
+
*/
|
| 389 |
+
/*
|
| 390 |
+
mp_err mp_init_u64(mp_int *a, uint64_t b) MP_WUR;
|
| 391 |
+
*/
|
| 392 |
+
|
| 393 |
+
/* get magnitude */
|
| 394 |
+
/*
|
| 395 |
+
uint32_t mp_get_mag_u32(const mp_int *a) MP_WUR;
|
| 396 |
+
*/
|
| 397 |
+
/*
|
| 398 |
+
uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR;
|
| 399 |
+
*/
|
| 400 |
+
#endif
|
| 401 |
+
/*
|
| 402 |
+
unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR;
|
| 403 |
+
*/
|
| 404 |
+
/*
|
| 405 |
+
Tcl_WideUInt mp_get_mag_ull(const mp_int *a) MP_WUR;
|
| 406 |
+
*/
|
| 407 |
+
|
| 408 |
+
/* get integer, set integer (long) */
|
| 409 |
+
/*
|
| 410 |
+
long mp_get_l(const mp_int *a) MP_WUR;
|
| 411 |
+
*/
|
| 412 |
+
/*
|
| 413 |
+
void mp_set_l(mp_int *a, long b);
|
| 414 |
+
*/
|
| 415 |
+
/*
|
| 416 |
+
mp_err mp_init_l(mp_int *a, long b) MP_WUR;
|
| 417 |
+
*/
|
| 418 |
+
|
| 419 |
+
/* get integer, set integer (unsigned long) */
|
| 420 |
+
#define mp_get_ul(a) ((unsigned long)mp_get_l(a))
|
| 421 |
+
/*
|
| 422 |
+
void mp_set_ul(mp_int *a, unsigned long b);
|
| 423 |
+
*/
|
| 424 |
+
/*
|
| 425 |
+
mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR;
|
| 426 |
+
*/
|
| 427 |
+
|
| 428 |
+
/* get integer, set integer (Tcl_WideInt) */
|
| 429 |
+
/*
|
| 430 |
+
Tcl_WideInt mp_get_ll(const mp_int *a) MP_WUR;
|
| 431 |
+
*/
|
| 432 |
+
/*
|
| 433 |
+
void mp_set_ll(mp_int *a, Tcl_WideInt b);
|
| 434 |
+
*/
|
| 435 |
+
/*
|
| 436 |
+
mp_err mp_init_ll(mp_int *a, Tcl_WideInt b) MP_WUR;
|
| 437 |
+
*/
|
| 438 |
+
|
| 439 |
+
/* get integer, set integer (Tcl_WideUInt) */
|
| 440 |
+
#define mp_get_ull(a) ((Tcl_WideUInt)mp_get_ll(a))
|
| 441 |
+
/*
|
| 442 |
+
void mp_set_ull(mp_int *a, Tcl_WideUInt b);
|
| 443 |
+
*/
|
| 444 |
+
/*
|
| 445 |
+
mp_err mp_init_ull(mp_int *a, Tcl_WideUInt b) MP_WUR;
|
| 446 |
+
*/
|
| 447 |
+
|
| 448 |
+
/* set to single unsigned digit, up to MP_DIGIT_MAX */
|
| 449 |
+
/*
|
| 450 |
+
void mp_set(mp_int *a, mp_digit b);
|
| 451 |
+
*/
|
| 452 |
+
/*
|
| 453 |
+
mp_err mp_init_set(mp_int *a, mp_digit b) MP_WUR;
|
| 454 |
+
*/
|
| 455 |
+
|
| 456 |
+
/* get integer, set integer and init with integer (deprecated) */
|
| 457 |
+
/*
|
| 458 |
+
MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int *a) MP_WUR;
|
| 459 |
+
*/
|
| 460 |
+
/*
|
| 461 |
+
MP_DEPRECATED(mp_get_mag_ul/mp_get_ul) unsigned long mp_get_long(const mp_int *a) MP_WUR;
|
| 462 |
+
*/
|
| 463 |
+
/*
|
| 464 |
+
MP_DEPRECATED(mp_get_mag_ull/mp_get_ull) Tcl_WideUInt mp_get_long_long(const mp_int *a) MP_WUR;
|
| 465 |
+
*/
|
| 466 |
+
/*
|
| 467 |
+
MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b);
|
| 468 |
+
*/
|
| 469 |
+
/*
|
| 470 |
+
MP_DEPRECATED(mp_set_ul) mp_err mp_set_long(mp_int *a, unsigned long b);
|
| 471 |
+
*/
|
| 472 |
+
/*
|
| 473 |
+
MP_DEPRECATED(mp_set_ull) mp_err mp_set_long_long(mp_int *a, Tcl_WideUInt b);
|
| 474 |
+
*/
|
| 475 |
+
/*
|
| 476 |
+
MP_DEPRECATED(mp_init_ul) mp_err mp_init_set_int(mp_int *a, unsigned long b) MP_WUR;
|
| 477 |
+
*/
|
| 478 |
+
|
| 479 |
+
/* copy, b = a */
|
| 480 |
+
/*
|
| 481 |
+
mp_err mp_copy(const mp_int *a, mp_int *b) MP_WUR;
|
| 482 |
+
*/
|
| 483 |
+
|
| 484 |
+
/* inits and copies, a = b */
|
| 485 |
+
/*
|
| 486 |
+
mp_err mp_init_copy(mp_int *a, const mp_int *b) MP_WUR;
|
| 487 |
+
*/
|
| 488 |
+
|
| 489 |
+
/* trim unused digits */
|
| 490 |
+
/*
|
| 491 |
+
void mp_clamp(mp_int *a);
|
| 492 |
+
*/
|
| 493 |
+
|
| 494 |
+
/* export binary data */
|
| 495 |
+
/*
|
| 496 |
+
MP_DEPRECATED(mp_pack) mp_err mp_export(void *rop, size_t *countp, int order, size_t size,
|
| 497 |
+
int endian, size_t nails, const mp_int *op) MP_WUR;
|
| 498 |
+
*/
|
| 499 |
+
|
| 500 |
+
/* import binary data */
|
| 501 |
+
/*
|
| 502 |
+
MP_DEPRECATED(mp_unpack) mp_err mp_import(mp_int *rop, size_t count, int order,
|
| 503 |
+
size_t size, int endian, size_t nails,
|
| 504 |
+
const void *op) MP_WUR;
|
| 505 |
+
*/
|
| 506 |
+
|
| 507 |
+
/* unpack binary data */
|
| 508 |
+
/*
|
| 509 |
+
mp_err mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian,
|
| 510 |
+
size_t nails, const void *op) MP_WUR;
|
| 511 |
+
*/
|
| 512 |
+
|
| 513 |
+
/* pack binary data */
|
| 514 |
+
/*
|
| 515 |
+
size_t mp_pack_count(const mp_int *a, size_t nails, size_t size) MP_WUR;
|
| 516 |
+
*/
|
| 517 |
+
/*
|
| 518 |
+
mp_err mp_pack(void *rop, size_t maxcount, size_t *written, mp_order order, size_t size,
|
| 519 |
+
mp_endian endian, size_t nails, const mp_int *op) MP_WUR;
|
| 520 |
+
*/
|
| 521 |
+
|
| 522 |
+
/* ---> digit manipulation <--- */
|
| 523 |
+
|
| 524 |
+
/* right shift by "b" digits */
|
| 525 |
+
/*
|
| 526 |
+
void mp_rshd(mp_int *a, int b);
|
| 527 |
+
*/
|
| 528 |
+
|
| 529 |
+
/* left shift by "b" digits */
|
| 530 |
+
/*
|
| 531 |
+
mp_err mp_lshd(mp_int *a, int b) MP_WUR;
|
| 532 |
+
*/
|
| 533 |
+
|
| 534 |
+
/* c = a / 2**b, implemented as c = a >> b */
|
| 535 |
+
/*
|
| 536 |
+
mp_err mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d) MP_WUR;
|
| 537 |
+
*/
|
| 538 |
+
|
| 539 |
+
/* b = a/2 */
|
| 540 |
+
/*
|
| 541 |
+
mp_err mp_div_2(const mp_int *a, mp_int *b) MP_WUR;
|
| 542 |
+
*/
|
| 543 |
+
|
| 544 |
+
/* a/3 => 3c + d == a */
|
| 545 |
+
/*
|
| 546 |
+
mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR;
|
| 547 |
+
*/
|
| 548 |
+
|
| 549 |
+
/* c = a * 2**b, implemented as c = a << b */
|
| 550 |
+
/*
|
| 551 |
+
mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 552 |
+
*/
|
| 553 |
+
|
| 554 |
+
/* b = a*2 */
|
| 555 |
+
/*
|
| 556 |
+
mp_err mp_mul_2(const mp_int *a, mp_int *b) MP_WUR;
|
| 557 |
+
*/
|
| 558 |
+
|
| 559 |
+
/* c = a mod 2**b */
|
| 560 |
+
/*
|
| 561 |
+
mp_err mp_mod_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 562 |
+
*/
|
| 563 |
+
|
| 564 |
+
/* computes a = 2**b */
|
| 565 |
+
/*
|
| 566 |
+
mp_err mp_2expt(mp_int *a, int b) MP_WUR;
|
| 567 |
+
*/
|
| 568 |
+
|
| 569 |
+
/* Counts the number of lsbs which are zero before the first zero bit */
|
| 570 |
+
/*
|
| 571 |
+
int mp_cnt_lsb(const mp_int *a) MP_WUR;
|
| 572 |
+
*/
|
| 573 |
+
|
| 574 |
+
/* I Love Earth! */
|
| 575 |
+
|
| 576 |
+
/* makes a pseudo-random mp_int of a given size */
|
| 577 |
+
/*
|
| 578 |
+
mp_err mp_rand(mp_int *a, int digits) MP_WUR;
|
| 579 |
+
*/
|
| 580 |
+
/* makes a pseudo-random small int of a given size */
|
| 581 |
+
/*
|
| 582 |
+
MP_DEPRECATED(mp_rand) mp_err mp_rand_digit(mp_digit *r) MP_WUR;
|
| 583 |
+
*/
|
| 584 |
+
/* use custom random data source instead of source provided the platform */
|
| 585 |
+
/*
|
| 586 |
+
void mp_rand_source(mp_err(*source)(void *out, size_t size));
|
| 587 |
+
*/
|
| 588 |
+
|
| 589 |
+
#ifdef MP_PRNG_ENABLE_LTM_RNG
|
| 590 |
+
/* A last resort to provide random data on systems without any of the other
|
| 591 |
+
* implemented ways to gather entropy.
|
| 592 |
+
* It is compatible with `rng_get_bytes()` from libtomcrypt so you could
|
| 593 |
+
* provide that one and then set `ltm_rng = rng_get_bytes;` */
|
| 594 |
+
extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
|
| 595 |
+
extern void (*ltm_rng_callback)(void);
|
| 596 |
+
#endif
|
| 597 |
+
|
| 598 |
+
/* ---> binary operations <--- */
|
| 599 |
+
|
| 600 |
+
/* Checks the bit at position b and returns MP_YES
|
| 601 |
+
* if the bit is 1, MP_NO if it is 0 and MP_VAL
|
| 602 |
+
* in case of error
|
| 603 |
+
*/
|
| 604 |
+
/*
|
| 605 |
+
MP_DEPRECATED(s_mp_get_bit) int mp_get_bit(const mp_int *a, int b) MP_WUR;
|
| 606 |
+
*/
|
| 607 |
+
|
| 608 |
+
/* c = a XOR b (two complement) */
|
| 609 |
+
/*
|
| 610 |
+
MP_DEPRECATED(mp_xor) mp_err mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 611 |
+
*/
|
| 612 |
+
/*
|
| 613 |
+
mp_err mp_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 614 |
+
*/
|
| 615 |
+
|
| 616 |
+
/* c = a OR b (two complement) */
|
| 617 |
+
/*
|
| 618 |
+
MP_DEPRECATED(mp_or) mp_err mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 619 |
+
*/
|
| 620 |
+
/*
|
| 621 |
+
mp_err mp_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 622 |
+
*/
|
| 623 |
+
|
| 624 |
+
/* c = a AND b (two complement) */
|
| 625 |
+
/*
|
| 626 |
+
MP_DEPRECATED(mp_and) mp_err mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 627 |
+
*/
|
| 628 |
+
/*
|
| 629 |
+
mp_err mp_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 630 |
+
*/
|
| 631 |
+
|
| 632 |
+
/* b = ~a (bitwise not, two complement) */
|
| 633 |
+
/*
|
| 634 |
+
mp_err mp_complement(const mp_int *a, mp_int *b) MP_WUR;
|
| 635 |
+
*/
|
| 636 |
+
|
| 637 |
+
/* right shift with sign extension */
|
| 638 |
+
/*
|
| 639 |
+
MP_DEPRECATED(mp_signed_rsh) mp_err mp_tc_div_2d(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 640 |
+
*/
|
| 641 |
+
/*
|
| 642 |
+
mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c) MP_WUR;
|
| 643 |
+
*/
|
| 644 |
+
|
| 645 |
+
/* ---> Basic arithmetic <--- */
|
| 646 |
+
|
| 647 |
+
/* b = -a */
|
| 648 |
+
/*
|
| 649 |
+
mp_err mp_neg(const mp_int *a, mp_int *b) MP_WUR;
|
| 650 |
+
*/
|
| 651 |
+
|
| 652 |
+
/* b = |a| */
|
| 653 |
+
/*
|
| 654 |
+
mp_err mp_abs(const mp_int *a, mp_int *b) MP_WUR;
|
| 655 |
+
*/
|
| 656 |
+
|
| 657 |
+
/* compare a to b */
|
| 658 |
+
/*
|
| 659 |
+
mp_ord mp_cmp(const mp_int *a, const mp_int *b) MP_WUR;
|
| 660 |
+
*/
|
| 661 |
+
|
| 662 |
+
/* compare |a| to |b| */
|
| 663 |
+
/*
|
| 664 |
+
mp_ord mp_cmp_mag(const mp_int *a, const mp_int *b) MP_WUR;
|
| 665 |
+
*/
|
| 666 |
+
|
| 667 |
+
/* c = a + b */
|
| 668 |
+
/*
|
| 669 |
+
mp_err mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 670 |
+
*/
|
| 671 |
+
|
| 672 |
+
/* c = a - b */
|
| 673 |
+
/*
|
| 674 |
+
mp_err mp_sub(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 675 |
+
*/
|
| 676 |
+
|
| 677 |
+
/* c = a * b */
|
| 678 |
+
/*
|
| 679 |
+
mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 680 |
+
*/
|
| 681 |
+
|
| 682 |
+
/* b = a*a */
|
| 683 |
+
/*
|
| 684 |
+
mp_err mp_sqr(const mp_int *a, mp_int *b) MP_WUR;
|
| 685 |
+
*/
|
| 686 |
+
|
| 687 |
+
/* a/b => cb + d == a */
|
| 688 |
+
/*
|
| 689 |
+
mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) MP_WUR;
|
| 690 |
+
*/
|
| 691 |
+
|
| 692 |
+
/* c = a mod b, 0 <= c < b */
|
| 693 |
+
/*
|
| 694 |
+
mp_err mp_mod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 695 |
+
*/
|
| 696 |
+
|
| 697 |
+
/* Increment "a" by one like "a++". Changes input! */
|
| 698 |
+
/*
|
| 699 |
+
mp_err mp_incr(mp_int *a) MP_WUR;
|
| 700 |
+
*/
|
| 701 |
+
|
| 702 |
+
/* Decrement "a" by one like "a--". Changes input! */
|
| 703 |
+
/*
|
| 704 |
+
mp_err mp_decr(mp_int *a) MP_WUR;
|
| 705 |
+
*/
|
| 706 |
+
|
| 707 |
+
/* ---> single digit functions <--- */
|
| 708 |
+
|
| 709 |
+
/* compare against a single digit */
|
| 710 |
+
/*
|
| 711 |
+
mp_ord mp_cmp_d(const mp_int *a, mp_digit b) MP_WUR;
|
| 712 |
+
*/
|
| 713 |
+
|
| 714 |
+
/* c = a + b */
|
| 715 |
+
/*
|
| 716 |
+
mp_err mp_add_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 717 |
+
*/
|
| 718 |
+
|
| 719 |
+
/* c = a - b */
|
| 720 |
+
/*
|
| 721 |
+
mp_err mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 722 |
+
*/
|
| 723 |
+
|
| 724 |
+
/* c = a * b */
|
| 725 |
+
/*
|
| 726 |
+
mp_err mp_mul_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 727 |
+
*/
|
| 728 |
+
|
| 729 |
+
/* a/b => cb + d == a */
|
| 730 |
+
/*
|
| 731 |
+
mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d) MP_WUR;
|
| 732 |
+
*/
|
| 733 |
+
|
| 734 |
+
/* c = a mod b, 0 <= c < b */
|
| 735 |
+
/*
|
| 736 |
+
mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c) MP_WUR;
|
| 737 |
+
*/
|
| 738 |
+
|
| 739 |
+
/* ---> number theory <--- */
|
| 740 |
+
|
| 741 |
+
/* d = a + b (mod c) */
|
| 742 |
+
/*
|
| 743 |
+
mp_err mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
|
| 744 |
+
*/
|
| 745 |
+
|
| 746 |
+
/* d = a - b (mod c) */
|
| 747 |
+
/*
|
| 748 |
+
mp_err mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
|
| 749 |
+
*/
|
| 750 |
+
|
| 751 |
+
/* d = a * b (mod c) */
|
| 752 |
+
/*
|
| 753 |
+
mp_err mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR;
|
| 754 |
+
*/
|
| 755 |
+
|
| 756 |
+
/* c = a * a (mod b) */
|
| 757 |
+
/*
|
| 758 |
+
mp_err mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 759 |
+
*/
|
| 760 |
+
|
| 761 |
+
/* c = 1/a (mod b) */
|
| 762 |
+
/*
|
| 763 |
+
mp_err mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 764 |
+
*/
|
| 765 |
+
|
| 766 |
+
/* c = (a, b) */
|
| 767 |
+
/*
|
| 768 |
+
mp_err mp_gcd(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 769 |
+
*/
|
| 770 |
+
|
| 771 |
+
/* produces value such that U1*a + U2*b = U3 */
|
| 772 |
+
/*
|
| 773 |
+
mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3) MP_WUR;
|
| 774 |
+
*/
|
| 775 |
+
|
| 776 |
+
/* c = [a, b] or (a*b)/(a, b) */
|
| 777 |
+
/*
|
| 778 |
+
mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
|
| 779 |
+
*/
|
| 780 |
+
|
| 781 |
+
/* finds one of the b'th root of a, such that |c|**b <= |a|
|
| 782 |
+
*
|
| 783 |
+
* returns error if a < 0 and b is even
|
| 784 |
+
*/
|
| 785 |
+
/*
|
| 786 |
+
mp_err mp_root_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR;
|
| 787 |
+
*/
|
| 788 |
+
/*
|
| 789 |
+
MP_DEPRECATED(mp_root_u32) mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 790 |
+
*/
|
| 791 |
+
/*
|
| 792 |
+
MP_DEPRECATED(mp_root_u32) mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR;
|
| 793 |
+
*/
|
| 794 |
+
|
| 795 |
+
/* special sqrt algo */
|
| 796 |
+
/*
|
| 797 |
+
mp_err mp_sqrt(const mp_int *arg, mp_int *ret) MP_WUR;
|
| 798 |
+
*/
|
| 799 |
+
|
| 800 |
+
/* special sqrt (mod prime) */
|
| 801 |
+
/*
|
| 802 |
+
mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret) MP_WUR;
|
| 803 |
+
*/
|
| 804 |
+
|
| 805 |
+
/* is number a square? */
|
| 806 |
+
/*
|
| 807 |
+
mp_err mp_is_square(const mp_int *arg, mp_bool *ret) MP_WUR;
|
| 808 |
+
*/
|
| 809 |
+
|
| 810 |
+
/* computes the jacobi c = (a | n) (or Legendre if b is prime) */
|
| 811 |
+
/*
|
| 812 |
+
MP_DEPRECATED(mp_kronecker) mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c) MP_WUR;
|
| 813 |
+
*/
|
| 814 |
+
|
| 815 |
+
/* computes the Kronecker symbol c = (a | p) (like jacobi() but with {a,p} in Z */
|
| 816 |
+
/*
|
| 817 |
+
mp_err mp_kronecker(const mp_int *a, const mp_int *p, int *c) MP_WUR;
|
| 818 |
+
*/
|
| 819 |
+
|
| 820 |
+
/* used to setup the Barrett reduction for a given modulus b */
|
| 821 |
+
/*
|
| 822 |
+
mp_err mp_reduce_setup(mp_int *a, const mp_int *b) MP_WUR;
|
| 823 |
+
*/
|
| 824 |
+
|
| 825 |
+
/* Barrett Reduction, computes a (mod b) with a precomputed value c
|
| 826 |
+
*
|
| 827 |
+
* Assumes that 0 < x <= m*m, note if 0 > x > -(m*m) then you can merely
|
| 828 |
+
* compute the reduction as -1 * mp_reduce(mp_abs(x)) [pseudo code].
|
| 829 |
+
*/
|
| 830 |
+
/*
|
| 831 |
+
mp_err mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu) MP_WUR;
|
| 832 |
+
*/
|
| 833 |
+
|
| 834 |
+
/* setups the montgomery reduction */
|
| 835 |
+
/*
|
| 836 |
+
mp_err mp_montgomery_setup(const mp_int *n, mp_digit *rho) MP_WUR;
|
| 837 |
+
*/
|
| 838 |
+
|
| 839 |
+
/* computes a = B**n mod b without division or multiplication useful for
|
| 840 |
+
* normalizing numbers in a Montgomery system.
|
| 841 |
+
*/
|
| 842 |
+
/*
|
| 843 |
+
mp_err mp_montgomery_calc_normalization(mp_int *a, const mp_int *b) MP_WUR;
|
| 844 |
+
*/
|
| 845 |
+
|
| 846 |
+
/* computes x/R == x (mod N) via Montgomery Reduction */
|
| 847 |
+
/*
|
| 848 |
+
mp_err mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) MP_WUR;
|
| 849 |
+
*/
|
| 850 |
+
|
| 851 |
+
/* returns 1 if a is a valid DR modulus */
|
| 852 |
+
/*
|
| 853 |
+
mp_bool mp_dr_is_modulus(const mp_int *a) MP_WUR;
|
| 854 |
+
*/
|
| 855 |
+
|
| 856 |
+
/* sets the value of "d" required for mp_dr_reduce */
|
| 857 |
+
/*
|
| 858 |
+
void mp_dr_setup(const mp_int *a, mp_digit *d);
|
| 859 |
+
*/
|
| 860 |
+
|
| 861 |
+
/* reduces a modulo n using the Diminished Radix method */
|
| 862 |
+
/*
|
| 863 |
+
mp_err mp_dr_reduce(mp_int *x, const mp_int *n, mp_digit k) MP_WUR;
|
| 864 |
+
*/
|
| 865 |
+
|
| 866 |
+
/* returns true if a can be reduced with mp_reduce_2k */
|
| 867 |
+
/*
|
| 868 |
+
mp_bool mp_reduce_is_2k(const mp_int *a) MP_WUR;
|
| 869 |
+
*/
|
| 870 |
+
|
| 871 |
+
/* determines k value for 2k reduction */
|
| 872 |
+
/*
|
| 873 |
+
mp_err mp_reduce_2k_setup(const mp_int *a, mp_digit *d) MP_WUR;
|
| 874 |
+
*/
|
| 875 |
+
|
| 876 |
+
/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
|
| 877 |
+
/*
|
| 878 |
+
mp_err mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d) MP_WUR;
|
| 879 |
+
*/
|
| 880 |
+
|
| 881 |
+
/* returns true if a can be reduced with mp_reduce_2k_l */
|
| 882 |
+
/*
|
| 883 |
+
mp_bool mp_reduce_is_2k_l(const mp_int *a) MP_WUR;
|
| 884 |
+
*/
|
| 885 |
+
|
| 886 |
+
/* determines k value for 2k reduction */
|
| 887 |
+
/*
|
| 888 |
+
mp_err mp_reduce_2k_setup_l(const mp_int *a, mp_int *d) MP_WUR;
|
| 889 |
+
*/
|
| 890 |
+
|
| 891 |
+
/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */
|
| 892 |
+
/*
|
| 893 |
+
mp_err mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d) MP_WUR;
|
| 894 |
+
*/
|
| 895 |
+
|
| 896 |
+
/* Y = G**X (mod P) */
|
| 897 |
+
/*
|
| 898 |
+
mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y) MP_WUR;
|
| 899 |
+
*/
|
| 900 |
+
|
| 901 |
+
/* ---> Primes <--- */
|
| 902 |
+
|
| 903 |
+
/* number of primes */
|
| 904 |
+
#ifdef MP_8BIT
|
| 905 |
+
# define PRIVATE_MP_PRIME_TAB_SIZE 31
|
| 906 |
+
#else
|
| 907 |
+
# define PRIVATE_MP_PRIME_TAB_SIZE 256
|
| 908 |
+
#endif
|
| 909 |
+
#define PRIME_SIZE (MP_DEPRECATED_PRAGMA("PRIME_SIZE has been made internal") PRIVATE_MP_PRIME_TAB_SIZE)
|
| 910 |
+
|
| 911 |
+
/* table of first PRIME_SIZE primes */
|
| 912 |
+
#if defined(BUILD_tcl) || !defined(_WIN32)
|
| 913 |
+
MODULE_SCOPE const mp_digit ltm_prime_tab[PRIVATE_MP_PRIME_TAB_SIZE];
|
| 914 |
+
#endif
|
| 915 |
+
|
| 916 |
+
/* result=1 if a is divisible by one of the first PRIME_SIZE primes */
|
| 917 |
+
/*
|
| 918 |
+
MP_DEPRECATED(mp_prime_is_prime) mp_err mp_prime_is_divisible(const mp_int *a, mp_bool *result) MP_WUR;
|
| 919 |
+
*/
|
| 920 |
+
|
| 921 |
+
/* performs one Fermat test of "a" using base "b".
|
| 922 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 923 |
+
*/
|
| 924 |
+
/*
|
| 925 |
+
mp_err mp_prime_fermat(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR;
|
| 926 |
+
*/
|
| 927 |
+
|
| 928 |
+
/* performs one Miller-Rabin test of "a" using base "b".
|
| 929 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 930 |
+
*/
|
| 931 |
+
/*
|
| 932 |
+
mp_err mp_prime_miller_rabin(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR;
|
| 933 |
+
*/
|
| 934 |
+
|
| 935 |
+
/* This gives [for a given bit size] the number of trials required
|
| 936 |
+
* such that Miller-Rabin gives a prob of failure lower than 2^-96
|
| 937 |
+
*/
|
| 938 |
+
/*
|
| 939 |
+
int mp_prime_rabin_miller_trials(int size) MP_WUR;
|
| 940 |
+
*/
|
| 941 |
+
|
| 942 |
+
/* performs one strong Lucas-Selfridge test of "a".
|
| 943 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 944 |
+
*/
|
| 945 |
+
/*
|
| 946 |
+
mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result) MP_WUR;
|
| 947 |
+
*/
|
| 948 |
+
|
| 949 |
+
/* performs one Frobenius test of "a" as described by Paul Underwood.
|
| 950 |
+
* Sets result to 0 if composite or 1 if probable prime
|
| 951 |
+
*/
|
| 952 |
+
/*
|
| 953 |
+
mp_err mp_prime_frobenius_underwood(const mp_int *N, mp_bool *result) MP_WUR;
|
| 954 |
+
*/
|
| 955 |
+
|
| 956 |
+
/* performs t random rounds of Miller-Rabin on "a" additional to
|
| 957 |
+
* bases 2 and 3. Also performs an initial sieve of trial
|
| 958 |
+
* division. Determines if "a" is prime with probability
|
| 959 |
+
* of error no more than (1/4)**t.
|
| 960 |
+
* Both a strong Lucas-Selfridge to complete the BPSW test
|
| 961 |
+
* and a separate Frobenius test are available at compile time.
|
| 962 |
+
* With t<0 a deterministic test is run for primes up to
|
| 963 |
+
* 318665857834031151167461. With t<13 (abs(t)-13) additional
|
| 964 |
+
* tests with sequential small primes are run starting at 43.
|
| 965 |
+
* Is Fips 186.4 compliant if called with t as computed by
|
| 966 |
+
* mp_prime_rabin_miller_trials();
|
| 967 |
+
*
|
| 968 |
+
* Sets result to 1 if probably prime, 0 otherwise
|
| 969 |
+
*/
|
| 970 |
+
/*
|
| 971 |
+
mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result) MP_WUR;
|
| 972 |
+
*/
|
| 973 |
+
|
| 974 |
+
/* finds the next prime after the number "a" using "t" trials
|
| 975 |
+
* of Miller-Rabin.
|
| 976 |
+
*
|
| 977 |
+
* bbs_style = 1 means the prime must be congruent to 3 mod 4
|
| 978 |
+
*/
|
| 979 |
+
/*
|
| 980 |
+
mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style) MP_WUR;
|
| 981 |
+
*/
|
| 982 |
+
|
| 983 |
+
/* makes a truly random prime of a given size (bytes),
|
| 984 |
+
* call with bbs = 1 if you want it to be congruent to 3 mod 4
|
| 985 |
+
*
|
| 986 |
+
* You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
|
| 987 |
+
* have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
|
| 988 |
+
* so it can be NULL
|
| 989 |
+
*
|
| 990 |
+
* The prime generated will be larger than 2^(8*size).
|
| 991 |
+
*/
|
| 992 |
+
#define mp_prime_random(a, t, size, bbs, cb, dat) (MP_DEPRECATED_PRAGMA("mp_prime_random has been deprecated, use mp_prime_rand instead") mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?MP_PRIME_BBS:0, cb, dat))
|
| 993 |
+
|
| 994 |
+
/* makes a truly random prime of a given size (bits),
|
| 995 |
+
*
|
| 996 |
+
* Flags are as follows:
|
| 997 |
+
*
|
| 998 |
+
* MP_PRIME_BBS - make prime congruent to 3 mod 4
|
| 999 |
+
* MP_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies MP_PRIME_BBS)
|
| 1000 |
+
* MP_PRIME_2MSB_ON - make the 2nd highest bit one
|
| 1001 |
+
*
|
| 1002 |
+
* You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
|
| 1003 |
+
* have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
|
| 1004 |
+
* so it can be NULL
|
| 1005 |
+
*
|
| 1006 |
+
*/
|
| 1007 |
+
/*
|
| 1008 |
+
MP_DEPRECATED(mp_prime_rand) mp_err mp_prime_random_ex(mp_int *a, int t, int size, int flags,
|
| 1009 |
+
private_mp_prime_callback cb, void *dat) MP_WUR;
|
| 1010 |
+
*/
|
| 1011 |
+
/*
|
| 1012 |
+
mp_err mp_prime_rand(mp_int *a, int t, int size, int flags) MP_WUR;
|
| 1013 |
+
*/
|
| 1014 |
+
|
| 1015 |
+
/* Integer logarithm to integer base */
|
| 1016 |
+
/*
|
| 1017 |
+
mp_err mp_log_u32(const mp_int *a, unsigned int base, unsigned int *c) MP_WUR;
|
| 1018 |
+
*/
|
| 1019 |
+
|
| 1020 |
+
/* c = a**b */
|
| 1021 |
+
/*
|
| 1022 |
+
mp_err mp_expt_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR;
|
| 1023 |
+
*/
|
| 1024 |
+
/*
|
| 1025 |
+
MP_DEPRECATED(mp_expt_u32) mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
|
| 1026 |
+
*/
|
| 1027 |
+
/*
|
| 1028 |
+
MP_DEPRECATED(mp_expt_u32) mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR;
|
| 1029 |
+
*/
|
| 1030 |
+
|
| 1031 |
+
/* ---> radix conversion <--- */
|
| 1032 |
+
/*
|
| 1033 |
+
int mp_count_bits(const mp_int *a) MP_WUR;
|
| 1034 |
+
*/
|
| 1035 |
+
|
| 1036 |
+
|
| 1037 |
+
/*
|
| 1038 |
+
MP_DEPRECATED(mp_ubin_size) int mp_unsigned_bin_size(const mp_int *a) MP_WUR;
|
| 1039 |
+
*/
|
| 1040 |
+
/*
|
| 1041 |
+
MP_DEPRECATED(mp_from_ubin) mp_err mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
|
| 1042 |
+
*/
|
| 1043 |
+
/*
|
| 1044 |
+
MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin(const mp_int *a, unsigned char *b) MP_WUR;
|
| 1045 |
+
*/
|
| 1046 |
+
/*
|
| 1047 |
+
MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR;
|
| 1048 |
+
*/
|
| 1049 |
+
|
| 1050 |
+
/*
|
| 1051 |
+
MP_DEPRECATED(mp_sbin_size) int mp_signed_bin_size(const mp_int *a) MP_WUR;
|
| 1052 |
+
*/
|
| 1053 |
+
/*
|
| 1054 |
+
MP_DEPRECATED(mp_from_sbin) mp_err mp_read_signed_bin(mp_int *a, const unsigned char *b, int c) MP_WUR;
|
| 1055 |
+
*/
|
| 1056 |
+
/*
|
| 1057 |
+
MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin(const mp_int *a, unsigned char *b) MP_WUR;
|
| 1058 |
+
*/
|
| 1059 |
+
/*
|
| 1060 |
+
MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR;
|
| 1061 |
+
*/
|
| 1062 |
+
|
| 1063 |
+
/*
|
| 1064 |
+
size_t mp_ubin_size(const mp_int *a) MP_WUR;
|
| 1065 |
+
*/
|
| 1066 |
+
/*
|
| 1067 |
+
mp_err mp_from_ubin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR;
|
| 1068 |
+
*/
|
| 1069 |
+
/*
|
| 1070 |
+
mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR;
|
| 1071 |
+
*/
|
| 1072 |
+
|
| 1073 |
+
/*
|
| 1074 |
+
size_t mp_sbin_size(const mp_int *a) MP_WUR;
|
| 1075 |
+
*/
|
| 1076 |
+
/*
|
| 1077 |
+
mp_err mp_from_sbin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR;
|
| 1078 |
+
*/
|
| 1079 |
+
/*
|
| 1080 |
+
mp_err mp_to_sbin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR;
|
| 1081 |
+
*/
|
| 1082 |
+
|
| 1083 |
+
/*
|
| 1084 |
+
mp_err mp_read_radix(mp_int *a, const char *str, int radix) MP_WUR;
|
| 1085 |
+
*/
|
| 1086 |
+
/*
|
| 1087 |
+
MP_DEPRECATED(mp_to_radix) mp_err mp_toradix(const mp_int *a, char *str, int radix) MP_WUR;
|
| 1088 |
+
*/
|
| 1089 |
+
/*
|
| 1090 |
+
MP_DEPRECATED(mp_to_radix) mp_err mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen) MP_WUR;
|
| 1091 |
+
*/
|
| 1092 |
+
/*
|
| 1093 |
+
mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) MP_WUR;
|
| 1094 |
+
*/
|
| 1095 |
+
/*
|
| 1096 |
+
mp_err mp_radix_size(const mp_int *a, int radix, int *size) MP_WUR;
|
| 1097 |
+
*/
|
| 1098 |
+
|
| 1099 |
+
#ifndef MP_NO_FILE
|
| 1100 |
+
/*
|
| 1101 |
+
mp_err mp_fread(mp_int *a, int radix, FILE *stream) MP_WUR;
|
| 1102 |
+
*/
|
| 1103 |
+
/*
|
| 1104 |
+
mp_err mp_fwrite(const mp_int *a, int radix, FILE *stream) MP_WUR;
|
| 1105 |
+
*/
|
| 1106 |
+
#endif
|
| 1107 |
+
|
| 1108 |
+
#define mp_read_raw(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_signed_bin") mp_read_signed_bin((mp), (str), (len)))
|
| 1109 |
+
#define mp_raw_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_signed_bin_size") mp_signed_bin_size(mp))
|
| 1110 |
+
#define mp_toraw(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_signed_bin") mp_to_signed_bin((mp), (str)))
|
| 1111 |
+
#define mp_read_mag(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_unsigned_bin") mp_read_unsigned_bin((mp), (str), (len))
|
| 1112 |
+
#define mp_mag_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_unsigned_bin_size") mp_unsigned_bin_size(mp))
|
| 1113 |
+
#define mp_tomag(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_unsigned_bin") mp_to_unsigned_bin((mp), (str)))
|
| 1114 |
+
|
| 1115 |
+
#define mp_tobinary(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_binary") mp_toradix((M), (S), 2))
|
| 1116 |
+
#define mp_tooctal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_octal") mp_toradix((M), (S), 8))
|
| 1117 |
+
#define mp_todecimal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_decimal") mp_toradix((M), (S), 10))
|
| 1118 |
+
#define mp_tohex(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_hex") mp_toradix((M), (S), 16))
|
| 1119 |
+
|
| 1120 |
+
#define mp_to_binary(M, S, N) mp_to_radix((M), (S), (N), NULL, 2)
|
| 1121 |
+
#define mp_to_octal(M, S, N) mp_to_radix((M), (S), (N), NULL, 8)
|
| 1122 |
+
#define mp_to_decimal(M, S, N) mp_to_radix((M), (S), (N), NULL, 10)
|
| 1123 |
+
#define mp_to_hex(M, S, N) mp_to_radix((M), (S), (N), NULL, 16)
|
| 1124 |
+
|
| 1125 |
+
#ifdef __cplusplus
|
| 1126 |
+
}
|
| 1127 |
+
#endif
|
| 1128 |
+
|
| 1129 |
+
#include "tclTomMathDecls.h"
|
| 1130 |
+
|
| 1131 |
+
#endif
|
deepseek/include/tclTomMathDecls.h
ADDED
|
@@ -0,0 +1,685 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*----------------------------------------------------------------------
|
| 3 |
+
*
|
| 4 |
+
* tclTomMathDecls.h --
|
| 5 |
+
*
|
| 6 |
+
* This file contains the declarations for the 'libtommath'
|
| 7 |
+
* functions that are exported by the Tcl library.
|
| 8 |
+
*
|
| 9 |
+
* Copyright (c) 2005 by Kevin B. Kenny. All rights reserved.
|
| 10 |
+
*
|
| 11 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 12 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
#ifndef _TCLTOMMATHDECLS
|
| 16 |
+
#define _TCLTOMMATHDECLS
|
| 17 |
+
|
| 18 |
+
#include "tcl.h"
|
| 19 |
+
#ifndef BN_H_
|
| 20 |
+
#include "tclTomMath.h"
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* Define the version of the Stubs table that's exported for tommath
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
#define TCLTOMMATH_EPOCH 0
|
| 28 |
+
#define TCLTOMMATH_REVISION 0
|
| 29 |
+
|
| 30 |
+
#define Tcl_TomMath_InitStubs(interp,version) \
|
| 31 |
+
(TclTomMathInitializeStubs((interp),(version),\
|
| 32 |
+
TCLTOMMATH_EPOCH,TCLTOMMATH_REVISION))
|
| 33 |
+
|
| 34 |
+
/* Define custom memory allocation for libtommath */
|
| 35 |
+
|
| 36 |
+
/* MODULE_SCOPE void* TclBNAlloc( size_t ); */
|
| 37 |
+
#define TclBNAlloc(s) ((void*)ckalloc((size_t)(s)))
|
| 38 |
+
/* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */
|
| 39 |
+
#define TclBNCalloc(m,s) memset(ckalloc((size_t)(m)*(size_t)(s)),0,(size_t)(m)*(size_t)(s))
|
| 40 |
+
/* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */
|
| 41 |
+
#define TclBNRealloc(x,s) ((void*)ckrealloc((char*)(x),(size_t)(s)))
|
| 42 |
+
/* MODULE_SCOPE void TclBNFree( void* ); */
|
| 43 |
+
#define TclBNFree(x) (ckfree((char*)(x)))
|
| 44 |
+
|
| 45 |
+
#define MP_MALLOC(size) TclBNAlloc(size)
|
| 46 |
+
#define MP_CALLOC(nmemb, size) TclBNCalloc(nmemb, size)
|
| 47 |
+
#define MP_REALLOC(mem, oldsize, newsize) TclBNRealloc(mem, newsize)
|
| 48 |
+
#define MP_FREE(mem, size) TclBNFree(mem)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
/* Rename the global symbols in libtommath to avoid linkage conflicts */
|
| 52 |
+
|
| 53 |
+
#define bn_reverse TclBN_reverse
|
| 54 |
+
#define mp_add TclBN_mp_add
|
| 55 |
+
#define mp_add_d TclBN_mp_add_d
|
| 56 |
+
#define mp_and TclBN_mp_and
|
| 57 |
+
#define mp_clamp TclBN_mp_clamp
|
| 58 |
+
#define mp_clear TclBN_mp_clear
|
| 59 |
+
#define mp_clear_multi TclBN_mp_clear_multi
|
| 60 |
+
#define mp_cmp TclBN_mp_cmp
|
| 61 |
+
#define mp_cmp_d TclBN_mp_cmp_d
|
| 62 |
+
#define mp_cmp_mag TclBN_mp_cmp_mag
|
| 63 |
+
#define mp_cnt_lsb TclBN_mp_cnt_lsb
|
| 64 |
+
#define mp_copy TclBN_mp_copy
|
| 65 |
+
#define mp_count_bits TclBN_mp_count_bits
|
| 66 |
+
#define mp_div TclBN_mp_div
|
| 67 |
+
#define mp_div_2 TclBN_mp_div_2
|
| 68 |
+
#define mp_div_2d TclBN_mp_div_2d
|
| 69 |
+
#define mp_div_3 TclBN_mp_div_3
|
| 70 |
+
#define mp_div_d TclBN_mp_div_d
|
| 71 |
+
#define mp_exch TclBN_mp_exch
|
| 72 |
+
#define mp_expt_d TclBN_mp_expt_d
|
| 73 |
+
#define mp_expt_d_ex TclBN_mp_expt_d_ex
|
| 74 |
+
#define mp_expt_u32 TclBN_mp_expt_d
|
| 75 |
+
#define mp_get_mag_ull TclBN_mp_get_mag_ull
|
| 76 |
+
#define mp_grow TclBN_mp_grow
|
| 77 |
+
#define mp_init TclBN_mp_init
|
| 78 |
+
#define mp_init_copy TclBN_mp_init_copy
|
| 79 |
+
#define mp_init_multi TclBN_mp_init_multi
|
| 80 |
+
#define mp_init_set TclBN_mp_init_set
|
| 81 |
+
#define mp_init_set_int TclBN_mp_init_set_int
|
| 82 |
+
#define mp_init_size TclBN_mp_init_size
|
| 83 |
+
#define mp_lshd TclBN_mp_lshd
|
| 84 |
+
#define mp_mod TclBN_mp_mod
|
| 85 |
+
#define mp_mod_2d TclBN_mp_mod_2d
|
| 86 |
+
#define mp_mul TclBN_mp_mul
|
| 87 |
+
#define mp_mul_2 TclBN_mp_mul_2
|
| 88 |
+
#define mp_mul_2d TclBN_mp_mul_2d
|
| 89 |
+
#define mp_mul_d TclBN_mp_mul_d
|
| 90 |
+
#define mp_neg TclBN_mp_neg
|
| 91 |
+
#define mp_or TclBN_mp_or
|
| 92 |
+
#define mp_pack TclBN_mp_pack
|
| 93 |
+
#define mp_pack_count TclBN_mp_pack_count
|
| 94 |
+
#define mp_radix_size TclBN_mp_radix_size
|
| 95 |
+
#define mp_read_radix TclBN_mp_read_radix
|
| 96 |
+
#define mp_rshd TclBN_mp_rshd
|
| 97 |
+
#define mp_set TclBN_mp_set
|
| 98 |
+
#define mp_set_int(a,b) (TclBN_mp_set_int(a,(unsigned int)(b)),MP_OKAY)
|
| 99 |
+
#define mp_set_ll TclBN_mp_set_ll
|
| 100 |
+
#define mp_set_long(a,b) (TclBN_mp_set_int(a,b),MP_OKAY)
|
| 101 |
+
#define mp_set_ul(a,b) (void)TclBN_mp_set_int(a,b)
|
| 102 |
+
#define mp_set_ull TclBN_mp_set_ull
|
| 103 |
+
#define mp_set_u64 TclBN_mp_set_ull
|
| 104 |
+
#define mp_shrink TclBN_mp_shrink
|
| 105 |
+
#define mp_sqr TclBN_mp_sqr
|
| 106 |
+
#define mp_sqrt TclBN_mp_sqrt
|
| 107 |
+
#define mp_sub TclBN_mp_sub
|
| 108 |
+
#define mp_sub_d TclBN_mp_sub_d
|
| 109 |
+
#define mp_signed_rsh TclBN_mp_signed_rsh
|
| 110 |
+
#define mp_tc_and TclBN_mp_and
|
| 111 |
+
#define mp_tc_div_2d TclBN_mp_signed_rsh
|
| 112 |
+
#define mp_tc_or TclBN_mp_or
|
| 113 |
+
#define mp_tc_xor TclBN_mp_xor
|
| 114 |
+
#define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin
|
| 115 |
+
#define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n
|
| 116 |
+
#define mp_toradix_n TclBN_mp_toradix_n
|
| 117 |
+
#define mp_to_radix TclBN_mp_to_radix
|
| 118 |
+
#define mp_to_ubin TclBN_mp_to_ubin
|
| 119 |
+
#define mp_unpack TclBN_mp_unpack
|
| 120 |
+
#define mp_ubin_size TclBN_mp_unsigned_bin_size
|
| 121 |
+
#define mp_unsigned_bin_size(a) ((int)TclBN_mp_unsigned_bin_size(a))
|
| 122 |
+
#define mp_xor TclBN_mp_xor
|
| 123 |
+
#define mp_zero TclBN_mp_zero
|
| 124 |
+
#define s_mp_add TclBN_s_mp_add
|
| 125 |
+
#define s_mp_balance_mul TclBN_mp_balance_mul
|
| 126 |
+
#define s_mp_karatsuba_mul TclBN_mp_karatsuba_mul
|
| 127 |
+
#define s_mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
|
| 128 |
+
#define s_mp_mul_digs TclBN_s_mp_mul_digs
|
| 129 |
+
#define s_mp_mul_digs_fast TclBN_fast_s_mp_mul_digs
|
| 130 |
+
#define s_mp_reverse TclBN_s_mp_reverse
|
| 131 |
+
#define s_mp_sqr TclBN_s_mp_sqr
|
| 132 |
+
#define s_mp_sqr_fast TclBN_fast_s_mp_sqr
|
| 133 |
+
#define s_mp_sub TclBN_s_mp_sub
|
| 134 |
+
#define s_mp_toom_mul TclBN_mp_toom_mul
|
| 135 |
+
#define s_mp_toom_sqr TclBN_mp_toom_sqr
|
| 136 |
+
|
| 137 |
+
#undef TCL_STORAGE_CLASS
|
| 138 |
+
#ifdef BUILD_tcl
|
| 139 |
+
# define TCL_STORAGE_CLASS DLLEXPORT
|
| 140 |
+
#else
|
| 141 |
+
# ifdef USE_TCL_STUBS
|
| 142 |
+
# define TCL_STORAGE_CLASS
|
| 143 |
+
# else
|
| 144 |
+
# define TCL_STORAGE_CLASS DLLIMPORT
|
| 145 |
+
# endif
|
| 146 |
+
#endif
|
| 147 |
+
|
| 148 |
+
/*
|
| 149 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 150 |
+
* script. Any modifications to the function declarations below should be made
|
| 151 |
+
* in the generic/tclInt.decls script.
|
| 152 |
+
*/
|
| 153 |
+
|
| 154 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 155 |
+
|
| 156 |
+
#ifdef __cplusplus
|
| 157 |
+
extern "C" {
|
| 158 |
+
#endif
|
| 159 |
+
|
| 160 |
+
/*
|
| 161 |
+
* Exported function declarations:
|
| 162 |
+
*/
|
| 163 |
+
|
| 164 |
+
/* 0 */
|
| 165 |
+
EXTERN int TclBN_epoch(void);
|
| 166 |
+
/* 1 */
|
| 167 |
+
EXTERN int TclBN_revision(void);
|
| 168 |
+
/* 2 */
|
| 169 |
+
EXTERN mp_err TclBN_mp_add(const mp_int *a, const mp_int *b,
|
| 170 |
+
mp_int *c);
|
| 171 |
+
/* 3 */
|
| 172 |
+
EXTERN mp_err TclBN_mp_add_d(const mp_int *a, mp_digit b,
|
| 173 |
+
mp_int *c);
|
| 174 |
+
/* 4 */
|
| 175 |
+
EXTERN mp_err TclBN_mp_and(const mp_int *a, const mp_int *b,
|
| 176 |
+
mp_int *c);
|
| 177 |
+
/* 5 */
|
| 178 |
+
EXTERN void TclBN_mp_clamp(mp_int *a);
|
| 179 |
+
/* 6 */
|
| 180 |
+
EXTERN void TclBN_mp_clear(mp_int *a);
|
| 181 |
+
/* 7 */
|
| 182 |
+
EXTERN void TclBN_mp_clear_multi(mp_int *a, ...);
|
| 183 |
+
/* 8 */
|
| 184 |
+
EXTERN mp_ord TclBN_mp_cmp(const mp_int *a, const mp_int *b);
|
| 185 |
+
/* 9 */
|
| 186 |
+
EXTERN mp_ord TclBN_mp_cmp_d(const mp_int *a, mp_digit b);
|
| 187 |
+
/* 10 */
|
| 188 |
+
EXTERN mp_ord TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b);
|
| 189 |
+
/* 11 */
|
| 190 |
+
EXTERN mp_err TclBN_mp_copy(const mp_int *a, mp_int *b);
|
| 191 |
+
/* 12 */
|
| 192 |
+
EXTERN int TclBN_mp_count_bits(const mp_int *a);
|
| 193 |
+
/* 13 */
|
| 194 |
+
EXTERN mp_err TclBN_mp_div(const mp_int *a, const mp_int *b,
|
| 195 |
+
mp_int *q, mp_int *r);
|
| 196 |
+
/* 14 */
|
| 197 |
+
EXTERN mp_err TclBN_mp_div_d(const mp_int *a, mp_digit b,
|
| 198 |
+
mp_int *q, mp_digit *r);
|
| 199 |
+
/* 15 */
|
| 200 |
+
EXTERN mp_err TclBN_mp_div_2(const mp_int *a, mp_int *q);
|
| 201 |
+
/* 16 */
|
| 202 |
+
EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q,
|
| 203 |
+
mp_int *r);
|
| 204 |
+
/* 17 */
|
| 205 |
+
EXTERN mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q,
|
| 206 |
+
mp_digit *r);
|
| 207 |
+
/* 18 */
|
| 208 |
+
EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
|
| 209 |
+
/* 19 */
|
| 210 |
+
EXTERN mp_err TclBN_mp_expt_d(const mp_int *a, unsigned int b,
|
| 211 |
+
mp_int *c);
|
| 212 |
+
/* 20 */
|
| 213 |
+
EXTERN mp_err TclBN_mp_grow(mp_int *a, int size);
|
| 214 |
+
/* 21 */
|
| 215 |
+
EXTERN mp_err TclBN_mp_init(mp_int *a);
|
| 216 |
+
/* 22 */
|
| 217 |
+
EXTERN mp_err TclBN_mp_init_copy(mp_int *a, const mp_int *b);
|
| 218 |
+
/* 23 */
|
| 219 |
+
EXTERN mp_err TclBN_mp_init_multi(mp_int *a, ...);
|
| 220 |
+
/* 24 */
|
| 221 |
+
EXTERN mp_err TclBN_mp_init_set(mp_int *a, mp_digit b);
|
| 222 |
+
/* 25 */
|
| 223 |
+
EXTERN mp_err TclBN_mp_init_size(mp_int *a, int size);
|
| 224 |
+
/* 26 */
|
| 225 |
+
EXTERN mp_err TclBN_mp_lshd(mp_int *a, int shift);
|
| 226 |
+
/* 27 */
|
| 227 |
+
EXTERN mp_err TclBN_mp_mod(const mp_int *a, const mp_int *b,
|
| 228 |
+
mp_int *r);
|
| 229 |
+
/* 28 */
|
| 230 |
+
EXTERN mp_err TclBN_mp_mod_2d(const mp_int *a, int b, mp_int *r);
|
| 231 |
+
/* 29 */
|
| 232 |
+
EXTERN mp_err TclBN_mp_mul(const mp_int *a, const mp_int *b,
|
| 233 |
+
mp_int *p);
|
| 234 |
+
/* 30 */
|
| 235 |
+
EXTERN mp_err TclBN_mp_mul_d(const mp_int *a, mp_digit b,
|
| 236 |
+
mp_int *p);
|
| 237 |
+
/* 31 */
|
| 238 |
+
EXTERN mp_err TclBN_mp_mul_2(const mp_int *a, mp_int *p);
|
| 239 |
+
/* 32 */
|
| 240 |
+
EXTERN mp_err TclBN_mp_mul_2d(const mp_int *a, int d, mp_int *p);
|
| 241 |
+
/* 33 */
|
| 242 |
+
EXTERN mp_err TclBN_mp_neg(const mp_int *a, mp_int *b);
|
| 243 |
+
/* 34 */
|
| 244 |
+
EXTERN mp_err TclBN_mp_or(const mp_int *a, const mp_int *b,
|
| 245 |
+
mp_int *c);
|
| 246 |
+
/* 35 */
|
| 247 |
+
EXTERN mp_err TclBN_mp_radix_size(const mp_int *a, int radix,
|
| 248 |
+
int *size);
|
| 249 |
+
/* 36 */
|
| 250 |
+
EXTERN mp_err TclBN_mp_read_radix(mp_int *a, const char *str,
|
| 251 |
+
int radix);
|
| 252 |
+
/* 37 */
|
| 253 |
+
EXTERN void TclBN_mp_rshd(mp_int *a, int shift);
|
| 254 |
+
/* 38 */
|
| 255 |
+
EXTERN mp_err TclBN_mp_shrink(mp_int *a);
|
| 256 |
+
/* 39 */
|
| 257 |
+
EXTERN void TclBN_mp_set(mp_int *a, mp_digit b);
|
| 258 |
+
/* 40 */
|
| 259 |
+
EXTERN mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
|
| 260 |
+
/* 41 */
|
| 261 |
+
EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b);
|
| 262 |
+
/* 42 */
|
| 263 |
+
EXTERN mp_err TclBN_mp_sub(const mp_int *a, const mp_int *b,
|
| 264 |
+
mp_int *c);
|
| 265 |
+
/* 43 */
|
| 266 |
+
EXTERN mp_err TclBN_mp_sub_d(const mp_int *a, mp_digit b,
|
| 267 |
+
mp_int *c);
|
| 268 |
+
/* 44 */
|
| 269 |
+
EXTERN mp_err TclBN_mp_to_unsigned_bin(const mp_int *a,
|
| 270 |
+
unsigned char *b);
|
| 271 |
+
/* 45 */
|
| 272 |
+
EXTERN mp_err TclBN_mp_to_unsigned_bin_n(const mp_int *a,
|
| 273 |
+
unsigned char *b, unsigned long *outlen);
|
| 274 |
+
/* 46 */
|
| 275 |
+
EXTERN mp_err TclBN_mp_toradix_n(const mp_int *a, char *str,
|
| 276 |
+
int radix, int maxlen);
|
| 277 |
+
/* 47 */
|
| 278 |
+
EXTERN size_t TclBN_mp_unsigned_bin_size(const mp_int *a);
|
| 279 |
+
/* 48 */
|
| 280 |
+
EXTERN mp_err TclBN_mp_xor(const mp_int *a, const mp_int *b,
|
| 281 |
+
mp_int *c);
|
| 282 |
+
/* 49 */
|
| 283 |
+
EXTERN void TclBN_mp_zero(mp_int *a);
|
| 284 |
+
/* 50 */
|
| 285 |
+
EXTERN void TclBN_reverse(unsigned char *s, int len);
|
| 286 |
+
/* 51 */
|
| 287 |
+
EXTERN mp_err TclBN_fast_s_mp_mul_digs(const mp_int *a,
|
| 288 |
+
const mp_int *b, mp_int *c, int digs);
|
| 289 |
+
/* 52 */
|
| 290 |
+
EXTERN mp_err TclBN_fast_s_mp_sqr(const mp_int *a, mp_int *b);
|
| 291 |
+
/* 53 */
|
| 292 |
+
EXTERN mp_err TclBN_mp_karatsuba_mul(const mp_int *a,
|
| 293 |
+
const mp_int *b, mp_int *c);
|
| 294 |
+
/* 54 */
|
| 295 |
+
EXTERN mp_err TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
|
| 296 |
+
/* 55 */
|
| 297 |
+
EXTERN mp_err TclBN_mp_toom_mul(const mp_int *a, const mp_int *b,
|
| 298 |
+
mp_int *c);
|
| 299 |
+
/* 56 */
|
| 300 |
+
EXTERN mp_err TclBN_mp_toom_sqr(const mp_int *a, mp_int *b);
|
| 301 |
+
/* 57 */
|
| 302 |
+
EXTERN mp_err TclBN_s_mp_add(const mp_int *a, const mp_int *b,
|
| 303 |
+
mp_int *c);
|
| 304 |
+
/* 58 */
|
| 305 |
+
EXTERN mp_err TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b,
|
| 306 |
+
mp_int *c, int digs);
|
| 307 |
+
/* 59 */
|
| 308 |
+
EXTERN mp_err TclBN_s_mp_sqr(const mp_int *a, mp_int *b);
|
| 309 |
+
/* 60 */
|
| 310 |
+
EXTERN mp_err TclBN_s_mp_sub(const mp_int *a, const mp_int *b,
|
| 311 |
+
mp_int *c);
|
| 312 |
+
/* 61 */
|
| 313 |
+
EXTERN mp_err TclBN_mp_init_set_int(mp_int *a, unsigned long i);
|
| 314 |
+
/* 62 */
|
| 315 |
+
EXTERN mp_err TclBN_mp_set_int(mp_int *a, unsigned long i);
|
| 316 |
+
/* 63 */
|
| 317 |
+
EXTERN int TclBN_mp_cnt_lsb(const mp_int *a);
|
| 318 |
+
/* 64 */
|
| 319 |
+
EXTERN int TclBNInitBignumFromLong(mp_int *bignum, long initVal);
|
| 320 |
+
/* 65 */
|
| 321 |
+
EXTERN int TclBNInitBignumFromWideInt(mp_int *bignum,
|
| 322 |
+
Tcl_WideInt initVal);
|
| 323 |
+
/* 66 */
|
| 324 |
+
EXTERN int TclBNInitBignumFromWideUInt(mp_int *bignum,
|
| 325 |
+
Tcl_WideUInt initVal);
|
| 326 |
+
/* 67 */
|
| 327 |
+
EXTERN mp_err TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
|
| 328 |
+
mp_int *c, int fast);
|
| 329 |
+
/* 68 */
|
| 330 |
+
EXTERN void TclBN_mp_set_ull(mp_int *a, Tcl_WideUInt i);
|
| 331 |
+
/* 69 */
|
| 332 |
+
EXTERN Tcl_WideUInt TclBN_mp_get_mag_ull(const mp_int *a);
|
| 333 |
+
/* 70 */
|
| 334 |
+
EXTERN void TclBN_mp_set_ll(mp_int *a, Tcl_WideInt i);
|
| 335 |
+
/* 71 */
|
| 336 |
+
EXTERN mp_err TclBN_mp_unpack(mp_int *rop, size_t count,
|
| 337 |
+
mp_order order, size_t size,
|
| 338 |
+
mp_endian endian, size_t nails,
|
| 339 |
+
const void *op);
|
| 340 |
+
/* 72 */
|
| 341 |
+
EXTERN mp_err TclBN_mp_pack(void *rop, size_t maxcount,
|
| 342 |
+
size_t *written, mp_order order, size_t size,
|
| 343 |
+
mp_endian endian, size_t nails,
|
| 344 |
+
const mp_int *op);
|
| 345 |
+
/* 73 */
|
| 346 |
+
EXTERN mp_err TclBN_mp_tc_and(const mp_int *a, const mp_int *b,
|
| 347 |
+
mp_int *c);
|
| 348 |
+
/* 74 */
|
| 349 |
+
EXTERN mp_err TclBN_mp_tc_or(const mp_int *a, const mp_int *b,
|
| 350 |
+
mp_int *c);
|
| 351 |
+
/* 75 */
|
| 352 |
+
EXTERN mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b,
|
| 353 |
+
mp_int *c);
|
| 354 |
+
/* 76 */
|
| 355 |
+
EXTERN mp_err TclBN_mp_signed_rsh(const mp_int *a, int b,
|
| 356 |
+
mp_int *c);
|
| 357 |
+
/* 77 */
|
| 358 |
+
EXTERN size_t TclBN_mp_pack_count(const mp_int *a, size_t nails,
|
| 359 |
+
size_t size);
|
| 360 |
+
/* 78 */
|
| 361 |
+
EXTERN int TclBN_mp_to_ubin(const mp_int *a, unsigned char *buf,
|
| 362 |
+
size_t maxlen, size_t *written);
|
| 363 |
+
/* 79 */
|
| 364 |
+
EXTERN mp_err TclBN_mp_div_ld(const mp_int *a, Tcl_WideUInt b,
|
| 365 |
+
mp_int *q, Tcl_WideUInt *r);
|
| 366 |
+
/* 80 */
|
| 367 |
+
EXTERN int TclBN_mp_to_radix(const mp_int *a, char *str,
|
| 368 |
+
size_t maxlen, size_t *written, int radix);
|
| 369 |
+
|
| 370 |
+
typedef struct TclTomMathStubs {
|
| 371 |
+
int magic;
|
| 372 |
+
void *hooks;
|
| 373 |
+
|
| 374 |
+
int (*tclBN_epoch) (void); /* 0 */
|
| 375 |
+
int (*tclBN_revision) (void); /* 1 */
|
| 376 |
+
mp_err (*tclBN_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 2 */
|
| 377 |
+
mp_err (*tclBN_mp_add_d) (const mp_int *a, mp_digit b, mp_int *c); /* 3 */
|
| 378 |
+
mp_err (*tclBN_mp_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 4 */
|
| 379 |
+
void (*tclBN_mp_clamp) (mp_int *a); /* 5 */
|
| 380 |
+
void (*tclBN_mp_clear) (mp_int *a); /* 6 */
|
| 381 |
+
void (*tclBN_mp_clear_multi) (mp_int *a, ...); /* 7 */
|
| 382 |
+
mp_ord (*tclBN_mp_cmp) (const mp_int *a, const mp_int *b); /* 8 */
|
| 383 |
+
mp_ord (*tclBN_mp_cmp_d) (const mp_int *a, mp_digit b); /* 9 */
|
| 384 |
+
mp_ord (*tclBN_mp_cmp_mag) (const mp_int *a, const mp_int *b); /* 10 */
|
| 385 |
+
mp_err (*tclBN_mp_copy) (const mp_int *a, mp_int *b); /* 11 */
|
| 386 |
+
int (*tclBN_mp_count_bits) (const mp_int *a); /* 12 */
|
| 387 |
+
mp_err (*tclBN_mp_div) (const mp_int *a, const mp_int *b, mp_int *q, mp_int *r); /* 13 */
|
| 388 |
+
mp_err (*tclBN_mp_div_d) (const mp_int *a, mp_digit b, mp_int *q, mp_digit *r); /* 14 */
|
| 389 |
+
mp_err (*tclBN_mp_div_2) (const mp_int *a, mp_int *q); /* 15 */
|
| 390 |
+
mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r); /* 16 */
|
| 391 |
+
mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, mp_digit *r); /* 17 */
|
| 392 |
+
void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
|
| 393 |
+
mp_err (*tclBN_mp_expt_d) (const mp_int *a, unsigned int b, mp_int *c); /* 19 */
|
| 394 |
+
mp_err (*tclBN_mp_grow) (mp_int *a, int size); /* 20 */
|
| 395 |
+
mp_err (*tclBN_mp_init) (mp_int *a); /* 21 */
|
| 396 |
+
mp_err (*tclBN_mp_init_copy) (mp_int *a, const mp_int *b); /* 22 */
|
| 397 |
+
mp_err (*tclBN_mp_init_multi) (mp_int *a, ...); /* 23 */
|
| 398 |
+
mp_err (*tclBN_mp_init_set) (mp_int *a, mp_digit b); /* 24 */
|
| 399 |
+
mp_err (*tclBN_mp_init_size) (mp_int *a, int size); /* 25 */
|
| 400 |
+
mp_err (*tclBN_mp_lshd) (mp_int *a, int shift); /* 26 */
|
| 401 |
+
mp_err (*tclBN_mp_mod) (const mp_int *a, const mp_int *b, mp_int *r); /* 27 */
|
| 402 |
+
mp_err (*tclBN_mp_mod_2d) (const mp_int *a, int b, mp_int *r); /* 28 */
|
| 403 |
+
mp_err (*tclBN_mp_mul) (const mp_int *a, const mp_int *b, mp_int *p); /* 29 */
|
| 404 |
+
mp_err (*tclBN_mp_mul_d) (const mp_int *a, mp_digit b, mp_int *p); /* 30 */
|
| 405 |
+
mp_err (*tclBN_mp_mul_2) (const mp_int *a, mp_int *p); /* 31 */
|
| 406 |
+
mp_err (*tclBN_mp_mul_2d) (const mp_int *a, int d, mp_int *p); /* 32 */
|
| 407 |
+
mp_err (*tclBN_mp_neg) (const mp_int *a, mp_int *b); /* 33 */
|
| 408 |
+
mp_err (*tclBN_mp_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 34 */
|
| 409 |
+
mp_err (*tclBN_mp_radix_size) (const mp_int *a, int radix, int *size); /* 35 */
|
| 410 |
+
mp_err (*tclBN_mp_read_radix) (mp_int *a, const char *str, int radix); /* 36 */
|
| 411 |
+
void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
|
| 412 |
+
mp_err (*tclBN_mp_shrink) (mp_int *a); /* 38 */
|
| 413 |
+
void (*tclBN_mp_set) (mp_int *a, mp_digit b); /* 39 */
|
| 414 |
+
mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b); /* 40 */
|
| 415 |
+
mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b); /* 41 */
|
| 416 |
+
mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 42 */
|
| 417 |
+
mp_err (*tclBN_mp_sub_d) (const mp_int *a, mp_digit b, mp_int *c); /* 43 */
|
| 418 |
+
mp_err (*tclBN_mp_to_unsigned_bin) (const mp_int *a, unsigned char *b); /* 44 */
|
| 419 |
+
mp_err (*tclBN_mp_to_unsigned_bin_n) (const mp_int *a, unsigned char *b, unsigned long *outlen); /* 45 */
|
| 420 |
+
mp_err (*tclBN_mp_toradix_n) (const mp_int *a, char *str, int radix, int maxlen); /* 46 */
|
| 421 |
+
size_t (*tclBN_mp_unsigned_bin_size) (const mp_int *a); /* 47 */
|
| 422 |
+
mp_err (*tclBN_mp_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 48 */
|
| 423 |
+
void (*tclBN_mp_zero) (mp_int *a); /* 49 */
|
| 424 |
+
void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
|
| 425 |
+
mp_err (*tclBN_fast_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 51 */
|
| 426 |
+
mp_err (*tclBN_fast_s_mp_sqr) (const mp_int *a, mp_int *b); /* 52 */
|
| 427 |
+
mp_err (*tclBN_mp_karatsuba_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 53 */
|
| 428 |
+
mp_err (*tclBN_mp_karatsuba_sqr) (const mp_int *a, mp_int *b); /* 54 */
|
| 429 |
+
mp_err (*tclBN_mp_toom_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 55 */
|
| 430 |
+
mp_err (*tclBN_mp_toom_sqr) (const mp_int *a, mp_int *b); /* 56 */
|
| 431 |
+
mp_err (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
|
| 432 |
+
mp_err (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
|
| 433 |
+
mp_err (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
|
| 434 |
+
mp_err (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
|
| 435 |
+
mp_err (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
|
| 436 |
+
mp_err (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
|
| 437 |
+
int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
|
| 438 |
+
int (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
|
| 439 |
+
int (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
|
| 440 |
+
int (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
|
| 441 |
+
mp_err (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
|
| 442 |
+
void (*tclBN_mp_set_ull) (mp_int *a, Tcl_WideUInt i); /* 68 */
|
| 443 |
+
Tcl_WideUInt (*tclBN_mp_get_mag_ull) (const mp_int *a); /* 69 */
|
| 444 |
+
void (*tclBN_mp_set_ll) (mp_int *a, Tcl_WideInt i); /* 70 */
|
| 445 |
+
mp_err (*tclBN_mp_unpack) (mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian, size_t nails, const void *op); /* 71 */
|
| 446 |
+
mp_err (*tclBN_mp_pack) (void *rop, size_t maxcount, size_t *written, mp_order order, size_t size, mp_endian endian, size_t nails, const mp_int *op); /* 72 */
|
| 447 |
+
mp_err (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */
|
| 448 |
+
mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */
|
| 449 |
+
mp_err (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */
|
| 450 |
+
mp_err (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c); /* 76 */
|
| 451 |
+
size_t (*tclBN_mp_pack_count) (const mp_int *a, size_t nails, size_t size); /* 77 */
|
| 452 |
+
int (*tclBN_mp_to_ubin) (const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written); /* 78 */
|
| 453 |
+
mp_err (*tclBN_mp_div_ld) (const mp_int *a, Tcl_WideUInt b, mp_int *q, Tcl_WideUInt *r); /* 79 */
|
| 454 |
+
int (*tclBN_mp_to_radix) (const mp_int *a, char *str, size_t maxlen, size_t *written, int radix); /* 80 */
|
| 455 |
+
} TclTomMathStubs;
|
| 456 |
+
|
| 457 |
+
extern const TclTomMathStubs *tclTomMathStubsPtr;
|
| 458 |
+
|
| 459 |
+
#ifdef __cplusplus
|
| 460 |
+
}
|
| 461 |
+
#endif
|
| 462 |
+
|
| 463 |
+
#if defined(USE_TCL_STUBS)
|
| 464 |
+
|
| 465 |
+
/*
|
| 466 |
+
* Inline function declarations:
|
| 467 |
+
*/
|
| 468 |
+
|
| 469 |
+
#define TclBN_epoch \
|
| 470 |
+
(tclTomMathStubsPtr->tclBN_epoch) /* 0 */
|
| 471 |
+
#define TclBN_revision \
|
| 472 |
+
(tclTomMathStubsPtr->tclBN_revision) /* 1 */
|
| 473 |
+
#define TclBN_mp_add \
|
| 474 |
+
(tclTomMathStubsPtr->tclBN_mp_add) /* 2 */
|
| 475 |
+
#define TclBN_mp_add_d \
|
| 476 |
+
(tclTomMathStubsPtr->tclBN_mp_add_d) /* 3 */
|
| 477 |
+
#define TclBN_mp_and \
|
| 478 |
+
(tclTomMathStubsPtr->tclBN_mp_and) /* 4 */
|
| 479 |
+
#define TclBN_mp_clamp \
|
| 480 |
+
(tclTomMathStubsPtr->tclBN_mp_clamp) /* 5 */
|
| 481 |
+
#define TclBN_mp_clear \
|
| 482 |
+
(tclTomMathStubsPtr->tclBN_mp_clear) /* 6 */
|
| 483 |
+
#define TclBN_mp_clear_multi \
|
| 484 |
+
(tclTomMathStubsPtr->tclBN_mp_clear_multi) /* 7 */
|
| 485 |
+
#define TclBN_mp_cmp \
|
| 486 |
+
(tclTomMathStubsPtr->tclBN_mp_cmp) /* 8 */
|
| 487 |
+
#define TclBN_mp_cmp_d \
|
| 488 |
+
(tclTomMathStubsPtr->tclBN_mp_cmp_d) /* 9 */
|
| 489 |
+
#define TclBN_mp_cmp_mag \
|
| 490 |
+
(tclTomMathStubsPtr->tclBN_mp_cmp_mag) /* 10 */
|
| 491 |
+
#define TclBN_mp_copy \
|
| 492 |
+
(tclTomMathStubsPtr->tclBN_mp_copy) /* 11 */
|
| 493 |
+
#define TclBN_mp_count_bits \
|
| 494 |
+
(tclTomMathStubsPtr->tclBN_mp_count_bits) /* 12 */
|
| 495 |
+
#define TclBN_mp_div \
|
| 496 |
+
(tclTomMathStubsPtr->tclBN_mp_div) /* 13 */
|
| 497 |
+
#define TclBN_mp_div_d \
|
| 498 |
+
(tclTomMathStubsPtr->tclBN_mp_div_d) /* 14 */
|
| 499 |
+
#define TclBN_mp_div_2 \
|
| 500 |
+
(tclTomMathStubsPtr->tclBN_mp_div_2) /* 15 */
|
| 501 |
+
#define TclBN_mp_div_2d \
|
| 502 |
+
(tclTomMathStubsPtr->tclBN_mp_div_2d) /* 16 */
|
| 503 |
+
#define TclBN_mp_div_3 \
|
| 504 |
+
(tclTomMathStubsPtr->tclBN_mp_div_3) /* 17 */
|
| 505 |
+
#define TclBN_mp_exch \
|
| 506 |
+
(tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
|
| 507 |
+
#define TclBN_mp_expt_d \
|
| 508 |
+
(tclTomMathStubsPtr->tclBN_mp_expt_d) /* 19 */
|
| 509 |
+
#define TclBN_mp_grow \
|
| 510 |
+
(tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
|
| 511 |
+
#define TclBN_mp_init \
|
| 512 |
+
(tclTomMathStubsPtr->tclBN_mp_init) /* 21 */
|
| 513 |
+
#define TclBN_mp_init_copy \
|
| 514 |
+
(tclTomMathStubsPtr->tclBN_mp_init_copy) /* 22 */
|
| 515 |
+
#define TclBN_mp_init_multi \
|
| 516 |
+
(tclTomMathStubsPtr->tclBN_mp_init_multi) /* 23 */
|
| 517 |
+
#define TclBN_mp_init_set \
|
| 518 |
+
(tclTomMathStubsPtr->tclBN_mp_init_set) /* 24 */
|
| 519 |
+
#define TclBN_mp_init_size \
|
| 520 |
+
(tclTomMathStubsPtr->tclBN_mp_init_size) /* 25 */
|
| 521 |
+
#define TclBN_mp_lshd \
|
| 522 |
+
(tclTomMathStubsPtr->tclBN_mp_lshd) /* 26 */
|
| 523 |
+
#define TclBN_mp_mod \
|
| 524 |
+
(tclTomMathStubsPtr->tclBN_mp_mod) /* 27 */
|
| 525 |
+
#define TclBN_mp_mod_2d \
|
| 526 |
+
(tclTomMathStubsPtr->tclBN_mp_mod_2d) /* 28 */
|
| 527 |
+
#define TclBN_mp_mul \
|
| 528 |
+
(tclTomMathStubsPtr->tclBN_mp_mul) /* 29 */
|
| 529 |
+
#define TclBN_mp_mul_d \
|
| 530 |
+
(tclTomMathStubsPtr->tclBN_mp_mul_d) /* 30 */
|
| 531 |
+
#define TclBN_mp_mul_2 \
|
| 532 |
+
(tclTomMathStubsPtr->tclBN_mp_mul_2) /* 31 */
|
| 533 |
+
#define TclBN_mp_mul_2d \
|
| 534 |
+
(tclTomMathStubsPtr->tclBN_mp_mul_2d) /* 32 */
|
| 535 |
+
#define TclBN_mp_neg \
|
| 536 |
+
(tclTomMathStubsPtr->tclBN_mp_neg) /* 33 */
|
| 537 |
+
#define TclBN_mp_or \
|
| 538 |
+
(tclTomMathStubsPtr->tclBN_mp_or) /* 34 */
|
| 539 |
+
#define TclBN_mp_radix_size \
|
| 540 |
+
(tclTomMathStubsPtr->tclBN_mp_radix_size) /* 35 */
|
| 541 |
+
#define TclBN_mp_read_radix \
|
| 542 |
+
(tclTomMathStubsPtr->tclBN_mp_read_radix) /* 36 */
|
| 543 |
+
#define TclBN_mp_rshd \
|
| 544 |
+
(tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */
|
| 545 |
+
#define TclBN_mp_shrink \
|
| 546 |
+
(tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */
|
| 547 |
+
#define TclBN_mp_set \
|
| 548 |
+
(tclTomMathStubsPtr->tclBN_mp_set) /* 39 */
|
| 549 |
+
#define TclBN_mp_sqr \
|
| 550 |
+
(tclTomMathStubsPtr->tclBN_mp_sqr) /* 40 */
|
| 551 |
+
#define TclBN_mp_sqrt \
|
| 552 |
+
(tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */
|
| 553 |
+
#define TclBN_mp_sub \
|
| 554 |
+
(tclTomMathStubsPtr->tclBN_mp_sub) /* 42 */
|
| 555 |
+
#define TclBN_mp_sub_d \
|
| 556 |
+
(tclTomMathStubsPtr->tclBN_mp_sub_d) /* 43 */
|
| 557 |
+
#define TclBN_mp_to_unsigned_bin \
|
| 558 |
+
(tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin) /* 44 */
|
| 559 |
+
#define TclBN_mp_to_unsigned_bin_n \
|
| 560 |
+
(tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin_n) /* 45 */
|
| 561 |
+
#define TclBN_mp_toradix_n \
|
| 562 |
+
(tclTomMathStubsPtr->tclBN_mp_toradix_n) /* 46 */
|
| 563 |
+
#define TclBN_mp_unsigned_bin_size \
|
| 564 |
+
(tclTomMathStubsPtr->tclBN_mp_unsigned_bin_size) /* 47 */
|
| 565 |
+
#define TclBN_mp_xor \
|
| 566 |
+
(tclTomMathStubsPtr->tclBN_mp_xor) /* 48 */
|
| 567 |
+
#define TclBN_mp_zero \
|
| 568 |
+
(tclTomMathStubsPtr->tclBN_mp_zero) /* 49 */
|
| 569 |
+
#define TclBN_reverse \
|
| 570 |
+
(tclTomMathStubsPtr->tclBN_reverse) /* 50 */
|
| 571 |
+
#define TclBN_fast_s_mp_mul_digs \
|
| 572 |
+
(tclTomMathStubsPtr->tclBN_fast_s_mp_mul_digs) /* 51 */
|
| 573 |
+
#define TclBN_fast_s_mp_sqr \
|
| 574 |
+
(tclTomMathStubsPtr->tclBN_fast_s_mp_sqr) /* 52 */
|
| 575 |
+
#define TclBN_mp_karatsuba_mul \
|
| 576 |
+
(tclTomMathStubsPtr->tclBN_mp_karatsuba_mul) /* 53 */
|
| 577 |
+
#define TclBN_mp_karatsuba_sqr \
|
| 578 |
+
(tclTomMathStubsPtr->tclBN_mp_karatsuba_sqr) /* 54 */
|
| 579 |
+
#define TclBN_mp_toom_mul \
|
| 580 |
+
(tclTomMathStubsPtr->tclBN_mp_toom_mul) /* 55 */
|
| 581 |
+
#define TclBN_mp_toom_sqr \
|
| 582 |
+
(tclTomMathStubsPtr->tclBN_mp_toom_sqr) /* 56 */
|
| 583 |
+
#define TclBN_s_mp_add \
|
| 584 |
+
(tclTomMathStubsPtr->tclBN_s_mp_add) /* 57 */
|
| 585 |
+
#define TclBN_s_mp_mul_digs \
|
| 586 |
+
(tclTomMathStubsPtr->tclBN_s_mp_mul_digs) /* 58 */
|
| 587 |
+
#define TclBN_s_mp_sqr \
|
| 588 |
+
(tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */
|
| 589 |
+
#define TclBN_s_mp_sub \
|
| 590 |
+
(tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
|
| 591 |
+
#define TclBN_mp_init_set_int \
|
| 592 |
+
(tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
|
| 593 |
+
#define TclBN_mp_set_int \
|
| 594 |
+
(tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
|
| 595 |
+
#define TclBN_mp_cnt_lsb \
|
| 596 |
+
(tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
|
| 597 |
+
#define TclBNInitBignumFromLong \
|
| 598 |
+
(tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */
|
| 599 |
+
#define TclBNInitBignumFromWideInt \
|
| 600 |
+
(tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */
|
| 601 |
+
#define TclBNInitBignumFromWideUInt \
|
| 602 |
+
(tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */
|
| 603 |
+
#define TclBN_mp_expt_d_ex \
|
| 604 |
+
(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
|
| 605 |
+
#define TclBN_mp_set_ull \
|
| 606 |
+
(tclTomMathStubsPtr->tclBN_mp_set_ull) /* 68 */
|
| 607 |
+
#define TclBN_mp_get_mag_ull \
|
| 608 |
+
(tclTomMathStubsPtr->tclBN_mp_get_mag_ull) /* 69 */
|
| 609 |
+
#define TclBN_mp_set_ll \
|
| 610 |
+
(tclTomMathStubsPtr->tclBN_mp_set_ll) /* 70 */
|
| 611 |
+
#define TclBN_mp_unpack \
|
| 612 |
+
(tclTomMathStubsPtr->tclBN_mp_unpack) /* 71 */
|
| 613 |
+
#define TclBN_mp_pack \
|
| 614 |
+
(tclTomMathStubsPtr->tclBN_mp_pack) /* 72 */
|
| 615 |
+
#define TclBN_mp_tc_and \
|
| 616 |
+
(tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */
|
| 617 |
+
#define TclBN_mp_tc_or \
|
| 618 |
+
(tclTomMathStubsPtr->tclBN_mp_tc_or) /* 74 */
|
| 619 |
+
#define TclBN_mp_tc_xor \
|
| 620 |
+
(tclTomMathStubsPtr->tclBN_mp_tc_xor) /* 75 */
|
| 621 |
+
#define TclBN_mp_signed_rsh \
|
| 622 |
+
(tclTomMathStubsPtr->tclBN_mp_signed_rsh) /* 76 */
|
| 623 |
+
#define TclBN_mp_pack_count \
|
| 624 |
+
(tclTomMathStubsPtr->tclBN_mp_pack_count) /* 77 */
|
| 625 |
+
#define TclBN_mp_to_ubin \
|
| 626 |
+
(tclTomMathStubsPtr->tclBN_mp_to_ubin) /* 78 */
|
| 627 |
+
#define TclBN_mp_div_ld \
|
| 628 |
+
(tclTomMathStubsPtr->tclBN_mp_div_ld) /* 79 */
|
| 629 |
+
#define TclBN_mp_to_radix \
|
| 630 |
+
(tclTomMathStubsPtr->tclBN_mp_to_radix) /* 80 */
|
| 631 |
+
|
| 632 |
+
#endif /* defined(USE_TCL_STUBS) */
|
| 633 |
+
|
| 634 |
+
/* !END!: Do not edit above this line. */
|
| 635 |
+
|
| 636 |
+
#undef TCL_STORAGE_CLASS
|
| 637 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 638 |
+
|
| 639 |
+
#ifdef USE_TCL_STUBS
|
| 640 |
+
#undef TclBNInitBignumFromLong
|
| 641 |
+
#define TclBNInitBignumFromLong(a,b) \
|
| 642 |
+
do { \
|
| 643 |
+
(a)->dp = NULL; \
|
| 644 |
+
(void)tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(b)); \
|
| 645 |
+
if ((a)->dp == NULL) { \
|
| 646 |
+
Tcl_Panic("initialization failure in TclBNInitBignumFromLong"); \
|
| 647 |
+
} \
|
| 648 |
+
} while (0)
|
| 649 |
+
#undef TclBNInitBignumFromWideInt
|
| 650 |
+
#define TclBNInitBignumFromWideInt(a,b) \
|
| 651 |
+
do { \
|
| 652 |
+
(a)->dp = NULL; \
|
| 653 |
+
(void)tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)); \
|
| 654 |
+
if ((a)->dp == NULL) { \
|
| 655 |
+
Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt"); \
|
| 656 |
+
} \
|
| 657 |
+
} while (0)
|
| 658 |
+
#undef TclBNInitBignumFromWideUInt
|
| 659 |
+
#define TclBNInitBignumFromWideUInt(a,b) \
|
| 660 |
+
do { \
|
| 661 |
+
(a)->dp = NULL; \
|
| 662 |
+
(void)tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)); \
|
| 663 |
+
if ((a)->dp == NULL) { \
|
| 664 |
+
Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt"); \
|
| 665 |
+
} \
|
| 666 |
+
} while (0)
|
| 667 |
+
#define mp_init_i32(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(int32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 668 |
+
#define mp_init_l(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromLong((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 669 |
+
#define mp_init_ll(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 670 |
+
#define mp_init_i64(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 671 |
+
#define mp_init_u32(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(uint32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 672 |
+
#define mp_init_ul(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(unsigned long)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 673 |
+
#define mp_init_ull(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 674 |
+
#define mp_init_u64(a,b) (((a)->dp=NULL,tclTomMathStubsPtr->tclBNInitBignumFromWideUInt((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 675 |
+
#else
|
| 676 |
+
#define mp_init_i32(a,b) (((a)->dp=NULL,(TclBNInitBignumFromLong)((a),(int32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 677 |
+
#define mp_init_l(a,b) (((a)->dp=NULL,(TclBNInitBignumFromLong)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 678 |
+
#define mp_init_ll(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 679 |
+
#define mp_init_i64(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 680 |
+
#define mp_init_u32(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(uint32_t)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 681 |
+
#define mp_init_ul(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(unsigned long)(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 682 |
+
#define mp_init_ull(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 683 |
+
#define mp_init_u64(a,b) (((a)->dp=NULL,(TclBNInitBignumFromWideUInt)((a),(b)),(a)->dp)?MP_OKAY:MP_ERR)
|
| 684 |
+
#endif /* USE_TCL_STUBS */
|
| 685 |
+
#endif /* _TCLINTDECLS */
|
deepseek/include/tdbc.h
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tdbc.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of the public API for Tcl DataBase Connectivity (TDBC)
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 2006 by Kevin B. Kenny
|
| 7 |
+
*
|
| 8 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 9 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 10 |
+
*
|
| 11 |
+
* RCS: @(#) $Id$
|
| 12 |
+
*
|
| 13 |
+
*-----------------------------------------------------------------------------
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef TDBC_H_INCLUDED
|
| 17 |
+
#define TDBC_H_INCLUDED 1
|
| 18 |
+
|
| 19 |
+
#include <tcl.h>
|
| 20 |
+
|
| 21 |
+
#ifndef TDBCAPI
|
| 22 |
+
# if defined(BUILD_tdbc)
|
| 23 |
+
# define TDBCAPI MODULE_SCOPE
|
| 24 |
+
# else
|
| 25 |
+
# define TDBCAPI extern
|
| 26 |
+
# undef USE_TDBC_STUBS
|
| 27 |
+
# define USE_TDBC_STUBS 1
|
| 28 |
+
# endif
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
#ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
#if defined(BUILD_tdbc)
|
| 36 |
+
DLLEXPORT int Tdbc_Init(Tcl_Interp *interp);
|
| 37 |
+
#elif defined(STATIC_BUILD)
|
| 38 |
+
extern int Tdbc_Init(Tcl_Interp* interp);
|
| 39 |
+
#else
|
| 40 |
+
DLLIMPORT int Tdbc_Init(Tcl_Interp* interp);
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#define Tdbc_InitStubs(interp) TdbcInitializeStubs(interp, \
|
| 44 |
+
TDBC_VERSION, TDBC_STUBS_EPOCH, TDBC_STUBS_REVISION)
|
| 45 |
+
#if defined(USE_TDBC_STUBS)
|
| 46 |
+
TDBCAPI const char* TdbcInitializeStubs(
|
| 47 |
+
Tcl_Interp* interp, const char* version, int epoch, int revision);
|
| 48 |
+
#else
|
| 49 |
+
# define TdbcInitializeStubs(interp, version, epoch, revision) \
|
| 50 |
+
(Tcl_PkgRequire(interp, "tdbc", version))
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
#ifdef __cplusplus
|
| 54 |
+
}
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* TDBC_VERSION and TDBC_PATCHLEVEL here must match the ones that
|
| 59 |
+
* appear near the top of configure.ac.
|
| 60 |
+
*/
|
| 61 |
+
|
| 62 |
+
#define TDBC_VERSION "1.1"
|
| 63 |
+
#define TDBC_PATCHLEVEL "1.1.7"
|
| 64 |
+
|
| 65 |
+
/*
|
| 66 |
+
* Include the Stubs declarations for the public API, generated from
|
| 67 |
+
* tdbc.decls.
|
| 68 |
+
*/
|
| 69 |
+
|
| 70 |
+
#include "tdbcDecls.h"
|
| 71 |
+
|
| 72 |
+
#endif
|
| 73 |
+
|
| 74 |
+
/*
|
| 75 |
+
* Local Variables:
|
| 76 |
+
* mode: c
|
| 77 |
+
* c-basic-offset: 4
|
| 78 |
+
* fill-column: 78
|
| 79 |
+
* End:
|
| 80 |
+
*/
|
deepseek/include/tdbcInt.h
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tdbcInt.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of the public API for Tcl DataBase Connectivity (TDBC)
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 2006 by Kevin B. Kenny
|
| 7 |
+
*
|
| 8 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 9 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 10 |
+
*
|
| 11 |
+
* RCS: @(#) $Id$
|
| 12 |
+
*
|
| 13 |
+
*-----------------------------------------------------------------------------
|
| 14 |
+
*/
|
| 15 |
+
#ifndef TDBCINT_H_INCLUDED
|
| 16 |
+
#define TDBCINT_H_INCLUDED 1
|
| 17 |
+
|
| 18 |
+
#include "tdbc.h"
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* Used to tag functions that are only to be visible within the module being
|
| 22 |
+
* built and not outside it (where this is supported by the linker).
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
#ifndef MODULE_SCOPE
|
| 26 |
+
# ifdef __cplusplus
|
| 27 |
+
# define MODULE_SCOPE extern "C"
|
| 28 |
+
# else
|
| 29 |
+
# define MODULE_SCOPE extern
|
| 30 |
+
# endif
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#ifndef JOIN
|
| 34 |
+
# define JOIN(a,b) JOIN1(a,b)
|
| 35 |
+
# define JOIN1(a,b) a##b
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
#ifndef TCL_UNUSED
|
| 39 |
+
# if defined(__cplusplus)
|
| 40 |
+
# define TCL_UNUSED(T) T
|
| 41 |
+
# elif defined(__GNUC__) && (__GNUC__ > 2)
|
| 42 |
+
# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused))
|
| 43 |
+
# else
|
| 44 |
+
# define TCL_UNUSED(T) T JOIN(dummy, __LINE__)
|
| 45 |
+
# endif
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
/*
|
| 49 |
+
* Linkage to procedures not exported from this module
|
| 50 |
+
*/
|
| 51 |
+
|
| 52 |
+
MODULE_SCOPE int TdbcTokenizeObjCmd(void *clientData, Tcl_Interp* interp,
|
| 53 |
+
int objc, Tcl_Obj *const objv[]);
|
| 54 |
+
|
| 55 |
+
#endif
|
deepseek/include/term_entry.h
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
|
| 32 |
+
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
|
| 33 |
+
* and: Thomas E. Dickey 1998-on *
|
| 34 |
+
****************************************************************************/
|
| 35 |
+
|
| 36 |
+
/* $Id: term_entry.h,v 1.63 2022/09/24 15:04:59 tom Exp $ */
|
| 37 |
+
|
| 38 |
+
/*
|
| 39 |
+
* term_entry.h -- interface to entry-manipulation code
|
| 40 |
+
*/
|
| 41 |
+
|
| 42 |
+
#ifndef NCURSES_TERM_ENTRY_H_incl
|
| 43 |
+
#define NCURSES_TERM_ENTRY_H_incl 1
|
| 44 |
+
/* *INDENT-OFF* */
|
| 45 |
+
|
| 46 |
+
#ifdef __cplusplus
|
| 47 |
+
extern "C" {
|
| 48 |
+
#endif
|
| 49 |
+
|
| 50 |
+
#include <ncursesw/curses.h>
|
| 51 |
+
#include <ncursesw/term.h>
|
| 52 |
+
|
| 53 |
+
/*
|
| 54 |
+
* These macros may be used by programs that know about TERMTYPE:
|
| 55 |
+
*/
|
| 56 |
+
#if NCURSES_XNAMES
|
| 57 |
+
#define NUM_BOOLEANS(tp) (tp)->num_Booleans
|
| 58 |
+
#define NUM_NUMBERS(tp) (tp)->num_Numbers
|
| 59 |
+
#define NUM_STRINGS(tp) (tp)->num_Strings
|
| 60 |
+
#define EXT_NAMES(tp,i,limit,index,table) (i >= limit) ? tp->ext_Names[index] : table[i]
|
| 61 |
+
#else
|
| 62 |
+
#define NUM_BOOLEANS(tp) BOOLCOUNT
|
| 63 |
+
#define NUM_NUMBERS(tp) NUMCOUNT
|
| 64 |
+
#define NUM_STRINGS(tp) STRCOUNT
|
| 65 |
+
#define EXT_NAMES(tp,i,limit,index,table) table[i]
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
#define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
|
| 69 |
+
|
| 70 |
+
#define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++)
|
| 71 |
+
#define for_each_number(n,tp) for(n = 0; n < NUM_NUMBERS(tp); n++)
|
| 72 |
+
#define for_each_string(n,tp) for(n = 0; n < NUM_STRINGS(tp); n++)
|
| 73 |
+
|
| 74 |
+
#if NCURSES_XNAMES
|
| 75 |
+
#define for_each_ext_boolean(n,tp) for(n = BOOLCOUNT; (int) n < (int) NUM_BOOLEANS(tp); n++)
|
| 76 |
+
#define for_each_ext_number(n,tp) for(n = NUMCOUNT; (int) n < (int) NUM_NUMBERS(tp); n++)
|
| 77 |
+
#define for_each_ext_string(n,tp) for(n = STRCOUNT; (int) n < (int) NUM_STRINGS(tp); n++)
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
#define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names)
|
| 81 |
+
#define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
|
| 82 |
+
#define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
|
| 83 |
+
|
| 84 |
+
/*
|
| 85 |
+
* The remaining type-definitions and macros are used only internally by the
|
| 86 |
+
* ncurses utilities.
|
| 87 |
+
*/
|
| 88 |
+
#ifdef NCURSES_INTERNALS
|
| 89 |
+
|
| 90 |
+
/*
|
| 91 |
+
* see db_iterator.c - this enumeration lists the places searched for a
|
| 92 |
+
* terminal description and defines the order in which they are searched.
|
| 93 |
+
*/
|
| 94 |
+
typedef enum {
|
| 95 |
+
dbdTIC = 0, /* special, used by tic when writing entry */
|
| 96 |
+
#if NCURSES_USE_DATABASE
|
| 97 |
+
dbdEnvOnce, /* the $TERMINFO environment variable */
|
| 98 |
+
dbdHome, /* $HOME/.terminfo */
|
| 99 |
+
dbdEnvList, /* the $TERMINFO_DIRS environment variable */
|
| 100 |
+
dbdCfgList, /* the compiled-in TERMINFO_DIRS value */
|
| 101 |
+
dbdCfgOnce, /* the compiled-in TERMINFO value */
|
| 102 |
+
#endif
|
| 103 |
+
#if NCURSES_USE_TERMCAP
|
| 104 |
+
dbdEnvOnce2, /* the $TERMCAP environment variable */
|
| 105 |
+
dbdEnvList2, /* the $TERMPATH environment variable */
|
| 106 |
+
dbdCfgList2, /* the compiled-in TERMPATH */
|
| 107 |
+
#endif
|
| 108 |
+
dbdLAST
|
| 109 |
+
} DBDIRS;
|
| 110 |
+
|
| 111 |
+
#define MAX_USES 32
|
| 112 |
+
#define MAX_CROSSLINKS 16
|
| 113 |
+
|
| 114 |
+
typedef struct entry ENTRY;
|
| 115 |
+
|
| 116 |
+
typedef struct {
|
| 117 |
+
char *name;
|
| 118 |
+
ENTRY *link;
|
| 119 |
+
long line;
|
| 120 |
+
} ENTRY_USES;
|
| 121 |
+
|
| 122 |
+
struct entry {
|
| 123 |
+
TERMTYPE2 tterm;
|
| 124 |
+
unsigned nuses;
|
| 125 |
+
ENTRY_USES uses[MAX_USES];
|
| 126 |
+
int ncrosslinks;
|
| 127 |
+
ENTRY *crosslinks[MAX_CROSSLINKS];
|
| 128 |
+
long cstart;
|
| 129 |
+
long cend;
|
| 130 |
+
long startline;
|
| 131 |
+
ENTRY *next;
|
| 132 |
+
ENTRY *last;
|
| 133 |
+
};
|
| 134 |
+
|
| 135 |
+
extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head;
|
| 136 |
+
extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
|
| 137 |
+
#define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next)
|
| 138 |
+
#define for_entry_list2(qp,q0) for (qp = q0; qp; qp = qp->next)
|
| 139 |
+
|
| 140 |
+
#define MAX_LINE 132
|
| 141 |
+
|
| 142 |
+
#define NULLHOOK (bool(*)(ENTRY *))0
|
| 143 |
+
|
| 144 |
+
/*
|
| 145 |
+
* Note that WANTED and PRESENT are not simple inverses! If a capability
|
| 146 |
+
* has been explicitly cancelled, it is not considered WANTED.
|
| 147 |
+
*/
|
| 148 |
+
#define WANTED(s) ((s) == ABSENT_STRING)
|
| 149 |
+
#define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING))
|
| 150 |
+
|
| 151 |
+
#define ANDMISSING(p,q) \
|
| 152 |
+
{ \
|
| 153 |
+
if (PRESENT(p) && !PRESENT(q)) \
|
| 154 |
+
_nc_warning(#p " but no " #q); \
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
#define PAIRED(p,q) \
|
| 158 |
+
{ \
|
| 159 |
+
if (PRESENT(q) && !PRESENT(p)) \
|
| 160 |
+
_nc_warning(#q " but no " #p); \
|
| 161 |
+
if (PRESENT(p) && !PRESENT(q)) \
|
| 162 |
+
_nc_warning(#p " but no " #q); \
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
/*
|
| 166 |
+
* These entrypoints are used only by the ncurses utilities such as tic.
|
| 167 |
+
*/
|
| 168 |
+
|
| 169 |
+
/* alloc_entry.c: elementary allocation code */
|
| 170 |
+
extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp);
|
| 171 |
+
extern NCURSES_EXPORT(char *) _nc_save_str (const char *const);
|
| 172 |
+
extern NCURSES_EXPORT(void) _nc_init_entry (ENTRY *const);
|
| 173 |
+
extern NCURSES_EXPORT(void) _nc_merge_entry (ENTRY *const, ENTRY *const);
|
| 174 |
+
extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool);
|
| 175 |
+
|
| 176 |
+
/* alloc_ttype.c: elementary allocation code */
|
| 177 |
+
extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE2 *, TERMTYPE2 *);
|
| 178 |
+
|
| 179 |
+
/* free_ttype.c: elementary allocation code */
|
| 180 |
+
extern NCURSES_EXPORT(void) _nc_free_termtype1 (TERMTYPE *);
|
| 181 |
+
extern NCURSES_EXPORT(void) _nc_free_termtype2 (TERMTYPE2 *);
|
| 182 |
+
|
| 183 |
+
/* lib_termcap.c: trim sgr0 string for termcap users */
|
| 184 |
+
extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE2 *);
|
| 185 |
+
|
| 186 |
+
/* parse_entry.c: entry-parsing code */
|
| 187 |
+
#if NCURSES_XNAMES
|
| 188 |
+
extern NCURSES_EXPORT_VAR(bool) _nc_user_definable;
|
| 189 |
+
extern NCURSES_EXPORT_VAR(bool) _nc_disable_period;
|
| 190 |
+
#endif
|
| 191 |
+
extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool);
|
| 192 |
+
extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *);
|
| 193 |
+
|
| 194 |
+
/* write_entry.c: writing an entry to the file system */
|
| 195 |
+
extern NCURSES_EXPORT(void) _nc_set_writedir (const char *);
|
| 196 |
+
extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE2 *const);
|
| 197 |
+
extern NCURSES_EXPORT(int) _nc_write_object (TERMTYPE2 *, char *, unsigned *, unsigned);
|
| 198 |
+
|
| 199 |
+
/* comp_parse.c: entry list handling */
|
| 200 |
+
extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*));
|
| 201 |
+
extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *);
|
| 202 |
+
extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */
|
| 203 |
+
extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool);
|
| 204 |
+
extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *);
|
| 205 |
+
extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */
|
| 206 |
+
extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2)(TERMTYPE2 *, bool);
|
| 207 |
+
|
| 208 |
+
/* trace_xnames.c */
|
| 209 |
+
extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *);
|
| 210 |
+
|
| 211 |
+
#endif /* NCURSES_INTERNALS */
|
| 212 |
+
|
| 213 |
+
/*
|
| 214 |
+
* These entrypoints were used by tack before 1.08.
|
| 215 |
+
*/
|
| 216 |
+
|
| 217 |
+
#undef NCURSES_TACK_1_08
|
| 218 |
+
#ifdef NCURSES_INTERNALS
|
| 219 |
+
#define NCURSES_TACK_1_08 /* nothing */
|
| 220 |
+
#else
|
| 221 |
+
#define NCURSES_TACK_1_08 GCC_DEPRECATED("upgrade to tack 1.08")
|
| 222 |
+
#endif
|
| 223 |
+
|
| 224 |
+
/* alloc_ttype.c: elementary allocation code */
|
| 225 |
+
extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, const TERMTYPE *) NCURSES_TACK_1_08;
|
| 226 |
+
|
| 227 |
+
/* lib_acs.c */
|
| 228 |
+
extern NCURSES_EXPORT(void) _nc_init_acs (void) NCURSES_TACK_1_08; /* corresponds to traditional 'init_acs()' */
|
| 229 |
+
|
| 230 |
+
/* free_ttype.c: elementary allocation code */
|
| 231 |
+
extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *) NCURSES_TACK_1_08;
|
| 232 |
+
|
| 233 |
+
#ifdef __cplusplus
|
| 234 |
+
}
|
| 235 |
+
#endif
|
| 236 |
+
|
| 237 |
+
/* *INDENT-ON* */
|
| 238 |
+
|
| 239 |
+
#endif /* NCURSES_TERM_ENTRY_H_incl */
|
deepseek/include/termcap.h
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2018-2020,2021 Thomas E. Dickey *
|
| 3 |
+
* Copyright 1998-2000,2001 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
|
| 32 |
+
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
|
| 33 |
+
****************************************************************************/
|
| 34 |
+
|
| 35 |
+
/* $Id: termcap.h.in,v 1.20 2021/06/17 21:26:02 tom Exp $ */
|
| 36 |
+
|
| 37 |
+
#ifndef NCURSES_TERMCAP_H_incl
|
| 38 |
+
#define NCURSES_TERMCAP_H_incl 1
|
| 39 |
+
|
| 40 |
+
#undef NCURSES_VERSION
|
| 41 |
+
#define NCURSES_VERSION "6.4"
|
| 42 |
+
|
| 43 |
+
#include <ncursesw/ncurses_dll.h>
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C"
|
| 47 |
+
{
|
| 48 |
+
#endif /* __cplusplus */
|
| 49 |
+
|
| 50 |
+
#include <sys/types.h>
|
| 51 |
+
|
| 52 |
+
#undef NCURSES_OSPEED
|
| 53 |
+
#define NCURSES_OSPEED short
|
| 54 |
+
|
| 55 |
+
extern NCURSES_EXPORT_VAR(char) PC;
|
| 56 |
+
extern NCURSES_EXPORT_VAR(char *) UP;
|
| 57 |
+
extern NCURSES_EXPORT_VAR(char *) BC;
|
| 58 |
+
extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed;
|
| 59 |
+
|
| 60 |
+
#if !defined(NCURSES_TERM_H_incl)
|
| 61 |
+
extern NCURSES_EXPORT(char *) tgetstr (const char *, char **);
|
| 62 |
+
extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
|
| 63 |
+
extern NCURSES_EXPORT(int) tgetent (char *, const char *);
|
| 64 |
+
extern NCURSES_EXPORT(int) tgetflag (const char *);
|
| 65 |
+
extern NCURSES_EXPORT(int) tgetnum (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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/****************************************************************************
|
| 2 |
+
* Copyright 2018-2021,2022 Thomas E. Dickey *
|
| 3 |
+
* Copyright 1998-2012,2017 Free Software Foundation, Inc. *
|
| 4 |
+
* *
|
| 5 |
+
* Permission is hereby granted, free of charge, to any person obtaining a *
|
| 6 |
+
* copy of this software and associated documentation files (the *
|
| 7 |
+
* "Software"), to deal in the Software without restriction, including *
|
| 8 |
+
* without limitation the rights to use, copy, modify, merge, publish, *
|
| 9 |
+
* distribute, distribute with modifications, sublicense, and/or sell *
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is *
|
| 11 |
+
* furnished to do so, subject to the following conditions: *
|
| 12 |
+
* *
|
| 13 |
+
* The above copyright notice and this permission notice shall be included *
|
| 14 |
+
* in all copies or substantial portions of the Software. *
|
| 15 |
+
* *
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
| 17 |
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
| 18 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
| 19 |
+
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
| 20 |
+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
| 21 |
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
| 22 |
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
| 23 |
+
* *
|
| 24 |
+
* Except as contained in this notice, the name(s) of the above copyright *
|
| 25 |
+
* holders shall not be used in advertising or otherwise to promote the *
|
| 26 |
+
* sale, use or other dealings in this Software without prior written *
|
| 27 |
+
* authorization. *
|
| 28 |
+
****************************************************************************/
|
| 29 |
+
|
| 30 |
+
/****************************************************************************
|
| 31 |
+
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
|
| 32 |
+
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
|
| 33 |
+
* and: Thomas E. Dickey 1996 on *
|
| 34 |
+
****************************************************************************/
|
| 35 |
+
|
| 36 |
+
/*
|
| 37 |
+
* $Id: tic.h,v 1.86 2022/09/17 16:01:45 tom Exp $
|
| 38 |
+
* tic.h - Global variables and structures for the terminfo compiler.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
#ifndef __TIC_H
|
| 42 |
+
#define __TIC_H
|
| 43 |
+
/* *INDENT-OFF* */
|
| 44 |
+
#ifdef __cplusplus
|
| 45 |
+
extern "C" {
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
#include <ncurses_cfg.h>
|
| 49 |
+
|
| 50 |
+
#include <ncursesw/curses.h> /* for the _tracef() prototype, ERR/OK, bool defs */
|
| 51 |
+
|
| 52 |
+
/*
|
| 53 |
+
** The format of SVr2 compiled terminfo files is as follows:
|
| 54 |
+
**
|
| 55 |
+
** Header (12 bytes), containing information given below
|
| 56 |
+
** Names Section, containing the names of the terminal
|
| 57 |
+
** Boolean Section, containing the values of all of the
|
| 58 |
+
** boolean capabilities
|
| 59 |
+
** A null byte may be inserted here to make
|
| 60 |
+
** sure that the Number Section begins on an
|
| 61 |
+
** even word boundary.
|
| 62 |
+
** Number Section, containing the values of all of the numeric
|
| 63 |
+
** capabilities, each as a short integer
|
| 64 |
+
** String Section, containing short integer offsets into the
|
| 65 |
+
** String Table, one per string capability
|
| 66 |
+
** String Table, containing the actual characters of the string
|
| 67 |
+
** capabilities.
|
| 68 |
+
**
|
| 69 |
+
** In the SVr2 format, "short" means signed 16-bit numbers, which is sometimes
|
| 70 |
+
** inconvenient. The numbers are signed, to provide for absent and canceled
|
| 71 |
+
** values. ncurses6.1 introduced an extension to this compiled format, by
|
| 72 |
+
** making the Number Section a list of signed 32-bit integers.
|
| 73 |
+
**
|
| 74 |
+
** NOTE that all short integers in the file are stored using VAX/PDP-style
|
| 75 |
+
** byte-order, i.e., least-significant byte first.
|
| 76 |
+
**
|
| 77 |
+
** There is no structure definition here because it would only confuse
|
| 78 |
+
** matters. Terminfo format is a raw byte layout, not a structure
|
| 79 |
+
** dump. If you happen to be on a little-endian machine with 16-bit
|
| 80 |
+
** shorts that requires no padding between short members in a struct,
|
| 81 |
+
** then there is a natural C structure that captures the header, but
|
| 82 |
+
** not very helpfully.
|
| 83 |
+
*/
|
| 84 |
+
|
| 85 |
+
#define MAGIC 0432 /* first two bytes of a compiled entry */
|
| 86 |
+
#define MAGIC2 01036 /* first two bytes of a compiled 32-bit entry */
|
| 87 |
+
|
| 88 |
+
#undef BYTE
|
| 89 |
+
#define BYTE(p,n) (unsigned char)((p)[n])
|
| 90 |
+
|
| 91 |
+
#define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377))
|
| 92 |
+
#define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377))
|
| 93 |
+
#define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1))
|
| 94 |
+
|
| 95 |
+
#define IS_TIC_MAGIC(p) (LOW_MSB(p) == MAGIC || LOW_MSB(p) == MAGIC2)
|
| 96 |
+
|
| 97 |
+
#define quick_prefix(s) (!strncmp((s), "b64:", (size_t)4) || !strncmp((s), "hex:", (size_t)4))
|
| 98 |
+
|
| 99 |
+
/*
|
| 100 |
+
* The "maximum" here is misleading; XSI guarantees minimum values, which a
|
| 101 |
+
* given implementation may exceed.
|
| 102 |
+
*/
|
| 103 |
+
#define MAX_NAME_SIZE 512 /* maximum legal name field size (XSI:127) */
|
| 104 |
+
#define MAX_ENTRY_SIZE1 4096 /* maximum legal entry size (SVr2) */
|
| 105 |
+
#define MAX_ENTRY_SIZE2 32768 /* maximum legal entry size (ncurses6.1) */
|
| 106 |
+
|
| 107 |
+
#if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR
|
| 108 |
+
#define MAX_ENTRY_SIZE MAX_ENTRY_SIZE2
|
| 109 |
+
#else
|
| 110 |
+
#define MAX_ENTRY_SIZE MAX_ENTRY_SIZE1
|
| 111 |
+
#endif
|
| 112 |
+
|
| 113 |
+
/*
|
| 114 |
+
* The maximum size of individual name or alias is guaranteed in XSI to be at
|
| 115 |
+
* least 14, since that corresponds to the older filename lengths. Newer
|
| 116 |
+
* systems allow longer aliases, though not many terminal descriptions are
|
| 117 |
+
* written to use them. The MAX_ALIAS symbol is used for warnings.
|
| 118 |
+
*/
|
| 119 |
+
#if HAVE_LONG_FILE_NAMES
|
| 120 |
+
#define MAX_ALIAS 32 /* smaller than POSIX minimum for PATH_MAX */
|
| 121 |
+
#else
|
| 122 |
+
#define MAX_ALIAS 14 /* SVr3 filename length */
|
| 123 |
+
#endif
|
| 124 |
+
|
| 125 |
+
/* location of user's personal info directory */
|
| 126 |
+
#define PRIVATE_INFO "%s/.terminfo" /* plug getenv("HOME") into %s */
|
| 127 |
+
|
| 128 |
+
/*
|
| 129 |
+
* Some traces are designed to be used via tic's verbose option (and similar in
|
| 130 |
+
* infocmp and toe) rather than the 'trace()' function. So we use the bits
|
| 131 |
+
* above the normal trace() parameter as a debug-level.
|
| 132 |
+
*/
|
| 133 |
+
|
| 134 |
+
#define MAX_DEBUG_LEVEL 15
|
| 135 |
+
#define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT)
|
| 136 |
+
|
| 137 |
+
#define set_trace_level(n) \
|
| 138 |
+
_nc_tracing &= TRACE_MAXIMUM, \
|
| 139 |
+
_nc_tracing |= DEBUG_LEVEL(n)
|
| 140 |
+
|
| 141 |
+
#ifdef TRACE
|
| 142 |
+
#define DEBUG(n, a) if (_nc_tracing >= DEBUG_LEVEL(n)) _tracef a
|
| 143 |
+
#else
|
| 144 |
+
#define DEBUG(n, a) /*nothing*/
|
| 145 |
+
#endif
|
| 146 |
+
|
| 147 |
+
/*
|
| 148 |
+
* These are the types of tokens returned by the scanner. The first
|
| 149 |
+
* three are also used in the hash table of capability names. The scanner
|
| 150 |
+
* returns one of these values after loading the specifics into the global
|
| 151 |
+
* structure curr_token.
|
| 152 |
+
*/
|
| 153 |
+
|
| 154 |
+
#define BOOLEAN 0 /* Boolean capability */
|
| 155 |
+
#define NUMBER 1 /* Numeric capability */
|
| 156 |
+
#define STRING 2 /* String-valued capability */
|
| 157 |
+
#define CANCEL 3 /* Capability to be cancelled in following tc's */
|
| 158 |
+
#define NAMES 4 /* The names for a terminal type */
|
| 159 |
+
#define UNDEF 5 /* Undefined */
|
| 160 |
+
|
| 161 |
+
#define NO_PUSHBACK -1 /* used in pushtype to indicate no pushback */
|
| 162 |
+
|
| 163 |
+
/*
|
| 164 |
+
* The global structure in which the specific parts of a
|
| 165 |
+
* scanned token are returned.
|
| 166 |
+
*/
|
| 167 |
+
|
| 168 |
+
struct token
|
| 169 |
+
{
|
| 170 |
+
char *tk_name; /* name of capability */
|
| 171 |
+
int tk_valnumber; /* value of capability (if a number) */
|
| 172 |
+
char *tk_valstring; /* value of capability (if a string) */
|
| 173 |
+
};
|
| 174 |
+
|
| 175 |
+
/*
|
| 176 |
+
* Offsets to string capabilities, with the corresponding functionkey codes.
|
| 177 |
+
*/
|
| 178 |
+
struct tinfo_fkeys {
|
| 179 |
+
unsigned offset;
|
| 180 |
+
chtype code;
|
| 181 |
+
};
|
| 182 |
+
|
| 183 |
+
typedef short HashValue;
|
| 184 |
+
|
| 185 |
+
/*
|
| 186 |
+
* The file comp_captab.c contains an array of these structures, one per
|
| 187 |
+
* possible capability. These are indexed by a hash table array of pointers to
|
| 188 |
+
* the same structures for use by the parser.
|
| 189 |
+
*/
|
| 190 |
+
struct name_table_entry
|
| 191 |
+
{
|
| 192 |
+
const char *nte_name; /* name to hash on */
|
| 193 |
+
int nte_type; /* BOOLEAN, NUMBER or STRING */
|
| 194 |
+
HashValue nte_index; /* index of associated variable in its array */
|
| 195 |
+
HashValue nte_link; /* index in table of next hash, or -1 */
|
| 196 |
+
};
|
| 197 |
+
|
| 198 |
+
/*
|
| 199 |
+
* Use this structure to hide differences between terminfo and termcap tables.
|
| 200 |
+
*/
|
| 201 |
+
typedef struct {
|
| 202 |
+
unsigned table_size;
|
| 203 |
+
const HashValue *table_data;
|
| 204 |
+
HashValue (*hash_of)(const char *);
|
| 205 |
+
int (*compare_names)(const char *, const char *);
|
| 206 |
+
} HashData;
|
| 207 |
+
|
| 208 |
+
struct alias
|
| 209 |
+
{
|
| 210 |
+
const char *from;
|
| 211 |
+
const char *to;
|
| 212 |
+
const char *source;
|
| 213 |
+
};
|
| 214 |
+
|
| 215 |
+
#define NOTFOUND ((struct name_table_entry *) 0)
|
| 216 |
+
|
| 217 |
+
/*
|
| 218 |
+
* The file comp_userdefs.c contains an array of these structures, one per
|
| 219 |
+
* possible capability. These are indexed by a hash table array of pointers to
|
| 220 |
+
* the same structures for use by the parser.
|
| 221 |
+
*/
|
| 222 |
+
struct user_table_entry
|
| 223 |
+
{
|
| 224 |
+
const char *ute_name; /* name to hash on */
|
| 225 |
+
int ute_type; /* mask (BOOLEAN, NUMBER, STRING) */
|
| 226 |
+
unsigned ute_argc; /* number of parameters */
|
| 227 |
+
unsigned ute_args; /* bit-mask for string parameters */
|
| 228 |
+
HashValue ute_index; /* index of associated variable in its array */
|
| 229 |
+
HashValue ute_link; /* index in table of next hash, or -1 */
|
| 230 |
+
};
|
| 231 |
+
|
| 232 |
+
/*
|
| 233 |
+
* The casts are required for correct sign-propagation with systems such as
|
| 234 |
+
* AIX, IRIX64, Solaris which default to unsigned characters. The C standard
|
| 235 |
+
* leaves this detail unspecified.
|
| 236 |
+
*/
|
| 237 |
+
|
| 238 |
+
/* out-of-band values for representing absent capabilities */
|
| 239 |
+
#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */
|
| 240 |
+
#define ABSENT_NUMERIC (-1)
|
| 241 |
+
#define ABSENT_STRING (char *)0
|
| 242 |
+
|
| 243 |
+
/* out-of-band values for representing cancels */
|
| 244 |
+
#define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */
|
| 245 |
+
#define CANCELLED_NUMERIC (-2)
|
| 246 |
+
#define CANCELLED_STRING (char *)(-1)
|
| 247 |
+
|
| 248 |
+
#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */
|
| 249 |
+
#define VALID_NUMERIC(s) ((s) >= 0)
|
| 250 |
+
#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING)
|
| 251 |
+
|
| 252 |
+
/* termcap entries longer than this may break old binaries */
|
| 253 |
+
#define MAX_TERMCAP_LENGTH 1023
|
| 254 |
+
|
| 255 |
+
/* this is a documented limitation of terminfo */
|
| 256 |
+
#define MAX_TERMINFO_LENGTH 4096
|
| 257 |
+
|
| 258 |
+
#ifndef TERMINFO
|
| 259 |
+
#define TERMINFO "/usr/share/terminfo"
|
| 260 |
+
#endif
|
| 261 |
+
|
| 262 |
+
#ifdef NCURSES_TERM_ENTRY_H_incl
|
| 263 |
+
|
| 264 |
+
/*
|
| 265 |
+
* These entrypoints are used only by the ncurses utilities such as tic.
|
| 266 |
+
*/
|
| 267 |
+
#ifdef NCURSES_INTERNALS
|
| 268 |
+
/* access.c */
|
| 269 |
+
extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *);
|
| 270 |
+
extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *);
|
| 271 |
+
extern NCURSES_EXPORT(bool) _nc_is_dir_path (const char *);
|
| 272 |
+
extern NCURSES_EXPORT(bool) _nc_is_file_path (const char *);
|
| 273 |
+
extern NCURSES_EXPORT(char *) _nc_basename (char *);
|
| 274 |
+
extern NCURSES_EXPORT(char *) _nc_rootname (char *);
|
| 275 |
+
|
| 276 |
+
/* comp_captab.c */
|
| 277 |
+
extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool);
|
| 278 |
+
extern NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool);
|
| 279 |
+
extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool);
|
| 280 |
+
|
| 281 |
+
/* comp_hash.c: name lookup */
|
| 282 |
+
extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry
|
| 283 |
+
(const char *, int, bool);
|
| 284 |
+
extern NCURSES_EXPORT(struct user_table_entry const *) _nc_find_user_entry
|
| 285 |
+
(const char *);
|
| 286 |
+
|
| 287 |
+
/* comp_scan.c: lexical analysis */
|
| 288 |
+
extern NCURSES_EXPORT(int) _nc_get_token (bool);
|
| 289 |
+
extern NCURSES_EXPORT(void) _nc_panic_mode (char);
|
| 290 |
+
extern NCURSES_EXPORT(void) _nc_push_token (int);
|
| 291 |
+
extern NCURSES_EXPORT_VAR(int) _nc_curr_col;
|
| 292 |
+
extern NCURSES_EXPORT_VAR(int) _nc_curr_line;
|
| 293 |
+
extern NCURSES_EXPORT_VAR(int) _nc_syntax;
|
| 294 |
+
extern NCURSES_EXPORT_VAR(int) _nc_strict_bsd;
|
| 295 |
+
extern NCURSES_EXPORT_VAR(long) _nc_comment_end;
|
| 296 |
+
extern NCURSES_EXPORT_VAR(long) _nc_comment_start;
|
| 297 |
+
extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos;
|
| 298 |
+
extern NCURSES_EXPORT_VAR(long) _nc_start_line;
|
| 299 |
+
#define SYN_TERMINFO 0
|
| 300 |
+
#define SYN_TERMCAP 1
|
| 301 |
+
|
| 302 |
+
/* comp_error.c: warning & abort messages */
|
| 303 |
+
extern NCURSES_EXPORT(const char *) _nc_get_source (void);
|
| 304 |
+
extern GCC_NORETURN NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2);
|
| 305 |
+
extern NCURSES_EXPORT(void) _nc_get_type (char *name);
|
| 306 |
+
extern NCURSES_EXPORT(void) _nc_set_source (const char *const);
|
| 307 |
+
extern NCURSES_EXPORT(void) _nc_set_type (const char *const);
|
| 308 |
+
extern GCC_NORETURN NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2);
|
| 309 |
+
extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2);
|
| 310 |
+
extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings;
|
| 311 |
+
|
| 312 |
+
/* comp_scan.c */
|
| 313 |
+
extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token;
|
| 314 |
+
|
| 315 |
+
/* comp_userdefs.c */
|
| 316 |
+
NCURSES_EXPORT(const struct user_table_entry *) _nc_get_userdefs_table (void);
|
| 317 |
+
NCURSES_EXPORT(const HashData *) _nc_get_hash_user (void);
|
| 318 |
+
|
| 319 |
+
/* captoinfo.c: capability conversion */
|
| 320 |
+
extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const);
|
| 321 |
+
extern NCURSES_EXPORT(char *) _nc_infotocap (const char *, const char *, int const);
|
| 322 |
+
|
| 323 |
+
/* home_terminfo.c */
|
| 324 |
+
extern NCURSES_EXPORT(char *) _nc_home_terminfo (void);
|
| 325 |
+
|
| 326 |
+
/* init_keytry.c */
|
| 327 |
+
#if BROKEN_LINKER
|
| 328 |
+
#define _nc_tinfo_fkeys _nc_tinfo_fkeysf()
|
| 329 |
+
extern NCURSES_EXPORT(const struct tinfo_fkeys *) _nc_tinfo_fkeysf (void);
|
| 330 |
+
#else
|
| 331 |
+
extern NCURSES_EXPORT_VAR(const struct tinfo_fkeys) _nc_tinfo_fkeys[];
|
| 332 |
+
#endif
|
| 333 |
+
|
| 334 |
+
/* lib_tparm.c */
|
| 335 |
+
#define NUM_PARM 9
|
| 336 |
+
|
| 337 |
+
extern NCURSES_EXPORT_VAR(int) _nc_tparm_err;
|
| 338 |
+
|
| 339 |
+
extern NCURSES_EXPORT(int) _nc_tparm_analyze(TERMINAL *, const char *, char **, int *);
|
| 340 |
+
extern NCURSES_EXPORT(void) _nc_reset_tparm(TERMINAL *);
|
| 341 |
+
|
| 342 |
+
/* lib_trace.c */
|
| 343 |
+
extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
|
| 344 |
+
extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
|
| 345 |
+
extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *);
|
| 346 |
+
|
| 347 |
+
/* lib_tputs.c */
|
| 348 |
+
extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */
|
| 349 |
+
|
| 350 |
+
/* comp_main.c: compiler main */
|
| 351 |
+
extern const char * _nc_progname;
|
| 352 |
+
|
| 353 |
+
/* db_iterator.c */
|
| 354 |
+
extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *);
|
| 355 |
+
extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *);
|
| 356 |
+
extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *);
|
| 357 |
+
extern NCURSES_EXPORT(void) _nc_last_db(void);
|
| 358 |
+
|
| 359 |
+
/* write_entry.c */
|
| 360 |
+
extern NCURSES_EXPORT(int) _nc_tic_written (void);
|
| 361 |
+
|
| 362 |
+
#endif /* NCURSES_INTERNALS */
|
| 363 |
+
|
| 364 |
+
/*
|
| 365 |
+
* These entrypoints were used by tack before 1.08.
|
| 366 |
+
*/
|
| 367 |
+
|
| 368 |
+
#undef NCURSES_TACK_1_08
|
| 369 |
+
#ifdef NCURSES_INTERNALS
|
| 370 |
+
#define NCURSES_TACK_1_08 /* nothing */
|
| 371 |
+
#else
|
| 372 |
+
#define NCURSES_TACK_1_08 GCC_DEPRECATED("upgrade to tack 1.08")
|
| 373 |
+
#endif
|
| 374 |
+
|
| 375 |
+
/* comp_hash.c: name lookup */
|
| 376 |
+
extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry
|
| 377 |
+
(const char *, const HashValue *) NCURSES_TACK_1_08;
|
| 378 |
+
extern NCURSES_EXPORT(const HashValue *) _nc_get_hash_table (bool) NCURSES_TACK_1_08;
|
| 379 |
+
|
| 380 |
+
/* comp_scan.c: lexical analysis */
|
| 381 |
+
extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *) NCURSES_TACK_1_08;
|
| 382 |
+
|
| 383 |
+
/* comp_expand.c: expand string into readable form */
|
| 384 |
+
extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int) NCURSES_TACK_1_08;
|
| 385 |
+
|
| 386 |
+
/* comp_scan.c: decode string from readable form */
|
| 387 |
+
extern NCURSES_EXPORT(int) _nc_trans_string (char *, char *) NCURSES_TACK_1_08;
|
| 388 |
+
|
| 389 |
+
#endif /* NCURSES_TERM_ENTRY_H_incl */
|
| 390 |
+
|
| 391 |
+
#ifdef __cplusplus
|
| 392 |
+
}
|
| 393 |
+
#endif
|
| 394 |
+
|
| 395 |
+
/* *INDENT-ON* */
|
| 396 |
+
#endif /* __TIC_H */
|
deepseek/include/tkCanvas.h
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkCanvas.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations shared among all the files that implement canvas widgets.
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 1991-1994 The Regents of the University of California.
|
| 7 |
+
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
|
| 8 |
+
* Copyright (c) 1998 by Scriptics Corporation.
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 11 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _TKCANVAS
|
| 15 |
+
#define _TKCANVAS
|
| 16 |
+
|
| 17 |
+
#ifndef _TK
|
| 18 |
+
#include "tk.h"
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
#ifndef USE_OLD_TAG_SEARCH
|
| 22 |
+
typedef struct TagSearchExpr_s TagSearchExpr;
|
| 23 |
+
|
| 24 |
+
struct TagSearchExpr_s {
|
| 25 |
+
TagSearchExpr *next; /* For linked lists of expressions - used in
|
| 26 |
+
* bindings. */
|
| 27 |
+
Tk_Uid uid; /* The uid of the whole expression. */
|
| 28 |
+
Tk_Uid *uids; /* Expresion compiled to an array of uids. */
|
| 29 |
+
int allocated; /* Available space for array of uids. */
|
| 30 |
+
int length; /* Length of expression. */
|
| 31 |
+
int index; /* Current position in expression
|
| 32 |
+
* evaluation. */
|
| 33 |
+
int match; /* This expression matches event's item's
|
| 34 |
+
* tags. */
|
| 35 |
+
};
|
| 36 |
+
#endif /* not USE_OLD_TAG_SEARCH */
|
| 37 |
+
|
| 38 |
+
/*
|
| 39 |
+
* The record below describes a canvas widget. It is made available to the
|
| 40 |
+
* item functions so they can access certain shared fields such as the overall
|
| 41 |
+
* displacement and scale factor for the canvas.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
typedef struct TkCanvas {
|
| 45 |
+
Tk_Window tkwin; /* Window that embodies the canvas. NULL means
|
| 46 |
+
* that the window has been destroyed but the
|
| 47 |
+
* data structures haven't yet been cleaned
|
| 48 |
+
* up.*/
|
| 49 |
+
Display *display; /* Display containing widget; needed, among
|
| 50 |
+
* other things, to release resources after
|
| 51 |
+
* tkwin has already gone away. */
|
| 52 |
+
Tcl_Interp *interp; /* Interpreter associated with canvas. */
|
| 53 |
+
Tcl_Command widgetCmd; /* Token for canvas's widget command. */
|
| 54 |
+
Tk_Item *firstItemPtr; /* First in list of all items in canvas, or
|
| 55 |
+
* NULL if canvas empty. */
|
| 56 |
+
Tk_Item *lastItemPtr; /* Last in list of all items in canvas, or
|
| 57 |
+
* NULL if canvas empty. */
|
| 58 |
+
|
| 59 |
+
/*
|
| 60 |
+
* Information used when displaying widget:
|
| 61 |
+
*/
|
| 62 |
+
|
| 63 |
+
int borderWidth; /* Width of 3-D border around window. */
|
| 64 |
+
Tk_3DBorder bgBorder; /* Used for canvas background. */
|
| 65 |
+
int relief; /* Indicates whether window as a whole is
|
| 66 |
+
* raised, sunken, or flat. */
|
| 67 |
+
int highlightWidth; /* Width in pixels of highlight to draw around
|
| 68 |
+
* widget when it has the focus. <= 0 means
|
| 69 |
+
* don't draw a highlight. */
|
| 70 |
+
XColor *highlightBgColorPtr;
|
| 71 |
+
/* Color for drawing traversal highlight area
|
| 72 |
+
* when highlight is off. */
|
| 73 |
+
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
|
| 74 |
+
int inset; /* Total width of all borders, including
|
| 75 |
+
* traversal highlight and 3-D border.
|
| 76 |
+
* Indicates how much interior stuff must be
|
| 77 |
+
* offset from outside edges to leave room for
|
| 78 |
+
* borders. */
|
| 79 |
+
GC pixmapGC; /* Used to copy bits from a pixmap to the
|
| 80 |
+
* screen and also to clear the pixmap. */
|
| 81 |
+
int width, height; /* Dimensions to request for canvas window,
|
| 82 |
+
* specified in pixels. */
|
| 83 |
+
int redrawX1, redrawY1; /* Upper left corner of area to redraw, in
|
| 84 |
+
* pixel coordinates. Border pixels are
|
| 85 |
+
* included. Only valid if REDRAW_PENDING flag
|
| 86 |
+
* is set. */
|
| 87 |
+
int redrawX2, redrawY2; /* Lower right corner of area to redraw, in
|
| 88 |
+
* integer canvas coordinates. Border pixels
|
| 89 |
+
* will *not* be redrawn. */
|
| 90 |
+
int confine; /* Non-zero means constrain view to keep as
|
| 91 |
+
* much of canvas visible as possible. */
|
| 92 |
+
|
| 93 |
+
/*
|
| 94 |
+
* Information used to manage the selection and insertion cursor:
|
| 95 |
+
*/
|
| 96 |
+
|
| 97 |
+
Tk_CanvasTextInfo textInfo; /* Contains lots of fields; see tk.h for
|
| 98 |
+
* details. This structure is shared with the
|
| 99 |
+
* code that implements individual items. */
|
| 100 |
+
int insertOnTime; /* Number of milliseconds cursor should spend
|
| 101 |
+
* in "on" state for each blink. */
|
| 102 |
+
int insertOffTime; /* Number of milliseconds cursor should spend
|
| 103 |
+
* in "off" state for each blink. */
|
| 104 |
+
Tcl_TimerToken insertBlinkHandler;
|
| 105 |
+
/* Timer handler used to blink cursor on and
|
| 106 |
+
* off. */
|
| 107 |
+
|
| 108 |
+
/*
|
| 109 |
+
* Transformation applied to canvas as a whole: to compute screen
|
| 110 |
+
* coordinates (X,Y) from canvas coordinates (x,y), do the following:
|
| 111 |
+
*
|
| 112 |
+
* X = x - xOrigin;
|
| 113 |
+
* Y = y - yOrigin;
|
| 114 |
+
*/
|
| 115 |
+
|
| 116 |
+
int xOrigin, yOrigin; /* Canvas coordinates corresponding to
|
| 117 |
+
* upper-left corner of window, given in
|
| 118 |
+
* canvas pixel units. */
|
| 119 |
+
int drawableXOrigin, drawableYOrigin;
|
| 120 |
+
/* During redisplay, these fields give the
|
| 121 |
+
* canvas coordinates corresponding to the
|
| 122 |
+
* upper-left corner of the drawable where
|
| 123 |
+
* items are actually being drawn (typically a
|
| 124 |
+
* pixmap smaller than the whole window). */
|
| 125 |
+
|
| 126 |
+
/*
|
| 127 |
+
* Information used for event bindings associated with items.
|
| 128 |
+
*/
|
| 129 |
+
|
| 130 |
+
Tk_BindingTable bindingTable;
|
| 131 |
+
/* Table of all bindings currently defined for
|
| 132 |
+
* this canvas. NULL means that no bindings
|
| 133 |
+
* exist, so the table hasn't been created.
|
| 134 |
+
* Each "object" used for this table is either
|
| 135 |
+
* a Tk_Uid for a tag or the address of an
|
| 136 |
+
* item named by id. */
|
| 137 |
+
Tk_Item *currentItemPtr; /* The item currently containing the mouse
|
| 138 |
+
* pointer, or NULL if none. */
|
| 139 |
+
Tk_Item *newCurrentPtr; /* The item that is about to become the
|
| 140 |
+
* current one, or NULL. This field is used to
|
| 141 |
+
* detect deletions of the new current item
|
| 142 |
+
* pointer that occur during Leave processing
|
| 143 |
+
* of the previous current item. */
|
| 144 |
+
double closeEnough; /* The mouse is assumed to be inside an item
|
| 145 |
+
* if it is this close to it. */
|
| 146 |
+
XEvent pickEvent; /* The event upon which the current choice of
|
| 147 |
+
* currentItem is based. Must be saved so that
|
| 148 |
+
* if the currentItem is deleted, can pick
|
| 149 |
+
* another. */
|
| 150 |
+
int state; /* Last known modifier state. Used to defer
|
| 151 |
+
* picking a new current object while buttons
|
| 152 |
+
* are down. */
|
| 153 |
+
|
| 154 |
+
/*
|
| 155 |
+
* Information used for managing scrollbars:
|
| 156 |
+
*/
|
| 157 |
+
|
| 158 |
+
char *xScrollCmd; /* Command prefix for communicating with
|
| 159 |
+
* horizontal scrollbar. NULL means no
|
| 160 |
+
* horizontal scrollbar. Malloc'ed. */
|
| 161 |
+
char *yScrollCmd; /* Command prefix for communicating with
|
| 162 |
+
* vertical scrollbar. NULL means no vertical
|
| 163 |
+
* scrollbar. Malloc'ed. */
|
| 164 |
+
int scrollX1, scrollY1, scrollX2, scrollY2;
|
| 165 |
+
/* These four coordinates define the region
|
| 166 |
+
* that is the 100% area for scrolling (i.e.
|
| 167 |
+
* these numbers determine the size and
|
| 168 |
+
* location of the sliders on scrollbars).
|
| 169 |
+
* Units are pixels in canvas coords. */
|
| 170 |
+
char *regionString; /* The option string from which scrollX1 etc.
|
| 171 |
+
* are derived. Malloc'ed. */
|
| 172 |
+
int xScrollIncrement; /* If >0, defines a grid for horizontal
|
| 173 |
+
* scrolling. This is the size of the "unit",
|
| 174 |
+
* and the left edge of the screen will always
|
| 175 |
+
* lie on an even unit boundary. */
|
| 176 |
+
int yScrollIncrement; /* If >0, defines a grid for horizontal
|
| 177 |
+
* scrolling. This is the size of the "unit",
|
| 178 |
+
* and the left edge of the screen will always
|
| 179 |
+
* lie on an even unit boundary. */
|
| 180 |
+
|
| 181 |
+
/*
|
| 182 |
+
* Information used for scanning:
|
| 183 |
+
*/
|
| 184 |
+
|
| 185 |
+
int scanX; /* X-position at which scan started (e.g.
|
| 186 |
+
* button was pressed here). */
|
| 187 |
+
int scanXOrigin; /* Value of xOrigin field when scan started. */
|
| 188 |
+
int scanY; /* Y-position at which scan started (e.g.
|
| 189 |
+
* button was pressed here). */
|
| 190 |
+
int scanYOrigin; /* Value of yOrigin field when scan started. */
|
| 191 |
+
|
| 192 |
+
/*
|
| 193 |
+
* Information used to speed up searches by remembering the last item
|
| 194 |
+
* created or found with an item id search.
|
| 195 |
+
*/
|
| 196 |
+
|
| 197 |
+
Tk_Item *hotPtr; /* Pointer to "hot" item (one that's been
|
| 198 |
+
* recently used. NULL means there's no hot
|
| 199 |
+
* item. */
|
| 200 |
+
Tk_Item *hotPrevPtr; /* Pointer to predecessor to hotPtr (NULL
|
| 201 |
+
* means item is first in list). This is only
|
| 202 |
+
* a hint and may not really be hotPtr's
|
| 203 |
+
* predecessor. */
|
| 204 |
+
|
| 205 |
+
/*
|
| 206 |
+
* Miscellaneous information:
|
| 207 |
+
*/
|
| 208 |
+
|
| 209 |
+
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
|
| 210 |
+
char *takeFocus; /* Value of -takefocus option; not used in the
|
| 211 |
+
* C code, but used by keyboard traversal
|
| 212 |
+
* scripts. Malloc'ed, but may be NULL. */
|
| 213 |
+
double pixelsPerMM; /* Scale factor between MM and pixels; used
|
| 214 |
+
* when converting coordinates. */
|
| 215 |
+
int flags; /* Various flags; see below for
|
| 216 |
+
* definitions. */
|
| 217 |
+
int nextId; /* Number to use as id for next item created
|
| 218 |
+
* in widget. */
|
| 219 |
+
Tk_PostscriptInfo psInfo; /* Pointer to information used for generating
|
| 220 |
+
* Postscript for the canvas. NULL means no
|
| 221 |
+
* Postscript is currently being generated. */
|
| 222 |
+
Tcl_HashTable idTable; /* Table of integer indices. */
|
| 223 |
+
|
| 224 |
+
/*
|
| 225 |
+
* Additional information, added by the 'dash'-patch
|
| 226 |
+
*/
|
| 227 |
+
|
| 228 |
+
void *reserved1;
|
| 229 |
+
Tk_State canvas_state; /* State of canvas. */
|
| 230 |
+
void *reserved2;
|
| 231 |
+
void *reserved3;
|
| 232 |
+
Tk_TSOffset tsoffset;
|
| 233 |
+
#ifndef USE_OLD_TAG_SEARCH
|
| 234 |
+
TagSearchExpr *bindTagExprs;/* Linked list of tag expressions used in
|
| 235 |
+
* bindings. */
|
| 236 |
+
#endif
|
| 237 |
+
} TkCanvas;
|
| 238 |
+
|
| 239 |
+
/*
|
| 240 |
+
* Flag bits for canvases:
|
| 241 |
+
*
|
| 242 |
+
* REDRAW_PENDING - 1 means a DoWhenIdle handler has already been
|
| 243 |
+
* created to redraw some or all of the canvas.
|
| 244 |
+
* REDRAW_BORDERS - 1 means that the borders need to be redrawn
|
| 245 |
+
* during the next redisplay operation.
|
| 246 |
+
* REPICK_NEEDED - 1 means DisplayCanvas should pick a new
|
| 247 |
+
* current item before redrawing the canvas.
|
| 248 |
+
* GOT_FOCUS - 1 means the focus is currently in this widget,
|
| 249 |
+
* so should draw the insertion cursor and
|
| 250 |
+
* traversal highlight.
|
| 251 |
+
* CURSOR_ON - 1 means the insertion cursor is in the "on"
|
| 252 |
+
* phase of its blink cycle. 0 means either we
|
| 253 |
+
* don't have the focus or the cursor is in the
|
| 254 |
+
* "off" phase of its cycle.
|
| 255 |
+
* UPDATE_SCROLLBARS - 1 means the scrollbars should get updated as
|
| 256 |
+
* part of the next display operation.
|
| 257 |
+
* LEFT_GRABBED_ITEM - 1 means that the mouse left the current item
|
| 258 |
+
* while a grab was in effect, so we didn't
|
| 259 |
+
* change canvasPtr->currentItemPtr.
|
| 260 |
+
* REPICK_IN_PROGRESS - 1 means PickCurrentItem is currently
|
| 261 |
+
* executing. If it should be called recursively,
|
| 262 |
+
* it should simply return immediately.
|
| 263 |
+
* BBOX_NOT_EMPTY - 1 means that the bounding box of the area that
|
| 264 |
+
* should be redrawn is not empty.
|
| 265 |
+
*/
|
| 266 |
+
|
| 267 |
+
#define REDRAW_PENDING 1
|
| 268 |
+
#define REDRAW_BORDERS 2
|
| 269 |
+
#define REPICK_NEEDED 4
|
| 270 |
+
#define GOT_FOCUS 8
|
| 271 |
+
#define CURSOR_ON 0x10
|
| 272 |
+
#define UPDATE_SCROLLBARS 0x20
|
| 273 |
+
#define LEFT_GRABBED_ITEM 0x40
|
| 274 |
+
#define REPICK_IN_PROGRESS 0x100
|
| 275 |
+
#define BBOX_NOT_EMPTY 0x200
|
| 276 |
+
|
| 277 |
+
/*
|
| 278 |
+
* Flag bits for canvas items (redraw_flags):
|
| 279 |
+
*
|
| 280 |
+
* FORCE_REDRAW - 1 means that the new coordinates of some item
|
| 281 |
+
* are not yet registered using
|
| 282 |
+
* Tk_CanvasEventuallyRedraw(). It should still
|
| 283 |
+
* be done by the general canvas code.
|
| 284 |
+
*/
|
| 285 |
+
|
| 286 |
+
#define FORCE_REDRAW 8
|
| 287 |
+
|
| 288 |
+
/*
|
| 289 |
+
* Canvas-related functions that are shared among Tk modules but not exported
|
| 290 |
+
* to the outside world:
|
| 291 |
+
*/
|
| 292 |
+
|
| 293 |
+
MODULE_SCOPE int TkCanvPostscriptCmd(TkCanvas *canvasPtr,
|
| 294 |
+
Tcl_Interp *interp, int argc, const char **argv);
|
| 295 |
+
MODULE_SCOPE int TkCanvTranslatePath(TkCanvas *canvPtr,
|
| 296 |
+
int numVertex, double *coordPtr, int closed,
|
| 297 |
+
XPoint *outPtr);
|
| 298 |
+
/*
|
| 299 |
+
* Standard item types provided by Tk:
|
| 300 |
+
*/
|
| 301 |
+
|
| 302 |
+
MODULE_SCOPE Tk_ItemType tkArcType, tkBitmapType, tkImageType, tkLineType;
|
| 303 |
+
MODULE_SCOPE Tk_ItemType tkOvalType, tkPolygonType;
|
| 304 |
+
MODULE_SCOPE Tk_ItemType tkRectangleType, tkTextType, tkWindowType;
|
| 305 |
+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
+
*
|
| 6 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 7 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 8 |
+
*
|
| 9 |
+
* Copyright (c) 2002 Apple Inc.
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef _TKENTRY
|
| 13 |
+
#define _TKENTRY
|
| 14 |
+
|
| 15 |
+
#ifndef _TKINT
|
| 16 |
+
#include "tkInt.h"
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
enum EntryType {
|
| 20 |
+
TK_ENTRY, TK_SPINBOX
|
| 21 |
+
};
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* A data structure of the following type is kept for each Entry widget
|
| 25 |
+
* managed by this file:
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
typedef struct {
|
| 29 |
+
Tk_Window tkwin; /* Window that embodies the entry. NULL means
|
| 30 |
+
* that the window has been destroyed but the
|
| 31 |
+
* data structures haven't yet been cleaned
|
| 32 |
+
* up.*/
|
| 33 |
+
Display *display; /* Display containing widget. Used, among
|
| 34 |
+
* other things, so that resources can be
|
| 35 |
+
* freed even after tkwin has gone away. */
|
| 36 |
+
Tcl_Interp *interp; /* Interpreter associated with entry. */
|
| 37 |
+
Tcl_Command widgetCmd; /* Token for entry's widget command. */
|
| 38 |
+
Tk_OptionTable optionTable; /* Table that defines configuration options
|
| 39 |
+
* available for this widget. */
|
| 40 |
+
enum EntryType type; /* Specialized type of Entry widget */
|
| 41 |
+
|
| 42 |
+
/*
|
| 43 |
+
* Fields that are set by widget commands other than "configure".
|
| 44 |
+
*/
|
| 45 |
+
|
| 46 |
+
const char *string; /* Pointer to storage for string;
|
| 47 |
+
* NULL-terminated; malloc-ed. */
|
| 48 |
+
int insertPos; /* Character index before which next typed
|
| 49 |
+
* character will be inserted. */
|
| 50 |
+
|
| 51 |
+
/*
|
| 52 |
+
* Information about what's selected, if any.
|
| 53 |
+
*/
|
| 54 |
+
|
| 55 |
+
int selectFirst; /* Character index of first selected character
|
| 56 |
+
* (-1 means nothing selected. */
|
| 57 |
+
int selectLast; /* Character index just after last selected
|
| 58 |
+
* character (-1 means nothing selected. */
|
| 59 |
+
int selectAnchor; /* Fixed end of selection (i.e. "select to"
|
| 60 |
+
* operation will use this as one end of the
|
| 61 |
+
* selection). */
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* Information for scanning:
|
| 65 |
+
*/
|
| 66 |
+
|
| 67 |
+
int scanMarkX; /* X-position at which scan started (e.g.
|
| 68 |
+
* button was pressed here). */
|
| 69 |
+
int scanMarkIndex; /* Character index of character that was at
|
| 70 |
+
* left of window when scan started. */
|
| 71 |
+
|
| 72 |
+
/*
|
| 73 |
+
* Configuration settings that are updated by Tk_ConfigureWidget.
|
| 74 |
+
*/
|
| 75 |
+
|
| 76 |
+
Tk_3DBorder normalBorder; /* Used for drawing border around whole
|
| 77 |
+
* window, plus used for background. */
|
| 78 |
+
Tk_3DBorder disabledBorder; /* Used for drawing border around whole window
|
| 79 |
+
* in disabled state, plus used for
|
| 80 |
+
* background. */
|
| 81 |
+
Tk_3DBorder readonlyBorder; /* Used for drawing border around whole window
|
| 82 |
+
* in readonly state, plus used for
|
| 83 |
+
* background. */
|
| 84 |
+
int borderWidth; /* Width of 3-D border around window. */
|
| 85 |
+
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
|
| 86 |
+
int exportSelection; /* Non-zero means tie internal entry selection
|
| 87 |
+
* to X selection. */
|
| 88 |
+
Tk_Font tkfont; /* Information about text font, or NULL. */
|
| 89 |
+
XColor *fgColorPtr; /* Text color in normal mode. */
|
| 90 |
+
XColor *dfgColorPtr; /* Text color in disabled mode. */
|
| 91 |
+
XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
|
| 92 |
+
* when highlight is off. */
|
| 93 |
+
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
|
| 94 |
+
int highlightWidth; /* Width in pixels of highlight to draw around
|
| 95 |
+
* widget when it has the focus. <= 0 means
|
| 96 |
+
* don't draw a highlight. */
|
| 97 |
+
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
|
| 98 |
+
* cursor. */
|
| 99 |
+
int insertBorderWidth; /* Width of 3-D border around insert cursor. */
|
| 100 |
+
int insertOffTime; /* Number of milliseconds cursor should spend
|
| 101 |
+
* in "off" state for each blink. */
|
| 102 |
+
int insertOnTime; /* Number of milliseconds cursor should spend
|
| 103 |
+
* in "on" state for each blink. */
|
| 104 |
+
int insertWidth; /* Total width of insert cursor. */
|
| 105 |
+
Tk_Justify justify; /* Justification to use for text within
|
| 106 |
+
* window. */
|
| 107 |
+
int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
|
| 108 |
+
Tk_3DBorder selBorder; /* Border and background for selected
|
| 109 |
+
* characters. */
|
| 110 |
+
int selBorderWidth; /* Width of border around selection. */
|
| 111 |
+
XColor *selFgColorPtr; /* Foreground color for selected text. */
|
| 112 |
+
int state; /* Normal or disabled. Entry is read-only when
|
| 113 |
+
* disabled. */
|
| 114 |
+
char *textVarName; /* Name of variable (malloc'ed) or NULL. If
|
| 115 |
+
* non-NULL, entry's string tracks the
|
| 116 |
+
* contents of this variable and vice
|
| 117 |
+
* versa. */
|
| 118 |
+
char *takeFocus; /* Value of -takefocus option; not used in the
|
| 119 |
+
* C code, but used by keyboard traversal
|
| 120 |
+
* scripts. Malloc'ed, but may be NULL. */
|
| 121 |
+
int prefWidth; /* Desired width of window, measured in
|
| 122 |
+
* average characters. */
|
| 123 |
+
char *scrollCmd; /* Command prefix for communicating with
|
| 124 |
+
* scrollbar(s). Malloc'ed. NULL means no
|
| 125 |
+
* command to issue. */
|
| 126 |
+
char *showChar; /* Value of -show option. If non-NULL, first
|
| 127 |
+
* character is used for displaying all
|
| 128 |
+
* characters in entry. Malloc'ed. This is
|
| 129 |
+
* only used by the Entry widget. */
|
| 130 |
+
|
| 131 |
+
/*
|
| 132 |
+
* Fields whose values are derived from the current values of the
|
| 133 |
+
* configuration settings above.
|
| 134 |
+
*/
|
| 135 |
+
|
| 136 |
+
const char *displayString; /* String to use when displaying. This may be
|
| 137 |
+
* a pointer to string, or a pointer to
|
| 138 |
+
* malloced memory with the same character
|
| 139 |
+
* length as string but whose characters are
|
| 140 |
+
* all equal to showChar. */
|
| 141 |
+
int numBytes; /* Length of string in bytes. */
|
| 142 |
+
int numChars; /* Length of string in characters. Both string
|
| 143 |
+
* and displayString have the same character
|
| 144 |
+
* length, but may have different byte lengths
|
| 145 |
+
* due to being made from different UTF-8
|
| 146 |
+
* characters. */
|
| 147 |
+
int numDisplayBytes; /* Length of displayString in bytes. */
|
| 148 |
+
int inset; /* Number of pixels on the left and right
|
| 149 |
+
* sides that are taken up by XPAD,
|
| 150 |
+
* borderWidth (if any), and highlightWidth
|
| 151 |
+
* (if any). */
|
| 152 |
+
Tk_TextLayout textLayout; /* Cached text layout information. */
|
| 153 |
+
int layoutX, layoutY; /* Origin for layout. */
|
| 154 |
+
int leftX; /* X position at which character at leftIndex
|
| 155 |
+
* is drawn (varies depending on justify). */
|
| 156 |
+
int leftIndex; /* Character index of left-most character
|
| 157 |
+
* visible in window. */
|
| 158 |
+
Tcl_TimerToken insertBlinkHandler;
|
| 159 |
+
/* Timer handler used to blink cursor on and
|
| 160 |
+
* off. */
|
| 161 |
+
GC textGC; /* For drawing normal text. */
|
| 162 |
+
GC selTextGC; /* For drawing selected text. */
|
| 163 |
+
GC highlightGC; /* For drawing traversal highlight. */
|
| 164 |
+
int avgWidth; /* Width of average character. */
|
| 165 |
+
int xWidth; /* Extra width to reserve for widget. Used by
|
| 166 |
+
* spinboxes for button space. */
|
| 167 |
+
int flags; /* Miscellaneous flags; see below for
|
| 168 |
+
* definitions. */
|
| 169 |
+
|
| 170 |
+
int validate; /* Non-zero means try to validate */
|
| 171 |
+
char *validateCmd; /* Command prefix to use when invoking
|
| 172 |
+
* validate command. NULL means don't invoke
|
| 173 |
+
* commands. Malloc'ed. */
|
| 174 |
+
char *invalidCmd; /* Command called when a validation returns 0
|
| 175 |
+
* (successfully fails), defaults to {}. */
|
| 176 |
+
} Entry;
|
| 177 |
+
|
| 178 |
+
/*
|
| 179 |
+
* A data structure of the following type is kept for each spinbox widget
|
| 180 |
+
* managed by this file:
|
| 181 |
+
*/
|
| 182 |
+
|
| 183 |
+
typedef struct {
|
| 184 |
+
Entry entry; /* A pointer to the generic entry structure.
|
| 185 |
+
* This must be the first element of the
|
| 186 |
+
* Spinbox. */
|
| 187 |
+
|
| 188 |
+
/*
|
| 189 |
+
* Spinbox specific configuration settings.
|
| 190 |
+
*/
|
| 191 |
+
|
| 192 |
+
Tk_3DBorder activeBorder; /* Used for drawing border around active
|
| 193 |
+
* buttons. */
|
| 194 |
+
Tk_3DBorder buttonBorder; /* Used for drawing border around buttons. */
|
| 195 |
+
Tk_Cursor bCursor; /* cursor for buttons, or NULL. */
|
| 196 |
+
int bdRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
|
| 197 |
+
int buRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
|
| 198 |
+
char *command; /* Command to invoke for spin buttons. NULL
|
| 199 |
+
* means no command to issue. */
|
| 200 |
+
|
| 201 |
+
/*
|
| 202 |
+
* Spinbox specific fields for use with configuration settings above.
|
| 203 |
+
*/
|
| 204 |
+
|
| 205 |
+
int wrap; /* whether to wrap around when spinning */
|
| 206 |
+
|
| 207 |
+
int selElement; /* currently selected control */
|
| 208 |
+
int curElement; /* currently mouseover control */
|
| 209 |
+
|
| 210 |
+
int repeatDelay; /* repeat delay */
|
| 211 |
+
int repeatInterval; /* repeat interval */
|
| 212 |
+
|
| 213 |
+
double fromValue; /* Value corresponding to left/top of dial */
|
| 214 |
+
double toValue; /* Value corresponding to right/bottom of
|
| 215 |
+
* dial */
|
| 216 |
+
double increment; /* If > 0, all values are rounded to an even
|
| 217 |
+
* multiple of this value. */
|
| 218 |
+
char *formatBuf; /* string into which to format value.
|
| 219 |
+
* Malloc'ed. */
|
| 220 |
+
char *reqFormat; /* Snprintf conversion specifier used for the
|
| 221 |
+
* value that the users requests. Malloc'ed */
|
| 222 |
+
char *valueFormat; /* Snprintf conversion specifier used for the
|
| 223 |
+
* value. */
|
| 224 |
+
char digitFormat[16]; /* Snprintf conversion specifier computed from
|
| 225 |
+
* digits and other information; used for the
|
| 226 |
+
* value. */
|
| 227 |
+
|
| 228 |
+
char *valueStr; /* Values List. Malloc'ed. */
|
| 229 |
+
Tcl_Obj *listObj; /* Pointer to the list object being used */
|
| 230 |
+
int eIndex; /* Holds the current index into elements */
|
| 231 |
+
int nElements; /* Holds the current count of elements */
|
| 232 |
+
} Spinbox;
|
| 233 |
+
|
| 234 |
+
/*
|
| 235 |
+
* Assigned bits of "flags" fields of Entry structures, and what those bits
|
| 236 |
+
* mean:
|
| 237 |
+
*
|
| 238 |
+
* REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
|
| 239 |
+
* already been queued to redisplay the entry.
|
| 240 |
+
* BORDER_NEEDED: Non-zero means 3-D border must be redrawn
|
| 241 |
+
* around window during redisplay. Normally only
|
| 242 |
+
* text portion needs to be redrawn.
|
| 243 |
+
* CURSOR_ON: Non-zero means insert cursor is displayed at
|
| 244 |
+
* present. 0 means it isn't displayed.
|
| 245 |
+
* GOT_FOCUS: Non-zero means this window has the input
|
| 246 |
+
* focus.
|
| 247 |
+
* UPDATE_SCROLLBAR: Non-zero means scrollbar should be updated
|
| 248 |
+
* during next redisplay operation.
|
| 249 |
+
* GOT_SELECTION: Non-zero means we've claimed the selection.
|
| 250 |
+
* ENTRY_DELETED: This entry has been effectively destroyed.
|
| 251 |
+
* VALIDATING: Non-zero means we are in a validateCmd
|
| 252 |
+
* VALIDATE_VAR: Non-zero means we are attempting to validate
|
| 253 |
+
* the entry's textvariable with validateCmd
|
| 254 |
+
* VALIDATE_ABORT: Non-zero if validatecommand signals an abort
|
| 255 |
+
* for current procedure and make no changes
|
| 256 |
+
* ENTRY_VAR_TRACED: Non-zero if a var trace is set.
|
| 257 |
+
*/
|
| 258 |
+
|
| 259 |
+
#define REDRAW_PENDING 1
|
| 260 |
+
#define BORDER_NEEDED 2
|
| 261 |
+
#define CURSOR_ON 4
|
| 262 |
+
#define GOT_FOCUS 8
|
| 263 |
+
#define UPDATE_SCROLLBAR 0x10
|
| 264 |
+
#define GOT_SELECTION 0x20
|
| 265 |
+
#define ENTRY_DELETED 0x40
|
| 266 |
+
#define VALIDATING 0x80
|
| 267 |
+
#define VALIDATE_VAR 0x100
|
| 268 |
+
#define VALIDATE_ABORT 0x200
|
| 269 |
+
#define ENTRY_VAR_TRACED 0x400
|
| 270 |
+
|
| 271 |
+
/*
|
| 272 |
+
* The following enum is used to define a type for the -state option of the
|
| 273 |
+
* Entry widget. These values are used as indices into the string table below.
|
| 274 |
+
*/
|
| 275 |
+
|
| 276 |
+
enum state {
|
| 277 |
+
STATE_DISABLED, STATE_NORMAL, STATE_READONLY
|
| 278 |
+
};
|
| 279 |
+
|
| 280 |
+
/*
|
| 281 |
+
* This is the element index corresponding to the strings in selElementNames.
|
| 282 |
+
* If you modify them, you must modify the numbers here.
|
| 283 |
+
*/
|
| 284 |
+
|
| 285 |
+
enum selelement {
|
| 286 |
+
SEL_NONE, SEL_BUTTONDOWN, SEL_BUTTONUP, SEL_NULL, SEL_ENTRY
|
| 287 |
+
};
|
| 288 |
+
|
| 289 |
+
/*
|
| 290 |
+
* Declaration of functions used in the implementation of the native side of
|
| 291 |
+
* the Entry widget.
|
| 292 |
+
*/
|
| 293 |
+
|
| 294 |
+
MODULE_SCOPE int TkpDrawEntryBorderAndFocus(Entry *entryPtr,
|
| 295 |
+
Drawable d, int isSpinbox);
|
| 296 |
+
MODULE_SCOPE int TkpDrawSpinboxButtons(Spinbox *sbPtr, Drawable d);
|
| 297 |
+
|
| 298 |
+
#endif /* _TKENTRY */
|
deepseek/include/tkFont.h
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkFont.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations for interfaces between the generic and platform-specific
|
| 5 |
+
* parts of the font package. This information is not visible outside of
|
| 6 |
+
* the font package.
|
| 7 |
+
*
|
| 8 |
+
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 11 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _TKFONT
|
| 15 |
+
#define _TKFONT
|
| 16 |
+
|
| 17 |
+
/*
|
| 18 |
+
* The following structure keeps track of the attributes of a font. It can be
|
| 19 |
+
* used to keep track of either the desired attributes or the actual
|
| 20 |
+
* attributes gotten when the font was instantiated.
|
| 21 |
+
*/
|
| 22 |
+
|
| 23 |
+
struct TkFontAttributes {
|
| 24 |
+
Tk_Uid family; /* Font family, or NULL to represent plaform-
|
| 25 |
+
* specific default system font. */
|
| 26 |
+
double size; /* Pointsize of font, 0.0 for default size, or
|
| 27 |
+
* negative number meaning pixel size. */
|
| 28 |
+
int weight; /* Weight flag; see below for def'n. */
|
| 29 |
+
int slant; /* Slant flag; see below for def'n. */
|
| 30 |
+
int underline; /* Non-zero for underline font. */
|
| 31 |
+
int overstrike; /* Non-zero for overstrike font. */
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
/*
|
| 35 |
+
* Possible values for the "weight" field in a TkFontAttributes structure.
|
| 36 |
+
* Weight is a subjective term and depends on what the company that created
|
| 37 |
+
* the font considers bold.
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#define TK_FW_NORMAL 0
|
| 41 |
+
#define TK_FW_BOLD 1
|
| 42 |
+
|
| 43 |
+
#define TK_FW_UNKNOWN -1 /* Unknown weight. This value is used for
|
| 44 |
+
* error checking and is never actually stored
|
| 45 |
+
* in the weight field. */
|
| 46 |
+
|
| 47 |
+
/*
|
| 48 |
+
* Possible values for the "slant" field in a TkFontAttributes structure.
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
#define TK_FS_ROMAN 0
|
| 52 |
+
#define TK_FS_ITALIC 1
|
| 53 |
+
#define TK_FS_OBLIQUE 2 /* This value is only used when parsing X font
|
| 54 |
+
* names to determine the closest match. It is
|
| 55 |
+
* only stored in the XLFDAttributes
|
| 56 |
+
* structure, never in the slant field of the
|
| 57 |
+
* TkFontAttributes. */
|
| 58 |
+
|
| 59 |
+
#define TK_FS_UNKNOWN -1 /* Unknown slant. This value is used for error
|
| 60 |
+
* checking and is never actually stored in
|
| 61 |
+
* the slant field. */
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* The following structure keeps track of the metrics for an instantiated
|
| 65 |
+
* font. The metrics are the physical properties of the font itself.
|
| 66 |
+
*/
|
| 67 |
+
|
| 68 |
+
typedef struct TkFontMetrics {
|
| 69 |
+
int ascent; /* From baseline to top of font. */
|
| 70 |
+
int descent; /* From baseline to bottom of font. */
|
| 71 |
+
int maxWidth; /* Width of widest character in font. */
|
| 72 |
+
int fixed; /* Non-zero if this is a fixed-width font,
|
| 73 |
+
* 0 otherwise. */
|
| 74 |
+
} TkFontMetrics;
|
| 75 |
+
|
| 76 |
+
/*
|
| 77 |
+
* The following structure is used to keep track of the generic information
|
| 78 |
+
* about a font. Each platform-specific font is represented by a structure
|
| 79 |
+
* with the following structure at its beginning, plus any platform-specific
|
| 80 |
+
* stuff after that.
|
| 81 |
+
*/
|
| 82 |
+
|
| 83 |
+
typedef struct TkFont {
|
| 84 |
+
/*
|
| 85 |
+
* Fields used and maintained exclusively by generic code.
|
| 86 |
+
*/
|
| 87 |
+
|
| 88 |
+
int resourceRefCount; /* Number of active uses of this font (each
|
| 89 |
+
* active use corresponds to a call to
|
| 90 |
+
* Tk_AllocFontFromTable or Tk_GetFont). If
|
| 91 |
+
* this count is 0, then this TkFont structure
|
| 92 |
+
* is no longer valid and it isn't present in
|
| 93 |
+
* a hash table: it is being kept around only
|
| 94 |
+
* because there are objects referring to it.
|
| 95 |
+
* The structure is freed when
|
| 96 |
+
* resourceRefCount and objRefCount are both
|
| 97 |
+
* 0. */
|
| 98 |
+
int objRefCount; /* The number of Tcl objects that reference
|
| 99 |
+
* this structure. */
|
| 100 |
+
Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure,
|
| 101 |
+
* used when deleting it. */
|
| 102 |
+
Tcl_HashEntry *namedHashPtr;/* Pointer to hash table entry that
|
| 103 |
+
* corresponds to the named font that the
|
| 104 |
+
* tkfont was based on, or NULL if the tkfont
|
| 105 |
+
* was not based on a named font. */
|
| 106 |
+
Screen *screen; /* The screen where this font is valid. */
|
| 107 |
+
int tabWidth; /* Width of tabs in this font (pixels). */
|
| 108 |
+
int underlinePos; /* Offset from baseline to origin of underline
|
| 109 |
+
* bar (used for drawing underlines on a
|
| 110 |
+
* non-underlined font). */
|
| 111 |
+
int underlineHeight; /* Height of underline bar (used for drawing
|
| 112 |
+
* underlines on a non-underlined font). */
|
| 113 |
+
|
| 114 |
+
/*
|
| 115 |
+
* Fields used in the generic code that are filled in by
|
| 116 |
+
* platform-specific code.
|
| 117 |
+
*/
|
| 118 |
+
|
| 119 |
+
Font fid; /* For backwards compatibility with XGCValues
|
| 120 |
+
* structures. Remove when TkGCValues is
|
| 121 |
+
* implemented. */
|
| 122 |
+
TkFontAttributes fa; /* Actual font attributes obtained when the
|
| 123 |
+
* the font was created, as opposed to the
|
| 124 |
+
* desired attributes passed in to
|
| 125 |
+
* TkpGetFontFromAttributes(). The desired
|
| 126 |
+
* metrics can be determined from the string
|
| 127 |
+
* that was used to create this font. */
|
| 128 |
+
TkFontMetrics fm; /* Font metrics determined when font was
|
| 129 |
+
* created. */
|
| 130 |
+
struct TkFont *nextPtr; /* Points to the next TkFont structure with
|
| 131 |
+
* the same name. All fonts with the same name
|
| 132 |
+
* (but different displays) are chained
|
| 133 |
+
* together off a single entry in a hash
|
| 134 |
+
* table. */
|
| 135 |
+
} TkFont;
|
| 136 |
+
|
| 137 |
+
/*
|
| 138 |
+
* The following structure is used to return attributes when parsing an XLFD.
|
| 139 |
+
* The extra information is of interest to the Unix-specific code when
|
| 140 |
+
* attempting to find the closest matching font.
|
| 141 |
+
*/
|
| 142 |
+
|
| 143 |
+
typedef struct TkXLFDAttributes {
|
| 144 |
+
Tk_Uid foundry; /* The foundry of the font. */
|
| 145 |
+
int slant; /* The tristate value for the slant, which is
|
| 146 |
+
* significant under X. */
|
| 147 |
+
int setwidth; /* The proportionate width, see below for
|
| 148 |
+
* definition. */
|
| 149 |
+
Tk_Uid charset; /* The actual charset string. */
|
| 150 |
+
} TkXLFDAttributes;
|
| 151 |
+
|
| 152 |
+
/*
|
| 153 |
+
* Possible values for the "setwidth" field in a TkXLFDAttributes structure.
|
| 154 |
+
* The setwidth is whether characters are considered wider or narrower than
|
| 155 |
+
* normal.
|
| 156 |
+
*/
|
| 157 |
+
|
| 158 |
+
#define TK_SW_NORMAL 0
|
| 159 |
+
#define TK_SW_CONDENSE 1
|
| 160 |
+
#define TK_SW_EXPAND 2
|
| 161 |
+
#define TK_SW_UNKNOWN 3 /* Unknown setwidth. This value may be stored
|
| 162 |
+
* in the setwidth field. */
|
| 163 |
+
|
| 164 |
+
/*
|
| 165 |
+
* The following defines specify the meaning of the fields in a fully
|
| 166 |
+
* qualified XLFD.
|
| 167 |
+
*/
|
| 168 |
+
|
| 169 |
+
#define XLFD_FOUNDRY 0
|
| 170 |
+
#define XLFD_FAMILY 1
|
| 171 |
+
#define XLFD_WEIGHT 2
|
| 172 |
+
#define XLFD_SLANT 3
|
| 173 |
+
#define XLFD_SETWIDTH 4
|
| 174 |
+
#define XLFD_ADD_STYLE 5
|
| 175 |
+
#define XLFD_PIXEL_SIZE 6
|
| 176 |
+
#define XLFD_POINT_SIZE 7
|
| 177 |
+
#define XLFD_RESOLUTION_X 8
|
| 178 |
+
#define XLFD_RESOLUTION_Y 9
|
| 179 |
+
#define XLFD_SPACING 10
|
| 180 |
+
#define XLFD_AVERAGE_WIDTH 11
|
| 181 |
+
#define XLFD_CHARSET 12
|
| 182 |
+
#define XLFD_NUMFIELDS 13 /* Number of fields in XLFD. */
|
| 183 |
+
|
| 184 |
+
/*
|
| 185 |
+
* Helper macro. How to correctly round a double to a short.
|
| 186 |
+
*/
|
| 187 |
+
|
| 188 |
+
#define ROUND16(x) ((short) floor((x) + 0.5))
|
| 189 |
+
|
| 190 |
+
/*
|
| 191 |
+
* Low-level API exported by generic code to platform-specific code.
|
| 192 |
+
*/
|
| 193 |
+
|
| 194 |
+
#define TkInitFontAttributes(fa) memset((fa), 0, sizeof(TkFontAttributes));
|
| 195 |
+
#define TkInitXLFDAttributes(xa) memset((xa), 0, sizeof(TkXLFDAttributes));
|
| 196 |
+
|
| 197 |
+
MODULE_SCOPE int TkFontParseXLFD(const char *string,
|
| 198 |
+
TkFontAttributes *faPtr, TkXLFDAttributes *xaPtr);
|
| 199 |
+
MODULE_SCOPE const char *const * TkFontGetAliasList(const char *faceName);
|
| 200 |
+
MODULE_SCOPE const char *const *const * TkFontGetFallbacks(void);
|
| 201 |
+
MODULE_SCOPE double TkFontGetPixels(Tk_Window tkwin, double size);
|
| 202 |
+
MODULE_SCOPE double TkFontGetPoints(Tk_Window tkwin, double size);
|
| 203 |
+
MODULE_SCOPE const char *const * TkFontGetGlobalClass(void);
|
| 204 |
+
MODULE_SCOPE const char *const * TkFontGetSymbolClass(void);
|
| 205 |
+
MODULE_SCOPE int TkCreateNamedFont(Tcl_Interp *interp, Tk_Window tkwin,
|
| 206 |
+
const char *name, TkFontAttributes *faPtr);
|
| 207 |
+
MODULE_SCOPE int TkDeleteNamedFont(Tcl_Interp *interp,
|
| 208 |
+
Tk_Window tkwin, const char *name);
|
| 209 |
+
MODULE_SCOPE int TkFontGetFirstTextLayout(Tk_TextLayout layout,
|
| 210 |
+
Tk_Font *font, char *dst);
|
| 211 |
+
|
| 212 |
+
/*
|
| 213 |
+
* Low-level API exported by platform-specific code to generic code.
|
| 214 |
+
*/
|
| 215 |
+
|
| 216 |
+
MODULE_SCOPE void TkpDeleteFont(TkFont *tkFontPtr);
|
| 217 |
+
MODULE_SCOPE void TkpFontPkgInit(TkMainInfo *mainPtr);
|
| 218 |
+
MODULE_SCOPE TkFont * TkpGetFontFromAttributes(TkFont *tkFontPtr,
|
| 219 |
+
Tk_Window tkwin, const TkFontAttributes *faPtr);
|
| 220 |
+
MODULE_SCOPE void TkpGetFontFamilies(Tcl_Interp *interp,
|
| 221 |
+
Tk_Window tkwin);
|
| 222 |
+
MODULE_SCOPE TkFont * TkpGetNativeFont(Tk_Window tkwin, const char *name);
|
| 223 |
+
|
| 224 |
+
#endif /* _TKFONT */
|
deepseek/include/tkIntDecls.h
ADDED
|
@@ -0,0 +1,1235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
| 6 |
+
* interfaces are not guaranteed to remain the same between
|
| 7 |
+
* versions. Use at your own risk.
|
| 8 |
+
*
|
| 9 |
+
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
| 10 |
+
*
|
| 11 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 12 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
#ifndef _TKINTDECLS
|
| 16 |
+
#define _TKINTDECLS
|
| 17 |
+
|
| 18 |
+
#ifdef BUILD_tk
|
| 19 |
+
#undef TCL_STORAGE_CLASS
|
| 20 |
+
#define TCL_STORAGE_CLASS DLLEXPORT
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
struct TkText;
|
| 24 |
+
typedef struct TkTextBTree_ *TkTextBTree;
|
| 25 |
+
struct TkTextDispChunk;
|
| 26 |
+
struct TkTextIndex;
|
| 27 |
+
struct TkTextSegment;
|
| 28 |
+
struct TkSharedText;
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 32 |
+
* script. Any modifications to the function declarations below should be made
|
| 33 |
+
* in the generic/tkInt.decls script.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 37 |
+
|
| 38 |
+
#ifdef __cplusplus
|
| 39 |
+
extern "C" {
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
/*
|
| 43 |
+
* Exported function declarations:
|
| 44 |
+
*/
|
| 45 |
+
|
| 46 |
+
/* 0 */
|
| 47 |
+
EXTERN TkWindow * TkAllocWindow(TkDisplay *dispPtr, int screenNum,
|
| 48 |
+
TkWindow *parentPtr);
|
| 49 |
+
/* 1 */
|
| 50 |
+
EXTERN void TkBezierPoints(double control[], int numSteps,
|
| 51 |
+
double *coordPtr);
|
| 52 |
+
/* 2 */
|
| 53 |
+
EXTERN void TkBezierScreenPoints(Tk_Canvas canvas,
|
| 54 |
+
double control[], int numSteps,
|
| 55 |
+
XPoint *xPointPtr);
|
| 56 |
+
/* Slot 3 is reserved */
|
| 57 |
+
/* 4 */
|
| 58 |
+
EXTERN void TkBindEventProc(TkWindow *winPtr, XEvent *eventPtr);
|
| 59 |
+
/* 5 */
|
| 60 |
+
EXTERN void TkBindFree(TkMainInfo *mainPtr);
|
| 61 |
+
/* 6 */
|
| 62 |
+
EXTERN void TkBindInit(TkMainInfo *mainPtr);
|
| 63 |
+
/* 7 */
|
| 64 |
+
EXTERN void TkChangeEventWindow(XEvent *eventPtr,
|
| 65 |
+
TkWindow *winPtr);
|
| 66 |
+
/* 8 */
|
| 67 |
+
EXTERN int TkClipInit(Tcl_Interp *interp, TkDisplay *dispPtr);
|
| 68 |
+
/* 9 */
|
| 69 |
+
EXTERN void TkComputeAnchor(Tk_Anchor anchor, Tk_Window tkwin,
|
| 70 |
+
int padX, int padY, int innerWidth,
|
| 71 |
+
int innerHeight, int *xPtr, int *yPtr);
|
| 72 |
+
/* Slot 10 is reserved */
|
| 73 |
+
/* Slot 11 is reserved */
|
| 74 |
+
/* 12 */
|
| 75 |
+
EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin,
|
| 76 |
+
const char *source, const char *mask,
|
| 77 |
+
int width, int height, int xHot, int yHot,
|
| 78 |
+
XColor fg, XColor bg);
|
| 79 |
+
/* 13 */
|
| 80 |
+
EXTERN int TkCreateFrame(ClientData clientData,
|
| 81 |
+
Tcl_Interp *interp, int argc,
|
| 82 |
+
const char *const *argv, int toplevel,
|
| 83 |
+
const char *appName);
|
| 84 |
+
/* 14 */
|
| 85 |
+
EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
|
| 86 |
+
const char *screenName, const char *baseName);
|
| 87 |
+
/* 15 */
|
| 88 |
+
EXTERN Time TkCurrentTime(TkDisplay *dispPtr);
|
| 89 |
+
/* 16 */
|
| 90 |
+
EXTERN void TkDeleteAllImages(TkMainInfo *mainPtr);
|
| 91 |
+
/* 17 */
|
| 92 |
+
EXTERN void TkDoConfigureNotify(TkWindow *winPtr);
|
| 93 |
+
/* 18 */
|
| 94 |
+
EXTERN void TkDrawInsetFocusHighlight(Tk_Window tkwin, GC gc,
|
| 95 |
+
int width, Drawable drawable, int padding);
|
| 96 |
+
/* 19 */
|
| 97 |
+
EXTERN void TkEventDeadWindow(TkWindow *winPtr);
|
| 98 |
+
/* 20 */
|
| 99 |
+
EXTERN void TkFillPolygon(Tk_Canvas canvas, double *coordPtr,
|
| 100 |
+
int numPoints, Display *display,
|
| 101 |
+
Drawable drawable, GC gc, GC outlineGC);
|
| 102 |
+
/* 21 */
|
| 103 |
+
EXTERN int TkFindStateNum(Tcl_Interp *interp,
|
| 104 |
+
const char *option, const TkStateMap *mapPtr,
|
| 105 |
+
const char *strKey);
|
| 106 |
+
/* 22 */
|
| 107 |
+
EXTERN CONST86 char * TkFindStateString(const TkStateMap *mapPtr,
|
| 108 |
+
int numKey);
|
| 109 |
+
/* 23 */
|
| 110 |
+
EXTERN void TkFocusDeadWindow(TkWindow *winPtr);
|
| 111 |
+
/* 24 */
|
| 112 |
+
EXTERN int TkFocusFilterEvent(TkWindow *winPtr,
|
| 113 |
+
XEvent *eventPtr);
|
| 114 |
+
/* 25 */
|
| 115 |
+
EXTERN TkWindow * TkFocusKeyEvent(TkWindow *winPtr, XEvent *eventPtr);
|
| 116 |
+
/* 26 */
|
| 117 |
+
EXTERN void TkFontPkgInit(TkMainInfo *mainPtr);
|
| 118 |
+
/* 27 */
|
| 119 |
+
EXTERN void TkFontPkgFree(TkMainInfo *mainPtr);
|
| 120 |
+
/* 28 */
|
| 121 |
+
EXTERN void TkFreeBindingTags(TkWindow *winPtr);
|
| 122 |
+
/* 29 */
|
| 123 |
+
EXTERN void TkpFreeCursor(TkCursor *cursorPtr);
|
| 124 |
+
/* 30 */
|
| 125 |
+
EXTERN char * TkGetBitmapData(Tcl_Interp *interp,
|
| 126 |
+
const char *string, const char *fileName,
|
| 127 |
+
int *widthPtr, int *heightPtr, int *hotXPtr,
|
| 128 |
+
int *hotYPtr);
|
| 129 |
+
/* 31 */
|
| 130 |
+
EXTERN void TkGetButtPoints(double p1[], double p2[],
|
| 131 |
+
double width, int project, double m1[],
|
| 132 |
+
double m2[]);
|
| 133 |
+
/* 32 */
|
| 134 |
+
EXTERN TkCursor * TkGetCursorByName(Tcl_Interp *interp,
|
| 135 |
+
Tk_Window tkwin, Tk_Uid string);
|
| 136 |
+
/* 33 */
|
| 137 |
+
EXTERN const char * TkGetDefaultScreenName(Tcl_Interp *interp,
|
| 138 |
+
const char *screenName);
|
| 139 |
+
/* 34 */
|
| 140 |
+
EXTERN TkDisplay * TkGetDisplay(Display *display);
|
| 141 |
+
/* 35 */
|
| 142 |
+
EXTERN int TkGetDisplayOf(Tcl_Interp *interp, int objc,
|
| 143 |
+
Tcl_Obj *const objv[], Tk_Window *tkwinPtr);
|
| 144 |
+
/* 36 */
|
| 145 |
+
EXTERN TkWindow * TkGetFocusWin(TkWindow *winPtr);
|
| 146 |
+
/* 37 */
|
| 147 |
+
EXTERN int TkGetInterpNames(Tcl_Interp *interp, Tk_Window tkwin);
|
| 148 |
+
/* 38 */
|
| 149 |
+
EXTERN int TkGetMiterPoints(double p1[], double p2[],
|
| 150 |
+
double p3[], double width, double m1[],
|
| 151 |
+
double m2[]);
|
| 152 |
+
/* 39 */
|
| 153 |
+
EXTERN void TkGetPointerCoords(Tk_Window tkwin, int *xPtr,
|
| 154 |
+
int *yPtr);
|
| 155 |
+
/* 40 */
|
| 156 |
+
EXTERN void TkGetServerInfo(Tcl_Interp *interp, Tk_Window tkwin);
|
| 157 |
+
/* 41 */
|
| 158 |
+
EXTERN void TkGrabDeadWindow(TkWindow *winPtr);
|
| 159 |
+
/* 42 */
|
| 160 |
+
EXTERN int TkGrabState(TkWindow *winPtr);
|
| 161 |
+
/* 43 */
|
| 162 |
+
EXTERN void TkIncludePoint(Tk_Item *itemPtr, double *pointPtr);
|
| 163 |
+
/* 44 */
|
| 164 |
+
EXTERN void TkInOutEvents(XEvent *eventPtr, TkWindow *sourcePtr,
|
| 165 |
+
TkWindow *destPtr, int leaveType,
|
| 166 |
+
int enterType, Tcl_QueuePosition position);
|
| 167 |
+
/* 45 */
|
| 168 |
+
EXTERN void TkInstallFrameMenu(Tk_Window tkwin);
|
| 169 |
+
/* 46 */
|
| 170 |
+
EXTERN CONST86 char * TkKeysymToString(KeySym keysym);
|
| 171 |
+
/* 47 */
|
| 172 |
+
EXTERN int TkLineToArea(double end1Ptr[], double end2Ptr[],
|
| 173 |
+
double rectPtr[]);
|
| 174 |
+
/* 48 */
|
| 175 |
+
EXTERN double TkLineToPoint(double end1Ptr[], double end2Ptr[],
|
| 176 |
+
double pointPtr[]);
|
| 177 |
+
/* 49 */
|
| 178 |
+
EXTERN int TkMakeBezierCurve(Tk_Canvas canvas, double *pointPtr,
|
| 179 |
+
int numPoints, int numSteps,
|
| 180 |
+
XPoint xPoints[], double dblPoints[]);
|
| 181 |
+
/* 50 */
|
| 182 |
+
EXTERN void TkMakeBezierPostscript(Tcl_Interp *interp,
|
| 183 |
+
Tk_Canvas canvas, double *pointPtr,
|
| 184 |
+
int numPoints);
|
| 185 |
+
/* 51 */
|
| 186 |
+
EXTERN void TkOptionClassChanged(TkWindow *winPtr);
|
| 187 |
+
/* 52 */
|
| 188 |
+
EXTERN void TkOptionDeadWindow(TkWindow *winPtr);
|
| 189 |
+
/* 53 */
|
| 190 |
+
EXTERN int TkOvalToArea(double *ovalPtr, double *rectPtr);
|
| 191 |
+
/* 54 */
|
| 192 |
+
EXTERN double TkOvalToPoint(double ovalPtr[], double width,
|
| 193 |
+
int filled, double pointPtr[]);
|
| 194 |
+
/* 55 */
|
| 195 |
+
EXTERN int TkpChangeFocus(TkWindow *winPtr, int force);
|
| 196 |
+
/* 56 */
|
| 197 |
+
EXTERN void TkpCloseDisplay(TkDisplay *dispPtr);
|
| 198 |
+
/* 57 */
|
| 199 |
+
EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force);
|
| 200 |
+
/* 58 */
|
| 201 |
+
EXTERN void TkpDisplayWarning(const char *msg, const char *title);
|
| 202 |
+
/* 59 */
|
| 203 |
+
EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name);
|
| 204 |
+
/* 60 */
|
| 205 |
+
EXTERN TkWindow * TkpGetOtherWindow(TkWindow *winPtr);
|
| 206 |
+
/* 61 */
|
| 207 |
+
EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr);
|
| 208 |
+
/* 62 */
|
| 209 |
+
EXTERN int TkpInit(Tcl_Interp *interp);
|
| 210 |
+
/* 63 */
|
| 211 |
+
EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp,
|
| 212 |
+
Tk_BindingTable bindingTable);
|
| 213 |
+
/* 64 */
|
| 214 |
+
EXTERN void TkpMakeContainer(Tk_Window tkwin);
|
| 215 |
+
/* 65 */
|
| 216 |
+
EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient);
|
| 217 |
+
/* 66 */
|
| 218 |
+
EXTERN Window TkpMakeWindow(TkWindow *winPtr, Window parent);
|
| 219 |
+
/* 67 */
|
| 220 |
+
EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp,
|
| 221 |
+
const char *menuName);
|
| 222 |
+
/* 68 */
|
| 223 |
+
EXTERN TkDisplay * TkpOpenDisplay(const char *display_name);
|
| 224 |
+
/* 69 */
|
| 225 |
+
EXTERN int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr);
|
| 226 |
+
/* 70 */
|
| 227 |
+
EXTERN int TkPolygonToArea(double *polyPtr, int numPoints,
|
| 228 |
+
double *rectPtr);
|
| 229 |
+
/* 71 */
|
| 230 |
+
EXTERN double TkPolygonToPoint(double *polyPtr, int numPoints,
|
| 231 |
+
double *pointPtr);
|
| 232 |
+
/* 72 */
|
| 233 |
+
EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr);
|
| 234 |
+
/* 73 */
|
| 235 |
+
EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr,
|
| 236 |
+
XEvent *eventPtr);
|
| 237 |
+
/* 74 */
|
| 238 |
+
EXTERN void TkpSetMainMenubar(Tcl_Interp *interp,
|
| 239 |
+
Tk_Window tkwin, const char *menuName);
|
| 240 |
+
/* 75 */
|
| 241 |
+
EXTERN int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin,
|
| 242 |
+
const char *string);
|
| 243 |
+
/* Slot 76 is reserved */
|
| 244 |
+
/* 77 */
|
| 245 |
+
EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr,
|
| 246 |
+
XEvent *eventPtr);
|
| 247 |
+
/* 78 */
|
| 248 |
+
EXTERN int TkReadBitmapFile(Display *display, Drawable d,
|
| 249 |
+
const char *filename,
|
| 250 |
+
unsigned int *width_return,
|
| 251 |
+
unsigned int *height_return,
|
| 252 |
+
Pixmap *bitmap_return, int *x_hot_return,
|
| 253 |
+
int *y_hot_return);
|
| 254 |
+
/* 79 */
|
| 255 |
+
EXTERN int TkScrollWindow(Tk_Window tkwin, GC gc, int x, int y,
|
| 256 |
+
int width, int height, int dx, int dy,
|
| 257 |
+
TkRegion damageRgn);
|
| 258 |
+
/* 80 */
|
| 259 |
+
EXTERN void TkSelDeadWindow(TkWindow *winPtr);
|
| 260 |
+
/* 81 */
|
| 261 |
+
EXTERN void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr);
|
| 262 |
+
/* 82 */
|
| 263 |
+
EXTERN void TkSelInit(Tk_Window tkwin);
|
| 264 |
+
/* 83 */
|
| 265 |
+
EXTERN void TkSelPropProc(XEvent *eventPtr);
|
| 266 |
+
/* Slot 84 is reserved */
|
| 267 |
+
/* 85 */
|
| 268 |
+
EXTERN void TkSetWindowMenuBar(Tcl_Interp *interp,
|
| 269 |
+
Tk_Window tkwin, const char *oldMenuName,
|
| 270 |
+
const char *menuName);
|
| 271 |
+
/* 86 */
|
| 272 |
+
EXTERN KeySym TkStringToKeysym(const char *name);
|
| 273 |
+
/* 87 */
|
| 274 |
+
EXTERN int TkThickPolyLineToArea(double *coordPtr,
|
| 275 |
+
int numPoints, double width, int capStyle,
|
| 276 |
+
int joinStyle, double *rectPtr);
|
| 277 |
+
/* 88 */
|
| 278 |
+
EXTERN void TkWmAddToColormapWindows(TkWindow *winPtr);
|
| 279 |
+
/* 89 */
|
| 280 |
+
EXTERN void TkWmDeadWindow(TkWindow *winPtr);
|
| 281 |
+
/* 90 */
|
| 282 |
+
EXTERN TkWindow * TkWmFocusToplevel(TkWindow *winPtr);
|
| 283 |
+
/* 91 */
|
| 284 |
+
EXTERN void TkWmMapWindow(TkWindow *winPtr);
|
| 285 |
+
/* 92 */
|
| 286 |
+
EXTERN void TkWmNewWindow(TkWindow *winPtr);
|
| 287 |
+
/* 93 */
|
| 288 |
+
EXTERN void TkWmProtocolEventProc(TkWindow *winPtr,
|
| 289 |
+
XEvent *evenvPtr);
|
| 290 |
+
/* 94 */
|
| 291 |
+
EXTERN void TkWmRemoveFromColormapWindows(TkWindow *winPtr);
|
| 292 |
+
/* 95 */
|
| 293 |
+
EXTERN void TkWmRestackToplevel(TkWindow *winPtr, int aboveBelow,
|
| 294 |
+
TkWindow *otherPtr);
|
| 295 |
+
/* 96 */
|
| 296 |
+
EXTERN void TkWmSetClass(TkWindow *winPtr);
|
| 297 |
+
/* 97 */
|
| 298 |
+
EXTERN void TkWmUnmapWindow(TkWindow *winPtr);
|
| 299 |
+
/* 98 */
|
| 300 |
+
EXTERN Tcl_Obj * TkDebugBitmap(Tk_Window tkwin, const char *name);
|
| 301 |
+
/* 99 */
|
| 302 |
+
EXTERN Tcl_Obj * TkDebugBorder(Tk_Window tkwin, const char *name);
|
| 303 |
+
/* 100 */
|
| 304 |
+
EXTERN Tcl_Obj * TkDebugCursor(Tk_Window tkwin, const char *name);
|
| 305 |
+
/* 101 */
|
| 306 |
+
EXTERN Tcl_Obj * TkDebugColor(Tk_Window tkwin, const char *name);
|
| 307 |
+
/* 102 */
|
| 308 |
+
EXTERN Tcl_Obj * TkDebugConfig(Tcl_Interp *interp,
|
| 309 |
+
Tk_OptionTable table);
|
| 310 |
+
/* 103 */
|
| 311 |
+
EXTERN Tcl_Obj * TkDebugFont(Tk_Window tkwin, const char *name);
|
| 312 |
+
/* 104 */
|
| 313 |
+
EXTERN int TkFindStateNumObj(Tcl_Interp *interp,
|
| 314 |
+
Tcl_Obj *optionPtr, const TkStateMap *mapPtr,
|
| 315 |
+
Tcl_Obj *keyPtr);
|
| 316 |
+
/* 105 */
|
| 317 |
+
EXTERN Tcl_HashTable * TkGetBitmapPredefTable(void);
|
| 318 |
+
/* 106 */
|
| 319 |
+
EXTERN TkDisplay * TkGetDisplayList(void);
|
| 320 |
+
/* 107 */
|
| 321 |
+
EXTERN TkMainInfo * TkGetMainInfoList(void);
|
| 322 |
+
/* 108 */
|
| 323 |
+
EXTERN int TkGetWindowFromObj(Tcl_Interp *interp,
|
| 324 |
+
Tk_Window tkwin, Tcl_Obj *objPtr,
|
| 325 |
+
Tk_Window *windowPtr);
|
| 326 |
+
/* 109 */
|
| 327 |
+
EXTERN CONST86 char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr,
|
| 328 |
+
Tcl_DString *dsPtr);
|
| 329 |
+
/* 110 */
|
| 330 |
+
EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont);
|
| 331 |
+
/* 111 */
|
| 332 |
+
EXTERN Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin,
|
| 333 |
+
const char *dbName, const char *className);
|
| 334 |
+
/* 112 */
|
| 335 |
+
EXTERN void TkpMenuThreadInit(void);
|
| 336 |
+
/* 113 */
|
| 337 |
+
EXTERN int TkClipBox(TkRegion rgn, XRectangle *rect_return);
|
| 338 |
+
/* 114 */
|
| 339 |
+
EXTERN TkRegion TkCreateRegion(void);
|
| 340 |
+
/* 115 */
|
| 341 |
+
EXTERN int TkDestroyRegion(TkRegion rgn);
|
| 342 |
+
/* 116 */
|
| 343 |
+
EXTERN int TkIntersectRegion(TkRegion sra, TkRegion srcb,
|
| 344 |
+
TkRegion dr_return);
|
| 345 |
+
/* 117 */
|
| 346 |
+
EXTERN int TkRectInRegion(TkRegion rgn, int x, int y,
|
| 347 |
+
unsigned int width, unsigned int height);
|
| 348 |
+
/* 118 */
|
| 349 |
+
EXTERN int TkSetRegion(Display *display, GC gc, TkRegion rgn);
|
| 350 |
+
/* 119 */
|
| 351 |
+
EXTERN int TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
|
| 352 |
+
TkRegion dr_return);
|
| 353 |
+
/* Slot 120 is reserved */
|
| 354 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 355 |
+
/* 121 */
|
| 356 |
+
EXTERN Pixmap TkpCreateNativeBitmap(Display *display,
|
| 357 |
+
const void *source);
|
| 358 |
+
#endif /* AQUA */
|
| 359 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 360 |
+
/* 122 */
|
| 361 |
+
EXTERN void TkpDefineNativeBitmaps(void);
|
| 362 |
+
#endif /* AQUA */
|
| 363 |
+
/* Slot 123 is reserved */
|
| 364 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 365 |
+
/* 124 */
|
| 366 |
+
EXTERN Pixmap TkpGetNativeAppBitmap(Display *display,
|
| 367 |
+
const char *name, int *width, int *height);
|
| 368 |
+
#endif /* AQUA */
|
| 369 |
+
/* Slot 125 is reserved */
|
| 370 |
+
/* Slot 126 is reserved */
|
| 371 |
+
/* Slot 127 is reserved */
|
| 372 |
+
/* Slot 128 is reserved */
|
| 373 |
+
/* Slot 129 is reserved */
|
| 374 |
+
/* Slot 130 is reserved */
|
| 375 |
+
/* Slot 131 is reserved */
|
| 376 |
+
/* Slot 132 is reserved */
|
| 377 |
+
/* Slot 133 is reserved */
|
| 378 |
+
/* Slot 134 is reserved */
|
| 379 |
+
/* 135 */
|
| 380 |
+
EXTERN void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC,
|
| 381 |
+
GC bgGC, int highlightWidth,
|
| 382 |
+
Drawable drawable);
|
| 383 |
+
/* 136 */
|
| 384 |
+
EXTERN void TkSetFocusWin(TkWindow *winPtr, int force);
|
| 385 |
+
/* 137 */
|
| 386 |
+
EXTERN void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym,
|
| 387 |
+
XEvent *eventPtr);
|
| 388 |
+
/* 138 */
|
| 389 |
+
EXTERN KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr);
|
| 390 |
+
/* 139 */
|
| 391 |
+
EXTERN void TkpInitKeymapInfo(TkDisplay *dispPtr);
|
| 392 |
+
/* 140 */
|
| 393 |
+
EXTERN TkRegion TkPhotoGetValidRegion(Tk_PhotoHandle handle);
|
| 394 |
+
/* 141 */
|
| 395 |
+
EXTERN TkWindow ** TkWmStackorderToplevel(TkWindow *parentPtr);
|
| 396 |
+
/* 142 */
|
| 397 |
+
EXTERN void TkFocusFree(TkMainInfo *mainPtr);
|
| 398 |
+
/* 143 */
|
| 399 |
+
EXTERN void TkClipCleanup(TkDisplay *dispPtr);
|
| 400 |
+
/* 144 */
|
| 401 |
+
EXTERN void TkGCCleanup(TkDisplay *dispPtr);
|
| 402 |
+
/* 145 */
|
| 403 |
+
EXTERN int TkSubtractRegion(TkRegion sra, TkRegion srcb,
|
| 404 |
+
TkRegion dr_return);
|
| 405 |
+
/* 146 */
|
| 406 |
+
EXTERN void TkStylePkgInit(TkMainInfo *mainPtr);
|
| 407 |
+
/* 147 */
|
| 408 |
+
EXTERN void TkStylePkgFree(TkMainInfo *mainPtr);
|
| 409 |
+
/* 148 */
|
| 410 |
+
EXTERN Tk_Window TkToplevelWindowForCommand(Tcl_Interp *interp,
|
| 411 |
+
const char *cmdName);
|
| 412 |
+
/* 149 */
|
| 413 |
+
EXTERN const Tk_OptionSpec * TkGetOptionSpec(const char *name,
|
| 414 |
+
Tk_OptionTable optionTable);
|
| 415 |
+
/* 150 */
|
| 416 |
+
EXTERN int TkMakeRawCurve(Tk_Canvas canvas, double *pointPtr,
|
| 417 |
+
int numPoints, int numSteps,
|
| 418 |
+
XPoint xPoints[], double dblPoints[]);
|
| 419 |
+
/* 151 */
|
| 420 |
+
EXTERN void TkMakeRawCurvePostscript(Tcl_Interp *interp,
|
| 421 |
+
Tk_Canvas canvas, double *pointPtr,
|
| 422 |
+
int numPoints);
|
| 423 |
+
/* 152 */
|
| 424 |
+
EXTERN void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border,
|
| 425 |
+
int highlightWidth, int borderWidth,
|
| 426 |
+
int relief);
|
| 427 |
+
/* 153 */
|
| 428 |
+
EXTERN void TkCreateThreadExitHandler(Tcl_ExitProc *proc,
|
| 429 |
+
ClientData clientData);
|
| 430 |
+
/* 154 */
|
| 431 |
+
EXTERN void TkDeleteThreadExitHandler(Tcl_ExitProc *proc,
|
| 432 |
+
ClientData clientData);
|
| 433 |
+
/* Slot 155 is reserved */
|
| 434 |
+
/* 156 */
|
| 435 |
+
EXTERN int TkpTestembedCmd(ClientData clientData,
|
| 436 |
+
Tcl_Interp *interp, int objc,
|
| 437 |
+
Tcl_Obj *const objv[]);
|
| 438 |
+
/* 157 */
|
| 439 |
+
EXTERN int TkpTesttextCmd(ClientData dummy, Tcl_Interp *interp,
|
| 440 |
+
int objc, Tcl_Obj *const objv[]);
|
| 441 |
+
/* 158 */
|
| 442 |
+
EXTERN int TkSelGetSelection(Tcl_Interp *interp,
|
| 443 |
+
Tk_Window tkwin, Atom selection, Atom target,
|
| 444 |
+
Tk_GetSelProc *proc, ClientData clientData);
|
| 445 |
+
/* 159 */
|
| 446 |
+
EXTERN int TkTextGetIndex(Tcl_Interp *interp,
|
| 447 |
+
struct TkText *textPtr, const char *string,
|
| 448 |
+
struct TkTextIndex *indexPtr);
|
| 449 |
+
/* 160 */
|
| 450 |
+
EXTERN int TkTextIndexBackBytes(const struct TkText *textPtr,
|
| 451 |
+
const struct TkTextIndex *srcPtr, int count,
|
| 452 |
+
struct TkTextIndex *dstPtr);
|
| 453 |
+
/* 161 */
|
| 454 |
+
EXTERN int TkTextIndexForwBytes(const struct TkText *textPtr,
|
| 455 |
+
const struct TkTextIndex *srcPtr, int count,
|
| 456 |
+
struct TkTextIndex *dstPtr);
|
| 457 |
+
/* 162 */
|
| 458 |
+
EXTERN struct TkTextIndex * TkTextMakeByteIndex(TkTextBTree tree,
|
| 459 |
+
const struct TkText *textPtr, int lineIndex,
|
| 460 |
+
int byteIndex, struct TkTextIndex *indexPtr);
|
| 461 |
+
/* 163 */
|
| 462 |
+
EXTERN int TkTextPrintIndex(const struct TkText *textPtr,
|
| 463 |
+
const struct TkTextIndex *indexPtr,
|
| 464 |
+
char *string);
|
| 465 |
+
/* 164 */
|
| 466 |
+
EXTERN struct TkTextSegment * TkTextSetMark(struct TkText *textPtr,
|
| 467 |
+
const char *name,
|
| 468 |
+
struct TkTextIndex *indexPtr);
|
| 469 |
+
/* 165 */
|
| 470 |
+
EXTERN int TkTextXviewCmd(struct TkText *textPtr,
|
| 471 |
+
Tcl_Interp *interp, int objc,
|
| 472 |
+
Tcl_Obj *const objv[]);
|
| 473 |
+
/* 166 */
|
| 474 |
+
EXTERN void TkTextChanged(struct TkSharedText *sharedTextPtr,
|
| 475 |
+
struct TkText *textPtr,
|
| 476 |
+
const struct TkTextIndex *index1Ptr,
|
| 477 |
+
const struct TkTextIndex *index2Ptr);
|
| 478 |
+
/* 167 */
|
| 479 |
+
EXTERN int TkBTreeNumLines(TkTextBTree tree,
|
| 480 |
+
const struct TkText *textPtr);
|
| 481 |
+
/* 168 */
|
| 482 |
+
EXTERN void TkTextInsertDisplayProc(struct TkText *textPtr,
|
| 483 |
+
struct TkTextDispChunk *chunkPtr, int x,
|
| 484 |
+
int y, int height, int baseline,
|
| 485 |
+
Display *display, Drawable dst, int screenY);
|
| 486 |
+
/* 169 */
|
| 487 |
+
EXTERN int TkStateParseProc(ClientData clientData,
|
| 488 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 489 |
+
const char *value, char *widgRec, int offset);
|
| 490 |
+
/* 170 */
|
| 491 |
+
EXTERN CONST86 char * TkStatePrintProc(ClientData clientData,
|
| 492 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 493 |
+
Tcl_FreeProc **freeProcPtr);
|
| 494 |
+
/* 171 */
|
| 495 |
+
EXTERN int TkCanvasDashParseProc(ClientData clientData,
|
| 496 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 497 |
+
const char *value, char *widgRec, int offset);
|
| 498 |
+
/* 172 */
|
| 499 |
+
EXTERN CONST86 char * TkCanvasDashPrintProc(ClientData clientData,
|
| 500 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 501 |
+
Tcl_FreeProc **freeProcPtr);
|
| 502 |
+
/* 173 */
|
| 503 |
+
EXTERN int TkOffsetParseProc(ClientData clientData,
|
| 504 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 505 |
+
const char *value, char *widgRec, int offset);
|
| 506 |
+
/* 174 */
|
| 507 |
+
EXTERN CONST86 char * TkOffsetPrintProc(ClientData clientData,
|
| 508 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 509 |
+
Tcl_FreeProc **freeProcPtr);
|
| 510 |
+
/* 175 */
|
| 511 |
+
EXTERN int TkPixelParseProc(ClientData clientData,
|
| 512 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 513 |
+
const char *value, char *widgRec, int offset);
|
| 514 |
+
/* 176 */
|
| 515 |
+
EXTERN CONST86 char * TkPixelPrintProc(ClientData clientData,
|
| 516 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 517 |
+
Tcl_FreeProc **freeProcPtr);
|
| 518 |
+
/* 177 */
|
| 519 |
+
EXTERN int TkOrientParseProc(ClientData clientData,
|
| 520 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 521 |
+
const char *value, char *widgRec, int offset);
|
| 522 |
+
/* 178 */
|
| 523 |
+
EXTERN CONST86 char * TkOrientPrintProc(ClientData clientData,
|
| 524 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 525 |
+
Tcl_FreeProc **freeProcPtr);
|
| 526 |
+
/* 179 */
|
| 527 |
+
EXTERN int TkSmoothParseProc(ClientData clientData,
|
| 528 |
+
Tcl_Interp *interp, Tk_Window tkwin,
|
| 529 |
+
const char *value, char *widgRec, int offset);
|
| 530 |
+
/* 180 */
|
| 531 |
+
EXTERN CONST86 char * TkSmoothPrintProc(ClientData clientData,
|
| 532 |
+
Tk_Window tkwin, char *widgRec, int offset,
|
| 533 |
+
Tcl_FreeProc **freeProcPtr);
|
| 534 |
+
/* 181 */
|
| 535 |
+
EXTERN void TkDrawAngledTextLayout(Display *display,
|
| 536 |
+
Drawable drawable, GC gc,
|
| 537 |
+
Tk_TextLayout layout, int x, int y,
|
| 538 |
+
double angle, int firstChar, int lastChar);
|
| 539 |
+
/* 182 */
|
| 540 |
+
EXTERN void TkUnderlineAngledTextLayout(Display *display,
|
| 541 |
+
Drawable drawable, GC gc,
|
| 542 |
+
Tk_TextLayout layout, int x, int y,
|
| 543 |
+
double angle, int underline);
|
| 544 |
+
/* 183 */
|
| 545 |
+
EXTERN int TkIntersectAngledTextLayout(Tk_TextLayout layout,
|
| 546 |
+
int x, int y, int width, int height,
|
| 547 |
+
double angle);
|
| 548 |
+
/* 184 */
|
| 549 |
+
EXTERN void TkDrawAngledChars(Display *display,
|
| 550 |
+
Drawable drawable, GC gc, Tk_Font tkfont,
|
| 551 |
+
const char *source, int numBytes, double x,
|
| 552 |
+
double y, double angle);
|
| 553 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 554 |
+
/* 185 */
|
| 555 |
+
EXTERN void TkpRedrawWidget(Tk_Window tkwin);
|
| 556 |
+
#endif /* MACOSX */
|
| 557 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 558 |
+
/* 186 */
|
| 559 |
+
EXTERN int TkpWillDrawWidget(Tk_Window tkwin);
|
| 560 |
+
#endif /* MACOSX */
|
| 561 |
+
/* 187 */
|
| 562 |
+
EXTERN void TkUnusedStubEntry(void);
|
| 563 |
+
|
| 564 |
+
typedef struct TkIntStubs {
|
| 565 |
+
int magic;
|
| 566 |
+
void *hooks;
|
| 567 |
+
|
| 568 |
+
TkWindow * (*tkAllocWindow) (TkDisplay *dispPtr, int screenNum, TkWindow *parentPtr); /* 0 */
|
| 569 |
+
void (*tkBezierPoints) (double control[], int numSteps, double *coordPtr); /* 1 */
|
| 570 |
+
void (*tkBezierScreenPoints) (Tk_Canvas canvas, double control[], int numSteps, XPoint *xPointPtr); /* 2 */
|
| 571 |
+
void (*reserved3)(void);
|
| 572 |
+
void (*tkBindEventProc) (TkWindow *winPtr, XEvent *eventPtr); /* 4 */
|
| 573 |
+
void (*tkBindFree) (TkMainInfo *mainPtr); /* 5 */
|
| 574 |
+
void (*tkBindInit) (TkMainInfo *mainPtr); /* 6 */
|
| 575 |
+
void (*tkChangeEventWindow) (XEvent *eventPtr, TkWindow *winPtr); /* 7 */
|
| 576 |
+
int (*tkClipInit) (Tcl_Interp *interp, TkDisplay *dispPtr); /* 8 */
|
| 577 |
+
void (*tkComputeAnchor) (Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int *xPtr, int *yPtr); /* 9 */
|
| 578 |
+
void (*reserved10)(void);
|
| 579 |
+
void (*reserved11)(void);
|
| 580 |
+
TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */
|
| 581 |
+
int (*tkCreateFrame) (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv, int toplevel, const char *appName); /* 13 */
|
| 582 |
+
Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, const char *screenName, const char *baseName); /* 14 */
|
| 583 |
+
Time (*tkCurrentTime) (TkDisplay *dispPtr); /* 15 */
|
| 584 |
+
void (*tkDeleteAllImages) (TkMainInfo *mainPtr); /* 16 */
|
| 585 |
+
void (*tkDoConfigureNotify) (TkWindow *winPtr); /* 17 */
|
| 586 |
+
void (*tkDrawInsetFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable, int padding); /* 18 */
|
| 587 |
+
void (*tkEventDeadWindow) (TkWindow *winPtr); /* 19 */
|
| 588 |
+
void (*tkFillPolygon) (Tk_Canvas canvas, double *coordPtr, int numPoints, Display *display, Drawable drawable, GC gc, GC outlineGC); /* 20 */
|
| 589 |
+
int (*tkFindStateNum) (Tcl_Interp *interp, const char *option, const TkStateMap *mapPtr, const char *strKey); /* 21 */
|
| 590 |
+
CONST86 char * (*tkFindStateString) (const TkStateMap *mapPtr, int numKey); /* 22 */
|
| 591 |
+
void (*tkFocusDeadWindow) (TkWindow *winPtr); /* 23 */
|
| 592 |
+
int (*tkFocusFilterEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 24 */
|
| 593 |
+
TkWindow * (*tkFocusKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 25 */
|
| 594 |
+
void (*tkFontPkgInit) (TkMainInfo *mainPtr); /* 26 */
|
| 595 |
+
void (*tkFontPkgFree) (TkMainInfo *mainPtr); /* 27 */
|
| 596 |
+
void (*tkFreeBindingTags) (TkWindow *winPtr); /* 28 */
|
| 597 |
+
void (*tkpFreeCursor) (TkCursor *cursorPtr); /* 29 */
|
| 598 |
+
char * (*tkGetBitmapData) (Tcl_Interp *interp, const char *string, const char *fileName, int *widthPtr, int *heightPtr, int *hotXPtr, int *hotYPtr); /* 30 */
|
| 599 |
+
void (*tkGetButtPoints) (double p1[], double p2[], double width, int project, double m1[], double m2[]); /* 31 */
|
| 600 |
+
TkCursor * (*tkGetCursorByName) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid string); /* 32 */
|
| 601 |
+
const char * (*tkGetDefaultScreenName) (Tcl_Interp *interp, const char *screenName); /* 33 */
|
| 602 |
+
TkDisplay * (*tkGetDisplay) (Display *display); /* 34 */
|
| 603 |
+
int (*tkGetDisplayOf) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], Tk_Window *tkwinPtr); /* 35 */
|
| 604 |
+
TkWindow * (*tkGetFocusWin) (TkWindow *winPtr); /* 36 */
|
| 605 |
+
int (*tkGetInterpNames) (Tcl_Interp *interp, Tk_Window tkwin); /* 37 */
|
| 606 |
+
int (*tkGetMiterPoints) (double p1[], double p2[], double p3[], double width, double m1[], double m2[]); /* 38 */
|
| 607 |
+
void (*tkGetPointerCoords) (Tk_Window tkwin, int *xPtr, int *yPtr); /* 39 */
|
| 608 |
+
void (*tkGetServerInfo) (Tcl_Interp *interp, Tk_Window tkwin); /* 40 */
|
| 609 |
+
void (*tkGrabDeadWindow) (TkWindow *winPtr); /* 41 */
|
| 610 |
+
int (*tkGrabState) (TkWindow *winPtr); /* 42 */
|
| 611 |
+
void (*tkIncludePoint) (Tk_Item *itemPtr, double *pointPtr); /* 43 */
|
| 612 |
+
void (*tkInOutEvents) (XEvent *eventPtr, TkWindow *sourcePtr, TkWindow *destPtr, int leaveType, int enterType, Tcl_QueuePosition position); /* 44 */
|
| 613 |
+
void (*tkInstallFrameMenu) (Tk_Window tkwin); /* 45 */
|
| 614 |
+
CONST86 char * (*tkKeysymToString) (KeySym keysym); /* 46 */
|
| 615 |
+
int (*tkLineToArea) (double end1Ptr[], double end2Ptr[], double rectPtr[]); /* 47 */
|
| 616 |
+
double (*tkLineToPoint) (double end1Ptr[], double end2Ptr[], double pointPtr[]); /* 48 */
|
| 617 |
+
int (*tkMakeBezierCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 49 */
|
| 618 |
+
void (*tkMakeBezierPostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 50 */
|
| 619 |
+
void (*tkOptionClassChanged) (TkWindow *winPtr); /* 51 */
|
| 620 |
+
void (*tkOptionDeadWindow) (TkWindow *winPtr); /* 52 */
|
| 621 |
+
int (*tkOvalToArea) (double *ovalPtr, double *rectPtr); /* 53 */
|
| 622 |
+
double (*tkOvalToPoint) (double ovalPtr[], double width, int filled, double pointPtr[]); /* 54 */
|
| 623 |
+
int (*tkpChangeFocus) (TkWindow *winPtr, int force); /* 55 */
|
| 624 |
+
void (*tkpCloseDisplay) (TkDisplay *dispPtr); /* 56 */
|
| 625 |
+
void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */
|
| 626 |
+
void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */
|
| 627 |
+
void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */
|
| 628 |
+
TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */
|
| 629 |
+
TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */
|
| 630 |
+
int (*tkpInit) (Tcl_Interp *interp); /* 62 */
|
| 631 |
+
void (*tkpInitializeMenuBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 63 */
|
| 632 |
+
void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */
|
| 633 |
+
void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */
|
| 634 |
+
Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */
|
| 635 |
+
void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */
|
| 636 |
+
TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */
|
| 637 |
+
int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */
|
| 638 |
+
int (*tkPolygonToArea) (double *polyPtr, int numPoints, double *rectPtr); /* 70 */
|
| 639 |
+
double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */
|
| 640 |
+
int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */
|
| 641 |
+
void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */
|
| 642 |
+
void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */
|
| 643 |
+
int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */
|
| 644 |
+
void (*reserved76)(void);
|
| 645 |
+
void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */
|
| 646 |
+
int (*tkReadBitmapFile) (Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return); /* 78 */
|
| 647 |
+
int (*tkScrollWindow) (Tk_Window tkwin, GC gc, int x, int y, int width, int height, int dx, int dy, TkRegion damageRgn); /* 79 */
|
| 648 |
+
void (*tkSelDeadWindow) (TkWindow *winPtr); /* 80 */
|
| 649 |
+
void (*tkSelEventProc) (Tk_Window tkwin, XEvent *eventPtr); /* 81 */
|
| 650 |
+
void (*tkSelInit) (Tk_Window tkwin); /* 82 */
|
| 651 |
+
void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */
|
| 652 |
+
void (*reserved84)(void);
|
| 653 |
+
void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */
|
| 654 |
+
KeySym (*tkStringToKeysym) (const char *name); /* 86 */
|
| 655 |
+
int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */
|
| 656 |
+
void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */
|
| 657 |
+
void (*tkWmDeadWindow) (TkWindow *winPtr); /* 89 */
|
| 658 |
+
TkWindow * (*tkWmFocusToplevel) (TkWindow *winPtr); /* 90 */
|
| 659 |
+
void (*tkWmMapWindow) (TkWindow *winPtr); /* 91 */
|
| 660 |
+
void (*tkWmNewWindow) (TkWindow *winPtr); /* 92 */
|
| 661 |
+
void (*tkWmProtocolEventProc) (TkWindow *winPtr, XEvent *evenvPtr); /* 93 */
|
| 662 |
+
void (*tkWmRemoveFromColormapWindows) (TkWindow *winPtr); /* 94 */
|
| 663 |
+
void (*tkWmRestackToplevel) (TkWindow *winPtr, int aboveBelow, TkWindow *otherPtr); /* 95 */
|
| 664 |
+
void (*tkWmSetClass) (TkWindow *winPtr); /* 96 */
|
| 665 |
+
void (*tkWmUnmapWindow) (TkWindow *winPtr); /* 97 */
|
| 666 |
+
Tcl_Obj * (*tkDebugBitmap) (Tk_Window tkwin, const char *name); /* 98 */
|
| 667 |
+
Tcl_Obj * (*tkDebugBorder) (Tk_Window tkwin, const char *name); /* 99 */
|
| 668 |
+
Tcl_Obj * (*tkDebugCursor) (Tk_Window tkwin, const char *name); /* 100 */
|
| 669 |
+
Tcl_Obj * (*tkDebugColor) (Tk_Window tkwin, const char *name); /* 101 */
|
| 670 |
+
Tcl_Obj * (*tkDebugConfig) (Tcl_Interp *interp, Tk_OptionTable table); /* 102 */
|
| 671 |
+
Tcl_Obj * (*tkDebugFont) (Tk_Window tkwin, const char *name); /* 103 */
|
| 672 |
+
int (*tkFindStateNumObj) (Tcl_Interp *interp, Tcl_Obj *optionPtr, const TkStateMap *mapPtr, Tcl_Obj *keyPtr); /* 104 */
|
| 673 |
+
Tcl_HashTable * (*tkGetBitmapPredefTable) (void); /* 105 */
|
| 674 |
+
TkDisplay * (*tkGetDisplayList) (void); /* 106 */
|
| 675 |
+
TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */
|
| 676 |
+
int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */
|
| 677 |
+
CONST86 char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */
|
| 678 |
+
void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */
|
| 679 |
+
Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */
|
| 680 |
+
void (*tkpMenuThreadInit) (void); /* 112 */
|
| 681 |
+
int (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */
|
| 682 |
+
TkRegion (*tkCreateRegion) (void); /* 114 */
|
| 683 |
+
int (*tkDestroyRegion) (TkRegion rgn); /* 115 */
|
| 684 |
+
int (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */
|
| 685 |
+
int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */
|
| 686 |
+
int (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */
|
| 687 |
+
int (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */
|
| 688 |
+
void (*reserved120)(void);
|
| 689 |
+
#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
|
| 690 |
+
void (*reserved121)(void);
|
| 691 |
+
#endif /* X11 */
|
| 692 |
+
#if defined(_WIN32) /* WIN */
|
| 693 |
+
void (*reserved121)(void);
|
| 694 |
+
#endif /* WIN */
|
| 695 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 696 |
+
void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */
|
| 697 |
+
Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */
|
| 698 |
+
#endif /* AQUA */
|
| 699 |
+
#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
|
| 700 |
+
void (*reserved122)(void);
|
| 701 |
+
#endif /* X11 */
|
| 702 |
+
#if defined(_WIN32) /* WIN */
|
| 703 |
+
void (*reserved122)(void);
|
| 704 |
+
#endif /* WIN */
|
| 705 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 706 |
+
void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */
|
| 707 |
+
void (*tkpDefineNativeBitmaps) (void); /* 122 */
|
| 708 |
+
#endif /* AQUA */
|
| 709 |
+
void (*reserved123)(void);
|
| 710 |
+
#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
|
| 711 |
+
void (*reserved124)(void);
|
| 712 |
+
#endif /* X11 */
|
| 713 |
+
#if defined(_WIN32) /* WIN */
|
| 714 |
+
void (*reserved124)(void);
|
| 715 |
+
#endif /* WIN */
|
| 716 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 717 |
+
void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */
|
| 718 |
+
Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */
|
| 719 |
+
#endif /* AQUA */
|
| 720 |
+
void (*reserved125)(void);
|
| 721 |
+
void (*reserved126)(void);
|
| 722 |
+
void (*reserved127)(void);
|
| 723 |
+
void (*reserved128)(void);
|
| 724 |
+
void (*reserved129)(void);
|
| 725 |
+
void (*reserved130)(void);
|
| 726 |
+
void (*reserved131)(void);
|
| 727 |
+
void (*reserved132)(void);
|
| 728 |
+
void (*reserved133)(void);
|
| 729 |
+
void (*reserved134)(void);
|
| 730 |
+
void (*tkpDrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 135 */
|
| 731 |
+
void (*tkSetFocusWin) (TkWindow *winPtr, int force); /* 136 */
|
| 732 |
+
void (*tkpSetKeycodeAndState) (Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 137 */
|
| 733 |
+
KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */
|
| 734 |
+
void (*tkpInitKeymapInfo) (TkDisplay *dispPtr); /* 139 */
|
| 735 |
+
TkRegion (*tkPhotoGetValidRegion) (Tk_PhotoHandle handle); /* 140 */
|
| 736 |
+
TkWindow ** (*tkWmStackorderToplevel) (TkWindow *parentPtr); /* 141 */
|
| 737 |
+
void (*tkFocusFree) (TkMainInfo *mainPtr); /* 142 */
|
| 738 |
+
void (*tkClipCleanup) (TkDisplay *dispPtr); /* 143 */
|
| 739 |
+
void (*tkGCCleanup) (TkDisplay *dispPtr); /* 144 */
|
| 740 |
+
int (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */
|
| 741 |
+
void (*tkStylePkgInit) (TkMainInfo *mainPtr); /* 146 */
|
| 742 |
+
void (*tkStylePkgFree) (TkMainInfo *mainPtr); /* 147 */
|
| 743 |
+
Tk_Window (*tkToplevelWindowForCommand) (Tcl_Interp *interp, const char *cmdName); /* 148 */
|
| 744 |
+
const Tk_OptionSpec * (*tkGetOptionSpec) (const char *name, Tk_OptionTable optionTable); /* 149 */
|
| 745 |
+
int (*tkMakeRawCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 150 */
|
| 746 |
+
void (*tkMakeRawCurvePostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 151 */
|
| 747 |
+
void (*tkpDrawFrame) (Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); /* 152 */
|
| 748 |
+
void (*tkCreateThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 153 */
|
| 749 |
+
void (*tkDeleteThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 154 */
|
| 750 |
+
void (*reserved155)(void);
|
| 751 |
+
int (*tkpTestembedCmd) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 156 */
|
| 752 |
+
int (*tkpTesttextCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 157 */
|
| 753 |
+
int (*tkSelGetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData); /* 158 */
|
| 754 |
+
int (*tkTextGetIndex) (Tcl_Interp *interp, struct TkText *textPtr, const char *string, struct TkTextIndex *indexPtr); /* 159 */
|
| 755 |
+
int (*tkTextIndexBackBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 160 */
|
| 756 |
+
int (*tkTextIndexForwBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 161 */
|
| 757 |
+
struct TkTextIndex * (*tkTextMakeByteIndex) (TkTextBTree tree, const struct TkText *textPtr, int lineIndex, int byteIndex, struct TkTextIndex *indexPtr); /* 162 */
|
| 758 |
+
int (*tkTextPrintIndex) (const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 163 */
|
| 759 |
+
struct TkTextSegment * (*tkTextSetMark) (struct TkText *textPtr, const char *name, struct TkTextIndex *indexPtr); /* 164 */
|
| 760 |
+
int (*tkTextXviewCmd) (struct TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 165 */
|
| 761 |
+
void (*tkTextChanged) (struct TkSharedText *sharedTextPtr, struct TkText *textPtr, const struct TkTextIndex *index1Ptr, const struct TkTextIndex *index2Ptr); /* 166 */
|
| 762 |
+
int (*tkBTreeNumLines) (TkTextBTree tree, const struct TkText *textPtr); /* 167 */
|
| 763 |
+
void (*tkTextInsertDisplayProc) (struct TkText *textPtr, struct TkTextDispChunk *chunkPtr, int x, int y, int height, int baseline, Display *display, Drawable dst, int screenY); /* 168 */
|
| 764 |
+
int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 169 */
|
| 765 |
+
CONST86 char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 170 */
|
| 766 |
+
int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 171 */
|
| 767 |
+
CONST86 char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 172 */
|
| 768 |
+
int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 173 */
|
| 769 |
+
CONST86 char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 174 */
|
| 770 |
+
int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 175 */
|
| 771 |
+
CONST86 char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 176 */
|
| 772 |
+
int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 177 */
|
| 773 |
+
CONST86 char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 178 */
|
| 774 |
+
int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 179 */
|
| 775 |
+
CONST86 char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 180 */
|
| 776 |
+
void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */
|
| 777 |
+
void (*tkUnderlineAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int underline); /* 182 */
|
| 778 |
+
int (*tkIntersectAngledTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height, double angle); /* 183 */
|
| 779 |
+
void (*tkDrawAngledChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, double x, double y, double angle); /* 184 */
|
| 780 |
+
#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */
|
| 781 |
+
void (*reserved185)(void);
|
| 782 |
+
#endif /* UNIX */
|
| 783 |
+
#if defined(_WIN32) /* WIN */
|
| 784 |
+
void (*reserved185)(void);
|
| 785 |
+
#endif /* WIN */
|
| 786 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 787 |
+
void (*tkpRedrawWidget) (Tk_Window tkwin); /* 185 */
|
| 788 |
+
#endif /* MACOSX */
|
| 789 |
+
#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */
|
| 790 |
+
void (*reserved186)(void);
|
| 791 |
+
#endif /* UNIX */
|
| 792 |
+
#if defined(_WIN32) /* WIN */
|
| 793 |
+
void (*reserved186)(void);
|
| 794 |
+
#endif /* WIN */
|
| 795 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 796 |
+
int (*tkpWillDrawWidget) (Tk_Window tkwin); /* 186 */
|
| 797 |
+
#endif /* MACOSX */
|
| 798 |
+
void (*tkUnusedStubEntry) (void); /* 187 */
|
| 799 |
+
} TkIntStubs;
|
| 800 |
+
|
| 801 |
+
extern const TkIntStubs *tkIntStubsPtr;
|
| 802 |
+
|
| 803 |
+
#ifdef __cplusplus
|
| 804 |
+
}
|
| 805 |
+
#endif
|
| 806 |
+
|
| 807 |
+
#if defined(USE_TK_STUBS)
|
| 808 |
+
|
| 809 |
+
/*
|
| 810 |
+
* Inline function declarations:
|
| 811 |
+
*/
|
| 812 |
+
|
| 813 |
+
#define TkAllocWindow \
|
| 814 |
+
(tkIntStubsPtr->tkAllocWindow) /* 0 */
|
| 815 |
+
#define TkBezierPoints \
|
| 816 |
+
(tkIntStubsPtr->tkBezierPoints) /* 1 */
|
| 817 |
+
#define TkBezierScreenPoints \
|
| 818 |
+
(tkIntStubsPtr->tkBezierScreenPoints) /* 2 */
|
| 819 |
+
/* Slot 3 is reserved */
|
| 820 |
+
#define TkBindEventProc \
|
| 821 |
+
(tkIntStubsPtr->tkBindEventProc) /* 4 */
|
| 822 |
+
#define TkBindFree \
|
| 823 |
+
(tkIntStubsPtr->tkBindFree) /* 5 */
|
| 824 |
+
#define TkBindInit \
|
| 825 |
+
(tkIntStubsPtr->tkBindInit) /* 6 */
|
| 826 |
+
#define TkChangeEventWindow \
|
| 827 |
+
(tkIntStubsPtr->tkChangeEventWindow) /* 7 */
|
| 828 |
+
#define TkClipInit \
|
| 829 |
+
(tkIntStubsPtr->tkClipInit) /* 8 */
|
| 830 |
+
#define TkComputeAnchor \
|
| 831 |
+
(tkIntStubsPtr->tkComputeAnchor) /* 9 */
|
| 832 |
+
/* Slot 10 is reserved */
|
| 833 |
+
/* Slot 11 is reserved */
|
| 834 |
+
#define TkCreateCursorFromData \
|
| 835 |
+
(tkIntStubsPtr->tkCreateCursorFromData) /* 12 */
|
| 836 |
+
#define TkCreateFrame \
|
| 837 |
+
(tkIntStubsPtr->tkCreateFrame) /* 13 */
|
| 838 |
+
#define TkCreateMainWindow \
|
| 839 |
+
(tkIntStubsPtr->tkCreateMainWindow) /* 14 */
|
| 840 |
+
#define TkCurrentTime \
|
| 841 |
+
(tkIntStubsPtr->tkCurrentTime) /* 15 */
|
| 842 |
+
#define TkDeleteAllImages \
|
| 843 |
+
(tkIntStubsPtr->tkDeleteAllImages) /* 16 */
|
| 844 |
+
#define TkDoConfigureNotify \
|
| 845 |
+
(tkIntStubsPtr->tkDoConfigureNotify) /* 17 */
|
| 846 |
+
#define TkDrawInsetFocusHighlight \
|
| 847 |
+
(tkIntStubsPtr->tkDrawInsetFocusHighlight) /* 18 */
|
| 848 |
+
#define TkEventDeadWindow \
|
| 849 |
+
(tkIntStubsPtr->tkEventDeadWindow) /* 19 */
|
| 850 |
+
#define TkFillPolygon \
|
| 851 |
+
(tkIntStubsPtr->tkFillPolygon) /* 20 */
|
| 852 |
+
#define TkFindStateNum \
|
| 853 |
+
(tkIntStubsPtr->tkFindStateNum) /* 21 */
|
| 854 |
+
#define TkFindStateString \
|
| 855 |
+
(tkIntStubsPtr->tkFindStateString) /* 22 */
|
| 856 |
+
#define TkFocusDeadWindow \
|
| 857 |
+
(tkIntStubsPtr->tkFocusDeadWindow) /* 23 */
|
| 858 |
+
#define TkFocusFilterEvent \
|
| 859 |
+
(tkIntStubsPtr->tkFocusFilterEvent) /* 24 */
|
| 860 |
+
#define TkFocusKeyEvent \
|
| 861 |
+
(tkIntStubsPtr->tkFocusKeyEvent) /* 25 */
|
| 862 |
+
#define TkFontPkgInit \
|
| 863 |
+
(tkIntStubsPtr->tkFontPkgInit) /* 26 */
|
| 864 |
+
#define TkFontPkgFree \
|
| 865 |
+
(tkIntStubsPtr->tkFontPkgFree) /* 27 */
|
| 866 |
+
#define TkFreeBindingTags \
|
| 867 |
+
(tkIntStubsPtr->tkFreeBindingTags) /* 28 */
|
| 868 |
+
#define TkpFreeCursor \
|
| 869 |
+
(tkIntStubsPtr->tkpFreeCursor) /* 29 */
|
| 870 |
+
#define TkGetBitmapData \
|
| 871 |
+
(tkIntStubsPtr->tkGetBitmapData) /* 30 */
|
| 872 |
+
#define TkGetButtPoints \
|
| 873 |
+
(tkIntStubsPtr->tkGetButtPoints) /* 31 */
|
| 874 |
+
#define TkGetCursorByName \
|
| 875 |
+
(tkIntStubsPtr->tkGetCursorByName) /* 32 */
|
| 876 |
+
#define TkGetDefaultScreenName \
|
| 877 |
+
(tkIntStubsPtr->tkGetDefaultScreenName) /* 33 */
|
| 878 |
+
#define TkGetDisplay \
|
| 879 |
+
(tkIntStubsPtr->tkGetDisplay) /* 34 */
|
| 880 |
+
#define TkGetDisplayOf \
|
| 881 |
+
(tkIntStubsPtr->tkGetDisplayOf) /* 35 */
|
| 882 |
+
#define TkGetFocusWin \
|
| 883 |
+
(tkIntStubsPtr->tkGetFocusWin) /* 36 */
|
| 884 |
+
#define TkGetInterpNames \
|
| 885 |
+
(tkIntStubsPtr->tkGetInterpNames) /* 37 */
|
| 886 |
+
#define TkGetMiterPoints \
|
| 887 |
+
(tkIntStubsPtr->tkGetMiterPoints) /* 38 */
|
| 888 |
+
#define TkGetPointerCoords \
|
| 889 |
+
(tkIntStubsPtr->tkGetPointerCoords) /* 39 */
|
| 890 |
+
#define TkGetServerInfo \
|
| 891 |
+
(tkIntStubsPtr->tkGetServerInfo) /* 40 */
|
| 892 |
+
#define TkGrabDeadWindow \
|
| 893 |
+
(tkIntStubsPtr->tkGrabDeadWindow) /* 41 */
|
| 894 |
+
#define TkGrabState \
|
| 895 |
+
(tkIntStubsPtr->tkGrabState) /* 42 */
|
| 896 |
+
#define TkIncludePoint \
|
| 897 |
+
(tkIntStubsPtr->tkIncludePoint) /* 43 */
|
| 898 |
+
#define TkInOutEvents \
|
| 899 |
+
(tkIntStubsPtr->tkInOutEvents) /* 44 */
|
| 900 |
+
#define TkInstallFrameMenu \
|
| 901 |
+
(tkIntStubsPtr->tkInstallFrameMenu) /* 45 */
|
| 902 |
+
#define TkKeysymToString \
|
| 903 |
+
(tkIntStubsPtr->tkKeysymToString) /* 46 */
|
| 904 |
+
#define TkLineToArea \
|
| 905 |
+
(tkIntStubsPtr->tkLineToArea) /* 47 */
|
| 906 |
+
#define TkLineToPoint \
|
| 907 |
+
(tkIntStubsPtr->tkLineToPoint) /* 48 */
|
| 908 |
+
#define TkMakeBezierCurve \
|
| 909 |
+
(tkIntStubsPtr->tkMakeBezierCurve) /* 49 */
|
| 910 |
+
#define TkMakeBezierPostscript \
|
| 911 |
+
(tkIntStubsPtr->tkMakeBezierPostscript) /* 50 */
|
| 912 |
+
#define TkOptionClassChanged \
|
| 913 |
+
(tkIntStubsPtr->tkOptionClassChanged) /* 51 */
|
| 914 |
+
#define TkOptionDeadWindow \
|
| 915 |
+
(tkIntStubsPtr->tkOptionDeadWindow) /* 52 */
|
| 916 |
+
#define TkOvalToArea \
|
| 917 |
+
(tkIntStubsPtr->tkOvalToArea) /* 53 */
|
| 918 |
+
#define TkOvalToPoint \
|
| 919 |
+
(tkIntStubsPtr->tkOvalToPoint) /* 54 */
|
| 920 |
+
#define TkpChangeFocus \
|
| 921 |
+
(tkIntStubsPtr->tkpChangeFocus) /* 55 */
|
| 922 |
+
#define TkpCloseDisplay \
|
| 923 |
+
(tkIntStubsPtr->tkpCloseDisplay) /* 56 */
|
| 924 |
+
#define TkpClaimFocus \
|
| 925 |
+
(tkIntStubsPtr->tkpClaimFocus) /* 57 */
|
| 926 |
+
#define TkpDisplayWarning \
|
| 927 |
+
(tkIntStubsPtr->tkpDisplayWarning) /* 58 */
|
| 928 |
+
#define TkpGetAppName \
|
| 929 |
+
(tkIntStubsPtr->tkpGetAppName) /* 59 */
|
| 930 |
+
#define TkpGetOtherWindow \
|
| 931 |
+
(tkIntStubsPtr->tkpGetOtherWindow) /* 60 */
|
| 932 |
+
#define TkpGetWrapperWindow \
|
| 933 |
+
(tkIntStubsPtr->tkpGetWrapperWindow) /* 61 */
|
| 934 |
+
#define TkpInit \
|
| 935 |
+
(tkIntStubsPtr->tkpInit) /* 62 */
|
| 936 |
+
#define TkpInitializeMenuBindings \
|
| 937 |
+
(tkIntStubsPtr->tkpInitializeMenuBindings) /* 63 */
|
| 938 |
+
#define TkpMakeContainer \
|
| 939 |
+
(tkIntStubsPtr->tkpMakeContainer) /* 64 */
|
| 940 |
+
#define TkpMakeMenuWindow \
|
| 941 |
+
(tkIntStubsPtr->tkpMakeMenuWindow) /* 65 */
|
| 942 |
+
#define TkpMakeWindow \
|
| 943 |
+
(tkIntStubsPtr->tkpMakeWindow) /* 66 */
|
| 944 |
+
#define TkpMenuNotifyToplevelCreate \
|
| 945 |
+
(tkIntStubsPtr->tkpMenuNotifyToplevelCreate) /* 67 */
|
| 946 |
+
#define TkpOpenDisplay \
|
| 947 |
+
(tkIntStubsPtr->tkpOpenDisplay) /* 68 */
|
| 948 |
+
#define TkPointerEvent \
|
| 949 |
+
(tkIntStubsPtr->tkPointerEvent) /* 69 */
|
| 950 |
+
#define TkPolygonToArea \
|
| 951 |
+
(tkIntStubsPtr->tkPolygonToArea) /* 70 */
|
| 952 |
+
#define TkPolygonToPoint \
|
| 953 |
+
(tkIntStubsPtr->tkPolygonToPoint) /* 71 */
|
| 954 |
+
#define TkPositionInTree \
|
| 955 |
+
(tkIntStubsPtr->tkPositionInTree) /* 72 */
|
| 956 |
+
#define TkpRedirectKeyEvent \
|
| 957 |
+
(tkIntStubsPtr->tkpRedirectKeyEvent) /* 73 */
|
| 958 |
+
#define TkpSetMainMenubar \
|
| 959 |
+
(tkIntStubsPtr->tkpSetMainMenubar) /* 74 */
|
| 960 |
+
#define TkpUseWindow \
|
| 961 |
+
(tkIntStubsPtr->tkpUseWindow) /* 75 */
|
| 962 |
+
/* Slot 76 is reserved */
|
| 963 |
+
#define TkQueueEventForAllChildren \
|
| 964 |
+
(tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */
|
| 965 |
+
#define TkReadBitmapFile \
|
| 966 |
+
(tkIntStubsPtr->tkReadBitmapFile) /* 78 */
|
| 967 |
+
#define TkScrollWindow \
|
| 968 |
+
(tkIntStubsPtr->tkScrollWindow) /* 79 */
|
| 969 |
+
#define TkSelDeadWindow \
|
| 970 |
+
(tkIntStubsPtr->tkSelDeadWindow) /* 80 */
|
| 971 |
+
#define TkSelEventProc \
|
| 972 |
+
(tkIntStubsPtr->tkSelEventProc) /* 81 */
|
| 973 |
+
#define TkSelInit \
|
| 974 |
+
(tkIntStubsPtr->tkSelInit) /* 82 */
|
| 975 |
+
#define TkSelPropProc \
|
| 976 |
+
(tkIntStubsPtr->tkSelPropProc) /* 83 */
|
| 977 |
+
/* Slot 84 is reserved */
|
| 978 |
+
#define TkSetWindowMenuBar \
|
| 979 |
+
(tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
|
| 980 |
+
#define TkStringToKeysym \
|
| 981 |
+
(tkIntStubsPtr->tkStringToKeysym) /* 86 */
|
| 982 |
+
#define TkThickPolyLineToArea \
|
| 983 |
+
(tkIntStubsPtr->tkThickPolyLineToArea) /* 87 */
|
| 984 |
+
#define TkWmAddToColormapWindows \
|
| 985 |
+
(tkIntStubsPtr->tkWmAddToColormapWindows) /* 88 */
|
| 986 |
+
#define TkWmDeadWindow \
|
| 987 |
+
(tkIntStubsPtr->tkWmDeadWindow) /* 89 */
|
| 988 |
+
#define TkWmFocusToplevel \
|
| 989 |
+
(tkIntStubsPtr->tkWmFocusToplevel) /* 90 */
|
| 990 |
+
#define TkWmMapWindow \
|
| 991 |
+
(tkIntStubsPtr->tkWmMapWindow) /* 91 */
|
| 992 |
+
#define TkWmNewWindow \
|
| 993 |
+
(tkIntStubsPtr->tkWmNewWindow) /* 92 */
|
| 994 |
+
#define TkWmProtocolEventProc \
|
| 995 |
+
(tkIntStubsPtr->tkWmProtocolEventProc) /* 93 */
|
| 996 |
+
#define TkWmRemoveFromColormapWindows \
|
| 997 |
+
(tkIntStubsPtr->tkWmRemoveFromColormapWindows) /* 94 */
|
| 998 |
+
#define TkWmRestackToplevel \
|
| 999 |
+
(tkIntStubsPtr->tkWmRestackToplevel) /* 95 */
|
| 1000 |
+
#define TkWmSetClass \
|
| 1001 |
+
(tkIntStubsPtr->tkWmSetClass) /* 96 */
|
| 1002 |
+
#define TkWmUnmapWindow \
|
| 1003 |
+
(tkIntStubsPtr->tkWmUnmapWindow) /* 97 */
|
| 1004 |
+
#define TkDebugBitmap \
|
| 1005 |
+
(tkIntStubsPtr->tkDebugBitmap) /* 98 */
|
| 1006 |
+
#define TkDebugBorder \
|
| 1007 |
+
(tkIntStubsPtr->tkDebugBorder) /* 99 */
|
| 1008 |
+
#define TkDebugCursor \
|
| 1009 |
+
(tkIntStubsPtr->tkDebugCursor) /* 100 */
|
| 1010 |
+
#define TkDebugColor \
|
| 1011 |
+
(tkIntStubsPtr->tkDebugColor) /* 101 */
|
| 1012 |
+
#define TkDebugConfig \
|
| 1013 |
+
(tkIntStubsPtr->tkDebugConfig) /* 102 */
|
| 1014 |
+
#define TkDebugFont \
|
| 1015 |
+
(tkIntStubsPtr->tkDebugFont) /* 103 */
|
| 1016 |
+
#define TkFindStateNumObj \
|
| 1017 |
+
(tkIntStubsPtr->tkFindStateNumObj) /* 104 */
|
| 1018 |
+
#define TkGetBitmapPredefTable \
|
| 1019 |
+
(tkIntStubsPtr->tkGetBitmapPredefTable) /* 105 */
|
| 1020 |
+
#define TkGetDisplayList \
|
| 1021 |
+
(tkIntStubsPtr->tkGetDisplayList) /* 106 */
|
| 1022 |
+
#define TkGetMainInfoList \
|
| 1023 |
+
(tkIntStubsPtr->tkGetMainInfoList) /* 107 */
|
| 1024 |
+
#define TkGetWindowFromObj \
|
| 1025 |
+
(tkIntStubsPtr->tkGetWindowFromObj) /* 108 */
|
| 1026 |
+
#define TkpGetString \
|
| 1027 |
+
(tkIntStubsPtr->tkpGetString) /* 109 */
|
| 1028 |
+
#define TkpGetSubFonts \
|
| 1029 |
+
(tkIntStubsPtr->tkpGetSubFonts) /* 110 */
|
| 1030 |
+
#define TkpGetSystemDefault \
|
| 1031 |
+
(tkIntStubsPtr->tkpGetSystemDefault) /* 111 */
|
| 1032 |
+
#define TkpMenuThreadInit \
|
| 1033 |
+
(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */
|
| 1034 |
+
#define TkClipBox \
|
| 1035 |
+
(tkIntStubsPtr->tkClipBox) /* 113 */
|
| 1036 |
+
#define TkCreateRegion \
|
| 1037 |
+
(tkIntStubsPtr->tkCreateRegion) /* 114 */
|
| 1038 |
+
#define TkDestroyRegion \
|
| 1039 |
+
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
|
| 1040 |
+
#define TkIntersectRegion \
|
| 1041 |
+
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
|
| 1042 |
+
#define TkRectInRegion \
|
| 1043 |
+
(tkIntStubsPtr->tkRectInRegion) /* 117 */
|
| 1044 |
+
#define TkSetRegion \
|
| 1045 |
+
(tkIntStubsPtr->tkSetRegion) /* 118 */
|
| 1046 |
+
#define TkUnionRectWithRegion \
|
| 1047 |
+
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
|
| 1048 |
+
/* Slot 120 is reserved */
|
| 1049 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 1050 |
+
#define TkpCreateNativeBitmap \
|
| 1051 |
+
(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
|
| 1052 |
+
#endif /* AQUA */
|
| 1053 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 1054 |
+
#define TkpDefineNativeBitmaps \
|
| 1055 |
+
(tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
|
| 1056 |
+
#endif /* AQUA */
|
| 1057 |
+
/* Slot 123 is reserved */
|
| 1058 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 1059 |
+
#define TkpGetNativeAppBitmap \
|
| 1060 |
+
(tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
|
| 1061 |
+
#endif /* AQUA */
|
| 1062 |
+
/* Slot 125 is reserved */
|
| 1063 |
+
/* Slot 126 is reserved */
|
| 1064 |
+
/* Slot 127 is reserved */
|
| 1065 |
+
/* Slot 128 is reserved */
|
| 1066 |
+
/* Slot 129 is reserved */
|
| 1067 |
+
/* Slot 130 is reserved */
|
| 1068 |
+
/* Slot 131 is reserved */
|
| 1069 |
+
/* Slot 132 is reserved */
|
| 1070 |
+
/* Slot 133 is reserved */
|
| 1071 |
+
/* Slot 134 is reserved */
|
| 1072 |
+
#define TkpDrawHighlightBorder \
|
| 1073 |
+
(tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */
|
| 1074 |
+
#define TkSetFocusWin \
|
| 1075 |
+
(tkIntStubsPtr->tkSetFocusWin) /* 136 */
|
| 1076 |
+
#define TkpSetKeycodeAndState \
|
| 1077 |
+
(tkIntStubsPtr->tkpSetKeycodeAndState) /* 137 */
|
| 1078 |
+
#define TkpGetKeySym \
|
| 1079 |
+
(tkIntStubsPtr->tkpGetKeySym) /* 138 */
|
| 1080 |
+
#define TkpInitKeymapInfo \
|
| 1081 |
+
(tkIntStubsPtr->tkpInitKeymapInfo) /* 139 */
|
| 1082 |
+
#define TkPhotoGetValidRegion \
|
| 1083 |
+
(tkIntStubsPtr->tkPhotoGetValidRegion) /* 140 */
|
| 1084 |
+
#define TkWmStackorderToplevel \
|
| 1085 |
+
(tkIntStubsPtr->tkWmStackorderToplevel) /* 141 */
|
| 1086 |
+
#define TkFocusFree \
|
| 1087 |
+
(tkIntStubsPtr->tkFocusFree) /* 142 */
|
| 1088 |
+
#define TkClipCleanup \
|
| 1089 |
+
(tkIntStubsPtr->tkClipCleanup) /* 143 */
|
| 1090 |
+
#define TkGCCleanup \
|
| 1091 |
+
(tkIntStubsPtr->tkGCCleanup) /* 144 */
|
| 1092 |
+
#define TkSubtractRegion \
|
| 1093 |
+
(tkIntStubsPtr->tkSubtractRegion) /* 145 */
|
| 1094 |
+
#define TkStylePkgInit \
|
| 1095 |
+
(tkIntStubsPtr->tkStylePkgInit) /* 146 */
|
| 1096 |
+
#define TkStylePkgFree \
|
| 1097 |
+
(tkIntStubsPtr->tkStylePkgFree) /* 147 */
|
| 1098 |
+
#define TkToplevelWindowForCommand \
|
| 1099 |
+
(tkIntStubsPtr->tkToplevelWindowForCommand) /* 148 */
|
| 1100 |
+
#define TkGetOptionSpec \
|
| 1101 |
+
(tkIntStubsPtr->tkGetOptionSpec) /* 149 */
|
| 1102 |
+
#define TkMakeRawCurve \
|
| 1103 |
+
(tkIntStubsPtr->tkMakeRawCurve) /* 150 */
|
| 1104 |
+
#define TkMakeRawCurvePostscript \
|
| 1105 |
+
(tkIntStubsPtr->tkMakeRawCurvePostscript) /* 151 */
|
| 1106 |
+
#define TkpDrawFrame \
|
| 1107 |
+
(tkIntStubsPtr->tkpDrawFrame) /* 152 */
|
| 1108 |
+
#define TkCreateThreadExitHandler \
|
| 1109 |
+
(tkIntStubsPtr->tkCreateThreadExitHandler) /* 153 */
|
| 1110 |
+
#define TkDeleteThreadExitHandler \
|
| 1111 |
+
(tkIntStubsPtr->tkDeleteThreadExitHandler) /* 154 */
|
| 1112 |
+
/* Slot 155 is reserved */
|
| 1113 |
+
#define TkpTestembedCmd \
|
| 1114 |
+
(tkIntStubsPtr->tkpTestembedCmd) /* 156 */
|
| 1115 |
+
#define TkpTesttextCmd \
|
| 1116 |
+
(tkIntStubsPtr->tkpTesttextCmd) /* 157 */
|
| 1117 |
+
#define TkSelGetSelection \
|
| 1118 |
+
(tkIntStubsPtr->tkSelGetSelection) /* 158 */
|
| 1119 |
+
#define TkTextGetIndex \
|
| 1120 |
+
(tkIntStubsPtr->tkTextGetIndex) /* 159 */
|
| 1121 |
+
#define TkTextIndexBackBytes \
|
| 1122 |
+
(tkIntStubsPtr->tkTextIndexBackBytes) /* 160 */
|
| 1123 |
+
#define TkTextIndexForwBytes \
|
| 1124 |
+
(tkIntStubsPtr->tkTextIndexForwBytes) /* 161 */
|
| 1125 |
+
#define TkTextMakeByteIndex \
|
| 1126 |
+
(tkIntStubsPtr->tkTextMakeByteIndex) /* 162 */
|
| 1127 |
+
#define TkTextPrintIndex \
|
| 1128 |
+
(tkIntStubsPtr->tkTextPrintIndex) /* 163 */
|
| 1129 |
+
#define TkTextSetMark \
|
| 1130 |
+
(tkIntStubsPtr->tkTextSetMark) /* 164 */
|
| 1131 |
+
#define TkTextXviewCmd \
|
| 1132 |
+
(tkIntStubsPtr->tkTextXviewCmd) /* 165 */
|
| 1133 |
+
#define TkTextChanged \
|
| 1134 |
+
(tkIntStubsPtr->tkTextChanged) /* 166 */
|
| 1135 |
+
#define TkBTreeNumLines \
|
| 1136 |
+
(tkIntStubsPtr->tkBTreeNumLines) /* 167 */
|
| 1137 |
+
#define TkTextInsertDisplayProc \
|
| 1138 |
+
(tkIntStubsPtr->tkTextInsertDisplayProc) /* 168 */
|
| 1139 |
+
#define TkStateParseProc \
|
| 1140 |
+
(tkIntStubsPtr->tkStateParseProc) /* 169 */
|
| 1141 |
+
#define TkStatePrintProc \
|
| 1142 |
+
(tkIntStubsPtr->tkStatePrintProc) /* 170 */
|
| 1143 |
+
#define TkCanvasDashParseProc \
|
| 1144 |
+
(tkIntStubsPtr->tkCanvasDashParseProc) /* 171 */
|
| 1145 |
+
#define TkCanvasDashPrintProc \
|
| 1146 |
+
(tkIntStubsPtr->tkCanvasDashPrintProc) /* 172 */
|
| 1147 |
+
#define TkOffsetParseProc \
|
| 1148 |
+
(tkIntStubsPtr->tkOffsetParseProc) /* 173 */
|
| 1149 |
+
#define TkOffsetPrintProc \
|
| 1150 |
+
(tkIntStubsPtr->tkOffsetPrintProc) /* 174 */
|
| 1151 |
+
#define TkPixelParseProc \
|
| 1152 |
+
(tkIntStubsPtr->tkPixelParseProc) /* 175 */
|
| 1153 |
+
#define TkPixelPrintProc \
|
| 1154 |
+
(tkIntStubsPtr->tkPixelPrintProc) /* 176 */
|
| 1155 |
+
#define TkOrientParseProc \
|
| 1156 |
+
(tkIntStubsPtr->tkOrientParseProc) /* 177 */
|
| 1157 |
+
#define TkOrientPrintProc \
|
| 1158 |
+
(tkIntStubsPtr->tkOrientPrintProc) /* 178 */
|
| 1159 |
+
#define TkSmoothParseProc \
|
| 1160 |
+
(tkIntStubsPtr->tkSmoothParseProc) /* 179 */
|
| 1161 |
+
#define TkSmoothPrintProc \
|
| 1162 |
+
(tkIntStubsPtr->tkSmoothPrintProc) /* 180 */
|
| 1163 |
+
#define TkDrawAngledTextLayout \
|
| 1164 |
+
(tkIntStubsPtr->tkDrawAngledTextLayout) /* 181 */
|
| 1165 |
+
#define TkUnderlineAngledTextLayout \
|
| 1166 |
+
(tkIntStubsPtr->tkUnderlineAngledTextLayout) /* 182 */
|
| 1167 |
+
#define TkIntersectAngledTextLayout \
|
| 1168 |
+
(tkIntStubsPtr->tkIntersectAngledTextLayout) /* 183 */
|
| 1169 |
+
#define TkDrawAngledChars \
|
| 1170 |
+
(tkIntStubsPtr->tkDrawAngledChars) /* 184 */
|
| 1171 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 1172 |
+
#define TkpRedrawWidget \
|
| 1173 |
+
(tkIntStubsPtr->tkpRedrawWidget) /* 185 */
|
| 1174 |
+
#endif /* MACOSX */
|
| 1175 |
+
#ifdef MAC_OSX_TCL /* MACOSX */
|
| 1176 |
+
#define TkpWillDrawWidget \
|
| 1177 |
+
(tkIntStubsPtr->tkpWillDrawWidget) /* 186 */
|
| 1178 |
+
#endif /* MACOSX */
|
| 1179 |
+
#define TkUnusedStubEntry \
|
| 1180 |
+
(tkIntStubsPtr->tkUnusedStubEntry) /* 187 */
|
| 1181 |
+
|
| 1182 |
+
#endif /* defined(USE_TK_STUBS) */
|
| 1183 |
+
|
| 1184 |
+
/* !END!: Do not edit above this line. */
|
| 1185 |
+
|
| 1186 |
+
#undef TCL_STORAGE_CLASS
|
| 1187 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 1188 |
+
|
| 1189 |
+
/*
|
| 1190 |
+
* On X11, these macros are just wrappers for the equivalent X Region calls.
|
| 1191 |
+
*/
|
| 1192 |
+
#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
|
| 1193 |
+
|
| 1194 |
+
#undef TkClipBox
|
| 1195 |
+
#undef TkCreateRegion
|
| 1196 |
+
#undef TkDestroyRegion
|
| 1197 |
+
#undef TkIntersectRegion
|
| 1198 |
+
#undef TkRectInRegion
|
| 1199 |
+
#undef TkSetRegion
|
| 1200 |
+
#undef TkSubtractRegion
|
| 1201 |
+
#undef TkUnionRectWithRegion
|
| 1202 |
+
#undef TkpCmapStressed_
|
| 1203 |
+
#undef TkpSync_
|
| 1204 |
+
#undef TkUnixContainerId_
|
| 1205 |
+
#undef TkUnixDoOneXEvent_
|
| 1206 |
+
#undef TkUnixSetMenubar_
|
| 1207 |
+
#undef TkWmCleanup_
|
| 1208 |
+
#undef TkSendCleanup_
|
| 1209 |
+
#undef TkpTestsendCmd_
|
| 1210 |
+
|
| 1211 |
+
#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
|
| 1212 |
+
#define TkCreateRegion() (TkRegion) XCreateRegion()
|
| 1213 |
+
#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
|
| 1214 |
+
#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
|
| 1215 |
+
(Region) b, (Region) r)
|
| 1216 |
+
#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
|
| 1217 |
+
#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
|
| 1218 |
+
#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \
|
| 1219 |
+
(Region) b, (Region) r)
|
| 1220 |
+
#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
|
| 1221 |
+
(Region) src, (Region) ret)
|
| 1222 |
+
|
| 1223 |
+
#endif /* UNIX */
|
| 1224 |
+
|
| 1225 |
+
#if !defined(MAC_OSX_TK)
|
| 1226 |
+
# undef TkpWillDrawWidget
|
| 1227 |
+
# undef TkpRedrawWidget
|
| 1228 |
+
# define TkpWillDrawWidget(w) 0
|
| 1229 |
+
# define TkpRedrawWidget(w)
|
| 1230 |
+
#endif
|
| 1231 |
+
|
| 1232 |
+
#undef TkUnusedStubEntry
|
| 1233 |
+
|
| 1234 |
+
#endif /* _TKINTDECLS */
|
| 1235 |
+
|
deepseek/include/tkMacOSXColor.h
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef MACOSXCOLOR_H
|
| 2 |
+
#define MACOSXCOLOR_H
|
| 3 |
+
/*
|
| 4 |
+
* The generic Tk code uses the X11 GC type to describe a graphics context.
|
| 5 |
+
* (A GC is a pointer to a struct XGCValues). The foreground and background
|
| 6 |
+
* colors in a GC are unsigned longs. These are meant to be used as indexes
|
| 7 |
+
* into a table of XColors, where an XColor is declared in Xlib.h as:
|
| 8 |
+
* typedef struct {
|
| 9 |
+
* unsigned long pixel;
|
| 10 |
+
* unsigned short red, green, blue;
|
| 11 |
+
* char flags;
|
| 12 |
+
* char pad;
|
| 13 |
+
* } XColor;
|
| 14 |
+
*
|
| 15 |
+
* The xlib function XParseColor creates XColors from strings. It recognizes
|
| 16 |
+
* literal hexadecimal color specifications such as "#RRGGBB" as well as the
|
| 17 |
+
* standard X11 color names. When XParseColor creates an XColor it fills in
|
| 18 |
+
* all of the fields except for the pixel field, and then passes the XColor
|
| 19 |
+
* to TkpGetPixel to get a value to use for the pixel field. Since TkpGetPixel
|
| 20 |
+
* is platform specific, each platform is free to choose a value which can
|
| 21 |
+
* be used to set the foreground or background color in the platform's graphics
|
| 22 |
+
* context.
|
| 23 |
+
*
|
| 24 |
+
* Tk represents a color by a struct TkColor, which extends the XColor struct.
|
| 25 |
+
* Tk provides a mapping from color names to TkColors which extends the mapping
|
| 26 |
+
* provided by XParseColor but also allows for platform specific color names.
|
| 27 |
+
* By convention, these platform specific color names begin with the string
|
| 28 |
+
* "system". The mapping from names to TkColors is implemented by the function
|
| 29 |
+
* TkpGetColor defined for the Macintosh in this file. The pixel field in the
|
| 30 |
+
* XColor contained in a TkColor will be stored in the X11 graphics context.
|
| 31 |
+
* In X11 the pixel field is used as an index into a colormap. On the Mac
|
| 32 |
+
* the high order byte of the pixel is used to indicate a color type and
|
| 33 |
+
* the low 24 bits are either used as an rgb value (if the type is rgbColor)
|
| 34 |
+
* or as an index into a table of color descriptions.
|
| 35 |
+
*/
|
| 36 |
+
|
| 37 |
+
enum colorType {
|
| 38 |
+
rgbColor, /* The 24 bit value is an rgb color. */
|
| 39 |
+
clearColor, /* The unique rgba color with all channels 0. */
|
| 40 |
+
HIBrush, /* A HITheme brush color.*/
|
| 41 |
+
HIText, /* A HITheme text color (32-bit only). */
|
| 42 |
+
HIBackground, /* A HITheme background color (32-bit only). */
|
| 43 |
+
ttkBackground, /* A background color which indicates nesting level.*/
|
| 44 |
+
semantic, /* A semantic NSColor.*/
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
typedef struct xpixel_t {
|
| 48 |
+
unsigned value: 24; /* Either RGB or an index into systemColorData. */
|
| 49 |
+
unsigned colortype: 8;
|
| 50 |
+
} xpixel;
|
| 51 |
+
|
| 52 |
+
typedef union MacPixel_t {
|
| 53 |
+
unsigned long ulong;
|
| 54 |
+
xpixel pixel;
|
| 55 |
+
} MacPixel;
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* We maintain two colormaps, one for the LightAqua appearance and one for the
|
| 59 |
+
* DarkAqua appearance.
|
| 60 |
+
*/
|
| 61 |
+
|
| 62 |
+
enum macColormap {
|
| 63 |
+
noColormap,
|
| 64 |
+
lightColormap,
|
| 65 |
+
darkColormap,
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
/*
|
| 69 |
+
* In TkMacOSXColor.c a Tk hash table is constructed from the static data
|
| 70 |
+
* below to map system color names to CGColors.
|
| 71 |
+
*/
|
| 72 |
+
|
| 73 |
+
typedef struct {
|
| 74 |
+
const char *name;
|
| 75 |
+
enum colorType type;
|
| 76 |
+
int value;
|
| 77 |
+
const char *macName;
|
| 78 |
+
/* Fields below are filled in after or during construction of the hash table. */
|
| 79 |
+
int index;
|
| 80 |
+
NSString *selector;
|
| 81 |
+
} SystemColorDatum;
|
| 82 |
+
|
| 83 |
+
/*
|
| 84 |
+
* WARNING: Semantic colors which are not supported on all systems must be
|
| 85 |
+
* preceded by a backup color with the same name which *is* supported. Systems
|
| 86 |
+
* which do support the color will replace the backup value when the table is
|
| 87 |
+
* constructed. Failing to ensure this will result in a Tcl_Panic abort.
|
| 88 |
+
*/
|
| 89 |
+
|
| 90 |
+
static SystemColorDatum systemColorData[] = {
|
| 91 |
+
{"Pixel", rgbColor, 0, NULL, 0, NULL },
|
| 92 |
+
{"Transparent", clearColor, 0, NULL, 0, NULL },
|
| 93 |
+
|
| 94 |
+
{"Highlight", HIBrush, kThemeBrushPrimaryHighlightColor, NULL, 0, NULL },
|
| 95 |
+
{"HighlightSecondary", HIBrush, kThemeBrushSecondaryHighlightColor, NULL, 0, NULL },
|
| 96 |
+
{"HighlightText", HIBrush, kThemeBrushBlack, NULL, 0, NULL },
|
| 97 |
+
{"HighlightAlternate", HIBrush, kThemeBrushAlternatePrimaryHighlightColor, NULL, 0, NULL },
|
| 98 |
+
{"PrimaryHighlightColor", HIBrush, kThemeBrushPrimaryHighlightColor, NULL, 0, NULL },
|
| 99 |
+
{"ButtonFace", HIBrush, kThemeBrushButtonFaceActive, NULL, 0, NULL },
|
| 100 |
+
{"SecondaryHighlightColor", HIBrush, kThemeBrushSecondaryHighlightColor, NULL, 0, NULL },
|
| 101 |
+
{"ButtonFrame", HIBrush, kThemeBrushButtonFrameActive, NULL, 0, NULL },
|
| 102 |
+
{"AlternatePrimaryHighlightColor", HIBrush, kThemeBrushAlternatePrimaryHighlightColor, NULL, 0, NULL },
|
| 103 |
+
{"WindowBody", HIBrush, kThemeBrushDocumentWindowBackground, NULL, 0, NULL },
|
| 104 |
+
{"SheetBackground", HIBrush, kThemeBrushSheetBackground, NULL, 0, NULL },
|
| 105 |
+
{"MenuActive", HIBrush, kThemeBrushMenuBackgroundSelected, NULL, 0, NULL },
|
| 106 |
+
{"Menu", HIBrush, kThemeBrushMenuBackground, NULL, 0, NULL },
|
| 107 |
+
{"DialogBackgroundInactive", HIBrush, kThemeBrushDialogBackgroundInactive, NULL, 0, NULL },
|
| 108 |
+
{"DialogBackgroundActive", HIBrush, kThemeBrushDialogBackgroundActive, NULL, 0, NULL },
|
| 109 |
+
{"AlertBackgroundActive", HIBrush, kThemeBrushAlertBackgroundActive, NULL, 0, NULL },
|
| 110 |
+
{"AlertBackgroundInactive", HIBrush, kThemeBrushAlertBackgroundInactive, NULL, 0, NULL },
|
| 111 |
+
{"ModelessDialogBackgroundActive", HIBrush, kThemeBrushModelessDialogBackgroundActive, NULL, 0, NULL },
|
| 112 |
+
{"ModelessDialogBackgroundInactive", HIBrush, kThemeBrushModelessDialogBackgroundInactive, NULL, 0, NULL },
|
| 113 |
+
{"UtilityWindowBackgroundActive", HIBrush, kThemeBrushUtilityWindowBackgroundActive, NULL, 0, NULL },
|
| 114 |
+
{"UtilityWindowBackgroundInactive", HIBrush, kThemeBrushUtilityWindowBackgroundInactive, NULL, 0, NULL },
|
| 115 |
+
{"ListViewSortColumnBackground", HIBrush, kThemeBrushListViewSortColumnBackground, NULL, 0, NULL },
|
| 116 |
+
{"ListViewBackground", HIBrush, kThemeBrushListViewBackground, NULL, 0, NULL },
|
| 117 |
+
{"IconLabelBackground", HIBrush, kThemeBrushIconLabelBackground, NULL, 0, NULL },
|
| 118 |
+
{"ListViewSeparator", HIBrush, kThemeBrushListViewSeparator, NULL, 0, NULL },
|
| 119 |
+
{"ChasingArrows", HIBrush, kThemeBrushChasingArrows, NULL, 0, NULL },
|
| 120 |
+
{"DragHilite", HIBrush, kThemeBrushDragHilite, NULL, 0, NULL },
|
| 121 |
+
{"DocumentWindowBackground", HIBrush, kThemeBrushDocumentWindowBackground, NULL, 0, NULL },
|
| 122 |
+
{"FinderWindowBackground", HIBrush, kThemeBrushFinderWindowBackground, NULL, 0, NULL },
|
| 123 |
+
{"ScrollBarDelimiterActive", HIBrush, kThemeBrushScrollBarDelimiterActive, NULL, 0, NULL },
|
| 124 |
+
{"ScrollBarDelimiterInactive", HIBrush, kThemeBrushScrollBarDelimiterInactive, NULL, 0, NULL },
|
| 125 |
+
{"FocusHighlight", HIBrush, kThemeBrushFocusHighlight, NULL, 0, NULL },
|
| 126 |
+
{"PopupArrowActive", HIBrush, kThemeBrushPopupArrowActive, NULL, 0, NULL },
|
| 127 |
+
{"PopupArrowPressed", HIBrush, kThemeBrushPopupArrowPressed, NULL, 0, NULL },
|
| 128 |
+
{"PopupArrowInactive", HIBrush, kThemeBrushPopupArrowInactive, NULL, 0, NULL },
|
| 129 |
+
{"AppleGuideCoachmark", HIBrush, kThemeBrushAppleGuideCoachmark, NULL, 0, NULL },
|
| 130 |
+
{"IconLabelBackgroundSelected", HIBrush, kThemeBrushIconLabelBackgroundSelected, NULL, 0, NULL },
|
| 131 |
+
{"StaticAreaFill", HIBrush, kThemeBrushStaticAreaFill, NULL, 0, NULL },
|
| 132 |
+
{"ActiveAreaFill", HIBrush, kThemeBrushActiveAreaFill, NULL, 0, NULL },
|
| 133 |
+
{"ButtonFrameActive", HIBrush, kThemeBrushButtonFrameActive, NULL, 0, NULL },
|
| 134 |
+
{"ButtonFrameInactive", HIBrush, kThemeBrushButtonFrameInactive, NULL, 0, NULL },
|
| 135 |
+
{"ButtonFaceActive", HIBrush, kThemeBrushButtonFaceActive, NULL, 0, NULL },
|
| 136 |
+
{"ButtonFaceInactive", HIBrush, kThemeBrushButtonFaceInactive, NULL, 0, NULL },
|
| 137 |
+
{"ButtonFacePressed", HIBrush, kThemeBrushButtonFacePressed, NULL, 0, NULL },
|
| 138 |
+
{"ButtonActiveDarkShadow", HIBrush, kThemeBrushButtonActiveDarkShadow, NULL, 0, NULL },
|
| 139 |
+
{"ButtonActiveDarkHighlight", HIBrush, kThemeBrushButtonActiveDarkHighlight, NULL, 0, NULL },
|
| 140 |
+
{"ButtonActiveLightShadow", HIBrush, kThemeBrushButtonActiveLightShadow, NULL, 0, NULL },
|
| 141 |
+
{"ButtonActiveLightHighlight", HIBrush, kThemeBrushButtonActiveLightHighlight, NULL, 0, NULL },
|
| 142 |
+
{"ButtonInactiveDarkShadow", HIBrush, kThemeBrushButtonInactiveDarkShadow, NULL, 0, NULL },
|
| 143 |
+
{"ButtonInactiveDarkHighlight", HIBrush, kThemeBrushButtonInactiveDarkHighlight, NULL, 0, NULL },
|
| 144 |
+
{"ButtonInactiveLightShadow", HIBrush, kThemeBrushButtonInactiveLightShadow, NULL, 0, NULL },
|
| 145 |
+
{"ButtonInactiveLightHighlight", HIBrush, kThemeBrushButtonInactiveLightHighlight, NULL, 0, NULL },
|
| 146 |
+
{"ButtonPressedDarkShadow", HIBrush, kThemeBrushButtonPressedDarkShadow, NULL, 0, NULL },
|
| 147 |
+
{"ButtonPressedDarkHighlight", HIBrush, kThemeBrushButtonPressedDarkHighlight, NULL, 0, NULL },
|
| 148 |
+
{"ButtonPressedLightShadow", HIBrush, kThemeBrushButtonPressedLightShadow, NULL, 0, NULL },
|
| 149 |
+
{"ButtonPressedLightHighlight", HIBrush, kThemeBrushButtonPressedLightHighlight, NULL, 0, NULL },
|
| 150 |
+
{"BevelActiveLight", HIBrush, kThemeBrushBevelActiveLight, NULL, 0, NULL },
|
| 151 |
+
{"BevelActiveDark", HIBrush, kThemeBrushBevelActiveDark, NULL, 0, NULL },
|
| 152 |
+
{"BevelInactiveLight", HIBrush, kThemeBrushBevelInactiveLight, NULL, 0, NULL },
|
| 153 |
+
{"BevelInactiveDark", HIBrush, kThemeBrushBevelInactiveDark, NULL, 0, NULL },
|
| 154 |
+
{"NotificationWindowBackground", HIBrush, kThemeBrushNotificationWindowBackground, NULL, 0, NULL },
|
| 155 |
+
{"MovableModalBackground", HIBrush, kThemeBrushMovableModalBackground, NULL, 0, NULL },
|
| 156 |
+
{"SheetBackgroundOpaque", HIBrush, kThemeBrushSheetBackgroundOpaque, NULL, 0, NULL },
|
| 157 |
+
{"DrawerBackground", HIBrush, kThemeBrushDrawerBackground, NULL, 0, NULL },
|
| 158 |
+
{"ToolbarBackground", HIBrush, kThemeBrushToolbarBackground, NULL, 0, NULL },
|
| 159 |
+
{"SheetBackgroundTransparent", HIBrush, kThemeBrushSheetBackgroundTransparent, NULL, 0, NULL },
|
| 160 |
+
{"MenuBackground", HIBrush, kThemeBrushMenuBackground, NULL, 0, NULL },
|
| 161 |
+
{"MenuBackgroundSelected", HIBrush, kThemeBrushMenuBackgroundSelected, NULL, 0, NULL },
|
| 162 |
+
{"ListViewOddRowBackground", HIBrush, kThemeBrushListViewOddRowBackground, NULL, 0, NULL },
|
| 163 |
+
{"ListViewEvenRowBackground", HIBrush, kThemeBrushListViewEvenRowBackground, NULL, 0, NULL },
|
| 164 |
+
{"ListViewColumnDivider", HIBrush, kThemeBrushListViewColumnDivider, NULL, 0, NULL },
|
| 165 |
+
|
| 166 |
+
{"ButtonText", HIText, kThemeTextColorPushButtonActive, NULL, 0, NULL },
|
| 167 |
+
{"MenuActiveText", HIText, kThemeTextColorMenuItemSelected, NULL, 0, NULL },
|
| 168 |
+
{"MenuDisabled", HIText, kThemeTextColorMenuItemDisabled, NULL, 0, NULL },
|
| 169 |
+
{"MenuText", HIText, kThemeTextColorMenuItemActive, NULL, 0, NULL },
|
| 170 |
+
{"BlackText", HIText, kThemeTextColorBlack, NULL, 0, NULL },
|
| 171 |
+
{"DialogActiveText", HIText, kThemeTextColorDialogActive, NULL, 0, NULL },
|
| 172 |
+
{"DialogInactiveText", HIText, kThemeTextColorDialogInactive, NULL, 0, NULL },
|
| 173 |
+
{"AlertActiveText", HIText, kThemeTextColorAlertActive, NULL, 0, NULL },
|
| 174 |
+
{"AlertInactiveText", HIText, kThemeTextColorAlertInactive, NULL, 0, NULL },
|
| 175 |
+
{"ModelessDialogActiveText", HIText, kThemeTextColorModelessDialogActive, NULL, 0, NULL },
|
| 176 |
+
{"ModelessDialogInactiveText", HIText, kThemeTextColorModelessDialogInactive, NULL, 0, NULL },
|
| 177 |
+
{"WindowHeaderActiveText", HIText, kThemeTextColorWindowHeaderActive, NULL, 0, NULL },
|
| 178 |
+
{"WindowHeaderInactiveText", HIText, kThemeTextColorWindowHeaderInactive, NULL, 0, NULL },
|
| 179 |
+
{"PlacardActiveText", HIText, kThemeTextColorPlacardActive, NULL, 0, NULL },
|
| 180 |
+
{"PlacardInactiveText", HIText, kThemeTextColorPlacardInactive, NULL, 0, NULL },
|
| 181 |
+
{"PlacardPressedText", HIText, kThemeTextColorPlacardPressed, NULL, 0, NULL },
|
| 182 |
+
{"PushButtonActiveText", HIText, kThemeTextColorPushButtonActive, NULL, 0, NULL },
|
| 183 |
+
{"PushButtonInactiveText", HIText, kThemeTextColorPushButtonInactive, NULL, 0, NULL },
|
| 184 |
+
{"PushButtonPressedText", HIText, kThemeTextColorPushButtonPressed, NULL, 0, NULL },
|
| 185 |
+
{"BevelButtonActiveText", HIText, kThemeTextColorBevelButtonActive, NULL, 0, NULL },
|
| 186 |
+
{"BevelButtonInactiveText", HIText, kThemeTextColorBevelButtonInactive, NULL, 0, NULL },
|
| 187 |
+
{"BevelButtonPressedText", HIText, kThemeTextColorBevelButtonPressed, NULL, 0, NULL },
|
| 188 |
+
{"PopupButtonActiveText", HIText, kThemeTextColorPopupButtonActive, NULL, 0, NULL },
|
| 189 |
+
{"PopupButtonInactiveText", HIText, kThemeTextColorPopupButtonInactive, NULL, 0, NULL },
|
| 190 |
+
{"PopupButtonPressedText", HIText, kThemeTextColorPopupButtonPressed, NULL, 0, NULL },
|
| 191 |
+
{"IconLabelText", HIText, kThemeTextColorIconLabel, NULL, 0, NULL },
|
| 192 |
+
{"ListViewText", HIText, kThemeTextColorListView, NULL, 0, NULL },
|
| 193 |
+
{"DocumentWindowTitleActiveText", HIText, kThemeTextColorDocumentWindowTitleActive, NULL, 0, NULL },
|
| 194 |
+
{"DocumentWindowTitleInactiveText", HIText, kThemeTextColorDocumentWindowTitleInactive, NULL, 0, NULL },
|
| 195 |
+
{"MovableModalWindowTitleActiveText", HIText, kThemeTextColorMovableModalWindowTitleActive, NULL, 0, NULL },
|
| 196 |
+
{"MovableModalWindowTitleInactiveText", HIText, kThemeTextColorMovableModalWindowTitleInactive, NULL, 0, NULL },
|
| 197 |
+
{"UtilityWindowTitleActiveText", HIText, kThemeTextColorUtilityWindowTitleActive, NULL, 0, NULL },
|
| 198 |
+
{"UtilityWindowTitleInactiveText", HIText, kThemeTextColorUtilityWindowTitleInactive, NULL, 0, NULL },
|
| 199 |
+
{"PopupWindowTitleActiveText", HIText, kThemeTextColorPopupWindowTitleActive, NULL, 0, NULL },
|
| 200 |
+
{"PopupWindowTitleInactiveText", HIText, kThemeTextColorPopupWindowTitleInactive, NULL, 0, NULL },
|
| 201 |
+
{"RootMenuActiveText", HIText, kThemeTextColorRootMenuActive, NULL, 0, NULL },
|
| 202 |
+
{"RootMenuSelectedText", HIText, kThemeTextColorRootMenuSelected, NULL, 0, NULL },
|
| 203 |
+
{"RootMenuDisabledText", HIText, kThemeTextColorRootMenuDisabled, NULL, 0, NULL },
|
| 204 |
+
{"MenuItemActiveText", HIText, kThemeTextColorMenuItemActive, NULL, 0, NULL },
|
| 205 |
+
{"MenuItemSelectedText", HIText, kThemeTextColorMenuItemSelected, NULL, 0, NULL },
|
| 206 |
+
{"MenuItemDisabledText", HIText, kThemeTextColorMenuItemDisabled, NULL, 0, NULL },
|
| 207 |
+
{"PopupLabelActiveText", HIText, kThemeTextColorPopupLabelActive, NULL, 0, NULL },
|
| 208 |
+
{"PopupLabelInactiveText", HIText, kThemeTextColorPopupLabelInactive, NULL, 0, NULL },
|
| 209 |
+
{"TabFrontActiveText", HIText, kThemeTextColorTabFrontActive, NULL, 0, NULL },
|
| 210 |
+
{"TabNonFrontActiveText", HIText, kThemeTextColorTabNonFrontActive, NULL, 0, NULL },
|
| 211 |
+
{"TabNonFrontPressedText", HIText, kThemeTextColorTabNonFrontPressed, NULL, 0, NULL },
|
| 212 |
+
{"TabFrontInactiveText", HIText, kThemeTextColorTabFrontInactive, NULL, 0, NULL },
|
| 213 |
+
{"TabNonFrontInactiveText", HIText, kThemeTextColorTabNonFrontInactive, NULL, 0, NULL },
|
| 214 |
+
{"IconLabelSelectedText", HIText, kThemeTextColorIconLabelSelected, NULL, 0, NULL },
|
| 215 |
+
{"BevelButtonStickyActiveText", HIText, kThemeTextColorBevelButtonStickyActive, NULL, 0, NULL },
|
| 216 |
+
{"BevelButtonStickyInactiveText", HIText, kThemeTextColorBevelButtonStickyInactive, NULL, 0, NULL },
|
| 217 |
+
{"NotificationText", HIText, kThemeTextColorNotification, NULL, 0, NULL },
|
| 218 |
+
{"SystemDetailText", HIText, kThemeTextColorSystemDetail, NULL, 0, NULL },
|
| 219 |
+
{"PlacardBackground", HIBackground, kThemeBackgroundPlacard, NULL, 0, NULL },
|
| 220 |
+
{"WindowHeaderBackground", HIBackground, kThemeBackgroundWindowHeader, NULL, 0, NULL },
|
| 221 |
+
{"ListViewWindowHeaderBackground", HIBackground, kThemeBackgroundListViewWindowHeader, NULL, 0, NULL },
|
| 222 |
+
{"MetalBackground", HIBackground, kThemeBackgroundMetal, NULL, 0, NULL },
|
| 223 |
+
|
| 224 |
+
{"SecondaryGroupBoxBackground", HIBackground, kThemeBackgroundSecondaryGroupBox, NULL, 0, NULL },
|
| 225 |
+
{"TabPaneBackground", HIBackground, kThemeBackgroundTabPane, NULL, 0, NULL },
|
| 226 |
+
{"WhiteText", HIText, kThemeTextColorWhite, NULL, 0, NULL },
|
| 227 |
+
{"Black", HIBrush, kThemeBrushBlack, NULL, 0, NULL },
|
| 228 |
+
{"White", HIBrush, kThemeBrushWhite, NULL, 0, NULL },
|
| 229 |
+
|
| 230 |
+
/*
|
| 231 |
+
* Dynamic Colors
|
| 232 |
+
*/
|
| 233 |
+
|
| 234 |
+
{"WindowBackgroundColor", ttkBackground, 0, NULL, 0, NULL },
|
| 235 |
+
{"WindowBackgroundColor1", ttkBackground, 1, NULL, 0, NULL },
|
| 236 |
+
{"WindowBackgroundColor2", ttkBackground, 2, NULL, 0, NULL },
|
| 237 |
+
{"WindowBackgroundColor3", ttkBackground, 3, NULL, 0, NULL },
|
| 238 |
+
{"WindowBackgroundColor4", ttkBackground, 4, NULL, 0, NULL },
|
| 239 |
+
{"WindowBackgroundColor5", ttkBackground, 5, NULL, 0, NULL },
|
| 240 |
+
{"WindowBackgroundColor6", ttkBackground, 6, NULL, 0, NULL },
|
| 241 |
+
{"WindowBackgroundColor7", ttkBackground, 7, NULL, 0, NULL },
|
| 242 |
+
/* Apple's SecondaryLabelColor is the same as their LabelColor so we roll our own. */
|
| 243 |
+
{"SecondaryLabelColor", ttkBackground, 14, NULL, 0, NULL },
|
| 244 |
+
/* Color to use for notebook tab label text -- depends on OS version. */
|
| 245 |
+
{"SelectedTabTextColor", semantic, 0, "textColor", 0, NULL },
|
| 246 |
+
/* Color to use for selected button labels -- depends on OS version. */
|
| 247 |
+
{"PressedButtonTextColor", semantic, 0, "textColor", 0, NULL },
|
| 248 |
+
/* Semantic colors that we simulate on older systems which don't supoort them. */
|
| 249 |
+
{"SelectedMenuItemTextColor", semantic, 0, "selectedMenuItemTextColor", 0, NULL },
|
| 250 |
+
{"ControlAccentColor", semantic, 0, "controlAccentColor", 0, NULL },
|
| 251 |
+
{"LabelColor", semantic, 0, "blackColor", 0, NULL },
|
| 252 |
+
{"LinkColor", semantic, 0, "blueColor", 0, NULL },
|
| 253 |
+
{"PlaceholderTextColor", semantic, 0, "grayColor", 0, NULL },
|
| 254 |
+
{"SeparatorColor", semantic, 0, "grayColor", 0, NULL },
|
| 255 |
+
{"UnemphasizedSelectedTextBackgroundColor", semantic, 0, "grayColor", 0, NULL },
|
| 256 |
+
{NULL, rgbColor, 0, NULL, 0, NULL }
|
| 257 |
+
};
|
| 258 |
+
|
| 259 |
+
#endif
|
| 260 |
+
/*
|
| 261 |
+
* Local Variables:
|
| 262 |
+
* mode: objc
|
| 263 |
+
* c-basic-offset: 4
|
| 264 |
+
* fill-column: 79
|
| 265 |
+
* coding: utf-8
|
| 266 |
+
* End:
|
| 267 |
+
*/
|
deepseek/include/tkMacOSXConstants.h
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXConstants.h --
|
| 3 |
+
*
|
| 4 |
+
* Macros which map the names of NS constants used in the Tk code to
|
| 5 |
+
* the new name that Apple came up with for subsequent versions of the
|
| 6 |
+
* operating system. (Each new OS release seems to come with a new
|
| 7 |
+
* naming convention for the same old constants.)
|
| 8 |
+
*
|
| 9 |
+
* Copyright (c) 2017 Marc Culler
|
| 10 |
+
*
|
| 11 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 12 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
#ifndef _TKMACCONSTANTS
|
| 16 |
+
#define _TKMACCONSTANTS
|
| 17 |
+
|
| 18 |
+
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
| 19 |
+
#define NSFullScreenWindowMask (1 << 14)
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1090
|
| 23 |
+
typedef NSInteger NSModalResponse;
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
/*
|
| 27 |
+
* Let's raise a glass for the project manager who improves our lives by
|
| 28 |
+
* generating deprecation warnings about pointless changes of the names
|
| 29 |
+
* of constants.
|
| 30 |
+
*/
|
| 31 |
+
|
| 32 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
| 33 |
+
#define kCTFontDefaultOrientation kCTFontOrientationDefault
|
| 34 |
+
#define kCTFontVerticalOrientation kCTFontOrientationVertical
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
|
| 38 |
+
#define NSOKButton NSModalResponseOK
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
|
| 42 |
+
#define kCTFontUserFixedPitchFontType kCTFontUIFontUserFixedPitch
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
|
| 46 |
+
#define NSAppKitDefined NSEventTypeAppKitDefined
|
| 47 |
+
#define NSApplicationDefined NSEventTypeApplicationDefined
|
| 48 |
+
#define NSApplicationActivatedEventType NSEventSubtypeApplicationActivated
|
| 49 |
+
#define NSApplicationDeactivatedEventType NSEventSubtypeApplicationDeactivated
|
| 50 |
+
#define NSWindowExposedEventType NSEventSubtypeWindowExposed
|
| 51 |
+
#define NSScreenChangedEventType NSEventSubtypeScreenChanged
|
| 52 |
+
#define NSWindowMovedEventType NSEventSubtypeWindowMoved
|
| 53 |
+
#define NSKeyUp NSEventTypeKeyUp
|
| 54 |
+
#define NSKeyDown NSEventTypeKeyDown
|
| 55 |
+
#define NSFlagsChanged NSEventTypeFlagsChanged
|
| 56 |
+
#define NSLeftMouseDown NSEventTypeLeftMouseDown
|
| 57 |
+
#define NSLeftMouseUp NSEventTypeLeftMouseUp
|
| 58 |
+
#define NSRightMouseDown NSEventTypeRightMouseDown
|
| 59 |
+
#define NSRightMouseUp NSEventTypeRightMouseUp
|
| 60 |
+
#define NSLeftMouseDragged NSEventTypeLeftMouseDragged
|
| 61 |
+
#define NSRightMouseDragged NSEventTypeRightMouseDragged
|
| 62 |
+
#define NSMouseMoved NSEventTypeMouseMoved
|
| 63 |
+
#define NSMouseEntered NSEventTypeMouseEntered
|
| 64 |
+
#define NSMouseExited NSEventTypeMouseExited
|
| 65 |
+
#define NSScrollWheel NSEventTypeScrollWheel
|
| 66 |
+
#define NSOtherMouseDown NSEventTypeOtherMouseDown
|
| 67 |
+
#define NSOtherMouseUp NSEventTypeOtherMouseUp
|
| 68 |
+
#define NSOtherMouseDragged NSEventTypeOtherMouseDragged
|
| 69 |
+
#define NSTabletPoint NSEventTypeTabletPoint
|
| 70 |
+
#define NSTabletProximity NSEventTypeTabletProximity
|
| 71 |
+
#define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask
|
| 72 |
+
#define NSCommandKeyMask NSEventModifierFlagCommand
|
| 73 |
+
#define NSShiftKeyMask NSEventModifierFlagShift
|
| 74 |
+
#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
|
| 75 |
+
#define NSAlternateKeyMask NSEventModifierFlagOption
|
| 76 |
+
#define NSControlKeyMask NSEventModifierFlagControl
|
| 77 |
+
#define NSNumericPadKeyMask NSEventModifierFlagNumericPad
|
| 78 |
+
#define NSFunctionKeyMask NSEventModifierFlagFunction
|
| 79 |
+
#define NSCursorUpdate NSEventTypeCursorUpdate
|
| 80 |
+
#define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground
|
| 81 |
+
#define NSCompositeCopy NSCompositingOperationCopy
|
| 82 |
+
#define NSWarningAlertStyle NSAlertStyleWarning
|
| 83 |
+
#define NSInformationalAlertStyle NSAlertStyleInformational
|
| 84 |
+
#define NSCriticalAlertStyle NSAlertStyleCritical
|
| 85 |
+
#define NSCenterTextAlignment NSTextAlignmentCenter
|
| 86 |
+
#define NSApplicationDefinedMask NSEventMaskApplicationDefined
|
| 87 |
+
#define NSUtilityWindowMask NSWindowStyleMaskUtilityWindow
|
| 88 |
+
#define NSNonactivatingPanelMask NSWindowStyleMaskNonactivatingPanel
|
| 89 |
+
#define NSDocModalWindowMask NSWindowStyleMaskDocModalWindow
|
| 90 |
+
#define NSHUDWindowMask NSWindowStyleMaskHUDWindow
|
| 91 |
+
#define NSTitledWindowMask NSWindowStyleMaskTitled
|
| 92 |
+
#define NSClosableWindowMask NSWindowStyleMaskClosable
|
| 93 |
+
#define NSResizableWindowMask NSWindowStyleMaskResizable
|
| 94 |
+
#define NSUnifiedTitleAndToolbarWindowMask NSWindowStyleMaskUnifiedTitleAndToolbar
|
| 95 |
+
#define NSMiniaturizableWindowMask NSWindowStyleMaskMiniaturizable
|
| 96 |
+
#define NSBorderlessWindowMask NSWindowStyleMaskBorderless
|
| 97 |
+
#define NSFullScreenWindowMask NSWindowStyleMaskFullScreen
|
| 98 |
+
#define NSAlphaFirstBitmapFormat NSBitmapFormatAlphaFirst
|
| 99 |
+
#define NSAnyEventMask NSEventMaskAny
|
| 100 |
+
#define NSLeftMouseDownMask NSEventMaskLeftMouseDown
|
| 101 |
+
#define NSMouseMovedMask NSEventMaskMouseMoved
|
| 102 |
+
#define NSLeftMouseDraggedMask NSEventMaskLeftMouseDragged
|
| 103 |
+
#endif
|
| 104 |
+
|
| 105 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
|
| 106 |
+
#define NSStringPboardType NSPasteboardTypeString
|
| 107 |
+
#define NSOnState NSControlStateValueOn
|
| 108 |
+
#define NSOffState NSControlStateValueOff
|
| 109 |
+
#endif
|
| 110 |
+
|
| 111 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
|
| 112 |
+
#define NSWindowStyleMaskTexturedBackground 0
|
| 113 |
+
#endif
|
| 114 |
+
|
| 115 |
+
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
|
| 116 |
+
#define GET_NSCONTEXT(context, flip) [NSGraphicsContext \
|
| 117 |
+
graphicsContextWithGraphicsPort:context flipped:flip]
|
| 118 |
+
#else
|
| 119 |
+
#define GET_NSCONTEXT(context, flip) [NSGraphicsContext \
|
| 120 |
+
graphicsContextWithCGContext:context flipped:NO]
|
| 121 |
+
#endif
|
| 122 |
+
|
| 123 |
+
#endif
|
deepseek/include/tkMacOSXCursors.h
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXCursors.h --
|
| 3 |
+
*
|
| 4 |
+
* This file defines a set of Macintosh cursor resources that
|
| 5 |
+
* are only available on the Macintosh platform.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
| 8 |
+
* Copyright 2008-2009, Apple Inc.
|
| 9 |
+
* Copyright (c) 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 10 |
+
*
|
| 11 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 12 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
static const unsigned char tkMacOSXCursors[][68] = {
|
| 16 |
+
|
| 17 |
+
#define TK_MAC_CURSOR_hand 0
|
| 18 |
+
[TK_MAC_CURSOR_hand] = {
|
| 19 |
+
0x01, 0x80, 0x1A, 0x70, 0x26, 0x48, 0x26, 0x4A, 0x12, 0x4D, 0x12, 0x49, 0x68, 0x09, 0x98, 0x01,
|
| 20 |
+
0x88, 0x02, 0x40, 0x02, 0x20, 0x02, 0x20, 0x04, 0x10, 0x04, 0x08, 0x08, 0x04, 0x08, 0x04, 0x08,
|
| 21 |
+
0x01, 0x80, 0x1B, 0xF0, 0x3F, 0xF8, 0x3F, 0xFA, 0x1F, 0xFF, 0x1F, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF,
|
| 22 |
+
0xFF, 0xFE, 0x7F, 0xFE, 0x3F, 0xFE, 0x3F, 0xFC, 0x1F, 0xFC, 0x0F, 0xF8, 0x07, 0xF8, 0x07, 0xF8,
|
| 23 |
+
0x00, 0x09, 0x00, 0x08,
|
| 24 |
+
},
|
| 25 |
+
|
| 26 |
+
#define TK_MAC_CURSOR_bucket 2
|
| 27 |
+
[TK_MAC_CURSOR_bucket] = {
|
| 28 |
+
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0x80, 0x09, 0x40, 0x0B, 0x30, 0x0D, 0x18, 0x09, 0x0C,
|
| 29 |
+
0x12, 0x9C, 0x21, 0x2C, 0x10, 0x4C, 0x08, 0x8C, 0x05, 0x0C, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00,
|
| 30 |
+
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0x80, 0x09, 0xC0, 0x0B, 0xF0, 0x0F, 0xF8, 0x0F, 0xFC,
|
| 31 |
+
0x1F, 0xFC, 0x3F, 0xEC, 0x1F, 0xCC, 0x0F, 0x8C, 0x07, 0x0C, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00,
|
| 32 |
+
0x00, 0x0D, 0x00, 0x0C,
|
| 33 |
+
},
|
| 34 |
+
|
| 35 |
+
#define TK_MAC_CURSOR_cancel 3
|
| 36 |
+
[TK_MAC_CURSOR_cancel] = {
|
| 37 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x80, 0x4A, 0x40, 0x4A, 0x40, 0x3F, 0x80,
|
| 38 |
+
0x0A, 0x00, 0x3F, 0x80, 0x4A, 0x40, 0x4A, 0x46, 0x31, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 39 |
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x80, 0x7B, 0xC0, 0xFF, 0xE0, 0xFF, 0xE0, 0x7F, 0xC0,
|
| 40 |
+
0x3F, 0x80, 0x7F, 0xC0, 0xFF, 0xE6, 0xFF, 0xEF, 0x7B, 0xCF, 0x31, 0x86, 0x00, 0x00, 0x00, 0x00,
|
| 41 |
+
0x00, 0x08, 0x00, 0x05,
|
| 42 |
+
},
|
| 43 |
+
|
| 44 |
+
#define TK_MAC_CURSOR_resize 4
|
| 45 |
+
[TK_MAC_CURSOR_resize] = {
|
| 46 |
+
0xFF, 0xFF, 0x80, 0x01, 0xBF, 0x01, 0xA1, 0x81, 0xA1, 0xF9, 0xA1, 0x8D, 0xA1, 0x8D, 0xBF, 0x8D,
|
| 47 |
+
0x9F, 0x8D, 0x88, 0x0D, 0x88, 0x0D, 0x88, 0x0D, 0x8F, 0xFD, 0x87, 0xFD, 0x80, 0x01, 0xFF, 0xFF,
|
| 48 |
+
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 49 |
+
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 50 |
+
0x00, 0x08, 0x00, 0x08,
|
| 51 |
+
},
|
| 52 |
+
|
| 53 |
+
#define TK_MAC_CURSOR_eyedrop 5
|
| 54 |
+
[TK_MAC_CURSOR_eyedrop] = {
|
| 55 |
+
0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xB8, 0x01, 0x18, 0x02, 0x28,
|
| 56 |
+
0x04, 0x40, 0x08, 0x80, 0x11, 0x00, 0x22, 0x00, 0x44, 0x00, 0x48, 0x00, 0xB0, 0x00, 0x40, 0x00,
|
| 57 |
+
0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xF8, 0x01, 0xF8, 0x03, 0xE8,
|
| 58 |
+
0x07, 0xC0, 0x0F, 0x80, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x40, 0x00,
|
| 59 |
+
0x00, 0x0F, 0x00, 0x00,
|
| 60 |
+
},
|
| 61 |
+
|
| 62 |
+
#define TK_MAC_CURSOR_eyedrop_full 6
|
| 63 |
+
[TK_MAC_CURSOR_eyedrop_full] = {
|
| 64 |
+
0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xB8, 0x01, 0x18, 0x03, 0x28,
|
| 65 |
+
0x07, 0xC0, 0x0F, 0x80, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x40, 0x00,
|
| 66 |
+
0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xF8, 0x01, 0xF8, 0x03, 0xE8,
|
| 67 |
+
0x07, 0xC0, 0x0F, 0x80, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x40, 0x00,
|
| 68 |
+
0x00, 0x0F, 0x00, 0x00,
|
| 69 |
+
},
|
| 70 |
+
|
| 71 |
+
#define TK_MAC_CURSOR_zoom_in 7
|
| 72 |
+
[TK_MAC_CURSOR_zoom_in] = {
|
| 73 |
+
0x07, 0x80, 0x18, 0x60, 0x27, 0x90, 0x58, 0x68, 0x53, 0x28, 0xA3, 0x14, 0xAF, 0xD4, 0xAF, 0xD4,
|
| 74 |
+
0xA3, 0x14, 0x53, 0x28, 0x58, 0x68, 0x27, 0x98, 0x18, 0x7C, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
|
| 75 |
+
0x07, 0x80, 0x1F, 0xE0, 0x3F, 0xF0, 0x78, 0x78, 0x73, 0x38, 0xE3, 0x1C, 0xEF, 0xDC, 0xEF, 0xDC,
|
| 76 |
+
0xE3, 0x1C, 0x73, 0x38, 0x78, 0x78, 0x3F, 0xF8, 0x1F, 0xFC, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
|
| 77 |
+
0x00, 0x07, 0x00, 0x07,
|
| 78 |
+
},
|
| 79 |
+
|
| 80 |
+
#define TK_MAC_CURSOR_zoom_out 8
|
| 81 |
+
[TK_MAC_CURSOR_zoom_out] = {
|
| 82 |
+
0x07, 0x80, 0x18, 0x60, 0x27, 0x90, 0x58, 0x68, 0x50, 0x28, 0xA0, 0x14, 0xAF, 0xD4, 0xAF, 0xD4,
|
| 83 |
+
0xA0, 0x14, 0x50, 0x28, 0x58, 0x68, 0x27, 0x98, 0x18, 0x7C, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
|
| 84 |
+
0x07, 0x80, 0x1F, 0xE0, 0x3F, 0xF0, 0x78, 0x78, 0x70, 0x38, 0xE0, 0x1C, 0xEF, 0xDC, 0xEF, 0xDC,
|
| 85 |
+
0xE0, 0x1C, 0x70, 0x38, 0x78, 0x78, 0x3F, 0xF8, 0x1F, 0xFC, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
|
| 86 |
+
0x00, 0x07, 0x00, 0x07,
|
| 87 |
+
},
|
| 88 |
+
|
| 89 |
+
};
|
deepseek/include/tkMacOSXDebug.h
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXDebug.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of Macintosh specific functions for debugging MacOS events,
|
| 5 |
+
* regions, etc...
|
| 6 |
+
*
|
| 7 |
+
* Copyright 2001-2009, Apple Inc.
|
| 8 |
+
* Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 11 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _TKMACDEBUG
|
| 15 |
+
#define _TKMACDEBUG
|
| 16 |
+
|
| 17 |
+
#ifndef _TKMACINT
|
| 18 |
+
#include "tkMacOSXInt.h"
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
#ifdef TK_MAC_DEBUG
|
| 22 |
+
|
| 23 |
+
MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol);
|
| 24 |
+
|
| 25 |
+
/* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */
|
| 26 |
+
#define TkMacOSXInitNamedDebugSymbol(module, ret, symbol, ...) \
|
| 27 |
+
static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
|
| 28 |
+
if (symbol == (void*)(-1L)) { \
|
| 29 |
+
symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
#endif /* TK_MAC_DEBUG */
|
| 33 |
+
|
| 34 |
+
#endif
|
deepseek/include/tkMacOSXDefault.h
ADDED
|
@@ -0,0 +1,570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXDefault.h --
|
| 3 |
+
*
|
| 4 |
+
* This file defines the defaults for all options for all of
|
| 5 |
+
* the Tk widgets.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1991-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
| 9 |
+
* Copyright 2001-2009, Apple Inc.
|
| 10 |
+
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 11 |
+
*
|
| 12 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 13 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef _TKMACDEFAULT
|
| 17 |
+
#define _TKMACDEFAULT
|
| 18 |
+
|
| 19 |
+
//#ifndef TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
|
| 20 |
+
//#define TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS 1
|
| 21 |
+
//#endif
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* The definitions below provide symbolic names for the default colors.
|
| 25 |
+
* NORMAL_BG - Normal background color.
|
| 26 |
+
* NORMAL_FG - Normal foreground color.
|
| 27 |
+
* ACTIVE_BG - Background color when widget is active.
|
| 28 |
+
* ACTIVE_FG - Foreground color when widget is active.
|
| 29 |
+
* SELECT_BG - Background color for selected text.
|
| 30 |
+
* SELECT_FG - Foreground color for selected text.
|
| 31 |
+
* TROUGH - Background color for troughs in scales and scrollbars.
|
| 32 |
+
* INDICATOR - Color for indicator when button is selected.
|
| 33 |
+
* DISABLED - Foreground color when widget is disabled.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#define BLACK "Black"
|
| 37 |
+
#define WHITE "White"
|
| 38 |
+
#define NORMAL_BG "systemWindowBackgroundColor"
|
| 39 |
+
#define TEXT_BG "systemTextBackgroundColor"
|
| 40 |
+
#define NORMAL_FG "systemTextColor"
|
| 41 |
+
#define ACTIVE_BG "systemWindowBackgroundColor"
|
| 42 |
+
#define ACTIVE_FG "systemTextColor"
|
| 43 |
+
#define SELECT_BG "systemSelectedTextBackgroundColor"
|
| 44 |
+
#define SELECT_FG "systemSelectedTextColor"
|
| 45 |
+
#define INACTIVE_SELECT_BG "systemUnemphasizedSelectedTextBackgroundColor"
|
| 46 |
+
#define TROUGH "#c3c3c3"
|
| 47 |
+
#define INDICATOR "#b03060"
|
| 48 |
+
#define DISABLED "#a3a3a3"
|
| 49 |
+
#define IGNORED "#abcdef"
|
| 50 |
+
|
| 51 |
+
/*
|
| 52 |
+
* Defaults for labels, buttons, checkbuttons, and radiobuttons:
|
| 53 |
+
*/
|
| 54 |
+
|
| 55 |
+
#define DEF_BUTTON_ANCHOR "center"
|
| 56 |
+
#define DEF_BUTTON_ACTIVE_BG_COLOR ACTIVE_BG
|
| 57 |
+
#define DEF_BUTTON_ACTIVE_BG_MONO BLACK
|
| 58 |
+
#define DEF_BUTTON_ACTIVE_FG_COLOR "systemPressedButtonTextColor"
|
| 59 |
+
#define DEF_CHKRAD_ACTIVE_FG_COLOR ACTIVE_FG
|
| 60 |
+
#define DEF_BUTTON_ACTIVE_FG_MONO WHITE
|
| 61 |
+
#define DEF_BUTTON_BG_COLOR NORMAL_BG
|
| 62 |
+
#define DEF_BUTTON_BG_MONO WHITE
|
| 63 |
+
#define DEF_BUTTON_BITMAP ""
|
| 64 |
+
#define DEF_BUTTON_BORDER_WIDTH "2"
|
| 65 |
+
#define DEF_BUTTON_CURSOR ""
|
| 66 |
+
#define DEF_BUTTON_COMMAND ""
|
| 67 |
+
#define DEF_BUTTON_COMPOUND "none"
|
| 68 |
+
#define DEF_BUTTON_DEFAULT "disabled"
|
| 69 |
+
#define DEF_BUTTON_DISABLED_FG_COLOR DISABLED
|
| 70 |
+
#define DEF_BUTTON_DISABLED_FG_MONO ""
|
| 71 |
+
#define DEF_BUTTON_FG BLACK
|
| 72 |
+
#define DEF_LABEL_FG NORMAL_FG
|
| 73 |
+
#define DEF_CHKRAD_FG DEF_LABEL_FG
|
| 74 |
+
#define DEF_BUTTON_FONT "TkDefaultFont"
|
| 75 |
+
#define DEF_BUTTON_HEIGHT "0"
|
| 76 |
+
#define DEF_BUTTON_HIGHLIGHT_BG_COLOR DEF_BUTTON_BG_COLOR
|
| 77 |
+
#define DEF_BUTTON_HIGHLIGHT_BG_MONO DEF_BUTTON_BG_MONO
|
| 78 |
+
#define DEF_BUTTON_HIGHLIGHT NORMAL_FG
|
| 79 |
+
#define DEF_LABEL_HIGHLIGHT_WIDTH "0"
|
| 80 |
+
//#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
|
| 81 |
+
//#define DEF_BUTTON_HIGHLIGHT_WIDTH "4"
|
| 82 |
+
//#define DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM "1"
|
| 83 |
+
//#else
|
| 84 |
+
#define DEF_BUTTON_HIGHLIGHT_WIDTH "1"
|
| 85 |
+
//#endif
|
| 86 |
+
#define DEF_BUTTON_IMAGE NULL
|
| 87 |
+
#define DEF_BUTTON_INDICATOR "1"
|
| 88 |
+
#define DEF_BUTTON_JUSTIFY "center"
|
| 89 |
+
#define DEF_BUTTON_OFF_VALUE "0"
|
| 90 |
+
#define DEF_BUTTON_ON_VALUE "1"
|
| 91 |
+
#define DEF_BUTTON_TRISTATE_VALUE ""
|
| 92 |
+
#define DEF_BUTTON_OVER_RELIEF ""
|
| 93 |
+
#define DEF_BUTTON_PADX "1"
|
| 94 |
+
#define DEF_LABCHKRAD_PADX "1"
|
| 95 |
+
#define DEF_BUTTON_PADY "1"
|
| 96 |
+
#define DEF_LABCHKRAD_PADY "1"
|
| 97 |
+
#define DEF_BUTTON_RELIEF "flat"
|
| 98 |
+
#define DEF_LABCHKRAD_RELIEF "flat"
|
| 99 |
+
#define DEF_BUTTON_REPEAT_DELAY "0"
|
| 100 |
+
#define DEF_BUTTON_REPEAT_INTERVAL "0"
|
| 101 |
+
#define DEF_BUTTON_SELECT_COLOR INDICATOR
|
| 102 |
+
#define DEF_BUTTON_SELECT_MONO BLACK
|
| 103 |
+
#define DEF_BUTTON_SELECT_IMAGE NULL
|
| 104 |
+
#define DEF_BUTTON_STATE "normal"
|
| 105 |
+
#define DEF_LABEL_TAKE_FOCUS "0"
|
| 106 |
+
#define DEF_BUTTON_TAKE_FOCUS NULL
|
| 107 |
+
#define DEF_BUTTON_TEXT ""
|
| 108 |
+
#define DEF_BUTTON_TEXT_VARIABLE ""
|
| 109 |
+
#define DEF_BUTTON_UNDERLINE "-1"
|
| 110 |
+
#define DEF_BUTTON_VALUE ""
|
| 111 |
+
#define DEF_BUTTON_WIDTH "0"
|
| 112 |
+
#define DEF_BUTTON_WRAP_LENGTH "0"
|
| 113 |
+
#define DEF_RADIOBUTTON_VARIABLE "selectedButton"
|
| 114 |
+
#define DEF_CHECKBUTTON_VARIABLE ""
|
| 115 |
+
|
| 116 |
+
/*
|
| 117 |
+
* Defaults for canvases:
|
| 118 |
+
*/
|
| 119 |
+
|
| 120 |
+
#define DEF_CANVAS_BG_COLOR NORMAL_BG
|
| 121 |
+
#define DEF_CANVAS_BG_MONO WHITE
|
| 122 |
+
#define DEF_CANVAS_BORDER_WIDTH "0"
|
| 123 |
+
#define DEF_CANVAS_CLOSE_ENOUGH "1"
|
| 124 |
+
#define DEF_CANVAS_CONFINE "1"
|
| 125 |
+
#define DEF_CANVAS_CURSOR ""
|
| 126 |
+
#define DEF_CANVAS_HEIGHT "7c"
|
| 127 |
+
#define DEF_CANVAS_HIGHLIGHT_BG NORMAL_BG
|
| 128 |
+
#define DEF_CANVAS_HIGHLIGHT NORMAL_FG
|
| 129 |
+
#define DEF_CANVAS_HIGHLIGHT_WIDTH "3"
|
| 130 |
+
#define DEF_CANVAS_INSERT_BG BLACK
|
| 131 |
+
#define DEF_CANVAS_INSERT_BD_COLOR "0"
|
| 132 |
+
#define DEF_CANVAS_INSERT_BD_MONO "0"
|
| 133 |
+
#define DEF_CANVAS_INSERT_OFF_TIME "300"
|
| 134 |
+
#define DEF_CANVAS_INSERT_ON_TIME "600"
|
| 135 |
+
#define DEF_CANVAS_INSERT_WIDTH "2"
|
| 136 |
+
#define DEF_CANVAS_RELIEF "flat"
|
| 137 |
+
#define DEF_CANVAS_SCROLL_REGION ""
|
| 138 |
+
#define DEF_CANVAS_SELECT_COLOR SELECT_BG
|
| 139 |
+
#define DEF_CANVAS_SELECT_MONO BLACK
|
| 140 |
+
#define DEF_CANVAS_SELECT_BD_COLOR "1"
|
| 141 |
+
#define DEF_CANVAS_SELECT_BD_MONO "0"
|
| 142 |
+
#define DEF_CANVAS_SELECT_FG_COLOR SELECT_FG
|
| 143 |
+
#define DEF_CANVAS_SELECT_FG_MONO WHITE
|
| 144 |
+
#define DEF_CANVAS_TAKE_FOCUS NULL
|
| 145 |
+
#define DEF_CANVAS_WIDTH "10c"
|
| 146 |
+
#define DEF_CANVAS_X_SCROLL_CMD ""
|
| 147 |
+
#define DEF_CANVAS_X_SCROLL_INCREMENT "0"
|
| 148 |
+
#define DEF_CANVAS_Y_SCROLL_CMD ""
|
| 149 |
+
#define DEF_CANVAS_Y_SCROLL_INCREMENT "0"
|
| 150 |
+
|
| 151 |
+
/*
|
| 152 |
+
* Defaults for entries:
|
| 153 |
+
*/
|
| 154 |
+
|
| 155 |
+
/*
|
| 156 |
+
* I test the following two values in TkpDrawEntryBorderAndFocus
|
| 157 |
+
* to determine whether to use the native entry widget. So if
|
| 158 |
+
* you change the defaults to be different from these, then you
|
| 159 |
+
* won't get the native widget by default.
|
| 160 |
+
*/
|
| 161 |
+
|
| 162 |
+
#define MAC_OSX_FOCUS_WIDTH 3
|
| 163 |
+
#define MAC_OSX_ENTRY_BORDER 2
|
| 164 |
+
#define MAC_OSX_ENTRY_RELIEF TK_RELIEF_SUNKEN
|
| 165 |
+
#define MAC_OSX_ENTRY_SELECT_RELIEF TK_RELIEF_FLAT
|
| 166 |
+
|
| 167 |
+
#define DEF_ENTRY_BG_COLOR TEXT_BG
|
| 168 |
+
#define DEF_ENTRY_BG_MONO WHITE
|
| 169 |
+
#define DEF_ENTRY_BORDER_WIDTH "2"
|
| 170 |
+
#define DEF_ENTRY_CURSOR "xterm"
|
| 171 |
+
#define DEF_ENTRY_DISABLED_BG_COLOR NORMAL_BG
|
| 172 |
+
#define DEF_ENTRY_DISABLED_BG_MONO WHITE
|
| 173 |
+
#define DEF_ENTRY_DISABLED_FG DISABLED
|
| 174 |
+
#define DEF_ENTRY_EXPORT_SELECTION "1"
|
| 175 |
+
#define DEF_ENTRY_FONT "TkTextFont"
|
| 176 |
+
#define DEF_ENTRY_FG NORMAL_FG
|
| 177 |
+
#define DEF_ENTRY_HIGHLIGHT_BG NORMAL_BG
|
| 178 |
+
#define DEF_ENTRY_HIGHLIGHT NORMAL_FG
|
| 179 |
+
#define DEF_ENTRY_HIGHLIGHT_WIDTH "3"
|
| 180 |
+
#define DEF_ENTRY_INSERT_BG NORMAL_FG
|
| 181 |
+
#define DEF_ENTRY_INSERT_BD_COLOR "0"
|
| 182 |
+
#define DEF_ENTRY_INSERT_BD_MONO "0"
|
| 183 |
+
#define DEF_ENTRY_INSERT_OFF_TIME "300"
|
| 184 |
+
#define DEF_ENTRY_INSERT_ON_TIME "600"
|
| 185 |
+
#define DEF_ENTRY_INSERT_WIDTH "1"
|
| 186 |
+
#define DEF_ENTRY_JUSTIFY "left"
|
| 187 |
+
#define DEF_ENTRY_READONLY_BG_COLOR NORMAL_BG
|
| 188 |
+
#define DEF_ENTRY_READONLY_BG_MONO WHITE
|
| 189 |
+
#define DEF_ENTRY_RELIEF "sunken"
|
| 190 |
+
#define DEF_ENTRY_SCROLL_COMMAND ""
|
| 191 |
+
#define DEF_ENTRY_SELECT_COLOR SELECT_BG
|
| 192 |
+
#define DEF_ENTRY_SELECT_MONO BLACK
|
| 193 |
+
#define DEF_ENTRY_SELECT_BD_COLOR "1"
|
| 194 |
+
#define DEF_ENTRY_SELECT_BD_MONO "0"
|
| 195 |
+
#define DEF_ENTRY_SELECT_FG_COLOR SELECT_FG
|
| 196 |
+
#define DEF_ENTRY_SELECT_FG_MONO WHITE
|
| 197 |
+
#define DEF_ENTRY_SHOW NULL
|
| 198 |
+
#define DEF_ENTRY_STATE "normal"
|
| 199 |
+
#define DEF_ENTRY_TAKE_FOCUS NULL
|
| 200 |
+
#define DEF_ENTRY_TEXT_VARIABLE ""
|
| 201 |
+
#define DEF_ENTRY_WIDTH "20"
|
| 202 |
+
|
| 203 |
+
/*
|
| 204 |
+
* Defaults for frames:
|
| 205 |
+
*/
|
| 206 |
+
|
| 207 |
+
#define DEF_FRAME_BG_COLOR NORMAL_BG
|
| 208 |
+
#define DEF_FRAME_BG_MONO WHITE
|
| 209 |
+
#define DEF_FRAME_BORDER_WIDTH "0"
|
| 210 |
+
#define DEF_FRAME_CLASS "Frame"
|
| 211 |
+
#define DEF_FRAME_COLORMAP ""
|
| 212 |
+
#define DEF_FRAME_CONTAINER "0"
|
| 213 |
+
#define DEF_FRAME_CURSOR ""
|
| 214 |
+
#define DEF_FRAME_HEIGHT "0"
|
| 215 |
+
#define DEF_FRAME_HIGHLIGHT_BG NORMAL_BG
|
| 216 |
+
#define DEF_FRAME_HIGHLIGHT NORMAL_FG
|
| 217 |
+
#define DEF_FRAME_HIGHLIGHT_WIDTH "0"
|
| 218 |
+
#define DEF_FRAME_PADX "0"
|
| 219 |
+
#define DEF_FRAME_PADY "0"
|
| 220 |
+
#define DEF_FRAME_RELIEF "flat"
|
| 221 |
+
#define DEF_FRAME_TAKE_FOCUS "0"
|
| 222 |
+
#define DEF_FRAME_VISUAL ""
|
| 223 |
+
#define DEF_FRAME_WIDTH "0"
|
| 224 |
+
|
| 225 |
+
/*
|
| 226 |
+
* Defaults for labelframes:
|
| 227 |
+
*/
|
| 228 |
+
|
| 229 |
+
#define DEF_LABELFRAME_BORDER_WIDTH "2"
|
| 230 |
+
#define DEF_LABELFRAME_CLASS "Labelframe"
|
| 231 |
+
#define DEF_LABELFRAME_RELIEF "groove"
|
| 232 |
+
#define DEF_LABELFRAME_FG NORMAL_FG
|
| 233 |
+
#define DEF_LABELFRAME_FONT "TkDefaultFont"
|
| 234 |
+
#define DEF_LABELFRAME_TEXT ""
|
| 235 |
+
#define DEF_LABELFRAME_LABELANCHOR "nw"
|
| 236 |
+
|
| 237 |
+
/*
|
| 238 |
+
* Defaults for listboxes:
|
| 239 |
+
*/
|
| 240 |
+
|
| 241 |
+
#define DEF_LISTBOX_ACTIVE_STYLE "dotbox"
|
| 242 |
+
#define DEF_LISTBOX_BG_COLOR TEXT_BG
|
| 243 |
+
#define DEF_LISTBOX_BG_MONO WHITE
|
| 244 |
+
#define DEF_LISTBOX_BORDER_WIDTH "1"
|
| 245 |
+
#define DEF_LISTBOX_CURSOR ""
|
| 246 |
+
#define DEF_LISTBOX_DISABLED_FG DISABLED
|
| 247 |
+
#define DEF_LISTBOX_EXPORT_SELECTION "1"
|
| 248 |
+
#define DEF_LISTBOX_FONT "TkTextFont"
|
| 249 |
+
#define DEF_LISTBOX_FG NORMAL_FG
|
| 250 |
+
#define DEF_LISTBOX_HEIGHT "10"
|
| 251 |
+
#define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG
|
| 252 |
+
#define DEF_LISTBOX_HIGHLIGHT NORMAL_FG
|
| 253 |
+
#define DEF_LISTBOX_HIGHLIGHT_WIDTH "0"
|
| 254 |
+
#define DEF_LISTBOX_JUSTIFY "left"
|
| 255 |
+
#define DEF_LISTBOX_RELIEF "solid"
|
| 256 |
+
#define DEF_LISTBOX_SCROLL_COMMAND ""
|
| 257 |
+
#define DEF_LISTBOX_LIST_VARIABLE ""
|
| 258 |
+
#define DEF_LISTBOX_SELECT_COLOR SELECT_BG
|
| 259 |
+
#define DEF_LISTBOX_SELECT_MONO BLACK
|
| 260 |
+
#define DEF_LISTBOX_SELECT_BD "0"
|
| 261 |
+
#define DEF_LISTBOX_SELECT_FG_COLOR SELECT_FG
|
| 262 |
+
#define DEF_LISTBOX_SELECT_FG_MONO WHITE
|
| 263 |
+
#define DEF_LISTBOX_SELECT_MODE "browse"
|
| 264 |
+
#define DEF_LISTBOX_SET_GRID "0"
|
| 265 |
+
#define DEF_LISTBOX_STATE "normal"
|
| 266 |
+
#define DEF_LISTBOX_TAKE_FOCUS NULL
|
| 267 |
+
#define DEF_LISTBOX_WIDTH "20"
|
| 268 |
+
|
| 269 |
+
/*
|
| 270 |
+
* Defaults for individual entries of menus:
|
| 271 |
+
*/
|
| 272 |
+
|
| 273 |
+
#define DEF_MENU_ENTRY_ACTIVE_BG NULL
|
| 274 |
+
#define DEF_MENU_ENTRY_ACTIVE_FG NULL
|
| 275 |
+
#define DEF_MENU_ENTRY_ACCELERATOR NULL
|
| 276 |
+
#define DEF_MENU_ENTRY_BG NULL
|
| 277 |
+
#define DEF_MENU_ENTRY_BITMAP NULL
|
| 278 |
+
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
|
| 279 |
+
#define DEF_MENU_ENTRY_COMMAND NULL
|
| 280 |
+
#define DEF_MENU_ENTRY_COMPOUND "none"
|
| 281 |
+
#define DEF_MENU_ENTRY_FG NULL
|
| 282 |
+
#define DEF_MENU_ENTRY_FONT NULL
|
| 283 |
+
#define DEF_MENU_ENTRY_HIDE_MARGIN "0"
|
| 284 |
+
#define DEF_MENU_ENTRY_IMAGE NULL
|
| 285 |
+
#define DEF_MENU_ENTRY_INDICATOR "1"
|
| 286 |
+
#define DEF_MENU_ENTRY_LABEL NULL
|
| 287 |
+
#define DEF_MENU_ENTRY_MENU NULL
|
| 288 |
+
#define DEF_MENU_ENTRY_OFF_VALUE "0"
|
| 289 |
+
#define DEF_MENU_ENTRY_ON_VALUE "1"
|
| 290 |
+
#define DEF_MENU_ENTRY_SELECT_IMAGE NULL
|
| 291 |
+
#define DEF_MENU_ENTRY_STATE "normal"
|
| 292 |
+
#define DEF_MENU_ENTRY_VALUE NULL
|
| 293 |
+
#define DEF_MENU_ENTRY_CHECK_VARIABLE NULL
|
| 294 |
+
#define DEF_MENU_ENTRY_RADIO_VARIABLE "selectedButton"
|
| 295 |
+
#define DEF_MENU_ENTRY_SELECT NULL
|
| 296 |
+
#define DEF_MENU_ENTRY_UNDERLINE "-1"
|
| 297 |
+
|
| 298 |
+
/*
|
| 299 |
+
* Defaults for menus overall:
|
| 300 |
+
*/
|
| 301 |
+
|
| 302 |
+
#define DEF_MENU_ACTIVE_BG_COLOR IGNORED
|
| 303 |
+
#define DEF_MENU_ACTIVE_BG_MONO IGNORED
|
| 304 |
+
#define DEF_MENU_ACTIVE_BORDER_WIDTH "0"
|
| 305 |
+
#define DEF_MENU_ACTIVE_FG_COLOR IGNORED
|
| 306 |
+
#define DEF_MENU_ACTIVE_FG_MONO IGNORED
|
| 307 |
+
#define DEF_MENU_BG_COLOR "#000001" /* Detects custom bg. */
|
| 308 |
+
#define DEF_MENU_BG_MONO IGNORED
|
| 309 |
+
#define DEF_MENU_BORDER_WIDTH "0"
|
| 310 |
+
#define DEF_MENU_CURSOR "arrow"
|
| 311 |
+
#define DEF_MENU_DISABLED_FG_COLOR IGNORED
|
| 312 |
+
#define DEF_MENU_DISABLED_FG_MONO ""
|
| 313 |
+
#define DEF_MENU_FONT "menu" /* special: see tkMacOSXMenu.c */
|
| 314 |
+
#define DEF_MENU_FG "#010000" /* Detects custom fg. */
|
| 315 |
+
#define DEF_MENU_POST_COMMAND ""
|
| 316 |
+
#define DEF_MENU_RELIEF "flat"
|
| 317 |
+
#define DEF_MENU_SELECT_COLOR IGNORED
|
| 318 |
+
#define DEF_MENU_SELECT_MONO IGNORED
|
| 319 |
+
#define DEF_MENU_TAKE_FOCUS "0"
|
| 320 |
+
#define DEF_MENU_TEAROFF "0"
|
| 321 |
+
#define DEF_MENU_TEAROFF_CMD NULL
|
| 322 |
+
#define DEF_MENU_TITLE ""
|
| 323 |
+
#define DEF_MENU_TYPE "normal"
|
| 324 |
+
|
| 325 |
+
/*
|
| 326 |
+
* Defaults for menubuttons:
|
| 327 |
+
*/
|
| 328 |
+
|
| 329 |
+
#define DEF_MENUBUTTON_ANCHOR "w"
|
| 330 |
+
#define DEF_MENUBUTTON_ACTIVE_BG_COLOR ACTIVE_BG
|
| 331 |
+
#define DEF_MENUBUTTON_ACTIVE_BG_MONO WHITE
|
| 332 |
+
#define DEF_MENUBUTTON_ACTIVE_FG_COLOR ACTIVE_FG
|
| 333 |
+
#define DEF_MENUBUTTON_ACTIVE_FG_MONO BLACK
|
| 334 |
+
#define DEF_MENUBUTTON_BG_COLOR NORMAL_BG
|
| 335 |
+
#define DEF_MENUBUTTON_BG_MONO WHITE
|
| 336 |
+
#define DEF_MENUBUTTON_BITMAP ""
|
| 337 |
+
#define DEF_MENUBUTTON_BORDER_WIDTH "0"
|
| 338 |
+
#define DEF_MENUBUTTON_CURSOR ""
|
| 339 |
+
#define DEF_MENUBUTTON_DIRECTION "below"
|
| 340 |
+
#define DEF_MENUBUTTON_DISABLED_FG_COLOR DISABLED
|
| 341 |
+
#define DEF_MENUBUTTON_DISABLED_FG_MONO ""
|
| 342 |
+
#define DEF_MENUBUTTON_FONT "TkDefaultFont"
|
| 343 |
+
#define DEF_MENUBUTTON_FG NORMAL_FG
|
| 344 |
+
#define DEF_MENUBUTTON_HEIGHT "0"
|
| 345 |
+
#define DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR DEF_MENUBUTTON_BG_COLOR
|
| 346 |
+
#define DEF_MENUBUTTON_HIGHLIGHT_BG_MONO DEF_MENUBUTTON_BG_MONO
|
| 347 |
+
#define DEF_MENUBUTTON_HIGHLIGHT NORMAL_FG
|
| 348 |
+
#define DEF_MENUBUTTON_HIGHLIGHT_WIDTH "0"
|
| 349 |
+
#define DEF_MENUBUTTON_IMAGE NULL
|
| 350 |
+
#define DEF_MENUBUTTON_INDICATOR "1"
|
| 351 |
+
#define DEF_MENUBUTTON_JUSTIFY "left"
|
| 352 |
+
#define DEF_MENUBUTTON_MENU ""
|
| 353 |
+
#define DEF_MENUBUTTON_PADX "0"
|
| 354 |
+
#define DEF_MENUBUTTON_PADY "0"
|
| 355 |
+
#define DEF_MENUBUTTON_RELIEF "flat"
|
| 356 |
+
#define DEF_MENUBUTTON_STATE "normal"
|
| 357 |
+
#define DEF_MENUBUTTON_TAKE_FOCUS "0"
|
| 358 |
+
#define DEF_MENUBUTTON_TEXT ""
|
| 359 |
+
#define DEF_MENUBUTTON_TEXT_VARIABLE ""
|
| 360 |
+
#define DEF_MENUBUTTON_UNDERLINE "-1"
|
| 361 |
+
#define DEF_MENUBUTTON_WIDTH "0"
|
| 362 |
+
#define DEF_MENUBUTTON_WRAP_LENGTH "0"
|
| 363 |
+
|
| 364 |
+
/*
|
| 365 |
+
* Defaults for messages:
|
| 366 |
+
*/
|
| 367 |
+
|
| 368 |
+
#define DEF_MESSAGE_ANCHOR "center"
|
| 369 |
+
#define DEF_MESSAGE_ASPECT "150"
|
| 370 |
+
#define DEF_MESSAGE_BG_COLOR NORMAL_BG
|
| 371 |
+
#define DEF_MESSAGE_BG_MONO WHITE
|
| 372 |
+
#define DEF_MESSAGE_BORDER_WIDTH "1"
|
| 373 |
+
#define DEF_MESSAGE_CURSOR ""
|
| 374 |
+
#define DEF_MESSAGE_FG NORMAL_FG
|
| 375 |
+
#define DEF_MESSAGE_FONT "TkDefaultFont"
|
| 376 |
+
#define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG
|
| 377 |
+
#define DEF_MESSAGE_HIGHLIGHT NORMAL_FG
|
| 378 |
+
#define DEF_MESSAGE_HIGHLIGHT_WIDTH "0"
|
| 379 |
+
#define DEF_MESSAGE_JUSTIFY "left"
|
| 380 |
+
#define DEF_MESSAGE_PADX "-1"
|
| 381 |
+
#define DEF_MESSAGE_PADY "-1"
|
| 382 |
+
#define DEF_MESSAGE_RELIEF "flat"
|
| 383 |
+
#define DEF_MESSAGE_TAKE_FOCUS "0"
|
| 384 |
+
#define DEF_MESSAGE_TEXT ""
|
| 385 |
+
#define DEF_MESSAGE_TEXT_VARIABLE ""
|
| 386 |
+
#define DEF_MESSAGE_WIDTH "0"
|
| 387 |
+
/*
|
| 388 |
+
* Defaults for panedwindows
|
| 389 |
+
*/
|
| 390 |
+
|
| 391 |
+
#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG
|
| 392 |
+
#define DEF_PANEDWINDOW_BG_MONO WHITE
|
| 393 |
+
#define DEF_PANEDWINDOW_BORDERWIDTH "1"
|
| 394 |
+
#define DEF_PANEDWINDOW_CURSOR ""
|
| 395 |
+
#define DEF_PANEDWINDOW_HANDLEPAD "8"
|
| 396 |
+
#define DEF_PANEDWINDOW_HANDLESIZE "8"
|
| 397 |
+
#define DEF_PANEDWINDOW_HEIGHT ""
|
| 398 |
+
#define DEF_PANEDWINDOW_OPAQUERESIZE "1"
|
| 399 |
+
#define DEF_PANEDWINDOW_ORIENT "horizontal"
|
| 400 |
+
#define DEF_PANEDWINDOW_PROXYBORDER "2"
|
| 401 |
+
#define DEF_PANEDWINDOW_RELIEF "flat"
|
| 402 |
+
#define DEF_PANEDWINDOW_SASHCURSOR ""
|
| 403 |
+
#define DEF_PANEDWINDOW_SASHPAD "0"
|
| 404 |
+
#define DEF_PANEDWINDOW_SASHRELIEF "flat"
|
| 405 |
+
#define DEF_PANEDWINDOW_SASHWIDTH "3"
|
| 406 |
+
#define DEF_PANEDWINDOW_SHOWHANDLE "0"
|
| 407 |
+
#define DEF_PANEDWINDOW_WIDTH ""
|
| 408 |
+
|
| 409 |
+
/*
|
| 410 |
+
* Defaults for panedwindow panes
|
| 411 |
+
*/
|
| 412 |
+
|
| 413 |
+
#define DEF_PANEDWINDOW_PANE_AFTER ""
|
| 414 |
+
#define DEF_PANEDWINDOW_PANE_BEFORE ""
|
| 415 |
+
#define DEF_PANEDWINDOW_PANE_HEIGHT ""
|
| 416 |
+
#define DEF_PANEDWINDOW_PANE_MINSIZE "0"
|
| 417 |
+
#define DEF_PANEDWINDOW_PANE_PADX "0"
|
| 418 |
+
#define DEF_PANEDWINDOW_PANE_PADY "0"
|
| 419 |
+
#define DEF_PANEDWINDOW_PANE_STICKY "nsew"
|
| 420 |
+
#define DEF_PANEDWINDOW_PANE_WIDTH ""
|
| 421 |
+
#define DEF_PANEDWINDOW_PANE_HIDE "0"
|
| 422 |
+
#define DEF_PANEDWINDOW_PANE_STRETCH "last"
|
| 423 |
+
|
| 424 |
+
/*
|
| 425 |
+
* Defaults for scales:
|
| 426 |
+
*/
|
| 427 |
+
|
| 428 |
+
#define DEF_SCALE_ACTIVE_BG_COLOR ACTIVE_BG
|
| 429 |
+
#define DEF_SCALE_ACTIVE_BG_MONO BLACK
|
| 430 |
+
#define DEF_SCALE_BG_COLOR NORMAL_BG
|
| 431 |
+
#define DEF_SCALE_BG_MONO WHITE
|
| 432 |
+
#define DEF_SCALE_BIG_INCREMENT "0"
|
| 433 |
+
#define DEF_SCALE_BORDER_WIDTH "1"
|
| 434 |
+
#define DEF_SCALE_COMMAND ""
|
| 435 |
+
#define DEF_SCALE_CURSOR ""
|
| 436 |
+
#define DEF_SCALE_DIGITS "0"
|
| 437 |
+
#define DEF_SCALE_FONT "TkDefaultFont"
|
| 438 |
+
#define DEF_SCALE_FG_COLOR NORMAL_FG
|
| 439 |
+
#define DEF_SCALE_FG_MONO BLACK
|
| 440 |
+
#define DEF_SCALE_FROM "0"
|
| 441 |
+
#define DEF_SCALE_HIGHLIGHT_BG_COLOR DEF_SCALE_BG_COLOR
|
| 442 |
+
#define DEF_SCALE_HIGHLIGHT_BG_MONO DEF_SCALE_BG_MONO
|
| 443 |
+
#define DEF_SCALE_HIGHLIGHT NORMAL_FG
|
| 444 |
+
#define DEF_SCALE_HIGHLIGHT_WIDTH "0"
|
| 445 |
+
#define DEF_SCALE_LABEL ""
|
| 446 |
+
#define DEF_SCALE_LENGTH "100"
|
| 447 |
+
#define DEF_SCALE_ORIENT "vertical"
|
| 448 |
+
#define DEF_SCALE_RELIEF "flat"
|
| 449 |
+
#define DEF_SCALE_REPEAT_DELAY "300"
|
| 450 |
+
#define DEF_SCALE_REPEAT_INTERVAL "100"
|
| 451 |
+
#define DEF_SCALE_RESOLUTION "1"
|
| 452 |
+
#define DEF_SCALE_TROUGH_COLOR TROUGH
|
| 453 |
+
#define DEF_SCALE_TROUGH_MONO WHITE
|
| 454 |
+
#define DEF_SCALE_SHOW_VALUE "1"
|
| 455 |
+
#define DEF_SCALE_SLIDER_LENGTH "30"
|
| 456 |
+
#define DEF_SCALE_SLIDER_RELIEF "raised"
|
| 457 |
+
#define DEF_SCALE_STATE "normal"
|
| 458 |
+
#define DEF_SCALE_TAKE_FOCUS NULL
|
| 459 |
+
#define DEF_SCALE_TICK_INTERVAL "0"
|
| 460 |
+
#define DEF_SCALE_TO "100"
|
| 461 |
+
#define DEF_SCALE_VARIABLE ""
|
| 462 |
+
#define DEF_SCALE_WIDTH "15"
|
| 463 |
+
|
| 464 |
+
/*
|
| 465 |
+
* Defaults for scrollbars:
|
| 466 |
+
*/
|
| 467 |
+
|
| 468 |
+
#define DEF_SCROLLBAR_ACTIVE_BG_COLOR ACTIVE_BG
|
| 469 |
+
#define DEF_SCROLLBAR_ACTIVE_BG_MONO BLACK
|
| 470 |
+
#define DEF_SCROLLBAR_ACTIVE_RELIEF "raised"
|
| 471 |
+
#define DEF_SCROLLBAR_BG_COLOR NORMAL_BG
|
| 472 |
+
#define DEF_SCROLLBAR_BG_MONO WHITE
|
| 473 |
+
#define DEF_SCROLLBAR_BORDER_WIDTH "0"
|
| 474 |
+
#define DEF_SCROLLBAR_COMMAND ""
|
| 475 |
+
#define DEF_SCROLLBAR_CURSOR ""
|
| 476 |
+
#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1"
|
| 477 |
+
#define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG
|
| 478 |
+
#define DEF_SCROLLBAR_HIGHLIGHT NORMAL_FG
|
| 479 |
+
#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0"
|
| 480 |
+
#define DEF_SCROLLBAR_JUMP "0"
|
| 481 |
+
#define DEF_SCROLLBAR_ORIENT "vertical"
|
| 482 |
+
#define DEF_SCROLLBAR_RELIEF "flat"
|
| 483 |
+
#define DEF_SCROLLBAR_REPEAT_DELAY "300"
|
| 484 |
+
#define DEF_SCROLLBAR_REPEAT_INTERVAL "100"
|
| 485 |
+
#define DEF_SCROLLBAR_TAKE_FOCUS NULL
|
| 486 |
+
#define DEF_SCROLLBAR_TROUGH_COLOR TROUGH
|
| 487 |
+
#define DEF_SCROLLBAR_TROUGH_MONO WHITE
|
| 488 |
+
#define DEF_SCROLLBAR_WIDTH "15"
|
| 489 |
+
|
| 490 |
+
/*
|
| 491 |
+
* Defaults for texts:
|
| 492 |
+
*/
|
| 493 |
+
|
| 494 |
+
#define DEF_TEXT_AUTO_SEPARATORS "1"
|
| 495 |
+
#define DEF_TEXT_BG_COLOR TEXT_BG
|
| 496 |
+
#define DEF_TEXT_BG_MONO WHITE
|
| 497 |
+
#define DEF_TEXT_BLOCK_CURSOR "0"
|
| 498 |
+
#define DEF_TEXT_BORDER_WIDTH "0"
|
| 499 |
+
#define DEF_TEXT_CURSOR "xterm"
|
| 500 |
+
#define DEF_TEXT_FG NORMAL_FG
|
| 501 |
+
#define DEF_TEXT_EXPORT_SELECTION "1"
|
| 502 |
+
#define DEF_TEXT_FONT "TkFixedFont"
|
| 503 |
+
#define DEF_TEXT_HEIGHT "24"
|
| 504 |
+
#define DEF_TEXT_HIGHLIGHT_BG NORMAL_BG
|
| 505 |
+
#define DEF_TEXT_HIGHLIGHT NORMAL_FG
|
| 506 |
+
#define DEF_TEXT_HIGHLIGHT_WIDTH "3"
|
| 507 |
+
#define DEF_TEXT_INSERT_BG NORMAL_FG
|
| 508 |
+
#define DEF_TEXT_INSERT_BD_COLOR "0"
|
| 509 |
+
#define DEF_TEXT_INSERT_BD_MONO "0"
|
| 510 |
+
#define DEF_TEXT_INSERT_OFF_TIME "300"
|
| 511 |
+
#define DEF_TEXT_INSERT_ON_TIME "600"
|
| 512 |
+
#define DEF_TEXT_INSERT_UNFOCUSSED "none"
|
| 513 |
+
#define DEF_TEXT_INSERT_WIDTH "1"
|
| 514 |
+
#define DEF_TEXT_MAX_UNDO "0"
|
| 515 |
+
#define DEF_TEXT_PADX "1"
|
| 516 |
+
#define DEF_TEXT_PADY "1"
|
| 517 |
+
#define DEF_TEXT_RELIEF "flat"
|
| 518 |
+
#define DEF_TEXT_INACTIVE_SELECT_COLOR INACTIVE_SELECT_BG
|
| 519 |
+
#define DEF_TEXT_SELECT_COLOR SELECT_BG
|
| 520 |
+
#define DEF_TEXT_SELECT_MONO BLACK
|
| 521 |
+
#define DEF_TEXT_SELECT_BD_COLOR "1"
|
| 522 |
+
#define DEF_TEXT_SELECT_BD_MONO "0"
|
| 523 |
+
#define DEF_TEXT_SELECT_FG_COLOR SELECT_FG
|
| 524 |
+
#define DEF_TEXT_SELECT_FG_MONO WHITE
|
| 525 |
+
#define DEF_TEXT_SELECT_RELIEF "flat"
|
| 526 |
+
#define DEF_TEXT_SET_GRID "0"
|
| 527 |
+
#define DEF_TEXT_SPACING1 "0"
|
| 528 |
+
#define DEF_TEXT_SPACING2 "0"
|
| 529 |
+
#define DEF_TEXT_SPACING3 "0"
|
| 530 |
+
#define DEF_TEXT_STATE "normal"
|
| 531 |
+
#define DEF_TEXT_TABS ""
|
| 532 |
+
#define DEF_TEXT_TABSTYLE "tabular"
|
| 533 |
+
#define DEF_TEXT_TAKE_FOCUS NULL
|
| 534 |
+
#define DEF_TEXT_UNDO "0"
|
| 535 |
+
#define DEF_TEXT_WIDTH "80"
|
| 536 |
+
#define DEF_TEXT_WRAP "char"
|
| 537 |
+
#define DEF_TEXT_XSCROLL_COMMAND ""
|
| 538 |
+
#define DEF_TEXT_YSCROLL_COMMAND ""
|
| 539 |
+
|
| 540 |
+
/*
|
| 541 |
+
* Defaults for canvas text:
|
| 542 |
+
*/
|
| 543 |
+
|
| 544 |
+
#define DEF_CANVTEXT_FONT "TkDefaultFont"
|
| 545 |
+
|
| 546 |
+
/*
|
| 547 |
+
* Defaults for canvas items
|
| 548 |
+
* (arcs, bitmaps, lines, polygons, rectangles, and ovals):
|
| 549 |
+
*/
|
| 550 |
+
|
| 551 |
+
#define DEF_CANVBMAP_FG NORMAL_FG
|
| 552 |
+
#define DEF_CANVITEM_OUTLINE NORMAL_FG
|
| 553 |
+
|
| 554 |
+
/*
|
| 555 |
+
* Defaults for toplevels (most of the defaults for frames also apply
|
| 556 |
+
* to toplevels):
|
| 557 |
+
*/
|
| 558 |
+
|
| 559 |
+
#define DEF_TOPLEVEL_CLASS "Toplevel"
|
| 560 |
+
#define DEF_TOPLEVEL_MENU ""
|
| 561 |
+
#define DEF_TOPLEVEL_SCREEN ""
|
| 562 |
+
#define DEF_TOPLEVEL_USE ""
|
| 563 |
+
|
| 564 |
+
/*
|
| 565 |
+
* Defaults for busy windows (not really used yet):
|
| 566 |
+
*/
|
| 567 |
+
|
| 568 |
+
#define DEF_BUSY_CURSOR "watch"
|
| 569 |
+
|
| 570 |
+
#endif /* _TKMACDEFAULT */
|
deepseek/include/tkMacOSXFont.h
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXFont.h --
|
| 3 |
+
*
|
| 4 |
+
* Contains the Macintosh implementation of the platform-independent
|
| 5 |
+
* font package interface.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1990-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
| 9 |
+
* Copyright 2001-2009, Apple Inc.
|
| 10 |
+
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 11 |
+
*
|
| 12 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 13 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef TKMACOSXFONT_H
|
| 17 |
+
#define TKMACOSXFONT_H 1
|
| 18 |
+
|
| 19 |
+
#include "tkFont.h"
|
| 20 |
+
|
| 21 |
+
#ifndef _TKMACINT
|
| 22 |
+
#include "tkMacOSXInt.h"
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
* Function prototypes
|
| 27 |
+
*/
|
| 28 |
+
|
| 29 |
+
MODULE_SCOPE Tcl_Obj * TkMacOSXFontDescriptionForNSFontAndNSFontAttributes(
|
| 30 |
+
NSFont *nsFont, NSDictionary *nsAttributes);
|
| 31 |
+
|
| 32 |
+
#endif /*TKMACOSXFONT_H*/
|
deepseek/include/tkMacOSXInt.h
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXInt.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of Macintosh specific shared variables and procedures.
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
|
| 7 |
+
* Copyright 2001-2009, Apple Inc.
|
| 8 |
+
* Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 11 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _TKMACINT
|
| 15 |
+
#define _TKMACINT
|
| 16 |
+
|
| 17 |
+
#ifndef _TKINT
|
| 18 |
+
#include "tkInt.h"
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* Include platform specific public interfaces.
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
#ifndef _TKMAC
|
| 26 |
+
#include "tkMacOSX.h"
|
| 27 |
+
#import <Cocoa/Cocoa.h>
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
* Define compatibility platform types used in the structures below so that
|
| 32 |
+
* this header can be included without pulling in the platform headers.
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
#ifndef _TKMACPRIV
|
| 36 |
+
# ifndef CGGEOMETRY_H_
|
| 37 |
+
# ifndef CGFLOAT_DEFINED
|
| 38 |
+
# if __LP64__
|
| 39 |
+
# define CGFloat double
|
| 40 |
+
# else
|
| 41 |
+
# define CGFloat float
|
| 42 |
+
# endif
|
| 43 |
+
# endif
|
| 44 |
+
# define CGSize struct {CGFloat width; CGFloat height;}
|
| 45 |
+
# endif
|
| 46 |
+
# ifndef CGCONTEXT_H_
|
| 47 |
+
# define CGContextRef void *
|
| 48 |
+
# endif
|
| 49 |
+
# ifndef CGCOLOR_H_
|
| 50 |
+
# define CGColorRef void *
|
| 51 |
+
# endif
|
| 52 |
+
# ifndef __HISHAPE__
|
| 53 |
+
# define HIShapeRef void *
|
| 54 |
+
# endif
|
| 55 |
+
# ifndef _APPKITDEFINES_H
|
| 56 |
+
# define NSView void *
|
| 57 |
+
# endif
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
struct TkWindowPrivate {
|
| 61 |
+
TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
|
| 62 |
+
NSView *view;
|
| 63 |
+
CGContextRef context;
|
| 64 |
+
int xOff; /* X offset from toplevel window */
|
| 65 |
+
int yOff; /* Y offset from toplevel window */
|
| 66 |
+
CGSize size;
|
| 67 |
+
HIShapeRef visRgn; /* Visible region of window */
|
| 68 |
+
HIShapeRef aboveVisRgn; /* Visible region of window & its children */
|
| 69 |
+
HIShapeRef drawRgn; /* Clipped drawing region */
|
| 70 |
+
int referenceCount; /* Don't delete toplevel until children are
|
| 71 |
+
* gone. */
|
| 72 |
+
struct TkWindowPrivate *toplevel;
|
| 73 |
+
/* Pointer to the toplevel datastruct. */
|
| 74 |
+
CGFloat fillRGBA[4]; /* Background used by the ttk FillElement */
|
| 75 |
+
int flags; /* Various state see defines below. */
|
| 76 |
+
};
|
| 77 |
+
typedef struct TkWindowPrivate MacDrawable;
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* Defines use for the flags field of the MacDrawable data structure.
|
| 81 |
+
*/
|
| 82 |
+
|
| 83 |
+
#define TK_SCROLLBAR_GROW 0x01
|
| 84 |
+
#define TK_CLIP_INVALID 0x02
|
| 85 |
+
#define TK_HOST_EXISTS 0x04
|
| 86 |
+
#define TK_DRAWN_UNDER_MENU 0x08
|
| 87 |
+
#define TK_IS_PIXMAP 0x10
|
| 88 |
+
#define TK_IS_BW_PIXMAP 0x20
|
| 89 |
+
#define TK_DO_NOT_DRAW 0x40
|
| 90 |
+
#define TTK_HAS_CONTRASTING_BG 0x80
|
| 91 |
+
|
| 92 |
+
/*
|
| 93 |
+
* I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags
|
| 94 |
+
* This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the
|
| 95 |
+
* TkWindow structure for the window, but in the MacWin. This way we can
|
| 96 |
+
* still tell what the correct port is after the TKWindow structure has been
|
| 97 |
+
* freed. This actually happens when you bind destroy of a toplevel to
|
| 98 |
+
* Destroy of a child.
|
| 99 |
+
*/
|
| 100 |
+
|
| 101 |
+
/*
|
| 102 |
+
* This structure is for handling Netscape-type in process
|
| 103 |
+
* embedding where Tk does not control the top-level. It contains
|
| 104 |
+
* various functions that are needed by Mac specific routines, like
|
| 105 |
+
* TkMacOSXGetDrawablePort. The definitions of the function types
|
| 106 |
+
* are in tkMacOSX.h.
|
| 107 |
+
*/
|
| 108 |
+
|
| 109 |
+
typedef struct {
|
| 110 |
+
Tk_MacOSXEmbedRegisterWinProc *registerWinProc;
|
| 111 |
+
Tk_MacOSXEmbedGetGrafPortProc *getPortProc;
|
| 112 |
+
Tk_MacOSXEmbedMakeContainerExistProc *containerExistProc;
|
| 113 |
+
Tk_MacOSXEmbedGetClipProc *getClipProc;
|
| 114 |
+
Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc;
|
| 115 |
+
} TkMacOSXEmbedHandler;
|
| 116 |
+
|
| 117 |
+
MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler;
|
| 118 |
+
|
| 119 |
+
/*
|
| 120 |
+
* Undef compatibility platform types defined above.
|
| 121 |
+
*/
|
| 122 |
+
|
| 123 |
+
#ifndef _TKMACPRIV
|
| 124 |
+
# ifndef CGGEOMETRY_H_
|
| 125 |
+
# ifndef CGFLOAT_DEFINED
|
| 126 |
+
# undef CGFloat
|
| 127 |
+
# endif
|
| 128 |
+
# undef CGSize
|
| 129 |
+
# endif
|
| 130 |
+
# ifndef CGCONTEXT_H_
|
| 131 |
+
# undef CGContextRef
|
| 132 |
+
# endif
|
| 133 |
+
# ifndef CGCOLOR_H_
|
| 134 |
+
# undef CGColorRef
|
| 135 |
+
# endif
|
| 136 |
+
# ifndef __HISHAPE__
|
| 137 |
+
# undef HIShapeRef
|
| 138 |
+
# endif
|
| 139 |
+
# ifndef _APPKITDEFINES_H
|
| 140 |
+
# undef NSView
|
| 141 |
+
# endif
|
| 142 |
+
#endif
|
| 143 |
+
|
| 144 |
+
/*
|
| 145 |
+
* Defines used for TkMacOSXInvalidateWindow
|
| 146 |
+
*/
|
| 147 |
+
|
| 148 |
+
#define TK_WINDOW_ONLY 0
|
| 149 |
+
#define TK_PARENT_WINDOW 1
|
| 150 |
+
|
| 151 |
+
/*
|
| 152 |
+
* Accessor for the privatePtr flags field for the TK_HOST_EXISTS field
|
| 153 |
+
*/
|
| 154 |
+
|
| 155 |
+
#define TkMacOSXHostToplevelExists(tkwin) \
|
| 156 |
+
(((TkWindow *) (tkwin))->privatePtr->toplevel->flags & TK_HOST_EXISTS)
|
| 157 |
+
|
| 158 |
+
/*
|
| 159 |
+
* Defines used for the flags argument to TkGenWMConfigureEvent.
|
| 160 |
+
*/
|
| 161 |
+
|
| 162 |
+
#define TK_LOCATION_CHANGED 1
|
| 163 |
+
#define TK_SIZE_CHANGED 2
|
| 164 |
+
#define TK_BOTH_CHANGED 3
|
| 165 |
+
#define TK_MACOSX_HANDLE_EVENT_IMMEDIATELY 1024
|
| 166 |
+
|
| 167 |
+
/*
|
| 168 |
+
* Defines for tkTextDisp.c and tkFont.c
|
| 169 |
+
*/
|
| 170 |
+
|
| 171 |
+
#define TK_LAYOUT_WITH_BASE_CHUNKS 1
|
| 172 |
+
#define TK_DRAW_IN_CONTEXT 1
|
| 173 |
+
|
| 174 |
+
/*
|
| 175 |
+
* Prototypes of internal procs not in the stubs table.
|
| 176 |
+
*/
|
| 177 |
+
|
| 178 |
+
MODULE_SCOPE void TkMacOSXDefaultStartupScript(void);
|
| 179 |
+
MODULE_SCOPE void TkpClipDrawableToRect(Display *display, Drawable d, int x,
|
| 180 |
+
int y, int width, int height);
|
| 181 |
+
MODULE_SCOPE Bool TkTestLogDisplay(Drawable drawable);
|
| 182 |
+
|
| 183 |
+
/*
|
| 184 |
+
* Include the stubbed internal platform-specific API.
|
| 185 |
+
*/
|
| 186 |
+
|
| 187 |
+
#include "tkIntPlatDecls.h"
|
| 188 |
+
|
| 189 |
+
#endif /* _TKMACINT */
|
| 190 |
+
|
| 191 |
+
/*
|
| 192 |
+
* Local Variables:
|
| 193 |
+
* mode: objc
|
| 194 |
+
* c-basic-offset: 4
|
| 195 |
+
* fill-column: 79
|
| 196 |
+
* coding: utf-8
|
| 197 |
+
* End:
|
| 198 |
+
*/
|
deepseek/include/tkMacOSXKeysyms.h
ADDED
|
@@ -0,0 +1,1308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXKeysyms.h --
|
| 3 |
+
*
|
| 4 |
+
* Contains data used for processing key events, some of which was
|
| 5 |
+
* moved from tkMacOSXKeyboard.c.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1990-1994 The Regents of the University of California.
|
| 8 |
+
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
| 9 |
+
* Copyright 2001-2009, Apple Inc.
|
| 10 |
+
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 11 |
+
* Copyright (c) 2020 Marc Culler
|
| 12 |
+
*
|
| 13 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 14 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef TKMACOSXKEYSYMS_H
|
| 18 |
+
#define TKMACOSXKEYSYMS_H 1
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* This table enumerates the keys on Mac keyboards which do not represent
|
| 22 |
+
* letters. This is static data -- these keys do not change when the keyboard
|
| 23 |
+
* layout changes. The unicode representation of a special key which is not a
|
| 24 |
+
* modifier and does not have an ASCII code point lies in the reserved range
|
| 25 |
+
* 0xF700 - 0xF8FF.
|
| 26 |
+
*
|
| 27 |
+
* The table includes every key listed in Apple's documentation of Function-Key
|
| 28 |
+
* Unicodes which is not marked as "Not on most Macintosh keyboards", as well
|
| 29 |
+
* as F20, which is reported to be usable in scripts even though it does not
|
| 30 |
+
* appear on any Macintosh keyboard.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
typedef struct {
|
| 34 |
+
int virt; /* value of [NSEvent keyCode] */
|
| 35 |
+
KeySym keysym; /* X11 keysym */
|
| 36 |
+
KeyCode keychar; /* XEvent keycode & 0xFFFF */
|
| 37 |
+
} KeyInfo;
|
| 38 |
+
|
| 39 |
+
static const KeyInfo keyArray[] = {
|
| 40 |
+
{36, XK_Return, NSNewlineCharacter},
|
| 41 |
+
{48, XK_Tab, NSTabCharacter},
|
| 42 |
+
{51, XK_BackSpace, NSDeleteCharacter},
|
| 43 |
+
{52, XK_Return, NSNewlineCharacter}, /* Used on some Powerbooks */
|
| 44 |
+
{53, XK_Escape, 0x1B},
|
| 45 |
+
{54, XK_Meta_R, MOD_KEYCHAR},
|
| 46 |
+
{55, XK_Meta_L, MOD_KEYCHAR},
|
| 47 |
+
{56, XK_Shift_L, MOD_KEYCHAR},
|
| 48 |
+
{57, XK_Caps_Lock, MOD_KEYCHAR},
|
| 49 |
+
{58, XK_Alt_L, MOD_KEYCHAR},
|
| 50 |
+
{59, XK_Control_L, MOD_KEYCHAR},
|
| 51 |
+
{60, XK_Shift_R, MOD_KEYCHAR},
|
| 52 |
+
{61, XK_Alt_R, MOD_KEYCHAR},
|
| 53 |
+
{62, XK_Control_R, MOD_KEYCHAR},
|
| 54 |
+
{63, XK_Super_L, MOD_KEYCHAR},
|
| 55 |
+
{64, XK_F17, NSF17FunctionKey},
|
| 56 |
+
{65, XK_KP_Decimal, '.'},
|
| 57 |
+
{67, XK_KP_Multiply, '*'},
|
| 58 |
+
{69, XK_KP_Add, '+'},
|
| 59 |
+
{71, XK_Clear, NSClearLineFunctionKey}, /* Numlock on PC */
|
| 60 |
+
{75, XK_KP_Divide, '/'},
|
| 61 |
+
{76, XK_KP_Enter, NSEnterCharacter}, /* Fn Return */
|
| 62 |
+
{78, XK_KP_Subtract, '-'},
|
| 63 |
+
{79, XK_F18, NSF18FunctionKey},
|
| 64 |
+
{80, XK_F19, NSF19FunctionKey},
|
| 65 |
+
{81, XK_KP_Equal, '='},
|
| 66 |
+
{82, XK_KP_0, '0'},
|
| 67 |
+
{83, XK_KP_1, '1'},
|
| 68 |
+
{84, XK_KP_2, '2'},
|
| 69 |
+
{85, XK_KP_3, '3'},
|
| 70 |
+
{86, XK_KP_4, '4'},
|
| 71 |
+
{87, XK_KP_5, '5'},
|
| 72 |
+
{88, XK_KP_6, '6'},
|
| 73 |
+
{89, XK_KP_7, '7'},
|
| 74 |
+
{90, XK_F20, NSF20FunctionKey}, /* For scripting only */
|
| 75 |
+
{91, XK_KP_8, '8'},
|
| 76 |
+
{92, XK_KP_9, '9'},
|
| 77 |
+
{96, XK_F5, NSF5FunctionKey},
|
| 78 |
+
{97, XK_F6, NSF6FunctionKey},
|
| 79 |
+
{98, XK_F7, NSF7FunctionKey},
|
| 80 |
+
{99, XK_F3, NSF3FunctionKey},
|
| 81 |
+
{100, XK_F8, NSF8FunctionKey},
|
| 82 |
+
{101, XK_F9, NSF9FunctionKey},
|
| 83 |
+
{103, XK_F11, NSF11FunctionKey},
|
| 84 |
+
{105, XK_F13, NSF13FunctionKey},
|
| 85 |
+
{106, XK_F16, NSF16FunctionKey},
|
| 86 |
+
{107, XK_F14, NSF14FunctionKey},
|
| 87 |
+
{109, XK_F10, NSF10FunctionKey},
|
| 88 |
+
{110, XK_Menu, UNKNOWN_KEYCHAR},
|
| 89 |
+
{111, XK_F12, NSF12FunctionKey},
|
| 90 |
+
{113, XK_F15, NSF15FunctionKey},
|
| 91 |
+
{114, XK_Help, NSHelpFunctionKey},
|
| 92 |
+
{115, XK_Home, NSHomeFunctionKey}, /* Fn Left */
|
| 93 |
+
{116, XK_Page_Up, NSPageUpFunctionKey}, /* Fn Up */
|
| 94 |
+
{117, XK_Delete, NSDeleteFunctionKey}, /* Fn Delete */
|
| 95 |
+
{118, XK_F4, NSF4FunctionKey},
|
| 96 |
+
{119, XK_End, NSEndFunctionKey}, /* Fn Right */
|
| 97 |
+
{120, XK_F2, NSF2FunctionKey},
|
| 98 |
+
{121, XK_Page_Down, NSPageDownFunctionKey}, /* Fn Down */
|
| 99 |
+
{122, XK_F1, NSF1FunctionKey},
|
| 100 |
+
{123, XK_Left, NSLeftArrowFunctionKey},
|
| 101 |
+
{124, XK_Right, NSRightArrowFunctionKey},
|
| 102 |
+
{125, XK_Down, NSDownArrowFunctionKey},
|
| 103 |
+
{126, XK_Up, NSUpArrowFunctionKey},
|
| 104 |
+
{0, 0, 0}
|
| 105 |
+
};
|
| 106 |
+
|
| 107 |
+
/*
|
| 108 |
+
* X11 keysyms for modifier keys, in order. This list includes keys
|
| 109 |
+
* which do not appear on Apple keyboards, such as Shift_Lock and
|
| 110 |
+
* Super_R. While most systems don't provide events for the "fn"
|
| 111 |
+
* function key, Apple does. We map it to Super_L when processing a
|
| 112 |
+
* FlagsChanged NSEvent.
|
| 113 |
+
*/
|
| 114 |
+
|
| 115 |
+
#define NUM_MOD_KEYCODES 14
|
| 116 |
+
static const KeyCode modKeyArray[NUM_MOD_KEYCODES] = {
|
| 117 |
+
XK_Shift_L,
|
| 118 |
+
XK_Shift_R,
|
| 119 |
+
XK_Control_L,
|
| 120 |
+
XK_Control_R,
|
| 121 |
+
XK_Caps_Lock,
|
| 122 |
+
XK_Shift_Lock,
|
| 123 |
+
XK_Meta_L,
|
| 124 |
+
XK_Meta_R,
|
| 125 |
+
XK_Alt_L,
|
| 126 |
+
XK_Alt_R,
|
| 127 |
+
XK_Super_L,
|
| 128 |
+
XK_Super_R,
|
| 129 |
+
XK_Hyper_L,
|
| 130 |
+
XK_Hyper_R,
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
/*
|
| 134 |
+
* This table pairs X11 Keysyms for alphanumeric characters with the
|
| 135 |
+
* unicode code point for that letter.
|
| 136 |
+
* The data comes from http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
|
| 137 |
+
*/
|
| 138 |
+
|
| 139 |
+
typedef struct KeysymInfo {
|
| 140 |
+
KeySym keysym;
|
| 141 |
+
KeyCode keycode;
|
| 142 |
+
} KeysymInfo;
|
| 143 |
+
|
| 144 |
+
const KeysymInfo keysymTable[] = {
|
| 145 |
+
{0x0020, 0x0020}, /* space */
|
| 146 |
+
{0x0021, 0x0021}, /* exclam */
|
| 147 |
+
{0x0022, 0x0022}, /* quotedbl */
|
| 148 |
+
{0x0023, 0x0023}, /* numbersign */
|
| 149 |
+
{0x0024, 0x0024}, /* dollar */
|
| 150 |
+
{0x0025, 0x0025}, /* percent */
|
| 151 |
+
{0x0026, 0x0026}, /* ampersand */
|
| 152 |
+
{0x0027, 0x0027}, /* apostrophe */
|
| 153 |
+
{0x0028, 0x0028}, /* parenleft */
|
| 154 |
+
{0x0029, 0x0029}, /* parenright */
|
| 155 |
+
{0x002a, 0x002a}, /* asterisk */
|
| 156 |
+
{0x002b, 0x002b}, /* plus */
|
| 157 |
+
{0x002c, 0x002c}, /* comma */
|
| 158 |
+
{0x002d, 0x002d}, /* minus */
|
| 159 |
+
{0x002e, 0x002e}, /* period */
|
| 160 |
+
{0x002f, 0x002f}, /* slash */
|
| 161 |
+
{0x0030, 0x0030}, /* 0 */
|
| 162 |
+
{0x0031, 0x0031}, /* 1 */
|
| 163 |
+
{0x0032, 0x0032}, /* 2 */
|
| 164 |
+
{0x0033, 0x0033}, /* 3 */
|
| 165 |
+
{0x0034, 0x0034}, /* 4 */
|
| 166 |
+
{0x0035, 0x0035}, /* 5 */
|
| 167 |
+
{0x0036, 0x0036}, /* 6 */
|
| 168 |
+
{0x0037, 0x0037}, /* 7 */
|
| 169 |
+
{0x0038, 0x0038}, /* 8 */
|
| 170 |
+
{0x0039, 0x0039}, /* 9 */
|
| 171 |
+
{0x003a, 0x003a}, /* colon */
|
| 172 |
+
{0x003b, 0x003b}, /* semicolon */
|
| 173 |
+
{0x003c, 0x003c}, /* less */
|
| 174 |
+
{0x003d, 0x003d}, /* equal */
|
| 175 |
+
{0x003e, 0x003e}, /* greater */
|
| 176 |
+
{0x003f, 0x003f}, /* question */
|
| 177 |
+
{0x0040, 0x0040}, /* at */
|
| 178 |
+
{0x0041, 0x0041}, /* A */
|
| 179 |
+
{0x0042, 0x0042}, /* B */
|
| 180 |
+
{0x0043, 0x0043}, /* C */
|
| 181 |
+
{0x0044, 0x0044}, /* D */
|
| 182 |
+
{0x0045, 0x0045}, /* E */
|
| 183 |
+
{0x0046, 0x0046}, /* F */
|
| 184 |
+
{0x0047, 0x0047}, /* G */
|
| 185 |
+
{0x0048, 0x0048}, /* H */
|
| 186 |
+
{0x0049, 0x0049}, /* I */
|
| 187 |
+
{0x004a, 0x004a}, /* J */
|
| 188 |
+
{0x004b, 0x004b}, /* K */
|
| 189 |
+
{0x004c, 0x004c}, /* L */
|
| 190 |
+
{0x004d, 0x004d}, /* M */
|
| 191 |
+
{0x004e, 0x004e}, /* N */
|
| 192 |
+
{0x004f, 0x004f}, /* O */
|
| 193 |
+
{0x0050, 0x0050}, /* P */
|
| 194 |
+
{0x0051, 0x0051}, /* Q */
|
| 195 |
+
{0x0052, 0x0052}, /* R */
|
| 196 |
+
{0x0053, 0x0053}, /* S */
|
| 197 |
+
{0x0054, 0x0054}, /* T */
|
| 198 |
+
{0x0055, 0x0055}, /* U */
|
| 199 |
+
{0x0056, 0x0056}, /* V */
|
| 200 |
+
{0x0057, 0x0057}, /* W */
|
| 201 |
+
{0x0058, 0x0058}, /* X */
|
| 202 |
+
{0x0059, 0x0059}, /* Y */
|
| 203 |
+
{0x005a, 0x005a}, /* Z */
|
| 204 |
+
{0x005b, 0x005b}, /* bracketleft */
|
| 205 |
+
{0x005c, 0x005c}, /* backslash */
|
| 206 |
+
{0x005d, 0x005d}, /* bracketright */
|
| 207 |
+
{0x005e, 0x005e}, /* asciicircum */
|
| 208 |
+
{0x005f, 0x005f}, /* underscore */
|
| 209 |
+
{0x0060, 0x0060}, /* grave */
|
| 210 |
+
{0x0061, 0x0061}, /* a */
|
| 211 |
+
{0x0062, 0x0062}, /* b */
|
| 212 |
+
{0x0063, 0x0063}, /* c */
|
| 213 |
+
{0x0064, 0x0064}, /* d */
|
| 214 |
+
{0x0065, 0x0065}, /* e */
|
| 215 |
+
{0x0066, 0x0066}, /* f */
|
| 216 |
+
{0x0067, 0x0067}, /* g */
|
| 217 |
+
{0x0068, 0x0068}, /* h */
|
| 218 |
+
{0x0069, 0x0069}, /* i */
|
| 219 |
+
{0x006a, 0x006a}, /* j */
|
| 220 |
+
{0x006b, 0x006b}, /* k */
|
| 221 |
+
{0x006c, 0x006c}, /* l */
|
| 222 |
+
{0x006d, 0x006d}, /* m */
|
| 223 |
+
{0x006e, 0x006e}, /* n */
|
| 224 |
+
{0x006f, 0x006f}, /* o */
|
| 225 |
+
{0x0070, 0x0070}, /* p */
|
| 226 |
+
{0x0071, 0x0071}, /* q */
|
| 227 |
+
{0x0072, 0x0072}, /* r */
|
| 228 |
+
{0x0073, 0x0073}, /* s */
|
| 229 |
+
{0x0074, 0x0074}, /* t */
|
| 230 |
+
{0x0075, 0x0075}, /* u */
|
| 231 |
+
{0x0076, 0x0076}, /* v */
|
| 232 |
+
{0x0077, 0x0077}, /* w */
|
| 233 |
+
{0x0078, 0x0078}, /* x */
|
| 234 |
+
{0x0079, 0x0079}, /* y */
|
| 235 |
+
{0x007a, 0x007a}, /* z */
|
| 236 |
+
{0x007b, 0x007b}, /* braceleft */
|
| 237 |
+
{0x007c, 0x007c}, /* bar */
|
| 238 |
+
{0x007d, 0x007d}, /* braceright */
|
| 239 |
+
{0x007e, 0x007e}, /* asciitilde */
|
| 240 |
+
{0x00a0, 0x00a0}, /* nobreakspace */
|
| 241 |
+
{0x00a1, 0x00a1}, /* exclamdown */
|
| 242 |
+
{0x00a2, 0x00a2}, /* cent */
|
| 243 |
+
{0x00a3, 0x00a3}, /* sterling */
|
| 244 |
+
{0x00a4, 0x00a4}, /* currency */
|
| 245 |
+
{0x00a5, 0x00a5}, /* yen */
|
| 246 |
+
{0x00a6, 0x00a6}, /* brokenbar */
|
| 247 |
+
{0x00a7, 0x00a7}, /* section */
|
| 248 |
+
{0x00a8, 0x00a8}, /* diaeresis */
|
| 249 |
+
{0x00a9, 0x00a9}, /* copyright */
|
| 250 |
+
{0x00aa, 0x00aa}, /* ordfeminine */
|
| 251 |
+
{0x00ab, 0x00ab}, /* guillemotleft */
|
| 252 |
+
{0x00ac, 0x00ac}, /* notsign */
|
| 253 |
+
{0x00ad, 0x00ad}, /* hyphen */
|
| 254 |
+
{0x00ae, 0x00ae}, /* registered */
|
| 255 |
+
{0x00af, 0x00af}, /* macron */
|
| 256 |
+
{0x00b0, 0x00b0}, /* degree */
|
| 257 |
+
{0x00b1, 0x00b1}, /* plusminus */
|
| 258 |
+
{0x00b2, 0x00b2}, /* twosuperior */
|
| 259 |
+
{0x00b3, 0x00b3}, /* threesuperior */
|
| 260 |
+
{0x00b4, 0x00b4}, /* acute */
|
| 261 |
+
{0x00b5, 0x00b5}, /* mu */
|
| 262 |
+
{0x00b6, 0x00b6}, /* paragraph */
|
| 263 |
+
{0x00b7, 0x00b7}, /* periodcentered */
|
| 264 |
+
{0x00b8, 0x00b8}, /* cedilla */
|
| 265 |
+
{0x00b9, 0x00b9}, /* onesuperior */
|
| 266 |
+
{0x00ba, 0x00ba}, /* masculine */
|
| 267 |
+
{0x00bb, 0x00bb}, /* guillemotright */
|
| 268 |
+
{0x00bc, 0x00bc}, /* onequarter */
|
| 269 |
+
{0x00bd, 0x00bd}, /* onehalf */
|
| 270 |
+
{0x00be, 0x00be}, /* threequarters */
|
| 271 |
+
{0x00bf, 0x00bf}, /* questiondown */
|
| 272 |
+
{0x00c0, 0x00c0}, /* Agrave */
|
| 273 |
+
{0x00c1, 0x00c1}, /* Aacute */
|
| 274 |
+
{0x00c2, 0x00c2}, /* Acircumflex */
|
| 275 |
+
{0x00c3, 0x00c3}, /* Atilde */
|
| 276 |
+
{0x00c4, 0x00c4}, /* Adiaeresis */
|
| 277 |
+
{0x00c5, 0x00c5}, /* Aring */
|
| 278 |
+
{0x00c6, 0x00c6}, /* AE */
|
| 279 |
+
{0x00c7, 0x00c7}, /* Ccedilla */
|
| 280 |
+
{0x00c8, 0x00c8}, /* Egrave */
|
| 281 |
+
{0x00c9, 0x00c9}, /* Eacute */
|
| 282 |
+
{0x00ca, 0x00ca}, /* Ecircumflex */
|
| 283 |
+
{0x00cb, 0x00cb}, /* Ediaeresis */
|
| 284 |
+
{0x00cc, 0x00cc}, /* Igrave */
|
| 285 |
+
{0x00cd, 0x00cd}, /* Iacute */
|
| 286 |
+
{0x00ce, 0x00ce}, /* Icircumflex */
|
| 287 |
+
{0x00cf, 0x00cf}, /* Idiaeresis */
|
| 288 |
+
{0x00d0, 0x00d0}, /* ETH */
|
| 289 |
+
{0x00d1, 0x00d1}, /* Ntilde */
|
| 290 |
+
{0x00d2, 0x00d2}, /* Ograve */
|
| 291 |
+
{0x00d3, 0x00d3}, /* Oacute */
|
| 292 |
+
{0x00d4, 0x00d4}, /* Ocircumflex */
|
| 293 |
+
{0x00d5, 0x00d5}, /* Otilde */
|
| 294 |
+
{0x00d6, 0x00d6}, /* Odiaeresis */
|
| 295 |
+
{0x00d7, 0x00d7}, /* multiply */
|
| 296 |
+
{0x00d8, 0x00d8}, /* Oslash */
|
| 297 |
+
{0x00d9, 0x00d9}, /* Ugrave */
|
| 298 |
+
{0x00da, 0x00da}, /* Uacute */
|
| 299 |
+
{0x00db, 0x00db}, /* Ucircumflex */
|
| 300 |
+
{0x00dc, 0x00dc}, /* Udiaeresis */
|
| 301 |
+
{0x00dd, 0x00dd}, /* Yacute */
|
| 302 |
+
{0x00de, 0x00de}, /* THORN */
|
| 303 |
+
{0x00df, 0x00df}, /* ssharp */
|
| 304 |
+
{0x00e0, 0x00e0}, /* agrave */
|
| 305 |
+
{0x00e1, 0x00e1}, /* aacute */
|
| 306 |
+
{0x00e2, 0x00e2}, /* acircumflex */
|
| 307 |
+
{0x00e3, 0x00e3}, /* atilde */
|
| 308 |
+
{0x00e4, 0x00e4}, /* adiaeresis */
|
| 309 |
+
{0x00e5, 0x00e5}, /* aring */
|
| 310 |
+
{0x00e6, 0x00e6}, /* ae */
|
| 311 |
+
{0x00e7, 0x00e7}, /* ccedilla */
|
| 312 |
+
{0x00e8, 0x00e8}, /* egrave */
|
| 313 |
+
{0x00e9, 0x00e9}, /* eacute */
|
| 314 |
+
{0x00ea, 0x00ea}, /* ecircumflex */
|
| 315 |
+
{0x00eb, 0x00eb}, /* ediaeresis */
|
| 316 |
+
{0x00ec, 0x00ec}, /* igrave */
|
| 317 |
+
{0x00ed, 0x00ed}, /* iacute */
|
| 318 |
+
{0x00ee, 0x00ee}, /* icircumflex */
|
| 319 |
+
{0x00ef, 0x00ef}, /* idiaeresis */
|
| 320 |
+
{0x00f0, 0x00f0}, /* eth */
|
| 321 |
+
{0x00f1, 0x00f1}, /* ntilde */
|
| 322 |
+
{0x00f2, 0x00f2}, /* ograve */
|
| 323 |
+
{0x00f3, 0x00f3}, /* oacute */
|
| 324 |
+
{0x00f4, 0x00f4}, /* ocircumflex */
|
| 325 |
+
{0x00f5, 0x00f5}, /* otilde */
|
| 326 |
+
{0x00f6, 0x00f6}, /* odiaeresis */
|
| 327 |
+
{0x00f7, 0x00f7}, /* division */
|
| 328 |
+
{0x00f8, 0x00f8}, /* oslash */
|
| 329 |
+
{0x00f9, 0x00f9}, /* ugrave */
|
| 330 |
+
{0x00fa, 0x00fa}, /* uacute */
|
| 331 |
+
{0x00fb, 0x00fb}, /* ucircumflex */
|
| 332 |
+
{0x00fc, 0x00fc}, /* udiaeresis */
|
| 333 |
+
{0x00fd, 0x00fd}, /* yacute */
|
| 334 |
+
{0x00fe, 0x00fe}, /* thorn */
|
| 335 |
+
{0x00ff, 0x00ff}, /* ydiaeresis */
|
| 336 |
+
{0x01a1, 0x0104}, /* Aogonek */
|
| 337 |
+
{0x01a2, 0x02d8}, /* breve */
|
| 338 |
+
{0x01a3, 0x0141}, /* Lstroke */
|
| 339 |
+
{0x01a5, 0x013d}, /* Lcaron */
|
| 340 |
+
{0x01a6, 0x015a}, /* Sacute */
|
| 341 |
+
{0x01a9, 0x0160}, /* Scaron */
|
| 342 |
+
{0x01aa, 0x015e}, /* Scedilla */
|
| 343 |
+
{0x01ab, 0x0164}, /* Tcaron */
|
| 344 |
+
{0x01ac, 0x0179}, /* Zacute */
|
| 345 |
+
{0x01ae, 0x017d}, /* Zcaron */
|
| 346 |
+
{0x01af, 0x017b}, /* Zabovedot */
|
| 347 |
+
{0x01b1, 0x0105}, /* aogonek */
|
| 348 |
+
{0x01b2, 0x02db}, /* ogonek */
|
| 349 |
+
{0x01b3, 0x0142}, /* lstroke */
|
| 350 |
+
{0x01b5, 0x013e}, /* lcaron */
|
| 351 |
+
{0x01b6, 0x015b}, /* sacute */
|
| 352 |
+
{0x01b7, 0x02c7}, /* caron */
|
| 353 |
+
{0x01b9, 0x0161}, /* scaron */
|
| 354 |
+
{0x01ba, 0x015f}, /* scedilla */
|
| 355 |
+
{0x01bb, 0x0165}, /* tcaron */
|
| 356 |
+
{0x01bc, 0x017a}, /* zacute */
|
| 357 |
+
{0x01bd, 0x02dd}, /* doubleacute */
|
| 358 |
+
{0x01be, 0x017e}, /* zcaron */
|
| 359 |
+
{0x01bf, 0x017c}, /* zabovedot */
|
| 360 |
+
{0x01c0, 0x0154}, /* Racute */
|
| 361 |
+
{0x01c3, 0x0102}, /* Abreve */
|
| 362 |
+
{0x01c5, 0x0139}, /* Lacute */
|
| 363 |
+
{0x01c6, 0x0106}, /* Cacute */
|
| 364 |
+
{0x01c8, 0x010c}, /* Ccaron */
|
| 365 |
+
{0x01ca, 0x0118}, /* Eogonek */
|
| 366 |
+
{0x01cc, 0x011a}, /* Ecaron */
|
| 367 |
+
{0x01cf, 0x010e}, /* Dcaron */
|
| 368 |
+
{0x01d0, 0x0110}, /* Dstroke */
|
| 369 |
+
{0x01d1, 0x0143}, /* Nacute */
|
| 370 |
+
{0x01d2, 0x0147}, /* Ncaron */
|
| 371 |
+
{0x01d5, 0x0150}, /* Odoubleacute */
|
| 372 |
+
{0x01d8, 0x0158}, /* Rcaron */
|
| 373 |
+
{0x01d9, 0x016e}, /* Uring */
|
| 374 |
+
{0x01db, 0x0170}, /* Udoubleacute */
|
| 375 |
+
{0x01de, 0x0162}, /* Tcedilla */
|
| 376 |
+
{0x01e0, 0x0155}, /* racute */
|
| 377 |
+
{0x01e3, 0x0103}, /* abreve */
|
| 378 |
+
{0x01e5, 0x013a}, /* lacute */
|
| 379 |
+
{0x01e6, 0x0107}, /* cacute */
|
| 380 |
+
{0x01e8, 0x010d}, /* ccaron */
|
| 381 |
+
{0x01ea, 0x0119}, /* eogonek */
|
| 382 |
+
{0x01ec, 0x011b}, /* ecaron */
|
| 383 |
+
{0x01ef, 0x010f}, /* dcaron */
|
| 384 |
+
{0x01f0, 0x0111}, /* dstroke */
|
| 385 |
+
{0x01f1, 0x0144}, /* nacute */
|
| 386 |
+
{0x01f2, 0x0148}, /* ncaron */
|
| 387 |
+
{0x01f5, 0x0151}, /* odoubleacute */
|
| 388 |
+
{0x01f8, 0x0159}, /* rcaron */
|
| 389 |
+
{0x01f9, 0x016f}, /* uring */
|
| 390 |
+
{0x01fb, 0x0171}, /* udoubleacute */
|
| 391 |
+
{0x01fe, 0x0163}, /* tcedilla */
|
| 392 |
+
{0x01ff, 0x02d9}, /* abovedot */
|
| 393 |
+
{0x02a1, 0x0126}, /* Hstroke */
|
| 394 |
+
{0x02a6, 0x0124}, /* Hcircumflex */
|
| 395 |
+
{0x02a9, 0x0130}, /* Iabovedot */
|
| 396 |
+
{0x02ab, 0x011e}, /* Gbreve */
|
| 397 |
+
{0x02ac, 0x0134}, /* Jcircumflex */
|
| 398 |
+
{0x02b1, 0x0127}, /* hstroke */
|
| 399 |
+
{0x02b6, 0x0125}, /* hcircumflex */
|
| 400 |
+
{0x02b9, 0x0131}, /* idotless */
|
| 401 |
+
{0x02bb, 0x011f}, /* gbreve */
|
| 402 |
+
{0x02bc, 0x0135}, /* jcircumflex */
|
| 403 |
+
{0x02c5, 0x010a}, /* Cabovedot */
|
| 404 |
+
{0x02c6, 0x0108}, /* Ccircumflex */
|
| 405 |
+
{0x02d5, 0x0120}, /* Gabovedot */
|
| 406 |
+
{0x02d8, 0x011c}, /* Gcircumflex */
|
| 407 |
+
{0x02dd, 0x016c}, /* Ubreve */
|
| 408 |
+
{0x02de, 0x015c}, /* Scircumflex */
|
| 409 |
+
{0x02e5, 0x010b}, /* cabovedot */
|
| 410 |
+
{0x02e6, 0x0109}, /* ccircumflex */
|
| 411 |
+
{0x02f5, 0x0121}, /* gabovedot */
|
| 412 |
+
{0x02f8, 0x011d}, /* gcircumflex */
|
| 413 |
+
{0x02fd, 0x016d}, /* ubreve */
|
| 414 |
+
{0x02fe, 0x015d}, /* scircumflex */
|
| 415 |
+
{0x03a2, 0x0138}, /* kra */
|
| 416 |
+
{0x03a3, 0x0156}, /* Rcedilla */
|
| 417 |
+
{0x03a5, 0x0128}, /* Itilde */
|
| 418 |
+
{0x03a6, 0x013b}, /* Lcedilla */
|
| 419 |
+
{0x03aa, 0x0112}, /* Emacron */
|
| 420 |
+
{0x03ab, 0x0122}, /* Gcedilla */
|
| 421 |
+
{0x03ac, 0x0166}, /* Tslash */
|
| 422 |
+
{0x03b3, 0x0157}, /* rcedilla */
|
| 423 |
+
{0x03b5, 0x0129}, /* itilde */
|
| 424 |
+
{0x03b6, 0x013c}, /* lcedilla */
|
| 425 |
+
{0x03ba, 0x0113}, /* emacron */
|
| 426 |
+
{0x03bb, 0x0123}, /* gcedilla */
|
| 427 |
+
{0x03bc, 0x0167}, /* tslash */
|
| 428 |
+
{0x03bd, 0x014a}, /* ENG */
|
| 429 |
+
{0x03bf, 0x014b}, /* eng */
|
| 430 |
+
{0x03c0, 0x0100}, /* Amacron */
|
| 431 |
+
{0x03c7, 0x012e}, /* Iogonek */
|
| 432 |
+
{0x03cc, 0x0116}, /* Eabovedot */
|
| 433 |
+
{0x03cf, 0x012a}, /* Imacron */
|
| 434 |
+
{0x03d1, 0x0145}, /* Ncedilla */
|
| 435 |
+
{0x03d2, 0x014c}, /* Omacron */
|
| 436 |
+
{0x03d3, 0x0136}, /* Kcedilla */
|
| 437 |
+
{0x03d9, 0x0172}, /* Uogonek */
|
| 438 |
+
{0x03dd, 0x0168}, /* Utilde */
|
| 439 |
+
{0x03de, 0x016a}, /* Umacron */
|
| 440 |
+
{0x03e0, 0x0101}, /* amacron */
|
| 441 |
+
{0x03e7, 0x012f}, /* iogonek */
|
| 442 |
+
{0x03ec, 0x0117}, /* eabovedot */
|
| 443 |
+
{0x03ef, 0x012b}, /* imacron */
|
| 444 |
+
{0x03f1, 0x0146}, /* ncedilla */
|
| 445 |
+
{0x03f2, 0x014d}, /* omacron */
|
| 446 |
+
{0x03f3, 0x0137}, /* kcedilla */
|
| 447 |
+
{0x03f9, 0x0173}, /* uogonek */
|
| 448 |
+
{0x03fd, 0x0169}, /* utilde */
|
| 449 |
+
{0x03fe, 0x016b}, /* umacron */
|
| 450 |
+
{0x047e, 0x203e}, /* overline */
|
| 451 |
+
{0x04a1, 0x3002}, /* kana_fullstop */
|
| 452 |
+
{0x04a2, 0x300c}, /* kana_openingbracket */
|
| 453 |
+
{0x04a3, 0x300d}, /* kana_closingbracket */
|
| 454 |
+
{0x04a4, 0x3001}, /* kana_comma */
|
| 455 |
+
{0x04a5, 0x30fb}, /* kana_conjunctive */
|
| 456 |
+
{0x04a6, 0x30f2}, /* kana_WO */
|
| 457 |
+
{0x04a7, 0x30a1}, /* kana_a */
|
| 458 |
+
{0x04a8, 0x30a3}, /* kana_i */
|
| 459 |
+
{0x04a9, 0x30a5}, /* kana_u */
|
| 460 |
+
{0x04aa, 0x30a7}, /* kana_e */
|
| 461 |
+
{0x04ab, 0x30a9}, /* kana_o */
|
| 462 |
+
{0x04ac, 0x30e3}, /* kana_ya */
|
| 463 |
+
{0x04ad, 0x30e5}, /* kana_yu */
|
| 464 |
+
{0x04ae, 0x30e7}, /* kana_yo */
|
| 465 |
+
{0x04af, 0x30c3}, /* kana_tsu */
|
| 466 |
+
{0x04b0, 0x30fc}, /* prolongedsound */
|
| 467 |
+
{0x04b1, 0x30a2}, /* kana_A */
|
| 468 |
+
{0x04b2, 0x30a4}, /* kana_I */
|
| 469 |
+
{0x04b3, 0x30a6}, /* kana_U */
|
| 470 |
+
{0x04b4, 0x30a8}, /* kana_E */
|
| 471 |
+
{0x04b5, 0x30aa}, /* kana_O */
|
| 472 |
+
{0x04b6, 0x30ab}, /* kana_KA */
|
| 473 |
+
{0x04b7, 0x30ad}, /* kana_KI */
|
| 474 |
+
{0x04b8, 0x30af}, /* kana_KU */
|
| 475 |
+
{0x04b9, 0x30b1}, /* kana_KE */
|
| 476 |
+
{0x04ba, 0x30b3}, /* kana_KO */
|
| 477 |
+
{0x04bb, 0x30b5}, /* kana_SA */
|
| 478 |
+
{0x04bc, 0x30b7}, /* kana_SHI */
|
| 479 |
+
{0x04bd, 0x30b9}, /* kana_SU */
|
| 480 |
+
{0x04be, 0x30bb}, /* kana_SE */
|
| 481 |
+
{0x04bf, 0x30bd}, /* kana_SO */
|
| 482 |
+
{0x04c0, 0x30bf}, /* kana_TA */
|
| 483 |
+
{0x04c1, 0x30c1}, /* kana_CHI */
|
| 484 |
+
{0x04c2, 0x30c4}, /* kana_TSU */
|
| 485 |
+
{0x04c3, 0x30c6}, /* kana_TE */
|
| 486 |
+
{0x04c4, 0x30c8}, /* kana_TO */
|
| 487 |
+
{0x04c5, 0x30ca}, /* kana_NA */
|
| 488 |
+
{0x04c6, 0x30cb}, /* kana_NI */
|
| 489 |
+
{0x04c7, 0x30cc}, /* kana_NU */
|
| 490 |
+
{0x04c8, 0x30cd}, /* kana_NE */
|
| 491 |
+
{0x04c9, 0x30ce}, /* kana_NO */
|
| 492 |
+
{0x04ca, 0x30cf}, /* kana_HA */
|
| 493 |
+
{0x04cb, 0x30d2}, /* kana_HI */
|
| 494 |
+
{0x04cc, 0x30d5}, /* kana_FU */
|
| 495 |
+
{0x04cd, 0x30d8}, /* kana_HE */
|
| 496 |
+
{0x04ce, 0x30db}, /* kana_HO */
|
| 497 |
+
{0x04cf, 0x30de}, /* kana_MA */
|
| 498 |
+
{0x04d0, 0x30df}, /* kana_MI */
|
| 499 |
+
{0x04d1, 0x30e0}, /* kana_MU */
|
| 500 |
+
{0x04d2, 0x30e1}, /* kana_ME */
|
| 501 |
+
{0x04d3, 0x30e2}, /* kana_MO */
|
| 502 |
+
{0x04d4, 0x30e4}, /* kana_YA */
|
| 503 |
+
{0x04d5, 0x30e6}, /* kana_YU */
|
| 504 |
+
{0x04d6, 0x30e8}, /* kana_YO */
|
| 505 |
+
{0x04d7, 0x30e9}, /* kana_RA */
|
| 506 |
+
{0x04d8, 0x30ea}, /* kana_RI */
|
| 507 |
+
{0x04d9, 0x30eb}, /* kana_RU */
|
| 508 |
+
{0x04da, 0x30ec}, /* kana_RE */
|
| 509 |
+
{0x04db, 0x30ed}, /* kana_RO */
|
| 510 |
+
{0x04dc, 0x30ef}, /* kana_WA */
|
| 511 |
+
{0x04dd, 0x30f3}, /* kana_N */
|
| 512 |
+
{0x04de, 0x309b}, /* voicedsound */
|
| 513 |
+
{0x04df, 0x309c}, /* semivoicedsound */
|
| 514 |
+
{0x05ac, 0x060c}, /* Arabic_comma */
|
| 515 |
+
{0x05bb, 0x061b}, /* Arabic_semicolon */
|
| 516 |
+
{0x05bf, 0x061f}, /* Arabic_question_mark */
|
| 517 |
+
{0x05c1, 0x0621}, /* Arabic_hamza */
|
| 518 |
+
{0x05c2, 0x0622}, /* Arabic_maddaonalef */
|
| 519 |
+
{0x05c3, 0x0623}, /* Arabic_hamzaonalef */
|
| 520 |
+
{0x05c4, 0x0624}, /* Arabic_hamzaonwaw */
|
| 521 |
+
{0x05c5, 0x0625}, /* Arabic_hamzaunderalef */
|
| 522 |
+
{0x05c6, 0x0626}, /* Arabic_hamzaonyeh */
|
| 523 |
+
{0x05c7, 0x0627}, /* Arabic_alef */
|
| 524 |
+
{0x05c8, 0x0628}, /* Arabic_beh */
|
| 525 |
+
{0x05c9, 0x0629}, /* Arabic_tehmarbuta */
|
| 526 |
+
{0x05ca, 0x062a}, /* Arabic_teh */
|
| 527 |
+
{0x05cb, 0x062b}, /* Arabic_theh */
|
| 528 |
+
{0x05cc, 0x062c}, /* Arabic_jeem */
|
| 529 |
+
{0x05cd, 0x062d}, /* Arabic_hah */
|
| 530 |
+
{0x05ce, 0x062e}, /* Arabic_khah */
|
| 531 |
+
{0x05cf, 0x062f}, /* Arabic_dal */
|
| 532 |
+
{0x05d0, 0x0630}, /* Arabic_thal */
|
| 533 |
+
{0x05d1, 0x0631}, /* Arabic_ra */
|
| 534 |
+
{0x05d2, 0x0632}, /* Arabic_zain */
|
| 535 |
+
{0x05d3, 0x0633}, /* Arabic_seen */
|
| 536 |
+
{0x05d4, 0x0634}, /* Arabic_sheen */
|
| 537 |
+
{0x05d5, 0x0635}, /* Arabic_sad */
|
| 538 |
+
{0x05d6, 0x0636}, /* Arabic_dad */
|
| 539 |
+
{0x05d7, 0x0637}, /* Arabic_tah */
|
| 540 |
+
{0x05d8, 0x0638}, /* Arabic_zah */
|
| 541 |
+
{0x05d9, 0x0639}, /* Arabic_ain */
|
| 542 |
+
{0x05da, 0x063a}, /* Arabic_ghain */
|
| 543 |
+
{0x05e0, 0x0640}, /* Arabic_tatweel */
|
| 544 |
+
{0x05e1, 0x0641}, /* Arabic_feh */
|
| 545 |
+
{0x05e2, 0x0642}, /* Arabic_qaf */
|
| 546 |
+
{0x05e3, 0x0643}, /* Arabic_kaf */
|
| 547 |
+
{0x05e4, 0x0644}, /* Arabic_lam */
|
| 548 |
+
{0x05e5, 0x0645}, /* Arabic_meem */
|
| 549 |
+
{0x05e6, 0x0646}, /* Arabic_noon */
|
| 550 |
+
{0x05e7, 0x0647}, /* Arabic_ha */
|
| 551 |
+
{0x05e8, 0x0648}, /* Arabic_waw */
|
| 552 |
+
{0x05e9, 0x0649}, /* Arabic_alefmaksura */
|
| 553 |
+
{0x05ea, 0x064a}, /* Arabic_yeh */
|
| 554 |
+
{0x05eb, 0x064b}, /* Arabic_fathatan */
|
| 555 |
+
{0x05ec, 0x064c}, /* Arabic_dammatan */
|
| 556 |
+
{0x05ed, 0x064d}, /* Arabic_kasratan */
|
| 557 |
+
{0x05ee, 0x064e}, /* Arabic_fatha */
|
| 558 |
+
{0x05ef, 0x064f}, /* Arabic_damma */
|
| 559 |
+
{0x05f0, 0x0650}, /* Arabic_kasra */
|
| 560 |
+
{0x05f1, 0x0651}, /* Arabic_shadda */
|
| 561 |
+
{0x05f2, 0x0652}, /* Arabic_sukun */
|
| 562 |
+
{0x06a1, 0x0452}, /* Serbian_dje */
|
| 563 |
+
{0x06a2, 0x0453}, /* Macedonia_gje */
|
| 564 |
+
{0x06a3, 0x0451}, /* Cyrillic_io */
|
| 565 |
+
{0x06a4, 0x0454}, /* Ukrainian_ie */
|
| 566 |
+
{0x06a5, 0x0455}, /* Macedonia_dse */
|
| 567 |
+
{0x06a6, 0x0456}, /* Ukrainian_i */
|
| 568 |
+
{0x06a7, 0x0457}, /* Ukrainian_yi */
|
| 569 |
+
{0x06a8, 0x0458}, /* Cyrillic_je */
|
| 570 |
+
{0x06a9, 0x0459}, /* Cyrillic_lje */
|
| 571 |
+
{0x06aa, 0x045a}, /* Cyrillic_nje */
|
| 572 |
+
{0x06ab, 0x045b}, /* Serbian_tshe */
|
| 573 |
+
{0x06ac, 0x045c}, /* Macedonia_kje */
|
| 574 |
+
{0x06ae, 0x045e}, /* Byelorussian_shortu */
|
| 575 |
+
{0x06af, 0x045f}, /* Cyrillic_dzhe */
|
| 576 |
+
{0x06b0, 0x2116}, /* numerosign */
|
| 577 |
+
{0x06b1, 0x0402}, /* Serbian_DJE */
|
| 578 |
+
{0x06b2, 0x0403}, /* Macedonia_GJE */
|
| 579 |
+
{0x06b3, 0x0401}, /* Cyrillic_IO */
|
| 580 |
+
{0x06b4, 0x0404}, /* Ukrainian_IE */
|
| 581 |
+
{0x06b5, 0x0405}, /* Macedonia_DSE */
|
| 582 |
+
{0x06b6, 0x0406}, /* Ukrainian_I */
|
| 583 |
+
{0x06b7, 0x0407}, /* Ukrainian_YI */
|
| 584 |
+
{0x06b8, 0x0408}, /* Cyrillic_JE */
|
| 585 |
+
{0x06b9, 0x0409}, /* Cyrillic_LJE */
|
| 586 |
+
{0x06ba, 0x040a}, /* Cyrillic_NJE */
|
| 587 |
+
{0x06bb, 0x040b}, /* Serbian_TSHE */
|
| 588 |
+
{0x06bc, 0x040c}, /* Macedonia_KJE */
|
| 589 |
+
{0x06be, 0x040e}, /* Byelorussian_SHORTU */
|
| 590 |
+
{0x06bf, 0x040f}, /* Cyrillic_DZHE */
|
| 591 |
+
{0x06c0, 0x044e}, /* Cyrillic_yu */
|
| 592 |
+
{0x06c1, 0x0430}, /* Cyrillic_a */
|
| 593 |
+
{0x06c2, 0x0431}, /* Cyrillic_be */
|
| 594 |
+
{0x06c3, 0x0446}, /* Cyrillic_tse */
|
| 595 |
+
{0x06c4, 0x0434}, /* Cyrillic_de */
|
| 596 |
+
{0x06c5, 0x0435}, /* Cyrillic_ie */
|
| 597 |
+
{0x06c6, 0x0444}, /* Cyrillic_ef */
|
| 598 |
+
{0x06c7, 0x0433}, /* Cyrillic_ghe */
|
| 599 |
+
{0x06c8, 0x0445}, /* Cyrillic_ha */
|
| 600 |
+
{0x06c9, 0x0438}, /* Cyrillic_i */
|
| 601 |
+
{0x06ca, 0x0439}, /* Cyrillic_shorti */
|
| 602 |
+
{0x06cb, 0x043a}, /* Cyrillic_ka */
|
| 603 |
+
{0x06cc, 0x043b}, /* Cyrillic_el */
|
| 604 |
+
{0x06cd, 0x043c}, /* Cyrillic_em */
|
| 605 |
+
{0x06ce, 0x043d}, /* Cyrillic_en */
|
| 606 |
+
{0x06cf, 0x043e}, /* Cyrillic_o */
|
| 607 |
+
{0x06d0, 0x043f}, /* Cyrillic_pe */
|
| 608 |
+
{0x06d1, 0x044f}, /* Cyrillic_ya */
|
| 609 |
+
{0x06d2, 0x0440}, /* Cyrillic_er */
|
| 610 |
+
{0x06d3, 0x0441}, /* Cyrillic_es */
|
| 611 |
+
{0x06d4, 0x0442}, /* Cyrillic_te */
|
| 612 |
+
{0x06d5, 0x0443}, /* Cyrillic_u */
|
| 613 |
+
{0x06d6, 0x0436}, /* Cyrillic_zhe */
|
| 614 |
+
{0x06d7, 0x0432}, /* Cyrillic_ve */
|
| 615 |
+
{0x06d8, 0x044c}, /* Cyrillic_softsign */
|
| 616 |
+
{0x06d9, 0x044b}, /* Cyrillic_yeru */
|
| 617 |
+
{0x06da, 0x0437}, /* Cyrillic_ze */
|
| 618 |
+
{0x06db, 0x0448}, /* Cyrillic_sha */
|
| 619 |
+
{0x06dc, 0x044d}, /* Cyrillic_e */
|
| 620 |
+
{0x06dd, 0x0449}, /* Cyrillic_shcha */
|
| 621 |
+
{0x06de, 0x0447}, /* Cyrillic_che */
|
| 622 |
+
{0x06df, 0x044a}, /* Cyrillic_hardsign */
|
| 623 |
+
{0x06e0, 0x042e}, /* Cyrillic_YU */
|
| 624 |
+
{0x06e1, 0x0410}, /* Cyrillic_A */
|
| 625 |
+
{0x06e2, 0x0411}, /* Cyrillic_BE */
|
| 626 |
+
{0x06e3, 0x0426}, /* Cyrillic_TSE */
|
| 627 |
+
{0x06e4, 0x0414}, /* Cyrillic_DE */
|
| 628 |
+
{0x06e5, 0x0415}, /* Cyrillic_IE */
|
| 629 |
+
{0x06e6, 0x0424}, /* Cyrillic_EF */
|
| 630 |
+
{0x06e7, 0x0413}, /* Cyrillic_GHE */
|
| 631 |
+
{0x06e8, 0x0425}, /* Cyrillic_HA */
|
| 632 |
+
{0x06e9, 0x0418}, /* Cyrillic_I */
|
| 633 |
+
{0x06ea, 0x0419}, /* Cyrillic_SHORTI */
|
| 634 |
+
{0x06eb, 0x041a}, /* Cyrillic_KA */
|
| 635 |
+
{0x06ec, 0x041b}, /* Cyrillic_EL */
|
| 636 |
+
{0x06ed, 0x041c}, /* Cyrillic_EM */
|
| 637 |
+
{0x06ee, 0x041d}, /* Cyrillic_EN */
|
| 638 |
+
{0x06ef, 0x041e}, /* Cyrillic_O */
|
| 639 |
+
{0x06f0, 0x041f}, /* Cyrillic_PE */
|
| 640 |
+
{0x06f1, 0x042f}, /* Cyrillic_YA */
|
| 641 |
+
{0x06f2, 0x0420}, /* Cyrillic_ER */
|
| 642 |
+
{0x06f3, 0x0421}, /* Cyrillic_ES */
|
| 643 |
+
{0x06f4, 0x0422}, /* Cyrillic_TE */
|
| 644 |
+
{0x06f5, 0x0423}, /* Cyrillic_U */
|
| 645 |
+
{0x06f6, 0x0416}, /* Cyrillic_ZHE */
|
| 646 |
+
{0x06f7, 0x0412}, /* Cyrillic_VE */
|
| 647 |
+
{0x06f8, 0x042c}, /* Cyrillic_SOFTSIGN */
|
| 648 |
+
{0x06f9, 0x042b}, /* Cyrillic_YERU */
|
| 649 |
+
{0x06fa, 0x0417}, /* Cyrillic_ZE */
|
| 650 |
+
{0x06fb, 0x0428}, /* Cyrillic_SHA */
|
| 651 |
+
{0x06fc, 0x042d}, /* Cyrillic_E */
|
| 652 |
+
{0x06fd, 0x0429}, /* Cyrillic_SHCHA */
|
| 653 |
+
{0x06fe, 0x0427}, /* Cyrillic_CHE */
|
| 654 |
+
{0x06ff, 0x042a}, /* Cyrillic_HARDSIGN */
|
| 655 |
+
{0x07a1, 0x0386}, /* Greek_ALPHAaccent */
|
| 656 |
+
{0x07a2, 0x0388}, /* Greek_EPSILONaccent */
|
| 657 |
+
{0x07a3, 0x0389}, /* Greek_ETAaccent */
|
| 658 |
+
{0x07a4, 0x038a}, /* Greek_IOTAaccent */
|
| 659 |
+
{0x07a5, 0x03aa}, /* Greek_IOTAdiaeresis */
|
| 660 |
+
{0x07a7, 0x038c}, /* Greek_OMICRONaccent */
|
| 661 |
+
{0x07a8, 0x038e}, /* Greek_UPSILONaccent */
|
| 662 |
+
{0x07a9, 0x03ab}, /* Greek_UPSILONdieresis */
|
| 663 |
+
{0x07ab, 0x038f}, /* Greek_OMEGAaccent */
|
| 664 |
+
{0x07ae, 0x0385}, /* Greek_accentdieresis */
|
| 665 |
+
{0x07af, 0x2015}, /* Greek_horizbar */
|
| 666 |
+
{0x07b1, 0x03ac}, /* Greek_alphaaccent */
|
| 667 |
+
{0x07b2, 0x03ad}, /* Greek_epsilonaccent */
|
| 668 |
+
{0x07b3, 0x03ae}, /* Greek_etaaccent */
|
| 669 |
+
{0x07b4, 0x03af}, /* Greek_iotaaccent */
|
| 670 |
+
{0x07b5, 0x03ca}, /* Greek_iotadieresis */
|
| 671 |
+
{0x07b6, 0x0390}, /* Greek_iotaaccentdieresis */
|
| 672 |
+
{0x07b7, 0x03cc}, /* Greek_omicronaccent */
|
| 673 |
+
{0x07b8, 0x03cd}, /* Greek_upsilonaccent */
|
| 674 |
+
{0x07b9, 0x03cb}, /* Greek_upsilondieresis */
|
| 675 |
+
{0x07ba, 0x03b0}, /* Greek_upsilonaccentdieresis */
|
| 676 |
+
{0x07bb, 0x03ce}, /* Greek_omegaaccent */
|
| 677 |
+
{0x07c1, 0x0391}, /* Greek_ALPHA */
|
| 678 |
+
{0x07c2, 0x0392}, /* Greek_BETA */
|
| 679 |
+
{0x07c3, 0x0393}, /* Greek_GAMMA */
|
| 680 |
+
{0x07c4, 0x0394}, /* Greek_DELTA */
|
| 681 |
+
{0x07c5, 0x0395}, /* Greek_EPSILON */
|
| 682 |
+
{0x07c6, 0x0396}, /* Greek_ZETA */
|
| 683 |
+
{0x07c7, 0x0397}, /* Greek_ETA */
|
| 684 |
+
{0x07c8, 0x0398}, /* Greek_THETA */
|
| 685 |
+
{0x07c9, 0x0399}, /* Greek_IOTA */
|
| 686 |
+
{0x07ca, 0x039a}, /* Greek_KAPPA */
|
| 687 |
+
{0x07cb, 0x039b}, /* Greek_LAMDA */
|
| 688 |
+
{0x07cc, 0x039c}, /* Greek_MU */
|
| 689 |
+
{0x07cd, 0x039d}, /* Greek_NU */
|
| 690 |
+
{0x07ce, 0x039e}, /* Greek_XI */
|
| 691 |
+
{0x07cf, 0x039f}, /* Greek_OMICRON */
|
| 692 |
+
{0x07d0, 0x03a0}, /* Greek_PI */
|
| 693 |
+
{0x07d1, 0x03a1}, /* Greek_RHO */
|
| 694 |
+
{0x07d2, 0x03a3}, /* Greek_SIGMA */
|
| 695 |
+
{0x07d4, 0x03a4}, /* Greek_TAU */
|
| 696 |
+
{0x07d5, 0x03a5}, /* Greek_UPSILON */
|
| 697 |
+
{0x07d6, 0x03a6}, /* Greek_PHI */
|
| 698 |
+
{0x07d7, 0x03a7}, /* Greek_CHI */
|
| 699 |
+
{0x07d8, 0x03a8}, /* Greek_PSI */
|
| 700 |
+
{0x07d9, 0x03a9}, /* Greek_OMEGA */
|
| 701 |
+
{0x07e1, 0x03b1}, /* Greek_alpha */
|
| 702 |
+
{0x07e2, 0x03b2}, /* Greek_beta */
|
| 703 |
+
{0x07e3, 0x03b3}, /* Greek_gamma */
|
| 704 |
+
{0x07e4, 0x03b4}, /* Greek_delta */
|
| 705 |
+
{0x07e5, 0x03b5}, /* Greek_epsilon */
|
| 706 |
+
{0x07e6, 0x03b6}, /* Greek_zeta */
|
| 707 |
+
{0x07e7, 0x03b7}, /* Greek_eta */
|
| 708 |
+
{0x07e8, 0x03b8}, /* Greek_theta */
|
| 709 |
+
{0x07e9, 0x03b9}, /* Greek_iota */
|
| 710 |
+
{0x07ea, 0x03ba}, /* Greek_kappa */
|
| 711 |
+
{0x07eb, 0x03bb}, /* Greek_lambda */
|
| 712 |
+
{0x07ec, 0x03bc}, /* Greek_mu */
|
| 713 |
+
{0x07ed, 0x03bd}, /* Greek_nu */
|
| 714 |
+
{0x07ee, 0x03be}, /* Greek_xi */
|
| 715 |
+
{0x07ef, 0x03bf}, /* Greek_omicron */
|
| 716 |
+
{0x07f0, 0x03c0}, /* Greek_pi */
|
| 717 |
+
{0x07f1, 0x03c1}, /* Greek_rho */
|
| 718 |
+
{0x07f2, 0x03c3}, /* Greek_sigma */
|
| 719 |
+
{0x07f3, 0x03c2}, /* Greek_finalsmallsigma */
|
| 720 |
+
{0x07f4, 0x03c4}, /* Greek_tau */
|
| 721 |
+
{0x07f5, 0x03c5}, /* Greek_upsilon */
|
| 722 |
+
{0x07f6, 0x03c6}, /* Greek_phi */
|
| 723 |
+
{0x07f7, 0x03c7}, /* Greek_chi */
|
| 724 |
+
{0x07f8, 0x03c8}, /* Greek_psi */
|
| 725 |
+
{0x07f9, 0x03c9}, /* Greek_omega */
|
| 726 |
+
{0x08a1, 0x23b7}, /* leftradical */
|
| 727 |
+
{0x08a4, 0x2320}, /* topintegral */
|
| 728 |
+
{0x08a5, 0x2321}, /* botintegral */
|
| 729 |
+
{0x08a7, 0x23a1}, /* topleftsqbracket */
|
| 730 |
+
{0x08a8, 0x23a3}, /* botleftsqbracket */
|
| 731 |
+
{0x08a9, 0x23a4}, /* toprightsqbracket */
|
| 732 |
+
{0x08aa, 0x23a6}, /* botrightsqbracket */
|
| 733 |
+
{0x08ab, 0x239b}, /* topleftparens */
|
| 734 |
+
{0x08ac, 0x239d}, /* botleftparens */
|
| 735 |
+
{0x08ad, 0x239e}, /* toprightparens */
|
| 736 |
+
{0x08ae, 0x23a0}, /* botrightparens */
|
| 737 |
+
{0x08af, 0x23a8}, /* leftmiddlecurlybrace */
|
| 738 |
+
{0x08b0, 0x23ac}, /* rightmiddlecurlybrace */
|
| 739 |
+
{0x08bc, 0x2264}, /* lessthanequal */
|
| 740 |
+
{0x08bd, 0x2260}, /* notequal */
|
| 741 |
+
{0x08be, 0x2265}, /* greaterthanequal */
|
| 742 |
+
{0x08bf, 0x222b}, /* integral */
|
| 743 |
+
{0x08c0, 0x2234}, /* therefore */
|
| 744 |
+
{0x08c1, 0x221d}, /* variation */
|
| 745 |
+
{0x08c2, 0x221e}, /* infinity */
|
| 746 |
+
{0x08c5, 0x2207}, /* nabla */
|
| 747 |
+
{0x08c8, 0x223c}, /* approximate */
|
| 748 |
+
{0x08c9, 0x2243}, /* similarequal */
|
| 749 |
+
{0x08cd, 0x21d4}, /* ifonlyif */
|
| 750 |
+
{0x08ce, 0x21d2}, /* implies */
|
| 751 |
+
{0x08cf, 0x2261}, /* identical */
|
| 752 |
+
{0x08d6, 0x221a}, /* radical */
|
| 753 |
+
{0x08da, 0x2282}, /* includedin */
|
| 754 |
+
{0x08db, 0x2283}, /* includes */
|
| 755 |
+
{0x08dc, 0x2229}, /* intersection */
|
| 756 |
+
{0x08dd, 0x222a}, /* union */
|
| 757 |
+
{0x08de, 0x2227}, /* logicaland */
|
| 758 |
+
{0x08df, 0x2228}, /* logicalor */
|
| 759 |
+
{0x08ef, 0x2202}, /* partialderivative */
|
| 760 |
+
{0x08f6, 0x0192}, /* function */
|
| 761 |
+
{0x08fb, 0x2190}, /* leftarrow */
|
| 762 |
+
{0x08fc, 0x2191}, /* uparrow */
|
| 763 |
+
{0x08fd, 0x2192}, /* rightarrow */
|
| 764 |
+
{0x08fe, 0x2193}, /* downarrow */
|
| 765 |
+
{0x09e0, 0x25c6}, /* soliddiamond */
|
| 766 |
+
{0x09e1, 0x2592}, /* checkerboard */
|
| 767 |
+
{0x09e2, 0x2409}, /* ht */
|
| 768 |
+
{0x09e3, 0x240c}, /* ff */
|
| 769 |
+
{0x09e4, 0x240d}, /* cr */
|
| 770 |
+
{0x09e5, 0x240a}, /* lf */
|
| 771 |
+
{0x09e8, 0x2424}, /* nl */
|
| 772 |
+
{0x09e9, 0x240b}, /* vt */
|
| 773 |
+
{0x09ea, 0x2518}, /* lowrightcorner */
|
| 774 |
+
{0x09eb, 0x2510}, /* uprightcorner */
|
| 775 |
+
{0x09ec, 0x250c}, /* upleftcorner */
|
| 776 |
+
{0x09ed, 0x2514}, /* lowleftcorner */
|
| 777 |
+
{0x09ee, 0x253c}, /* crossinglines */
|
| 778 |
+
{0x09ef, 0x23ba}, /* horizlinescan1 */
|
| 779 |
+
{0x09f0, 0x23bb}, /* horizlinescan3 */
|
| 780 |
+
{0x09f1, 0x2500}, /* horizlinescan5 */
|
| 781 |
+
{0x09f2, 0x23bc}, /* horizlinescan7 */
|
| 782 |
+
{0x09f3, 0x23bd}, /* horizlinescan9 */
|
| 783 |
+
{0x09f4, 0x251c}, /* leftt */
|
| 784 |
+
{0x09f5, 0x2524}, /* rightt */
|
| 785 |
+
{0x09f6, 0x2534}, /* bott */
|
| 786 |
+
{0x09f7, 0x252c}, /* topt */
|
| 787 |
+
{0x09f8, 0x2502}, /* vertbar */
|
| 788 |
+
{0x0aa1, 0x2003}, /* emspace */
|
| 789 |
+
{0x0aa2, 0x2002}, /* enspace */
|
| 790 |
+
{0x0aa3, 0x2004}, /* em3space */
|
| 791 |
+
{0x0aa4, 0x2005}, /* em4space */
|
| 792 |
+
{0x0aa5, 0x2007}, /* digitspace */
|
| 793 |
+
{0x0aa6, 0x2008}, /* punctspace */
|
| 794 |
+
{0x0aa7, 0x2009}, /* thinspace */
|
| 795 |
+
{0x0aa8, 0x200a}, /* hairspace */
|
| 796 |
+
{0x0aa9, 0x2014}, /* emdash */
|
| 797 |
+
{0x0aaa, 0x2013}, /* endash */
|
| 798 |
+
{0x0aae, 0x2026}, /* ellipsis */
|
| 799 |
+
{0x0aaf, 0x2025}, /* doubbaselinedot */
|
| 800 |
+
{0x0ab0, 0x2153}, /* onethird */
|
| 801 |
+
{0x0ab1, 0x2154}, /* twothirds */
|
| 802 |
+
{0x0ab2, 0x2155}, /* onefifth */
|
| 803 |
+
{0x0ab3, 0x2156}, /* twofifths */
|
| 804 |
+
{0x0ab4, 0x2157}, /* threefifths */
|
| 805 |
+
{0x0ab5, 0x2158}, /* fourfifths */
|
| 806 |
+
{0x0ab6, 0x2159}, /* onesixth */
|
| 807 |
+
{0x0ab7, 0x215a}, /* fivesixths */
|
| 808 |
+
{0x0ab8, 0x2105}, /* careof */
|
| 809 |
+
{0x0abb, 0x2012}, /* figdash */
|
| 810 |
+
{0x0ac3, 0x215b}, /* oneeighth */
|
| 811 |
+
{0x0ac4, 0x215c}, /* threeeighths */
|
| 812 |
+
{0x0ac5, 0x215d}, /* fiveeighths */
|
| 813 |
+
{0x0ac6, 0x215e}, /* seveneighths */
|
| 814 |
+
{0x0ac9, 0x2122}, /* trademark */
|
| 815 |
+
{0x0ad0, 0x2018}, /* leftsinglequotemark */
|
| 816 |
+
{0x0ad1, 0x2019}, /* rightsinglequotemark */
|
| 817 |
+
{0x0ad2, 0x201c}, /* leftdoublequotemark */
|
| 818 |
+
{0x0ad3, 0x201d}, /* rightdoublequotemark */
|
| 819 |
+
{0x0ad4, 0x211e}, /* prescription */
|
| 820 |
+
{0x0ad6, 0x2032}, /* minutes */
|
| 821 |
+
{0x0ad7, 0x2033}, /* seconds */
|
| 822 |
+
{0x0ad9, 0x271d}, /* latincross */
|
| 823 |
+
{0x0aec, 0x2663}, /* club */
|
| 824 |
+
{0x0aed, 0x2666}, /* diamond */
|
| 825 |
+
{0x0aee, 0x2665}, /* heart */
|
| 826 |
+
{0x0af0, 0x2720}, /* maltesecross */
|
| 827 |
+
{0x0af1, 0x2020}, /* dagger */
|
| 828 |
+
{0x0af2, 0x2021}, /* doubledagger */
|
| 829 |
+
{0x0af3, 0x2713}, /* checkmark */
|
| 830 |
+
{0x0af4, 0x2717}, /* ballotcross */
|
| 831 |
+
{0x0af5, 0x266f}, /* musicalsharp */
|
| 832 |
+
{0x0af6, 0x266d}, /* musicalflat */
|
| 833 |
+
{0x0af7, 0x2642}, /* malesymbol */
|
| 834 |
+
{0x0af8, 0x2640}, /* femalesymbol */
|
| 835 |
+
{0x0af9, 0x260e}, /* telephone */
|
| 836 |
+
{0x0afa, 0x2315}, /* telephonerecorder */
|
| 837 |
+
{0x0afb, 0x2117}, /* phonographcopyright */
|
| 838 |
+
{0x0afc, 0x2038}, /* caret */
|
| 839 |
+
{0x0afd, 0x201a}, /* singlelowquotemark */
|
| 840 |
+
{0x0afe, 0x201e}, /* doublelowquotemark */
|
| 841 |
+
{0x0bc2, 0x22a5}, /* downtack */
|
| 842 |
+
{0x0bc4, 0x230a}, /* downstile */
|
| 843 |
+
{0x0bca, 0x2218}, /* jot */
|
| 844 |
+
{0x0bcc, 0x2395}, /* quad */
|
| 845 |
+
{0x0bce, 0x22a4}, /* uptack */
|
| 846 |
+
{0x0bcf, 0x25cb}, /* circle */
|
| 847 |
+
{0x0bd3, 0x2308}, /* upstile */
|
| 848 |
+
{0x0bdc, 0x22a2}, /* lefttack */
|
| 849 |
+
{0x0bfc, 0x22a3}, /* righttack */
|
| 850 |
+
{0x0cdf, 0x2017}, /* hebrew_doublelowline */
|
| 851 |
+
{0x0ce0, 0x05d0}, /* hebrew_aleph */
|
| 852 |
+
{0x0ce1, 0x05d1}, /* hebrew_bet */
|
| 853 |
+
{0x0ce2, 0x05d2}, /* hebrew_gimel */
|
| 854 |
+
{0x0ce3, 0x05d3}, /* hebrew_dalet */
|
| 855 |
+
{0x0ce4, 0x05d4}, /* hebrew_he */
|
| 856 |
+
{0x0ce5, 0x05d5}, /* hebrew_waw */
|
| 857 |
+
{0x0ce6, 0x05d6}, /* hebrew_zain */
|
| 858 |
+
{0x0ce7, 0x05d7}, /* hebrew_chet */
|
| 859 |
+
{0x0ce8, 0x05d8}, /* hebrew_tet */
|
| 860 |
+
{0x0ce9, 0x05d9}, /* hebrew_yod */
|
| 861 |
+
{0x0cea, 0x05da}, /* hebrew_finalkaph */
|
| 862 |
+
{0x0ceb, 0x05db}, /* hebrew_kaph */
|
| 863 |
+
{0x0cec, 0x05dc}, /* hebrew_lamed */
|
| 864 |
+
{0x0ced, 0x05dd}, /* hebrew_finalmem */
|
| 865 |
+
{0x0cee, 0x05de}, /* hebrew_mem */
|
| 866 |
+
{0x0cef, 0x05df}, /* hebrew_finalnun */
|
| 867 |
+
{0x0cf0, 0x05e0}, /* hebrew_nun */
|
| 868 |
+
{0x0cf1, 0x05e1}, /* hebrew_samech */
|
| 869 |
+
{0x0cf2, 0x05e2}, /* hebrew_ayin */
|
| 870 |
+
{0x0cf3, 0x05e3}, /* hebrew_finalpe */
|
| 871 |
+
{0x0cf4, 0x05e4}, /* hebrew_pe */
|
| 872 |
+
{0x0cf5, 0x05e5}, /* hebrew_finalzade */
|
| 873 |
+
{0x0cf6, 0x05e6}, /* hebrew_zade */
|
| 874 |
+
{0x0cf7, 0x05e7}, /* hebrew_qoph */
|
| 875 |
+
{0x0cf8, 0x05e8}, /* hebrew_resh */
|
| 876 |
+
{0x0cf9, 0x05e9}, /* hebrew_shin */
|
| 877 |
+
{0x0cfa, 0x05ea}, /* hebrew_taw */
|
| 878 |
+
{0x0da1, 0x0e01}, /* Thai_kokai */
|
| 879 |
+
{0x0da2, 0x0e02}, /* Thai_khokhai */
|
| 880 |
+
{0x0da3, 0x0e03}, /* Thai_khokhuat */
|
| 881 |
+
{0x0da4, 0x0e04}, /* Thai_khokhwai */
|
| 882 |
+
{0x0da5, 0x0e05}, /* Thai_khokhon */
|
| 883 |
+
{0x0da6, 0x0e06}, /* Thai_khorakhang */
|
| 884 |
+
{0x0da7, 0x0e07}, /* Thai_ngongu */
|
| 885 |
+
{0x0da8, 0x0e08}, /* Thai_chochan */
|
| 886 |
+
{0x0da9, 0x0e09}, /* Thai_choching */
|
| 887 |
+
{0x0daa, 0x0e0a}, /* Thai_chochang */
|
| 888 |
+
{0x0dab, 0x0e0b}, /* Thai_soso */
|
| 889 |
+
{0x0dac, 0x0e0c}, /* Thai_chochoe */
|
| 890 |
+
{0x0dad, 0x0e0d}, /* Thai_yoying */
|
| 891 |
+
{0x0dae, 0x0e0e}, /* Thai_dochada */
|
| 892 |
+
{0x0daf, 0x0e0f}, /* Thai_topatak */
|
| 893 |
+
{0x0db0, 0x0e10}, /* Thai_thothan */
|
| 894 |
+
{0x0db1, 0x0e11}, /* Thai_thonangmontho */
|
| 895 |
+
{0x0db2, 0x0e12}, /* Thai_thophuthao */
|
| 896 |
+
{0x0db3, 0x0e13}, /* Thai_nonen */
|
| 897 |
+
{0x0db4, 0x0e14}, /* Thai_dodek */
|
| 898 |
+
{0x0db5, 0x0e15}, /* Thai_totao */
|
| 899 |
+
{0x0db6, 0x0e16}, /* Thai_thothung */
|
| 900 |
+
{0x0db7, 0x0e17}, /* Thai_thothahan */
|
| 901 |
+
{0x0db8, 0x0e18}, /* Thai_thothong */
|
| 902 |
+
{0x0db9, 0x0e19}, /* Thai_nonu */
|
| 903 |
+
{0x0dba, 0x0e1a}, /* Thai_bobaimai */
|
| 904 |
+
{0x0dbb, 0x0e1b}, /* Thai_popla */
|
| 905 |
+
{0x0dbc, 0x0e1c}, /* Thai_phophung */
|
| 906 |
+
{0x0dbd, 0x0e1d}, /* Thai_fofa */
|
| 907 |
+
{0x0dbe, 0x0e1e}, /* Thai_phophan */
|
| 908 |
+
{0x0dbf, 0x0e1f}, /* Thai_fofan */
|
| 909 |
+
{0x0dc0, 0x0e20}, /* Thai_phosamphao */
|
| 910 |
+
{0x0dc1, 0x0e21}, /* Thai_moma */
|
| 911 |
+
{0x0dc2, 0x0e22}, /* Thai_yoyak */
|
| 912 |
+
{0x0dc3, 0x0e23}, /* Thai_rorua */
|
| 913 |
+
{0x0dc4, 0x0e24}, /* Thai_ru */
|
| 914 |
+
{0x0dc5, 0x0e25}, /* Thai_loling */
|
| 915 |
+
{0x0dc6, 0x0e26}, /* Thai_lu */
|
| 916 |
+
{0x0dc7, 0x0e27}, /* Thai_wowaen */
|
| 917 |
+
{0x0dc8, 0x0e28}, /* Thai_sosala */
|
| 918 |
+
{0x0dc9, 0x0e29}, /* Thai_sorusi */
|
| 919 |
+
{0x0dca, 0x0e2a}, /* Thai_sosua */
|
| 920 |
+
{0x0dcb, 0x0e2b}, /* Thai_hohip */
|
| 921 |
+
{0x0dcc, 0x0e2c}, /* Thai_lochula */
|
| 922 |
+
{0x0dcd, 0x0e2d}, /* Thai_oang */
|
| 923 |
+
{0x0dce, 0x0e2e}, /* Thai_honokhuk */
|
| 924 |
+
{0x0dcf, 0x0e2f}, /* Thai_paiyannoi */
|
| 925 |
+
{0x0dd0, 0x0e30}, /* Thai_saraa */
|
| 926 |
+
{0x0dd1, 0x0e31}, /* Thai_maihanakat */
|
| 927 |
+
{0x0dd2, 0x0e32}, /* Thai_saraaa */
|
| 928 |
+
{0x0dd3, 0x0e33}, /* Thai_saraam */
|
| 929 |
+
{0x0dd4, 0x0e34}, /* Thai_sarai */
|
| 930 |
+
{0x0dd5, 0x0e35}, /* Thai_saraii */
|
| 931 |
+
{0x0dd6, 0x0e36}, /* Thai_saraue */
|
| 932 |
+
{0x0dd7, 0x0e37}, /* Thai_sarauee */
|
| 933 |
+
{0x0dd8, 0x0e38}, /* Thai_sarau */
|
| 934 |
+
{0x0dd9, 0x0e39}, /* Thai_sarauu */
|
| 935 |
+
{0x0dda, 0x0e3a}, /* Thai_phinthu */
|
| 936 |
+
{0x0ddf, 0x0e3f}, /* Thai_baht */
|
| 937 |
+
{0x0de0, 0x0e40}, /* Thai_sarae */
|
| 938 |
+
{0x0de1, 0x0e41}, /* Thai_saraae */
|
| 939 |
+
{0x0de2, 0x0e42}, /* Thai_sarao */
|
| 940 |
+
{0x0de3, 0x0e43}, /* Thai_saraaimaimuan */
|
| 941 |
+
{0x0de4, 0x0e44}, /* Thai_saraaimaimalai */
|
| 942 |
+
{0x0de5, 0x0e45}, /* Thai_lakkhangyao */
|
| 943 |
+
{0x0de6, 0x0e46}, /* Thai_maiyamok */
|
| 944 |
+
{0x0de7, 0x0e47}, /* Thai_maitaikhu */
|
| 945 |
+
{0x0de8, 0x0e48}, /* Thai_maiek */
|
| 946 |
+
{0x0de9, 0x0e49}, /* Thai_maitho */
|
| 947 |
+
{0x0dea, 0x0e4a}, /* Thai_maitri */
|
| 948 |
+
{0x0deb, 0x0e4b}, /* Thai_maichattawa */
|
| 949 |
+
{0x0dec, 0x0e4c}, /* Thai_thanthakhat */
|
| 950 |
+
{0x0ded, 0x0e4d}, /* Thai_nikhahit */
|
| 951 |
+
{0x0df0, 0x0e50}, /* Thai_leksun */
|
| 952 |
+
{0x0df1, 0x0e51}, /* Thai_leknung */
|
| 953 |
+
{0x0df2, 0x0e52}, /* Thai_leksong */
|
| 954 |
+
{0x0df3, 0x0e53}, /* Thai_leksam */
|
| 955 |
+
{0x0df4, 0x0e54}, /* Thai_leksi */
|
| 956 |
+
{0x0df5, 0x0e55}, /* Thai_lekha */
|
| 957 |
+
{0x0df6, 0x0e56}, /* Thai_lekhok */
|
| 958 |
+
{0x0df7, 0x0e57}, /* Thai_lekchet */
|
| 959 |
+
{0x0df8, 0x0e58}, /* Thai_lekpaet */
|
| 960 |
+
{0x0df9, 0x0e59}, /* Thai_lekkao */
|
| 961 |
+
{0x13bc, 0x0152}, /* OE */
|
| 962 |
+
{0x13bd, 0x0153}, /* oe */
|
| 963 |
+
{0x13be, 0x0178}, /* Ydiaeresis */
|
| 964 |
+
{0x20a0, 0x20a0}, /* EcuSign */
|
| 965 |
+
{0x20a1, 0x20a1}, /* ColonSign */
|
| 966 |
+
{0x20a2, 0x20a2}, /* CruzeiroSign */
|
| 967 |
+
{0x20a3, 0x20a3}, /* FFrancSign */
|
| 968 |
+
{0x20a4, 0x20a4}, /* LiraSign */
|
| 969 |
+
{0x20a5, 0x20a5}, /* MillSign */
|
| 970 |
+
{0x20a6, 0x20a6}, /* NairaSign */
|
| 971 |
+
{0x20a7, 0x20a7}, /* PesetaSign */
|
| 972 |
+
{0x20a8, 0x20a8}, /* RupeeSign */
|
| 973 |
+
{0x20a9, 0x20a9}, /* WonSign */
|
| 974 |
+
{0x20aa, 0x20aa}, /* NewSheqelSign */
|
| 975 |
+
{0x20ab, 0x20ab}, /* DongSign */
|
| 976 |
+
{0x20ac, 0x20ac}, /* EuroSign */
|
| 977 |
+
{0x06ad, 0x0491}, /* Ukrainian_ghe_with_upturn */
|
| 978 |
+
{0x06bd, 0x0490}, /* Ukrainian_GHE_WITH_UPTURN */
|
| 979 |
+
{0x14a2, 0x0587}, /* Armenian_ligature_ew */
|
| 980 |
+
{0x14a3, 0x0589}, /* Armenian_verjaket */
|
| 981 |
+
{0x14aa, 0x055d}, /* Armenian_but */
|
| 982 |
+
{0x14ad, 0x058a}, /* Armenian_yentamna */
|
| 983 |
+
{0x14af, 0x055c}, /* Armenian_amanak */
|
| 984 |
+
{0x14b0, 0x055b}, /* Armenian_shesht */
|
| 985 |
+
{0x14b1, 0x055e}, /* Armenian_paruyk */
|
| 986 |
+
{0x14b2, 0x0531}, /* Armenian_AYB */
|
| 987 |
+
{0x14b3, 0x0561}, /* Armenian_ayb */
|
| 988 |
+
{0x14b4, 0x0532}, /* Armenian_BEN */
|
| 989 |
+
{0x14b5, 0x0562}, /* Armenian_ben */
|
| 990 |
+
{0x14b6, 0x0533}, /* Armenian_GIM */
|
| 991 |
+
{0x14b7, 0x0563}, /* Armenian_gim */
|
| 992 |
+
{0x14b8, 0x0534}, /* Armenian_DA */
|
| 993 |
+
{0x14b9, 0x0564}, /* Armenian_da */
|
| 994 |
+
{0x14ba, 0x0535}, /* Armenian_YECH */
|
| 995 |
+
{0x14bb, 0x0565}, /* Armenian_yech */
|
| 996 |
+
{0x14bc, 0x0536}, /* Armenian_ZA */
|
| 997 |
+
{0x14bd, 0x0566}, /* Armenian_za */
|
| 998 |
+
{0x14be, 0x0537}, /* Armenian_E */
|
| 999 |
+
{0x14bf, 0x0567}, /* Armenian_e */
|
| 1000 |
+
{0x14c0, 0x0538}, /* Armenian_AT */
|
| 1001 |
+
{0x14c1, 0x0568}, /* Armenian_at */
|
| 1002 |
+
{0x14c2, 0x0539}, /* Armenian_TO */
|
| 1003 |
+
{0x14c3, 0x0569}, /* Armenian_to */
|
| 1004 |
+
{0x14c4, 0x053a}, /* Armenian_ZHE */
|
| 1005 |
+
{0x14c5, 0x056a}, /* Armenian_zhe */
|
| 1006 |
+
{0x14c6, 0x053b}, /* Armenian_INI */
|
| 1007 |
+
{0x14c7, 0x056b}, /* Armenian_ini */
|
| 1008 |
+
{0x14c8, 0x053c}, /* Armenian_LYUN */
|
| 1009 |
+
{0x14c9, 0x056c}, /* Armenian_lyun */
|
| 1010 |
+
{0x14ca, 0x053d}, /* Armenian_KHE */
|
| 1011 |
+
{0x14cb, 0x056d}, /* Armenian_khe */
|
| 1012 |
+
{0x14cc, 0x053e}, /* Armenian_TSA */
|
| 1013 |
+
{0x14cd, 0x056e}, /* Armenian_tsa */
|
| 1014 |
+
{0x14ce, 0x053f}, /* Armenian_KEN */
|
| 1015 |
+
{0x14cf, 0x056f}, /* Armenian_ken */
|
| 1016 |
+
{0x14d0, 0x0540}, /* Armenian_HO */
|
| 1017 |
+
{0x14d1, 0x0570}, /* Armenian_ho */
|
| 1018 |
+
{0x14d2, 0x0541}, /* Armenian_DZA */
|
| 1019 |
+
{0x14d3, 0x0571}, /* Armenian_dza */
|
| 1020 |
+
{0x14d4, 0x0542}, /* Armenian_GHAT */
|
| 1021 |
+
{0x14d5, 0x0572}, /* Armenian_ghat */
|
| 1022 |
+
{0x14d6, 0x0543}, /* Armenian_TCHE */
|
| 1023 |
+
{0x14d7, 0x0573}, /* Armenian_tche */
|
| 1024 |
+
{0x14d8, 0x0544}, /* Armenian_MEN */
|
| 1025 |
+
{0x14d9, 0x0574}, /* Armenian_men */
|
| 1026 |
+
{0x14da, 0x0545}, /* Armenian_HI */
|
| 1027 |
+
{0x14db, 0x0575}, /* Armenian_hi */
|
| 1028 |
+
{0x14dc, 0x0546}, /* Armenian_NU */
|
| 1029 |
+
{0x14dd, 0x0576}, /* Armenian_nu */
|
| 1030 |
+
{0x14de, 0x0547}, /* Armenian_SHA */
|
| 1031 |
+
{0x14df, 0x0577}, /* Armenian_sha */
|
| 1032 |
+
{0x14e0, 0x0548}, /* Armenian_VO */
|
| 1033 |
+
{0x14e1, 0x0578}, /* Armenian_vo */
|
| 1034 |
+
{0x14e2, 0x0549}, /* Armenian_CHA */
|
| 1035 |
+
{0x14e3, 0x0579}, /* Armenian_cha */
|
| 1036 |
+
{0x14e4, 0x054a}, /* Armenian_PE */
|
| 1037 |
+
{0x14e5, 0x057a}, /* Armenian_pe */
|
| 1038 |
+
{0x14e6, 0x054b}, /* Armenian_JE */
|
| 1039 |
+
{0x14e7, 0x057b}, /* Armenian_je */
|
| 1040 |
+
{0x14e8, 0x054c}, /* Armenian_RA */
|
| 1041 |
+
{0x14e9, 0x057c}, /* Armenian_ra */
|
| 1042 |
+
{0x14ea, 0x054d}, /* Armenian_SE */
|
| 1043 |
+
{0x14eb, 0x057d}, /* Armenian_se */
|
| 1044 |
+
{0x14ec, 0x054e}, /* Armenian_VEV */
|
| 1045 |
+
{0x14ed, 0x057e}, /* Armenian_vev */
|
| 1046 |
+
{0x14ee, 0x054f}, /* Armenian_TYUN */
|
| 1047 |
+
{0x14ef, 0x057f}, /* Armenian_tyun */
|
| 1048 |
+
{0x14f0, 0x0550}, /* Armenian_RE */
|
| 1049 |
+
{0x14f1, 0x0580}, /* Armenian_re */
|
| 1050 |
+
{0x14f2, 0x0551}, /* Armenian_TSO */
|
| 1051 |
+
{0x14f3, 0x0581}, /* Armenian_tso */
|
| 1052 |
+
{0x14f4, 0x0552}, /* Armenian_VYUN */
|
| 1053 |
+
{0x14f5, 0x0582}, /* Armenian_vyun */
|
| 1054 |
+
{0x14f6, 0x0553}, /* Armenian_PYUR */
|
| 1055 |
+
{0x14f7, 0x0583}, /* Armenian_pyur */
|
| 1056 |
+
{0x14f8, 0x0554}, /* Armenian_KE */
|
| 1057 |
+
{0x14f9, 0x0584}, /* Armenian_ke */
|
| 1058 |
+
{0x14fa, 0x0555}, /* Armenian_O */
|
| 1059 |
+
{0x14fb, 0x0585}, /* Armenian_o */
|
| 1060 |
+
{0x14fc, 0x0556}, /* Armenian_FE */
|
| 1061 |
+
{0x14fd, 0x0586}, /* Armenian_fe */
|
| 1062 |
+
{0x14fe, 0x055a}, /* Armenian_apostrophe */
|
| 1063 |
+
{0x15d0, 0x10d0}, /* Georgian_an */
|
| 1064 |
+
{0x15d1, 0x10d1}, /* Georgian_ban */
|
| 1065 |
+
{0x15d2, 0x10d2}, /* Georgian_gan */
|
| 1066 |
+
{0x15d3, 0x10d3}, /* Georgian_don */
|
| 1067 |
+
{0x15d4, 0x10d4}, /* Georgian_en */
|
| 1068 |
+
{0x15d5, 0x10d5}, /* Georgian_vin */
|
| 1069 |
+
{0x15d6, 0x10d6}, /* Georgian_zen */
|
| 1070 |
+
{0x15d7, 0x10d7}, /* Georgian_tan */
|
| 1071 |
+
{0x15d8, 0x10d8}, /* Georgian_in */
|
| 1072 |
+
{0x15d9, 0x10d9}, /* Georgian_kan */
|
| 1073 |
+
{0x15da, 0x10da}, /* Georgian_las */
|
| 1074 |
+
{0x15db, 0x10db}, /* Georgian_man */
|
| 1075 |
+
{0x15dc, 0x10dc}, /* Georgian_nar */
|
| 1076 |
+
{0x15dd, 0x10dd}, /* Georgian_on */
|
| 1077 |
+
{0x15de, 0x10de}, /* Georgian_par */
|
| 1078 |
+
{0x15df, 0x10df}, /* Georgian_zhar */
|
| 1079 |
+
{0x15e0, 0x10e0}, /* Georgian_rae */
|
| 1080 |
+
{0x15e1, 0x10e1}, /* Georgian_san */
|
| 1081 |
+
{0x15e2, 0x10e2}, /* Georgian_tar */
|
| 1082 |
+
{0x15e3, 0x10e3}, /* Georgian_un */
|
| 1083 |
+
{0x15e4, 0x10e4}, /* Georgian_phar */
|
| 1084 |
+
{0x15e5, 0x10e5}, /* Georgian_khar */
|
| 1085 |
+
{0x15e6, 0x10e6}, /* Georgian_ghan */
|
| 1086 |
+
{0x15e7, 0x10e7}, /* Georgian_qar */
|
| 1087 |
+
{0x15e8, 0x10e8}, /* Georgian_shin */
|
| 1088 |
+
{0x15e9, 0x10e9}, /* Georgian_chin */
|
| 1089 |
+
{0x15ea, 0x10ea}, /* Georgian_can */
|
| 1090 |
+
{0x15eb, 0x10eb}, /* Georgian_jil */
|
| 1091 |
+
{0x15ec, 0x10ec}, /* Georgian_cil */
|
| 1092 |
+
{0x15ed, 0x10ed}, /* Georgian_char */
|
| 1093 |
+
{0x15ee, 0x10ee}, /* Georgian_xan */
|
| 1094 |
+
{0x15ef, 0x10ef}, /* Georgian_jhan */
|
| 1095 |
+
{0x15f0, 0x10f0}, /* Georgian_hae */
|
| 1096 |
+
{0x15f1, 0x10f1}, /* Georgian_he */
|
| 1097 |
+
{0x15f2, 0x10f2}, /* Georgian_hie */
|
| 1098 |
+
{0x15f3, 0x10f3}, /* Georgian_we */
|
| 1099 |
+
{0x15f4, 0x10f4}, /* Georgian_har */
|
| 1100 |
+
{0x15f5, 0x10f5}, /* Georgian_hoe */
|
| 1101 |
+
{0x15f6, 0x10f6}, /* Georgian_fi */
|
| 1102 |
+
{0x12a1, 0x1e02}, /* Babovedot */
|
| 1103 |
+
{0x12a2, 0x1e03}, /* babovedot */
|
| 1104 |
+
{0x12a6, 0x1e0a}, /* Dabovedot */
|
| 1105 |
+
{0x12a8, 0x1e80}, /* Wgrave */
|
| 1106 |
+
{0x12aa, 0x1e82}, /* Wacute */
|
| 1107 |
+
{0x12ab, 0x1e0b}, /* dabovedot */
|
| 1108 |
+
{0x12ac, 0x1ef2}, /* Ygrave */
|
| 1109 |
+
{0x12b0, 0x1e1e}, /* Fabovedot */
|
| 1110 |
+
{0x12b1, 0x1e1f}, /* fabovedot */
|
| 1111 |
+
{0x12b4, 0x1e40}, /* Mabovedot */
|
| 1112 |
+
{0x12b5, 0x1e41}, /* mabovedot */
|
| 1113 |
+
{0x12b7, 0x1e56}, /* Pabovedot */
|
| 1114 |
+
{0x12b8, 0x1e81}, /* wgrave */
|
| 1115 |
+
{0x12b9, 0x1e57}, /* pabovedot */
|
| 1116 |
+
{0x12ba, 0x1e83}, /* wacute */
|
| 1117 |
+
{0x12bb, 0x1e60}, /* Sabovedot */
|
| 1118 |
+
{0x12bc, 0x1ef3}, /* ygrave */
|
| 1119 |
+
{0x12bd, 0x1e84}, /* Wdiaeresis */
|
| 1120 |
+
{0x12be, 0x1e85}, /* wdiaeresis */
|
| 1121 |
+
{0x12bf, 0x1e61}, /* sabovedot */
|
| 1122 |
+
{0x12d0, 0x0174}, /* Wcircumflex */
|
| 1123 |
+
{0x12d7, 0x1e6a}, /* Tabovedot */
|
| 1124 |
+
{0x12de, 0x0176}, /* Ycircumflex */
|
| 1125 |
+
{0x12f0, 0x0175}, /* wcircumflex */
|
| 1126 |
+
{0x12f7, 0x1e6b}, /* tabovedot */
|
| 1127 |
+
{0x12fe, 0x0177}, /* ycircumflex */
|
| 1128 |
+
{0x0590, 0x06f0}, /* Farsi_0 */
|
| 1129 |
+
{0x0591, 0x06f1}, /* Farsi_1 */
|
| 1130 |
+
{0x0592, 0x06f2}, /* Farsi_2 */
|
| 1131 |
+
{0x0593, 0x06f3}, /* Farsi_3 */
|
| 1132 |
+
{0x0594, 0x06f4}, /* Farsi_4 */
|
| 1133 |
+
{0x0595, 0x06f5}, /* Farsi_5 */
|
| 1134 |
+
{0x0596, 0x06f6}, /* Farsi_6 */
|
| 1135 |
+
{0x0597, 0x06f7}, /* Farsi_7 */
|
| 1136 |
+
{0x0598, 0x06f8}, /* Farsi_8 */
|
| 1137 |
+
{0x0599, 0x06f9}, /* Farsi_9 */
|
| 1138 |
+
{0x05a5, 0x066a}, /* Arabic_percent */
|
| 1139 |
+
{0x05a6, 0x0670}, /* Arabic_superscript_alef */
|
| 1140 |
+
{0x05a7, 0x0679}, /* Arabic_tteh */
|
| 1141 |
+
{0x05a8, 0x067e}, /* Arabic_peh */
|
| 1142 |
+
{0x05a9, 0x0686}, /* Arabic_tcheh */
|
| 1143 |
+
{0x05aa, 0x0688}, /* Arabic_ddal */
|
| 1144 |
+
{0x05ab, 0x0691}, /* Arabic_rreh */
|
| 1145 |
+
{0x05ae, 0x06d4}, /* Arabic_fullstop */
|
| 1146 |
+
{0x05b0, 0x0660}, /* Arabic_0 */
|
| 1147 |
+
{0x05b1, 0x0661}, /* Arabic_1 */
|
| 1148 |
+
{0x05b2, 0x0662}, /* Arabic_2 */
|
| 1149 |
+
{0x05b3, 0x0663}, /* Arabic_3 */
|
| 1150 |
+
{0x05b4, 0x0664}, /* Arabic_4 */
|
| 1151 |
+
{0x05b5, 0x0665}, /* Arabic_5 */
|
| 1152 |
+
{0x05b6, 0x0666}, /* Arabic_6 */
|
| 1153 |
+
{0x05b7, 0x0667}, /* Arabic_7 */
|
| 1154 |
+
{0x05b8, 0x0668}, /* Arabic_8 */
|
| 1155 |
+
{0x05b9, 0x0669}, /* Arabic_9 */
|
| 1156 |
+
{0x05f3, 0x0653}, /* Arabic_madda_above */
|
| 1157 |
+
{0x05f4, 0x0654}, /* Arabic_hamza_above */
|
| 1158 |
+
{0x05f5, 0x0655}, /* Arabic_hamza_below */
|
| 1159 |
+
{0x05f6, 0x0698}, /* Arabic_jeh */
|
| 1160 |
+
{0x05f7, 0x06a4}, /* Arabic_veh */
|
| 1161 |
+
{0x05f8, 0x06a9}, /* Arabic_keheh */
|
| 1162 |
+
{0x05f9, 0x06af}, /* Arabic_gaf */
|
| 1163 |
+
{0x05fa, 0x06ba}, /* Arabic_noon_ghunna */
|
| 1164 |
+
{0x05fb, 0x06be}, /* Arabic_heh_doachashmee */
|
| 1165 |
+
{0x05fc, 0x06cc}, /* Farsi_yeh */
|
| 1166 |
+
{0x05fd, 0x06d2}, /* Arabic_yeh_baree */
|
| 1167 |
+
{0x05fe, 0x06c1}, /* Arabic_heh_goal */
|
| 1168 |
+
{0x0680, 0x0492}, /* Cyrillic_GHE_bar */
|
| 1169 |
+
{0x0681, 0x0496}, /* Cyrillic_ZHE_descender */
|
| 1170 |
+
{0x0682, 0x049a}, /* Cyrillic_KA_descender */
|
| 1171 |
+
{0x0683, 0x049c}, /* Cyrillic_KA_vertstroke */
|
| 1172 |
+
{0x0684, 0x04a2}, /* Cyrillic_EN_descender */
|
| 1173 |
+
{0x0685, 0x04ae}, /* Cyrillic_U_straight */
|
| 1174 |
+
{0x0686, 0x04b0}, /* Cyrillic_U_straight_bar */
|
| 1175 |
+
{0x0687, 0x04b2}, /* Cyrillic_HA_descender */
|
| 1176 |
+
{0x0688, 0x04b6}, /* Cyrillic_CHE_descender */
|
| 1177 |
+
{0x0689, 0x04b8}, /* Cyrillic_CHE_vertstroke */
|
| 1178 |
+
{0x068a, 0x04ba}, /* Cyrillic_SHHA */
|
| 1179 |
+
{0x068c, 0x04d8}, /* Cyrillic_SCHWA */
|
| 1180 |
+
{0x068d, 0x04e2}, /* Cyrillic_I_macron */
|
| 1181 |
+
{0x068e, 0x04e8}, /* Cyrillic_O_bar */
|
| 1182 |
+
{0x068f, 0x04ee}, /* Cyrillic_U_macron */
|
| 1183 |
+
{0x0690, 0x0493}, /* Cyrillic_ghe_bar */
|
| 1184 |
+
{0x0691, 0x0497}, /* Cyrillic_zhe_descender */
|
| 1185 |
+
{0x0692, 0x049b}, /* Cyrillic_ka_descender */
|
| 1186 |
+
{0x0693, 0x049d}, /* Cyrillic_ka_vertstroke */
|
| 1187 |
+
{0x0694, 0x04a3}, /* Cyrillic_en_descender */
|
| 1188 |
+
{0x0695, 0x04af}, /* Cyrillic_u_straight */
|
| 1189 |
+
{0x0696, 0x04b1}, /* Cyrillic_u_straight_bar */
|
| 1190 |
+
{0x0697, 0x04b3}, /* Cyrillic_ha_descender */
|
| 1191 |
+
{0x0698, 0x04b7}, /* Cyrillic_che_descender */
|
| 1192 |
+
{0x0699, 0x04b9}, /* Cyrillic_che_vertstroke */
|
| 1193 |
+
{0x069a, 0x04bb}, /* Cyrillic_shha */
|
| 1194 |
+
{0x069c, 0x04d9}, /* Cyrillic_schwa */
|
| 1195 |
+
{0x069d, 0x04e3}, /* Cyrillic_i_macron */
|
| 1196 |
+
{0x069e, 0x04e9}, /* Cyrillic_o_bar */
|
| 1197 |
+
{0x069f, 0x04ef}, /* Cyrillic_u_macron */
|
| 1198 |
+
{0x16a3, 0x1e8a}, /* Xabovedot */
|
| 1199 |
+
{0x16a6, 0x012c}, /* Ibreve */
|
| 1200 |
+
{0x16a9, 0x01b5}, /* Zstroke */
|
| 1201 |
+
{0x16aa, 0x01e6}, /* Gcaron */
|
| 1202 |
+
{0x16af, 0x019f}, /* Obarred */
|
| 1203 |
+
{0x16b3, 0x1e8b}, /* xabovedot */
|
| 1204 |
+
{0x16b6, 0x012d}, /* ibreve */
|
| 1205 |
+
{0x16b9, 0x01b6}, /* zstroke */
|
| 1206 |
+
{0x16ba, 0x01e7}, /* gcaron */
|
| 1207 |
+
{0x16bd, 0x01d2}, /* ocaron */
|
| 1208 |
+
{0x16bf, 0x0275}, /* obarred */
|
| 1209 |
+
{0x16c6, 0x018f}, /* SCHWA */
|
| 1210 |
+
{0x16f6, 0x0259}, /* schwa */
|
| 1211 |
+
{0x16d1, 0x1e36}, /* Lbelowdot */
|
| 1212 |
+
{0x16e1, 0x1e37}, /* lbelowdot */
|
| 1213 |
+
{0x1ea0, 0x1ea0}, /* Abelowdot */
|
| 1214 |
+
{0x1ea1, 0x1ea1}, /* abelowdot */
|
| 1215 |
+
{0x1ea2, 0x1ea2}, /* Ahook */
|
| 1216 |
+
{0x1ea3, 0x1ea3}, /* ahook */
|
| 1217 |
+
{0x1ea4, 0x1ea4}, /* Acircumflexacute */
|
| 1218 |
+
{0x1ea5, 0x1ea5}, /* acircumflexacute */
|
| 1219 |
+
{0x1ea6, 0x1ea6}, /* Acircumflexgrave */
|
| 1220 |
+
{0x1ea7, 0x1ea7}, /* acircumflexgrave */
|
| 1221 |
+
{0x1ea8, 0x1ea8}, /* Acircumflexhook */
|
| 1222 |
+
{0x1ea9, 0x1ea9}, /* acircumflexhook */
|
| 1223 |
+
{0x1eaa, 0x1eaa}, /* Acircumflextilde */
|
| 1224 |
+
{0x1eab, 0x1eab}, /* acircumflextilde */
|
| 1225 |
+
{0x1eac, 0x1eac}, /* Acircumflexbelowdot */
|
| 1226 |
+
{0x1ead, 0x1ead}, /* acircumflexbelowdot */
|
| 1227 |
+
{0x1eae, 0x1eae}, /* Abreveacute */
|
| 1228 |
+
{0x1eaf, 0x1eaf}, /* abreveacute */
|
| 1229 |
+
{0x1eb0, 0x1eb0}, /* Abrevegrave */
|
| 1230 |
+
{0x1eb1, 0x1eb1}, /* abrevegrave */
|
| 1231 |
+
{0x1eb2, 0x1eb2}, /* Abrevehook */
|
| 1232 |
+
{0x1eb3, 0x1eb3}, /* abrevehook */
|
| 1233 |
+
{0x1eb4, 0x1eb4}, /* Abrevetilde */
|
| 1234 |
+
{0x1eb5, 0x1eb5}, /* abrevetilde */
|
| 1235 |
+
{0x1eb6, 0x1eb6}, /* Abrevebelowdot */
|
| 1236 |
+
{0x1eb7, 0x1eb7}, /* abrevebelowdot */
|
| 1237 |
+
{0x1eb8, 0x1eb8}, /* Ebelowdot */
|
| 1238 |
+
{0x1eb9, 0x1eb9}, /* ebelowdot */
|
| 1239 |
+
{0x1eba, 0x1eba}, /* Ehook */
|
| 1240 |
+
{0x1ebb, 0x1ebb}, /* ehook */
|
| 1241 |
+
{0x1ebc, 0x1ebc}, /* Etilde */
|
| 1242 |
+
{0x1ebd, 0x1ebd}, /* etilde */
|
| 1243 |
+
{0x1ebe, 0x1ebe}, /* Ecircumflexacute */
|
| 1244 |
+
{0x1ebf, 0x1ebf}, /* ecircumflexacute */
|
| 1245 |
+
{0x1ec0, 0x1ec0}, /* Ecircumflexgrave */
|
| 1246 |
+
{0x1ec1, 0x1ec1}, /* ecircumflexgrave */
|
| 1247 |
+
{0x1ec2, 0x1ec2}, /* Ecircumflexhook */
|
| 1248 |
+
{0x1ec3, 0x1ec3}, /* ecircumflexhook */
|
| 1249 |
+
{0x1ec4, 0x1ec4}, /* Ecircumflextilde */
|
| 1250 |
+
{0x1ec5, 0x1ec5}, /* ecircumflextilde */
|
| 1251 |
+
{0x1ec6, 0x1ec6}, /* Ecircumflexbelowdot */
|
| 1252 |
+
{0x1ec7, 0x1ec7}, /* ecircumflexbelowdot */
|
| 1253 |
+
{0x1ec8, 0x1ec8}, /* Ihook */
|
| 1254 |
+
{0x1ec9, 0x1ec9}, /* ihook */
|
| 1255 |
+
{0x1eca, 0x1eca}, /* Ibelowdot */
|
| 1256 |
+
{0x1ecb, 0x1ecb}, /* ibelowdot */
|
| 1257 |
+
{0x1ecc, 0x1ecc}, /* Obelowdot */
|
| 1258 |
+
{0x1ecd, 0x1ecd}, /* obelowdot */
|
| 1259 |
+
{0x1ece, 0x1ece}, /* Ohook */
|
| 1260 |
+
{0x1ecf, 0x1ecf}, /* ohook */
|
| 1261 |
+
{0x1ed0, 0x1ed0}, /* Ocircumflexacute */
|
| 1262 |
+
{0x1ed1, 0x1ed1}, /* ocircumflexacute */
|
| 1263 |
+
{0x1ed2, 0x1ed2}, /* Ocircumflexgrave */
|
| 1264 |
+
{0x1ed3, 0x1ed3}, /* ocircumflexgrave */
|
| 1265 |
+
{0x1ed4, 0x1ed4}, /* Ocircumflexhook */
|
| 1266 |
+
{0x1ed5, 0x1ed5}, /* ocircumflexhook */
|
| 1267 |
+
{0x1ed6, 0x1ed6}, /* Ocircumflextilde */
|
| 1268 |
+
{0x1ed7, 0x1ed7}, /* ocircumflextilde */
|
| 1269 |
+
{0x1ed8, 0x1ed8}, /* Ocircumflexbelowdot */
|
| 1270 |
+
{0x1ed9, 0x1ed9}, /* ocircumflexbelowdot */
|
| 1271 |
+
{0x1eda, 0x1eda}, /* Ohornacute */
|
| 1272 |
+
{0x1edb, 0x1edb}, /* ohornacute */
|
| 1273 |
+
{0x1edc, 0x1edc}, /* Ohorngrave */
|
| 1274 |
+
{0x1edd, 0x1edd}, /* ohorngrave */
|
| 1275 |
+
{0x1ede, 0x1ede}, /* Ohornhook */
|
| 1276 |
+
{0x1edf, 0x1edf}, /* ohornhook */
|
| 1277 |
+
{0x1ee0, 0x1ee0}, /* Ohorntilde */
|
| 1278 |
+
{0x1ee1, 0x1ee1}, /* ohorntilde */
|
| 1279 |
+
{0x1ee2, 0x1ee2}, /* Ohornbelowdot */
|
| 1280 |
+
{0x1ee3, 0x1ee3}, /* ohornbelowdot */
|
| 1281 |
+
{0x1ee4, 0x1ee4}, /* Ubelowdot */
|
| 1282 |
+
{0x1ee5, 0x1ee5}, /* ubelowdot */
|
| 1283 |
+
{0x1ee6, 0x1ee6}, /* Uhook */
|
| 1284 |
+
{0x1ee7, 0x1ee7}, /* uhook */
|
| 1285 |
+
{0x1ee8, 0x1ee8}, /* Uhornacute */
|
| 1286 |
+
{0x1ee9, 0x1ee9}, /* uhornacute */
|
| 1287 |
+
{0x1eea, 0x1eea}, /* Uhorngrave */
|
| 1288 |
+
{0x1eeb, 0x1eeb}, /* uhorngrave */
|
| 1289 |
+
{0x1eec, 0x1eec}, /* Uhornhook */
|
| 1290 |
+
{0x1eed, 0x1eed}, /* uhornhook */
|
| 1291 |
+
{0x1eee, 0x1eee}, /* Uhorntilde */
|
| 1292 |
+
{0x1eef, 0x1eef}, /* uhorntilde */
|
| 1293 |
+
{0x1ef0, 0x1ef0}, /* Uhornbelowdot */
|
| 1294 |
+
{0x1ef1, 0x1ef1}, /* uhornbelowdot */
|
| 1295 |
+
{0x1ef4, 0x1ef4}, /* Ybelowdot */
|
| 1296 |
+
{0x1ef5, 0x1ef5}, /* ybelowdot */
|
| 1297 |
+
{0x1ef6, 0x1ef6}, /* Yhook */
|
| 1298 |
+
{0x1ef7, 0x1ef7}, /* yhook */
|
| 1299 |
+
{0x1ef8, 0x1ef8}, /* Ytilde */
|
| 1300 |
+
{0x1ef9, 0x1ef9}, /* ytilde */
|
| 1301 |
+
{0x1efa, 0x01a0}, /* Ohorn */
|
| 1302 |
+
{0x1efb, 0x01a1}, /* ohorn */
|
| 1303 |
+
{0x1efc, 0x01af}, /* Uhorn */
|
| 1304 |
+
{0x1efd, 0x01b0}, /*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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXPrivate.h --
|
| 3 |
+
*
|
| 4 |
+
* Macros and declarations that are purely internal & private to TkAqua.
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 7 |
+
* Copyright (c) 2008-2009 Apple Inc.
|
| 8 |
+
* Copyright (c) 2020 Marc Culler
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 11 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*
|
| 13 |
+
* RCS: @(#) $Id$
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef _TKMACPRIV
|
| 17 |
+
#define _TKMACPRIV
|
| 18 |
+
|
| 19 |
+
#if !__OBJC__
|
| 20 |
+
#error Objective-C compiler required
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
#ifndef __clang__
|
| 24 |
+
#define instancetype id
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#define TextStyle MacTextStyle
|
| 28 |
+
#import <ApplicationServices/ApplicationServices.h>
|
| 29 |
+
#import <Cocoa/Cocoa.h>
|
| 30 |
+
#import <QuartzCore/QuartzCore.h>
|
| 31 |
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
| 32 |
+
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
|
| 33 |
+
#endif
|
| 34 |
+
#ifndef NO_CARBON_H
|
| 35 |
+
#import <Carbon/Carbon.h>
|
| 36 |
+
#endif
|
| 37 |
+
#undef TextStyle
|
| 38 |
+
#import <objc/runtime.h> /* for sel_isEqual() */
|
| 39 |
+
|
| 40 |
+
#ifndef _TKMACINT
|
| 41 |
+
#include "tkMacOSXInt.h"
|
| 42 |
+
#endif
|
| 43 |
+
#ifndef _TKMACDEFAULT
|
| 44 |
+
#include "tkMacOSXDefault.h"
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
/* Macros for Mac OS X API availability checking */
|
| 48 |
+
#define TK_IF_MAC_OS_X_API(vers, symbol, ...) \
|
| 49 |
+
tk_if_mac_os_x_10_##vers(symbol != NULL, 1, __VA_ARGS__)
|
| 50 |
+
#define TK_ELSE_MAC_OS_X(vers, ...) \
|
| 51 |
+
tk_else_mac_os_x_10_##vers(__VA_ARGS__)
|
| 52 |
+
#define TK_IF_MAC_OS_X_API_COND(vers, symbol, cond, ...) \
|
| 53 |
+
tk_if_mac_os_x_10_##vers(symbol != NULL, cond, __VA_ARGS__)
|
| 54 |
+
#define TK_ELSE(...) \
|
| 55 |
+
} else { __VA_ARGS__
|
| 56 |
+
#define TK_ENDIF \
|
| 57 |
+
}
|
| 58 |
+
/* Private macros that implement the checking macros above */
|
| 59 |
+
#define tk_if_mac_os_x_yes(chk, cond, ...) \
|
| 60 |
+
if (cond) { __VA_ARGS__
|
| 61 |
+
#define tk_else_mac_os_x_yes(...) \
|
| 62 |
+
} else {
|
| 63 |
+
#define tk_if_mac_os_x_chk(chk, cond, ...) \
|
| 64 |
+
if ((chk) && (cond)) { __VA_ARGS__
|
| 65 |
+
#define tk_else_mac_os_x_chk(...) \
|
| 66 |
+
} else { __VA_ARGS__
|
| 67 |
+
#define tk_if_mac_os_x_no(chk, cond, ...) \
|
| 68 |
+
if (0) {
|
| 69 |
+
#define tk_else_mac_os_x_no(...) \
|
| 70 |
+
} else { __VA_ARGS__
|
| 71 |
+
|
| 72 |
+
/*
|
| 73 |
+
* Macros for DEBUG_ASSERT_MESSAGE et al from Debugging.h.
|
| 74 |
+
*/
|
| 75 |
+
|
| 76 |
+
#undef kComponentSignatureString
|
| 77 |
+
#undef COMPONENT_SIGNATURE
|
| 78 |
+
#define kComponentSignatureString "TkMacOSX"
|
| 79 |
+
#define COMPONENT_SIGNATURE 'Tk '
|
| 80 |
+
|
| 81 |
+
/*
|
| 82 |
+
* Macros abstracting checks only active in a debug build.
|
| 83 |
+
*/
|
| 84 |
+
|
| 85 |
+
#ifdef TK_MAC_DEBUG
|
| 86 |
+
#define TKLog(f, ...) NSLog(f, ##__VA_ARGS__)
|
| 87 |
+
|
| 88 |
+
/*
|
| 89 |
+
* Macro to do debug message output.
|
| 90 |
+
*/
|
| 91 |
+
#define TkMacOSXDbgMsg(m, ...) \
|
| 92 |
+
do { \
|
| 93 |
+
TKLog(@"%s:%d: %s(): " m, strrchr(__FILE__, '/')+1, \
|
| 94 |
+
__LINE__, __func__, ##__VA_ARGS__); \
|
| 95 |
+
} while (0)
|
| 96 |
+
|
| 97 |
+
/*
|
| 98 |
+
* Macro to do debug API failure message output.
|
| 99 |
+
*/
|
| 100 |
+
#define TkMacOSXDbgOSErr(f, err) \
|
| 101 |
+
do { \
|
| 102 |
+
TkMacOSXDbgMsg("%s failed: %d", #f, (int)(err)); \
|
| 103 |
+
} while (0)
|
| 104 |
+
|
| 105 |
+
/*
|
| 106 |
+
* Macro to do very common check for noErr return from given API and output
|
| 107 |
+
* debug message in case of failure.
|
| 108 |
+
*/
|
| 109 |
+
#define ChkErr(f, ...) ({ \
|
| 110 |
+
OSStatus err_ = f(__VA_ARGS__); \
|
| 111 |
+
if (err_ != noErr) { \
|
| 112 |
+
TkMacOSXDbgOSErr(f, err_); \
|
| 113 |
+
} \
|
| 114 |
+
err_;})
|
| 115 |
+
|
| 116 |
+
#else /* TK_MAC_DEBUG */
|
| 117 |
+
#define TKLog(f, ...)
|
| 118 |
+
#define TkMacOSXDbgMsg(m, ...)
|
| 119 |
+
#define TkMacOSXDbgOSErr(f, err)
|
| 120 |
+
#define ChkErr(f, ...) ({f(__VA_ARGS__);})
|
| 121 |
+
#endif /* TK_MAC_DEBUG */
|
| 122 |
+
|
| 123 |
+
/*
|
| 124 |
+
* Macro abstracting use of TkMacOSXGetNamedSymbol to init named symbols.
|
| 125 |
+
*/
|
| 126 |
+
|
| 127 |
+
#define UNINITIALISED_SYMBOL ((void*)(-1L))
|
| 128 |
+
#define TkMacOSXInitNamedSymbol(module, ret, symbol, ...) \
|
| 129 |
+
static ret (* symbol)(__VA_ARGS__) = UNINITIALISED_SYMBOL; \
|
| 130 |
+
if (symbol == UNINITIALISED_SYMBOL) { \
|
| 131 |
+
symbol = TkMacOSXGetNamedSymbol(STRINGIFY(module), \
|
| 132 |
+
STRINGIFY(symbol)); \
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/*
|
| 136 |
+
* The structure of a 32-bit XEvent keycode on macOS. It may be viewed as
|
| 137 |
+
* an unsigned int or as having either two or three bitfields.
|
| 138 |
+
*/
|
| 139 |
+
|
| 140 |
+
typedef struct keycode_v_t {
|
| 141 |
+
unsigned keychar: 22; /* UCS-32 character */
|
| 142 |
+
unsigned o_s: 2; /* State of Option and Shift keys. */
|
| 143 |
+
unsigned virt: 8; /* 8-bit virtual keycode - identifies a key. */
|
| 144 |
+
} keycode_v;
|
| 145 |
+
|
| 146 |
+
typedef struct keycode_x_t {
|
| 147 |
+
unsigned keychar: 22; /* UCS-32 character */
|
| 148 |
+
unsigned xvirtual: 10; /* Combines o_s and virtual. This 10-bit integer
|
| 149 |
+
* is used as a key for looking up the character
|
| 150 |
+
* produced when pressing a key with a particular
|
| 151 |
+
* Shift and Option modifier state. */
|
| 152 |
+
} keycode_x;
|
| 153 |
+
|
| 154 |
+
typedef union MacKeycode_t {
|
| 155 |
+
unsigned int uint;
|
| 156 |
+
keycode_v v;
|
| 157 |
+
keycode_x x;
|
| 158 |
+
} MacKeycode;
|
| 159 |
+
|
| 160 |
+
/*
|
| 161 |
+
* Macros used in tkMacOSXKeyboard.c and tkMacOSXKeyEvent.c.
|
| 162 |
+
* Note that 0x7f is del and 0xF8FF is the Apple Logo character.
|
| 163 |
+
*/
|
| 164 |
+
|
| 165 |
+
#define ON_KEYPAD(virt) ((virt >= 0x41) && (virt <= 0x5C))
|
| 166 |
+
#define IS_PRINTABLE(keychar) ((keychar >= 0x20) && (keychar != 0x7f) && \
|
| 167 |
+
((keychar < 0xF700) || keychar >= 0xF8FF))
|
| 168 |
+
|
| 169 |
+
/*
|
| 170 |
+
* An "index" is 2-bit bitfield showing the state of the Option and Shift
|
| 171 |
+
* keys. It is used as an index when building the keymaps and it
|
| 172 |
+
* is the value of the o_s bitfield of a keycode_v.
|
| 173 |
+
*/
|
| 174 |
+
|
| 175 |
+
#define INDEX_SHIFT 1
|
| 176 |
+
#define INDEX_OPTION 2
|
| 177 |
+
#define INDEX2STATE(index) ((index & INDEX_SHIFT ? ShiftMask : 0) | \
|
| 178 |
+
(index & INDEX_OPTION ? Mod2Mask : 0))
|
| 179 |
+
#define INDEX2CARBON(index) ((index & INDEX_SHIFT ? shiftKey : 0) | \
|
| 180 |
+
(index & INDEX_OPTION ? optionKey : 0))
|
| 181 |
+
#define STATE2INDEX(state) ((state & ShiftMask ? INDEX_SHIFT : 0) | \
|
| 182 |
+
(state & Mod2Mask ? INDEX_OPTION : 0))
|
| 183 |
+
|
| 184 |
+
/*
|
| 185 |
+
* Special values for the virtual bitfield. Actual virtual keycodes are < 128.
|
| 186 |
+
*/
|
| 187 |
+
|
| 188 |
+
#define NO_VIRTUAL 0xFF /* Not generated by a key or the NSText"InputClient. */
|
| 189 |
+
#define REPLACEMENT_VIRTUAL 0x80 /* A BMP char sent by the NSTextInputClient. */
|
| 190 |
+
#define NON_BMP_VIRTUAL 0x81 /* A non-BMP char sent by the NSTextInputClient. */
|
| 191 |
+
|
| 192 |
+
/*
|
| 193 |
+
* A special character is used in the keycode for simulated modifier KeyPress
|
| 194 |
+
* or KeyRelease XEvents. It is near the end of the private-use range but
|
| 195 |
+
* different from the UniChar 0xF8FF which Apple uses for their logo character.
|
| 196 |
+
* A different special character is used for keys, like the Menu key, which do
|
| 197 |
+
* not appear on Macintosh keyboards.
|
| 198 |
+
*/
|
| 199 |
+
|
| 200 |
+
#define MOD_KEYCHAR 0xF8FE
|
| 201 |
+
#define UNKNOWN_KEYCHAR 0xF8FD
|
| 202 |
+
|
| 203 |
+
/*
|
| 204 |
+
* Structure encapsulating current drawing environment.
|
| 205 |
+
*/
|
| 206 |
+
|
| 207 |
+
typedef struct TkMacOSXDrawingContext {
|
| 208 |
+
CGContextRef context;
|
| 209 |
+
NSView *view;
|
| 210 |
+
HIShapeRef clipRgn;
|
| 211 |
+
} TkMacOSXDrawingContext;
|
| 212 |
+
|
| 213 |
+
/*
|
| 214 |
+
* Prototypes for TkMacOSXRegion.c.
|
| 215 |
+
*/
|
| 216 |
+
|
| 217 |
+
MODULE_SCOPE HIShapeRef TkMacOSXGetNativeRegion(TkRegion r);
|
| 218 |
+
MODULE_SCOPE void TkMacOSXSetWithNativeRegion(TkRegion r,
|
| 219 |
+
HIShapeRef rgn);
|
| 220 |
+
MODULE_SCOPE OSStatus TkMacOSHIShapeDifferenceWithRect(
|
| 221 |
+
HIMutableShapeRef inShape, const CGRect *inRect);
|
| 222 |
+
MODULE_SCOPE int TkMacOSXCountRectsInRegion(HIShapeRef shape);
|
| 223 |
+
MODULE_SCOPE void TkMacOSXPrintRectsInRegion(HIShapeRef shape);
|
| 224 |
+
/*
|
| 225 |
+
* Prototypes of TkAqua internal procs.
|
| 226 |
+
*/
|
| 227 |
+
|
| 228 |
+
MODULE_SCOPE void * TkMacOSXGetNamedSymbol(const char *module,
|
| 229 |
+
const char *symbol);
|
| 230 |
+
MODULE_SCOPE void TkMacOSXDisplayChanged(Display *display);
|
| 231 |
+
MODULE_SCOPE CGFloat TkMacOSXZeroScreenHeight();
|
| 232 |
+
MODULE_SCOPE CGFloat TkMacOSXZeroScreenTop();
|
| 233 |
+
MODULE_SCOPE int TkMacOSXUseAntialiasedText(Tcl_Interp *interp,
|
| 234 |
+
int enable);
|
| 235 |
+
MODULE_SCOPE int TkMacOSXInitCGDrawing(Tcl_Interp *interp, int enable,
|
| 236 |
+
int antiAlias);
|
| 237 |
+
MODULE_SCOPE int TkMacOSXIsWindowZoomed(TkWindow *winPtr);
|
| 238 |
+
MODULE_SCOPE int TkGenerateButtonEventForXPointer(Window window);
|
| 239 |
+
MODULE_SCOPE void TkMacOSXDrawCGImage(Drawable d, GC gc, CGContextRef context,
|
| 240 |
+
CGImageRef image, unsigned long imageForeground,
|
| 241 |
+
unsigned long imageBackground, CGRect imageBounds,
|
| 242 |
+
CGRect srcBounds, CGRect dstBounds);
|
| 243 |
+
MODULE_SCOPE int TkMacOSXSetupDrawingContext(Drawable d, GC gc,
|
| 244 |
+
TkMacOSXDrawingContext *dcPtr);
|
| 245 |
+
MODULE_SCOPE void TkMacOSXRestoreDrawingContext(
|
| 246 |
+
TkMacOSXDrawingContext *dcPtr);
|
| 247 |
+
MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel,
|
| 248 |
+
CGContextRef context);
|
| 249 |
+
#define TkMacOSXGetTkWindow(window) ((TkWindow *)Tk_MacOSXGetTkWindow(window))
|
| 250 |
+
#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow *)TkMacOSXDrawable(drawable))
|
| 251 |
+
#define TkMacOSXGetNSViewForDrawable(macWin) ((NSView *)Tk_MacOSXGetNSViewForDrawable((Drawable)(macWin)))
|
| 252 |
+
MODULE_SCOPE CGContextRef TkMacOSXGetCGContextForDrawable(Drawable drawable);
|
| 253 |
+
MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
|
| 254 |
+
MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
|
| 255 |
+
MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view,
|
| 256 |
+
HIShapeRef rgn);
|
| 257 |
+
MODULE_SCOPE NSImage* TkMacOSXGetNSImageFromTkImage(Display *display,
|
| 258 |
+
Tk_Image image, int width, int height);
|
| 259 |
+
MODULE_SCOPE NSImage* TkMacOSXGetNSImageFromBitmap(Display *display,
|
| 260 |
+
Pixmap bitmap, GC gc, int width, int height);
|
| 261 |
+
MODULE_SCOPE NSColor* TkMacOSXGetNSColor(GC gc, unsigned long pixel);
|
| 262 |
+
MODULE_SCOPE NSFont* TkMacOSXNSFontForFont(Tk_Font tkfont);
|
| 263 |
+
MODULE_SCOPE NSDictionary* TkMacOSXNSFontAttributesForFont(Tk_Font tkfont);
|
| 264 |
+
MODULE_SCOPE NSModalSession TkMacOSXGetModalSession(void);
|
| 265 |
+
MODULE_SCOPE void TkMacOSXSelDeadWindow(TkWindow *winPtr);
|
| 266 |
+
MODULE_SCOPE void TkMacOSXApplyWindowAttributes(TkWindow *winPtr,
|
| 267 |
+
NSWindow *macWindow);
|
| 268 |
+
MODULE_SCOPE Tcl_ObjCmdProc TkMacOSXStandardAboutPanelObjCmd;
|
| 269 |
+
MODULE_SCOPE Tcl_ObjCmdProc TkMacOSXIconBitmapObjCmd;
|
| 270 |
+
MODULE_SCOPE void TkMacOSXDrawSolidBorder(Tk_Window tkwin, GC gc,
|
| 271 |
+
int inset, int thickness);
|
| 272 |
+
MODULE_SCOPE int TkMacOSXServices_Init(Tcl_Interp *interp);
|
| 273 |
+
MODULE_SCOPE Tcl_ObjCmdProc TkMacOSXRegisterServiceWidgetObjCmd;
|
| 274 |
+
MODULE_SCOPE unsigned TkMacOSXAddVirtual(unsigned int keycode);
|
| 275 |
+
MODULE_SCOPE void TkMacOSXWinNSBounds(TkWindow *winPtr, NSView *view,
|
| 276 |
+
NSRect *bounds);
|
| 277 |
+
MODULE_SCOPE Bool TkMacOSXInDarkMode(Tk_Window tkwin);
|
| 278 |
+
MODULE_SCOPE void TkMacOSXDrawAllViews(void *clientData);
|
| 279 |
+
MODULE_SCOPE unsigned long TkMacOSXClearPixel(void);
|
| 280 |
+
MODULE_SCOPE NSString* TkMacOSXOSTypeToUTI(OSType ostype);
|
| 281 |
+
MODULE_SCOPE NSImage* TkMacOSXIconForFileType(NSString *filetype);
|
| 282 |
+
|
| 283 |
+
#pragma mark Private Objective-C Classes
|
| 284 |
+
|
| 285 |
+
#define VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
|
| 286 |
+
|
| 287 |
+
enum { tkMainMenu = 1, tkApplicationMenu, tkWindowsMenu, tkHelpMenu};
|
| 288 |
+
|
| 289 |
+
VISIBILITY_HIDDEN
|
| 290 |
+
@interface TKMenu : NSMenu {
|
| 291 |
+
@private
|
| 292 |
+
void *_tkMenu;
|
| 293 |
+
NSUInteger _tkOffset, _tkItemCount, _tkSpecial;
|
| 294 |
+
}
|
| 295 |
+
- (void)setSpecial:(NSUInteger)special;
|
| 296 |
+
- (BOOL)isSpecial:(NSUInteger)special;
|
| 297 |
+
@end
|
| 298 |
+
|
| 299 |
+
@interface TKMenu(TKMenuDelegate) <NSMenuDelegate>
|
| 300 |
+
@end
|
| 301 |
+
|
| 302 |
+
VISIBILITY_HIDDEN
|
| 303 |
+
@interface TKApplication : NSApplication {
|
| 304 |
+
@private
|
| 305 |
+
Tcl_Interp *_eventInterp;
|
| 306 |
+
NSMenu *_servicesMenu;
|
| 307 |
+
TKMenu *_defaultMainMenu, *_defaultApplicationMenu;
|
| 308 |
+
NSMenuItem *_demoMenuItem;
|
| 309 |
+
NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems;
|
| 310 |
+
NSArray *_defaultHelpMenuItems, *_defaultFileMenuItems;
|
| 311 |
+
NSAutoreleasePool *_mainPool;
|
| 312 |
+
NSThread *_backgoundLoop;
|
| 313 |
+
|
| 314 |
+
#ifdef __i386__
|
| 315 |
+
/* The Objective C runtime used on i386 requires this. */
|
| 316 |
+
int _poolLock;
|
| 317 |
+
int _macOSVersion; /* 10000 * major + 100*minor */
|
| 318 |
+
Bool _isDrawing;
|
| 319 |
+
Bool _needsToDraw;
|
| 320 |
+
Bool _tkLiveResizeEnded;
|
| 321 |
+
TkWindow *_tkPointerWindow;
|
| 322 |
+
TkWindow *_tkEventTarget;
|
| 323 |
+
TkWindow *_tkDragTarget;
|
| 324 |
+
unsigned int _tkButtonState;
|
| 325 |
+
#endif
|
| 326 |
+
|
| 327 |
+
}
|
| 328 |
+
@property int poolLock;
|
| 329 |
+
@property int macOSVersion;
|
| 330 |
+
@property Bool isDrawing;
|
| 331 |
+
@property Bool needsToDraw;
|
| 332 |
+
@property Bool tkLiveResizeEnded;
|
| 333 |
+
|
| 334 |
+
/*
|
| 335 |
+
* Persistent state variables used by processMouseEvent.
|
| 336 |
+
*/
|
| 337 |
+
|
| 338 |
+
@property(nonatomic) TkWindow *tkPointerWindow;
|
| 339 |
+
@property(nonatomic) TkWindow *tkEventTarget;
|
| 340 |
+
@property(nonatomic) TkWindow *tkDragTarget;
|
| 341 |
+
@property unsigned int tkButtonState;
|
| 342 |
+
|
| 343 |
+
@end
|
| 344 |
+
@interface TKApplication(TKInit)
|
| 345 |
+
- (NSString *)tkFrameworkImagePath:(NSString*)image;
|
| 346 |
+
- (void)_resetAutoreleasePool;
|
| 347 |
+
- (void)_lockAutoreleasePool;
|
| 348 |
+
- (void)_unlockAutoreleasePool;
|
| 349 |
+
@end
|
| 350 |
+
@interface TKApplication(TKKeyboard)
|
| 351 |
+
- (void) keyboardChanged: (NSNotification *) notification;
|
| 352 |
+
@end
|
| 353 |
+
@interface TKApplication(TKWindowEvent) <NSApplicationDelegate>
|
| 354 |
+
- (void) _setupWindowNotifications;
|
| 355 |
+
@end
|
| 356 |
+
@interface TKApplication(TKDialog) <NSOpenSavePanelDelegate>
|
| 357 |
+
@end
|
| 358 |
+
@interface TKApplication(TKMenu)
|
| 359 |
+
- (void)tkSetMainMenu:(TKMenu *)menu;
|
| 360 |
+
@end
|
| 361 |
+
@interface TKApplication(TKMenus)
|
| 362 |
+
- (void) _setupMenus;
|
| 363 |
+
@end
|
| 364 |
+
@interface NSApplication(TKNotify)
|
| 365 |
+
/* We need to declare this hidden method. */
|
| 366 |
+
- (void) _modalSession: (NSModalSession) session sendEvent: (NSEvent *) event;
|
| 367 |
+
- (void) _runBackgroundLoop;
|
| 368 |
+
@end
|
| 369 |
+
@interface TKApplication(TKEvent)
|
| 370 |
+
- (NSEvent *)tkProcessEvent:(NSEvent *)theEvent;
|
| 371 |
+
@end
|
| 372 |
+
@interface TKApplication(TKMouseEvent)
|
| 373 |
+
- (NSEvent *)tkProcessMouseEvent:(NSEvent *)theEvent;
|
| 374 |
+
@end
|
| 375 |
+
@interface TKApplication(TKKeyEvent)
|
| 376 |
+
- (NSEvent *)tkProcessKeyEvent:(NSEvent *)theEvent;
|
| 377 |
+
@end
|
| 378 |
+
@interface TKApplication(TKClipboard)
|
| 379 |
+
- (void)tkProvidePasteboard:(TkDisplay *)dispPtr;
|
| 380 |
+
- (void)tkCheckPasteboard;
|
| 381 |
+
@end
|
| 382 |
+
@interface TKApplication(TKHLEvents)
|
| 383 |
+
- (void) terminate: (id) sender;
|
| 384 |
+
- (void) superTerminate: (id) sender;
|
| 385 |
+
- (void) preferences: (id) sender;
|
| 386 |
+
- (void) handleQuitApplicationEvent: (NSAppleEventDescriptor *)event
|
| 387 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 388 |
+
- (void) handleOpenApplicationEvent: (NSAppleEventDescriptor *)event
|
| 389 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 390 |
+
- (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event
|
| 391 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 392 |
+
- (void) handleShowPreferencesEvent: (NSAppleEventDescriptor *)event
|
| 393 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 394 |
+
- (void) handleOpenDocumentsEvent: (NSAppleEventDescriptor *)event
|
| 395 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 396 |
+
- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event
|
| 397 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 398 |
+
- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event
|
| 399 |
+
withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
|
| 400 |
+
- (void)handleURLEvent: (NSAppleEventDescriptor*)event
|
| 401 |
+
withReplyEvent: (NSAppleEventDescriptor*)replyEvent;
|
| 402 |
+
@end
|
| 403 |
+
|
| 404 |
+
VISIBILITY_HIDDEN
|
| 405 |
+
/*
|
| 406 |
+
* Subclass TKContentView from NSTextInputClient to enable composition and
|
| 407 |
+
* input from the Character Palette.
|
| 408 |
+
*/
|
| 409 |
+
|
| 410 |
+
@interface TKContentView : NSView <NSTextInputClient>
|
| 411 |
+
{
|
| 412 |
+
@private
|
| 413 |
+
NSString *privateWorkingText;
|
| 414 |
+
Bool _tkNeedsDisplay;
|
| 415 |
+
NSRect _tkDirtyRect;
|
| 416 |
+
NSTrackingArea *trackingArea;
|
| 417 |
+
}
|
| 418 |
+
@property Bool tkNeedsDisplay;
|
| 419 |
+
@property NSRect tkDirtyRect;
|
| 420 |
+
@end
|
| 421 |
+
|
| 422 |
+
@interface TKContentView(TKKeyEvent)
|
| 423 |
+
- (void) deleteWorkingText;
|
| 424 |
+
- (void) cancelComposingText;
|
| 425 |
+
@end
|
| 426 |
+
|
| 427 |
+
@interface TKContentView(TKWindowEvent)
|
| 428 |
+
- (void) addTkDirtyRect: (NSRect) rect;
|
| 429 |
+
- (void) clearTkDirtyRect;
|
| 430 |
+
- (void) generateExposeEvents: (NSRect) rect;
|
| 431 |
+
- (void) tkToolbarButton: (id) sender;
|
| 432 |
+
@end
|
| 433 |
+
|
| 434 |
+
@interface NSWindow(TKWm)
|
| 435 |
+
- (NSPoint) tkConvertPointToScreen:(NSPoint)point;
|
| 436 |
+
- (NSPoint) tkConvertPointFromScreen:(NSPoint)point;
|
| 437 |
+
@end
|
| 438 |
+
|
| 439 |
+
VISIBILITY_HIDDEN
|
| 440 |
+
@interface TKWindow : NSWindow
|
| 441 |
+
{
|
| 442 |
+
#ifdef __i386__
|
| 443 |
+
/* The Objective C runtime used on i386 requires this. */
|
| 444 |
+
Window _tkWindow;
|
| 445 |
+
#endif
|
| 446 |
+
}
|
| 447 |
+
@property Window tkWindow;
|
| 448 |
+
@end
|
| 449 |
+
|
| 450 |
+
@interface TKWindow(TKWm)
|
| 451 |
+
- (void) tkLayoutChanged;
|
| 452 |
+
@end
|
| 453 |
+
|
| 454 |
+
@interface TKDrawerWindow : NSWindow
|
| 455 |
+
{
|
| 456 |
+
id _i1, _i2;
|
| 457 |
+
#ifdef __i386__
|
| 458 |
+
/* The Objective C runtime used on i386 requires this. */
|
| 459 |
+
Window _tkWindow;
|
| 460 |
+
#endif
|
| 461 |
+
}
|
| 462 |
+
@property Window tkWindow;
|
| 463 |
+
@end
|
| 464 |
+
|
| 465 |
+
@interface TKPanel : NSPanel
|
| 466 |
+
{
|
| 467 |
+
#ifdef __i386__
|
| 468 |
+
/* The Objective C runtime used on i386 requires this. */
|
| 469 |
+
Window _tkWindow;
|
| 470 |
+
#endif
|
| 471 |
+
}
|
| 472 |
+
@property Window tkWindow;
|
| 473 |
+
@end
|
| 474 |
+
|
| 475 |
+
#pragma mark NSMenu & NSMenuItem Utilities
|
| 476 |
+
|
| 477 |
+
@interface NSMenu(TKUtils)
|
| 478 |
+
+ (id)menuWithTitle:(NSString *)title;
|
| 479 |
+
+ (id)menuWithTitle:(NSString *)title menuItems:(NSArray *)items;
|
| 480 |
+
+ (id)menuWithTitle:(NSString *)title submenus:(NSArray *)submenus;
|
| 481 |
+
- (NSMenuItem *)itemWithSubmenu:(NSMenu *)submenu;
|
| 482 |
+
- (NSMenuItem *)itemInSupermenu;
|
| 483 |
+
@end
|
| 484 |
+
|
| 485 |
+
@interface NSMenuItem(TKUtils)
|
| 486 |
+
+ (id)itemWithSubmenu:(NSMenu *)submenu;
|
| 487 |
+
+ (id)itemWithTitle:(NSString *)title submenu:(NSMenu *)submenu;
|
| 488 |
+
+ (id)itemWithTitle:(NSString *)title action:(SEL)action;
|
| 489 |
+
+ (id)itemWithTitle:(NSString *)title action:(SEL)action
|
| 490 |
+
target:(id)target;
|
| 491 |
+
+ (id)itemWithTitle:(NSString *)title action:(SEL)action
|
| 492 |
+
keyEquivalent:(NSString *)keyEquivalent;
|
| 493 |
+
+ (id)itemWithTitle:(NSString *)title action:(SEL)action
|
| 494 |
+
target:(id)target keyEquivalent:(NSString *)keyEquivalent;
|
| 495 |
+
+ (id)itemWithTitle:(NSString *)title action:(SEL)action
|
| 496 |
+
keyEquivalent:(NSString *)keyEquivalent
|
| 497 |
+
keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask;
|
| 498 |
+
+ (id)itemWithTitle:(NSString *)title action:(SEL)action
|
| 499 |
+
target:(id)target keyEquivalent:(NSString *)keyEquivalent
|
| 500 |
+
keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask;
|
| 501 |
+
@end
|
| 502 |
+
|
| 503 |
+
@interface NSColorPanel(TKDialog)
|
| 504 |
+
- (void) _setUseModalAppearance: (BOOL) flag;
|
| 505 |
+
@end
|
| 506 |
+
|
| 507 |
+
@interface NSFont(TKFont)
|
| 508 |
+
- (NSFont *) bestMatchingFontForCharacters: (const UTF16Char *) characters
|
| 509 |
+
length: (NSUInteger) length attributes: (NSDictionary *) attributes
|
| 510 |
+
actualCoveredLength: (NSUInteger *) coveredLength;
|
| 511 |
+
@end
|
| 512 |
+
|
| 513 |
+
/*
|
| 514 |
+
* This method of NSApplication is not declared in NSApplication.h so we
|
| 515 |
+
* declare it here to be a method of the TKMenu category.
|
| 516 |
+
*/
|
| 517 |
+
|
| 518 |
+
@interface NSApplication(TKMenu)
|
| 519 |
+
- (void) setAppleMenu: (NSMenu *) menu;
|
| 520 |
+
@end
|
| 521 |
+
|
| 522 |
+
/*
|
| 523 |
+
* These methods are exposed because they are needed to prevent zombie windows
|
| 524 |
+
* on systems with a TouchBar. The TouchBar Key-Value observer holds a
|
| 525 |
+
* reference to the key window, which prevents deallocation of the key window
|
| 526 |
+
* when it is closed.
|
| 527 |
+
*/
|
| 528 |
+
|
| 529 |
+
@interface NSApplication(TkWm)
|
| 530 |
+
- (id) _setKeyWindow: (NSWindow *) window;
|
| 531 |
+
- (id) _setMainWindow: (NSWindow *) window;
|
| 532 |
+
@end
|
| 533 |
+
|
| 534 |
+
|
| 535 |
+
/*
|
| 536 |
+
*---------------------------------------------------------------------------
|
| 537 |
+
*
|
| 538 |
+
* TKNSString --
|
| 539 |
+
*
|
| 540 |
+
* When Tcl is compiled with TCL_UTF_MAX = 3 (the default for 8.6) it cannot
|
| 541 |
+
* deal directly with UTF-8 encoded non-BMP characters, since their UTF-8
|
| 542 |
+
* encoding requires 4 bytes. Instead, when using these versions of Tcl, Tk
|
| 543 |
+
* uses the CESU-8 encoding internally. This encoding is similar to UTF-8
|
| 544 |
+
* except that it allows encoding surrogate characters as 3-byte sequences
|
| 545 |
+
* using the same algorithm which UTF-8 uses for non-surrogates. This means
|
| 546 |
+
* that a non-BMP character is encoded as a string of length 6. Apple's
|
| 547 |
+
* NSString class does not provide a constructor which accepts a CESU-8 encoded
|
| 548 |
+
* byte sequence as initial data. So we add a new class which does provide
|
| 549 |
+
* such a constructor. It also has a DString property which is a DString whose
|
| 550 |
+
* string pointer is a byte sequence encoding the NSString with the current Tk
|
| 551 |
+
* encoding, namely UTF-8 if TCL_UTF_MAX >= 4 or CESU-8 if TCL_UTF_MAX = 3.
|
| 552 |
+
*
|
| 553 |
+
*---------------------------------------------------------------------------
|
| 554 |
+
*/
|
| 555 |
+
|
| 556 |
+
@interface TKNSString:NSString {
|
| 557 |
+
@private
|
| 558 |
+
Tcl_DString _ds;
|
| 559 |
+
NSString *_string;
|
| 560 |
+
const char *_UTF8String;
|
| 561 |
+
}
|
| 562 |
+
@property const char *UTF8String;
|
| 563 |
+
@property (readonly) Tcl_DString DString;
|
| 564 |
+
- (instancetype)initWithTclUtfBytes:(const void *)bytes
|
| 565 |
+
length:(NSUInteger)len;
|
| 566 |
+
@end
|
| 567 |
+
|
| 568 |
+
#endif /* _TKMACPRIV */
|
| 569 |
+
|
| 570 |
+
/*
|
| 571 |
+
* Local Variables:
|
| 572 |
+
* mode: objc
|
| 573 |
+
* c-basic-offset: 4
|
| 574 |
+
* fill-column: 79
|
| 575 |
+
* coding: utf-8
|
| 576 |
+
* End:
|
| 577 |
+
*/
|
deepseek/include/tkMacOSXWm.h
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkMacOSXWm.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of Macintosh specific window manager structures.
|
| 5 |
+
*
|
| 6 |
+
* Copyright 2001-2009, Apple Inc.
|
| 7 |
+
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
| 8 |
+
*
|
| 9 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 10 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef _TKMACWM
|
| 14 |
+
#define _TKMACWM
|
| 15 |
+
|
| 16 |
+
#include "tkMacOSXInt.h"
|
| 17 |
+
#include "tkMenu.h"
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* A data structure of the following type holds information for each window
|
| 21 |
+
* manager protocol (such as WM_DELETE_WINDOW) for which a handler (i.e. a Tcl
|
| 22 |
+
* command) has been defined for a particular top-level window.
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
typedef struct ProtocolHandler {
|
| 26 |
+
Atom protocol; /* Identifies the protocol. */
|
| 27 |
+
struct ProtocolHandler *nextPtr;
|
| 28 |
+
/* Next in list of protocol handlers for the
|
| 29 |
+
* same top-level window, or NULL for end of
|
| 30 |
+
* list. */
|
| 31 |
+
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
|
| 32 |
+
char* command; /* Tcl command to invoke when a client message
|
| 33 |
+
* for this protocol arrives. The actual size
|
| 34 |
+
* of the structure varies to accommodate the
|
| 35 |
+
* needs of the actual command. THIS MUST BE
|
| 36 |
+
* THE LAST FIELD OF THE STRUCTURE. */
|
| 37 |
+
} ProtocolHandler;
|
| 38 |
+
|
| 39 |
+
/* The following data structure is used in the TkWmInfo to maintain a list of all of the
|
| 40 |
+
* transient windows belonging to a given container.
|
| 41 |
+
*/
|
| 42 |
+
|
| 43 |
+
typedef struct Transient {
|
| 44 |
+
TkWindow *winPtr;
|
| 45 |
+
int flags;
|
| 46 |
+
struct Transient *nextPtr;
|
| 47 |
+
} Transient;
|
| 48 |
+
|
| 49 |
+
#define WITHDRAWN_BY_CONTAINER 0x1
|
| 50 |
+
#define WITHDRAWN_BY_MASTER 0x1
|
| 51 |
+
|
| 52 |
+
/*
|
| 53 |
+
* A data structure of the following type holds window-manager-related
|
| 54 |
+
* information for each top-level window in an application.
|
| 55 |
+
*/
|
| 56 |
+
|
| 57 |
+
typedef struct TkWmInfo {
|
| 58 |
+
TkWindow *winPtr; /* Pointer to main Tk information for this
|
| 59 |
+
* window. */
|
| 60 |
+
Window reparent; /* If the window has been reparented, this
|
| 61 |
+
* gives the ID of the ancestor of the window
|
| 62 |
+
* that is a child of the root window (may not
|
| 63 |
+
* be window's immediate parent). If the window
|
| 64 |
+
* isn't reparented, this has the value
|
| 65 |
+
* None. */
|
| 66 |
+
Tk_Uid titleUid; /* Title to display in window caption. If NULL,
|
| 67 |
+
* use name of widget. */
|
| 68 |
+
char *iconName; /* Name to display in icon. */
|
| 69 |
+
Tk_Window container; /* Container window for TRANSIENT_FOR property,
|
| 70 |
+
* or None. */
|
| 71 |
+
XWMHints hints; /* Various pieces of information for window
|
| 72 |
+
* manager. */
|
| 73 |
+
char *leaderName; /* Path name of leader of window group
|
| 74 |
+
* (corresponds to hints.window_group).
|
| 75 |
+
* Malloc-ed. Note: this field doesn't get
|
| 76 |
+
* updated if leader is destroyed. */
|
| 77 |
+
Tk_Window icon; /* Window to use as icon for this window, or
|
| 78 |
+
* NULL. */
|
| 79 |
+
Tk_Window iconFor; /* Window for which this window is icon, or
|
| 80 |
+
* NULL if this isn't an icon for anyone. */
|
| 81 |
+
Transient *transientPtr; /* First item in a list of all transient windows
|
| 82 |
+
* belonging to this window, or NULL if there
|
| 83 |
+
* are no transients. */
|
| 84 |
+
|
| 85 |
+
/*
|
| 86 |
+
* Information used to construct an XSizeHints structure for the window
|
| 87 |
+
* manager:
|
| 88 |
+
*/
|
| 89 |
+
|
| 90 |
+
int sizeHintsFlags; /* Flags word for XSizeHints structure. If the
|
| 91 |
+
* PBaseSize flag is set then the window is
|
| 92 |
+
* gridded; otherwise it isn't gridded. */
|
| 93 |
+
int minWidth, minHeight; /* Minimum dimensions of window, in grid units,
|
| 94 |
+
* not pixels. */
|
| 95 |
+
int maxWidth, maxHeight; /* Maximum dimensions of window, in grid units,
|
| 96 |
+
* not pixels. */
|
| 97 |
+
Tk_Window gridWin; /* Identifies the window that controls gridding
|
| 98 |
+
* for this top-level, or NULL if the top-level
|
| 99 |
+
* isn't currently gridded. */
|
| 100 |
+
int widthInc, heightInc; /* Increments for size changes (# pixels per
|
| 101 |
+
* step). */
|
| 102 |
+
struct {
|
| 103 |
+
int x; /* numerator */
|
| 104 |
+
int y; /* denominator */
|
| 105 |
+
} minAspect, maxAspect; /* Min/max aspect ratios for window. */
|
| 106 |
+
int reqGridWidth, reqGridHeight;
|
| 107 |
+
/* The dimensions of the window (in grid units)
|
| 108 |
+
* requested through the geometry manager. */
|
| 109 |
+
int gravity; /* Desired window gravity. */
|
| 110 |
+
|
| 111 |
+
/*
|
| 112 |
+
* Information used to manage the size and location of a window.
|
| 113 |
+
*/
|
| 114 |
+
|
| 115 |
+
int width, height; /* Desired dimensions of window, specified in
|
| 116 |
+
* grid units. These values are set by the "wm
|
| 117 |
+
* geometry" command and by ConfigureNotify
|
| 118 |
+
* events (for when wm resizes window). -1
|
| 119 |
+
* means user hasn't requested dimensions. */
|
| 120 |
+
int x, y; /* Desired X and Y coordinates for window.
|
| 121 |
+
* These values are set by "wm geometry", plus
|
| 122 |
+
* by ConfigureNotify events (when wm moves
|
| 123 |
+
* window). These numbers are different than
|
| 124 |
+
* the numbers stored in winPtr->changes
|
| 125 |
+
* because (a) they could be measured from the
|
| 126 |
+
* right or bottom edge of the screen (see
|
| 127 |
+
* WM_NEGATIVE_X and WM_NEGATIVE_Y flags) and
|
| 128 |
+
* (b) if the window has been reparented then
|
| 129 |
+
* they refer to the parent rather than the
|
| 130 |
+
* window itself. */
|
| 131 |
+
int parentWidth, parentHeight;
|
| 132 |
+
/* Width and height of reparent, in pixels
|
| 133 |
+
* *including border*. If window hasn't been
|
| 134 |
+
* reparented then these will be the outer
|
| 135 |
+
* dimensions of the window, including
|
| 136 |
+
* border. */
|
| 137 |
+
int xInParent, yInParent; /* Offset of window within reparent, measured
|
| 138 |
+
* from upper-left outer corner of parent's
|
| 139 |
+
* border to upper-left outer corner of child's
|
| 140 |
+
* border. If not reparented then these are
|
| 141 |
+
* zero. */
|
| 142 |
+
int configX, configY; /* x,y position of toplevel when window is
|
| 143 |
+
* switched into fullscreen state, */
|
| 144 |
+
int configWidth, configHeight;
|
| 145 |
+
/* Dimensions passed to last request that we
|
| 146 |
+
* issued to change geometry of window. Used to
|
| 147 |
+
* eliminate redundant resize operations. */
|
| 148 |
+
|
| 149 |
+
/*
|
| 150 |
+
* Information about the virtual root window for this top-level, if there
|
| 151 |
+
* is one.
|
| 152 |
+
*/
|
| 153 |
+
|
| 154 |
+
Window vRoot; /* Virtual root window for this top-level, or
|
| 155 |
+
* None if there is no virtual root window
|
| 156 |
+
* (i.e. just use the screen's root). */
|
| 157 |
+
int vRootX, vRootY; /* Position of the virtual root inside the root
|
| 158 |
+
* window. If the WM_VROOT_OFFSET_STALE flag is
|
| 159 |
+
* set then this information may be incorrect
|
| 160 |
+
* and needs to be refreshed from the OS. If
|
| 161 |
+
* vRoot is None then these values are both
|
| 162 |
+
* 0. */
|
| 163 |
+
unsigned int vRootWidth, vRootHeight;
|
| 164 |
+
/* Dimensions of the virtual root window. If
|
| 165 |
+
* vRoot is None, gives the dimensions of the
|
| 166 |
+
* containing screen. This information is never
|
| 167 |
+
* stale, even though vRootX and vRootY can
|
| 168 |
+
* be. */
|
| 169 |
+
|
| 170 |
+
/*
|
| 171 |
+
* List of children of the toplevel which have private colormaps.
|
| 172 |
+
*/
|
| 173 |
+
|
| 174 |
+
TkWindow **cmapList; /* Array of window with private colormaps. */
|
| 175 |
+
int cmapCount; /* Number of windows in array. */
|
| 176 |
+
|
| 177 |
+
/*
|
| 178 |
+
* Miscellaneous information.
|
| 179 |
+
*/
|
| 180 |
+
|
| 181 |
+
ProtocolHandler *protPtr; /* First in list of protocol handlers for this
|
| 182 |
+
* window (NULL means none). */
|
| 183 |
+
Tcl_Obj *commandObj; /* The command (guaranteed to be a list) for
|
| 184 |
+
* the WM_COMMAND property. NULL means nothing
|
| 185 |
+
* available. */
|
| 186 |
+
char *clientMachine; /* String to store in WM_CLIENT_MACHINE
|
| 187 |
+
* property, or NULL. */
|
| 188 |
+
int flags; /* Miscellaneous flags, defined below. */
|
| 189 |
+
|
| 190 |
+
/*
|
| 191 |
+
* Macintosh information.
|
| 192 |
+
*/
|
| 193 |
+
|
| 194 |
+
WindowClass macClass;
|
| 195 |
+
UInt64 attributes, configAttributes;
|
| 196 |
+
TkWindow *scrollWinPtr; /* Ptr to scrollbar handling grow widget. */
|
| 197 |
+
TkMenu *menuPtr;
|
| 198 |
+
NSWindow *window;
|
| 199 |
+
|
| 200 |
+
/*
|
| 201 |
+
* Space to cache current window state when window becomes Fullscreen.
|
| 202 |
+
*/
|
| 203 |
+
|
| 204 |
+
unsigned long cachedStyle;
|
| 205 |
+
unsigned long cachedPresentation;
|
| 206 |
+
NSRect cachedBounds;
|
| 207 |
+
|
| 208 |
+
} WmInfo;
|
| 209 |
+
|
| 210 |
+
/*
|
| 211 |
+
* Flag values for WmInfo structures:
|
| 212 |
+
*
|
| 213 |
+
* WM_NEVER_MAPPED - non-zero means window has never been mapped;
|
| 214 |
+
* need to update all info when window is first
|
| 215 |
+
* mapped.
|
| 216 |
+
* WM_UPDATE_PENDING - non-zero means a call to UpdateGeometryInfo
|
| 217 |
+
* has already been scheduled for this window; no
|
| 218 |
+
* need to schedule another one.
|
| 219 |
+
* WM_NEGATIVE_X - non-zero means x-coordinate is measured in
|
| 220 |
+
* pixels from right edge of screen, rather than
|
| 221 |
+
* from left edge.
|
| 222 |
+
* WM_NEGATIVE_Y - non-zero means y-coordinate is measured in
|
| 223 |
+
* pixels up from bottom of screen, rather than
|
| 224 |
+
* down from top.
|
| 225 |
+
* WM_UPDATE_SIZE_HINTS - non-zero means that new size hints need to be
|
| 226 |
+
* propagated to window manager.
|
| 227 |
+
* WM_SYNC_PENDING - set to non-zero while waiting for the window
|
| 228 |
+
* manager to respond to some state change.
|
| 229 |
+
* WM_VROOT_OFFSET_STALE - non-zero means that (x,y) offset information
|
| 230 |
+
* about the virtual root window is stale and
|
| 231 |
+
* needs to be fetched fresh from the X server.
|
| 232 |
+
* WM_ABOUT_TO_MAP - non-zero means that the window is about to be
|
| 233 |
+
* mapped by TkWmMapWindow. This is used by
|
| 234 |
+
* UpdateGeometryInfo to modify its behavior.
|
| 235 |
+
* WM_MOVE_PENDING - non-zero means the application has requested a
|
| 236 |
+
* new position for the window, but it hasn't
|
| 237 |
+
* been reflected through the window manager yet.
|
| 238 |
+
* WM_COLORMAPS_EXPLICIT - non-zero means the colormap windows were set
|
| 239 |
+
* explicitly via "wm colormapwindows".
|
| 240 |
+
* WM_ADDED_TOPLEVEL_COLORMAP - non-zero means that when "wm colormapwindows"
|
| 241 |
+
* was called the top-level itself wasn't
|
| 242 |
+
* specified, so we added it implicitly at the
|
| 243 |
+
* end of the list.
|
| 244 |
+
* WM_WIDTH_NOT_RESIZABLE - non-zero means that we're not supposed to
|
| 245 |
+
* allow the user to change the width of the
|
| 246 |
+
* window (controlled by "wm resizable" command).
|
| 247 |
+
* WM_HEIGHT_NOT_RESIZABLE - non-zero means that we're not supposed to
|
| 248 |
+
* allow the user to change the height of the
|
| 249 |
+
* window (controlled by "wm resizable" command).
|
| 250 |
+
*/
|
| 251 |
+
|
| 252 |
+
#define WM_NEVER_MAPPED 0x0001
|
| 253 |
+
#define WM_UPDATE_PENDING 0x0002
|
| 254 |
+
#define WM_NEGATIVE_X 0x0004
|
| 255 |
+
#define WM_NEGATIVE_Y 0x0008
|
| 256 |
+
#define WM_UPDATE_SIZE_HINTS 0x0010
|
| 257 |
+
#define WM_SYNC_PENDING 0x0020
|
| 258 |
+
#define WM_VROOT_OFFSET_STALE 0x0040
|
| 259 |
+
#define WM_ABOUT_TO_MAP 0x0080
|
| 260 |
+
#define WM_MOVE_PENDING 0x0100
|
| 261 |
+
#define WM_COLORMAPS_EXPLICIT 0x0200
|
| 262 |
+
#define WM_ADDED_TOPLEVEL_COLORMAP 0x0400
|
| 263 |
+
#define WM_WIDTH_NOT_RESIZABLE 0x0800
|
| 264 |
+
#define WM_HEIGHT_NOT_RESIZABLE 0x1000
|
| 265 |
+
#define WM_TOPMOST 0x2000
|
| 266 |
+
#define WM_FULLSCREEN 0x4000
|
| 267 |
+
#define WM_TRANSPARENT 0x8000
|
| 268 |
+
|
| 269 |
+
#endif /* _TKMACWM */
|
| 270 |
+
|
| 271 |
+
/*
|
| 272 |
+
* Local Variables:
|
| 273 |
+
* mode: objc
|
| 274 |
+
* c-basic-offset: 4
|
| 275 |
+
* fill-column: 79
|
| 276 |
+
* coding: utf-8
|
| 277 |
+
* End:
|
| 278 |
+
*/
|
deepseek/include/tkPlatDecls.h
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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3 |
+
*
|
| 4 |
+
* Declarations of functions in the platform-specific public Tcl API.
|
| 5 |
+
*
|
| 6 |
+
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
| 7 |
+
*
|
| 8 |
+
* See the file "license.terms" for information on usage and redistribution
|
| 9 |
+
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef _TKPLATDECLS
|
| 13 |
+
#define _TKPLATDECLS
|
| 14 |
+
|
| 15 |
+
#ifdef BUILD_tk
|
| 16 |
+
#undef TCL_STORAGE_CLASS
|
| 17 |
+
#define TCL_STORAGE_CLASS DLLEXPORT
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
| 22 |
+
* script. Any modifications to the function declarations below should be made
|
| 23 |
+
* in the generic/tk.decls script.
|
| 24 |
+
*/
|
| 25 |
+
|
| 26 |
+
#ifdef __cplusplus
|
| 27 |
+
extern "C" {
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
/* !BEGIN!: Do not edit below this line. */
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
extern "C" {
|
| 34 |
+
#endif
|
| 35 |
+
|
| 36 |
+
/*
|
| 37 |
+
* Exported function declarations:
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 41 |
+
/* 0 */
|
| 42 |
+
EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd);
|
| 43 |
+
/* 1 */
|
| 44 |
+
EXTERN HINSTANCE Tk_GetHINSTANCE(void);
|
| 45 |
+
/* 2 */
|
| 46 |
+
EXTERN HWND Tk_GetHWND(Window window);
|
| 47 |
+
/* 3 */
|
| 48 |
+
EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd);
|
| 49 |
+
/* 4 */
|
| 50 |
+
EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y);
|
| 51 |
+
/* 5 */
|
| 52 |
+
EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message,
|
| 53 |
+
WPARAM wParam, LPARAM lParam,
|
| 54 |
+
LRESULT *result);
|
| 55 |
+
#endif /* WIN */
|
| 56 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 57 |
+
/* 0 */
|
| 58 |
+
EXTERN void Tk_MacOSXSetEmbedHandler(
|
| 59 |
+
Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr,
|
| 60 |
+
Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr,
|
| 61 |
+
Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr,
|
| 62 |
+
Tk_MacOSXEmbedGetClipProc *getClipProc,
|
| 63 |
+
Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc);
|
| 64 |
+
/* 1 */
|
| 65 |
+
EXTERN void Tk_MacOSXTurnOffMenus(void);
|
| 66 |
+
/* 2 */
|
| 67 |
+
EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt);
|
| 68 |
+
/* 3 */
|
| 69 |
+
EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp);
|
| 70 |
+
/* 4 */
|
| 71 |
+
EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp);
|
| 72 |
+
/* 5 */
|
| 73 |
+
EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y,
|
| 74 |
+
int width, int height, int flags);
|
| 75 |
+
/* 6 */
|
| 76 |
+
EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin);
|
| 77 |
+
/* 7 */
|
| 78 |
+
EXTERN void * TkMacOSXGetDrawablePort(Drawable drawable);
|
| 79 |
+
/* 8 */
|
| 80 |
+
EXTERN void * TkMacOSXGetRootControl(Drawable drawable);
|
| 81 |
+
/* 9 */
|
| 82 |
+
EXTERN void Tk_MacOSXSetupTkNotifier(void);
|
| 83 |
+
/* 10 */
|
| 84 |
+
EXTERN int Tk_MacOSXIsAppInFront(void);
|
| 85 |
+
/* 11 */
|
| 86 |
+
EXTERN Tk_Window Tk_MacOSXGetTkWindow(void *w);
|
| 87 |
+
/* 12 */
|
| 88 |
+
EXTERN void * Tk_MacOSXGetCGContextForDrawable(Drawable drawable);
|
| 89 |
+
/* 13 */
|
| 90 |
+
EXTERN void * Tk_MacOSXGetNSWindowForDrawable(Drawable drawable);
|
| 91 |
+
/* Slot 14 is reserved */
|
| 92 |
+
/* Slot 15 is reserved */
|
| 93 |
+
/* 16 */
|
| 94 |
+
EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y,
|
| 95 |
+
int width, int height, int flags);
|
| 96 |
+
#endif /* AQUA */
|
| 97 |
+
|
| 98 |
+
typedef struct TkPlatStubs {
|
| 99 |
+
int magic;
|
| 100 |
+
void *hooks;
|
| 101 |
+
|
| 102 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 103 |
+
Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */
|
| 104 |
+
HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */
|
| 105 |
+
HWND (*tk_GetHWND) (Window window); /* 2 */
|
| 106 |
+
Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */
|
| 107 |
+
void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */
|
| 108 |
+
int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */
|
| 109 |
+
#endif /* WIN */
|
| 110 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 111 |
+
void (*tk_MacOSXSetEmbedHandler) (Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 0 */
|
| 112 |
+
void (*tk_MacOSXTurnOffMenus) (void); /* 1 */
|
| 113 |
+
void (*tk_MacOSXTkOwnsCursor) (int tkOwnsIt); /* 2 */
|
| 114 |
+
void (*tkMacOSXInitMenus) (Tcl_Interp *interp); /* 3 */
|
| 115 |
+
void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */
|
| 116 |
+
void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */
|
| 117 |
+
void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */
|
| 118 |
+
void * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */
|
| 119 |
+
void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
|
| 120 |
+
void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */
|
| 121 |
+
int (*tk_MacOSXIsAppInFront) (void); /* 10 */
|
| 122 |
+
Tk_Window (*tk_MacOSXGetTkWindow) (void *w); /* 11 */
|
| 123 |
+
void * (*tk_MacOSXGetCGContextForDrawable) (Drawable drawable); /* 12 */
|
| 124 |
+
void * (*tk_MacOSXGetNSWindowForDrawable) (Drawable drawable); /* 13 */
|
| 125 |
+
void (*reserved14)(void);
|
| 126 |
+
void (*reserved15)(void);
|
| 127 |
+
void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 16 */
|
| 128 |
+
#endif /* AQUA */
|
| 129 |
+
} TkPlatStubs;
|
| 130 |
+
|
| 131 |
+
extern const TkPlatStubs *tkPlatStubsPtr;
|
| 132 |
+
|
| 133 |
+
#ifdef __cplusplus
|
| 134 |
+
}
|
| 135 |
+
#endif
|
| 136 |
+
|
| 137 |
+
#if defined(USE_TK_STUBS)
|
| 138 |
+
|
| 139 |
+
/*
|
| 140 |
+
* Inline function declarations:
|
| 141 |
+
*/
|
| 142 |
+
|
| 143 |
+
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
| 144 |
+
#define Tk_AttachHWND \
|
| 145 |
+
(tkPlatStubsPtr->tk_AttachHWND) /* 0 */
|
| 146 |
+
#define Tk_GetHINSTANCE \
|
| 147 |
+
(tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
|
| 148 |
+
#define Tk_GetHWND \
|
| 149 |
+
(tkPlatStubsPtr->tk_GetHWND) /* 2 */
|
| 150 |
+
#define Tk_HWNDToWindow \
|
| 151 |
+
(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
|
| 152 |
+
#define Tk_PointerEvent \
|
| 153 |
+
(tkPlatStubsPtr->tk_PointerEvent) /* 4 */
|
| 154 |
+
#define Tk_TranslateWinEvent \
|
| 155 |
+
(tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
|
| 156 |
+
#endif /* WIN */
|
| 157 |
+
#ifdef MAC_OSX_TK /* AQUA */
|
| 158 |
+
#define Tk_MacOSXSetEmbedHandler \
|
| 159 |
+
(tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */
|
| 160 |
+
#define Tk_MacOSXTurnOffMenus \
|
| 161 |
+
(tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */
|
| 162 |
+
#define Tk_MacOSXTkOwnsCursor \
|
| 163 |
+
(tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */
|
| 164 |
+
#define TkMacOSXInitMenus \
|
| 165 |
+
(tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */
|
| 166 |
+
#define TkMacOSXInitAppleEvents \
|
| 167 |
+
(tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */
|
| 168 |
+
#define TkGenWMConfigureEvent \
|
| 169 |
+
(tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */
|
| 170 |
+
#define TkMacOSXInvalClipRgns \
|
| 171 |
+
(tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */
|
| 172 |
+
#define TkMacOSXGetDrawablePort \
|
| 173 |
+
(tkPlatStubsPtr->tkMacOSXGetDrawablePort) /* 7 */
|
| 174 |
+
#define TkMacOSXGetRootControl \
|
| 175 |
+
(tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */
|
| 176 |
+
#define Tk_MacOSXSetupTkNotifier \
|
| 177 |
+
(tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */
|
| 178 |
+
#define Tk_MacOSXIsAppInFront \
|
| 179 |
+
(tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */
|
| 180 |
+
#define Tk_MacOSXGetTkWindow \
|
| 181 |
+
(tkPlatStubsPtr->tk_MacOSXGetTkWindow) /* 11 */
|
| 182 |
+
#define Tk_MacOSXGetCGContextForDrawable \
|
| 183 |
+
(tkPlatStubsPtr->tk_MacOSXGetCGContextForDrawable) /* 12 */
|
| 184 |
+
#define Tk_MacOSXGetNSWindowForDrawable \
|
| 185 |
+
(tkPlatStubsPtr->tk_MacOSXGetNSWindowForDrawable) /* 13 */
|
| 186 |
+
/* Slot 14 is reserved */
|
| 187 |
+
/* Slot 15 is reserved */
|
| 188 |
+
#define TkGenWMConfigureEvent_ \
|
| 189 |
+
(tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 16 */
|
| 190 |
+
#endif /* AQUA */
|
| 191 |
+
|
| 192 |
+
#endif /* defined(USE_TK_STUBS) */
|
| 193 |
+
|
| 194 |
+
/* !END!: Do not edit above this line. */
|
| 195 |
+
|
| 196 |
+
#ifdef __cplusplus
|
| 197 |
+
}
|
| 198 |
+
#endif
|
| 199 |
+
|
| 200 |
+
#undef TCL_STORAGE_CLASS
|
| 201 |
+
#define TCL_STORAGE_CLASS DLLIMPORT
|
| 202 |
+
|
| 203 |
+
#undef TkGenWMConfigureEvent_
|
| 204 |
+
#define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl
|
| 205 |
+
|
| 206 |
+
#endif /* _TKPLATDECLS */
|
deepseek/include/tkScale.h
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkScale.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of types and functions used to implement the scale
|
| 5 |
+
* widget.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1996 by Sun Microsystems, Inc.
|
| 8 |
+
* Copyright (c) 1999-2000 by Scriptics Corporation.
|
| 9 |
+
*
|
| 10 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 11 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef _TKSCALE
|
| 15 |
+
#define _TKSCALE
|
| 16 |
+
|
| 17 |
+
#ifndef _TKINT
|
| 18 |
+
#include "tkInt.h"
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* Legal values for the "orient" field of TkScale records.
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
enum orient {
|
| 26 |
+
ORIENT_HORIZONTAL, ORIENT_VERTICAL
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
* Legal values for the "state" field of TkScale records.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
enum state {
|
| 34 |
+
STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
* A data structure of the following type is kept for each scale widget
|
| 39 |
+
* managed by this file:
|
| 40 |
+
*/
|
| 41 |
+
|
| 42 |
+
typedef struct TkScale {
|
| 43 |
+
Tk_Window tkwin; /* Window that embodies the scale. NULL means
|
| 44 |
+
* that the window has been destroyed but the
|
| 45 |
+
* data structures haven't yet been cleaned
|
| 46 |
+
* up.*/
|
| 47 |
+
Display *display; /* Display containing widget. Used, among
|
| 48 |
+
* other things, so that resources can be
|
| 49 |
+
* freed even after tkwin has gone away. */
|
| 50 |
+
Tcl_Interp *interp; /* Interpreter associated with scale. */
|
| 51 |
+
Tcl_Command widgetCmd; /* Token for scale's widget command. */
|
| 52 |
+
Tk_OptionTable optionTable; /* Table that defines configuration options
|
| 53 |
+
* available for this widget. */
|
| 54 |
+
enum orient orient; /* Orientation for window (vertical or
|
| 55 |
+
* horizontal). */
|
| 56 |
+
int width; /* Desired narrow dimension of scale, in
|
| 57 |
+
* pixels. */
|
| 58 |
+
int length; /* Desired long dimension of scale, in
|
| 59 |
+
* pixels. */
|
| 60 |
+
double value; /* Current value of scale. */
|
| 61 |
+
Tcl_Obj *varNamePtr; /* Name of variable or NULL. If non-NULL,
|
| 62 |
+
* scale's value tracks the contents of this
|
| 63 |
+
* variable and vice versa. */
|
| 64 |
+
double fromValue; /* Value corresponding to left or top of
|
| 65 |
+
* scale. */
|
| 66 |
+
double toValue; /* Value corresponding to right or bottom of
|
| 67 |
+
* scale. */
|
| 68 |
+
double tickInterval; /* Distance between tick marks; 0 means don't
|
| 69 |
+
* display any tick marks. */
|
| 70 |
+
double resolution; /* If > 0, all values are rounded to an even
|
| 71 |
+
* multiple of this value. */
|
| 72 |
+
int digits; /* Number of significant digits to print in
|
| 73 |
+
* values. 0 means we get to choose the number
|
| 74 |
+
* based on resolution and/or the range of the
|
| 75 |
+
* scale. */
|
| 76 |
+
char valueFormat[16]; /* Snprintf conversion specifier computed from
|
| 77 |
+
* digits and other information. */
|
| 78 |
+
char tickFormat[16]; /* Snprintf conversion specifier computed from
|
| 79 |
+
* tick interval. */
|
| 80 |
+
double bigIncrement; /* Amount to use for large increments to scale
|
| 81 |
+
* value. (0 means we pick a value). */
|
| 82 |
+
char *command; /* Command prefix to use when invoking Tcl
|
| 83 |
+
* commands because the scale value changed.
|
| 84 |
+
* NULL means don't invoke commands. */
|
| 85 |
+
int repeatDelay; /* How long to wait before auto-repeating on
|
| 86 |
+
* scrolling actions (in ms). */
|
| 87 |
+
int repeatInterval; /* Interval between autorepeats (in ms). */
|
| 88 |
+
char *label; /* Label to display above or to right of
|
| 89 |
+
* scale; NULL means don't display a label. */
|
| 90 |
+
int labelLength; /* Number of non-NULL chars. in label. */
|
| 91 |
+
enum state state; /* Values are active, normal, or disabled.
|
| 92 |
+
* Value of scale cannot be changed when
|
| 93 |
+
* disabled. */
|
| 94 |
+
|
| 95 |
+
/*
|
| 96 |
+
* Information used when displaying widget:
|
| 97 |
+
*/
|
| 98 |
+
|
| 99 |
+
int borderWidth; /* Width of 3-D border around window. */
|
| 100 |
+
Tk_3DBorder bgBorder; /* Used for drawing slider and other
|
| 101 |
+
* background areas. */
|
| 102 |
+
Tk_3DBorder activeBorder; /* For drawing the slider when active. */
|
| 103 |
+
int sliderRelief; /* Is slider to be drawn raised, sunken,
|
| 104 |
+
* etc. */
|
| 105 |
+
XColor *troughColorPtr; /* Color for drawing trough. */
|
| 106 |
+
GC troughGC; /* For drawing trough. */
|
| 107 |
+
GC copyGC; /* Used for copying from pixmap onto screen */
|
| 108 |
+
Tk_Font tkfont; /* Information about text font, or NULL. */
|
| 109 |
+
XColor *textColorPtr; /* Color for drawing text. */
|
| 110 |
+
GC textGC; /* GC for drawing text in normal mode. */
|
| 111 |
+
int relief; /* Indicates whether window as a whole is
|
| 112 |
+
* raised, sunken, or flat. */
|
| 113 |
+
int highlightWidth; /* Width in pixels of highlight to draw around
|
| 114 |
+
* widget when it has the focus. <= 0 means
|
| 115 |
+
* don't draw a highlight. */
|
| 116 |
+
Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
|
| 117 |
+
* specifies background with which to draw 3-D
|
| 118 |
+
* default ring and focus highlight area when
|
| 119 |
+
* highlight is off. */
|
| 120 |
+
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
|
| 121 |
+
int inset; /* Total width of all borders, including
|
| 122 |
+
* traversal highlight and 3-D border.
|
| 123 |
+
* Indicates how much interior stuff must be
|
| 124 |
+
* offset from outside edges to leave room for
|
| 125 |
+
* borders. */
|
| 126 |
+
int sliderLength; /* Length of slider, measured in pixels along
|
| 127 |
+
* long dimension of scale. */
|
| 128 |
+
int showValue; /* Non-zero means to display the scale value
|
| 129 |
+
* below or to the left of the slider; zero
|
| 130 |
+
* means don't display the value. */
|
| 131 |
+
|
| 132 |
+
/*
|
| 133 |
+
* Layout information for horizontal scales, assuming that window gets the
|
| 134 |
+
* size it requested:
|
| 135 |
+
*/
|
| 136 |
+
|
| 137 |
+
int horizLabelY; /* Y-coord at which to draw label. */
|
| 138 |
+
int horizValueY; /* Y-coord at which to draw value text. */
|
| 139 |
+
int horizTroughY; /* Y-coord of top of slider trough. */
|
| 140 |
+
int horizTickY; /* Y-coord at which to draw tick text. */
|
| 141 |
+
/*
|
| 142 |
+
* Layout information for vertical scales, assuming that window gets the
|
| 143 |
+
* size it requested:
|
| 144 |
+
*/
|
| 145 |
+
|
| 146 |
+
int vertTickRightX; /* X-location of right side of tick-marks. */
|
| 147 |
+
int vertValueRightX; /* X-location of right side of value string. */
|
| 148 |
+
int vertTroughX; /* X-location of scale's slider trough. */
|
| 149 |
+
int vertLabelX; /* X-location of origin of label. */
|
| 150 |
+
|
| 151 |
+
/*
|
| 152 |
+
* Miscellaneous information:
|
| 153 |
+
*/
|
| 154 |
+
|
| 155 |
+
int fontHeight; /* Height of scale font. */
|
| 156 |
+
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
|
| 157 |
+
Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
|
| 158 |
+
* C code, but used by keyboard traversal
|
| 159 |
+
* scripts. May be NULL. */
|
| 160 |
+
int flags; /* Various flags; see below for
|
| 161 |
+
* definitions. */
|
| 162 |
+
} TkScale;
|
| 163 |
+
|
| 164 |
+
/*
|
| 165 |
+
* Flag bits for scales:
|
| 166 |
+
*
|
| 167 |
+
* REDRAW_SLIDER - 1 means slider (and numerical readout) need to
|
| 168 |
+
* be redrawn.
|
| 169 |
+
* REDRAW_OTHER - 1 means other stuff besides slider and value
|
| 170 |
+
* need to be redrawn.
|
| 171 |
+
* REDRAW_ALL - 1 means the entire widget needs to be redrawn.
|
| 172 |
+
* REDRAW_PENDING - 1 means any sort of redraw is pending
|
| 173 |
+
* ACTIVE - 1 means the widget is active (the mouse is in
|
| 174 |
+
* its window).
|
| 175 |
+
* INVOKE_COMMAND - 1 means the scale's command needs to be
|
| 176 |
+
* invoked during the next redisplay (the value
|
| 177 |
+
* of the scale has changed since the last time
|
| 178 |
+
* the command was invoked).
|
| 179 |
+
* SETTING_VAR - 1 means that the associated variable is being
|
| 180 |
+
* set by us, so there's no need for ScaleVarProc
|
| 181 |
+
* to do anything.
|
| 182 |
+
* NEVER_SET - 1 means that the scale's value has never been
|
| 183 |
+
* set before (so must invoke -command and set
|
| 184 |
+
* associated variable even if the value doesn't
|
| 185 |
+
* appear to have changed).
|
| 186 |
+
* GOT_FOCUS - 1 means that the focus is currently in this
|
| 187 |
+
* widget.
|
| 188 |
+
* SCALE_DELETED - 1 means the scale widget is being deleted
|
| 189 |
+
*/
|
| 190 |
+
|
| 191 |
+
#define REDRAW_SLIDER (1<<0)
|
| 192 |
+
#define REDRAW_OTHER (1<<1)
|
| 193 |
+
#define REDRAW_ALL (REDRAW_OTHER|REDRAW_SLIDER)
|
| 194 |
+
#define REDRAW_PENDING (1<<2)
|
| 195 |
+
#define ACTIVE (1<<3)
|
| 196 |
+
#define INVOKE_COMMAND (1<<4)
|
| 197 |
+
#define SETTING_VAR (1<<5)
|
| 198 |
+
#define NEVER_SET (1<<6)
|
| 199 |
+
#define GOT_FOCUS (1<<7)
|
| 200 |
+
#define SCALE_DELETED (1<<8)
|
| 201 |
+
|
| 202 |
+
/*
|
| 203 |
+
* Symbolic values for the active parts of a slider. These are the values that
|
| 204 |
+
* may be returned by the ScaleElement procedure.
|
| 205 |
+
*/
|
| 206 |
+
|
| 207 |
+
#define OTHER 0
|
| 208 |
+
#define TROUGH1 1
|
| 209 |
+
#define SLIDER 2
|
| 210 |
+
#define TROUGH2 3
|
| 211 |
+
|
| 212 |
+
/*
|
| 213 |
+
* Space to leave between scale area and text, and between text and edge of
|
| 214 |
+
* window.
|
| 215 |
+
*/
|
| 216 |
+
|
| 217 |
+
#define SPACING 2
|
| 218 |
+
|
| 219 |
+
/*
|
| 220 |
+
* The tick values are all displayed with the same number of decimal places.
|
| 221 |
+
* This number of decimal places is such that the displayed values are all
|
| 222 |
+
* accurate to within the following proportion of a tick interval.
|
| 223 |
+
*/
|
| 224 |
+
|
| 225 |
+
#define TICK_VALUES_DISPLAY_ACCURACY 0.2
|
| 226 |
+
|
| 227 |
+
/*
|
| 228 |
+
* Declaration of procedures used in the implementation of the scale widget.
|
| 229 |
+
*/
|
| 230 |
+
|
| 231 |
+
MODULE_SCOPE void TkEventuallyRedrawScale(TkScale *scalePtr, int what);
|
| 232 |
+
MODULE_SCOPE double TkRoundValueToResolution(TkScale *scalePtr, double value);
|
| 233 |
+
MODULE_SCOPE double TkRoundIntervalToResolution(TkScale *scalePtr, double value);
|
| 234 |
+
MODULE_SCOPE TkScale * TkpCreateScale(Tk_Window tkwin);
|
| 235 |
+
MODULE_SCOPE void TkpDestroyScale(TkScale *scalePtr);
|
| 236 |
+
MODULE_SCOPE void TkpDisplayScale(ClientData clientData);
|
| 237 |
+
MODULE_SCOPE int TkpScaleElement(TkScale *scalePtr, int x, int y);
|
| 238 |
+
MODULE_SCOPE void TkScaleSetValue(TkScale *scalePtr, double value,
|
| 239 |
+
int setVar, int invokeCommand);
|
| 240 |
+
MODULE_SCOPE double TkScalePixelToValue(TkScale *scalePtr, int x, int y);
|
| 241 |
+
MODULE_SCOPE int TkScaleValueToPixel(TkScale *scalePtr, double value);
|
| 242 |
+
|
| 243 |
+
#endif /* _TKSCALE */
|
deepseek/include/tkScrollbar.h
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* tkScrollbar.h --
|
| 3 |
+
*
|
| 4 |
+
* Declarations of types and functions used to implement the scrollbar
|
| 5 |
+
* widget.
|
| 6 |
+
*
|
| 7 |
+
* Copyright (c) 1996 by Sun Microsystems, Inc.
|
| 8 |
+
*
|
| 9 |
+
* See the file "license.terms" for information on usage and redistribution of
|
| 10 |
+
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef _TKSCROLLBAR
|
| 14 |
+
#define _TKSCROLLBAR
|
| 15 |
+
|
| 16 |
+
#ifndef _TKINT
|
| 17 |
+
#include "tkInt.h"
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* A data structure of the following type is kept for each scrollbar widget.
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
typedef struct TkScrollbar {
|
| 25 |
+
Tk_Window tkwin; /* Window that embodies the scrollbar. NULL
|
| 26 |
+
* means that the window has been destroyed
|
| 27 |
+
* but the data structures haven't yet been
|
| 28 |
+
* cleaned up.*/
|
| 29 |
+
Display *display; /* Display containing widget. Used, among
|
| 30 |
+
* other things, so that resources can be
|
| 31 |
+
* freed even after tkwin has gone away. */
|
| 32 |
+
Tcl_Interp *interp; /* Interpreter associated with scrollbar. */
|
| 33 |
+
Tcl_Command widgetCmd; /* Token for scrollbar's widget command. */
|
| 34 |
+
int vertical; /* Non-zero means vertical orientation
|
| 35 |
+
* requested, zero means horizontal. */
|
| 36 |
+
int width; /* Desired narrow dimension of scrollbar, in
|
| 37 |
+
* pixels. */
|
| 38 |
+
char *command; /* Command prefix to use when invoking
|
| 39 |
+
* scrolling commands. NULL means don't invoke
|
| 40 |
+
* commands. Malloc'ed. */
|
| 41 |
+
int commandSize; /* Number of non-NULL bytes in command. */
|
| 42 |
+
int repeatDelay; /* How long to wait before auto-repeating on
|
| 43 |
+
* scrolling actions (in ms). */
|
| 44 |
+
int repeatInterval; /* Interval between autorepeats (in ms). */
|
| 45 |
+
int jump; /* Value of -jump option. */
|
| 46 |
+
|
| 47 |
+
/*
|
| 48 |
+
* Information used when displaying widget:
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
int borderWidth; /* Width of 3-D borders. */
|
| 52 |
+
Tk_3DBorder bgBorder; /* Used for drawing background (all flat
|
| 53 |
+
* surfaces except for trough). */
|
| 54 |
+
Tk_3DBorder activeBorder; /* For drawing backgrounds when active (i.e.
|
| 55 |
+
* when mouse is positioned over element). */
|
| 56 |
+
XColor *troughColorPtr; /* Color for drawing trough. */
|
| 57 |
+
int relief; /* Indicates whether window as a whole is
|
| 58 |
+
* raised, sunken, or flat. */
|
| 59 |
+
int highlightWidth; /* Width in pixels of highlight to draw around
|
| 60 |
+
* widget when it has the focus. <= 0 means
|
| 61 |
+
* don't draw a highlight. */
|
| 62 |
+
XColor *highlightBgColorPtr;
|
| 63 |
+
/* Color for drawing traversal highlight area
|
| 64 |
+
* when highlight is off. */
|
| 65 |
+
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
|
| 66 |
+
int inset; /* Total width of all borders, including
|
| 67 |
+
* traversal highlight and 3-D border.
|
| 68 |
+
* Indicates how much interior stuff must be
|
| 69 |
+
* offset from outside edges to leave room for
|
| 70 |
+
* borders. */
|
| 71 |
+
int elementBorderWidth; /* Width of border to draw around elements
|
| 72 |
+
* inside scrollbar (arrows and slider). -1
|
| 73 |
+
* means use borderWidth. */
|
| 74 |
+
int arrowLength; /* Length of arrows along long dimension of
|
| 75 |
+
* scrollbar, including space for a small gap
|
| 76 |
+
* between the arrow and the slider.
|
| 77 |
+
* Recomputed on window size changes. */
|
| 78 |
+
int sliderFirst; /* Pixel coordinate of top or left edge of
|
| 79 |
+
* slider area, including border. */
|
| 80 |
+
int sliderLast; /* Coordinate of pixel just after bottom or
|
| 81 |
+
* right edge of slider area, including
|
| 82 |
+
* border. */
|
| 83 |
+
int activeField; /* Names field to be displayed in active
|
| 84 |
+
* colors, such as TOP_ARROW, or 0 for no
|
| 85 |
+
* field. */
|
| 86 |
+
int activeRelief; /* Value of -activeRelief option: relief to
|
| 87 |
+
* use for active element. */
|
| 88 |
+
|
| 89 |
+
/*
|
| 90 |
+
* Information describing the application related to the scrollbar. This
|
| 91 |
+
* information is provided by the application by invoking the "set" widget
|
| 92 |
+
* command. This information can now be provided in two ways: the "old"
|
| 93 |
+
* form (totalUnits, windowUnits, firstUnit, and lastUnit), or the "new"
|
| 94 |
+
* form (firstFraction and lastFraction). FirstFraction and lastFraction
|
| 95 |
+
* will always be valid, but the old-style information is only valid if
|
| 96 |
+
* the NEW_STYLE_COMMANDS flag is 0.
|
| 97 |
+
*/
|
| 98 |
+
|
| 99 |
+
int totalUnits; /* Total dimension of application, in units.
|
| 100 |
+
* Valid only if the NEW_STYLE_COMMANDS flag
|
| 101 |
+
* isn't set. */
|
| 102 |
+
int windowUnits; /* Maximum number of units that can be
|
| 103 |
+
* displayed in the window at once. Valid only
|
| 104 |
+
* if the NEW_STYLE_COMMANDS flag isn't set. */
|
| 105 |
+
int firstUnit; /* Number of last unit visible in
|
| 106 |
+
* application's window. Valid only if the
|
| 107 |
+
* NEW_STYLE_COMMANDS flag isn't set. */
|
| 108 |
+
int lastUnit; /* Index of last unit visible in window.
|
| 109 |
+
* Valid only if the NEW_STYLE_COMMANDS flag
|
| 110 |
+
* isn't set. */
|
| 111 |
+
double firstFraction; /* Position of first visible thing in window,
|
| 112 |
+
* specified as a fraction between 0 and
|
| 113 |
+
* 1.0. */
|
| 114 |
+
double lastFraction; /* Position of last visible thing in window,
|
| 115 |
+
* specified as a fraction between 0 and
|
| 116 |
+
* 1.0. */
|
| 117 |
+
|
| 118 |
+
/*
|
| 119 |
+
* Miscellaneous information:
|
| 120 |
+
*/
|
| 121 |
+
|
| 122 |
+
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
|
| 123 |
+
char *takeFocus; /* Value of -takefocus option; not used in the
|
| 124 |
+
* C code, but used by keyboard traversal
|
| 125 |
+
* scripts. Malloc'ed, but may be NULL. */
|
| 126 |
+
int flags; /* Various flags; see below for
|
| 127 |
+
* definitions. */
|
| 128 |
+
} TkScrollbar;
|
| 129 |
+
|
| 130 |
+
/*
|
| 131 |
+
* Legal values for "activeField" field of Scrollbar structures. These are
|
| 132 |
+
* also the return values from the ScrollbarPosition function.
|
| 133 |
+
*/
|
| 134 |
+
|
| 135 |
+
#define OUTSIDE 0
|
| 136 |
+
#define TOP_ARROW 1
|
| 137 |
+
#define TOP_GAP 2
|
| 138 |
+
#define SLIDER 3
|
| 139 |
+
#define BOTTOM_GAP 4
|
| 140 |
+
#define BOTTOM_ARROW 5
|
| 141 |
+
|
| 142 |
+
/*
|
| 143 |
+
* Flag bits for scrollbars:
|
| 144 |
+
*
|
| 145 |
+
* REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
|
| 146 |
+
* already been queued to redraw this window.
|
| 147 |
+
* NEW_STYLE_COMMANDS: Non-zero means the new style of commands
|
| 148 |
+
* should be used to communicate with the widget:
|
| 149 |
+
* ".t yview scroll 2 lines", instead of
|
| 150 |
+
* ".t yview 40", for example.
|
| 151 |
+
* GOT_FOCUS: Non-zero means this window has the input
|
| 152 |
+
* focus.
|
| 153 |
+
*/
|
| 154 |
+
|
| 155 |
+
#define REDRAW_PENDING 1
|
| 156 |
+
#define NEW_STYLE_COMMANDS 2
|
| 157 |
+
#define GOT_FOCUS 4
|
| 158 |
+
|
| 159 |
+
/*
|
| 160 |
+
* Declaration of scrollbar class functions structure
|
| 161 |
+
* and default scrollbar width, for use in configSpec.
|
| 162 |
+
*/
|
| 163 |
+
|
| 164 |
+
MODULE_SCOPE const Tk_ClassProcs tkpScrollbarProcs;
|
| 165 |
+
MODULE_SCOPE char tkDefScrollbarWidth[TCL_INTEGER_SPACE];
|
| 166 |
+
|
| 167 |
+
/*
|
| 168 |
+
* Declaration of functions used in the implementation of the scrollbar
|
| 169 |
+
* widget.
|
| 170 |
+
*/
|
| 171 |
+
|
| 172 |
+
MODULE_SCOPE void TkScrollbarEventProc(ClientData clientData,
|
| 173 |
+
XEvent *eventPtr);
|
| 174 |
+
MODULE_SCOPE void TkScrollbarEventuallyRedraw(TkScrollbar *scrollPtr);
|
| 175 |
+
MODULE_SCOPE void TkpComputeScrollbarGeometry(TkScrollbar *scrollPtr);
|
| 176 |
+
MODULE_SCOPE TkScrollbar *TkpCreateScrollbar(Tk_Window tkwin);
|
| 177 |
+
MODULE_SCOPE void TkpDestroyScrollbar(TkScrollbar *scrollPtr);
|
| 178 |
+
MODULE_SCOPE void TkpDisplayScrollbar(ClientData clientData);
|
| 179 |
+
MODULE_SCOPE void TkpConfigureScrollbar(TkScrollbar *scrollPtr);
|
| 180 |
+
MODULE_SCOPE int TkpScrollbarPosition(TkScrollbar *scrollPtr,
|
| 181 |
+
int x, int y);
|
| 182 |
+
|
| 183 |
+
#endif /* _TKSCROLLBAR */
|