~ubuntu-branches/ubuntu/feisty/aspell/feisty

« back to all changes in this revision

Viewing changes to interfaces/cc/aspell.h

  • Committer: Bazaar Package Importer
  • Author(s): Brian Nelson
  • Date: 2005-10-25 23:43:21 UTC
  • mfrom: (0.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051025234321-6mttbd3m82liomkh
Tags: 0.60.4-1
* New upstream release

* debian/patches/10_autotools: regenerated

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
struct AspellKeyInfo {
56
56
 
57
 
  /* the name of the key */
 
57
  /* The name of the key. */
58
58
  const char * name;
59
59
 
60
 
  /* the key type */
 
60
  /* The key type. */
61
61
  enum AspellKeyInfoType type;
62
62
 
63
 
  /* the default value of the key */
 
63
  /* The default value of the key. */
64
64
  const char * def;
65
65
 
66
 
  /* a brief description of the key or null if internal value */
 
66
  /* A brief description of the key or NULL if internal value. */
67
67
  const char * desc;
68
68
 
69
69
  int flags;
111
111
 
112
112
const struct AspellError * aspell_config_error(const struct AspellConfig * ths);
113
113
 
114
 
/* sets extra keys which this config class should accept
115
 
 * begin and end are expected to point to the begging
116
 
 * and end of an array of Aspell Key Info */
 
114
/* Sets extra keys which this config class should
 
115
 * accept. begin and end are expected to point to
 
116
 * the beginning and ending of an array of Aspell
 
117
 * Key Info. */
117
118
void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end);
118
119
 
119
 
/* returns the KeyInfo object for the
120
 
 * corresponding key or returns null and sets
 
120
/* Returns the KeyInfo object for the
 
121
 * corresponding key or returns NULL and sets
121
122
 * error_num to PERROR_UNKNOWN_KEY if the key is
122
123
 * not valid. The pointer returned is valid for
123
124
 * the lifetime of the object. */
124
125
const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key);
125
126
 
126
 
/* returns a newly allocated enumeration of all the
127
 
 * possible objects this config class uses */
 
127
/* Returns a newly allocated enumeration of all
 
128
 * the possible objects this config class uses. */
128
129
struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra);
129
130
 
130
 
/* returns the default value for given key which
131
 
 * way involve substating variables, thus it is
132
 
 * not the same as keyinfo(key)->def returns null
 
131
/* Returns the default value for given key which
 
132
 * may involve substituting variables, thus it is
 
133
 * not the same as keyinfo(key)->def returns NULL
133
134
 * and sets error_num to PERROR_UNKNOWN_KEY if
134
135
 * the key is not valid. Uses the temporary
135
136
 * string. */
136
137
const char * aspell_config_get_default(struct AspellConfig * ths, const char * key);
137
138
 
138
 
/* returns a newly alloacted enumeration of all the
139
 
 * key/value pairs. This DOES not include ones
140
 
 * which are set to their default values */
 
139
/* Returns a newly allocated enumeration of all
 
140
 * the key/value pairs. This DOES not include ones
 
141
 * which are set to their default values. */
141
142
struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths);
142
143
 
143
 
/* inserts an item, if the item already exists it
144
 
 * will be replaced. returns true if it succesed
145
 
 * or false on error. If the key in not valid it
 
144
/* Inserts an item, if the item already exists it
 
145
 * will be replaced. Returns TRUE if it succeeded
 
146
 * or FALSE on error. If the key in not valid it
146
147
 * sets error_num to PERROR_UNKNOWN_KEY, if the
147
 
 * value is not valid it will sets error_num to
 
148
 * value is not valid it will set error_num to
148
149
 * PERROR_BAD_VALUE, if the value can not be
149
150
 * changed it sets error_num to
150
151
 * PERROR_CANT_CHANGE_VALUE, and if the value is
151
 
 * a list and you are trying to set it directory
 
152
 * a list and you are trying to set its directory,
152
153
 * it sets error_num to PERROR_LIST_SET */
153
154
int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value);
154
155
 
155
 
