This file is indexed.

/usr/include/x86_64-linux-gnu/chewing/chewingio.h is in libchewing3-dev 0.4.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
/*
 * chewingio.h
 *
 * Copyright (c) 1999, 2000, 2001
 *	Lu-chuan Kung and Kang-pen Chen.
 *	All rights reserved.
 *
 * Copyright (c) 2004, 2005, 2008
 *	libchewing Core Team. See ChangeLog for details.
 *
 * See the file "COPYING" for information on usage and redistribution
 * of this file.
 */

/* *INDENT-OFF* */
#ifndef _CHEWING_IO_H
#define _CHEWING_IO_H
/* *INDENT-ON* */

/*! \file chewingio.h
 *  \brief Chewing I/O module
 *  \author libchewing Core Team
 */

#include "global.h"

#define KEYSTROKE_IGNORE 1
#define KEYSTROKE_COMMIT 2
#define KEYSTROKE_BELL 4
#define KEYSTROKE_ABSORB 8

/*! \name Series of functions handling key stroke.
 */

/*@{*/
/**
 * @brief Handle the input key stroke: Space
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Space(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Escape
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Esc(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Enter/Return
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Enter(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Delete
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Del(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Backspace
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Backspace(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Tab
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Tab(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Shift + Left
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_ShiftLeft(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Left
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Left(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Shift + Right
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_ShiftRight(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Right
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Right(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Up
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Up(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Home
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Home(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: End
 * @param ctx Chewing IM context
 */

