ZTWHHH commited on
Commit
792137b
·
verified ·
1 Parent(s): fc91621

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. llava_next/include/fakemysql.h +335 -0
  2. llava_next/include/itclInt.h +854 -0
  3. llava_next/include/sqlite3.h +0 -0
  4. llava_next/include/tclOOIntDecls.h +166 -0
  5. llava_next/include/term.h +893 -0
  6. llava_next/include/tkMacOSXFont.h +32 -0
  7. llava_next/include/tkMenubutton.h +216 -0
  8. llava_next/include/tkUuid.h +3 -0
  9. llava_next/share/info/history.info +1426 -0
  10. llava_next/share/info/libgomp.info +0 -0
  11. videochat2/lib/python3.10/site-packages/tensorflow/compiler/__init__.py +0 -0
  12. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__pycache__/__init__.cpython-310.pyc +0 -0
  13. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__pycache__/quantization_config_pb2.cpython-310.pyc +0 -0
  14. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__pycache__/quantization_options_pb2.cpython-310.pyc +0 -0
  15. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/__init__.py +0 -0
  16. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/__init__.py +0 -0
  17. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_algorithm.py +393 -0
  18. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics_pb2.py +32 -0
  19. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/pywrap_calibration.pyi +32 -0
  20. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/exported_model_pb2.py +33 -0
  21. videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/quantization_options_pb2.py +65 -0
  22. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/__init__.py +0 -0
  23. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/_pywrap_py_utils.pyi +19 -0
  24. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__init__.py +0 -0
  25. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__pycache__/__init__.cpython-310.pyc +0 -0
  26. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__pycache__/tf2xla_pb2.cpython-310.pyc +0 -0
  27. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/__init__.py +0 -0
  28. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/__pycache__/__init__.cpython-310.pyc +0 -0
  29. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/gen_xla_ops.py +0 -0
  30. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__init__.py +0 -0
  31. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__pycache__/__init__.cpython-310.pyc +0 -0
  32. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__pycache__/xla.cpython-310.pyc +0 -0
  33. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/xla.py +726 -0
  34. videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/tf2xla_pb2.py +36 -0
  35. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/__init__.py +0 -0
  36. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/__init__.cpython-310.pyc +0 -0
  37. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/xla_data_pb2.cpython-310.pyc +0 -0
  38. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__init__.py +0 -0
  39. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/__init__.cpython-310.pyc +0 -0
  40. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/hlo_pb2.cpython-310.pyc +0 -0
  41. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py +104 -0
  42. videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py +136 -0
  43. videochat2/lib/python3.10/site-packages/tensorflow/distribute/__init__.py +0 -0
  44. videochat2/lib/python3.10/site-packages/tensorflow/distribute/__pycache__/__init__.cpython-310.pyc +0 -0
  45. videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/__init__.py +0 -0
  46. videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/__pycache__/__init__.cpython-310.pyc +0 -0
  47. videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/__init__.py +0 -0
  48. videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/__pycache__/__init__.cpython-310.pyc +0 -0
  49. videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/__init__.py +0 -0
  50. videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/__pycache__/__init__.cpython-310.pyc +0 -0