/* remove a key and returns true if it exists
156
 
 * otherise return false. This effictly sets the
157
 
 * key to its default value. Calling replace with
158
 
 * a value of "<default>" will also call
159
 
 * remove. If the key does not exists sets
160
 
 * error_num to 0 or PERROR_NOT, if the key in
161
 
 * not valid sets error_num to
 
156
/* Remove a key and returns TRUE if it exists
 
157
 * otherwise return FALSE. This effectively sets
 
158
 * the key to its default value. Calling replace
 
159
 * with a value of "<default>" will also call
 
160
 * remove. If the key does not exist then it sets
 
161
 * error_num to 0 or PERROR_NOT, if the key is
 
162
 * not valid then it sets error_num to
162
163
 * PERROR_UNKNOWN_KEY, if the value can not be
163
 
 * changed sets error_num to
 
164
 * changed then it sets error_num to
164
165
 * PERROR_CANT_CHANGE_VALUE */
165
166
int aspell_config_remove(struct AspellConfig * ths, const char * key);
166
167
 
167
168
int aspell_config_have(const struct AspellConfig * ths, const char * key);
168
169
 
169
 
/* returns null on error */
 
170
/* Returns NULL on error. */
170
171
const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key);
171
172
 
172
173
int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst);
173
174
 
174
 
/* return -1 on error, 0 if false, 1 if true */
 
175
/* Return -1 on error, 0 if false, 1 if true. */
175
176
int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key);
176
177
 
177
 
/* return -1 on error */
 
178
/* Return -1 on error. */
178
179
int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key);
179
180
 
180
181
 
338
339
 
339
340
struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths);
340
341
 
341
 
/* returns       0 if it is not in the dictionary,
 
342
/* Returns 0 if it is not in the dictionary,
342
343
 * 1 if it is, or -1 on error. */
343
344
int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size);
344
345
 
 
346
/* Add this word to your own personal word list. */
345
347
int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size);
346
348
 
 
349
/* Add this word to the current spelling session. */
347
350
int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size);
348
351
 
 
352
/* This is your own personal word list file plus
 
353
 * any extra words added during this session to
 
354
 * your own personal word list. */
349
355
const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths);
350
356
 
 
357
/* This is a list of words added to this session
 
358
 * that are not in the main word list or in your
 
359
 * own personal list but are considered valid for
 
360
 * this spelling session. */
351
361
const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths);
352
362
 
 
363
/* This is the main list of words used during this
 
364
 * spelling session. */
353
365
const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths);
354
366
 
355
367
int aspell_speller_save_all_word_lists(struct AspellSpeller * ths);
356
368
 
357
369
int aspell_speller_clear_session(struct AspellSpeller * ths);
358
370
 
359
 
/* Return null on error.
360
 
 * the word list returned by suggest is only valid until the next
361
 
 * call to suggest */
 
371
/* Return NULL on error.
 
372
 * The word list returned by suggest is only
 
373
 * valid until the next call to suggest. */
362
374
const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size);
363
375
 
364
376
int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size);
410
422
const struct AspellError * aspell_document_checker_error(const struct AspellDocumentChecker * ths);
411
423
 
412
424
/* Creates a new document checker.
413
 
 * The speller class is expect to last until this
414
 
 * class is destroyed.
415
 
 * If config is given it will be used to overwide
 
425
 * The speller class is expected to last until
 
426
 * this class is destroyed.
 
427
 * If config is given it will be used to override
416
428
 * any relevent options set by this speller class.
417
429
 * The config class is not once this function is done.
418
430
 * If filter is given then it will take ownership of
422
434
 
423
435
struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj);
424
436
 
425
 
/* reset the internal state of the filter.
426
 
 * should be called whenever a new document is being filtered */
 
437
/* Reset the internal state of the filter.
 
438
 * Should be called whenever a new document is
 
439
 * being filtered. */
427
440
void aspell_document_checker_reset(struct AspellDocumentChecker * ths);
428
441
 
429
 
/* process a string
430
 
 * The string passed in should only be split on white space
431
 
 * characters.  Furthermore, between calles to reset, each string
432
 
 * should be passed in exactly once and in the order they appeared
433
 
 * in the document.  Passing in stings out of order, skipping
434
 
 * strings or passing them in more than once may lead to undefined
435
 
 * results. */
 