CHEWING_API int chewing_handle_End(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: PageUp
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_PageUp(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: PageDown
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_PageDown(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Down
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Down(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Capslock
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_Capslock(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: casual key
 * @param ctx Chewing IM context
 * @param key scan code of key stroke
 */
CHEWING_API int chewing_handle_Default(ChewingContext *ctx, int key);

/**
 * @brief Handle the input key stroke: Ctrl + Number-key
 * @param ctx Chewing IM context
 * @param key scan code of number key
 */
CHEWING_API int chewing_handle_CtrlNum(ChewingContext *ctx, int key);

/**
 * @brief Handle the input key stroke: Shift + Space
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_ShiftSpace(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: double Tab
 * @param ctx Chewing IM context
 */
CHEWING_API int chewing_handle_DblTab(ChewingContext *ctx);

/**
 * @brief Handle the input key stroke: Numlock (keypad)
 * @param ctx Chewing IM context
 * @param key scan code of number key
 */
CHEWING_API int chewing_handle_Numlock(ChewingContext *ctx, int key);

/*@}*/


/*! \name Chewing IM Instance Management
 */

/*@{*/
/**
 * @brief Create new handle of the instance for Chewing IM
 * @see chewing_delete()
 */
CHEWING_API ChewingContext *chewing_new();

/**
 * @brief Release the handle and internal memory by given Chewing instance
 * @see chewing_new()
 *
 * @param ctx Chewing IM context
 */
CHEWING_API void chewing_delete(ChewingContext *ctx);

/**
 * @brief Release memory allocated used by given pointer used in APIs
 */
CHEWING_API void chewing_free(void *);

/*@}*/


/*! \name Chewing IM Setup
 */

/**
 * @brief Reset all settings
 *
 * @param ctx
 * @return If successed than return 0
 */
CHEWING_API int chewing_Reset(ChewingContext *ctx);

/*@}*/

/*! \name Keyboard mapping
 */

/*@{*/
/**
 * @brief Set keyboard mapping type
 *
 * @param ctx
 * @param kbtype index number of keyboard mapping type from KBStr2Num
 * @return If successed then return 0
 */
CHEWING_API int chewing_set_KBType(ChewingContext *ctx, int kbtype);

/**
 * @brief Get keyboard mapping type
 *
 * @param ctx
 * @return If successed then return keyboard mapping type from KBStr2Num
 */
CHEWING_API int chewing_get_KBType(const ChewingContext *ctx);

/**
 * @brief Get keyboard mapping type in C-style string format
 *
 * @param ctx
 * @return If successed then return kbtype from KBStr2Num
 */
CHEWING_API char *chewing_get_KBString(const ChewingContext *ctx);

/**
 * @brief Get the index number of keyboard mapping type from given string
 *
 * @param str[] name of kbtype eg. "KB_HSU"
 */
CHEWING_API int chewing_KBStr2Num(const char str[]);

/*@}*/


/*! \name Operating language mode of Chewing IM
 */

/*@{*/
/**
 * @brief Set the operating language mode of Chewing IM.
 *
 * @param ctx
 * @param mode CHINESE_MODE or ENGLISH_MODE
 */
CHEWING_API void chewing_set_ChiEngMode(ChewingContext *ctx, int mode);

/**
 * @brief Get current operating language mode: English / Chinese
 *
 * @param ctx
 *
 * @return CHINESE_MODE or ENGLISH_MODE
 */
CHEWING_API int chewing_get_ChiEngMode(const ChewingContext *ctx);

/*@*/


/*! \name Shape mode of output symbols
 */

/*@{*/
/**
 * @brief Set the shape mode of output symbols: full-shape / half-shape
 *
 * @param ctx
 * @param mode FULLSHAPE_MODE or HALFSHAPE_MODE
 */
CHEWING_API void chewing_set_ShapeMode(ChewingContext *ctx, int mode);

/**
 * @brief Get current shape mode of output symbols
 *
 * @param ctx
 *
 * @return FULLSHAPE_MODE or HALFSHAPE_MODE
 */
CHEWING_API int chewing_get_ShapeMode(const ChewingContext *ctx);

/*@}*/


/*! \name Number of selection candidate per page
 */

/*@{*/
/**
 * @brief Set the number of selection candidate per page
 *
 * @param ctx
 * @param n number of selection candidate
 */
CHEWING_API void chewing_set_candPerPage(ChewingContext *ctx, int n);

/**
 * @brief Get the number of selection candidate per page
 *
 * @param ctx
 */
CHEWING_API int chewing_get_candPerPage(const ChewingContext *ctx);

/*@}*/


/*! \name Maximum length of Chinese symbols
 */

/*@{*/
/**
 * @brief Set the maximum length of Chinese symbols
 *
 * @param ctx
 * @param n maximum length
 */
CHEWING_API void chewing_set_maxChiSymbolLen(ChewingContext *ctx, int n);

/**
 * @brief Get the maximum length of Chinese symbols
 *
 * @param ctx
 */
CHEWING_API int chewing_get_maxChiSymbolLen(const ChewingContext *ctx);

/*@}*/


/*! \name Key sequence for selecting phrases
 */

/*@{*/
/**
 * @brief Set the key sequence for selecting phrases
 *
 * @param ctx
 * @param selkeys
 * @param len
 */
CHEWING_API void chewing_set_selKey(ChewingContext *ctx, const int *selkeys, int len);

/**
 * @brief Get the key sequence for selecting phrases
 *
 * @param ctx
 */
CHEWING_API int *chewing_get_selKey(const ChewingContext *ctx);

/*@}*/


/*! \name Direction of adding new user-defined phrases
 */

/*@{*/
/**
 * @brief Set the direction of adding new user-defined phrases
 *
 * @param ctx
 * @param direction
 */
CHEWING_API void chewing_set_addPhraseDirection(ChewingContext *ctx, int direction);

/**
 * @brief Get the direction of adding new user-defined phrases
 *
 * @param ctx
 */
CHEWING_API int chewing_get_addPhraseDirection(const ChewingContext *ctx);

/*@}*/


/*! \name Behavior whether if space key is regarded as selection key
 */

/*@{*/
/**
 * @brief Set the behavior whether if space key is regarded as selection key
 *
 * @param ctx
 * @param mode
 */
CHEWING_API void chewing_set_spaceAsSelection(ChewingContext *ctx, int mode);

/**
 * @brief Get the behavior if space key is regarded as selection key or not
 *
 * @param ctx
 */
CHEWING_API int chewing_get_spaceAsSelection(const ChewingContext *ctx);

/*@}*/


/*! \name Behavior whether if Escape should clean all buffer
 */

/*@{*/
/**
 * @brief Set the behavior whether if Escape key should clean all buffer
 *
 * @param ctx
 * @param mode
 */
CHEWING_API void chewing_set_escCleanAllBuf(ChewingContext *ctx, int mode);

/**
 * @brief Get the behavior whether if Escape key should clean all buffer
 *
 * @param ctx
 */
CHEWING_API int chewing_get_escCleanAllBuf(const ChewingContext *ctx);

/*@}*/


/*! \name Behavior of automatically shifting cursor after selection
 */

/*@{*/
/**
 * @brief Set the behavior of automatically shifting cursor after selection
 *
 * @param ctx
 * @param mode
 */
CHEWING_API void chewing_set_autoShiftCur(ChewingContext *ctx, int mode);

/**
 * @brief Get the behavior of automatically shifting cursor after selection
 *
 * @param ctx
 */
CHEWING_API int chewing_get_autoShiftCur(const ChewingContext *ctx);

/*@}*/


/*! \name Operating mode during easy symbol input
 */

/*@{*/
/**
 * @brief Set the operating mode during easy symbol input
 *
 * @param ctx
 * @param mode
 */
CHEWING_API void chewing_set_easySymbolInput(ChewingContext *ctx, int mode);

/**
 * @brief Get the operating mode during easy symbol input
 *
 * @param ctx
 */
CHEWING_API int chewing_get_easySymbolInput(const ChewingContext *ctx);

/*@}*/


/*! \name Behavior for phrase choice to be rearward or not
 */

/*@{*/
/**
 * @brief Set the behavior for phrase choice to be rearward or not
 *
 * @param ctx
 * @param mode
 */
CHEWING_API void chewing_set_phraseChoiceRearward(ChewingContext *ctx, int mode);

/**
 * @brief Get the behavior for phrase choice to be rearward or not
 *
 * @param ctx
 */
CHEWING_API int chewing_get_phraseChoiceRearward(const ChewingContext *ctx);

/*@}*/


/*! \name Phonetic sequence in Chewing internal state machine
 */

/*@{*/
/**
 * @brief Get phonetic sequence in Chewing internal state machine
 *
 * @param ctx
 */
CHEWING_API unsigned short *chewing_get_phoneSeq(const ChewingContext *ctx);

/**
 * @brief Get the length of phonetic sequence in Chewing internal state machine
 *
 * @param ctx
 */
CHEWING_API int chewing_get_phoneSeqLen(const ChewingContext *ctx);

/*@}*/

CHEWING_API void chewing_set_logger(ChewingContext *ctx,
                                    void (*logger) (void *data, int level, const char *fmt, ...), void *data);

CHEWING_API int chewing_userphrase_enumerate(ChewingContext *ctx);

CHEWING_API int chewing_userphrase_has_next(ChewingContext *ctx, unsigned int *phrase_len, unsigned int *bopomofo_len);

CHEWING_API int chewing_userphrase_get(ChewingContext *ctx,
                                       char *phrase_buf, unsigned int phrase_len,
                                       char *bopomofo_buf, unsigned int bopomofo_len);

CHEWING_API int chewing_userphrase_add(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf);

CHEWING_API int chewing_userphrase_remove(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf);

CHEWING_API int chewing_userphrase_lookup(ChewingContext *ctx, const char *phrase_buf, const char *bopomofo_buf);

CHEWING_API int chewing_cand_list_first(ChewingContext *ctx);
CHEWING_API int chewing_cand_list_last(ChewingContext *ctx);
CHEWING_API int chewing_cand_list_has_next(ChewingContext *ctx);
CHEWING_API int chewing_cand_list_has_prev(ChewingContext *ctx);
CHEWING_API int chewing_cand_list_next(ChewingContext *ctx);
CHEWING_API int chewing_cand_list_prev(ChewingContext *ctx);

CHEWING_API int chewing_commit_preedit_buf(ChewingContext *ctx);
CHEWING_API int chewing_clean_preedit_buf(ChewingContext *ctx);

CHEWING_API int chewing_clean_bopomofo_buf(ChewingContext *ctx);

CHEWING_API ChewingContext *chewing_new2(const char *syspath,
                                         const char *userpath,
                                         void (*logger) (void *data, int level, const char *fmt, ...),
                                         void *loggerdata);

/* *INDENT-OFF* */
#endif                          /* _CHEWING_IO_H */
/* *INDENT-ON* */