llava_next/include/fakemysql.h ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fakemysql.h --
3
+ *
4
+ * Fake definitions of the MySQL API sufficient to build tdbc::mysql
5
+ * without having an MySQL installation on the build system. This file
6
+ * comprises only data type, constant and function definitions.
7
+ *
8
+ * The programmers of this file believe that it contains material not
9
+ * subject to copyright under the doctrines of scenes a faire and
10
+ * of merger of idea and expression. Accordingly, this file is in the
11
+ * public domain.
12
+ *
13
+ *-----------------------------------------------------------------------------
14
+ */
15
+
16
+ #ifndef FAKEMYSQL_H_INCLUDED
17
+ #define FAKEMYSQL_H_INCLUDED
18
+
19
+ #include <stddef.h>
20
+
21
+ #ifndef MODULE_SCOPE
22
+ #define MODULE_SCOPE extern
23
+ #endif
24
+
25
+ MODULE_SCOPE Tcl_LoadHandle MysqlInitStubs(Tcl_Interp*);
26
+
27
+ #ifdef _WIN32
28
+ #define STDCALL __stdcall
29
+ #else
30
+ #define STDCALL /* nothing */
31
+ #endif
32
+
33
+ enum enum_field_types {
34
+ MYSQL_TYPE_DECIMAL=0,
35
+ MYSQL_TYPE_TINY=1,
36
+ MYSQL_TYPE_SHORT=2,
37
+ MYSQL_TYPE_LONG=3,
38
+ MYSQL_TYPE_FLOAT=4,
39
+ MYSQL_TYPE_DOUBLE=5,
40
+ MYSQL_TYPE_NULL=6,
41
+ MYSQL_TYPE_TIMESTAMP=7,
42
+ MYSQL_TYPE_LONGLONG=8,
43
+ MYSQL_TYPE_INT24=9,
44
+ MYSQL_TYPE_DATE=10,
45
+ MYSQL_TYPE_TIME=11,
46
+ MYSQL_TYPE_DATETIME=12,
47
+ MYSQL_TYPE_YEAR=13,
48
+ MYSQL_TYPE_NEWDATE=14,
49
+ MYSQL_TYPE_VARCHAR=15,
50
+ MYSQL_TYPE_BIT=16,
51
+ MYSQL_TYPE_NEWDECIMAL=246,
52
+ MYSQL_TYPE_ENUM=247,
53
+ MYSQL_TYPE_SET=248,
54
+ MYSQL_TYPE_TINY_BLOB=249,
55
+ MYSQL_TYPE_MEDIUM_BLOB=250,
56
+ MYSQL_TYPE_LONG_BLOB=251,
57
+ MYSQL_TYPE_BLOB=252,
58
+ MYSQL_TYPE_VAR_STRING=253,
59
+ MYSQL_TYPE_STRING=254,
60
+ MYSQL_TYPE_GEOMETRY=255
61
+ };
62
+
63
+ enum mysql_option {
64
+ MYSQL_SET_CHARSET_NAME=7,
65
+ };
66
+
67
+ enum mysql_status {
68
+ MYSQL_STATUS_READY=0,
69
+ };
70
+
71
+ #define CLIENT_COMPRESS 32
72
+ #define CLIENT_INTERACTIVE 1024
73
+ #define MYSQL_DATA_TRUNCATED 101
74
+ #define MYSQL_ERRMSG_SIZE 512
75
+ #define MYSQL_NO_DATA 100
76
+ #define SCRAMBLE_LENGTH 20
77
+ #define SQLSTATE_LENGTH 5
78
+
79
+ typedef struct st_list LIST;
80
+ typedef struct st_mem_root MEM_ROOT;
81
+ typedef struct st_mysql MYSQL;
82
+ typedef struct st_mysql_bind MYSQL_BIND;
83
+ typedef struct st_mysql_field MYSQL_FIELD;
84
+ typedef struct st_mysql_res MYSQL_RES;
85
+ typedef char** MYSQL_ROW;
86
+ typedef struct st_mysql_stmt MYSQL_STMT;
87
+ typedef char my_bool;
88
+ #ifndef Socket_defined
89
+ typedef int my_socket;
90
+ #define INVALID_SOCKET -1
91
+ #endif
92
+ typedef Tcl_WideUInt my_ulonglong;
93
+ typedef struct st_net NET;
94
+ typedef struct st_used_mem USED_MEM;
95
+ typedef struct st_vio Vio;
96
+
97
+ struct st_mem_root {
98
+ USED_MEM *free;
99
+ USED_MEM *used;
100
+ USED_MEM *pre_alloc;
101
+ size_t min_malloc;
102
+ size_t block_size;
103
+ unsigned int block_num;
104
+ unsigned int first_block_usage;
105
+ void (*error_handler)(void);
106
+ };
107
+
108
+ struct st_mysql_options {
109
+ unsigned int connect_timeout;
110
+ unsigned int read_timeout;
111
+ unsigned int write_timeout;
112
+ unsigned int port;
113
+ unsigned int protocol;
114
+ unsigned long client_flag;
115
+ char *host;
116
+ char *user;
117
+ char *password;
118
+ char *unix_socket;
119
+ char *db;
120
+ struct st_dynamic_array *init_commands;
121
+ char *my_cnf_file;
122
+ char *my_cnf_group;
123
+ char *charset_dir;
124
+ char *charset_name;
125
+ char *ssl_key;
126
+ char *ssl_cert;
127
+ char *ssl_ca;
128
+ char *ssl_capath;
129
+ char *ssl_cipher;
130
+ char *shared_memory_base_name;
131
+ unsigned long max_allowed_packet;
132
+ my_bool use_ssl;
133
+ my_bool compress,named_pipe;
134
+ my_bool rpl_probe;
135
+ my_bool rpl_parse;
136
+ my_bool no_master_reads;
137
+ #if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
138
+ my_bool separate_thread;
139
+ #endif
140
+ enum mysql_option methods_to_use;
141
+ char *client_ip;
142
+ my_bool secure_auth;
143
+ my_bool report_data_truncation;
144
+ int (*local_infile_init)(void **, const char *, void *);
145
+ int (*local_infile_read)(void *, char *, unsigned int);
146
+ void (*local_infile_end)(void *);
147
+ int (*local_infile_error)(void *, char *, unsigned int);
148
+ void *local_infile_userdata;
149
+ void *extension;
150
+ };
151
+
152
+ struct st_net {
153
+ #if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
154
+ Vio *vio;
155
+ unsigned char *buff;
156
+ unsigned char *buff_end;
157
+ unsigned char *write_pos;
158
+ unsigned char *read_pos;
159
+ my_socket fd;
160
+ unsigned long remain_in_buf;
161
+ unsigned long length;
162
+ unsigned long buf_length;
163
+ unsigned long where_b;
164
+ unsigned long max_packet;
165
+ unsigned long max_packet_size;
166
+ unsigned int pkt_nr;
167
+ unsigned int compress_pkt_nr;
168
+ unsigned int write_timeout;
169
+ unsigned int read_timeout;
170
+ unsigned int retry_count;
171
+ int fcntl;
172
+ unsigned int *return_status;
173
+ unsigned char reading_or_writing;
174
+ char save_char;
175
+ my_bool unused0;
176
+ my_bool unused;
177
+ my_bool compress;
178
+ my_bool unused1;
179
+ #endif
180
+ unsigned char *query_cache_query;
181
+ unsigned int last_errno;
182
+ unsigned char error;
183
+ my_bool unused2;
184
+ my_bool return_errno;
185
+ char last_error[MYSQL_ERRMSG_SIZE];
186
+ char sqlstate[SQLSTATE_LENGTH+1];
187
+ void *extension;
188
+ #if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
189
+ my_bool skip_big_packet;
190
+ #endif
191
+ };
192
+
193
+ /*
194
+ * st_mysql differs between 5.0 and 5.1, but the 5.0 version is a
195
+ * strict subset, we don't use any of the 5.1 fields, and we don't
196
+ * ever allocate the structure ourselves.
197
+ */
198
+
199
+ struct st_mysql {
200
+ NET net;
201
+ unsigned char *connector_fd;
202
+ char *host;
203
+ char *user;
204
+ char *passwd;
205
+ char *unix_socket;
206
+ char *server_version;
207
+ char *host_info;
208
+ char *info;
209
+ char *db;
210
+ struct charset_info_st *charset;
211
+ MYSQL_FIELD *fields;
212
+ MEM_ROOT field_alloc;
213
+ my_ulonglong affected_rows;
214
+ my_ulonglong insert_id;
215
+ my_ulonglong extra_info;
216
+ unsigned long thread_id;
217
+ unsigned long packet_length;
218
+ unsigned int port;
219
+ unsigned long client_flag;
220
+ unsigned long server_capabilities;
221
+ unsigned int protocol_version;
222
+ unsigned int field_count;
223
+ unsigned int server_status;
224
+ unsigned int server_language;
225
+ unsigned int warning_count;
226
+ struct st_mysql_options options;
227
+ enum mysql_status status;
228
+ my_bool free_me;
229
+ my_bool reconnect;
230
+ char scramble[SCRAMBLE_LENGTH+1];
231
+ my_bool rpl_pivot;
232
+ struct st_mysql *master;
233
+ struct st_mysql *next_slave;
234
+ struct st_mysql* last_used_slave;
235
+ struct st_mysql* last_used_con;
236
+ LIST *stmts;
237
+ const struct st_mysql_methods *methods;
238
+ void *thd;
239
+ my_bool *unbuffered_fetch_owner;
240
+ char *info_buffer;
241
+ };
242
+
243
+ /*
244
+ * There are different version of the MYSQL_BIND structure before and after
245
+ * MySQL 5.1. We go after the fields of the structure using accessor functions
246
+ * so that the code in this file is compatible with both versions.
247
+ */
248
+
249
+ struct st_mysql_bind_51 { /* Post-5.1 */
250
+ unsigned long* length;
251
+ my_bool* is_null;
252
+ void* buffer;
253
+ my_bool* error;
254
+ unsigned char* row_ptr;
255
+ void (*store_param_func)(NET* net, MYSQL_BIND* param);
256
+ void (*fetch_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
257
+ void (*skip_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
258
+ unsigned long buffer_length;
259
+ unsigned long offset;
260
+ unsigned long length_value;
261
+ unsigned int param_number;
262
+ unsigned int pack_length;
263
+ enum enum_field_types buffer_type;
264
+ my_bool error_value;
265
+ my_bool is_unsigned;
266
+ my_bool long_data_used;
267
+ my_bool is_null_value;
268
+ void* extension;
269
+ };
270
+
271
+ struct st_mysql_bind_50 { /* Pre-5.1 */
272
+ unsigned long* length;
273
+ my_bool* is_null;
274
+ void* buffer;
275
+ my_bool* error;
276
+ enum enum_field_types buffer_type;
277
+ unsigned long buffer_length;
278
+ unsigned char* row_ptr;
279
+ unsigned long offset;
280
+ unsigned long length_value;
281
+ unsigned int param_number;
282
+ unsigned int pack_length;
283
+ my_bool error_value;
284
+ my_bool is_unsigned;
285
+ my_bool long_data_used;
286
+ my_bool is_null_value;
287
+ void (*store_param_func)(NET* net, MYSQL_BIND* param);
288
+ void (*fetch_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
289
+ void (*skip_result)(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**);
290
+ };
291
+
292
+ /*
293
+ * There are also different versions of the MYSQL_FIELD structure; fortunately,
294
+ * the 5.1 version is a strict extension of the 5.0 version.
295
+ */
296
+
297
+ struct st_mysql_field {
298
+ char* name;
299
+ char *org_name;
300
+ char* table;
301
+ char* org_table;
302
+ char* db;
303
+ char* catalog;
304
+ char* def;
305
+ unsigned long length;
306
+ unsigned long max_length;
307
+ unsigned int name_length;
308
+ unsigned int org_name_length;
309
+ unsigned int table_length;
310
+ unsigned int org_table_length;
311
+ unsigned int db_length;
312
+ unsigned int catalog_length;
313
+ unsigned int def_length;
314
+ unsigned int flags;
315
+ unsigned int decimals;
316
+ unsigned int charsetnr;
317
+ enum enum_field_types type;
318
+ };
319
+ struct st_mysql_field_50 {
320
+ struct st_mysql_field field;
321
+ };
322
+ struct st_mysql_field_51 {
323
+ struct st_mysql_field field;
324
+ void* extension;
325
+ };
326
+ #define NOT_NULL_FLAG 1
327
+
328
+ #define IS_NUM(t) ((t) <= MYSQL_TYPE_INT24 || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
329
+
330
+ #define mysql_library_init mysql_server_init
331
+ #define mysql_library_end mysql_server_end
332
+
333
+ #include "mysqlStubs.h"
334
+
335
+ #endif /* not FAKEMYSQL_H_INCLUDED */
llava_next/include/itclInt.h ADDED
@@ -0,0 +1,854 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"
llava_next/include/sqlite3.h ADDED
The diff for this file is too large to render. See raw diff
 
llava_next/include/tclOOIntDecls.h ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file is (mostly) automatically generated from tclOO.decls.
3
+ */
4
+
5
+ #ifndef _TCLOOINTDECLS
6
+ #define _TCLOOINTDECLS
7
+
8
+ /* !BEGIN!: Do not edit below this line. */
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ /*
15
+ * Exported function declarations:
16
+ */
17
+
18
+ /* 0 */
19
+ TCLAPI Tcl_Object TclOOGetDefineCmdContext(Tcl_Interp *interp);
20
+ /* 1 */
21
+ TCLAPI Tcl_Method TclOOMakeProcInstanceMethod(Tcl_Interp *interp,
22
+ Object *oPtr, int flags, Tcl_Obj *nameObj,
23
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
24
+ const Tcl_MethodType *typePtr,
25
+ void *clientData, Proc **procPtrPtr);
26
+ /* 2 */
27
+ TCLAPI Tcl_Method TclOOMakeProcMethod(Tcl_Interp *interp,
28
+ Class *clsPtr, int flags, Tcl_Obj *nameObj,
29
+ const char *namePtr, Tcl_Obj *argsObj,
30
+ Tcl_Obj *bodyObj,
31
+ const Tcl_MethodType *typePtr,
32
+ void *clientData, Proc **procPtrPtr);
33
+ /* 3 */
34
+ TCLAPI Method * TclOONewProcInstanceMethod(Tcl_Interp *interp,
35
+ Object *oPtr, int flags, Tcl_Obj *nameObj,
36
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
37
+ ProcedureMethod **pmPtrPtr);
38
+ /* 4 */
39
+ TCLAPI Method * TclOONewProcMethod(Tcl_Interp *interp, Class *clsPtr,
40
+ int flags, Tcl_Obj *nameObj,
41
+ Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
42
+ ProcedureMethod **pmPtrPtr);
43
+ /* 5 */
44
+ TCLAPI int TclOOObjectCmdCore(Object *oPtr, Tcl_Interp *interp,
45
+ int objc, Tcl_Obj *const *objv,
46
+ int publicOnly, Class *startCls);
47
+ /* 6 */
48
+ TCLAPI int TclOOIsReachable(Class *targetPtr, Class *startPtr);
49
+ /* 7 */
50
+ TCLAPI Method * TclOONewForwardMethod(Tcl_Interp *interp,
51
+ Class *clsPtr, int isPublic,
52
+ Tcl_Obj *nameObj, Tcl_Obj *prefixObj);
53
+ /* 8 */
54
+ TCLAPI Method * TclOONewForwardInstanceMethod(Tcl_Interp *interp,
55
+ Object *oPtr, int isPublic, Tcl_Obj *nameObj,
56
+ Tcl_Obj *prefixObj);
57
+ /* 9 */
58
+ TCLAPI Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp,
59
+ Tcl_Object oPtr,
60
+ TclOO_PreCallProc *preCallPtr,
61
+ TclOO_PostCallProc *postCallPtr,
62
+ ProcErrorProc *errProc, void *clientData,
63
+ Tcl_Obj *nameObj, Tcl_Obj *argsObj,
64
+ Tcl_Obj *bodyObj, int flags,
65
+ void **internalTokenPtr);
66
+ /* 10 */
67
+ TCLAPI Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp,
68
+ Tcl_Class clsPtr,
69
+ TclOO_PreCallProc *preCallPtr,
70
+ TclOO_PostCallProc *postCallPtr,
71
+ ProcErrorProc *errProc, void *clientData,
72
+ Tcl_Obj *nameObj, Tcl_Obj *argsObj,
73
+ Tcl_Obj *bodyObj, int flags,
74
+ void **internalTokenPtr);
75
+ /* 11 */
76
+ TCLAPI int TclOOInvokeObject(Tcl_Interp *interp,
77
+ Tcl_Object object, Tcl_Class startCls,
78
+ int publicPrivate, int objc,
79
+ Tcl_Obj *const *objv);
80
+ /* 12 */
81
+ TCLAPI void TclOOObjectSetFilters(Object *oPtr, int numFilters,
82
+ Tcl_Obj *const *filters);
83
+ /* 13 */
84
+ TCLAPI void TclOOClassSetFilters(Tcl_Interp *interp,
85
+ Class *classPtr, int numFilters,
86
+ Tcl_Obj *const *filters);
87
+ /* 14 */
88
+ TCLAPI void TclOOObjectSetMixins(Object *oPtr, int numMixins,
89
+ Class *const *mixins);
90
+ /* 15 */
91
+ TCLAPI void TclOOClassSetMixins(Tcl_Interp *interp,
92
+ Class *classPtr, int numMixins,
93
+ Class *const *mixins);
94
+
95
+ typedef struct TclOOIntStubs {
96
+ int magic;
97
+ void *hooks;
98
+
99
+ Tcl_Object (*tclOOGetDefineCmdContext) (Tcl_Interp *interp); /* 0 */
100
+ Tcl_Method (*tclOOMakeProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, void *clientData, Proc **procPtrPtr); /* 1 */
101
+ Tcl_Method (*tclOOMakeProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, const char *namePtr, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, const Tcl_MethodType *typePtr, void *clientData, Proc **procPtrPtr); /* 2 */
102
+ Method * (*tclOONewProcInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, ProcedureMethod **pmPtrPtr); /* 3 */
103
+ Method * (*tclOONewProcMethod) (Tcl_Interp *interp, Class *clsPtr, int flags, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, ProcedureMethod **pmPtrPtr); /* 4 */
104
+ int (*tclOOObjectCmdCore) (Object *oPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, int publicOnly, Class *startCls); /* 5 */
105
+ int (*tclOOIsReachable) (Class *targetPtr, Class *startPtr); /* 6 */
106
+ Method * (*tclOONewForwardMethod) (Tcl_Interp *interp, Class *clsPtr, int isPublic, Tcl_Obj *nameObj, Tcl_Obj *prefixObj); /* 7 */
107
+ Method * (*tclOONewForwardInstanceMethod) (Tcl_Interp *interp, Object *oPtr, int isPublic, Tcl_Obj *nameObj, Tcl_Obj *prefixObj); /* 8 */
108
+ Tcl_Method (*tclOONewProcInstanceMethodEx) (Tcl_Interp *interp, Tcl_Object oPtr, TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, void *clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 9 */
109
+ Tcl_Method (*tclOONewProcMethodEx) (Tcl_Interp *interp, Tcl_Class clsPtr, TclOO_PreCallProc *preCallPtr, TclOO_PostCallProc *postCallPtr, ProcErrorProc *errProc, void *clientData, Tcl_Obj *nameObj, Tcl_Obj *argsObj, Tcl_Obj *bodyObj, int flags, void **internalTokenPtr); /* 10 */
110
+ int (*tclOOInvokeObject) (Tcl_Interp *interp, Tcl_Object object, Tcl_Class startCls, int publicPrivate, int objc, Tcl_Obj *const *objv); /* 11 */
111
+ void (*tclOOObjectSetFilters) (Object *oPtr, int numFilters, Tcl_Obj *const *filters); /* 12 */
112
+ void (*tclOOClassSetFilters) (Tcl_Interp *interp, Class *classPtr, int numFilters, Tcl_Obj *const *filters); /* 13 */
113
+ void (*tclOOObjectSetMixins) (Object *oPtr, int numMixins, Class *const *mixins); /* 14 */
114
+ void (*tclOOClassSetMixins) (Tcl_Interp *interp, Class *classPtr, int numMixins, Class *const *mixins); /* 15 */
115
+ } TclOOIntStubs;
116
+
117
+ extern const TclOOIntStubs *tclOOIntStubsPtr;
118
+
119
+ #ifdef __cplusplus
120
+ }
121
+ #endif
122
+
123
+ #if defined(USE_TCLOO_STUBS)
124
+
125
+ /*
126
+ * Inline function declarations:
127
+ */
128
+
129
+ #define TclOOGetDefineCmdContext \
130
+ (tclOOIntStubsPtr->tclOOGetDefineCmdContext) /* 0 */
131
+ #define TclOOMakeProcInstanceMethod \
132
+ (tclOOIntStubsPtr->tclOOMakeProcInstanceMethod) /* 1 */
133
+ #define TclOOMakeProcMethod \
134
+ (tclOOIntStubsPtr->tclOOMakeProcMethod) /* 2 */
135
+ #define TclOONewProcInstanceMethod \
136
+ (tclOOIntStubsPtr->tclOONewProcInstanceMethod) /* 3 */
137
+ #define TclOONewProcMethod \
138
+ (tclOOIntStubsPtr->tclOONewProcMethod) /* 4 */
139
+ #define TclOOObjectCmdCore \
140
+ (tclOOIntStubsPtr->tclOOObjectCmdCore) /* 5 */
141
+ #define TclOOIsReachable \
142
+ (tclOOIntStubsPtr->tclOOIsReachable) /* 6 */
143
+ #define TclOONewForwardMethod \
144
+ (tclOOIntStubsPtr->tclOONewForwardMethod) /* 7 */
145
+ #define TclOONewForwardInstanceMethod \
146
+ (tclOOIntStubsPtr->tclOONewForwardInstanceMethod) /* 8 */
147
+ #define TclOONewProcInstanceMethodEx \
148
+ (tclOOIntStubsPtr->tclOONewProcInstanceMethodEx) /* 9 */
149
+ #define TclOONewProcMethodEx \
150
+ (tclOOIntStubsPtr->tclOONewProcMethodEx) /* 10 */
151
+ #define TclOOInvokeObject \
152
+ (tclOOIntStubsPtr->tclOOInvokeObject) /* 11 */
153
+ #define TclOOObjectSetFilters \
154
+ (tclOOIntStubsPtr->tclOOObjectSetFilters) /* 12 */
155
+ #define TclOOClassSetFilters \
156
+ (tclOOIntStubsPtr->tclOOClassSetFilters) /* 13 */
157
+ #define TclOOObjectSetMixins \
158
+ (tclOOIntStubsPtr->tclOOObjectSetMixins) /* 14 */
159
+ #define TclOOClassSetMixins \
160
+ (tclOOIntStubsPtr->tclOOClassSetMixins) /* 15 */
161
+
162
+ #endif /* defined(USE_TCLOO_STUBS) */
163
+
164
+ /* !END!: Do not edit above this line. */
165
+
166
+ #endif /* _TCLOOINTDECLS */
llava_next/include/term.h ADDED
@@ -0,0 +1,893 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /****************************************************************************
2
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
3
+ * Copyright 1998-2013,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 1995-on */
34
+ /****************************************************************************/
35
+
36
+ /* $Id: MKterm.h.awk.in,v 1.82 2021/09/24 17:02:46 tom Exp $ */
37
+
38
+ /*
39
+ ** term.h -- Definition of struct term
40
+ */
41
+
42
+ #ifndef NCURSES_TERM_H_incl
43
+ #define NCURSES_TERM_H_incl 1
44
+
45
+ #undef NCURSES_VERSION
46
+ #define NCURSES_VERSION "6.4"
47
+
48
+ #include <ncursesw/ncurses_dll.h>
49
+
50
+ #ifdef __cplusplus
51
+ extern "C" {
52
+ #endif
53
+
54
+ /* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H
55
+ * definition (based on the system for which this was configured).
56
+ */
57
+
58
+ #ifndef __NCURSES_H
59
+
60
+ typedef struct screen SCREEN;
61
+
62
+ #if 1
63
+ #undef NCURSES_SP_FUNCS
64
+ #define NCURSES_SP_FUNCS 20221231
65
+ #undef NCURSES_SP_NAME
66
+ #define NCURSES_SP_NAME(name) name##_sp
67
+
68
+ /* Define the sp-funcs helper function */
69
+ #undef NCURSES_SP_OUTC
70
+ #define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)
71
+ typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);
72
+ #endif
73
+
74
+ #endif /* __NCURSES_H */
75
+
76
+ #undef NCURSES_CONST
77
+ #define NCURSES_CONST const
78
+
79
+ #undef NCURSES_SBOOL
80
+ #define NCURSES_SBOOL char
81
+
82
+ #undef NCURSES_USE_DATABASE
83
+ #define NCURSES_USE_DATABASE 1
84
+
85
+ #undef NCURSES_USE_TERMCAP
86
+ #define NCURSES_USE_TERMCAP 1
87
+
88
+ #undef NCURSES_XNAMES
89
+ #define NCURSES_XNAMES 1
90
+
91
+ /* We will use these symbols to hide differences between
92
+ * termios/termio/sgttyb interfaces.
93
+ */
94
+ #undef TTY
95
+ #undef SET_TTY
96
+ #undef GET_TTY
97
+
98
+ /* Assume POSIX termio if we have the header and function */
99
+ /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */
100
+ #if 1 && 1
101
+
102
+ #undef TERMIOS
103
+ #define TERMIOS 1
104
+
105
+ #include <termios.h>
106
+ #define TTY struct termios
107
+
108
+ #else /* !HAVE_TERMIOS_H */
109
+
110
+ /* #if HAVE_TERMIO_H */
111
+ #if 1
112
+
113
+ #undef TERMIOS
114
+ #define TERMIOS 1
115
+
116
+ #include <termio.h>
117
+ #define TTY struct termio
118
+
119
+ #else /* !HAVE_TERMIO_H */
120
+
121
+ #if (defined(_WIN32) || defined(_WIN64))
122
+ #if 0
123
+ #include <ncursesw/win32_curses.h>
124
+ #define TTY struct winconmode
125
+ #else
126
+ #include <ncursesw/ncurses_mingw.h>
127
+ #define TTY struct termios
128
+ #endif
129
+ #else
130
+ #undef TERMIOS
131
+ #include <sgtty.h>
132
+ #include <sys/ioctl.h>
133
+ #define TTY struct sgttyb
134
+ #endif /* MINGW32 */
135
+ #endif /* HAVE_TERMIO_H */
136
+
137
+ #endif /* HAVE_TERMIOS_H */
138
+
139
+ #ifdef TERMIOS
140
+ #define GET_TTY(fd, buf) tcgetattr(fd, buf)
141
+ #define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
142
+ #elif 0 && (defined(_WIN32) || defined(_WIN64))
143
+ #define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)
144
+ #define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)
145
+ #else
146
+ #define GET_TTY(fd, buf) gtty(fd, buf)
147
+ #define SET_TTY(fd, buf) stty(fd, buf)
148
+ #endif
149
+
150
+ #ifndef GCC_NORETURN
151
+ #define GCC_NORETURN /* nothing */
152
+ #endif
153
+
154
+ #define NAMESIZE 256
155
+
156
+ /* The cast works because TERMTYPE is the first data in TERMINAL */
157
+ #define CUR ((TERMTYPE *)(cur_term))->
158
+
159
+ #define auto_left_margin CUR Booleans[0]
160
+ #define auto_right_margin CUR Booleans[1]
161
+ #define no_esc_ctlc CUR Booleans[2]
162
+ #define ceol_standout_glitch CUR Booleans[3]
163
+ #define eat_newline_glitch CUR Booleans[4]
164
+ #define erase_overstrike CUR Booleans[5]
165
+ #define generic_type CUR Booleans[6]
166
+ #define hard_copy CUR Booleans[7]
167
+ #define has_meta_key CUR Booleans[8]
168
+ #define has_status_line CUR Booleans[9]
169
+ #define insert_null_glitch CUR Booleans[10]
170
+ #define memory_above CUR Booleans[11]
171
+ #define memory_below CUR Booleans[12]
172
+ #define move_insert_mode CUR Booleans[13]
173
+ #define move_standout_mode CUR Booleans[14]
174
+ #define over_strike CUR Booleans[15]
175
+ #define status_line_esc_ok CUR Booleans[16]
176
+ #define dest_tabs_magic_smso CUR Booleans[17]
177
+ #define tilde_glitch CUR Booleans[18]
178
+ #define transparent_underline CUR Booleans[19]
179
+ #define xon_xoff CUR Booleans[20]
180
+ #define needs_xon_xoff CUR Booleans[21]
181
+ #define prtr_silent CUR Booleans[22]
182
+ #define hard_cursor CUR Booleans[23]
183
+ #define non_rev_rmcup CUR Booleans[24]
184
+ #define no_pad_char CUR Booleans[25]
185
+ #define non_dest_scroll_region CUR Booleans[26]
186
+ #define can_change CUR Booleans[27]
187
+ #define back_color_erase CUR Booleans[28]
188
+ #define hue_lightness_saturation CUR Booleans[29]
189
+ #define col_addr_glitch CUR Booleans[30]
190
+ #define cr_cancels_micro_mode CUR Booleans[31]
191
+ #define has_print_wheel CUR Booleans[32]
192
+ #define row_addr_glitch CUR Booleans[33]
193
+ #define semi_auto_right_margin CUR Booleans[34]
194
+ #define cpi_changes_res CUR Booleans[35]
195
+ #define lpi_changes_res CUR Booleans[36]
196
+ #define columns CUR Numbers[0]
197
+ #define init_tabs CUR Numbers[1]
198
+ #define lines CUR Numbers[2]
199
+ #define lines_of_memory CUR Numbers[3]
200
+ #define magic_cookie_glitch CUR Numbers[4]
201
+ #define padding_baud_rate CUR Numbers[5]
202
+ #define virtual_terminal CUR Numbers[6]
203
+ #define width_status_line CUR Numbers[7]
204
+ #define num_labels CUR Numbers[8]
205
+ #define label_height CUR Numbers[9]
206
+ #define label_width CUR Numbers[10]
207
+ #define max_attributes CUR Numbers[11]
208
+ #define maximum_windows CUR Numbers[12]
209
+ #define max_colors CUR Numbers[13]
210
+ #define max_pairs CUR Numbers[14]
211
+ #define no_color_video CUR Numbers[15]
212
+ #define buffer_capacity CUR Numbers[16]
213
+ #define dot_vert_spacing CUR Numbers[17]
214
+ #define dot_horz_spacing CUR Numbers[18]
215
+ #define max_micro_address CUR Numbers[19]
216
+ #define max_micro_jump CUR Numbers[20]
217
+ #define micro_col_size CUR Numbers[21]
218
+ #define micro_line_size CUR Numbers[22]
219
+ #define number_of_pins CUR Numbers[23]
220
+ #define output_res_char CUR Numbers[24]
221
+ #define output_res_line CUR Numbers[25]
222
+ #define output_res_horz_inch CUR Numbers[26]
223
+ #define output_res_vert_inch CUR Numbers[27]
224
+ #define print_rate CUR Numbers[28]
225
+ #define wide_char_size CUR Numbers[29]
226
+ #define buttons CUR Numbers[30]
227
+ #define bit_image_entwining CUR Numbers[31]
228
+ #define bit_image_type CUR Numbers[32]
229
+ #define back_tab CUR Strings[0]
230
+ #define bell CUR Strings[1]
231
+ #define carriage_return CUR Strings[2]
232
+ #define change_scroll_region CUR Strings[3]
233
+ #define clear_all_tabs CUR Strings[4]
234
+ #define clear_screen CUR Strings[5]
235
+ #define clr_eol CUR Strings[6]
236
+ #define clr_eos CUR Strings[7]
237
+ #define column_address CUR Strings[8]
238
+ #define command_character CUR Strings[9]
239
+ #define cursor_address CUR Strings[10]
240
+ #define cursor_down CUR Strings[11]
241
+ #define cursor_home CUR Strings[12]
242
+ #define cursor_invisible CUR Strings[13]
243
+ #define cursor_left CUR Strings[14]
244
+ #define cursor_mem_address CUR Strings[15]
245
+ #define cursor_normal CUR Strings[16]
246
+ #define cursor_right CUR Strings[17]
247
+ #define cursor_to_ll CUR Strings[18]
248
+ #define cursor_up CUR Strings[19]
249
+ #define cursor_visible CUR Strings[20]
250
+ #define delete_character CUR Strings[21]
251
+ #define delete_line CUR Strings[22]
252
+ #define dis_status_line CUR Strings[23]
253
+ #define down_half_line CUR Strings[24]
254
+ #define enter_alt_charset_mode CUR Strings[25]
255
+ #define enter_blink_mode CUR Strings[26]
256
+ #define enter_bold_mode CUR Strings[27]
257
+ #define enter_ca_mode CUR Strings[28]
258
+ #define enter_delete_mode CUR Strings[29]
259
+ #define enter_dim_mode CUR Strings[30]
260
+ #define enter_insert_mode CUR Strings[31]
261
+ #define enter_secure_mode CUR Strings[32]
262
+ #define enter_protected_mode CUR Strings[33]
263
+ #define enter_reverse_mode CUR Strings[34]
264
+ #define enter_standout_mode CUR Strings[35]
265
+ #define enter_underline_mode CUR Strings[36]
266
+ #define erase_chars CUR Strings[37]
267
+ #define exit_alt_charset_mode CUR Strings[38]
268
+ #define exit_attribute_mode CUR Strings[39]
269
+ #define exit_ca_mode CUR Strings[40]
270
+ #define exit_delete_mode CUR Strings[41]
271
+ #define exit_insert_mode CUR Strings[42]
272
+ #define exit_standout_mode CUR Strings[43]
273
+ #define exit_underline_mode CUR Strings[44]
274
+ #define flash_screen CUR Strings[45]
275
+ #define form_feed CUR Strings[46]
276
+ #define from_status_line CUR Strings[47]
277
+ #define init_1string CUR Strings[48]
278
+ #define init_2string CUR Strings[49]
279
+ #define init_3string CUR Strings[50]
280
+ #define init_file CUR Strings[51]
281
+ #define insert_character CUR Strings[52]
282
+ #define insert_line CUR Strings[53]
283
+ #define insert_padding CUR Strings[54]
284
+ #define key_backspace CUR Strings[55]
285
+ #define key_catab CUR Strings[56]
286
+ #define key_clear CUR Strings[57]
287
+ #define key_ctab CUR Strings[58]
288
+ #define key_dc CUR Strings[59]
289
+ #define key_dl CUR Strings[60]
290
+ #define key_down CUR Strings[61]
291
+ #define key_eic CUR Strings[62]
292
+ #define key_eol CUR Strings[63]
293
+ #define key_eos CUR Strings[64]
294
+ #define key_f0 CUR Strings[65]
295
+ #define key_f1 CUR Strings[66]
296
+ #define key_f10 CUR Strings[67]
297
+ #define key_f2 CUR Strings[68]
298
+ #define key_f3 CUR Strings[69]
299
+ #define key_f4 CUR Strings[70]
300
+ #define key_f5 CUR Strings[71]
301
+ #define key_f6 CUR Strings[72]
302
+ #define key_f7 CUR Strings[73]
303
+ #define key_f8 CUR Strings[74]
304
+ #define key_f9 CUR Strings[75]
305
+ #define key_home CUR Strings[76]
306
+ #define key_ic CUR Strings[77]
307
+ #define key_il CUR Strings[78]
308
+ #define key_left CUR Strings[79]
309
+ #define key_ll CUR Strings[80]
310
+ #define key_npage CUR Strings[81]
311
+ #define key_ppage CUR Strings[82]
312
+ #define key_right CUR Strings[83]
313
+ #define key_sf CUR Strings[84]
314
+ #define key_sr CUR Strings[85]
315
+ #define key_stab CUR Strings[86]
316
+ #define key_up CUR Strings[87]
317
+ #define keypad_local CUR Strings[88]
318
+ #define keypad_xmit CUR Strings[89]
319
+ #define lab_f0 CUR Strings[90]
320
+ #define lab_f1 CUR Strings[91]
321
+ #define lab_f10 CUR Strings[92]
322
+ #define lab_f2 CUR Strings[93]
323
+ #define lab_f3 CUR Strings[94]
324
+ #define lab_f4 CUR Strings[95]
325
+ #define lab_f5 CUR Strings[96]
326
+ #define lab_f6 CUR Strings[97]
327
+ #define lab_f7 CUR Strings[98]
328
+ #define lab_f8 CUR Strings[99]
329
+ #define lab_f9 CUR Strings[100]
330
+ #define meta_off CUR Strings[101]
331
+ #define meta_on CUR Strings[102]
332
+ #define newline CUR Strings[103]
333
+ #define pad_char CUR Strings[104]
334
+ #define parm_dch CUR Strings[105]
335
+ #define parm_delete_line CUR Strings[106]
336
+ #define parm_down_cursor CUR Strings[107]
337
+ #define parm_ich CUR Strings[108]
338
+ #define parm_index CUR Strings[109]
339
+ #define parm_insert_line CUR Strings[110]
340
+ #define parm_left_cursor CUR Strings[111]
341
+ #define parm_right_cursor CUR Strings[112]
342
+ #define parm_rindex CUR Strings[113]
343
+ #define parm_up_cursor CUR Strings[114]
344
+ #define pkey_key CUR Strings[115]
345
+ #define pkey_local CUR Strings[116]
346
+ #define pkey_xmit CUR Strings[117]
347
+ #define print_screen CUR Strings[118]
348
+ #define prtr_off CUR Strings[119]
349
+ #define prtr_on CUR Strings[120]
350
+ #define repeat_char CUR Strings[121]
351
+ #define reset_1string CUR Strings[122]
352
+ #define reset_2string CUR Strings[123]
353
+ #define reset_3string CUR Strings[124]
354
+ #define reset_file CUR Strings[125]
355
+ #define restore_cursor CUR Strings[126]
356
+ #define row_address CUR Strings[127]
357
+ #define save_cursor CUR Strings[128]
358
+ #define scroll_forward CUR Strings[129]
359
+ #define scroll_reverse CUR Strings[130]
360
+ #define set_attributes CUR Strings[131]
361
+ #define set_tab CUR Strings[132]
362
+ #define set_window CUR Strings[133]
363
+ #define tab CUR Strings[134]
364
+ #define to_status_line CUR Strings[135]
365
+ #define underline_char CUR Strings[136]
366
+ #define up_half_line CUR Strings[137]
367
+ #define init_prog CUR Strings[138]
368
+ #define key_a1 CUR Strings[139]
369
+ #define key_a3 CUR Strings[140]
370
+ #define key_b2 CUR Strings[141]
371
+ #define key_c1 CUR Strings[142]
372
+ #define key_c3 CUR Strings[143]
373
+ #define prtr_non CUR Strings[144]
374
+ #define char_padding CUR Strings[145]
375
+ #define acs_chars CUR Strings[146]
376
+ #define plab_norm CUR Strings[147]
377
+ #define key_btab CUR Strings[148]
378
+ #define enter_xon_mode CUR Strings[149]
379
+ #define exit_xon_mode CUR Strings[150]
380
+ #define enter_am_mode CUR Strings[151]
381
+ #define exit_am_mode CUR Strings[152]
382
+ #define xon_character CUR Strings[153]
383
+ #define xoff_character CUR Strings[154]
384
+ #define ena_acs CUR Strings[155]
385
+ #define label_on CUR Strings[156]
386
+ #define label_off CUR Strings[157]
387
+ #define key_beg CUR Strings[158]
388
+ #define key_cancel CUR Strings[159]
389
+ #define key_close CUR Strings[160]
390
+ #define key_command CUR Strings[161]
391
+ #define key_copy CUR Strings[162]
392
+ #define key_create CUR Strings[163]
393
+ #define key_end CUR Strings[164]
394
+ #define key_enter CUR Strings[165]
395
+ #define key_exit CUR Strings[166]
396
+ #define key_find CUR Strings[167]
397
+ #define key_help CUR Strings[168]
398
+ #define key_mark CUR Strings[169]
399
+ #define key_message CUR Strings[170]
400
+ #define key_move CUR Strings[171]
401
+ #define key_next CUR Strings[172]
402
+ #define key_open CUR Strings[173]
403
+ #define key_options CUR Strings[174]
404
+ #define key_previous CUR Strings[175]
405
+ #define key_print CUR Strings[176]
406
+ #define key_redo CUR Strings[177]
407
+ #define key_reference CUR Strings[178]
408
+ #define key_refresh CUR Strings[179]
409
+ #define key_replace CUR Strings[180]
410
+ #define key_restart CUR Strings[181]
411
+ #define key_resume CUR Strings[182]
412
+ #define key_save CUR Strings[183]
413
+ #define key_suspend CUR Strings[184]
414
+ #define key_undo CUR Strings[185]
415
+ #define key_sbeg CUR Strings[186]
416
+ #define key_scancel CUR Strings[187]
417
+ #define key_scommand CUR Strings[188]
418
+ #define key_scopy CUR Strings[189]
419
+ #define key_screate CUR Strings[190]
420
+ #define key_sdc CUR Strings[191]
421
+ #define key_sdl CUR Strings[192]
422
+ #define key_select CUR Strings[193]
423
+ #define key_send CUR Strings[194]
424
+ #define key_seol CUR Strings[195]
425
+ #define key_sexit CUR Strings[196]
426
+ #define key_sfind CUR Strings[197]
427
+ #define key_shelp CUR Strings[198]
428
+ #define key_shome CUR Strings[199]
429
+ #define key_sic CUR Strings[200]
430
+ #define key_sleft CUR Strings[201]
431
+ #define key_smessage CUR Strings[202]
432
+ #define key_smove CUR Strings[203]
433
+ #define key_snext CUR Strings[204]
434
+ #define key_soptions CUR Strings[205]
435
+ #define key_sprevious CUR Strings[206]
436
+ #define key_sprint CUR Strings[207]
437
+ #define key_sredo CUR Strings[208]
438
+ #define key_sreplace CUR Strings[209]
439
+ #define key_sright CUR Strings[210]
440
+ #define key_srsume CUR Strings[211]
441
+ #define key_ssave CUR Strings[212]
442
+ #define key_ssuspend CUR Strings[213]
443
+ #define key_sundo CUR Strings[214]
444
+ #define req_for_input CUR Strings[215]
445
+ #define key_f11 CUR Strings[216]
446
+ #define key_f12 CUR Strings[217]
447
+ #define key_f13 CUR Strings[218]
448
+ #define key_f14 CUR Strings[219]
449
+ #define key_f15 CUR Strings[220]
450
+ #define key_f16 CUR Strings[221]
451
+ #define key_f17 CUR Strings[222]
452
+ #define key_f18 CUR Strings[223]
453
+ #define key_f19 CUR Strings[224]
454
+ #define key_f20 CUR Strings[225]
455
+ #define key_f21 CUR Strings[226]
456
+ #define key_f22 CUR Strings[227]
457
+ #define key_f23 CUR Strings[228]
458
+ #define key_f24 CUR Strings[229]
459
+ #define key_f25 CUR Strings[230]
460
+ #define key_f26 CUR Strings[231]
461
+ #define key_f27 CUR Strings[232]
462
+ #define key_f28 CUR Strings[233]
463
+ #define key_f29 CUR Strings[234]
464
+ #define key_f30 CUR Strings[235]
465
+ #define key_f31 CUR Strings[236]
466
+ #define key_f32 CUR Strings[237]
467
+ #define key_f33 CUR Strings[238]
468
+ #define key_f34 CUR Strings[239]
469
+ #define key_f35 CUR Strings[240]
470
+ #define key_f36 CUR Strings[241]
471
+ #define key_f37 CUR Strings[242]
472
+ #define key_f38 CUR Strings[243]
473
+ #define key_f39 CUR Strings[244]
474
+ #define key_f40 CUR Strings[245]
475
+ #define key_f41 CUR Strings[246]
476
+ #define key_f42 CUR Strings[247]
477
+ #define key_f43 CUR Strings[248]
478
+ #define key_f44 CUR Strings[249]
479
+ #define key_f45 CUR Strings[250]
480
+ #define key_f46 CUR Strings[251]
481
+ #define key_f47 CUR Strings[252]
482
+ #define key_f48 CUR Strings[253]
483
+ #define key_f49 CUR Strings[254]
484
+ #define key_f50 CUR Strings[255]
485
+ #define key_f51 CUR Strings[256]
486
+ #define key_f52 CUR Strings[257]
487
+ #define key_f53 CUR Strings[258]
488
+ #define key_f54 CUR Strings[259]
489
+ #define key_f55 CUR Strings[260]
490
+ #define key_f56 CUR Strings[261]
491
+ #define key_f57 CUR Strings[262]
492
+ #define key_f58 CUR Strings[263]
493
+ #define key_f59 CUR Strings[264]
494
+ #define key_f60 CUR Strings[265]
495
+ #define key_f61 CUR Strings[266]
496
+ #define key_f62 CUR Strings[267]
497
+ #define key_f63 CUR Strings[268]
498
+ #define clr_bol CUR Strings[269]
499
+ #define clear_margins CUR Strings[270]
500
+ #define set_left_margin CUR Strings[271]
501
+ #define set_right_margin CUR Strings[272]
502
+ #define label_format CUR Strings[273]
503
+ #define set_clock CUR Strings[274]
504
+ #define display_clock CUR Strings[275]
505
+ #define remove_clock CUR Strings[276]
506
+ #define create_window CUR Strings[277]
507
+ #define goto_window CUR Strings[278]
508
+ #define hangup CUR Strings[279]
509
+ #define dial_phone CUR Strings[280]
510
+ #define quick_dial CUR Strings[281]
511
+ #define tone CUR Strings[282]
512
+ #define pulse CUR Strings[283]
513
+ #define flash_hook CUR Strings[284]
514
+ #define fixed_pause CUR Strings[285]
515
+ #define wait_tone CUR Strings[286]
516
+ #define user0 CUR Strings[287]
517
+ #define user1 CUR Strings[288]
518
+ #define user2 CUR Strings[289]
519
+ #define user3 CUR Strings[290]
520
+ #define user4 CUR Strings[291]
521
+ #define user5 CUR Strings[292]
522
+ #define user6 CUR Strings[293]
523
+ #define user7 CUR Strings[294]
524
+ #define user8 CUR Strings[295]
525
+ #define user9 CUR Strings[296]
526
+ #define orig_pair CUR Strings[297]
527
+ #define orig_colors CUR Strings[298]
528
+ #define initialize_color CUR Strings[299]
529
+ #define initialize_pair CUR Strings[300]
530
+ #define set_color_pair CUR Strings[301]
531
+ #define set_foreground CUR Strings[302]
532
+ #define set_background CUR Strings[303]
533
+ #define change_char_pitch CUR Strings[304]
534
+ #define change_line_pitch CUR Strings[305]
535
+ #define change_res_horz CUR Strings[306]
536
+ #define change_res_vert CUR Strings[307]
537
+ #define define_char CUR Strings[308]
538
+ #define enter_doublewide_mode CUR Strings[309]
539
+ #define enter_draft_quality CUR Strings[310]
540
+ #define enter_italics_mode CUR Strings[311]
541
+ #define enter_leftward_mode CUR Strings[312]
542
+ #define enter_micro_mode CUR Strings[313]
543
+ #define enter_near_letter_quality CUR Strings[314]
544
+ #define enter_normal_quality CUR Strings[315]
545
+ #define enter_shadow_mode CUR Strings[316]
546
+ #define enter_subscript_mode CUR Strings[317]
547
+ #define enter_superscript_mode CUR Strings[318]
548
+ #define enter_upward_mode CUR Strings[319]
549
+ #define exit_doublewide_mode CUR Strings[320]
550
+ #define exit_italics_mode CUR Strings[321]
551
+ #define exit_leftward_mode CUR Strings[322]
552
+ #define exit_micro_mode CUR Strings[323]
553
+ #define exit_shadow_mode CUR Strings[324]
554
+ #define exit_subscript_mode CUR Strings[325]
555
+ #define exit_superscript_mode CUR Strings[326]
556
+ #define exit_upward_mode CUR Strings[327]
557
+ #define micro_column_address CUR Strings[328]
558
+ #define micro_down CUR Strings[329]
559
+ #define micro_left CUR Strings[330]
560
+ #define micro_right CUR Strings[331]
561
+ #define micro_row_address CUR Strings[332]
562
+ #define micro_up CUR Strings[333]
563
+ #define order_of_pins CUR Strings[334]
564
+ #define parm_down_micro CUR Strings[335]
565
+ #define parm_left_micro CUR Strings[336]
566
+ #define parm_right_micro CUR Strings[337]
567
+ #define parm_up_micro CUR Strings[338]
568
+ #define select_char_set CUR Strings[339]
569
+ #define set_bottom_margin CUR Strings[340]
570
+ #define set_bottom_margin_parm CUR Strings[341]
571
+ #define set_left_margin_parm CUR Strings[342]
572
+ #define set_right_margin_parm CUR Strings[343]
573
+ #define set_top_margin CUR Strings[344]
574
+ #define set_top_margin_parm CUR Strings[345]
575
+ #define start_bit_image CUR Strings[346]
576
+ #define start_char_set_def CUR Strings[347]
577
+ #define stop_bit_image CUR Strings[348]
578
+ #define stop_char_set_def CUR Strings[349]
579
+ #define subscript_characters CUR Strings[350]
580
+ #define superscript_characters CUR Strings[351]
581
+ #define these_cause_cr CUR Strings[352]
582
+ #define zero_motion CUR Strings[353]
583
+ #define char_set_names CUR Strings[354]
584
+ #define key_mouse CUR Strings[355]
585
+ #define mouse_info CUR Strings[356]
586
+ #define req_mouse_pos CUR Strings[357]
587
+ #define get_mouse CUR Strings[358]
588
+ #define set_a_foreground CUR Strings[359]
589
+ #define set_a_background CUR Strings[360]
590
+ #define pkey_plab CUR Strings[361]
591
+ #define device_type CUR Strings[362]
592
+ #define code_set_init CUR Strings[363]
593
+ #define set0_des_seq CUR Strings[364]
594
+ #define set1_des_seq CUR Strings[365]
595
+ #define set2_des_seq CUR Strings[366]
596
+ #define set3_des_seq CUR Strings[367]
597
+ #define set_lr_margin CUR Strings[368]
598
+ #define set_tb_margin CUR Strings[369]
599
+ #define bit_image_repeat CUR Strings[370]
600
+ #define bit_image_newline CUR Strings[371]
601
+ #define bit_image_carriage_return CUR Strings[372]
602
+ #define color_names CUR Strings[373]
603
+ #define define_bit_image_region CUR Strings[374]
604
+ #define end_bit_image_region CUR Strings[375]
605
+ #define set_color_band CUR Strings[376]
606
+ #define set_page_length CUR Strings[377]
607
+ #define display_pc_char CUR Strings[378]
608
+ #define enter_pc_charset_mode CUR Strings[379]
609
+ #define exit_pc_charset_mode CUR Strings[380]
610
+ #define enter_scancode_mode CUR Strings[381]
611
+ #define exit_scancode_mode CUR Strings[382]
612
+ #define pc_term_options CUR Strings[383]
613
+ #define scancode_escape CUR Strings[384]
614
+ #define alt_scancode_esc CUR Strings[385]
615
+ #define enter_horizontal_hl_mode CUR Strings[386]
616
+ #define enter_left_hl_mode CUR Strings[387]
617
+ #define enter_low_hl_mode CUR Strings[388]
618
+ #define enter_right_hl_mode CUR Strings[389]
619
+ #define enter_top_hl_mode CUR Strings[390]
620
+ #define enter_vertical_hl_mode CUR Strings[391]
621
+ #define set_a_attributes CUR Strings[392]
622
+ #define set_pglen_inch CUR Strings[393]
623
+
624
+ #define BOOLWRITE 37
625
+ #define NUMWRITE 33
626
+ #define STRWRITE 394
627
+
628
+ /* older synonyms for some capabilities */
629
+ #define beehive_glitch no_esc_ctlc
630
+ #define teleray_glitch dest_tabs_magic_smso
631
+
632
+ /* HPUX-11 uses this name rather than the standard one */
633
+ #ifndef micro_char_size
634
+ #define micro_char_size micro_col_size
635
+ #endif
636
+
637
+ #ifdef __INTERNAL_CAPS_VISIBLE
638
+ #define termcap_init2 CUR Strings[394]
639
+ #define termcap_reset CUR Strings[395]
640
+ #define magic_cookie_glitch_ul CUR Numbers[33]
641
+ #define backspaces_with_bs CUR Booleans[37]
642
+ #define crt_no_scrolling CUR Booleans[38]
643
+ #define no_correctly_working_cr CUR Booleans[39]
644
+ #define carriage_return_delay CUR Numbers[34]
645
+ #define new_line_delay CUR Numbers[35]
646
+ #define linefeed_if_not_lf CUR Strings[396]
647
+ #define backspace_if_not_bs CUR Strings[397]
648
+ #define gnu_has_meta_key CUR Booleans[40]
649
+ #define linefeed_is_newline CUR Booleans[41]
650
+ #define backspace_delay CUR Numbers[36]
651
+ #define horizontal_tab_delay CUR Numbers[37]
652
+ #define number_of_function_keys CUR Numbers[38]
653
+ #define other_non_function_keys CUR Strings[398]
654
+ #define arrow_key_map CUR Strings[399]
655
+ #define has_hardware_tabs CUR Booleans[42]
656
+ #define return_does_clr_eol CUR Booleans[43]
657
+ #define acs_ulcorner CUR Strings[400]
658
+ #define acs_llcorner CUR Strings[401]
659
+ #define acs_urcorner CUR Strings[402]
660
+ #define acs_lrcorner CUR Strings[403]
661
+ #define acs_ltee CUR Strings[404]
662
+ #define acs_rtee CUR Strings[405]
663
+ #define acs_btee CUR Strings[406]
664
+ #define acs_ttee CUR Strings[407]
665
+ #define acs_hline CUR Strings[408]
666
+ #define acs_vline CUR Strings[409]
667
+ #define acs_plus CUR Strings[410]
668
+ #define memory_lock CUR Strings[411]
669
+ #define memory_unlock CUR Strings[412]
670
+ #define box_chars_1 CUR Strings[413]
671
+ #endif /* __INTERNAL_CAPS_VISIBLE */
672
+
673
+
674
+ /*
675
+ * Predefined terminfo array sizes
676
+ */
677
+ #define BOOLCOUNT 44
678
+ #define NUMCOUNT 39
679
+ #define STRCOUNT 414
680
+
681
+ /* used by code for comparing entries */
682
+ #define acs_chars_index 146
683
+
684
+ typedef struct termtype { /* in-core form of terminfo data */
685
+ char *term_names; /* str_table offset of term names */
686
+ char *str_table; /* pointer to string table */
687
+ NCURSES_SBOOL *Booleans; /* array of boolean values */
688
+ short *Numbers; /* array of integer values */
689
+ char **Strings; /* array of string offsets */
690
+
691
+ #if NCURSES_XNAMES
692
+ char *ext_str_table; /* pointer to extended string table */
693
+ char **ext_Names; /* corresponding names */
694
+
695
+ unsigned short num_Booleans;/* count total Booleans */
696
+ unsigned short num_Numbers; /* count total Numbers */
697
+ unsigned short num_Strings; /* count total Strings */
698
+
699
+ unsigned short ext_Booleans;/* count extensions to Booleans */
700
+ unsigned short ext_Numbers; /* count extensions to Numbers */
701
+ unsigned short ext_Strings; /* count extensions to Strings */
702
+ #endif /* NCURSES_XNAMES */
703
+
704
+ } TERMTYPE;
705
+
706
+ /*
707
+ * The only reason these structures are visible is for read-only use.
708
+ * Programs which modify the data are not, never were, portable across
709
+ * curses implementations.
710
+ *
711
+ * The first field in TERMINAL is used in macros.
712
+ * The remaining fields are private.
713
+ */
714
+ #ifdef NCURSES_INTERNALS
715
+
716
+ #undef TERMINAL
717
+ #define TERMINAL struct term
718
+ TERMINAL;
719
+
720
+ typedef struct termtype2 { /* in-core form of terminfo data */
721
+ char *term_names; /* str_table offset of term names */
722
+ char *str_table; /* pointer to string table */
723
+ NCURSES_SBOOL *Booleans; /* array of boolean values */
724
+ int *Numbers; /* array of integer values */
725
+ char **Strings; /* array of string offsets */
726
+
727
+ #if NCURSES_XNAMES
728
+ char *ext_str_table; /* pointer to extended string table */
729
+ char **ext_Names; /* corresponding names */
730
+
731
+ unsigned short num_Booleans;/* count total Booleans */
732
+ unsigned short num_Numbers; /* count total Numbers */
733
+ unsigned short num_Strings; /* count total Strings */
734
+
735
+ unsigned short ext_Booleans;/* count extensions to Booleans */
736
+ unsigned short ext_Numbers; /* count extensions to Numbers */
737
+ unsigned short ext_Strings; /* count extensions to Strings */
738
+ #endif /* NCURSES_XNAMES */
739
+
740
+ } TERMTYPE2;
741
+ #else
742
+
743
+ typedef struct term { /* describe an actual terminal */
744
+ TERMTYPE type; /* terminal type description */
745
+ } TERMINAL;
746
+
747
+ #endif /* NCURSES_INTERNALS */
748
+
749
+
750
+ #if 0 && !0
751
+ extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
752
+ #elif 0
753
+ NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);
754
+ #define cur_term NCURSES_PUBLIC_VAR(cur_term())
755
+ #else
756
+ extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
757
+ #endif
758
+
759
+ #if 0 || 0
760
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);
761
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);
762
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);
763
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);
764
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);
765
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);
766
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);
767
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);
768
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);
769
+
770
+ #define boolnames NCURSES_PUBLIC_VAR(boolnames())
771
+ #define boolcodes NCURSES_PUBLIC_VAR(boolcodes())
772
+ #define boolfnames NCURSES_PUBLIC_VAR(boolfnames())
773
+ #define numnames NCURSES_PUBLIC_VAR(numnames())
774
+ #define numcodes NCURSES_PUBLIC_VAR(numcodes())
775
+ #define numfnames NCURSES_PUBLIC_VAR(numfnames())
776
+ #define strnames NCURSES_PUBLIC_VAR(strnames())
777
+ #define strcodes NCURSES_PUBLIC_VAR(strcodes())
778
+ #define strfnames NCURSES_PUBLIC_VAR(strfnames())
779
+
780
+ #else
781
+
782
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];
783
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
784
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];
785
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];
786
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];
787
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];
788
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];
789
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];
790
+ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
791
+
792
+ #endif
793
+
794
+ /*
795
+ * These entrypoints are used only by the ncurses utilities such as tic.
796
+ */
797
+ #ifdef NCURSES_INTERNALS
798
+
799
+ extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);
800
+ extern NCURSES_EXPORT(int) _nc_read_entry2 (const char * const, char * const, TERMTYPE2 *const);
801
+ extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE2 *);
802
+ extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, char *, int);
803
+ extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);
804
+ extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);
805
+ extern NCURSES_EXPORT(char *) _nc_tiparm(int, const char *, ...);
806
+
807
+ #endif /* NCURSES_INTERNALS */
808
+
809
+
810
+ /*
811
+ * These entrypoints are used by tack 1.07.
812
+ */
813
+ extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);
814
+ extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);
815
+
816
+ /*
817
+ * Normal entry points
818
+ */
819
+ extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);
820
+ extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);
821
+
822
+ /* miscellaneous entry points */
823
+ extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);
824
+ extern NCURSES_EXPORT(int) setupterm (const char *,int,int *);
825
+
826
+ /* terminfo entry points, also declared in curses.h */
827
+ #if !defined(__NCURSES_H)
828
+ extern NCURSES_EXPORT(char *) tigetstr (const char *);
829
+ extern NCURSES_EXPORT_VAR(char) ttytype[];
830
+ extern NCURSES_EXPORT(int) putp (const char *);
831
+ extern NCURSES_EXPORT(int) tigetflag (const char *);
832
+ extern NCURSES_EXPORT(int) tigetnum (const char *);
833
+
834
+ #if 1 /* NCURSES_TPARM_VARARGS */
835
+ extern NCURSES_EXPORT(char *) tparm (const char *, ...); /* special */
836
+ #else
837
+ extern NCURSES_EXPORT(char *) tparm (const char *, long,long,long,long,long,long,long,long,long); /* special */
838
+ #endif
839
+
840
+ extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */
841
+
842
+ #endif /* __NCURSES_H */
843
+
844
+ /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
845
+ #if !defined(NCURSES_TERMCAP_H_incl)
846
+ extern NCURSES_EXPORT(char *) tgetstr (const char *, char **);
847
+ extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
848
+ extern NCURSES_EXPORT(int) tgetent (char *, const char *);
849
+ extern NCURSES_EXPORT(int) tgetflag (const char *);
850
+ extern NCURSES_EXPORT(int) tgetnum (const char *);
851
+ extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
852
+ #endif /* NCURSES_TERMCAP_H_incl */
853
+
854
+ /*
855
+ * Include curses.h before term.h to enable these extensions.
856
+ */
857
+ #if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)
858
+
859
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tigetstr) (SCREEN*, const char *);
860
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(putp) (SCREEN*, const char *);
861
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetflag) (SCREEN*, const char *);
862
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetnum) (SCREEN*, const char *);
863
+
864
+ #if 1 /* NCURSES_TPARM_VARARGS */
865
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, ...); /* special */
866
+ #else
867
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, long,long,long,long,long,long,long,long,long); /* special */
868
+ #endif
869
+
870
+ /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
871
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgetstr) (SCREEN*, const char *, char **);
872
+ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);
873
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);
874
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetflag) (SCREEN*, const char *);
875
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetnum) (SCREEN*, const char *);
876
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);
877
+
878
+ extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);
879
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);
880
+
881
+ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);
882
+ #endif /* NCURSES_SP_FUNCS */
883
+
884
+ /*
885
+ * Debugging features.
886
+ */
887
+ extern GCC_NORETURN NCURSES_EXPORT(void) exit_terminfo(int);
888
+
889
+ #ifdef __cplusplus
890
+ }
891
+ #endif
892
+
893
+ #endif /* NCURSES_TERM_H_incl */
llava_next/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*/
llava_next/include/tkMenubutton.h ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * tkMenubutton.h --
3
+ *
4
+ * Declarations of types and functions used to implement the menubutton
5
+ * widget.
6
+ *
7
+ * Copyright (c) 1996-1997 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 _TKMENUBUTTON
14
+ #define _TKMENUBUTTON
15
+
16
+ #ifndef _TKINT
17
+ #include "tkInt.h"
18
+ #endif
19
+
20
+ #ifndef _TKMENU
21
+ #include "tkMenu.h"
22
+ #endif
23
+
24
+ /*
25
+ * Legal values for the "orient" field of TkMenubutton records.
26
+ */
27
+
28
+ enum direction {
29
+ DIRECTION_ABOVE, DIRECTION_BELOW, DIRECTION_FLUSH,
30
+ DIRECTION_LEFT, DIRECTION_RIGHT
31
+ };
32
+
33
+ /*
34
+ * Legal values for the "state" field of TkMenubutton records.
35
+ */
36
+
37
+ enum state {
38
+ STATE_ACTIVE, STATE_DISABLED, STATE_NORMAL
39
+ };
40
+
41
+ /*
42
+ * A data structure of the following type is kept for each widget managed by
43
+ * this file:
44
+ */
45
+
46
+ typedef struct {
47
+ Tk_Window tkwin; /* Window that embodies the widget. NULL means
48
+ * that the window has been destroyed but the
49
+ * data structures haven't yet been cleaned
50
+ * up. */
51
+ Display *display; /* Display containing widget. Needed, among
52
+ * other things, so that resources can bee
53
+ * freed up even after tkwin has gone away. */
54
+ Tcl_Interp *interp; /* Interpreter associated with menubutton. */
55
+ Tcl_Command widgetCmd; /* Token for menubutton's widget command. */
56
+ Tk_OptionTable optionTable; /* Table that defines configuration options
57
+ * available for this widget. */
58
+ char *menuName; /* Name of menu associated with widget.
59
+ * Malloc-ed. */
60
+
61
+ /*
62
+ * Information about what's displayed in the menu button:
63
+ */
64
+
65
+ char *text; /* Text to display in button (malloc'ed) or
66
+ * NULL. */
67
+ int underline; /* Index of character to underline. */
68
+ char *textVarName; /* Name of variable (malloc'ed) or NULL. If
69
+ * non-NULL, button displays the contents of
70
+ * this variable. */
71
+ Pixmap bitmap; /* Bitmap to display or None. If not None then
72
+ * text and textVar and underline are
73
+ * ignored. */
74
+ char *imageString; /* Name of image to display (malloc'ed), or
75
+ * NULL. If non-NULL, bitmap, text, and
76
+ * textVarName are ignored. */
77
+ Tk_Image image; /* Image to display in window, or NULL if
78
+ * none. */
79
+
80
+ /*
81
+ * Information used when displaying widget:
82
+ */
83
+
84
+ enum state state; /* State of button for display purposes:
85
+ * normal, active, or disabled. */
86
+ Tk_3DBorder normalBorder; /* Structure used to draw 3-D border and
87
+ * background when window isn't active. NULL
88
+ * means no such border exists. */
89
+ Tk_3DBorder activeBorder; /* Structure used to draw 3-D border and
90
+ * background when window is active. NULL
91
+ * means no such border exists. */
92
+ int borderWidth; /* Width of border. */
93
+ int relief; /* 3-d effect: TK_RELIEF_RAISED, etc. */
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
+ XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
98
+ * when highlight is off. */
99
+ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
100
+ int inset; /* Total width of all borders, including
101
+ * traversal highlight and 3-D border.
102
+ * Indicates how much interior stuff must be
103
+ * offset from outside edges to leave room for
104
+ * borders. */
105
+ Tk_Font tkfont; /* Information about text font, or NULL. */
106
+ XColor *normalFg; /* Foreground color in normal mode. */
107
+ XColor *activeFg; /* Foreground color in active mode. NULL means
108
+ * use normalFg instead. */
109
+ XColor *disabledFg; /* Foreground color when disabled. NULL means
110
+ * use normalFg with a 50% stipple instead. */
111
+ GC normalTextGC; /* GC for drawing text in normal mode. */
112
+ GC activeTextGC; /* GC for drawing text in active mode (NULL
113
+ * means use normalTextGC). */
114
+ Pixmap gray; /* Pixmap for displaying disabled text/icon if
115
+ * disabledFg is NULL. */
116
+ GC disabledGC; /* Used to produce disabled effect for
117
+ * text. */
118
+ GC stippleGC; /* Used to produce disabled stipple effect for
119
+ * images when disabled. */
120
+ int leftBearing; /* Distance from text origin to leftmost drawn
121
+ * pixel (positive means to right). */
122
+ int rightBearing; /* Amount text sticks right from its
123
+ * origin. */
124
+ char *widthString; /* Value of -width option. Malloc'ed. */
125
+ char *heightString; /* Value of -height option. Malloc'ed. */
126
+ int width, height; /* If > 0, these specify dimensions to request
127
+ * for window, in characters for text and in
128
+ * pixels for bitmaps. In this case the actual
129
+ * size of the text string or bitmap is
130
+ * ignored in computing desired window
131
+ * size. */
132
+ int wrapLength; /* Line length (in pixels) at which to wrap
133
+ * onto next line. <= 0 means don't wrap
134
+ * except at newlines. */
135
+ int padX, padY; /* Extra space around text or bitmap (pixels
136
+ * on each side). */
137
+ Tk_Anchor anchor; /* Where text/bitmap should be displayed
138
+ * inside window region. */
139
+ Tk_Justify justify; /* Justification to use for multi-line
140
+ * text. */
141
+ int textWidth; /* Width needed to display text as requested,
142
+ * in pixels. */
143
+ int textHeight; /* Height needed to display text as requested,
144
+ * in pixels. */
145
+ Tk_TextLayout textLayout; /* Saved text layout information. */
146
+ int indicatorOn; /* Non-zero means display indicator; 0 means
147
+ * don't display. */
148
+ int indicatorHeight; /* Height of indicator in pixels. This same
149
+ * amount of extra space is also left on each
150
+ * side of the indicator. 0 if no
151
+ * indicator. */
152
+ int indicatorWidth; /* Width of indicator in pixels, including
153
+ * indicatorHeight in padding on each side. 0
154
+ * if no indicator. */
155
+
156
+ /*
157
+ * Miscellaneous information:
158
+ */
159
+
160
+ int compound; /* Value of -compound option; specifies
161
+ * whether the menubutton should show both an
162
+ * image and text, and, if so, how. */
163
+ enum direction direction; /* Direction for where to pop the menu. Valid
164
+ * directions are "above", "below", "left",
165
+ * "right", and "flush". "flush" means that
166
+ * the upper left corner of the menubutton is
167
+ * where the menu pops up. "above" and "below"
168
+ * will attempt to pop the menu completely
169
+ * above or below the menu respectively.
170
+ * "left" and "right" will pop the menu left
171
+ * or right, and the active item will be next
172
+ * to the button. */
173
+ Tk_Cursor cursor; /* Current cursor for window, or NULL. */
174
+ char *takeFocus; /* Value of -takefocus option; not used in the
175
+ * C code, but used by keyboard traversal
176
+ * scripts. Malloc'ed, but may be NULL. */
177
+ int flags; /* Various flags; see below for
178
+ * definitions. */
179
+ } TkMenuButton;
180
+
181
+ /*
182
+ * Flag bits for buttons:
183
+ *
184
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
185
+ * already been queued to redraw this window.
186
+ * POSTED: Non-zero means that the menu associated with
187
+ * this button has been posted (typically because
188
+ * of an active button press).
189
+ * GOT_FOCUS: Non-zero means this button currently has the
190
+ * input focus.
191
+ */
192
+
193
+ #define REDRAW_PENDING 1
194
+ #define POSTED 2
195
+ #define GOT_FOCUS 4
196
+
197
+ /*
198
+ * The following constants define the dimensions of the cascade indicator,
199
+ * which is displayed if the "-indicatoron" option is true. The units for
200
+ * these options are 1/10 millimeters.
201
+ */
202
+
203
+ #define INDICATOR_WIDTH 40
204
+ #define INDICATOR_HEIGHT 17
205
+
206
+ /*
207
+ * Declaration of procedures used in the implementation of the button widget.
208
+ */
209
+
210
+ MODULE_SCOPE void TkpComputeMenuButtonGeometry(TkMenuButton *mbPtr);
211
+ MODULE_SCOPE TkMenuButton *TkpCreateMenuButton(Tk_Window tkwin);
212
+ MODULE_SCOPE void TkpDisplayMenuButton(ClientData clientData);
213
+ MODULE_SCOPE void TkpDestroyMenuButton(TkMenuButton *mbPtr);
214
+ MODULE_SCOPE void TkMenuButtonWorldChanged(ClientData instanceData);
215
+
216
+ #endif /* _TKMENUBUTTON */
llava_next/include/tkUuid.h ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #define TK_VERSION_UUID \
2
+ e987bb51b8fce99b545a408b5eb2cbcecedf6929ff1f7094e383666f02a5f556
3
+
llava_next/share/info/history.info ADDED
@@ -0,0 +1,1426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This is history.info, produced by makeinfo version 6.8 from
2
+ history.texi.
3
+
4
+ This document describes the GNU History library (version 8.2, 19
5
+ September 2022), a programming tool that provides a consistent user
6
+ interface for recalling lines of previously typed input.
7
+
8
+ Copyright (C) 1988-2022 Free Software Foundation, Inc.
9
+
10
+ Permission is granted to copy, distribute and/or modify this
11
+ document under the terms of the GNU Free Documentation License,
12
+ Version 1.3 or any later version published by the Free Software
13
+ Foundation; with no Invariant Sections, no Front-Cover Texts, and
14
+ no Back-Cover Texts. A copy of the license is included in the
15
+ section entitled "GNU Free Documentation License".
16
+
17
+ INFO-DIR-SECTION Libraries
18
+ START-INFO-DIR-ENTRY
19
+ * History: (history). The GNU history library API.
20
+ END-INFO-DIR-ENTRY
21
+
22
+ 
23
+ File: history.info, Node: Top, Next: Using History Interactively, Up: (dir)
24
+
25
+ GNU History Library
26
+ *******************
27
+
28
+ This document describes the GNU History library, a programming tool that
29
+ provides a consistent user interface for recalling lines of previously
30
+ typed input.
31
+
32
+ * Menu:
33
+
34
+ * Using History Interactively:: GNU History User's Manual.
35
+ * Programming with GNU History:: GNU History Programmer's Manual.
36
+ * GNU Free Documentation License:: License for copying this manual.
37
+ * Concept Index:: Index of concepts described in this manual.
38
+ * Function and Variable Index:: Index of externally visible functions
39
+ and variables.
40
+
41
+ 
42
+ File: history.info, Node: Using History Interactively, Next: Programming with GNU History, Prev: Top, Up: Top
43
+
44
+ 1 Using History Interactively
45
+ *****************************
46
+
47
+ This chapter describes how to use the GNU History Library interactively,
48
+ from a user's standpoint. It should be considered a user's guide. For
49
+ information on using the GNU History Library in your own programs, *note
50
+ Programming with GNU History::.
51
+
52
+ * Menu:
53
+
54
+ * History Interaction:: What it feels like using History as a user.
55
+
56
+ 
57
+ File: history.info, Node: History Interaction, Up: Using History Interactively
58
+
59
+ 1.1 History Expansion
60
+ =====================
61
+
62
+ The History library provides a history expansion feature that is similar
63
+ to the history expansion provided by 'csh'. This section describes the
64
+ syntax used to manipulate the history information.
65
+
66
+ History expansions introduce words from the history list into the
67
+ input stream, making it easy to repeat commands, insert the arguments to
68
+ a previous command into the current input line, or fix errors in
69
+ previous commands quickly.
70
+
71
+ History expansion takes place in two parts. The first is to
72
+ determine which line from the history list should be used during
73
+ substitution. The second is to select portions of that line for
74
+ inclusion into the current one. The line selected from the history is
75
+ called the "event", and the portions of that line that are acted upon
76
+ are called "words". Various "modifiers" are available to manipulate the
77
+ selected words. The line is broken into words in the same fashion that
78
+ Bash does, so that several words surrounded by quotes are considered one
79
+ word. History expansions are introduced by the appearance of the
80
+ history expansion character, which is '!' by default.
81
+
82
+ History expansion implements shell-like quoting conventions: a
83
+ backslash can be used to remove the special handling for the next
84
+ character; single quotes enclose verbatim sequences of characters, and
85
+ can be used to inhibit history expansion; and characters enclosed within
86
+ double quotes may be subject to history expansion, since backslash can
87
+ escape the history expansion character, but single quotes may not, since
88
+ they are not treated specially within double quotes.
89
+
90
+ * Menu:
91
+
92
+ * Event Designators:: How to specify which history line to use.
93
+ * Word Designators:: Specifying which words are of interest.
94
+ * Modifiers:: Modifying the results of substitution.
95
+
96
+ 
97
+ File: history.info, Node: Event Designators, Next: Word Designators, Up: History Interaction
98
+
99
+ 1.1.1 Event Designators
100
+ -----------------------
101
+
102
+ An event designator is a reference to a command line entry in the
103
+ history list. Unless the reference is absolute, events are relative to
104
+ the current position in the history list.
105
+
106
+ '!'
107
+ Start a history substitution, except when followed by a space, tab,
108
+ the end of the line, or '='.
109
+
110
+ '!N'
111
+ Refer to command line N.
112
+
113
+ '!-N'
114
+ Refer to the command N lines back.
115
+
116
+ '!!'
117
+ Refer to the previous command. This is a synonym for '!-1'.
118
+
119
+ '!STRING'
120
+ Refer to the most recent command preceding the current position in
121
+ the history list starting with STRING.
122
+
123
+ '!?STRING[?]'
124
+ Refer to the most recent command preceding the current position in
125
+ the history list containing STRING. The trailing '?' may be
126
+ omitted if the STRING is followed immediately by a newline. If
127
+ STRING is missing, the string from the most recent search is used;
128
+ it is an error if there is no previous search string.
129
+
130
+ '^STRING1^STRING2^'
131
+ Quick Substitution. Repeat the last command, replacing STRING1
132
+ with STRING2. Equivalent to '!!:s^STRING1^STRING2^'.
133
+
134
+ '!#'
135
+ The entire command line typed so far.
136
+
137
+ 
138
+ File: history.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction
139
+
140
+ 1.1.2 Word Designators
141
+ ----------------------
142
+
143
+ Word designators are used to select desired words from the event. A ':'
144
+ separates the event specification from the word designator. It may be
145
+ omitted if the word designator begins with a '^', '$', '*', '-', or '%'.
146
+ Words are numbered from the beginning of the line, with the first word
147
+ being denoted by 0 (zero). Words are inserted into the current line
148
+ separated by single spaces.
149
+
150
+ For example,
151
+
152
+ '!!'
153
+ designates the preceding command. When you type this, the
154
+ preceding command is repeated in toto.
155
+
156
+ '!!:$'
157
+ designates the last argument of the preceding command. This may be
158
+ shortened to '!$'.
159
+
160
+ '!fi:2'
161
+ designates the second argument of the most recent command starting
162
+ with the letters 'fi'.
163
+
164
+ Here are the word designators:
165
+
166
+ '0 (zero)'
167
+ The '0'th word. For many applications, this is the command word.
168
+
169
+ 'N'
170
+ The Nth word.
171
+
172
+ '^'
173
+ The first argument; that is, word 1.
174
+
175
+ '$'
176
+ The last argument.
177
+
178
+ '%'
179
+ The first word matched by the most recent '?STRING?' search, if the
180
+ search string begins with a character that is part of a word.
181
+
182
+ 'X-Y'
183
+ A range of words; '-Y' abbreviates '0-Y'.
184
+
185
+ '*'
186
+ All of the words, except the '0'th. This is a synonym for '1-$'.
187
+ It is not an error to use '*' if there is just one word in the
188
+ event; the empty string is returned in that case.
189
+
190
+ 'X*'
191
+ Abbreviates 'X-$'
192
+
193
+ 'X-'
194
+ Abbreviates 'X-$' like 'X*', but omits the last word. If 'x' is
195
+ missing, it defaults to 0.
196
+
197
+ If a word designator is supplied without an event specification, the
198
+ previous command is used as the event.
199
+
200
+ 
201
+ File: history.info, Node: Modifiers, Prev: Word Designators, Up: History Interaction
202
+
203
+ 1.1.3 Modifiers
204
+ ---------------
205
+
206
+ After the optional word designator, you can add a sequence of one or
207
+ more of the following modifiers, each preceded by a ':'. These modify,
208
+ or edit, the word or words selected from the history event.
209
+
210
+ 'h'
211
+ Remove a trailing pathname component, leaving only the head.
212
+
213
+ 't'
214
+ Remove all leading pathname components, leaving the tail.
215
+
216
+ 'r'
217
+ Remove a trailing suffix of the form '.SUFFIX', leaving the
218
+ basename.
219
+
220
+ 'e'
221
+ Remove all but the trailing suffix.
222
+
223
+ 'p'
224
+ Print the new command but do not execute it.
225
+
226
+ 's/OLD/NEW/'
227
+ Substitute NEW for the first occurrence of OLD in the event line.
228
+ Any character may be used as the delimiter in place of '/'. The
229
+ delimiter may be quoted in OLD and NEW with a single backslash. If
230
+ '&' appears in NEW, it is replaced by OLD. A single backslash will
231
+ quote the '&'. If OLD is null, it is set to the last OLD
232
+ substituted, or, if no previous history substitutions took place,
233
+ the last STRING in a !?STRING'[?]' search. If NEW is null, each
234
+ matching OLD is deleted. The final delimiter is optional if it is
235
+ the last character on the input line.
236
+
237
+ '&'
238
+ Repeat the previous substitution.
239
+
240
+ 'g'
241
+ 'a'
242
+ Cause changes to be applied over the entire event line. Used in
243
+ conjunction with 's', as in 'gs/OLD/NEW/', or with '&'.
244
+
245
+ 'G'
246
+ Apply the following 's' or '&' modifier once to each word in the
247
+ event.
248
+
249
+ 
250
+ File: history.info, Node: Programming with GNU History, Next: GNU Free Documentation License, Prev: Using History Interactively, Up: Top
251
+
252
+ 2 Programming with GNU History
253
+ ******************************
254
+
255
+ This chapter describes how to interface programs that you write with the
256
+ GNU History Library. It should be considered a technical guide. For
257
+ information on the interactive use of GNU History, *note Using History
258
+ Interactively::.
259
+
260
+ * Menu:
261
+
262
+ * Introduction to History:: What is the GNU History library for?
263
+ * History Storage:: How information is stored.
264
+ * History Functions:: Functions that you can use.
265
+ * History Variables:: Variables that control behaviour.
266
+ * History Programming Example:: Example of using the GNU History Library.
267
+
268
+ 
269
+ File: history.info, Node: Introduction to History, Next: History Storage, Up: Programming with GNU History
270
+
271
+ 2.1 Introduction to History
272
+ ===========================
273
+
274
+ Many programs read input from the user a line at a time. The GNU
275
+ History library is able to keep track of those lines, associate
276
+ arbitrary data with each line, and utilize information from previous
277
+ lines in composing new ones.
278
+
279
+ A programmer using the History library has available functions for
280
+ remembering lines on a history list, associating arbitrary data with a
281
+ line, removing lines from the list, searching through the list for a
282
+ line containing an arbitrary text string, and referencing any line in
283
+ the list directly. In addition, a history "expansion" function is
284
+ available which provides for a consistent user interface across
285
+ different programs.
286
+
287
+ The user using programs written with the History library has the
288
+ benefit of a consistent user interface with a set of well-known commands
289
+ for manipulating the text of previous lines and using that text in new
290
+ commands. The basic history manipulation commands are similar to the
291
+ history substitution provided by 'csh'.
292
+
293
+ The programmer can also use the Readline library, which includes some
294
+ history manipulation by default, and has the added advantage of command
295
+ line editing.
296
+
297
+ Before declaring any functions using any functionality the History
298
+ library provides in other code, an application writer should include the
299
+ file '<readline/history.h>' in any file that uses the History library's
300
+ features. It supplies extern declarations for all of the library's
301
+ public functions and variables, and declares all of the public data
302
+ structures.
303
+
304
+ 
305
+ File: history.info, Node: History Storage, Next: History Functions, Prev: Introduction to History, Up: Programming with GNU History
306
+
307
+ 2.2 History Storage
308
+ ===================
309
+
310
+ The history list is an array of history entries. A history entry is
311
+ declared as follows:
312
+
313
+ typedef void *histdata_t;
314
+
315
+ typedef struct _hist_entry {
316
+ char *line;
317
+ char *timestamp;
318
+ histdata_t data;
319
+ } HIST_ENTRY;
320
+
321
+ The history list itself might therefore be declared as
322
+
323
+ HIST_ENTRY **the_history_list;
324
+
325
+ The state of the History library is encapsulated into a single
326
+ structure:
327
+
328
+ /*
329
+ * A structure used to pass around the current state of the history.
330
+ */
331
+ typedef struct _hist_state {
332
+ HIST_ENTRY **entries; /* Pointer to the entries themselves. */
333
+ int offset; /* The location pointer within this array. */
334
+ int length; /* Number of elements within this array. */
335
+ int size; /* Number of slots allocated to this array. */
336
+ int flags;
337
+ } HISTORY_STATE;
338
+
339
+ If the flags member includes 'HS_STIFLED', the history has been
340
+ stifled.
341
+
342
+ 
343
+ File: history.info, Node: History Functions, Next: History Variables, Prev: History Storage, Up: Programming with GNU History
344
+
345
+ 2.3 History Functions
346
+ =====================
347
+
348
+ This section describes the calling sequence for the various functions
349
+ exported by the GNU History library.
350
+
351
+ * Menu:
352
+
353
+ * Initializing History and State Management:: Functions to call when you
354
+ want to use history in a
355
+ program.
356
+ * History List Management:: Functions used to manage the list
357
+ of history entries.
358
+ * Information About the History List:: Functions returning information about
359
+ the history list.
360
+ * Moving Around the History List:: Functions used to change the position
361
+ in the history list.
362
+ * Searching the History List:: Functions to search the history list
363
+ for entries containing a string.
364
+ * Managing the History File:: Functions that read and write a file
365
+ containing the history list.
366
+ * History Expansion:: Functions to perform csh-like history
367
+ expansion.
368
+
369
+ 
370
+ File: history.info, Node: Initializing History and State Management, Next: History List Management, Up: History Functions
371
+
372
+ 2.3.1 Initializing History and State Management
373
+ -----------------------------------------------
374
+
375
+ This section describes functions used to initialize and manage the state
376
+ of the History library when you want to use the history functions in
377
+ your program.
378
+
379
+ -- Function: void using_history (void)
380
+ Begin a session in which the history functions might be used. This
381
+ initializes the interactive variables.
382
+
383
+ -- Function: HISTORY_STATE * history_get_history_state (void)
384
+ Return a structure describing the current state of the input
385
+ history.
386
+
387
+ -- Function: void history_set_history_state (HISTORY_STATE *state)
388
+ Set the state of the history list according to STATE.
389
+
390
+ 
391
+ File: history.info, Node: History List Management, Next: Information About the History List, Prev: Initializing History and State Management, Up: History Functions
392
+
393
+ 2.3.2 History List Management
394
+ -----------------------------
395
+
396
+ These functions manage individual entries on the history list, or set
397
+ parameters managing the list itself.
398
+
399
+ -- Function: void add_history (const char *string)
400
+ Place STRING at the end of the history list. The associated data
401
+ field (if any) is set to 'NULL'. If the maximum number of history
402
+ entries has been set using 'stifle_history()', and the new number
403
+ of history entries would exceed that maximum, the oldest history
404
+ entry is removed.
405
+
406
+ -- Function: void add_history_time (const char *string)
407
+ Change the time stamp associated with the most recent history entry
408
+ to STRING.
409
+
410
+ -- Function: HIST_ENTRY * remove_history (int which)
411
+ Remove history entry at offset WHICH from the history. The removed
412
+ element is returned so you can free the line, data, and containing
413
+ structure.
414
+
415
+ -- Function: histdata_t free_history_entry (HIST_ENTRY *histent)
416
+ Free the history entry HISTENT and any history library private data
417
+ associated with it. Returns the application-specific data so the
418
+ caller can dispose of it.
419
+
420
+ -- Function: HIST_ENTRY * replace_history_entry (int which, const char
421
+ *line, histdata_t data)
422
+ Make the history entry at offset WHICH have LINE and DATA. This
423
+ returns the old entry so the caller can dispose of any
424
+ application-specific data. In the case of an invalid WHICH, a
425
+ 'NULL' pointer is returned.
426
+
427
+ -- Function: void clear_history (void)
428
+ Clear the history list by deleting all the entries.
429
+
430
+ -- Function: void stifle_history (int max)
431
+ Stifle the history list, remembering only the last MAX entries.
432
+ The history list will contain only MAX entries at a time.
433
+
434
+ -- Function: int unstifle_history (void)
435
+ Stop stifling the history. This returns the previously-set maximum
436
+ number of history entries (as set by 'stifle_history()'). The
437
+ value is positive if the history was stifled, negative if it
438
+ wasn't.
439
+
440
+ -- Function: int history_is_stifled (void)
441
+ Returns non-zero if the history is stifled, zero if it is not.
442
+
443
+ 
444
+ File: history.info, Node: Information About the History List, Next: Moving Around the History List, Prev: History List Management, Up: History Functions
445
+
446
+ 2.3.3 Information About the History List
447
+ ----------------------------------------
448
+
449
+ These functions return information about the entire history list or
450
+ individual list entries.
451
+
452
+ -- Function: HIST_ENTRY ** history_list (void)
453
+ Return a 'NULL' terminated array of 'HIST_ENTRY *' which is the
454
+ current input history. Element 0 of this list is the beginning of
455
+ time. If there is no history, return 'NULL'.
456
+
457
+ -- Function: int where_history (void)
458
+ Returns the offset of the current history element.
459
+
460
+ -- Function: HIST_ENTRY * current_history (void)
461
+ Return the history entry at the current position, as determined by
462
+ 'where_history()'. If there is no entry there, return a 'NULL'
463
+ pointer.
464
+
465
+ -- Function: HIST_ENTRY * history_get (int offset)
466
+ Return the history entry at position OFFSET. The range of valid
467
+ values of OFFSET starts at 'history_base' and ends at
468
+ HISTORY_LENGTH - 1 (*note History Variables::). If there is no
469
+ entry there, or if OFFSET is outside the valid range, return a
470
+ 'NULL' pointer.
471
+
472
+ -- Function: time_t history_get_time (HIST_ENTRY *entry)
473
+ Return the time stamp associated with the history entry ENTRY. If
474
+ the timestamp is missing or invalid, return 0.
475
+
476
+ -- Function: int history_total_bytes (void)
477
+ Return the number of bytes that the primary history entries are
478
+ using. This function returns the sum of the lengths of all the
479
+ lines in the history.
480
+
481
+ 
482
+ File: history.info, Node: Moving Around the History List, Next: Searching the History List, Prev: Information About the History List, Up: History Functions
483
+
484
+ 2.3.4 Moving Around the History List
485
+ ------------------------------------
486
+
487
+ These functions allow the current index into the history list to be set
488
+ or changed.
489
+
490
+ -- Function: int history_set_pos (int pos)
491
+ Set the current history offset to POS, an absolute index into the
492
+ list. Returns 1 on success, 0 if POS is less than zero or greater
493
+ than the number of history entries.
494
+
495
+ -- Function: HIST_ENTRY * previous_history (void)
496
+ Back up the current history offset to the previous history entry,
497
+ and return a pointer to that entry. If there is no previous entry,
498
+ return a 'NULL' pointer.
499
+
500
+ -- Function: HIST_ENTRY * next_history (void)
501
+ If the current history offset refers to a valid history entry,
502
+ increment the current history offset. If the possibly-incremented
503
+ history offset refers to a valid history entry, return a pointer to
504
+ that entry; otherwise, return a 'BNULL' pointer.
505
+
506
+ 
507
+ File: history.info, Node: Searching the History List, Next: Managing the History File, Prev: Moving Around the History List, Up: History Functions
508
+
509
+ 2.3.5 Searching the History List
510
+ --------------------------------
511
+
512
+ These functions allow searching of the history list for entries
513
+ containing a specific string. Searching may be performed both forward
514
+ and backward from the current history position. The search may be
515
+ "anchored", meaning that the string must match at the beginning of the
516
+ history entry.
517
+
518
+ -- Function: int history_search (const char *string, int direction)
519
+ Search the history for STRING, starting at the current history
520
+ offset. If DIRECTION is less than 0, then the search is through
521
+ previous entries, otherwise through subsequent entries. If STRING
522
+ is found, then the current history index is set to that history
523
+ entry, and the value returned is the offset in the line of the
524
+ entry where STRING was found. Otherwise, nothing is changed, and a
525
+ -1 is returned.
526
+
527
+ -- Function: int history_search_prefix (const char *string, int
528
+ direction)
529
+ Search the history for STRING, starting at the current history
530
+ offset. The search is anchored: matching lines must begin with
531
+ STRING. If DIRECTION is less than 0, then the search is through
532
+ previous entries, otherwise through subsequent entries. If STRING
533
+ is found, then the current history index is set to that entry, and
534
+ the return value is 0. Otherwise, nothing is changed, and a -1 is
535
+ returned.
536
+
537
+ -- Function: int history_search_pos (const char *string, int direction,
538
+ int pos)
539
+ Search for STRING in the history list, starting at POS, an absolute
540
+ index into the list. If DIRECTION is negative, the search proceeds
541
+ backward from POS, otherwise forward. Returns the absolute index
542
+ of the history element where STRING was found, or -1 otherwise.
543
+
544
+ 
545
+ File: history.info, Node: Managing the History File, Next: History Expansion, Prev: Searching the History List, Up: History Functions
546
+
547
+ 2.3.6 Managing the History File
548
+ -------------------------------
549
+
550
+ The History library can read the history from and write it to a file.
551
+ This section documents the functions for managing a history file.
552
+
553
+ -- Function: int read_history (const char *filename)
554
+ Add the contents of FILENAME to the history list, a line at a time.
555
+ If FILENAME is 'NULL', then read from '~/.history'. Returns 0 if
556
+ successful, or 'errno' if not.
557
+
558
+ -- Function: int read_history_range (const char *filename, int from,
559
+ int to)
560
+ Read a range of lines from FILENAME, adding them to the history
561
+ list. Start reading at line FROM and end at TO. If FROM is zero,
562
+ start at the beginning. If TO is less than FROM, then read until
563
+ the end of the file. If FILENAME is 'NULL', then read from
564
+ '~/.history'. Returns 0 if successful, or 'errno' if not.
565
+
566
+ -- Function: int write_history (const char *filename)
567
+ Write the current history to FILENAME, overwriting FILENAME if
568
+ necessary. If FILENAME is 'NULL', then write the history list to
569
+ '~/.history'. Returns 0 on success, or 'errno' on a read or write
570
+ error.
571
+
572
+ -- Function: int append_history (int nelements, const char *filename)
573
+ Append the last NELEMENTS of the history list to FILENAME. If
574
+ FILENAME is 'NULL', then append to '~/.history'. Returns 0 on
575
+ success, or 'errno' on a read or write error.
576
+
577
+ -- Function: int history_truncate_file (const char *filename, int
578
+ nlines)
579
+ Truncate the history file FILENAME, leaving only the last NLINES
580
+ lines. If FILENAME is 'NULL', then '~/.history' is truncated.
581
+ Returns 0 on success, or 'errno' on failure.
582
+
583
+ 
584
+ File: history.info, Node: History Expansion, Prev: Managing the History File, Up: History Functions
585
+
586
+ 2.3.7 History Expansion
587
+ -----------------------
588
+
589
+ These functions implement history expansion.
590
+
591
+ -- Function: int history_expand (char *string, char **output)
592
+ Expand STRING, placing the result into OUTPUT, a pointer to a
593
+ string (*note History Interaction::). Returns:
594
+ '0'
595
+ If no expansions took place (or, if the only change in the
596
+ text was the removal of escape characters preceding the
597
+ history expansion character);
598
+ '1'
599
+ if expansions did take place;
600
+ '-1'
601
+ if there was an error in expansion;
602
+ '2'
603
+ if the returned line should be displayed, but not executed, as
604
+ with the ':p' modifier (*note Modifiers::).
605
+
606
+ If an error occurred in expansion, then OUTPUT contains a
607
+ descriptive error message.
608
+
609
+ -- Function: char * get_history_event (const char *string, int *cindex,
610
+ int qchar)
611
+ Returns the text of the history event beginning at STRING +
612
+ *CINDEX. *CINDEX is modified to point to after the event
613
+ specifier. At function entry, CINDEX points to the index into
614
+ STRING where the history event specification begins. QCHAR is a
615
+ character that is allowed to end the event specification in
616
+ addition to the "normal" terminating characters.
617
+
618
+ -- Function: char ** history_tokenize (const char *string)
619
+ Return an array of tokens parsed out of STRING, much as the shell
620
+ might. The tokens are split on the characters in the
621
+ HISTORY_WORD_DELIMITERS variable, and shell quoting conventions are
622
+ obeyed as described below.
623
+
624
+ -- Function: char * history_arg_extract (int first, int last, const
625
+ char *string)
626
+ Extract a string segment consisting of the FIRST through LAST
627
+ arguments present in STRING. Arguments are split using
628
+ 'history_tokenize'.
629
+
630
+ 
631
+ File: history.info, Node: History Variables, Next: History Programming Example, Prev: History Functions, Up: Programming with GNU History
632
+
633
+ 2.4 History Variables
634
+ =====================
635
+
636
+ This section describes the externally-visible variables exported by the
637
+ GNU History Library.
638
+
639
+ -- Variable: int history_base
640
+ The logical offset of the first entry in the history list.
641
+
642
+ -- Variable: int history_length
643
+ The number of entries currently stored in the history list.
644
+
645
+ -- Variable: int history_max_entries
646
+ The maximum number of history entries. This must be changed using
647
+ 'stifle_history()'.
648
+
649
+ -- Variable: int history_write_timestamps
650
+ If non-zero, timestamps are written to the history file, so they
651
+ can be preserved between sessions. The default value is 0, meaning
652
+ that timestamps are not saved.
653
+
654
+ The current timestamp format uses the value of HISTORY_COMMENT_CHAR
655
+ to delimit timestamp entries in the history file. If that variable
656
+ does not have a value (the default), timestamps will not be
657
+ written.
658
+
659
+ -- Variable: char history_expansion_char
660
+ The character that introduces a history event. The default is '!'.
661
+ Setting this to 0 inhibits history expansion.
662
+
663
+ -- Variable: char history_subst_char
664
+ The character that invokes word substitution if found at the start
665
+ of a line. The default is '^'.
666
+
667
+ -- Variable: char history_comment_char
668
+ During tokenization, if this character is seen as the first
669
+ character of a word, then it and all subsequent characters up to a
670
+ newline are ignored, suppressing history expansion for the
671
+ remainder of the line. This is disabled by default.
672
+
673
+ -- Variable: char * history_word_delimiters
674
+ The characters that separate tokens for 'history_tokenize()'. The
675
+ default value is '" \t\n()<>;&|"'.
676
+
677
+ -- Variable: char * history_search_delimiter_chars
678
+ The list of additional characters which can delimit a history
679
+ search string, in addition to space, TAB, ':' and '?' in the case
680
+ of a substring search. The default is empty.
681
+
682
+ -- Variable: char * history_no_expand_chars
683
+ The list of characters which inhibit history expansion if found
684
+ immediately following HISTORY_EXPANSION_CHAR. The default is
685
+ space, tab, newline, carriage return, and '='.
686
+
687
+ -- Variable: int history_quotes_inhibit_expansion
688
+ If non-zero, the history expansion code implements shell-like
689
+ quoting: single-quoted words are not scanned for the history
690
+ expansion character or the history comment character, and
691
+ double-quoted words may have history expansion performed, since
692
+ single quotes are not special within double quotes. The default
693
+ value is 0.
694
+
695
+ -- Variable: int history_quoting_state
696
+ An application may set this variable to indicate that the current
697
+ line being expanded is subject to existing quoting. If set to ''',
698
+ the history expansion function will assume that the line is
699
+ single-quoted and inhibit expansion until it reads an unquoted
700
+ closing single quote; if set to '"', history expansion will assume
701
+ the line is double quoted until it reads an unquoted closing double
702
+ quote. If set to zero, the default, the history expansion function
703
+ will assume the line is not quoted and treat quote characters
704
+ within the line as described above. This is only effective if
705
+ HISTORY_QUOTES_INHIBIT_EXPANSION is set.
706
+
707
+ -- Variable: rl_linebuf_func_t * history_inhibit_expansion_function
708
+ This should be set to the address of a function that takes two
709
+ arguments: a 'char *' (STRING) and an 'int' index into that string
710
+ (I). It should return a non-zero value if the history expansion
711
+ starting at STRING[I] should not be performed; zero if the
712
+ expansion should be done. It is intended for use by applications
713
+ like Bash that use the history expansion character for additional
714
+ purposes. By default, this variable is set to 'NULL'.
715
+
716
+ 
717
+ File: history.info, Node: History Programming Example, Prev: History Variables, Up: Programming with GNU History
718
+
719
+ 2.5 History Programming Example
720
+ ===============================
721
+
722
+ The following program demonstrates simple use of the GNU History
723
+ Library.
724
+
725
+ #include <stdio.h>
726
+ #include <readline/history.h>
727
+
728
+ main (argc, argv)
729
+ int argc;
730
+ char **argv;
731
+ {
732
+ char line[1024], *t;
733
+ int len, done = 0;
734
+
735
+ line[0] = 0;
736
+
737
+ using_history ();
738
+ while (!done)
739
+ {
740
+ printf ("history$ ");
741
+ fflush (stdout);
742
+ t = fgets (line, sizeof (line) - 1, stdin);
743
+ if (t && *t)
744
+ {
745
+ len = strlen (t);
746
+ if (t[len - 1] == '\n')
747
+ t[len - 1] = '\0';
748
+ }
749
+
750
+ if (!t)
751
+ strcpy (line, "quit");
752
+
753
+ if (line[0])
754
+ {
755
+ char *expansion;
756
+ int result;
757
+
758
+ result = history_expand (line, &expansion);
759
+ if (result)
760
+ fprintf (stderr, "%s\n", expansion);
761
+
762
+ if (result < 0 || result == 2)
763
+ {
764
+ free (expansion);
765
+ continue;
766
+ }
767
+
768
+ add_history (expansion);
769
+ strncpy (line, expansion, sizeof (line) - 1);
770
+ free (expansion);
771
+ }
772
+
773
+ if (strcmp (line, "quit") == 0)
774
+ done = 1;
775
+ else if (strcmp (line, "save") == 0)
776
+ write_history ("history_file");
777
+ else if (strcmp (line, "read") == 0)
778
+ read_history ("history_file");
779
+ else if (strcmp (line, "list") == 0)
780
+ {
781
+ register HIST_ENTRY **the_list;
782
+ register int i;
783
+
784
+ the_list = history_list ();
785
+ if (the_list)
786
+ for (i = 0; the_list[i]; i++)
787
+ printf ("%d: %s\n", i + history_base, the_list[i]->line);
788
+ }
789
+ else if (strncmp (line, "delete", 6) == 0)
790
+ {
791
+ int which;
792
+ if ((sscanf (line + 6, "%d", &which)) == 1)
793
+ {
794
+ HIST_ENTRY *entry = remove_history (which);
795
+ if (!entry)
796
+ fprintf (stderr, "No such entry %d\n", which);
797
+ else
798
+ {
799
+ free (entry->line);
800
+ free (entry);
801
+ }
802
+ }
803
+ else
804
+ {
805
+ fprintf (stderr, "non-numeric arg given to `delete'\n");
806
+ }
807
+ }
808
+ }
809
+ }
810
+
811
+ 
812
+ File: history.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: Programming with GNU History, Up: Top
813
+
814
+ Appendix A GNU Free Documentation License
815
+ *****************************************
816
+
817
+ Version 1.3, 3 November 2008
818
+
819
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
820
+ <http://fsf.org/>
821
+
822
+ Everyone is permitted to copy and distribute verbatim copies
823
+ of this license document, but changing it is not allowed.
824
+
825
+ 0. PREAMBLE
826
+
827
+ The purpose of this License is to make a manual, textbook, or other
828
+ functional and useful document "free" in the sense of freedom: to
829
+ assure everyone the effective freedom to copy and redistribute it,
830
+ with or without modifying it, either commercially or
831
+ noncommercially. Secondarily, this License preserves for the
832
+ author and publisher a way to get credit for their work, while not
833
+ being considered responsible for modifications made by others.
834
+
835
+ This License is a kind of "copyleft", which means that derivative
836
+ works of the document must themselves be free in the same sense.
837
+ It complements the GNU General Public License, which is a copyleft
838
+ license designed for free software.
839
+
840
+ We have designed this License in order to use it for manuals for
841
+ free software, because free software needs free documentation: a
842
+ free program should come with manuals providing the same freedoms
843
+ that the software does. But this License is not limited to
844
+ software manuals; it can be used for any textual work, regardless
845
+ of subject matter or whether it is published as a printed book. We
846
+ recommend this License principally for works whose purpose is
847
+ instruction or reference.
848
+
849
+ 1. APPLICABILITY AND DEFINITIONS
850
+
851
+ This License applies to any manual or other work, in any medium,
852
+ that contains a notice placed by the copyright holder saying it can
853
+ be distributed under the terms of this License. Such a notice
854
+ grants a world-wide, royalty-free license, unlimited in duration,
855
+ to use that work under the conditions stated herein. The
856
+ "Document", below, refers to any such manual or work. Any member
857
+ of the public is a licensee, and is addressed as "you". You accept
858
+ the license if you copy, modify or distribute the work in a way
859
+ requiring permission under copyright law.
860
+
861
+ A "Modified Version" of the Document means any work containing the
862
+ Document or a portion of it, either copied verbatim, or with
863
+ modifications and/or translated into another language.
864
+
865
+ A "Secondary Section" is a named appendix or a front-matter section
866
+ of the Document that deals exclusively with the relationship of the
867
+ publishers or authors of the Document to the Document's overall
868
+ subject (or to related matters) and contains nothing that could
869
+ fall directly within that overall subject. (Thus, if the Document
870
+ is in part a textbook of mathematics, a Secondary Section may not
871
+ explain any mathematics.) The relationship could be a matter of
872
+ historical connection with the subject or with related matters, or
873
+ of legal, commercial, philosophical, ethical or political position
874
+ regarding them.
875
+
876
+ The "Invariant Sections" are certain Secondary Sections whose
877
+ titles are designated, as being those of Invariant Sections, in the
878
+ notice that says that the Document is released under this License.
879
+ If a section does not fit the above definition of Secondary then it
880
+ is not allowed to be designated as Invariant. The Document may
881
+ contain zero Invariant Sections. If the Document does not identify
882
+ any Invariant Sections then there are none.
883
+
884
+ The "Cover Texts" are certain short passages of text that are
885
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
886
+ that says that the Document is released under this License. A
887
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
888
+ be at most 25 words.
889
+
890
+ A "Transparent" copy of the Document means a machine-readable copy,
891
+ represented in a format whose specification is available to the
892
+ general public, that is suitable for revising the document
893
+ straightforwardly with generic text editors or (for images composed
894
+ of pixels) generic paint programs or (for drawings) some widely
895
+ available drawing editor, and that is suitable for input to text
896
+ formatters or for automatic translation to a variety of formats
897
+ suitable for input to text formatters. A copy made in an otherwise
898
+ Transparent file format whose markup, or absence of markup, has
899
+ been arranged to thwart or discourage subsequent modification by
900
+ readers is not Transparent. An image format is not Transparent if
901
+ used for any substantial amount of text. A copy that is not
902
+ "Transparent" is called "Opaque".
903
+
904
+ Examples of suitable formats for Transparent copies include plain
905
+ ASCII without markup, Texinfo input format, LaTeX input format,
906
+ SGML or XML using a publicly available DTD, and standard-conforming
907
+ simple HTML, PostScript or PDF designed for human modification.
908
+ Examples of transparent image formats include PNG, XCF and JPG.
909
+ Opaque formats include proprietary formats that can be read and
910
+ edited only by proprietary word processors, SGML or XML for which
911
+ the DTD and/or processing tools are not generally available, and
912
+ the machine-generated HTML, PostScript or PDF produced by some word
913
+ processors for output purposes only.
914
+
915
+ The "Title Page" means, for a printed book, the title page itself,
916
+ plus such following pages as are needed to hold, legibly, the
917
+ material this License requires to appear in the title page. For
918
+ works in formats which do not have any title page as such, "Title
919
+ Page" means the text near the most prominent appearance of the
920
+ work's title, preceding the beginning of the body of the text.
921
+
922
+ The "publisher" means any person or entity that distributes copies
923
+ of the Document to the public.
924
+
925
+ A section "Entitled XYZ" means a named subunit of the Document
926
+ whose title either is precisely XYZ or contains XYZ in parentheses
927
+ following text that translates XYZ in another language. (Here XYZ
928
+ stands for a specific section name mentioned below, such as
929
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
930
+ To "Preserve the Title" of such a section when you modify the
931
+ Document means that it remains a section "Entitled XYZ" according
932
+ to this definition.
933
+
934
+ The Document may include Warranty Disclaimers next to the notice
935
+ which states that this License applies to the Document. These
936
+ Warranty Disclaimers are considered to be included by reference in
937
+ this License, but only as regards disclaiming warranties: any other
938
+ implication that these Warranty Disclaimers may have is void and
939
+ has no effect on the meaning of this License.
940
+
941
+ 2. VERBATIM COPYING
942
+
943
+ You may copy and distribute the Document in any medium, either
944
+ commercially or noncommercially, provided that this License, the
945
+ copyright notices, and the license notice saying this License
946
+ applies to the Document are reproduced in all copies, and that you
947
+ add no other conditions whatsoever to those of this License. You
948
+ may not use technical measures to obstruct or control the reading
949
+ or further copying of the copies you make or distribute. However,
950
+ you may accept compensation in exchange for copies. If you
951
+ distribute a large enough number of copies you must also follow the
952
+ conditions in section 3.
953
+
954
+ You may also lend copies, under the same conditions stated above,
955
+ and you may publicly display copies.
956
+
957
+ 3. COPYING IN QUANTITY
958
+
959
+ If you publish printed copies (or copies in media that commonly
960
+ have printed covers) of the Document, numbering more than 100, and
961
+ the Document's license notice requires Cover Texts, you must
962
+ enclose the copies in covers that carry, clearly and legibly, all
963
+ these Cover Texts: Front-Cover Texts on the front cover, and
964
+ Back-Cover Texts on the back cover. Both covers must also clearly
965
+ and legibly identify you as the publisher of these copies. The
966
+ front cover must present the full title with all words of the title
967
+ equally prominent and visible. You may add other material on the
968
+ covers in addition. Copying with changes limited to the covers, as
969
+ long as they preserve the title of the Document and satisfy these
970
+ conditions, can be treated as verbatim copying in other respects.
971
+
972
+ If the required texts for either cover are too voluminous to fit
973
+ legibly, you should put the first ones listed (as many as fit
974
+ reasonably) on the actual cover, and continue the rest onto
975
+ adjacent pages.
976
+
977
+ If you publish or distribute Opaque copies of the Document
978
+ numbering more than 100, you must either include a machine-readable
979
+ Transparent copy along with each Opaque copy, or state in or with
980
+ each Opaque copy a computer-network location from which the general
981
+ network-using public has access to download using public-standard
982
+ network protocols a complete Transparent copy of the Document, free
983
+ of added material. If you use the latter option, you must take
984
+ reasonably prudent steps, when you begin distribution of Opaque
985
+ copies in quantity, to ensure that this Transparent copy will
986
+ remain thus accessible at the stated location until at least one
987
+ year after the last time you distribute an Opaque copy (directly or
988
+ through your agents or retailers) of that edition to the public.
989
+
990
+ It is requested, but not required, that you contact the authors of
991
+ the Document well before redistributing any large number of copies,
992
+ to give them a chance to provide you with an updated version of the
993
+ Document.
994
+
995
+ 4. MODIFICATIONS
996
+
997
+ You may copy and distribute a Modified Version of the Document
998
+ under the conditions of sections 2 and 3 above, provided that you
999
+ release the Modified Version under precisely this License, with the
1000
+ Modified Version filling the role of the Document, thus licensing
1001
+ distribution and modification of the Modified Version to whoever
1002
+ possesses a copy of it. In addition, you must do these things in
1003
+ the Modified Version:
1004
+
1005
+ A. Use in the Title Page (and on the covers, if any) a title
1006
+ distinct from that of the Document, and from those of previous
1007
+ versions (which should, if there were any, be listed in the
1008
+ History section of the Document). You may use the same title
1009
+ as a previous version if the original publisher of that
1010
+ version gives permission.
1011
+
1012
+ B. List on the Title Page, as authors, one or more persons or
1013
+ entities responsible for authorship of the modifications in
1014
+ the Modified Version, together with at least five of the
1015
+ principal authors of the Document (all of its principal
1016
+ authors, if it has fewer than five), unless they release you
1017
+ from this requirement.
1018
+
1019
+ C. State on the Title page the name of the publisher of the
1020
+ Modified Version, as the publisher.
1021
+
1022
+ D. Preserve all the copyright notices of the Document.
1023
+
1024
+ E. Add an appropriate copyright notice for your modifications
1025
+ adjacent to the other copyright notices.
1026
+
1027
+ F. Include, immediately after the copyright notices, a license
1028
+ notice giving the public permission to use the Modified
1029
+ Version under the terms of this License, in the form shown in
1030
+ the Addendum below.
1031
+
1032
+ G. Preserve in that license notice the full lists of Invariant
1033
+ Sections and required Cover Texts given in the Document's
1034
+ license notice.
1035
+
1036
+ H. Include an unaltered copy of this License.
1037
+
1038
+ I. Preserve the section Entitled "History", Preserve its Title,
1039
+ and add to it an item stating at least the title, year, new
1040
+ authors, and publisher of the Modified Version as given on the
1041
+ Title Page. If there is no section Entitled "History" in the
1042
+ Document, create one stating the title, year, authors, and
1043
+ publisher of the Document as given on its Title Page, then add
1044
+ an item describing the Modified Version as stated in the
1045
+ previous sentence.
1046
+
1047
+ J. Preserve the network location, if any, given in the Document
1048
+ for public access to a Transparent copy of the Document, and
1049
+ likewise the network locations given in the Document for
1050
+ previous versions it was based on. These may be placed in the
1051
+ "History" section. You may omit a network location for a work
1052
+ that was published at least four years before the Document
1053
+ itself, or if the original publisher of the version it refers
1054
+ to gives permission.
1055
+
1056
+ K. For any section Entitled "Acknowledgements" or "Dedications",
1057
+ Preserve the Title of the section, and preserve in the section
1058
+ all the substance and tone of each of the contributor
1059
+ acknowledgements and/or dedications given therein.
1060
+
1061
+ L. Preserve all the Invariant Sections of the Document, unaltered
1062
+ in their text and in their titles. Section numbers or the
1063
+ equivalent are not considered part of the section titles.
1064
+
1065
+ M. Delete any section Entitled "Endorsements". Such a section
1066
+ may not be included in the Modified Version.
1067
+
1068
+ N. Do not retitle any existing section to be Entitled
1069
+ "Endorsements" or to conflict in title with any Invariant
1070
+ Section.
1071
+
1072
+ O. Preserve any Warranty Disclaimers.
1073
+
1074
+ If the Modified Version includes new front-matter sections or
1075
+ appendices that qualify as Secondary Sections and contain no
1076
+ material copied from the Document, you may at your option designate
1077
+ some or all of these sections as invariant. To do this, add their
1078
+ titles to the list of Invariant Sections in the Modified Version's
1079
+ license notice. These titles must be distinct from any other
1080
+ section titles.
1081
+
1082
+ You may add a section Entitled "Endorsements", provided it contains
1083
+ nothing but endorsements of your Modified Version by various
1084
+ parties--for example, statements of peer review or that the text
1085
+ has been approved by an organization as the authoritative
1086
+ definition of a standard.
1087
+
1088
+ You may add a passage of up to five words as a Front-Cover Text,
1089
+ and a passage of up to 25 words as a Back-Cover Text, to the end of
1090
+ the list of Cover Texts in the Modified Version. Only one passage
1091
+ of Front-Cover Text and one of Back-Cover Text may be added by (or
1092
+ through arrangements made by) any one entity. If the Document
1093
+ already includes a cover text for the same cover, previously added
1094
+ by you or by arrangement made by the same entity you are acting on
1095
+ behalf of, you may not add another; but you may replace the old
1096
+ one, on explicit permission from the previous publisher that added
1097
+ the old one.
1098
+
1099
+ The author(s) and publisher(s) of the Document do not by this
1100
+ License give permission to use their names for publicity for or to
1101
+ assert or imply endorsement of any Modified Version.
1102
+
1103
+ 5. COMBINING DOCUMENTS
1104
+
1105
+ You may combine the Document with other documents released under
1106
+ this License, under the terms defined in section 4 above for
1107
+ modified versions, provided that you include in the combination all
1108
+ of the Invariant Sections of all of the original documents,
1109
+ unmodified, and list them all as Invariant Sections of your
1110
+ combined work in its license notice, and that you preserve all
1111
+ their Warranty Disclaimers.
1112
+
1113
+ The combined work need only contain one copy of this License, and
1114
+ multiple identical Invariant Sections may be replaced with a single
1115
+ copy. If there are multiple Invariant Sections with the same name
1116
+ but different contents, make the title of each such section unique
1117
+ by adding at the end of it, in parentheses, the name of the
1118
+ original author or publisher of that section if known, or else a
1119
+ unique number. Make the same adjustment to the section titles in
1120
+ the list of Invariant Sections in the license notice of the
1121
+ combined work.
1122
+
1123
+ In the combination, you must combine any sections Entitled
1124
+ "History" in the various original documents, forming one section
1125
+ Entitled "History"; likewise combine any sections Entitled
1126
+ "Acknowledgements", and any sections Entitled "Dedications". You
1127
+ must delete all sections Entitled "Endorsements."
1128
+
1129
+ 6. COLLECTIONS OF DOCUMENTS
1130
+
1131
+ You may make a collection consisting of the Document and other
1132
+ documents released under this License, and replace the individual
1133
+ copies of this License in the various documents with a single copy
1134
+ that is included in the collection, provided that you follow the
1135
+ rules of this License for verbatim copying of each of the documents
1136
+ in all other respects.
1137
+
1138
+ You may extract a single document from such a collection, and
1139
+ distribute it individually under this License, provided you insert
1140
+ a copy of this License into the extracted document, and follow this
1141
+ License in all other respects regarding verbatim copying of that
1142
+ document.
1143
+
1144
+ 7. AGGREGATION WITH INDEPENDENT WORKS
1145
+
1146
+ A compilation of the Document or its derivatives with other
1147
+ separate and independent documents or works, in or on a volume of a
1148
+ storage or distribution medium, is called an "aggregate" if the
1149
+ copyright resulting from the compilation is not used to limit the
1150
+ legal rights of the compilation's users beyond what the individual
1151
+ works permit. When the Document is included in an aggregate, this
1152
+ License does not apply to the other works in the aggregate which
1153
+ are not themselves derivative works of the Document.
1154
+
1155
+ If the Cover Text requirement of section 3 is applicable to these
1156
+ copies of the Document, then if the Document is less than one half
1157
+ of the entire aggregate, the Document's Cover Texts may be placed
1158
+ on covers that bracket the Document within the aggregate, or the
1159
+ electronic equivalent of covers if the Document is in electronic
1160
+ form. Otherwise they must appear on printed covers that bracket
1161
+ the whole aggregate.
1162
+
1163
+ 8. TRANSLATION
1164
+
1165
+ Translation is considered a kind of modification, so you may
1166
+ distribute translations of the Document under the terms of section
1167
+ 4. Replacing Invariant Sections with translations requires special
1168
+ permission from their copyright holders, but you may include
1169
+ translations of some or all Invariant Sections in addition to the
1170
+ original versions of these Invariant Sections. You may include a
1171
+ translation of this License, and all the license notices in the
1172
+ Document, and any Warranty Disclaimers, provided that you also
1173
+ include the original English version of this License and the
1174
+ original versions of those notices and disclaimers. In case of a
1175
+ disagreement between the translation and the original version of
1176
+ this License or a notice or disclaimer, the original version will
1177
+ prevail.
1178
+
1179
+ If a section in the Document is Entitled "Acknowledgements",
1180
+ "Dedications", or "History", the requirement (section 4) to
1181
+ Preserve its Title (section 1) will typically require changing the
1182
+ actual title.
1183
+
1184
+ 9. TERMINATION
1185
+
1186
+ You may not copy, modify, sublicense, or distribute the Document
1187
+ except as expressly provided under this License. Any attempt
1188
+ otherwise to copy, modify, sublicense, or distribute it is void,
1189
+ and will automatically terminate your rights under this License.
1190
+
1191
+ However, if you cease all violation of this License, then your
1192
+ license from a particular copyright holder is reinstated (a)
1193
+ provisionally, unless and until the copyright holder explicitly and
1194
+ finally terminates your license, and (b) permanently, if the
1195
+ copyright holder fails to notify you of the violation by some
1196
+ reasonable means prior to 60 days after the cessation.
1197
+
1198
+ Moreover, your license from a particular copyright holder is
1199
+ reinstated permanently if the copyright holder notifies you of the
1200
+ violation by some reasonable means, this is the first time you have
1201
+ received notice of violation of this License (for any work) from
1202
+ that copyright holder, and you cure the violation prior to 30 days
1203
+ after your receipt of the notice.
1204
+
1205
+ Termination of your rights under this section does not terminate
1206
+ the licenses of parties who have received copies or rights from you
1207
+ under this License. If your rights have been terminated and not
1208
+ permanently reinstated, receipt of a copy of some or all of the
1209
+ same material does not give you any rights to use it.
1210
+
1211
+ 10. FUTURE REVISIONS OF THIS LICENSE
1212
+
1213
+ The Free Software Foundation may publish new, revised versions of
1214
+ the GNU Free Documentation License from time to time. Such new
1215
+ versions will be similar in spirit to the present version, but may
1216
+ differ in detail to address new problems or concerns. See
1217
+ <http://www.gnu.org/copyleft/>.
1218
+
1219
+ Each version of the License is given a distinguishing version
1220
+ number. If the Document specifies that a particular numbered
1221
+ version of this License "or any later version" applies to it, you
1222
+ have the option of following the terms and conditions either of
1223
+ that specified version or of any later version that has been
1224
+ published (not as a draft) by the Free Software Foundation. If the
1225
+ Document does not specify a version number of this License, you may
1226
+ choose any version ever published (not as a draft) by the Free
1227
+ Software Foundation. If the Document specifies that a proxy can
1228
+ decide which future versions of this License can be used, that
1229
+ proxy's public statement of acceptance of a version permanently
1230
+ authorizes you to choose that version for the Document.
1231
+
1232
+ 11. RELICENSING
1233
+
1234
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
1235
+ World Wide Web server that publishes copyrightable works and also
1236
+ provides prominent facilities for anybody to edit those works. A
1237
+ public wiki that anybody can edit is an example of such a server.
1238
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
1239
+ site means any set of copyrightable works thus published on the MMC
1240
+ site.
1241
+
1242
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
1243
+ license published by Creative Commons Corporation, a not-for-profit
1244
+ corporation with a principal place of business in San Francisco,
1245
+ California, as well as future copyleft versions of that license
1246
+ published by that same organization.
1247
+
1248
+ "Incorporate" means to publish or republish a Document, in whole or
1249
+ in part, as part of another Document.
1250
+
1251
+ An MMC is "eligible for relicensing" if it is licensed under this
1252
+ License, and if all works that were first published under this
1253
+ License somewhere other than this MMC, and subsequently
1254
+ incorporated in whole or in part into the MMC, (1) had no cover
1255
+ texts or invariant sections, and (2) were thus incorporated prior
1256
+ to November 1, 2008.
1257
+
1258
+ The operator of an MMC Site may republish an MMC contained in the
1259
+ site under CC-BY-SA on the same site at any time before August 1,
1260
+ 2009, provided the MMC is eligible for relicensing.
1261
+
1262
+ ADDENDUM: How to use this License for your documents
1263
+ ====================================================
1264
+
1265
+ To use this License in a document you have written, include a copy of
1266
+ the License in the document and put the following copyright and license
1267
+ notices just after the title page:
1268
+
1269
+ Copyright (C) YEAR YOUR NAME.
1270
+ Permission is granted to copy, distribute and/or modify this document
1271
+ under the terms of the GNU Free Documentation License, Version 1.3
1272
+ or any later version published by the Free Software Foundation;
1273
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
1274
+ Texts. A copy of the license is included in the section entitled ``GNU
1275
+ Free Documentation License''.
1276
+
1277
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
1278
+ Texts, replace the "with...Texts." line with this:
1279
+
1280
+ with the Invariant Sections being LIST THEIR TITLES, with
1281
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
1282
+ being LIST.
1283
+
1284
+ If you have Invariant Sections without Cover Texts, or some other
1285
+ combination of the three, merge those two alternatives to suit the
1286
+ situation.
1287
+
1288
+ If your document contains nontrivial examples of program code, we
1289
+ recommend releasing these examples in parallel under your choice of free
1290
+ software license, such as the GNU General Public License, to permit
1291
+ their use in free software.
1292
+
1293
+ 
1294
+ File: history.info, Node: Concept Index, Next: Function and Variable Index, Prev: GNU Free Documentation License, Up: Top
1295
+
1296
+ Appendix B Concept Index
1297
+ ************************
1298
+
1299
+ [index]
1300
+ * Menu:
1301
+
1302
+ * anchored search: Searching the History List.
1303
+ (line 10)
1304
+ * event designators: Event Designators. (line 6)
1305
+ * history events: Event Designators. (line 8)
1306
+ * history expansion: History Interaction. (line 6)
1307
+ * History Searching: Searching the History List.
1308
+ (line 6)
1309
+
1310
+ 
1311
+ File: history.info, Node: Function and Variable Index, Prev: Concept Index, Up: Top
1312
+
1313
+ Appendix C Function and Variable Index
1314
+ **************************************
1315
+
1316
+ [index]
1317
+ * Menu:
1318
+
1319
+ * add_history: History List Management.
1320
+ (line 9)
1321
+ * add_history_time: History List Management.
1322
+ (line 16)
1323
+ * append_history: Managing the History File.
1324
+ (line 28)
1325
+ * clear_history: History List Management.
1326
+ (line 37)
1327
+ * current_history: Information About the History List.
1328
+ (line 17)
1329
+ * free_history_entry: History List Management.
1330
+ (line 25)
1331
+ * get_history_event: History Expansion. (line 26)
1332
+ * history_arg_extract: History Expansion. (line 41)
1333
+ * history_base: History Variables. (line 9)
1334
+ * history_comment_char: History Variables. (line 37)
1335
+ * history_expand: History Expansion. (line 8)
1336
+ * history_expansion_char: History Variables. (line 29)
1337
+ * history_get: Information About the History List.
1338
+ (line 22)
1339
+ * history_get_history_state: Initializing History and State Management.
1340
+ (line 14)
1341
+ * history_get_time: Information About the History List.
1342
+ (line 29)
1343
+ * history_inhibit_expansion_function: History Variables. (line 77)
1344
+ * history_is_stifled: History List Management.
1345
+ (line 50)
1346
+ * history_length: History Variables. (line 12)
1347
+ * history_list: Information About the History List.
1348
+ (line 9)
1349
+ * history_max_entries: History Variables. (line 15)
1350
+ * history_no_expand_chars: History Variables. (line 52)
1351
+ * history_quotes_inhibit_expansion: History Variables. (line 57)
1352
+ * history_quoting_state: History Variables. (line 65)
1353
+ * history_search: Searching the History List.
1354
+ (line 12)
1355
+ * history_search_delimiter_chars: History Variables. (line 47)
1356
+ * history_search_pos: Searching the History List.
1357
+ (line 31)
1358
+ * history_search_prefix: Searching the History List.
1359
+ (line 21)
1360
+ * history_set_history_state: Initializing History and State Management.
1361
+ (line 18)
1362
+ * history_set_pos: Moving Around the History List.
1363
+ (line 9)
1364
+ * history_subst_char: History Variables. (line 33)
1365
+ * history_tokenize: History Expansion. (line 35)
1366
+ * history_total_bytes: Information About the History List.
1367
+ (line 33)
1368
+ * history_truncate_file: Managing the History File.
1369
+ (line 33)
1370
+ * history_word_delimiters: History Variables. (line 43)
1371
+ * history_write_timestamps: History Variables. (line 19)
1372
+ * next_history: Moving Around the History List.
1373
+ (line 19)
1374
+ * previous_history: Moving Around the History List.
1375
+ (line 14)
1376
+ * read_history: Managing the History File.
1377
+ (line 9)
1378
+ * read_history_range: Managing the History File.
1379
+ (line 14)
1380
+ * remove_history: History List Management.
1381
+ (line 20)
1382
+ * replace_history_entry: History List Management.
1383
+ (line 30)
1384
+ * stifle_history: History List Management.
1385
+ (line 40)
1386
+ * unstifle_history: History List Management.
1387
+ (line 44)
1388
+ * using_history: Initializing History and State Management.
1389
+ (line 10)
1390
+ * where_history: Information About the History List.
1391
+ (line 14)
1392
+ * write_history: Managing the History File.
1393
+ (line 22)
1394
+
1395
+
1396
+ 
1397
+ Tag Table:
1398
+ Node: Top850
1399
+ Node: Using History Interactively1495
1400
+ Node: History Interaction2003
1401
+ Node: Event Designators3901
1402
+ Node: Word Designators5175
1403
+ Node: Modifiers6935
1404
+ Node: Programming with GNU History8477
1405
+ Node: Introduction to History9221
1406
+ Node: History Storage10899
1407
+ Node: History Functions12034
1408
+ Node: Initializing History and State Management13023
1409
+ Node: History List Management13835
1410
+ Node: Information About the History List16129
1411
+ Node: Moving Around the History List17743
1412
+ Node: Searching the History List18836
1413
+ Node: Managing the History File20761
1414
+ Node: History Expansion22581
1415
+ Node: History Variables24510
1416
+ Node: History Programming Example28490
1417
+ Node: GNU Free Documentation License31167
1418
+ Node: Concept Index56339
1419
+ Node: Function and Variable Index57044
1420
+ 
1421
+ End Tag Table
1422
+
1423
+ 
1424
+ Local Variables:
1425
+ coding: utf-8
1426
+ End:
llava_next/share/info/libgomp.info ADDED
The diff for this file is too large to render. See raw diff
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (203 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__pycache__/quantization_config_pb2.cpython-310.pyc ADDED
Binary file (1.99 kB). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/stablehlo/__pycache__/quantization_options_pb2.cpython-310.pyc ADDED
Binary file (2.95 kB). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_algorithm.py ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Defines CalibrationAlgorithm for calculating min and max values calculated by calibration method."""
16
+ import abc
17
+ import itertools
18
+ import logging
19
+
20
+ import numpy as np
21
+
22
+ from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2 as quant_opts_pb2
23
+ from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2 as calib_stats_pb2
24
+
25
+
26
+ _CalibrationMethod = quant_opts_pb2.CalibrationOptions.CalibrationMethod
27
+ _REGISTRY = {}
28
+
29
+
30
+ def _implements(calib_method: _CalibrationMethod):
31
+ def decorator(cls):
32
+ assert calib_method not in _REGISTRY
33
+ _REGISTRY[calib_method] = cls
34
+ return cls
35
+
36
+ return decorator
37
+
38
+
39
+ class _CalibrationAlgorithmBase(abc.ABC):
40
+ """Abstract base class for calibration algorithm."""
41
+
42
+ def __init__(
43
+ self,
44
+ statistics: calib_stats_pb2.CalibrationStatistics,
45
+ calib_opts: quant_opts_pb2.CalibrationOptions,
46
+ ):
47
+ self._statistics = statistics
48
+ self._calib_opts = calib_opts
49
+
50
+ @abc.abstractmethod
51
+ def get_min_max_value(self) -> tuple[float, float]:
52
+ pass
53
+
54
+
55
+ class _HistogramCalibrationAlgorithmBase(_CalibrationAlgorithmBase):
56
+ """Base class for histogram calibrators."""
57
+
58
+ def __init__(
59
+ self,
60
+ statistics: calib_stats_pb2.CalibrationStatistics,
61
+ calib_opts: quant_opts_pb2.CalibrationOptions,
62
+ ):
63
+ """Builds histogram using statistics.histogram_statistics.
64
+
65
+ lower_bound hist_mid
66
+ v v
67
+ |=========|=========|=========|=========|=========|
68
+ bin width
69
+
70
+ Args:
71
+ statistics: Collected calibration statistics.
72
+ calib_opts: Calibration options used for calculating min and max.
73
+ """
74
+ super().__init__(statistics, calib_opts)
75
+ hist_stats = statistics.histogram_statistics
76
+ self._bin_width = hist_stats.bin_width
77
+ self._lower_bound = hist_stats.lower_bound
78
+ self._hist_freq = np.array(hist_stats.hist_freq)
79
+ self._num_bins = len(self._hist_freq)
80
+ self._num_bits = 8
81
+ # i-th bin has a range [bins[i], bins[i + 1]).
82
+ # bins[i] = lower_bound + i * bin_width
83
+ # bins[i + 1] = lower_bound + (i + 1) * bin_width
84
+ # So hist_mids[i] = (lower_bound + bin_width / 2) + bin_width * i
85
+ first_mid = self._lower_bound + self._bin_width / 2
86
+ last_mid = first_mid + (self._num_bins - 1) * self._bin_width
87
+ self._hist_mids = np.linspace(first_mid, last_mid, self._num_bins)
88
+
89
+ def _get_dequantized_hist_mids_after_quantize(
90
+ self, quant_min: float, quant_max: float
91
+ ) -> np.ndarray:
92
+ """Quantizes and dequantizes hist_mids using quant_min and quant_max.
93
+
94
+ Quantization converts the range of numbers from [quant_min, quant_max] to
95
+ [0, 2^num_bits - 1]. Values less than quant_min are converted to 0, and
96
+ values greater than quant_max are converted to 2^num_bits - 1.
97
+
98
+ The histogram represents the distribution of the data, and our goal is to
99
+ find the quant_min and quant_max that best describe this distribution. To do
100
+ this, we quantize hist_mids using quant_min and quant_max and dequantize
101
+ them again. Then the difference between hist_mids and dequantized hist_mids
102
+ equates to quantization error when using quant_min and quant_max.
103
+
104
+
105
+ Args:
106
+ quant_min: The minimum real value that can be represented by a quantized
107
+ value.
108
+ quant_max: The maximum real value that can be represented by a quantized
109
+ value.
110
+
111
+ Returns:
112
+ dequantized hist_mids after quantizing by quant_min and quant_max
113
+ """
114
+ maxbound = 2**self._num_bits - 1
115
+ minbound = 0
116
+ scale = (quant_max - quant_min) / maxbound
117
+ zero_point = -quant_min / scale
118
+
119
+ # Limit the range of zero_point and scale in case (quant_max - quant_min)
120
+ # is unusually small.
121
+ if abs(zero_point) > 9e9:
122
+ zero_point = 9e9
123
+ if abs(scale) < 1e-9:
124
+ scale = 1e-9
125
+
126
+ zero_point = round(zero_point)
127
+ quantized_hist_mids = np.clip(
128
+ np.round(self._hist_mids / scale) + zero_point, minbound, maxbound
129
+ )
130
+ dequantized_hist_mids = scale * (quantized_hist_mids - zero_point)
131
+ return dequantized_hist_mids
132
+
133
+ def _get_weighted_mean_squared_error(
134
+ self, quant_min, quant_max
135
+ ) -> tuple[float, float, float]:
136
+ """Gets mean squared error between hist_mids and dequantized hist_mids.
137
+
138
+ Quantization converts the range of numbers from [quant_min, quant_max] to
139
+ [0, 2^num_bits - 1]. Values less than quant_min are converted to 0, and
140
+ values greater than quant_max are converted to 2^num_bits - 1.
141
+
142
+ Args:
143
+ quant_min: The minimum real value that can be represented by a quantized
144
+ value.
145
+ quant_max: The maximum real value that can be represented by a quantized
146
+ value.
147
+
148
+ Returns:
149
+ (error, quant_min, quant_max): Tuple of weighted mean squared error.
150
+ error = (hist_mids - dequantized_hist_mids)**2 * hist_freq
151
+ """
152
+ dequantized_hist_mids = self._get_dequantized_hist_mids_after_quantize(
153
+ quant_min, quant_max
154
+ )
155
+ squared_error = (self._hist_mids - dequantized_hist_mids) ** 2
156
+ weighted_error = np.sum(squared_error * self._hist_freq)
157
+ return (weighted_error, quant_min, quant_max)
158
+
159
+ def _get_min_max_value_by_expanding_range(
160
+ self, start_idx: int
161
+ ) -> tuple[float, float]:
162
+ """Starting from start_idx, expand left and right alternately to find the min value of mse loss.
163
+
164
+ Args:
165
+ start_idx: Index to start quantization.
166
+
167
+ Returns:
168
+ (min_value, max_value): Min and max calculated.
169
+ """
170
+ # Tuple of (mse_error, quant_min, quant_max).
171
+ mse_min = (float('inf'), float('inf'), float('inf'))
172
+ left, right = start_idx, start_idx
173
+
174
+ # If this value is true, it moves left, otherwise it moves right.
175
+ move_left = True
176
+ while not (left == 0 and right == self._num_bins - 1):
177
+ # Decrease left if right can't be moved or move_left is true.
178
+ if (move_left and left > 0) or (right == self._num_bins - 1):
179
+ left = max(left - 1, 0)
180
+ # Else increase right.
181
+ else:
182
+ right = min(right + 1, self._num_bins - 1)
183
+ # Toogle the move_left.
184
+ move_left = not move_left
185
+ quant_min, quant_max = self._hist_mids[left], self._hist_mids[right]
186
+ mse_tuple = self._get_weighted_mean_squared_error(quant_min, quant_max)
187
+ mse_min = min(mse_tuple, mse_min)
188
+ # Extract (quant_min, quant_max) from (mse_error, quant_min, quant_max).
189
+ min_value, max_value = mse_min[1], mse_min[2]
190
+ return min_value, max_value
191
+
192
+
193
+ @_implements(_CalibrationMethod.CALIBRATION_METHOD_MIN_MAX)
194
+ class _MinMax(_CalibrationAlgorithmBase):
195
+ """MinMaxCalibrationAlgorithm for calculating min and max values of calibration result.
196
+
197
+ MinMax calibration calculates the global min and global max values.
198
+
199
+ global min = min of given sample inputs
200
+ global max = max of given sample inputs
201
+ """
202
+
203
+ def get_min_max_value(self) -> tuple[float, float]:
204
+ """Calculates the global min and max values.
205
+
206
+ Returns:
207
+ (min_value, max_value): Min and max calculated using MinMax
208
+ """
209
+ return (
210
+ self._statistics.min_max_statistics.global_min,
211
+ self._statistics.min_max_statistics.global_max,
212
+ )
213
+
214
+
215
+ @_implements(_CalibrationMethod.CALIBRATION_METHOD_AVERAGE_MIN_MAX)
216
+ class _AverageMinMax(_CalibrationAlgorithmBase):
217
+ """AverageMinMaxCalibrationAlgorithm for calculating min and max values of calibration result.
218
+
219
+ AverageMinMax calibration calculates the average of min and max values.
220
+ average of min = sum of min values / number of samples
221
+ average of max = sum of max values / number of samples
222
+ """
223
+
224
+ def get_min_max_value(self) -> tuple[float, float]:
225
+ """Calculates the average of min and max values.
226
+
227
+ Returns:
228
+ (min_value, max_value): Min and max calculated using AverageMinMax
229
+
230
+ Raises:
231
+ ValueError: num_samples is 0.
232
+ """
233
+ average_min_max_statistics = self._statistics.average_min_max_statistics
234
+ # num_samples is guaranteed to be larger than 0 because
235
+ # get_statistics_from_calibrator throws an exception if num_samples == 0.
236
+ num_samples = average_min_max_statistics.num_samples
237
+ if num_samples == 0:
238
+ raise ValueError(
239
+ 'num_samples must not be 0 when calibration method is'
240
+ f' AverageMinMax: {self._calib_opts}'
241
+ )
242
+ min_value, max_value = (
243
+ average_min_max_statistics.min_sum / num_samples,
244
+ average_min_max_statistics.max_sum / num_samples,
245
+ )
246
+
247
+ return min_value, max_value
248
+
249
+
250
+ @_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_PERCENTILE)
251
+ class _HistogramPercentile(_HistogramCalibrationAlgorithmBase):
252
+ """HistogramPercentile for calculating min and max values of calibration result."""
253
+
254
+ def get_min_max_value(self) -> tuple[float, float]:
255
+ """Calculates min and max from statistics using calibration options.
256
+
257
+ A "percentile" is a statistical concept that represents the value below
258
+ which a given percentage of data falls in a dataset. It involves sorting the
259
+ data from smallest to largest and then finding the value at a specified
260
+ percentage position. For example, the 0.01 percentile represents the value
261
+ in a given data set that corresponds to the lowest 0.01% of the data.
262
+
263
+ HistogramPercentile calibration uses min_percentile and max_percentile to
264
+ find min and max.
265
+
266
+ min_percentile and max_percentile must be in range [0, 100].
267
+ min_percentile is 0.001 by default.
268
+ max_percentile is 99.999 by default.
269
+
270
+ Returns:
271
+ (min_value, max_value): Min and max calculated using HistogramPercentile
272
+ """
273
+ total_freq = sum(self._hist_freq)
274
+ # hist_freq_cumsum is dividing cumulative sum of hist_freq by total_freq
275
+ # hist_freq_cumsum's value is in range [0, 1] by its definition
276
+ hist_freq_cumsum = np.cumsum(self._hist_freq) / total_freq
277
+
278
+ # min_percentile and max_percentile are converted from [0, 100] to [0, 1].
279
+ min_quantile, max_quantile = (
280
+ self._calib_opts.calibration_parameters.min_percentile / 100.0,
281
+ self._calib_opts.calibration_parameters.max_percentile / 100.0,
282
+ )
283
+
284
+ # Get index of min/max quantile.
285
+ min_quantile_idx, max_quantile_idx = (
286
+ np.searchsorted(hist_freq_cumsum, min_quantile, side='right'),
287
+ np.searchsorted(hist_freq_cumsum, max_quantile, side='left'),
288
+ )
289
+
290
+ # Get value of min/max quantile index.
291
+ min_value, max_value = (
292
+ self._hist_mids[min_quantile_idx],
293
+ self._hist_mids[max_quantile_idx],
294
+ )
295
+
296
+ return min_value, max_value
297
+
298
+
299
+ @_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_BRUTEFORCE)
300
+ class _HistogramMseBruteforce(_HistogramCalibrationAlgorithmBase):
301
+ """HistogramMseBruteforce for calculating min and max values of calibration result."""
302
+
303
+ def get_min_max_value(self) -> tuple[float, float]:
304
+ """Finds the optimal quant_min and quant_max by testing all possible cases.
305
+
306
+ It guarantees optimal quant_min and quant_max for the representative
307
+ dataset, but not for the test dataset.
308
+
309
+ Returns:
310
+ (min_value, max_value): Min and max calculated using
311
+ HistogramMseBruteforce.
312
+ """
313
+ if self._num_bins > 512:
314
+ logging.warning(
315
+ 'num_bins=%d is too large. The HISTOGRAM_MSE_BRUTEFORCE method tests'
316
+ ' all histogram mid value pairs, so it may take a long time.',
317
+ self._num_bins,
318
+ )
319
+ # Tuple of (mse_error, quant_min, quant_max).
320
+ mse_min = (float('inf'), float('inf'), float('inf'))
321
+
322
+ # Calculate the error for all hist_mid pairs.
323
+ for left, right in itertools.combinations(range(self._num_bins), 2):
324
+ quant_min, quant_max = self._hist_mids[left], self._hist_mids[right]
325
+ mse_tuple = self._get_weighted_mean_squared_error(quant_min, quant_max)
326
+ mse_min = min(mse_tuple, mse_min)
327
+ min_value, max_value = mse_min[1], mse_min[2]
328
+
329
+ return min_value, max_value
330
+
331
+
332
+ @_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_MAX_FREQUENCY)
333
+ class _HistogramMseMaxFrequency(_HistogramCalibrationAlgorithmBase):
334
+ """HistogramMseMaxFrequency for calculating min and max values of calibration result."""
335
+
336
+ def get_min_max_value(self) -> tuple[float, float]:
337
+ """Finds min and max starting from the index of the max frequency.
338
+
339
+ The HistogramMseMaxFrequency method starts from the bin with the highest
340
+ frequency and expands the range to both sides. This performs well when data
341
+ is well spread on both sides of the max frequency.
342
+
343
+ Returns:
344
+ (min_value, max_value): Min and max calculated using method to expand the
345
+ range based on max frequency.
346
+ """
347
+ # Find the index of max frequency.
348
+ freq_max_idx = np.argmax(self._hist_freq)
349
+ return self._get_min_max_value_by_expanding_range(freq_max_idx)
350
+
351
+
352
+ @_implements(_CalibrationMethod.CALIBRATION_METHOD_HISTOGRAM_MSE_SYMMETRIC)
353
+ class _HistogramMseSymmetric(_HistogramCalibrationAlgorithmBase):
354
+ """HistogramMseSymmetric for calculating min and max values of calibration result."""
355
+
356
+ def get_min_max_value(self) -> tuple[float, float]:
357
+ """Finds min and max starting from the center index.
358
+
359
+ The HistogramMseSymmetric method starts from the center bin and expands the
360
+ range to both sides. This works better when the data is well-centered.
361
+
362
+ Returns:
363
+ (min_value, max_value): Min and max calculated using the method starting
364
+ from center and expanding.
365
+ """
366
+
367
+ # This function is currently only called in this method, but will be used in
368
+ # other methods in the future.
369
+ return self._get_min_max_value_by_expanding_range(self._num_bins // 2)
370
+
371
+
372
+ def get_min_max_value(
373
+ statistics: calib_stats_pb2.CalibrationStatistics,
374
+ calib_opts: quant_opts_pb2.CalibrationOptions,
375
+ ) -> tuple[float, float]:
376
+ """Calculates min and max from statistics using calibration options.
377
+
378
+ Args:
379
+ statistics: Collected calibration statistics.
380
+ calib_opts: Calibration options used for calculating min and max.
381
+
382
+ Returns:
383
+ (min_value, max_value): Min and max calculated using calib_opts.
384
+
385
+ Raises:
386
+ ValueError: Unsupported calibration method is given.
387
+ """
388
+ calib_method = calib_opts.calibration_method
389
+ if calib_method not in _REGISTRY:
390
+ raise ValueError(f'Unsupported calibration method: {calib_method}')
391
+
392
+ calibration_algorithm = _REGISTRY[calib_method](statistics, calib_opts)
393
+ return calibration_algorithm.get_min_max_value()
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics_pb2.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+
15
+
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nXtensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics.proto\x12\x15tensorflow.calibrator\"\x9c\x04\n\x15\x43\x61librationStatistics\x12Y\n\x12min_max_statistics\x18\x01 \x01(\x0b\x32=.tensorflow.calibrator.CalibrationStatistics.MinMaxStatistics\x12h\n\x1a\x61verage_min_max_statistics\x18\x02 \x01(\x0b\x32\x44.tensorflow.calibrator.CalibrationStatistics.AverageMinMaxStatistics\x12^\n\x14histogram_statistics\x18\x03 \x01(\x0b\x32@.tensorflow.calibrator.CalibrationStatistics.HistogramStatistics\x1a:\n\x10MinMaxStatistics\x12\x12\n\nglobal_min\x18\x01 \x01(\x02\x12\x12\n\nglobal_max\x18\x02 \x01(\x02\x1aP\n\x17\x41verageMinMaxStatistics\x12\x0f\n\x07min_sum\x18\x01 \x01(\x02\x12\x0f\n\x07max_sum\x18\x02 \x01(\x02\x12\x13\n\x0bnum_samples\x18\x03 \x01(\x05\x1aP\n\x13HistogramStatistics\x12\x11\n\tbin_width\x18\x01 \x01(\x02\x12\x13\n\x0blower_bound\x18\x02 \x01(\x02\x12\x11\n\thist_freq\x18\x03 \x03(\x03\x42\x03\xf8\x01\x01\x62\x06proto3')
17
+
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.tensorflow.calibrator.calibration_statistics_pb2', globals())
20
+ if _descriptor._USE_C_DESCRIPTORS == False:
21
+
22
+ DESCRIPTOR._options = None
23
+ DESCRIPTOR._serialized_options = b'\370\001\001'
24
+ _CALIBRATIONSTATISTICS._serialized_start=116
25
+ _CALIBRATIONSTATISTICS._serialized_end=656
26
+ _CALIBRATIONSTATISTICS_MINMAXSTATISTICS._serialized_start=434
27
+ _CALIBRATIONSTATISTICS_MINMAXSTATISTICS._serialized_end=492
28
+ _CALIBRATIONSTATISTICS_AVERAGEMINMAXSTATISTICS._serialized_start=494
29
+ _CALIBRATIONSTATISTICS_AVERAGEMINMAXSTATISTICS._serialized_end=574
30
+ _CALIBRATIONSTATISTICS_HISTOGRAMSTATISTICS._serialized_start=576
31
+ _CALIBRATIONSTATISTICS_HISTOGRAMSTATISTICS._serialized_end=656
32
+ # @@protoc_insertion_point(module_scope)
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/pywrap_calibration.pyi ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2
16
+
17
+ # LINT.IfChange(clear_calibrator)
18
+ def clear_calibrator() -> None: ...
19
+
20
+ # LINT.ThenChange()
21
+
22
+ # LINT.IfChange(clear_data_from_calibrator)
23
+ def clear_data_from_calibrator(id: bytes) -> None: ...
24
+
25
+ # LINT.ThenChange()
26
+
27
+ # LINT.IfChange(get_statistics_from_calibrator)
28
+ def get_statistics_from_calibrator(
29
+ id: bytes,
30
+ ) -> calibration_statistics_pb2.CalibrationStatistics: ...
31
+
32
+ # LINT.ThenChange()
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/exported_model_pb2.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: tensorflow/compiler/mlir/quantization/tensorflow/exported_model.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from tensorflow.core.framework import graph_pb2 as tensorflow_dot_core_dot_framework_dot_graph__pb2
15
+ from tensorflow.core.protobuf import meta_graph_pb2 as tensorflow_dot_core_dot_protobuf_dot_meta__graph__pb2
16
+ from tensorflow.core.protobuf import saver_pb2 as tensorflow_dot_core_dot_protobuf_dot_saver__pb2
17
+
18
+
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nEtensorflow/compiler/mlir/quantization/tensorflow/exported_model.proto\x12\x17tensorflow.quantization\x1a%tensorflow/core/framework/graph.proto\x1a)tensorflow/core/protobuf/meta_graph.proto\x1a$tensorflow/core/protobuf/saver.proto\"\xbe\x03\n\rExportedModel\x12\'\n\tgraph_def\x18\x01 \x01(\x0b\x32\x14.tensorflow.GraphDef\x12\x16\n\x0einit_node_name\x18\x02 \x01(\t\x12\x16\n\x0e\x63heckpoint_dir\x18\x05 \x01(\t\x12U\n\x10\x66unction_aliases\x18\x06 \x03(\x0b\x32;.tensorflow.quantization.ExportedModel.FunctionAliasesEntry\x12\x31\n\x0f\x61sset_file_defs\x18\x08 \x03(\x0b\x32\x18.tensorflow.AssetFileDef\x12\'\n\tsaver_def\x18\n \x01(\x0b\x32\x14.tensorflow.SaverDef\x1a\x36\n\x14\x46unctionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x07\x10\x08J\x04\x08\t\x10\nR\x15variable_shared_namesR\x11restore_node_nameR\x0esave_node_nameR\x17\x66ile_prefix_tensor_nameB\x03\xf8\x01\x01\x62\x06proto3')
20
+
21
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
22
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.tensorflow.exported_model_pb2', globals())
23
+ if _descriptor._USE_C_DESCRIPTORS == False:
24
+
25
+ DESCRIPTOR._options = None
26
+ DESCRIPTOR._serialized_options = b'\370\001\001'
27
+ _EXPORTEDMODEL_FUNCTIONALIASESENTRY._options = None
28
+ _EXPORTEDMODEL_FUNCTIONALIASESENTRY._serialized_options = b'8\001'
29
+ _EXPORTEDMODEL._serialized_start=219
30
+ _EXPORTEDMODEL._serialized_end=665
31
+ _EXPORTEDMODEL_FUNCTIONALIASESENTRY._serialized_start=504
32
+ _EXPORTEDMODEL_FUNCTIONALIASESENTRY._serialized_end=558
33
+ # @@protoc_insertion_point(module_scope)
videochat2/lib/python3.10/site-packages/tensorflow/compiler/mlir/quantization/tensorflow/quantization_options_pb2.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: tensorflow/compiler/mlir/quantization/tensorflow/quantization_options.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nKtensorflow/compiler/mlir/quantization/tensorflow/quantization_options.proto\x12\x17tensorflow.quantization\x1a&tensorflow/core/framework/tensor.proto\"\xed\x02\n\x12QuantizationMethod\x12O\n\rpreset_method\x18\x04 \x01(\x0e\x32\x38.tensorflow.quantization.QuantizationMethod.PresetMethod\x12X\n\x1cquantization_component_specs\x18\x03 \x03(\x0b\x32\x32.tensorflow.quantization.QuantizationComponentSpec\"\xa5\x01\n\x0cPresetMethod\x12\x16\n\x12METHOD_UNSPECIFIED\x10\x00\x12\x16\n\x12METHOD_NO_QUANTIZE\x10\x01\x12\x1c\n\x18METHOD_STATIC_RANGE_INT8\x10\x02\x12\x1d\n\x19METHOD_DYNAMIC_RANGE_INT8\x10\x03\x12(\n$METHOD_STATIC_RANGE_WEIGHT_ONLY_INT8\x10\x04J\x04\x08\x01\x10\x03\"\xbe\x03\n\x19QuantizationComponentSpec\x12h\n\x16quantization_component\x18\x01 \x01(\x0e\x32H.tensorflow.quantization.QuantizationComponentSpec.QuantizationComponent\x12R\n\x0btensor_type\x18\x02 \x01(\x0e\x32=.tensorflow.quantization.QuantizationComponentSpec.TensorType\"v\n\x15QuantizationComponent\x12\x19\n\x15\x43OMPONENT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43OMPONENT_ACTIVATION\x10\x01\x12\x14\n\x10\x43OMPONENT_WEIGHT\x10\x02\x12\x12\n\x0e\x43OMPONENT_BIAS\x10\x03\"k\n\nTensorType\x12\x1a\n\x16TENSORTYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10TENSORTYPE_INT_4\x10\x01\x12\x14\n\x10TENSORTYPE_INT_8\x10\x02\x12\x15\n\x11TENSORTYPE_INT_32\x10\x03\"\x87\x02\n\x18UnitWiseQuantizationSpec\x12P\n\x04unit\x18\x05 \x03(\x0b\x32\x42.tensorflow.quantization.UnitWiseQuantizationSpec.QuantizationUnit\x12H\n\x13quantization_method\x18\x06 \x01(\x0b\x32+.tensorflow.quantization.QuantizationMethod\x1aI\n\x10QuantizationUnit\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x11\n\tnode_name\x18\x02 \x01(\t\x12\x11\n\tfunc_name\x18\x03 \x01(\tJ\x04\x08\x01\x10\x05\"\xf9\x04\n\x12\x43\x61librationOptions\x12Y\n\x12\x63\x61libration_method\x18\x01 \x01(\x0e\x32=.tensorflow.quantization.CalibrationOptions.CalibrationMethod\x12\x61\n\x16\x63\x61libration_parameters\x18\x02 \x01(\x0b\x32\x41.tensorflow.quantization.CalibrationOptions.CalibrationParameters\x1a\x61\n\x15\x43\x61librationParameters\x12\x18\n\x10initial_num_bins\x18\x01 \x01(\x05\x12\x16\n\x0emin_percentile\x18\x02 \x01(\x02\x12\x16\n\x0emax_percentile\x18\x03 \x01(\x02\"\xc1\x02\n\x11\x43\x61librationMethod\x12\"\n\x1e\x43\x41LIBRATION_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43\x41LIBRATION_METHOD_MIN_MAX\x10\x01\x12&\n\"CALIBRATION_METHOD_AVERAGE_MIN_MAX\x10\x02\x12+\n\'CALIBRATION_METHOD_HISTOGRAM_PERCENTILE\x10\x03\x12/\n+CALIBRATION_METHOD_HISTOGRAM_MSE_BRUTEFORCE\x10\x04\x12\x32\n.CALIBRATION_METHOD_HISTOGRAM_MSE_MAX_FREQUENCY\x10\x05\x12.\n*CALIBRATION_METHOD_HISTOGRAM_MSE_SYMMETRIC\x10\x06\"\xd4\x01\n\x18RepresentativeDataSample\x12\x65\n\x13tensor_proto_inputs\x18\x02 \x03(\x0b\x32H.tensorflow.quantization.RepresentativeDataSample.TensorProtoInputsEntry\x1aQ\n\x16TensorProtoInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tensorflow.TensorProto:\x02\x38\x01\"I\n\x19RepresentativeDatasetFile\x12\x1c\n\x12tfrecord_file_path\x18\x01 \x01(\tH\x00\x42\x0e\n\x0c\x64\x61taset_file\"\xad\x02\n\x0f\x44\x65\x62uggerOptions\x12L\n\rdebugger_type\x18\x01 \x01(\x0e\x32\x35.tensorflow.quantization.DebuggerOptions.DebuggerType\x12#\n\x1bunquantized_dump_model_path\x18\x02 \x01(\t\x12\x14\n\x0clog_dir_path\x18\x03 \x01(\t\"\x90\x01\n\x0c\x44\x65\x62uggerType\x12\x1d\n\x19\x44\x45\x42UGGER_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x44\x45\x42UGGER_TYPE_WHOLE_MODEL\x10\x01\x12\x1f\n\x1b\x44\x45\x42UGGER_TYPE_INT_PER_LAYER\x10\x02\x12!\n\x1d\x44\x45\x42UGGER_TYPE_FLOAT_PER_LAYER\x10\x03\"\xa5\x07\n\x13QuantizationOptions\x12H\n\x13quantization_method\x18\x01 \x01(\x0b\x32+.tensorflow.quantization.QuantizationMethod\x12.\n\x06op_set\x18\x02 \x01(\x0e\x32\x1e.tensorflow.quantization.OpSet\x12W\n\x1cunit_wise_quantization_specs\x18\x11 \x03(\x0b\x32\x31.tensorflow.quantization.UnitWiseQuantizationSpec\x12\x0c\n\x04tags\x18\x05 \x03(\t\x12\x16\n\x0esignature_keys\x18\x06 \x03(\t\x12i\n\x17representative_datasets\x18\x07 \x03(\x0b\x32H.tensorflow.quantization.QuantizationOptions.RepresentativeDatasetsEntry\x12$\n\x1cmin_num_elements_for_weights\x18\x08 \x01(\x03\x12!\n\x14\x66reeze_all_variables\x18\t \x01(\x08H\x00\x88\x01\x01\x12\'\n\x1f\x65nable_per_channel_quantization\x18\n \x01(\x08\x12 \n\x18\x65nable_two_input_tensors\x18\x0b \x01(\x08\x12-\n%experimental_enable_tpu_model_support\x18\x0c \x01(\x08\x12!\n\x19\x65nable_legacy_weight_only\x18\r \x01(\x08\x12$\n\x1c\x66orce_graph_mode_calibration\x18\x0e \x01(\x08\x12H\n\x13\x63\x61libration_options\x18\x0f \x01(\x0b\x32+.tensorflow.quantization.CalibrationOptions\x12\x42\n\x10\x64\x65\x62ugger_options\x18\x10 \x01(\x0b\x32(.tensorflow.quantization.DebuggerOptions\x1aq\n\x1bRepresentativeDatasetsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.tensorflow.quantization.RepresentativeDatasetFile:\x02\x38\x01\x42\x17\n\x15_freeze_all_variablesJ\x04\x08\x03\x10\x04*V\n\x05OpSet\x12\x16\n\x12OP_SET_UNSPECIFIED\x10\x00\x12\x06\n\x02TF\x10\x01\x12\x07\n\x03XLA\x10\x02\x12\x15\n\x11UNIFORM_QUANTIZED\x10\x03\x12\r\n\tSTABLEHLO\x10\x04\x42\x03\xf8\x01\x01\x62\x06proto3')
18
+
19
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
20
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.mlir.quantization.tensorflow.quantization_options_pb2', globals())
21
+ if _descriptor._USE_C_DESCRIPTORS == False:
22
+
23
+ DESCRIPTOR._options = None
24
+ DESCRIPTOR._serialized_options = b'\370\001\001'
25
+ _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._options = None
26
+ _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._serialized_options = b'8\001'
27
+ _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._options = None
28
+ _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._serialized_options = b'8\001'
29
+ _OPSET._serialized_start=3393
30
+ _OPSET._serialized_end=3479
31
+ _QUANTIZATIONMETHOD._serialized_start=145
32
+ _QUANTIZATIONMETHOD._serialized_end=510
33
+ _QUANTIZATIONMETHOD_PRESETMETHOD._serialized_start=339
34
+ _QUANTIZATIONMETHOD_PRESETMETHOD._serialized_end=504
35
+ _QUANTIZATIONCOMPONENTSPEC._serialized_start=513
36
+ _QUANTIZATIONCOMPONENTSPEC._serialized_end=959
37
+ _QUANTIZATIONCOMPONENTSPEC_QUANTIZATIONCOMPONENT._serialized_start=732
38
+ _QUANTIZATIONCOMPONENTSPEC_QUANTIZATIONCOMPONENT._serialized_end=850
39
+ _QUANTIZATIONCOMPONENTSPEC_TENSORTYPE._serialized_start=852
40
+ _QUANTIZATIONCOMPONENTSPEC_TENSORTYPE._serialized_end=959
41
+ _UNITWISEQUANTIZATIONSPEC._serialized_start=962
42
+ _UNITWISEQUANTIZATIONSPEC._serialized_end=1225
43
+ _UNITWISEQUANTIZATIONSPEC_QUANTIZATIONUNIT._serialized_start=1146
44
+ _UNITWISEQUANTIZATIONSPEC_QUANTIZATIONUNIT._serialized_end=1219
45
+ _CALIBRATIONOPTIONS._serialized_start=1228
46
+ _CALIBRATIONOPTIONS._serialized_end=1861
47
+ _CALIBRATIONOPTIONS_CALIBRATIONPARAMETERS._serialized_start=1440
48
+ _CALIBRATIONOPTIONS_CALIBRATIONPARAMETERS._serialized_end=1537
49
+ _CALIBRATIONOPTIONS_CALIBRATIONMETHOD._serialized_start=1540
50
+ _CALIBRATIONOPTIONS_CALIBRATIONMETHOD._serialized_end=1861
51
+ _REPRESENTATIVEDATASAMPLE._serialized_start=1864
52
+ _REPRESENTATIVEDATASAMPLE._serialized_end=2076
53
+ _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._serialized_start=1995
54
+ _REPRESENTATIVEDATASAMPLE_TENSORPROTOINPUTSENTRY._serialized_end=2076
55
+ _REPRESENTATIVEDATASETFILE._serialized_start=2078
56
+ _REPRESENTATIVEDATASETFILE._serialized_end=2151
57
+ _DEBUGGEROPTIONS._serialized_start=2154
58
+ _DEBUGGEROPTIONS._serialized_end=2455
59
+ _DEBUGGEROPTIONS_DEBUGGERTYPE._serialized_start=2311
60
+ _DEBUGGEROPTIONS_DEBUGGERTYPE._serialized_end=2455
61
+ _QUANTIZATIONOPTIONS._serialized_start=2458
62
+ _QUANTIZATIONOPTIONS._serialized_end=3391
63
+ _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._serialized_start=3247
64
+ _QUANTIZATIONOPTIONS_REPRESENTATIVEDATASETSENTRY._serialized_end=3360
65
+ # @@protoc_insertion_point(module_scope)
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2tensorrt/_pywrap_py_utils.pyi ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+
16
+ def get_linked_tensorrt_version() -> tuple[int,int,int]: ...
17
+ def get_loaded_tensorrt_version() -> tuple[int,int,int]: ...
18
+ def get_registered_op_converters() -> list[str]: ...
19
+ def is_tensorrt_enabled() -> bool: ...
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (182 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/__pycache__/tf2xla_pb2.cpython-310.pyc ADDED
Binary file (2.07 kB). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (186 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/ops/gen_xla_ops.py ADDED
The diff for this file is too large to render. See raw diff
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (189 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/__pycache__/xla.cpython-310.pyc ADDED
Binary file (16.6 kB). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/python/xla.py ADDED
@@ -0,0 +1,726 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Experimental library that exposes XLA operations directly in TensorFlow.
16
+
17
+ It is sometimes useful to be able to build HLO programs directly from
18
+ TensorFlow. This file provides Tensorflow operators that mirror the semantics of
19
+ HLO operators as closely as possible.
20
+
21
+ Note: Most of the operators defined in this module are used by the jax2tf
22
+ converter (see go/jax2tf for details) and are used in SavedModel produced
23
+ by jax2tf. Hence, we need to maintain backwards compatibility for these
24
+ operators. Please reach out to the JAX team if you want to make changes.
25
+ """
26
+
27
+ from tensorflow.compiler.tf2xla.ops import gen_xla_ops
28
+ from tensorflow.compiler.xla import xla_data_pb2
29
+ from tensorflow.core.framework import attr_value_pb2
30
+ from tensorflow.python.framework import constant_op
31
+ from tensorflow.python.framework import dtypes
32
+ from tensorflow.python.framework import ops
33
+ from tensorflow.python.ops import array_ops
34
+ from tensorflow.python.ops import bitwise_ops
35
+ from tensorflow.python.ops import gen_math_ops
36
+ from tensorflow.python.ops import gen_random_ops
37
+ from tensorflow.python.ops import math_ops
38
+ from tensorflow.python.ops import random_ops
39
+ from tensorflow.python.ops import random_ops_util
40
+ from tensorflow.python.ops import special_math_ops
41
+ from tensorflow.python.ops.numpy_ops import np_utils
42
+
43
+ # TODO(phawkins): provide wrappers for all XLA operators. Currently the missing
44
+ # ops include:
45
+ # infeed/outfeed (available via tf.contrib.tpu)
46
+ # collectives, e.g., cross-replica-sum (available via tf.contrib.tpu)
47
+ # conditional
48
+ # gather/scatter
49
+ # collapse
50
+
51
+ # This file reuses builtin names (following XLA's names, so we can call things
52
+ # like xla.max), so we capture the builtin versions here.
53
+ # pylint: disable=redefined-builtin
54
+ _max = max
55
+ _min = min
56
+ _slice = slice # pylint: disable=invalid-name
57
+
58
+ constant = constant_op.constant
59
+
60
+ # Unary operators.
61
+
62
+ # For most arithmetic operators there is a TensorFlow operator
63
+ # that exactly corresponds to each XLA operator. Rather than defining
64
+ # XLA-specific variants, we reuse the corresponding TensorFlow operator.
65
+ # TODO(phawkins): It would be even better to have TensorFlow operators that 1:1
66
+ # wrap every HLO operator, because that would allow us to be confident that the
67
+ # semantics match.
68
+
69
+
70
+ def _unary_op(fn):
71
+ """Wrapper that restricts `fn` to have the correct signature."""
72
+
73
+ def unary_op_wrapper(x, name=None):
74
+ return fn(x, name=name)
75
+
76
+ return unary_op_wrapper
77
+
78
+
79
+ abs = _unary_op(math_ops.abs)
80
+ # TODO(phawkins): implement clz.
81
+ conj = _unary_op(math_ops.conj)
82
+ cos = _unary_op(math_ops.cos)
83
+ ceil = _unary_op(math_ops.ceil)
84
+ digamma = _unary_op(math_ops.digamma)
85
+ erf = _unary_op(math_ops.erf)
86
+ erfc = _unary_op(math_ops.erfc)
87
+ erfinv = _unary_op(math_ops.erfinv)
88
+ ndtri = _unary_op(math_ops.ndtri)
89
+ exp = _unary_op(math_ops.exp)
90
+ expm1 = _unary_op(math_ops.expm1)
91
+ floor = _unary_op(math_ops.floor)
92
+ imag = _unary_op(math_ops.imag)
93
+ is_finite = _unary_op(math_ops.is_finite)
94
+ lgamma = _unary_op(math_ops.lgamma)
95
+ log = _unary_op(math_ops.log)
96
+ log1p = _unary_op(math_ops.log1p)
97
+ logical_not = _unary_op(math_ops.logical_not)
98
+ neg = _unary_op(math_ops.neg)
99
+ real = _unary_op(math_ops.real)
100
+ # TODO(phawkins): unlike xla::Round, this rounds to even instead of zero for
101
+ # numbers halfway between two integers.
102
+ round = _unary_op(math_ops.round)
103
+ sin = _unary_op(math_ops.sin)
104
+ sign = _unary_op(math_ops.sign)
105
+ tan = _unary_op(math_ops.tan)
106
+ tanh = _unary_op(math_ops.tanh)
107
+
108
+ # Bessel
109
+ bessel_i0e = _unary_op(special_math_ops.bessel_i0e)
110
+ bessel_i1e = _unary_op(special_math_ops.bessel_i1e)
111
+
112
+ # Binary operators
113
+
114
+ # The main difference between TensorFlow and XLA binary ops is the broadcasting
115
+ # semantics. TensorFlow uses Numpy-style broadcasting semantics, whereas XLA
116
+ # requires an explicit specification of which dimensions to broadcast if the
117
+ # arguments have different ranks.
118
+
119
+
120
+ def _broadcasting_binary_op(fn):
121
+ """Wraps a binary Tensorflow operator and performs XLA-style broadcasting."""
122
+
123
+ def broadcasting_binary_op_wrapper(x, y, broadcast_dims=None, name=None):
124
+ """Inner wrapper function."""
125
+ broadcast_dims = broadcast_dims or []
126
+ broadcast_dims = ops.convert_to_tensor(broadcast_dims, dtypes.int64)
127
+ # Rather than relying on having static shape information in the TensorFlow
128
+ # graph, we use an XlaBroadcastHelper op that can compute the correct shapes
129
+ # at JIT compilation time.
130
+ x, y = gen_xla_ops.xla_broadcast_helper(x, y, broadcast_dims)
131
+ return fn(x, y, name=name)
132
+
133
+ return broadcasting_binary_op_wrapper
134
+
135
+
136
+ # Map from TF signed types to TF unsigned types.
137
+ _SIGNED_TO_UNSIGNED_TABLE = {
138
+ dtypes.int8: dtypes.uint8,
139
+ dtypes.int16: dtypes.uint16,
140
+ dtypes.int32: dtypes.uint32,
141
+ dtypes.int64: dtypes.uint64,
142
+ }
143
+
144
+ # Map from TF unsigned types to TF signed types.
145
+ _UNSIGNED_TO_SIGNED_TABLE = {
146
+ dtypes.uint8: dtypes.int8,
147
+ dtypes.uint16: dtypes.int16,
148
+ dtypes.uint32: dtypes.int32,
149
+ dtypes.uint64: dtypes.int64,
150
+ }
151
+
152
+
153
+ def _shift_right_logical_helper(x, y, name=None):
154
+ """Performs an integer right logical shift irrespective of input type."""
155
+ assert y.dtype == x.dtype
156
+ dtype = x.dtype
157
+ signed = dtype in _SIGNED_TO_UNSIGNED_TABLE
158
+ if signed:
159
+ unsigned_dtype = _SIGNED_TO_UNSIGNED_TABLE[dtype]
160
+ x = math_ops.cast(x, unsigned_dtype)
161
+ y = math_ops.cast(y, unsigned_dtype)
162
+ output = bitwise_ops.right_shift(x, y, name=name)
163
+ if signed:
164
+ output = math_ops.cast(output, dtype)
165
+ return output
166
+
167
+
168
+ def _shift_right_arithmetic_helper(x, y, name=None):
169
+ """Performs an integer right arithmetic shift irrespective of input type."""
170
+ assert y.dtype == x.dtype
171
+ dtype = x.dtype
172
+ unsigned = dtype in _UNSIGNED_TO_SIGNED_TABLE
173
+ if unsigned:
174
+ signed_dtype = _UNSIGNED_TO_SIGNED_TABLE[dtype]
175
+ x = math_ops.cast(x, signed_dtype)
176
+ y = math_ops.cast(y, signed_dtype)
177
+ output = bitwise_ops.right_shift(x, y, name=name)
178
+ if unsigned:
179
+ output = math_ops.cast(output, dtype)
180
+ return output
181
+
182
+
183
+ add = _broadcasting_binary_op(math_ops.add)
184
+ sub = _broadcasting_binary_op(math_ops.sub)
185
+ mul = _broadcasting_binary_op(math_ops.mul)
186
+ div = _broadcasting_binary_op(math_ops.div)
187
+ rem = _broadcasting_binary_op(gen_math_ops.mod)
188
+ max = _broadcasting_binary_op(math_ops.maximum)
189
+ min = _broadcasting_binary_op(math_ops.minimum)
190
+ atan2 = _broadcasting_binary_op(math_ops.atan2)
191
+ complex = _broadcasting_binary_op(math_ops.complex)
192
+ logical_and = _broadcasting_binary_op(math_ops.logical_and)
193
+ logical_or = _broadcasting_binary_op(math_ops.logical_or)
194
+ logical_xor = _broadcasting_binary_op(math_ops.logical_xor)
195
+ eq = _broadcasting_binary_op(math_ops.equal)
196
+ ne = _broadcasting_binary_op(math_ops.not_equal)
197
+ ge = _broadcasting_binary_op(math_ops.greater_equal)
198
+ gt = _broadcasting_binary_op(math_ops.greater)
199
+ le = _broadcasting_binary_op(math_ops.less_equal)
200
+ lt = _broadcasting_binary_op(math_ops.less)
201
+ pow = _broadcasting_binary_op(math_ops.pow)
202
+ shift_left = _broadcasting_binary_op(bitwise_ops.left_shift)
203
+ shift_right_logical = _broadcasting_binary_op(_shift_right_logical_helper)
204
+ shift_right_arithmetic = _broadcasting_binary_op(_shift_right_arithmetic_helper)
205
+
206
+ igamma = _broadcasting_binary_op(math_ops.igamma)
207
+ igamma_grad_a = _broadcasting_binary_op(gen_math_ops.igamma_grad_a)
208
+ random_gamma_grad = _broadcasting_binary_op(gen_random_ops.random_gamma_grad)
209
+ igammac = _broadcasting_binary_op(math_ops.igammac)
210
+ polygamma = _broadcasting_binary_op(math_ops.polygamma)
211
+ zeta = _broadcasting_binary_op(math_ops.zeta)
212
+
213
+
214
+ def _binary_op(fn):
215
+ """Wrapper that restricts `fn` to have the correct signature."""
216
+
217
+ def binary_op_wrapper(x, y, name=None):
218
+ return fn(x, y, name=name)
219
+
220
+ return binary_op_wrapper
221
+
222
+
223
+ transpose = _binary_op(array_ops.transpose)
224
+ rev = _binary_op(array_ops.reverse)
225
+
226
+ bitcast_convert_type = array_ops.bitcast
227
+
228
+
229
+ def broadcast(x, dims, name=None):
230
+ x = ops.convert_to_tensor(x)
231
+ shape = array_ops.concat(
232
+ [constant_op.constant(dims), array_ops.shape(x)], axis=0
233
+ )
234
+ return array_ops.broadcast_to(x, shape, name=name)
235
+
236
+
237
+ def clamp(a, x, b, name=None):
238
+ return min(max(a, x, name=name), b, name=name)
239
+
240
+
241
+ concatenate = array_ops.concat
242
+
243
+
244
+ def conv(
245
+ lhs,
246
+ rhs,
247
+ window_strides,
248
+ padding,
249
+ lhs_dilation,
250
+ rhs_dilation,
251
+ dimension_numbers,
252
+ feature_group_count=1,
253
+ precision_config=None,
254
+ preferred_element_type=None,
255
+ name=None,
256
+ use_v2=False,
257
+ batch_group_count=1,
258
+ ):
259
+ """Wraps the XLA ConvGeneralDilated operator.
260
+
261
+ ConvGeneralDilated is the most general form of XLA convolution and is
262
+ documented at
263
+ https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution
264
+
265
+ Args:
266
+ lhs: the input tensor
267
+ rhs: the kernel tensor
268
+ window_strides: the inter-window strides
269
+ padding: the padding to apply at the start and end of each input dimensions
270
+ lhs_dilation: dilation to apply between input elements
271
+ rhs_dilation: dilation to apply between kernel elements
272
+ dimension_numbers: a `ConvolutionDimensionNumbers` proto.
273
+ feature_group_count: number of feature groups for grouped convolution.
274
+ precision_config: a `xla.PrecisionConfig` proto.
275
+ preferred_element_type: the result `dtype`.
276
+ name: an optional name for the operator.
277
+ use_v2: an optional request to use the XlaConvV2 op even if not necessary.
278
+ batch_group_count: number of batch groups or grouped filters.
279
+
280
+ Returns:
281
+ A tensor representing the output of the convolution.
282
+ """
283
+ precision_config_proto = ""
284
+ if precision_config:
285
+ precision_config_proto = precision_config.SerializeToString()
286
+ needs_v2 = (
287
+ preferred_element_type
288
+ or (lhs.dtype != rhs.dtype)
289
+ or batch_group_count > 1
290
+ )
291
+ if preferred_element_type is None:
292
+ preferred_element_type = np_utils.result_type(lhs.dtype, rhs.dtype)
293
+ if needs_v2 or use_v2:
294
+ return gen_xla_ops.xla_conv_v2(
295
+ lhs,
296
+ rhs,
297
+ window_strides=window_strides,
298
+ padding=padding,
299
+ lhs_dilation=lhs_dilation,
300
+ rhs_dilation=rhs_dilation,
301
+ feature_group_count=feature_group_count,
302
+ batch_group_count=batch_group_count,
303
+ dimension_numbers=dimension_numbers.SerializeToString(),
304
+ precision_config=precision_config_proto,
305
+ preferred_element_type=preferred_element_type,
306
+ name=name,
307
+ )
308
+ return gen_xla_ops.xla_conv(
309
+ lhs,
310
+ rhs,
311
+ window_strides=window_strides,
312
+ padding=padding,
313
+ lhs_dilation=lhs_dilation,
314
+ rhs_dilation=rhs_dilation,
315
+ feature_group_count=feature_group_count,
316
+ dimension_numbers=dimension_numbers.SerializeToString(),
317
+ precision_config=precision_config_proto,
318
+ name=name,
319
+ )
320
+
321
+
322
+ convert_element_type = math_ops.cast
323
+
324
+
325
+ def dot(lhs, rhs, name=None):
326
+ return math_ops.tensordot(lhs, rhs, axes=1, name=name)
327
+
328
+
329
+ DotDimensionNumbers = xla_data_pb2.DotDimensionNumbers
330
+ PrecisionConfig = xla_data_pb2.PrecisionConfig
331
+
332
+
333
+ def dot_general(
334
+ lhs,
335
+ rhs,
336
+ dimension_numbers,
337
+ precision_config=None,
338
+ preferred_element_type=None,
339
+ name=None,
340
+ use_v2=False,
341
+ ):
342
+ precision_config_proto = ""
343
+ if precision_config:
344
+ precision_config_proto = precision_config.SerializeToString()
345
+ needs_v2 = preferred_element_type or (lhs.dtype != rhs.dtype)
346
+ if preferred_element_type is None:
347
+ preferred_element_type = np_utils.result_type(lhs.dtype, rhs.dtype)
348
+ if needs_v2 or use_v2:
349
+ return gen_xla_ops.xla_dot_v2(
350
+ lhs,
351
+ rhs,
352
+ dimension_numbers=dimension_numbers.SerializeToString(),
353
+ precision_config=precision_config_proto,
354
+ preferred_element_type=preferred_element_type,
355
+ name=name,
356
+ )
357
+ return gen_xla_ops.xla_dot(
358
+ lhs,
359
+ rhs,
360
+ dimension_numbers=dimension_numbers.SerializeToString(),
361
+ precision_config=precision_config_proto,
362
+ name=name,
363
+ )
364
+
365
+
366
+ def self_adjoint_eig(a, lower, max_iter, epsilon):
367
+ return gen_xla_ops.xla_self_adjoint_eig(a, lower, max_iter, epsilon)
368
+
369
+
370
+ def svd(a, max_iter, epsilon, precision_config=None):
371
+ precision_config_proto = ""
372
+ if precision_config:
373
+ precision_config_proto = precision_config.SerializeToString()
374
+ return gen_xla_ops.xla_svd(a, max_iter, epsilon, precision_config_proto)
375
+
376
+
377
+ dynamic_slice = gen_xla_ops.xla_dynamic_slice
378
+ dynamic_update_slice = gen_xla_ops.xla_dynamic_update_slice
379
+ einsum = gen_xla_ops.xla_einsum
380
+
381
+ # TODO(phawkins): generalize tf.pad to support interior padding, and then remove
382
+ # the XLA-specific pad operator.
383
+ pad = gen_xla_ops.xla_pad
384
+
385
+
386
+ def random_normal(mu, sigma, dims, name=None):
387
+ mu = ops.convert_to_tensor(mu)
388
+ return random_ops.random_normal(
389
+ dims, mean=mu, stddev=sigma, dtype=mu.dtype, name=name
390
+ )
391
+
392
+
393
+ def random_uniform(minval, maxval, dims, name=None):
394
+ minval = ops.convert_to_tensor(minval)
395
+ return random_ops.random_uniform(
396
+ dims, minval, maxval, dtype=minval.dtype, name=name
397
+ )
398
+
399
+
400
+ def rng_bit_generator(algorithm, initial_state, shape, dtype):
401
+ """Stateless PRNG bit generator.
402
+
403
+ Wraps the XLA RngBitGenerator operator, documented at
404
+ https://www.tensorflow.org/performance/xla/operation_semantics#rngbitgenerator.
405
+
406
+ Args:
407
+ algorithm: The PRNG algorithm to use, one of tf.random.Algorithm.{PHILOX,
408
+ THREEFRY, AUTO_SELECT}.
409
+ initial_state: Initial state for the PRNG algorithm. For THREEFRY, it should
410
+ be a u64[2] and for PHILOX a u64[3].
411
+ shape: The output shape of the generated data.
412
+ dtype: The type of the tensor.
413
+
414
+ Returns:
415
+ a tuple with a new state and generated data of the given shape.
416
+ """
417
+ alg_int = random_ops_util.convert_alg_to_int(algorithm)
418
+ return gen_xla_ops.xla_rng_bit_generator(
419
+ alg_int, initial_state, shape, dtype=dtype
420
+ )
421
+
422
+
423
+ recv = gen_xla_ops.xla_recv
424
+ reduce = gen_xla_ops.xla_reduce
425
+ variadic_reduce = gen_xla_ops.xla_variadic_reduce_v2
426
+
427
+ ops.no_gradient("XlaVariadicReduce")
428
+
429
+
430
+ def reduce_window(
431
+ operand,
432
+ init,
433
+ reducer,
434
+ window_dimensions,
435
+ window_strides=None,
436
+ base_dilations=None,
437
+ window_dilations=None,
438
+ padding=None,
439
+ name=None,
440
+ ):
441
+ """Wraps the XLA ReduceWindow operator.
442
+
443
+ ReduceWindow is documented at
444
+ https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow .
445
+
446
+ Args:
447
+ operand: the input tensor
448
+ init: a scalar tensor representing the initial value for the reduction
449
+ reducer: a reduction function that combines a pair of scalars.
450
+ window_dimensions: shape of the window, as a list of integers
451
+ window_strides: inter-window strides, as a list of integers. Optional; if
452
+ omitted, defaults to strides of 1.
453
+ padding: padding to apply to 'operand'. List of (low, high) pairs of
454
+ integers that specify the padding to apply before and after each
455
+ dimension. Optional; if omitted, defaults to no padding.
456
+ name: the operator name, or None.
457
+
458
+ Returns:
459
+ A tensor that represents the output of the reduce_window operator.
460
+ """
461
+ window_strides = window_strides or [1] * len(window_dimensions)
462
+ base_dilations = base_dilations or [1] * len(window_dimensions)
463
+ window_dilations = window_dilations or [1] * len(window_dimensions)
464
+ padding = padding or [(0, 0)] * len(window_dimensions)
465
+ return gen_xla_ops.xla_reduce_window(
466
+ input=operand,
467
+ init_value=init,
468
+ window_dimensions=window_dimensions,
469
+ window_strides=window_strides,
470
+ base_dilations=base_dilations,
471
+ window_dilations=window_dilations,
472
+ padding=padding,
473
+ computation=reducer,
474
+ name=name,
475
+ )
476
+
477
+
478
+ replica_id = gen_xla_ops.xla_replica_id
479
+
480
+ # Set a static bound for the given input value as a hint to Xla compiler,
481
+ # returns the same value.
482
+ # Usage:
483
+ # def f(t, p):
484
+ # p = xla.set_bound(p, 3) # Tells xla the constraint that p <= 3.
485
+ # return t[:p] # xla knows the bound of the slice is 3.
486
+ set_bound = gen_xla_ops.xla_set_bound
487
+
488
+ # Make a static dimension into a xla bounded dynamic dimension. The current
489
+ # static dimension size will become the bound and the second operand becomes the
490
+ # dynamic size of the dimension.
491
+ #
492
+ # This should mostly be used for testing.
493
+ #
494
+ # def f():
495
+ # array = tf.convert_to_tensor([[1, 2, 3, 4, 5]])
496
+ # # Tells xla the valid size of the array is 3.
497
+ # dim = 0
498
+ # p = xla_set_dynamic_dimension_size(array, dim, 3)
499
+ # assert(reduce_sum(p) == 6) # xla knows only the first 3 elements are valid.
500
+ set_dynamic_dimension_size = gen_xla_ops.xla_set_dynamic_dimension_size
501
+
502
+ # Inverse of xla_set_dynamic_dimension_size. Make an xla bounded dynamic
503
+ # dimension into a static dimension. The bound of the size of dimension
504
+ # `dim_index` becomes the static dimension size.
505
+ remove_dynamic_dimension_size = gen_xla_ops.xla_remove_dynamic_dimension_size
506
+
507
+
508
+ def reshape(x, new_sizes, dimensions=None, name=None):
509
+ if dimensions is not None:
510
+ x = array_ops.transpose(x, dimensions)
511
+ x = array_ops.reshape(x, new_sizes, name=name)
512
+ return x
513
+
514
+
515
+ def select(condition, x, y, name=None):
516
+ return array_ops.where(condition, x, y, name)
517
+
518
+
519
+ select_and_scatter = gen_xla_ops.xla_select_and_scatter
520
+ send = gen_xla_ops.xla_send
521
+
522
+
523
+ def slice(x, start_dims, limit_dims, strides):
524
+ spec = [
525
+ _slice(start, limit, stride)
526
+ for (start, limit, stride) in zip(start_dims, limit_dims, strides)
527
+ ]
528
+ return x[tuple(spec)]
529
+
530
+
531
+ sharding = gen_xla_ops.xla_sharding
532
+
533
+
534
+ @ops.RegisterGradient("XlaSharding")
535
+ def _sharding_grad(op, grad):
536
+ """Gradient for XlaSharding op."""
537
+ sharding_attr = op.get_attr("sharding")
538
+ grad_sharding = gen_xla_ops.xla_sharding(
539
+ grad,
540
+ sharding=sharding_attr,
541
+ unspecified_dims=op.get_attr("unspecified_dims"),
542
+ )
543
+ # pylint: disable=protected-access
544
+ grad_sharding.op._set_attr(
545
+ "_XlaSharding", attr_value_pb2.AttrValue(s=sharding_attr)
546
+ )
547
+ return [grad_sharding]
548
+
549
+
550
+ spmd_full_to_shard_shape = gen_xla_ops.xla_spmd_full_to_shard_shape
551
+ spmd_shard_to_full_shape = gen_xla_ops.xla_spmd_shard_to_full_shape
552
+
553
+
554
+ @ops.RegisterGradient("XlaSpmdFullToShardShape")
555
+ def _spmd_full_to_shard_shape_grad(op, grad):
556
+ s2f = gen_xla_ops.xla_spmd_shard_to_full_shape(
557
+ grad,
558
+ manual_sharding=op.get_attr("manual_sharding"),
559
+ full_shape=op.inputs[0].shape.as_list(),
560
+ dim=op.get_attr("dim"),
561
+ unspecified_dims=op.get_attr("unspecified_dims"),
562
+ )
563
+ return [s2f]
564
+
565
+
566
+ @ops.RegisterGradient("XlaSpmdShardToFullShape")
567
+ def _spmd_shard_to_full_shape_grad(op, grad):
568
+ f2s = gen_xla_ops.xla_spmd_full_to_shard_shape(
569
+ grad,
570
+ manual_sharding=op.get_attr("manual_sharding"),
571
+ dim=op.get_attr("dim"),
572
+ unspecified_dims=op.get_attr("unspecified_dims"),
573
+ )
574
+ return [f2s]
575
+
576
+
577
+ sort = gen_xla_ops.xla_sort
578
+ key_value_sort = gen_xla_ops.xla_key_value_sort
579
+ variadic_sort = gen_xla_ops.xla_variadic_sort
580
+ while_loop = gen_xla_ops.xla_while
581
+ dequantize = gen_xla_ops.xla_dequantize
582
+ custom_call = gen_xla_ops.xla_custom_call
583
+
584
+
585
+ def custom_call_v2(
586
+ call_target_name,
587
+ operands,
588
+ result_specs,
589
+ backend_config=None,
590
+ has_side_effect=None,
591
+ name=None,
592
+ ):
593
+ """Emits an HLO `CustomCall` operation with multiple outputs.
594
+
595
+ See `CustomCall` specification at
596
+ https://tensorflow.org/xla/operation_semantics#customcall,
597
+ and `mhlo.custom_call` specification at
598
+ https://tensorflow.org/mlir/hlo_ops#mhlocustom_call_mlirmhlocustomcallop.
599
+
600
+ Args:
601
+ call_target_name: Name of the user function. The function signature must
602
+ conform to version 3 of the API, see
603
+ `API_VERSION_STATUS_RETURNING_UNIFIED`. All operands and results assumed
604
+ to be in the default layout.
605
+ operands: A sequence of tensors with possibly different types.
606
+ result_specs: A sequence of tensor specs for all results.
607
+ backend_config: A string that encodes a metadata for the backend. Empty
608
+ string by default.
609
+ has_side_effect: Indicates whether the custom call has side effects. `False`
610
+ by default.
611
+ name: Optional name of the operation.
612
+
613
+ Returns:
614
+ A tuple of output tensors.
615
+ """
616
+ return gen_xla_ops.xla_custom_call_v2(
617
+ operands=operands,
618
+ call_target_name=call_target_name,
619
+ backend_config="" if backend_config is None else backend_config,
620
+ has_side_effect=False if has_side_effect is None else has_side_effect,
621
+ result_dtypes=tuple(spec.dtype for spec in result_specs),
622
+ result_shapes=tuple(spec.shape for spec in result_specs),
623
+ name=name,
624
+ )
625
+
626
+
627
+ # pylint: disable=g-doc-args
628
+ # pylint: disable=g-doc-return-or-yield
629
+ def call_module(
630
+ args,
631
+ *,
632
+ version=4,
633
+ module,
634
+ Tout,
635
+ Sout,
636
+ platforms=(),
637
+ function_list=(),
638
+ has_token_input_output=False,
639
+ disabled_checks=(),
640
+ ):
641
+ """See documentation for the XlaCallModule op.
642
+
643
+ https://github.com/search?q=repo%3Atensorflow%2Ftensorflow+path%3Axla_ops.cc+xlacallmodule&type=code
644
+ """
645
+ res = gen_xla_ops.xla_call_module(
646
+ args,
647
+ version=version,
648
+ module=module,
649
+ dim_args_spec=(),
650
+ Tout=Tout,
651
+ Sout=Sout,
652
+ platforms=platforms,
653
+ function_list=function_list,
654
+ has_token_input_output=has_token_input_output,
655
+ disabled_checks=disabled_checks,
656
+ )
657
+ # Since XLACallModule op is stateful, zero return function will return the TF
658
+ # op under tf.function. It creates trouble for downstream codes.
659
+ # Here we force it return empty tuple to work around it.
660
+ # TODO(johnqiangzhang): Figure out a better way to handle control dependency.
661
+ if isinstance(res, ops.Operation):
662
+ res = ()
663
+ return res
664
+
665
+
666
+ def call_module_maximum_supported_version():
667
+ """Maximum version of XlaCallModule op supported.
668
+
669
+ See versioning details documentation for the XlaCallModule op at:
670
+ https://github.com/search?q=repo%3Atensorflow%2Ftensorflow+path%3Axla_call_module+%22int+VERSION_MAXIMUM_SUPPORTED%22&type=code
671
+ """
672
+ return 9
673
+
674
+ # pylint: enable=g-doc-args
675
+ # pylint: enable=g-doc-return-or-yield
676
+
677
+
678
+ def call_module_disable_check_platform():
679
+ # For use with xla_call_module.disabled_checks.
680
+ return "platform"
681
+
682
+
683
+ def gather(
684
+ operand,
685
+ start_indices,
686
+ dimension_numbers,
687
+ slice_sizes,
688
+ indices_are_sorted=False,
689
+ name=None,
690
+ ):
691
+ return gen_xla_ops.xla_gather(
692
+ operand,
693
+ start_indices,
694
+ slice_sizes=slice_sizes,
695
+ dimension_numbers=dimension_numbers.SerializeToString(),
696
+ indices_are_sorted=indices_are_sorted,
697
+ name=name,
698
+ )
699
+
700
+
701
+ def scatter(
702
+ operand,
703
+ scatter_indices,
704
+ updates,
705
+ update_computation,
706
+ dimension_numbers,
707
+ indices_are_sorted=False,
708
+ name=None,
709
+ ):
710
+ return gen_xla_ops.xla_scatter(
711
+ operand,
712
+ scatter_indices,
713
+ updates,
714
+ update_computation=update_computation,
715
+ dimension_numbers=dimension_numbers.SerializeToString(),
716
+ indices_are_sorted=indices_are_sorted,
717
+ name=name,
718
+ )
719
+
720
+
721
+ def optimization_barrier(*args):
722
+ return gen_xla_ops.xla_optimization_barrier(args)
723
+
724
+
725
+ def reduce_precision(operand, exponent_bits, mantissa_bits):
726
+ return gen_xla_ops.xla_reduce_precision(operand, exponent_bits, mantissa_bits)
videochat2/lib/python3.10/site-packages/tensorflow/compiler/tf2xla/tf2xla_pb2.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: tensorflow/compiler/tf2xla/tf2xla.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
15
+ from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2
16
+
17
+
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'tensorflow/compiler/tf2xla/tf2xla.proto\x12\x11tensorflow.tf2xla\x1a,tensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.proto\"3\n\x08TensorId\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x14\n\x0coutput_index\x18\x02 \x01(\x03\"\x8e\x01\n\x04\x46\x65\x65\x64\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x1b.tensorflow.tf2xla.TensorId\x12+\n\x05shape\x18\x02 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\"\n\x04type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\"\x8f\x01\n\x05\x46\x65tch\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x1b.tensorflow.tf2xla.TensorId\x12\x0c\n\x04name\x18\x02 \x01(\t\x12+\n\x05shape\x18\x03 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\"\n\x04type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\"\x8e\x01\n\x08Variable\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12+\n\x05shape\x18\x03 \x01(\x0b\x32\x1c.tensorflow.TensorShapeProto\x12\"\n\x04type\x18\x04 \x01(\x0e\x32\x14.tensorflow.DataType\x12\x10\n\x08readonly\x18\x05 \x01(\x08\"\x87\x01\n\x06\x43onfig\x12%\n\x04\x66\x65\x65\x64\x18\x01 \x03(\x0b\x32\x17.tensorflow.tf2xla.Feed\x12\'\n\x05\x66\x65tch\x18\x02 \x03(\x0b\x32\x18.tensorflow.tf2xla.Fetch\x12-\n\x08variable\x18\x03 \x03(\x0b\x32\x1b.tensorflow.tf2xla.VariableB*\n\x15org.tensorflow.tf2xlaB\x0cTf2XlaProtosP\x01\xf8\x01\x01\x62\x06proto3')
19
+
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tensorflow.compiler.tf2xla.tf2xla_pb2', globals())
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+
24
+ DESCRIPTOR._options = None
25
+ DESCRIPTOR._serialized_options = b'\n\025org.tensorflow.tf2xlaB\014Tf2XlaProtosP\001\370\001\001'
26
+ _TENSORID._serialized_start=147
27
+ _TENSORID._serialized_end=198
28
+ _FEED._serialized_start=201
29
+ _FEED._serialized_end=343
30
+ _FETCH._serialized_start=346
31
+ _FETCH._serialized_end=489
32
+ _VARIABLE._serialized_start=492
33
+ _VARIABLE._serialized_end=634
34
+ _CONFIG._serialized_start=637
35
+ _CONFIG._serialized_end=772
36
+ # @@protoc_insertion_point(module_scope)
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (179 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/__pycache__/xla_data_pb2.cpython-310.pyc ADDED
Binary file (10.1 kB). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (187 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/__pycache__/hlo_pb2.cpython-310.pyc ADDED
Binary file (10.8 kB). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/service/hlo_pb2.py ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: xla/service/hlo.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2
15
+ from tensorflow.compiler.xla import xla_data_pb2 as xla_dot_xla__data__pb2
16
+
17
+
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xla/service/hlo.proto\x12\x03xla\x1a\x19google/protobuf/any.proto\x1a\x12xla/xla_data.proto\"\xc5\x16\n\x13HloInstructionProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06opcode\x18\x02 \x01(\t\x12\x1e\n\x05shape\x18\x03 \x01(\x0b\x32\x0f.xla.ShapeProto\x12!\n\x08metadata\x18\x07 \x01(\x0b\x32\x0f.xla.OpMetadata\x12\"\n\x07literal\x18\x08 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x18\n\x10parameter_number\x18\t \x01(\x03\x12\x13\n\x0b\x66usion_kind\x18\x0b \x01(\t\x12\x13\n\x0btuple_index\x18\r \x01(\x03\x12\x12\n\ndimensions\x18\x0e \x03(\x03\x12\x1b\n\x06window\x18\x0f \x01(\x0b\x32\x0b.xla.Window\x12G\n\x1d\x63onvolution_dimension_numbers\x18\x10 \x01(\x0b\x32 .xla.ConvolutionDimensionNumbers\x12\x1b\n\x13\x66\x65\x61ture_group_count\x18\x32 \x01(\x03\x12\x19\n\x11\x62\x61tch_group_count\x18: \x01(\x03\x12\x42\n\x10slice_dimensions\x18\x11 \x03(\x0b\x32(.xla.HloInstructionProto.SliceDimensions\x12\x15\n\rexponent_bits\x18\x12 \x01(\x05\x12\x15\n\rmantissa_bits\x18\x13 \x01(\x05\x12\x1b\n\x13\x64ynamic_slice_sizes\x18\x14 \x03(\x03\x12*\n\x0epadding_config\x18\x15 \x01(\x0b\x32\x12.xla.PaddingConfig\x12\x16\n\x0eoutfeed_config\x18\x16 \x01(\x0c\x12-\n\x0c\x64istribution\x18\x17 \x01(\x0e\x32\x17.xla.RandomDistribution\x12\x0f\n\x07\x65psilon\x18\x18 \x01(\x02\x12\x15\n\rfeature_index\x18\x19 \x01(\x03\x12\x12\n\nchannel_id\x18\x1a \x01(\x03\x12\x15\n\rinfeed_config\x18\x1b \x01(\x0c\x12\x1a\n\x12\x63ustom_call_target\x18\x1c \x01(\t\x12&\n\routfeed_shape\x18\x1d \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x37\n\x15\x64ot_dimension_numbers\x18\x1e \x01(\x0b\x32\x18.xla.DotDimensionNumbers\x12\x1e\n\x08\x66\x66t_type\x18\x1f \x01(\x0e\x32\x0c.xla.FftType\x12\x12\n\nfft_length\x18 \x03(\x03\x12\x1c\n\x14\x63omparison_direction\x18? \x01(\t\x12=\n\x18gather_dimension_numbers\x18! \x01(\x0b\x32\x1b.xla.GatherDimensionNumbers\x12\x1a\n\x12gather_slice_sizes\x18\" \x03(\x03\x12\n\n\x02id\x18# \x01(\x03\x12\x13\n\x0boperand_ids\x18$ \x03(\x03\x12\x1f\n\x17\x63ontrol_predecessor_ids\x18% \x03(\x03\x12\x1e\n\x16\x63\x61lled_computation_ids\x18& \x03(\x03\x12!\n\x08sharding\x18( \x01(\x0b\x32\x0f.xla.OpSharding\x12\x16\n\x0e\x62\x61\x63kend_config\x18+ \x01(\x0c\x12)\n\x0ereplica_groups\x18\x31 \x03(\x0b\x32\x11.xla.ReplicaGroup\x12\x19\n\rall_reduce_id\x18- \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x15use_global_device_ids\x18G \x01(\x08\x12\x18\n\x10is_host_transfer\x18/ \x01(\x08\x12\x11\n\tis_stable\x18< \x01(\x08\x12?\n\x19scatter_dimension_numbers\x18\x30 \x01(\x0b\x32\x1c.xla.ScatterDimensionNumbers\x12.\n\x10precision_config\x18\x33 \x01(\x0b\x32\x14.xla.PrecisionConfig\x12.\n\x13source_target_pairs\x18\x34 \x03(\x0b\x32\x11.xla.SourceTarget\x12.\n\x15\x64omain_entry_sharding\x18\x36 \x01(\x0b\x32\x0f.xla.OpSharding\x12-\n\x14\x64omain_exit_sharding\x18\x37 \x01(\x0b\x32\x0f.xla.OpSharding\x12\x18\n\x10\x63onstrain_layout\x18\x38 \x01(\x08\x12\x33\n\x1aoperand_shapes_with_layout\x18\x39 \x03(\x0b\x32\x0f.xla.ShapeProto\x12=\n\x18triangular_solve_options\x18; \x01(\x0b\x32\x1b.xla.TriangularSolveOptions\x12.\n\x10\x63holesky_options\x18> \x01(\x0b\x32\x14.xla.CholeskyOptions\x12\x38\n\x15parameter_replication\x18= \x01(\x0b\x32\x19.xla.ParameterReplication\x12#\n\x1b\x63ustom_call_has_side_effect\x18\x41 \x01(\x08\x12;\n\x17output_operand_aliasing\x18J \x03(\x0b\x32\x1a.xla.OutputOperandAliasing\x12\x35\n\x14\x63ustom_call_schedule\x18L \x01(\x0e\x32\x17.xla.CustomCallSchedule\x12\r\n\x05\x64\x65lta\x18\x42 \x01(\x03\x12\x1a\n\x12indices_are_sorted\x18\x43 \x01(\x08\x12\x34\n\x13\x66rontend_attributes\x18\x44 \x01(\x0b\x32\x17.xla.FrontendAttributes\x12\x16\n\x0eunique_indices\x18\x45 \x01(\x08\x12+\n\rrng_algorithm\x18\x46 \x01(\x0e\x32\x14.xla.RandomAlgorithm\x12\x17\n\x0f\x63omparison_type\x18H \x01(\t\x12%\n\x19is_cross_program_prefetch\x18I \x01(\x08\x42\x02\x18\x01\x12&\n\x1c\x63ross_program_prefetch_index\x18P \x01(\x05H\x00\x12&\n\x0cpadding_type\x18K \x01(\x0e\x32\x10.xla.PaddingType\x12:\n\x17\x63ustom_call_api_version\x18M \x01(\x0e\x32\x19.xla.CustomCallApiVersion\x12\x1e\n\x16\x61sync_execution_thread\x18O \x01(\t\x12\t\n\x01k\x18Q \x01(\x03\x12\x0f\n\x07largest\x18U \x01(\x08\x12*\n\x0estatistics_viz\x18R \x01(\x0b\x32\x12.xla.StatisticsViz\x12-\n\x0c\x64ot_sparsity\x18V \x01(\x0b\x32\x17.xla.SparsityDescriptor\x1a?\n\x0fSliceDimensions\x12\r\n\x05start\x18\x01 \x01(\x03\x12\r\n\x05limit\x18\x02 \x01(\x03\x12\x0e\n\x06stride\x18\x03 \x01(\x03\x42\'\n%optional_cross_program_prefetch_indexJ\x04\x08\n\x10\x0bJ\x04\x08\x0c\x10\rJ\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08,\x10-J\x04\x08\x35\x10\x36J\x04\x08.\x10/J\x04\x08)\x10*J\x04\x08*\x10+J\x04\x08@\x10\x41J\x04\x08N\x10OJ\x04\x08S\x10TJ\x04\x08T\x10UR\x0eparameter_nameR\x1e\x66used_instructions_computationR\roperand_namesR\x19\x63ontrol_predecessor_namesR\x18\x63\x61lled_computation_namesR\x11replica_group_idsR\x12\x63ustom_call_opaqueR\x12\x61ll_reduce_barrier\"\xe9\x01\n\x13HloComputationProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x0cinstructions\x18\x02 \x03(\x0b\x32\x18.xla.HloInstructionProto\x12-\n\rprogram_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\x0f\n\x07root_id\x18\x06 \x01(\x03\x12\x1d\n\x15is_fusion_computation\x18\x07 \x01(\x08\x12\x18\n\x10\x65xecution_thread\x18\x08 \x01(\tJ\x04\x08\x03\x10\x04R\troot_name\"\xd8\x01\n\x10HloScheduleProto\x12\x37\n\tsequences\x18\x01 \x03(\x0b\x32$.xla.HloScheduleProto.SequencesEntry\x1a.\n\x13InstructionSequence\x12\x17\n\x0finstruction_ids\x18\x01 \x03(\x03\x1a[\n\x0eSequencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).xla.HloScheduleProto.InstructionSequence:\x02\x38\x01\"\xdb\x01\n\x18HloInputOutputAliasProto\x12>\n\x07\x65ntries\x18\x01 \x03(\x0b\x32-.xla.HloInputOutputAliasProto.AliasEntryProto\x1a\x7f\n\x0f\x41liasEntryProto\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x18\n\x10parameter_number\x18\x02 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x03 \x03(\x03\x12\x17\n\x04kind\x18\x04 \x01(\x0e\x32\t.xla.Kind\"\xa8\x01\n\x13HloBufferDonorProto\x12?\n\x07\x65ntries\x18\x01 \x03(\x0b\x32..xla.HloBufferDonorProto.BufferDonorEntryProto\x1aP\n\x15\x42ufferDonorEntryProto\x12\x18\n\x10parameter_number\x18\x01 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x02 \x03(\x03\"H\n\x14\x43rossProgramPrefetch\x12\x11\n\tparameter\x18\x01 \x01(\x03\x12\r\n\x05index\x18\x02 \x03(\x03\x12\x0e\n\x06offset\x18\x03 \x01(\x03\"\xdd\x02\n\x14StackFrameIndexProto\x12\x12\n\nfile_names\x18\x01 \x03(\t\x12\x16\n\x0e\x66unction_names\x18\x02 \x03(\t\x12>\n\x0e\x66ile_locations\x18\x03 \x03(\x0b\x32&.xla.StackFrameIndexProto.FileLocation\x12:\n\x0cstack_frames\x18\x04 \x03(\x0b\x32$.xla.StackFrameIndexProto.StackFrame\x1a\\\n\x0c\x46ileLocation\x12\x14\n\x0c\x66ile_name_id\x18\x01 \x01(\x05\x12\x18\n\x10\x66unction_name_id\x18\x02 \x01(\x05\x12\x0c\n\x04line\x18\x03 \x01(\x05\x12\x0e\n\x06\x63olumn\x18\x04 \x01(\x05\x1a?\n\nStackFrame\x12\x18\n\x10\x66ile_location_id\x18\x01 \x01(\x05\x12\x17\n\x0fparent_frame_id\x18\x02 \x01(\x05\"\xce\x08\n\x0eHloModuleProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65ntry_computation_name\x18\x02 \x01(\t\x12\x1c\n\x14\x65ntry_computation_id\x18\x06 \x01(\x03\x12.\n\x0c\x63omputations\x18\x03 \x03(\x0b\x32\x18.xla.HloComputationProto\x12\x32\n\x12host_program_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\'\n\x08schedule\x18\x07 \x01(\x0b\x32\x15.xla.HloScheduleProto\x12\x39\n\x12input_output_alias\x18\x08 \x01(\x0b\x32\x1d.xla.HloInputOutputAliasProto\x12.\n\x0c\x62uffer_donor\x18\x12 \x01(\x0b\x32\x18.xla.HloBufferDonorProto\x12;\n\x18\x63ross_program_prefetches\x18\n \x03(\x0b\x32\x19.xla.CrossProgramPrefetch\x12\x12\n\nis_dynamic\x18\x0b \x01(\x08\x12-\n\x14spmd_output_sharding\x18\x0c \x01(\x0b\x32\x0f.xla.OpSharding\x12\x32\n\x19spmd_parameters_shardings\x18\x0e \x03(\x0b\x32\x0f.xla.OpSharding\x12\"\n\x1ause_auto_spmd_partitioning\x18\x10 \x01(\x08\x12\x35\n\x0cprofile_info\x18\r \x03(\x0b\x32\x1f.xla.HloModuleProto.ProfileInfo\x12\x35\n\x11\x64\x65vice_assignment\x18\x0f \x01(\x0b\x32\x1a.xla.DeviceAssignmentProto\x12\x34\n\x11stack_frame_index\x18\x11 \x01(\x0b\x32\x19.xla.StackFrameIndexProto\x12\x34\n\x13\x66rontend_attributes\x18\x13 \x01(\x0b\x32\x17.xla.FrontendAttributes\x1a\xd1\x01\n\x0bProfileInfo\x12\x35\n\x0cprofile_type\x18\x01 \x01(\x0e\x32\x1f.xla.HloModuleProto.ProfileType\x12\x18\n\x10relative_speedup\x18\x02 \x01(\x01\x12*\n\x0eprofile_source\x18\x03 \x01(\x0e\x32\x12.xla.ProfileSource\x12\x30\n\x11\x63ompilation_event\x18\x04 \x01(\x0e\x32\x15.xla.CompilationEvent\x12\x13\n\x0b\x66ingerprint\x18\x05 \x01(\t\"E\n\x0bProfileType\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04\x46LAG\x10\x01\x12\n\n\x06\x46USION\x10\x02\x12\n\n\x06LAYOUT\x10\x03\x12\x07\n\x03\x44OT\x10\x04J\x04\x08\t\x10\nR\x19\x64ynamic_parameter_binding\"\xd0\x01\n\x12LogicalBufferProto\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x34\n\ndefined_at\x18\x03 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\x12\r\n\x05\x63olor\x18\x04 \x01(\x03\x1a[\n\x08Location\x12\x1c\n\x10instruction_name\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\x0einstruction_id\x18\x04 \x01(\x03\x12\x13\n\x0bshape_index\x18\x03 \x03(\x03J\x04\x08\x01\x10\x02\"\xf8\x02\n\x15\x42ufferAllocationProto\x12\r\n\x05index\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x17\n\x0fis_thread_local\x18\x03 \x01(\x08\x12\x10\n\x08is_tuple\x18\x0b \x01(\x08\x12&\n\x1eis_entry_computation_parameter\x18\x05 \x01(\x08\x12\x13\n\x0bis_constant\x18\x0c \x01(\x08\x12\x18\n\x10parameter_number\x18\x06 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\n \x03(\x03\x12\x16\n\x0emaybe_live_out\x18\x07 \x01(\x08\x12\r\n\x05\x63olor\x18\x08 \x01(\x03\x12\x35\n\x08\x61ssigned\x18\t \x03(\x0b\x32#.xla.BufferAllocationProto.Assigned\x1a\x43\n\x08\x41ssigned\x12\x19\n\x11logical_buffer_id\x18\x01 \x01(\x03\x12\x0e\n\x06offset\x18\x02 \x01(\x03\x12\x0c\n\x04size\x18\x03 \x01(\x03\"\xd6\x02\n\x12HeapSimulatorTrace\x12-\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1d.xla.HeapSimulatorTrace.Event\x12\x1f\n\x17whole_module_simulation\x18\x02 \x01(\x08\x12\x1f\n\x17\x62uffer_allocation_index\x18\x03 \x01(\x03\x1a\xce\x01\n\x05\x45vent\x12\x30\n\x04kind\x18\x01 \x01(\x0e\x32\".xla.HeapSimulatorTrace.Event.Kind\x12\x11\n\tbuffer_id\x18\x02 \x01(\x03\x12\x18\n\x10\x63omputation_name\x18\x03 \x01(\t\x12\x18\n\x10instruction_name\x18\x04 \x01(\t\x12\x1f\n\x17share_with_canonical_id\x18\x05 \x01(\x03\"+\n\x04Kind\x12\t\n\x05\x41LLOC\x10\x00\x12\x08\n\x04\x46REE\x10\x01\x12\x0e\n\nSHARE_WITH\x10\x02\"M\n\x13HloModuleGroupProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12(\n\x0bhlo_modules\x18\x02 \x03(\x0b\x32\x13.xla.HloModuleProto\"\xd6\x02\n\x15\x42ufferAssignmentProto\x12\x30\n\x0flogical_buffers\x18\x01 \x03(\x0b\x32\x17.xla.LogicalBufferProto\x12>\n\x0e\x62uffer_aliases\x18\x02 \x03(\x0b\x32&.xla.BufferAssignmentProto.BufferAlias\x12\x36\n\x12\x62uffer_allocations\x18\x03 \x03(\x0b\x32\x1a.xla.BufferAllocationProto\x12\x36\n\x15heap_simulator_traces\x18\x04 \x03(\x0b\x32\x17.xla.HeapSimulatorTrace\x1a[\n\x0b\x42ufferAlias\x12\x18\n\x10source_buffer_id\x18\x01 \x01(\x03\x12\x32\n\x08location\x18\x02 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\"~\n\x08HloProto\x12\'\n\nhlo_module\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x35\n\x11\x62uffer_assignment\x18\x03 \x01(\x0b\x32\x1a.xla.BufferAssignmentProtoJ\x04\x08\x02\x10\x03R\x0chlo_ordering\"\x8e\x01\n\x0bHloSnapshot\x12\x1a\n\x03hlo\x18\x01 \x01(\x0b\x32\r.xla.HloProto\x12$\n\targuments\x18\x02 \x03(\x0b\x32\x11.xla.LiteralProto\x12!\n\x06result\x18\x03 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x1a\n\x12\x65xecution_platform\x18\x04 \x01(\t\"\xb9\x01\n\x16HloModuleMetadataProto\x12\x1b\n\x13\x63\x61nonical_module_id\x18\x01 \x01(\x03\x12\x19\n\x11module_group_name\x18\x02 \x01(\t\x12\x1a\n\x12original_module_id\x18\x03 \x01(\x03\x12\x1e\n\x16partitioned_module_ids\x18\x04 \x03(\x03\x12+\n\rpass_metadata\x18\x05 \x03(\x0b\x32\x14.xla.HloPassMetadata\"\x99\x02\n\x0fHloPassMetadata\x12\x0f\n\x07pass_id\x18\x01 \x01(\x03\x12\x11\n\tpass_name\x18\x02 \x01(\t\x12\x15\n\rpipeline_name\x18\x03 \x01(\t\x12\x16\n\x0e\x64ump_filenames\x18\x04 \x03(\t\x12\x16\n\x0emodule_changed\x18\x05 \x01(\x08\x12\x11\n\tmodule_id\x18\x06 \x01(\x03\x12\x1f\n\x17module_group_module_ids\x18\x07 \x03(\x03\x12\x1c\n\x14start_timestamp_usec\x18\x08 \x01(\x03\x12\x1a\n\x12\x65nd_timestamp_usec\x18\t \x01(\x03\x12-\n\x0f\x63ustom_metadata\x18\n \x01(\x0b\x32\x14.google.protobuf.Any\"q\n\x19XlaRuntimeExecutableProto\x12-\n\x10hlo_module_proto\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x10\n\x08obj_file\x18\x03 \x01(\x0c\x12\x13\n\x0bmlir_module\x18\x04 \x01(\t*S\n\x12\x43ustomCallSchedule\x12\x11\n\rSCHEDULE_NONE\x10\x00\x12\x13\n\x0fSCHEDULE_LATEST\x10\x01\x12\x15\n\x11SCHEDULE_EARLIEST\x10\x02*\xb4\x01\n\x14\x43ustomCallApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\x18\n\x14\x41PI_VERSION_ORIGINAL\x10\x01\x12 \n\x1c\x41PI_VERSION_STATUS_RETURNING\x10\x02\x12(\n$API_VERSION_STATUS_RETURNING_UNIFIED\x10\x03\x12\x19\n\x15\x41PI_VERSION_TYPED_FFI\x10\x04*:\n\x04Kind\x12\x13\n\x0fUNDEFINED_ALIAS\x10\x00\x12\r\n\tMAY_ALIAS\x10\x01\x12\x0e\n\nMUST_ALIAS\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3')
19
+
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.service.hlo_pb2', globals())
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+
24
+ DESCRIPTOR._options = None
25
+ DESCRIPTOR._serialized_options = b'\370\001\001'
26
+ _HLOINSTRUCTIONPROTO.fields_by_name['all_reduce_id']._options = None
27
+ _HLOINSTRUCTIONPROTO.fields_by_name['all_reduce_id']._serialized_options = b'\030\001'
28
+ _HLOINSTRUCTIONPROTO.fields_by_name['is_cross_program_prefetch']._options = None
29
+ _HLOINSTRUCTIONPROTO.fields_by_name['is_cross_program_prefetch']._serialized_options = b'\030\001'
30
+ _HLOSCHEDULEPROTO_SEQUENCESENTRY._options = None
31
+ _HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_options = b'8\001'
32
+ _LOGICALBUFFERPROTO_LOCATION.fields_by_name['instruction_name']._options = None
33
+ _LOGICALBUFFERPROTO_LOCATION.fields_by_name['instruction_name']._serialized_options = b'\030\001'
34
+ _CUSTOMCALLSCHEDULE._serialized_start=7563
35
+ _CUSTOMCALLSCHEDULE._serialized_end=7646
36
+ _CUSTOMCALLAPIVERSION._serialized_start=7649
37
+ _CUSTOMCALLAPIVERSION._serialized_end=7829
38
+ _KIND._serialized_start=7831
39
+ _KIND._serialized_end=7889
40
+ _HLOINSTRUCTIONPROTO._serialized_start=78
41
+ _HLOINSTRUCTIONPROTO._serialized_end=2963
42
+ _HLOINSTRUCTIONPROTO_SLICEDIMENSIONS._serialized_start=2600
43
+ _HLOINSTRUCTIONPROTO_SLICEDIMENSIONS._serialized_end=2663
44
+ _HLOCOMPUTATIONPROTO._serialized_start=2966
45
+ _HLOCOMPUTATIONPROTO._serialized_end=3199
46
+ _HLOSCHEDULEPROTO._serialized_start=3202
47
+ _HLOSCHEDULEPROTO._serialized_end=3418
48
+ _HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE._serialized_start=3279
49
+ _HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE._serialized_end=3325
50
+ _HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_start=3327
51
+ _HLOSCHEDULEPROTO_SEQUENCESENTRY._serialized_end=3418
52
+ _HLOINPUTOUTPUTALIASPROTO._serialized_start=3421
53
+ _HLOINPUTOUTPUTALIASPROTO._serialized_end=3640
54
+ _HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO._serialized_start=3513
55
+ _HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO._serialized_end=3640
56
+ _HLOBUFFERDONORPROTO._serialized_start=3643
57
+ _HLOBUFFERDONORPROTO._serialized_end=3811
58
+ _HLOBUFFERDONORPROTO_BUFFERDONORENTRYPROTO._serialized_start=3731
59
+ _HLOBUFFERDONORPROTO_BUFFERDONORENTRYPROTO._serialized_end=3811
60
+ _CROSSPROGRAMPREFETCH._serialized_start=3813
61
+ _CROSSPROGRAMPREFETCH._serialized_end=3885
62
+ _STACKFRAMEINDEXPROTO._serialized_start=3888
63
+ _STACKFRAMEINDEXPROTO._serialized_end=4237
64
+ _STACKFRAMEINDEXPROTO_FILELOCATION._serialized_start=4080
65
+ _STACKFRAMEINDEXPROTO_FILELOCATION._serialized_end=4172
66
+ _STACKFRAMEINDEXPROTO_STACKFRAME._serialized_start=4174
67
+ _STACKFRAMEINDEXPROTO_STACKFRAME._serialized_end=4237
68
+ _HLOMODULEPROTO._serialized_start=4240
69
+ _HLOMODULEPROTO._serialized_end=5342
70
+ _HLOMODULEPROTO_PROFILEINFO._serialized_start=5029
71
+ _HLOMODULEPROTO_PROFILEINFO._serialized_end=5238
72
+ _HLOMODULEPROTO_PROFILETYPE._serialized_start=5240
73
+ _HLOMODULEPROTO_PROFILETYPE._serialized_end=5309
74
+ _LOGICALBUFFERPROTO._serialized_start=5345
75
+ _LOGICALBUFFERPROTO._serialized_end=5553
76
+ _LOGICALBUFFERPROTO_LOCATION._serialized_start=5462
77
+ _LOGICALBUFFERPROTO_LOCATION._serialized_end=5553
78
+ _BUFFERALLOCATIONPROTO._serialized_start=5556
79
+ _BUFFERALLOCATIONPROTO._serialized_end=5932
80
+ _BUFFERALLOCATIONPROTO_ASSIGNED._serialized_start=5865
81
+ _BUFFERALLOCATIONPROTO_ASSIGNED._serialized_end=5932
82
+ _HEAPSIMULATORTRACE._serialized_start=5935
83
+ _HEAPSIMULATORTRACE._serialized_end=6277
84
+ _HEAPSIMULATORTRACE_EVENT._serialized_start=6071
85
+ _HEAPSIMULATORTRACE_EVENT._serialized_end=6277
86
+ _HEAPSIMULATORTRACE_EVENT_KIND._serialized_start=6234
87
+ _HEAPSIMULATORTRACE_EVENT_KIND._serialized_end=6277
88
+ _HLOMODULEGROUPPROTO._serialized_start=6279
89
+ _HLOMODULEGROUPPROTO._serialized_end=6356
90
+ _BUFFERASSIGNMENTPROTO._serialized_start=6359
91
+ _BUFFERASSIGNMENTPROTO._serialized_end=6701
92
+ _BUFFERASSIGNMENTPROTO_BUFFERALIAS._serialized_start=6610
93
+ _BUFFERASSIGNMENTPROTO_BUFFERALIAS._serialized_end=6701
94
+ _HLOPROTO._serialized_start=6703
95
+ _HLOPROTO._serialized_end=6829
96
+ _HLOSNAPSHOT._serialized_start=6832
97
+ _HLOSNAPSHOT._serialized_end=6974
98
+ _HLOMODULEMETADATAPROTO._serialized_start=6977
99
+ _HLOMODULEMETADATAPROTO._serialized_end=7162
100
+ _HLOPASSMETADATA._serialized_start=7165
101
+ _HLOPASSMETADATA._serialized_end=7446
102
+ _XLARUNTIMEEXECUTABLEPROTO._serialized_start=7448
103
+ _XLARUNTIMEEXECUTABLEPROTO._serialized_end=7561
104
+ # @@protoc_insertion_point(module_scope)
videochat2/lib/python3.10/site-packages/tensorflow/compiler/xla/xla_data_pb2.py ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: xla/xla_data.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+
15
+
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12xla/xla_data.proto\x12\x03xla\"\xb7\x01\n\rPaddingConfig\x12=\n\ndimensions\x18\x01 \x03(\x0b\x32).xla.PaddingConfig.PaddingConfigDimension\x1ag\n\x16PaddingConfigDimension\x12\x18\n\x10\x65\x64ge_padding_low\x18\x01 \x01(\x03\x12\x19\n\x11\x65\x64ge_padding_high\x18\x02 \x01(\x03\x12\x18\n\x10interior_padding\x18\x03 \x01(\x03\"\x1f\n\tTileProto\x12\x12\n\ndimensions\x18\x01 \x03(\x03\"\x8c\x04\n\x0bLayoutProto\x12*\n\x0f\x64im_level_types\x18\t \x03(\x0e\x32\x11.xla.DimLevelType\x12\x12\n\ndim_unique\x18\r \x03(\x08\x12\x13\n\x0b\x64im_ordered\x18\x0e \x03(\x08\x12\x16\n\x0eminor_to_major\x18\x01 \x03(\x03\x12\x1d\n\x05tiles\x18\x06 \x03(\x0b\x32\x0e.xla.TileProto\x12*\n\"tail_padding_alignment_in_elements\x18\x10 \x01(\x03\x12\x1c\n\x14\x65lement_size_in_bits\x18\x07 \x01(\x03\x12\x14\n\x0cmemory_space\x18\x08 \x01(\x03\x12\x30\n\x14index_primitive_type\x18\x0b \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x32\n\x16pointer_primitive_type\x18\x0c \x01(\x0e\x32\x12.xla.PrimitiveType\x12\'\n\x0ephysical_shape\x18\n \x01(\x0b\x32\x0f.xla.ShapeProto\x12+\n#dynamic_shape_metadata_prefix_bytes\x18\x0f \x01(\x03J\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06R\x11padded_dimensionsR\rpadding_valueR\x06\x66ormatR\x13max_sparse_elements\"\xbd\x01\n\nShapeProto\x12(\n\x0c\x65lement_type\x18\x02 \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x12\n\ndimensions\x18\x03 \x03(\x03\x12%\n\x0ctuple_shapes\x18\x04 \x03(\x0b\x32\x0f.xla.ShapeProto\x12 \n\x06layout\x18\x05 \x01(\x0b\x32\x10.xla.LayoutProto\x12\x1c\n\x14is_dynamic_dimension\x18\x06 \x03(\x08J\x04\x08\x01\x10\x02R\x04rank\"r\n\x11ProgramShapeProto\x12#\n\nparameters\x18\x01 \x03(\x0b\x32\x0f.xla.ShapeProto\x12\x1f\n\x06result\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x17\n\x0fparameter_names\x18\x03 \x03(\t\"D\n\x10\x43omputationStats\x12\x12\n\nflop_count\x18\x01 \x01(\x01\x12\x1c\n\x14transcendental_count\x18\x02 \x01(\x01\"\xcb\x04\n\nOpMetadata\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x0f\n\x07op_name\x18\x02 \x01(\t\x12\x13\n\x0bsource_file\x18\x03 \x01(\t\x12\x13\n\x0bsource_line\x18\x04 \x01(\x05\x12*\n\x0cprofile_type\x18\x05 \x03(\x0e\x32\x10.xla.ProfileTypeB\x02\x18\x01\x12\x18\n\x10\x63reation_pass_id\x18\x06 \x01(\x03\x12 \n\x18logical_creation_pass_id\x18\x07 \x01(\x03\x12\'\n\x1fsize_of_generated_code_in_bytes\x18\x08 \x01(\x03\x12+\n#size_of_memory_working_set_in_bytes\x18\t \x01(\x03\x12\x31\n\x0cprofile_info\x18\n \x01(\x0b\x32\x1b.xla.OpMetadata.ProfileInfo\x12\x19\n\x11\x64\x65\x64uplicated_name\x18\x0c \x01(\t\x12\x17\n\x0fpreserve_layout\x18\r \x01(\x08\x12\x16\n\x0estack_frame_id\x18\x0f \x01(\x05\x1a\xad\x01\n\x0bProfileInfo\x12&\n\x0cprofile_type\x18\x01 \x03(\x0e\x32\x10.xla.ProfileType\x12\x18\n\x10relative_speedup\x18\x02 \x01(\x01\x12*\n\x0eprofile_source\x18\x03 \x01(\x0e\x32\x12.xla.ProfileSource\x12\x30\n\x11\x63ompilation_event\x18\x04 \x01(\x0e\x32\x15.xla.CompilationEventJ\x04\x08\x0e\x10\x0f\"\xe3\x01\n\x10\x45xecutionProfile\x12\x1d\n\x15\x63ompilation_cache_hit\x18\x01 \x01(\x08\x12\x17\n\x0f\x63ompile_time_ms\x18\x02 \x01(\x03\x12\x1b\n\x13\x63ompute_cycle_count\x18\x03 \x01(\x03\x12\x17\n\x0f\x63ompute_time_ns\x18\x04 \x01(\x03\x12$\n\x1c\x63ompute_and_transfer_time_ns\x18\x05 \x01(\x03\x12 \n\x18\x65xecutable_size_in_bytes\x18\x06 \x01(\x03\x12\x19\n\x11profile_cache_hit\x18\x07 \x01(\x08\"!\n\x0f\x45xecutionHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"\"\n\x10GlobalDataHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"4\n\x0c\x44\x65viceHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12\x14\n\x0c\x64\x65vice_count\x18\x02 \x01(\x03\"\xb4\x01\n\rChannelHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12,\n\x04type\x18\x02 \x01(\x0e\x32\x1e.xla.ChannelHandle.ChannelType\"e\n\x0b\x43hannelType\x12\x18\n\x14\x43HANNEL_TYPE_INVALID\x10\x00\x12\x14\n\x10\x44\x45VICE_TO_DEVICE\x10\x01\x12\x12\n\x0e\x44\x45VICE_TO_HOST\x10\x02\x12\x12\n\x0eHOST_TO_DEVICE\x10\x03\"\xc5\x01\n\x15\x44\x65viceAssignmentProto\x12\x15\n\rreplica_count\x18\x01 \x01(\x05\x12\x19\n\x11\x63omputation_count\x18\x02 \x01(\x05\x12I\n\x13\x63omputation_devices\x18\x03 \x03(\x0b\x32,.xla.DeviceAssignmentProto.ComputationDevice\x1a/\n\x11\x43omputationDevice\x12\x1a\n\x12replica_device_ids\x18\x01 \x03(\x05\"\xc4\x03\n\x0cLiteralProto\x12\x1e\n\x05shape\x18\x01 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\r\n\x05preds\x18\x02 \x03(\x08\x12\x0b\n\x03s4s\x18\x15 \x01(\x0c\x12\x0b\n\x03u4s\x18\x16 \x01(\x0c\x12\x0b\n\x03s8s\x18\x0f \x01(\x0c\x12\x0b\n\x03u8s\x18\x03 \x01(\x0c\x12\x0c\n\x04s32s\x18\x04 \x03(\x05\x12\x0c\n\x04s64s\x18\x05 \x03(\x03\x12\x0c\n\x04u32s\x18\x06 \x03(\r\x12\x0c\n\x04u64s\x18\x07 \x03(\x04\x12\x0c\n\x04\x66\x33\x32s\x18\x08 \x03(\x02\x12\x0c\n\x04\x66\x36\x34s\x18\t \x03(\x01\x12\x0c\n\x04\x63\x36\x34s\x18\x0c \x03(\x02\x12\r\n\x05\x63\x31\x32\x38s\x18\x12 \x03(\x01\x12)\n\x0etuple_literals\x18\n \x03(\x0b\x32\x11.xla.LiteralProto\x12\x0c\n\x04\x66\x31\x36s\x18\x0b \x01(\x0c\x12\r\n\x05\x62\x66\x31\x36s\x18\r \x01(\x0c\x12\x0c\n\x04u16s\x18\x10 \x01(\x0c\x12\x0c\n\x04s16s\x18\x11 \x01(\x0c\x12\x0f\n\x07\x66\x38\x65\x35m2s\x18\x13 \x01(\x0c\x12\x11\n\tf8e4m3fns\x18\x14 \x01(\x0c\x12\x16\n\x0e\x66\x38\x65\x34m3b11fnuzs\x18\x17 \x01(\x0c\x12\x13\n\x0b\x66\x38\x65\x35m2fnuzs\x18\x18 \x01(\x0c\x12\x13\n\x0b\x66\x38\x65\x34m3fnuzs\x18\x19 \x01(\x0c\x12\x16\n\x0esparse_indices\x18\x0e \x03(\x03\"\xa3\x01\n\x0fWindowDimension\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0e\n\x06stride\x18\x02 \x01(\x03\x12\x13\n\x0bpadding_low\x18\x03 \x01(\x03\x12\x14\n\x0cpadding_high\x18\x04 \x01(\x03\x12\x17\n\x0fwindow_dilation\x18\x05 \x01(\x03\x12\x15\n\rbase_dilation\x18\x06 \x01(\x03\x12\x17\n\x0fwindow_reversal\x18\x07 \x01(\x08\"2\n\x06Window\x12(\n\ndimensions\x18\x01 \x03(\x0b\x32\x14.xla.WindowDimension\"~\n\x16GatherDimensionNumbers\x12\x13\n\x0boffset_dims\x18\x01 \x03(\x03\x12\x1c\n\x14\x63ollapsed_slice_dims\x18\x02 \x03(\x03\x12\x17\n\x0fstart_index_map\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\"\x93\x01\n\x17ScatterDimensionNumbers\x12\x1a\n\x12update_window_dims\x18\x01 \x03(\x03\x12\x1c\n\x14inserted_window_dims\x18\x02 \x03(\x03\x12$\n\x1cscatter_dims_to_operand_dims\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\"\xd8\x02\n\x1b\x43onvolutionDimensionNumbers\x12\x1d\n\x15input_batch_dimension\x18\x07 \x01(\x03\x12\x1f\n\x17input_feature_dimension\x18\x08 \x01(\x03\x12 \n\x18input_spatial_dimensions\x18\x0b \x03(\x03\x12&\n\x1ekernel_input_feature_dimension\x18\x03 \x01(\x03\x12\'\n\x1fkernel_output_feature_dimension\x18\x04 \x01(\x03\x12!\n\x19kernel_spatial_dimensions\x18\x06 \x03(\x03\x12\x1e\n\x16output_batch_dimension\x18\t \x01(\x03\x12 \n\x18output_feature_dimension\x18\n \x01(\x03\x12!\n\x19output_spatial_dimensions\x18\x0c \x03(\x03\"\x99\x01\n\x13\x44otDimensionNumbers\x12\"\n\x1alhs_contracting_dimensions\x18\x01 \x03(\x03\x12\"\n\x1arhs_contracting_dimensions\x18\x02 \x03(\x03\x12\x1c\n\x14lhs_batch_dimensions\x18\x03 \x03(\x03\x12\x1c\n\x14rhs_batch_dimensions\x18\x04 \x03(\x03\"m\n\x12SparsityDescriptor\x12\x1f\n\x04type\x18\x01 \x01(\x0e\x32\x11.xla.SparsityType\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x11\n\tdimension\x18\x03 \x01(\x05\x12\t\n\x01n\x18\x04 \x01(\x05\x12\t\n\x01m\x18\x05 \x01(\x05\"\xdf\x01\n\x16TriangularSolveOptions\x12\x11\n\tleft_side\x18\x01 \x01(\x08\x12\r\n\x05lower\x18\x02 \x01(\x08\x12\x15\n\runit_diagonal\x18\x03 \x01(\x08\x12:\n\x0btranspose_a\x18\x04 \x01(\x0e\x32%.xla.TriangularSolveOptions.Transpose\"P\n\tTranspose\x12\x15\n\x11TRANSPOSE_INVALID\x10\x00\x12\x10\n\x0cNO_TRANSPOSE\x10\x01\x12\r\n\tTRANSPOSE\x10\x02\x12\x0b\n\x07\x41\x44JOINT\x10\x03\" \n\x0f\x43holeskyOptions\x12\r\n\x05lower\x18\x01 \x01(\x08\"!\n\x0bSortOptions\x12\x12\n\ndescending\x18\x01 \x01(\x08\"o\n\x12\x46rontendAttributes\x12-\n\x03map\x18\x01 \x03(\x0b\x32 .xla.FrontendAttributes.MapEntry\x1a*\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\tStatistic\x12\x11\n\tstat_name\x18\x01 \x01(\t\x12\x10\n\x08stat_val\x18\x02 \x01(\x01\"T\n\rStatisticsViz\x12\x1f\n\x17stat_index_to_visualize\x18\x01 \x01(\x03\x12\"\n\nstatistics\x18\x02 \x03(\x0b\x32\x0e.xla.Statistic\"\xd3\x04\n\nOpSharding\x12\"\n\x04type\x18\x01 \x01(\x0e\x32\x14.xla.OpSharding.Type\x12#\n\ntile_shape\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\"\n\x1atile_assignment_dimensions\x18\x03 \x03(\x03\x12\x1f\n\x17tile_assignment_devices\x18\x04 \x03(\x03\x12(\n\x0ftuple_shardings\x18\x05 \x03(\x0b\x32\x0f.xla.OpSharding\x12\"\n\x1areplicate_on_last_tile_dim\x18\x06 \x01(\x08\x12!\n\x08metadata\x18\x07 \x03(\x0b\x32\x0f.xla.OpMetadata\x12,\n\x0elast_tile_dims\x18\x08 \x03(\x0e\x32\x14.xla.OpSharding.Type\x12\x19\n\x11iota_reshape_dims\x18\t \x03(\x03\x12\x1b\n\x13iota_transpose_perm\x18\n \x03(\x05\x12\x16\n\x0eis_shard_group\x18\x0b \x01(\x08\x12\x16\n\x0eshard_group_id\x18\x0c \x01(\x03\x12\x38\n\x10shard_group_type\x18\r \x01(\x0e\x32\x1e.xla.OpSharding.ShardGroupType\"R\n\x04Type\x12\x0e\n\nREPLICATED\x10\x00\x12\x0b\n\x07MAXIMAL\x10\x01\x12\t\n\x05TUPLE\x10\x02\x12\t\n\x05OTHER\x10\x03\x12\n\n\x06MANUAL\x10\x04\x12\x0b\n\x07UNKNOWN\x10\x05\"\"\n\x0eShardGroupType\x12\x06\n\x02\x41S\x10\x00\x12\x08\n\x04LIKE\x10\x01\"#\n\x0cReplicaGroup\x12\x13\n\x0breplica_ids\x18\x01 \x03(\x03\".\n\x0cSourceTarget\x12\x0e\n\x06source\x18\x01 \x01(\x03\x12\x0e\n\x06target\x18\x02 \x01(\x03\"\x90\x01\n\x0fPrecisionConfig\x12\x39\n\x11operand_precision\x18\x01 \x03(\x0e\x32\x1e.xla.PrecisionConfig.Precision\"B\n\tPrecision\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\x0b\n\x07HIGHEST\x10\x02\x12\x11\n\rPACKED_NIBBLE\x10\x03\":\n\x14ParameterReplication\x12\"\n\x1areplicated_at_leaf_buffers\x18\x01 \x03(\x08\"{\n\x16WhileLoopBackendConfig\x12\x44\n\x10known_trip_count\x18\x01 \x01(\x0b\x32*.xla.WhileLoopBackendConfig.KnownTripCount\x1a\x1b\n\x0eKnownTripCount\x12\t\n\x01n\x18\x01 \x01(\x03\"g\n\x15OutputOperandAliasing\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x15\n\roperand_index\x18\x02 \x01(\x03\x12\x1b\n\x13operand_shape_index\x18\x03 \x03(\x03*\xb7\x02\n\rPrimitiveType\x12\x1a\n\x16PRIMITIVE_TYPE_INVALID\x10\x00\x12\x08\n\x04PRED\x10\x01\x12\x06\n\x02S4\x10\x15\x12\x06\n\x02S8\x10\x02\x12\x07\n\x03S16\x10\x03\x12\x07\n\x03S32\x10\x04\x12\x07\n\x03S64\x10\x05\x12\x06\n\x02U4\x10\x16\x12\x06\n\x02U8\x10\x06\x12\x07\n\x03U16\x10\x07\x12\x07\n\x03U32\x10\x08\x12\x07\n\x03U64\x10\t\x12\x07\n\x03\x46\x31\x36\x10\n\x12\x07\n\x03\x46\x33\x32\x10\x0b\x12\x08\n\x04\x42\x46\x31\x36\x10\x10\x12\x07\n\x03\x46\x36\x34\x10\x0c\x12\n\n\x06\x46\x38\x45\x35M2\x10\x13\x12\x0c\n\x08\x46\x38\x45\x34M3FN\x10\x14\x12\x11\n\rF8E4M3B11FNUZ\x10\x17\x12\x0e\n\nF8E5M2FNUZ\x10\x18\x12\x0e\n\nF8E4M3FNUZ\x10\x19\x12\x07\n\x03\x43\x36\x34\x10\x0f\x12\x08\n\x04\x43\x31\x32\x38\x10\x12\x12\t\n\x05TUPLE\x10\r\x12\x0f\n\x0bOPAQUE_TYPE\x10\x0e\x12\t\n\x05TOKEN\x10\x11*^\n\x0c\x44imLevelType\x12\r\n\tDIM_DENSE\x10\x00\x12\x12\n\x0e\x44IM_COMPRESSED\x10\x01\x12\x11\n\rDIM_SINGLETON\x10\x02\x12\x18\n\x14\x44IM_LOOSE_COMPRESSED\x10\x03*=\n\x0bProfileType\x12\x0b\n\x07INVALID\x10\x00\x12\n\n\x06WINDOW\x10\x01\x12\x08\n\x04\x46LAG\x10\x02\x12\x0b\n\x07INTEGER\x10\x03*j\n\rProfileSource\x12!\n\x1dPROFILE_SOURCE_UNKNOWN_SOURCE\x10\x00\x12\x1b\n\x17PROFILE_SOURCE_EMBEDDED\x10\x01\x12\x19\n\x15PROFILE_SOURCE_REMOTE\x10\x02*\x85\x01\n\x10\x43ompilationEvent\x12#\n\x1f\x43OMPILATION_EVENT_UNKNOWN_EVENT\x10\x00\x12\'\n#COMPILATION_EVENT_FIRST_COMPILATION\x10\x01\x12#\n\x1f\x43OMPILATION_EVENT_RECOMPILATION\x10\x02*G\n\x0bPaddingType\x12\x13\n\x0fPADDING_INVALID\x10\x00\x12\x11\n\rPADDING_VALID\x10\x01\x12\x10\n\x0cPADDING_SAME\x10\x02*1\n\x07\x46\x66tType\x12\x07\n\x03\x46\x46T\x10\x00\x12\x08\n\x04IFFT\x10\x01\x12\x08\n\x04RFFT\x10\x02\x12\t\n\x05IRFFT\x10\x03*A\n\x0cSparsityType\x12\x14\n\x10SPARSITY_INVALID\x10\x00\x12\x1b\n\x17SPARSITY_STRUCTURED_N_M\x10\x01*F\n\x12RandomDistribution\x12\x0f\n\x0bRNG_INVALID\x10\x00\x12\x0f\n\x0bRNG_UNIFORM\x10\x01\x12\x0e\n\nRNG_NORMAL\x10\x02*E\n\x0fRandomAlgorithm\x12\x0f\n\x0bRNG_DEFAULT\x10\x00\x12\x11\n\rRNG_THREE_FRY\x10\x01\x12\x0e\n\nRNG_PHILOX\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3')
17
+
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xla.xla_data_pb2', globals())
20
+ if _descriptor._USE_C_DESCRIPTORS == False:
21
+
22
+ DESCRIPTOR._options = None
23
+ DESCRIPTOR._serialized_options = b'\370\001\001'
24
+ _OPMETADATA.fields_by_name['profile_type']._options = None
25
+ _OPMETADATA.fields_by_name['profile_type']._serialized_options = b'\030\001'
26
+ _FRONTENDATTRIBUTES_MAPENTRY._options = None
27
+ _FRONTENDATTRIBUTES_MAPENTRY._serialized_options = b'8\001'
28
+ _PRIMITIVETYPE._serialized_start=5709
29
+ _PRIMITIVETYPE._serialized_end=6020
30
+ _DIMLEVELTYPE._serialized_start=6022
31
+ _DIMLEVELTYPE._serialized_end=6116
32
+ _PROFILETYPE._serialized_start=6118
33
+ _PROFILETYPE._serialized_end=6179
34
+ _PROFILESOURCE._serialized_start=6181
35
+ _PROFILESOURCE._serialized_end=6287
36
+ _COMPILATIONEVENT._serialized_start=6290
37
+ _COMPILATIONEVENT._serialized_end=6423
38
+ _PADDINGTYPE._serialized_start=6425
39
+ _PADDINGTYPE._serialized_end=6496
40
+ _FFTTYPE._serialized_start=6498
41
+ _FFTTYPE._serialized_end=6547
42
+ _SPARSITYTYPE._serialized_start=6549
43
+ _SPARSITYTYPE._serialized_end=6614
44
+ _RANDOMDISTRIBUTION._serialized_start=6616
45
+ _RANDOMDISTRIBUTION._serialized_end=6686
46
+ _RANDOMALGORITHM._serialized_start=6688
47
+ _RANDOMALGORITHM._serialized_end=6757
48
+ _PADDINGCONFIG._serialized_start=28
49
+ _PADDINGCONFIG._serialized_end=211
50
+ _PADDINGCONFIG_PADDINGCONFIGDIMENSION._serialized_start=108
51
+ _PADDINGCONFIG_PADDINGCONFIGDIMENSION._serialized_end=211
52
+ _TILEPROTO._serialized_start=213
53
+ _TILEPROTO._serialized_end=244
54
+ _LAYOUTPROTO._serialized_start=247
55
+ _LAYOUTPROTO._serialized_end=771
56
+ _SHAPEPROTO._serialized_start=774
57
+ _SHAPEPROTO._serialized_end=963
58
+ _PROGRAMSHAPEPROTO._serialized_start=965
59
+ _PROGRAMSHAPEPROTO._serialized_end=1079
60
+ _COMPUTATIONSTATS._serialized_start=1081
61
+ _COMPUTATIONSTATS._serialized_end=1149
62
+ _OPMETADATA._serialized_start=1152
63
+ _OPMETADATA._serialized_end=1739
64
+ _OPMETADATA_PROFILEINFO._serialized_start=1560
65
+ _OPMETADATA_PROFILEINFO._serialized_end=1733
66
+ _EXECUTIONPROFILE._serialized_start=1742
67
+ _EXECUTIONPROFILE._serialized_end=1969
68
+ _EXECUTIONHANDLE._serialized_start=1971
69
+ _EXECUTIONHANDLE._serialized_end=2004
70
+ _GLOBALDATAHANDLE._serialized_start=2006
71
+ _GLOBALDATAHANDLE._serialized_end=2040
72
+ _DEVICEHANDLE._serialized_start=2042
73
+ _DEVICEHANDLE._serialized_end=2094
74
+ _CHANNELHANDLE._serialized_start=2097
75
+ _CHANNELHANDLE._serialized_end=2277
76
+ _CHANNELHANDLE_CHANNELTYPE._serialized_start=2176
77
+ _CHANNELHANDLE_CHANNELTYPE._serialized_end=2277
78
+ _DEVICEASSIGNMENTPROTO._serialized_start=2280
79
+ _DEVICEASSIGNMENTPROTO._serialized_end=2477
80
+ _DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE._serialized_start=2430
81
+ _DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE._serialized_end=2477
82
+ _LITERALPROTO._serialized_start=2480
83
+ _LITERALPROTO._serialized_end=2932
84
+ _WINDOWDIMENSION._serialized_start=2935
85
+ _WINDOWDIMENSION._serialized_end=3098
86
+ _WINDOW._serialized_start=3100
87
+ _WINDOW._serialized_end=3150
88
+ _GATHERDIMENSIONNUMBERS._serialized_start=3152
89
+ _GATHERDIMENSIONNUMBERS._serialized_end=3278
90
+ _SCATTERDIMENSIONNUMBERS._serialized_start=3281
91
+ _SCATTERDIMENSIONNUMBERS._serialized_end=3428
92
+ _CONVOLUTIONDIMENSIONNUMBERS._serialized_start=3431
93
+ _CONVOLUTIONDIMENSIONNUMBERS._serialized_end=3775
94
+ _DOTDIMENSIONNUMBERS._serialized_start=3778
95
+ _DOTDIMENSIONNUMBERS._serialized_end=3931
96
+ _SPARSITYDESCRIPTOR._serialized_start=3933
97
+ _SPARSITYDESCRIPTOR._serialized_end=4042
98
+ _TRIANGULARSOLVEOPTIONS._serialized_start=4045
99
+ _TRIANGULARSOLVEOPTIONS._serialized_end=4268
100
+ _TRIANGULARSOLVEOPTIONS_TRANSPOSE._serialized_start=4188
101
+ _TRIANGULARSOLVEOPTIONS_TRANSPOSE._serialized_end=4268
102
+ _CHOLESKYOPTIONS._serialized_start=4270
103
+ _CHOLESKYOPTIONS._serialized_end=4302
104
+ _SORTOPTIONS._serialized_start=4304
105
+ _SORTOPTIONS._serialized_end=4337
106
+ _FRONTENDATTRIBUTES._serialized_start=4339
107
+ _FRONTENDATTRIBUTES._serialized_end=4450
108
+ _FRONTENDATTRIBUTES_MAPENTRY._serialized_start=4408
109
+ _FRONTENDATTRIBUTES_MAPENTRY._serialized_end=4450
110
+ _STATISTIC._serialized_start=4452
111
+ _STATISTIC._serialized_end=4500
112
+ _STATISTICSVIZ._serialized_start=4502
113
+ _STATISTICSVIZ._serialized_end=4586
114
+ _OPSHARDING._serialized_start=4589
115
+ _OPSHARDING._serialized_end=5184
116
+ _OPSHARDING_TYPE._serialized_start=5066
117
+ _OPSHARDING_TYPE._serialized_end=5148
118
+ _OPSHARDING_SHARDGROUPTYPE._serialized_start=5150
119
+ _OPSHARDING_SHARDGROUPTYPE._serialized_end=5184
120
+ _REPLICAGROUP._serialized_start=5186
121
+ _REPLICAGROUP._serialized_end=5221
122
+ _SOURCETARGET._serialized_start=5223
123
+ _SOURCETARGET._serialized_end=5269
124
+ _PRECISIONCONFIG._serialized_start=5272
125
+ _PRECISIONCONFIG._serialized_end=5416
126
+ _PRECISIONCONFIG_PRECISION._serialized_start=5350
127
+ _PRECISIONCONFIG_PRECISION._serialized_end=5416
128
+ _PARAMETERREPLICATION._serialized_start=5418
129
+ _PARAMETERREPLICATION._serialized_end=5476
130
+ _WHILELOOPBACKENDCONFIG._serialized_start=5478
131
+ _WHILELOOPBACKENDCONFIG._serialized_end=5601
132
+ _WHILELOOPBACKENDCONFIG_KNOWNTRIPCOUNT._serialized_start=5574
133
+ _WHILELOOPBACKENDCONFIG_KNOWNTRIPCOUNT._serialized_end=5601
134
+ _OUTPUTOPERANDALIASING._serialized_start=5603
135
+ _OUTPUTOPERANDALIASING._serialized_end=5706
136
+ # @@protoc_insertion_point(module_scope)
videochat2/lib/python3.10/site-packages/tensorflow/distribute/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/distribute/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (177 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (190 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (194 Bytes). View file
 
videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/__init__.py ADDED
File without changes
videochat2/lib/python3.10/site-packages/tensorflow/distribute/experimental/rpc/kernels/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (202 Bytes). View file