442
/* Process a string.
 
443
 * The string passed in should only be split on
 
444
 * white space characters.  Furthermore, between
 
445
 * calls to reset, each string should be passed
 
446
 * in exactly once and in the order they appeared
 
447
 * in the document.  Passing in strings out of
 
448
 * order, skipping strings or passing them in
 
449
 * more than once may lead to undefined results. */
436
450
void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size);
437
451
 
438
 
/* returns the next misspelled word in the processed string
439
 
 * if there are no more misspelled word than token.word
440
 
 * will be null and token.size will be 0 */
 
452
/* Returns the next misspelled word in the
 
453
 * processed string.  If there are no more
 
454
 * misspelled words, then token.word will be
 
455
 * NULL and token.size will be 0 */
441
456
struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths);
442
457
 
443
 
/* returns the underlying filter class */
 
458
/* Returns the underlying filter class. */
444
459
struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths);
445
460
 
446
461
 
500
515
 
501
516
struct AspellDictInfo {
502
517
 
503
 
  /* name to identify the dictionary by */
 
518
  /* The Name to identify this dictionary by. */
504
519
  const char * name;
505
520
 
 
521
  /* The language code to identify this dictionary.
 
522
   * A two letter UPPER-CASE ISO 639 language code
 
523
   * and an optional two letter ISO 3166 country
 
524
   * code after a dash or underscore. */
506
525
  const char * code;
507
526
 
 
527
  /* Any extra information to distinguish this
 
528
   * variety of dictionary from other dictionaries
 
529
   * which may have the same language and size. */
508
530
  const char * jargon;
509
531
 
510
532
  int size;
511
533
 
 
534
  /* A two char digit code describing the size of
 
535
   * the dictionary: 10=tiny, 20=really small,
 
536
   * 30=small, 40=med-small, 50=med, 60=med-large,
 
537
   * 70=large, 80=huge, 90=insane.  Please check
 
538
   * the README in aspell-lang-200?????.tar.bz2 or
 
539
   * see SCOWL (http://wordlist.sourceforge.net)
 
540
   * for an example of how these sizes are used. */
512
541
  const char * size_str;
513
542
 
514
543
  struct AspellModuleInfo * module;
634
663
struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths);
635
664
 
636
665
/* Insert a new element.
637
 
 * Will NOT overright an existing entry.
638
 
 * Returns false if the element already exists. */
 
666
 * Will NOT overwrite an existing entry.
 
667
 * Returns FALSE if the element already exists. */
639
668
int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value);
640
669
 
641
670
/* Insert a new element.
642
 
 * Will overright an existing entry.
643
 
 * Always returns true. */
 
671
 * Will overwrite an existing entry.
 
672
 * Always returns TRUE. */
644
673
int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value);
645
674
 
646
 
/* Looks up an element.
647
 
 * Returns null if the element did not exist.
648
 
 * Returns an empty string if the element exists but has a null value.
649
 
 * Otherwises returns the value */
 
675
/* Looks up an element and returns the value.
 
676
 * Returns NULL if the element does not exist.
 
677
 * Returns an empty string if the element exists
 
678
 * but has a NULL value. */
650
679
const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key);
651
680
 
652
681
 
687
716
/******************************** cache ********************************/
688
717
 
689
718
 
690
 
/* Reset the global cache(s) so that cache queries will create a new
691
 
 * object.       If exiting objects are still in use they are not deleted.
692
 
 * If which is NULL than ALL caches will be reset.       Current caches are
693
 
 * "encode", "decode", "dictionary", "language", and "keyboard". */
 
719
/* Reset the global cache(s) so that cache queries will
 
720
 * create a new object. If existing objects are still in
 
721
 * use they are not deleted. If which is NULL then all
 
722
 * caches will be reset. Current caches are "encode",
 
723
 * "decode", "dictionary", "language", and "keyboard". */
694
724
int aspell_reset_cache(const char * which);
695
725
 
696
726
#ifdef __cplusplus