00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ASPELL_ASPELL__H
00010 #define ASPELL_ASPELL__H
00011
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015
00016
00017
00018
00019 union AspellTypeId {
00020
00021 unsigned int num;
00022
00023 char str[4];
00024
00025 };
00026
00027
00028 typedef union AspellTypeId AspellTypeId;
00029
00030
00031
00032
00033
00034 typedef struct AspellMutableContainer AspellMutableContainer;
00035
00036
00037 int aspell_mutable_container_add(struct AspellMutableContainer * ths, const char * to_add);
00038
00039 int aspell_mutable_container_remove(struct AspellMutableContainer * ths, const char * to_rem);
00040
00041 void aspell_mutable_container_clear(struct AspellMutableContainer * ths);
00042
00043 struct AspellMutableContainer * aspell_mutable_container_to_mutable_container(struct AspellMutableContainer * ths);
00044
00045
00046
00047
00048
00049
00050
00051 enum AspellKeyInfoType {AspellKeyInfoString, AspellKeyInfoInt, AspellKeyInfoBool, AspellKeyInfoList};
00052 typedef enum AspellKeyInfoType AspellKeyInfoType;
00053
00054
00055 struct AspellKeyInfo {
00056
00057
00058 const char * name;
00059
00060
00061 enum AspellKeyInfoType type;
00062
00063
00064 const char * def;
00065
00066
00067 const char * desc;
00068
00069 int flags;
00070
00071 int other_data;
00072
00073 };
00074
00075
00076 typedef struct AspellKeyInfo AspellKeyInfo;
00077
00078
00079
00080
00081
00082 typedef struct AspellKeyInfoEnumeration AspellKeyInfoEnumeration;
00083
00084
00085 int aspell_key_info_enumeration_at_end(const struct AspellKeyInfoEnumeration * ths);
00086
00087 const struct AspellKeyInfo * aspell_key_info_enumeration_next(struct AspellKeyInfoEnumeration * ths);
00088
00089 void delete_aspell_key_info_enumeration(struct AspellKeyInfoEnumeration * ths);
00090
00091 struct AspellKeyInfoEnumeration * aspell_key_info_enumeration_clone(const struct AspellKeyInfoEnumeration * ths);
00092
00093 void aspell_key_info_enumeration_assign(struct AspellKeyInfoEnumeration * ths, const struct AspellKeyInfoEnumeration * other);
00094
00095
00096
00097 typedef struct AspellConfig AspellConfig;
00098
00099
00100 struct AspellConfig * new_aspell_config();
00101
00102 void delete_aspell_config(struct AspellConfig * ths);
00103
00104 struct AspellConfig * aspell_config_clone(const struct AspellConfig * ths);
00105
00106 void aspell_config_assign(struct AspellConfig * ths, const struct AspellConfig * other);
00107
00108 unsigned int aspell_config_error_number(const struct AspellConfig * ths);
00109
00110 const char * aspell_config_error_message(const struct AspellConfig * ths);
00111
00112 const struct AspellError * aspell_config_error(const struct AspellConfig * ths);
00113
00114
00115
00116
00117
00118 void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end);
00119
00120
00121
00122
00123
00124
00125 const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key);
00126
00127
00128
00129 struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra);
00130
00131
00132
00133
00134
00135
00136
00137 const char * aspell_config_get_default(struct AspellConfig * ths, const char * key);
00138
00139
00140
00141
00142 struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths);
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value);
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 int aspell_config_remove(struct AspellConfig * ths, const char * key);
00167
00168 int aspell_config_have(const struct AspellConfig * ths, const char * key);
00169
00170
00171 const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key);
00172
00173 int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst);
00174
00175
00176 int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key);
00177
00178
00179 int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key);
00180
00181
00182
00183
00184
00185
00186 struct AspellError {
00187
00188 const char * mesg;
00189
00190 const struct AspellErrorInfo * err;
00191
00192 };
00193
00194
00195 typedef struct AspellError AspellError;
00196
00197 int aspell_error_is_a(const struct AspellError * ths, const struct AspellErrorInfo * e);
00198
00199
00200 struct AspellErrorInfo {
00201
00202 const struct AspellErrorInfo * isa;
00203
00204 const char * mesg;
00205
00206 unsigned int num_parms;
00207
00208 const char * parms[3];
00209
00210 };
00211
00212
00213 typedef struct AspellErrorInfo AspellErrorInfo;
00214
00215
00216
00217
00218
00219 typedef struct AspellCanHaveError AspellCanHaveError;
00220
00221
00222 unsigned int aspell_error_number(const struct AspellCanHaveError * ths);
00223
00224 const char * aspell_error_message(const struct AspellCanHaveError * ths);
00225
00226 const struct AspellError * aspell_error(const struct AspellCanHaveError * ths);
00227
00228 void delete_aspell_can_have_error(struct AspellCanHaveError * ths);
00229
00230
00231
00232
00233
00234
00235 extern const struct AspellErrorInfo * const aerror_other;
00236 extern const struct AspellErrorInfo * const aerror_operation_not_supported;
00237 extern const struct AspellErrorInfo * const aerror_cant_copy;
00238 extern const struct AspellErrorInfo * const aerror_unimplemented_method;
00239 extern const struct AspellErrorInfo * const aerror_file;
00240 extern const struct AspellErrorInfo * const aerror_cant_open_file;
00241 extern const struct AspellErrorInfo * const aerror_cant_read_file;
00242 extern const struct AspellErrorInfo * const aerror_cant_write_file;
00243 extern const struct AspellErrorInfo * const aerror_invalid_name;
00244 extern const struct AspellErrorInfo * const aerror_bad_file_format;
00245 extern const struct AspellErrorInfo * const aerror_dir;
00246 extern const struct AspellErrorInfo * const aerror_cant_read_dir;
00247 extern const struct AspellErrorInfo * const aerror_config;
00248 extern const struct AspellErrorInfo * const aerror_unknown_key;
00249 extern const struct AspellErrorInfo * const aerror_cant_change_value;
00250 extern const struct AspellErrorInfo * const aerror_bad_key;
00251 extern const struct AspellErrorInfo * const aerror_bad_value;
00252 extern const struct AspellErrorInfo * const aerror_duplicate;
00253 extern const struct AspellErrorInfo * const aerror_key_not_string;
00254 extern const struct AspellErrorInfo * const aerror_key_not_int;
00255 extern const struct AspellErrorInfo * const aerror_key_not_bool;
00256 extern const struct AspellErrorInfo * const aerror_key_not_list;
00257 extern const struct AspellErrorInfo * const aerror_no_value_reset;
00258 extern const struct AspellErrorInfo * const aerror_no_value_enable;
00259 extern const struct AspellErrorInfo * const aerror_no_value_disable;
00260 extern const struct AspellErrorInfo * const aerror_no_value_clear;
00261 extern const struct AspellErrorInfo * const aerror_language_related;
00262 extern const struct AspellErrorInfo * const aerror_unknown_language;
00263 extern const struct AspellErrorInfo * const aerror_unknown_soundslike;
00264 extern const struct AspellErrorInfo * const aerror_language_not_supported;
00265 extern const struct AspellErrorInfo * const aerror_no_wordlist_for_lang;
00266 extern const struct AspellErrorInfo * const aerror_mismatched_language;
00267 extern const struct AspellErrorInfo * const aerror_affix;
00268 extern const struct AspellErrorInfo * const aerror_corrupt_affix;
00269 extern const struct AspellErrorInfo * const aerror_invalid_cond;
00270 extern const struct AspellErrorInfo * const aerror_invalid_cond_strip;
00271 extern const struct AspellErrorInfo * const aerror_incorrect_encoding;
00272 extern const struct AspellErrorInfo * const aerror_encoding;
00273 extern const struct AspellErrorInfo * const aerror_unknown_encoding;
00274 extern const struct AspellErrorInfo * const aerror_encoding_not_supported;
00275 extern const struct AspellErrorInfo * const aerror_conversion_not_supported;
00276 extern const struct AspellErrorInfo * const aerror_pipe;
00277 extern const struct AspellErrorInfo * const aerror_cant_create_pipe;
00278 extern const struct AspellErrorInfo * const aerror_process_died;
00279 extern const struct AspellErrorInfo * const aerror_bad_input;
00280 extern const struct AspellErrorInfo * const aerror_invalid_string;
00281 extern const struct AspellErrorInfo * const aerror_invalid_word;
00282 extern const struct AspellErrorInfo * const aerror_invalid_affix;
00283 extern const struct AspellErrorInfo * const aerror_inapplicable_affix;
00284 extern const struct AspellErrorInfo * const aerror_unknown_unichar;
00285 extern const struct AspellErrorInfo * const aerror_word_list_flags;
00286 extern const struct AspellErrorInfo * const aerror_invalid_flag;
00287 extern const struct AspellErrorInfo * const aerror_conflicting_flags;
00288 extern const struct AspellErrorInfo * const aerror_version_control;
00289 extern const struct AspellErrorInfo * const aerror_bad_version_string;
00290 extern const struct AspellErrorInfo * const aerror_filter;
00291 extern const struct AspellErrorInfo * const aerror_cant_dlopen_file;
00292 extern const struct AspellErrorInfo * const aerror_empty_filter;
00293 extern const struct AspellErrorInfo * const aerror_no_such_filter;
00294 extern const struct AspellErrorInfo * const aerror_confusing_version;
00295 extern const struct AspellErrorInfo * const aerror_bad_version;
00296 extern const struct AspellErrorInfo * const aerror_identical_option;
00297 extern const struct AspellErrorInfo * const aerror_options_only;
00298 extern const struct AspellErrorInfo * const aerror_invalid_option_modifier;
00299 extern const struct AspellErrorInfo * const aerror_cant_describe_filter;
00300 extern const struct AspellErrorInfo * const aerror_filter_mode_file;
00301 extern const struct AspellErrorInfo * const aerror_mode_option_name;
00302 extern const struct AspellErrorInfo * const aerror_no_filter_to_option;
00303 extern const struct AspellErrorInfo * const aerror_bad_mode_key;
00304 extern const struct AspellErrorInfo * const aerror_expect_mode_key;
00305 extern const struct AspellErrorInfo * const aerror_mode_version_requirement;
00306 extern const struct AspellErrorInfo * const aerror_confusing_mode_version;
00307 extern const struct AspellErrorInfo * const aerror_bad_mode_version;
00308 extern const struct AspellErrorInfo * const aerror_missing_magic_expression;
00309 extern const struct AspellErrorInfo * const aerror_empty_file_ext;
00310 extern const struct AspellErrorInfo * const aerror_filter_mode_expand;
00311 extern const struct AspellErrorInfo * const aerror_unknown_mode;
00312 extern const struct AspellErrorInfo * const aerror_mode_extend_expand;
00313 extern const struct AspellErrorInfo * const aerror_filter_mode_magic;
00314 extern const struct AspellErrorInfo * const aerror_file_magic_pos;
00315 extern const struct AspellErrorInfo * const aerror_file_magic_range;
00316 extern const struct AspellErrorInfo * const aerror_missing_magic;
00317 extern const struct AspellErrorInfo * const aerror_bad_magic;
00318 extern const struct AspellErrorInfo * const aerror_expression;
00319 extern const struct AspellErrorInfo * const aerror_invalid_expression;
00320
00321
00322
00323
00324
00325 typedef struct AspellSpeller AspellSpeller;
00326
00327
00328 struct AspellCanHaveError * new_aspell_speller(struct AspellConfig * config);
00329
00330 struct AspellSpeller * to_aspell_speller(struct AspellCanHaveError * obj);
00331
00332 void delete_aspell_speller(struct AspellSpeller * ths);
00333
00334 unsigned int aspell_speller_error_number(const struct AspellSpeller * ths);
00335
00336 const char * aspell_speller_error_message(const struct AspellSpeller * ths);
00337
00338 const struct AspellError * aspell_speller_error(const struct AspellSpeller * ths);
00339
00340 struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths);
00341
00342
00343
00344 int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size);
00345
00346
00347 int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size);
00348
00349
00350 int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size);
00351
00352
00353
00354
00355 const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths);
00356
00357
00358
00359
00360
00361 const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths);
00362
00363
00364
00365 const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths);
00366
00367 int aspell_speller_save_all_word_lists(struct AspellSpeller * ths);
00368
00369 int aspell_speller_clear_session(struct AspellSpeller * ths);
00370
00371
00372
00373
00374 const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size);
00375
00376 int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size);
00377
00378
00379
00380
00381
00382
00383 typedef struct AspellFilter AspellFilter;
00384
00385
00386 void delete_aspell_filter(struct AspellFilter * ths);
00387
00388 unsigned int aspell_filter_error_number(const struct AspellFilter * ths);
00389
00390 const char * aspell_filter_error_message(const struct AspellFilter * ths);
00391
00392 const struct AspellError * aspell_filter_error(const struct AspellFilter * ths);
00393
00394 struct AspellFilter * to_aspell_filter(struct AspellCanHaveError * obj);
00395
00396
00397
00398
00399
00400
00401 struct AspellToken {
00402
00403 unsigned int offset;
00404
00405 unsigned int len;
00406
00407 };
00408
00409
00410 typedef struct AspellToken AspellToken;
00411
00412
00413 typedef struct AspellDocumentChecker AspellDocumentChecker;
00414
00415
00416 void delete_aspell_document_checker(struct AspellDocumentChecker * ths);
00417
00418 unsigned int aspell_document_checker_error_number(const struct AspellDocumentChecker * ths);
00419
00420 const char * aspell_document_checker_error_message(const struct AspellDocumentChecker * ths);
00421
00422 const struct AspellError * aspell_document_checker_error(const struct AspellDocumentChecker * ths);
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433 struct AspellCanHaveError * new_aspell_document_checker(struct AspellSpeller * speller);
00434
00435 struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj);
00436
00437
00438
00439
00440 void aspell_document_checker_reset(struct AspellDocumentChecker * ths);
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450 void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size);
00451
00452
00453
00454
00455
00456 struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths);
00457
00458
00459 struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths);
00460
00461
00462
00463
00464
00465
00466 typedef struct AspellWordList AspellWordList;
00467
00468
00469 int aspell_word_list_empty(const struct AspellWordList * ths);
00470
00471 unsigned int aspell_word_list_size(const struct AspellWordList * ths);
00472
00473 struct AspellStringEnumeration * aspell_word_list_elements(const struct AspellWordList * ths);
00474
00475
00476
00477
00478
00479
00480 typedef struct AspellStringEnumeration AspellStringEnumeration;
00481
00482
00483 void delete_aspell_string_enumeration(struct AspellStringEnumeration * ths);
00484
00485 struct AspellStringEnumeration * aspell_string_enumeration_clone(const struct AspellStringEnumeration * ths);
00486
00487 void aspell_string_enumeration_assign(struct AspellStringEnumeration * ths, const struct AspellStringEnumeration * other);
00488
00489 int aspell_string_enumeration_at_end(const struct AspellStringEnumeration * ths);
00490
00491 const char * aspell_string_enumeration_next(struct AspellStringEnumeration * ths);
00492
00493
00494
00495
00496
00497
00498 struct AspellModuleInfo {
00499
00500 const char * name;
00501
00502 double order_num;
00503
00504 const char * lib_dir;
00505
00506 struct AspellStringList * dict_dirs;
00507
00508 struct AspellStringList * dict_exts;
00509
00510 };
00511
00512
00513 typedef struct AspellModuleInfo AspellModuleInfo;
00514
00515
00516 struct AspellDictInfo {
00517
00518
00519 const char * name;
00520
00521
00522
00523
00524
00525 const char * code;
00526
00527
00528
00529
00530 const char * jargon;
00531
00532 int size;
00533
00534
00535
00536
00537
00538
00539
00540
00541 const char * size_str;
00542
00543 struct AspellModuleInfo * module;
00544
00545 };
00546
00547
00548 typedef struct AspellDictInfo AspellDictInfo;
00549
00550
00551 typedef struct AspellModuleInfoList AspellModuleInfoList;
00552
00553
00554 struct AspellModuleInfoList * get_aspell_module_info_list(struct AspellConfig * config);
00555
00556 int aspell_module_info_list_empty(const struct AspellModuleInfoList * ths);
00557
00558 unsigned int aspell_module_info_list_size(const struct AspellModuleInfoList * ths);
00559
00560 struct AspellModuleInfoEnumeration * aspell_module_info_list_elements(const struct AspellModuleInfoList * ths);
00561
00562
00563
00564 typedef struct AspellDictInfoList AspellDictInfoList;
00565
00566
00567 struct AspellDictInfoList * get_aspell_dict_info_list(struct AspellConfig * config);
00568
00569 int aspell_dict_info_list_empty(const struct AspellDictInfoList * ths);
00570
00571 unsigned int aspell_dict_info_list_size(const struct AspellDictInfoList * ths);
00572
00573 struct AspellDictInfoEnumeration * aspell_dict_info_list_elements(const struct AspellDictInfoList * ths);
00574
00575
00576
00577 typedef struct AspellModuleInfoEnumeration AspellModuleInfoEnumeration;
00578
00579
00580 int aspell_module_info_enumeration_at_end(const struct AspellModuleInfoEnumeration * ths);
00581
00582 const struct AspellModuleInfo * aspell_module_info_enumeration_next(struct AspellModuleInfoEnumeration * ths);
00583
00584 void delete_aspell_module_info_enumeration(struct AspellModuleInfoEnumeration * ths);
00585
00586 struct AspellModuleInfoEnumeration * aspell_module_info_enumeration_clone(const struct AspellModuleInfoEnumeration * ths);
00587
00588 void aspell_module_info_enumeration_assign(struct AspellModuleInfoEnumeration * ths, const struct AspellModuleInfoEnumeration * other);
00589
00590
00591
00592 typedef struct AspellDictInfoEnumeration AspellDictInfoEnumeration;
00593
00594
00595 int aspell_dict_info_enumeration_at_end(const struct AspellDictInfoEnumeration * ths);
00596
00597 const struct AspellDictInfo * aspell_dict_info_enumeration_next(struct AspellDictInfoEnumeration * ths);
00598
00599 void delete_aspell_dict_info_enumeration(struct AspellDictInfoEnumeration * ths);
00600
00601 struct AspellDictInfoEnumeration * aspell_dict_info_enumeration_clone(const struct AspellDictInfoEnumeration * ths);
00602
00603 void aspell_dict_info_enumeration_assign(struct AspellDictInfoEnumeration * ths, const struct AspellDictInfoEnumeration * other);
00604
00605
00606
00607
00608
00609
00610 typedef struct AspellStringList AspellStringList;
00611
00612
00613 struct AspellStringList * new_aspell_string_list();
00614
00615 int aspell_string_list_empty(const struct AspellStringList * ths);
00616
00617 unsigned int aspell_string_list_size(const struct AspellStringList * ths);
00618
00619 struct AspellStringEnumeration * aspell_string_list_elements(const struct AspellStringList * ths);
00620
00621 int aspell_string_list_add(struct AspellStringList * ths, const char * to_add);
00622
00623 int aspell_string_list_remove(struct AspellStringList * ths, const char * to_rem);
00624
00625 void aspell_string_list_clear(struct AspellStringList * ths);
00626
00627 struct AspellMutableContainer * aspell_string_list_to_mutable_container(struct AspellStringList * ths);
00628
00629 void delete_aspell_string_list(struct AspellStringList * ths);
00630
00631 struct AspellStringList * aspell_string_list_clone(const struct AspellStringList * ths);
00632
00633 void aspell_string_list_assign(struct AspellStringList * ths, const struct AspellStringList * other);
00634
00635
00636
00637
00638
00639
00640 typedef struct AspellStringMap AspellStringMap;
00641
00642
00643 struct AspellStringMap * new_aspell_string_map();
00644
00645 int aspell_string_map_add(struct AspellStringMap * ths, const char * to_add);
00646
00647 int aspell_string_map_remove(struct AspellStringMap * ths, const char * to_rem);
00648
00649 void aspell_string_map_clear(struct AspellStringMap * ths);
00650
00651 struct AspellMutableContainer * aspell_string_map_to_mutable_container(struct AspellStringMap * ths);
00652
00653 void delete_aspell_string_map(struct AspellStringMap * ths);
00654
00655 struct AspellStringMap * aspell_string_map_clone(const struct AspellStringMap * ths);
00656
00657 void aspell_string_map_assign(struct AspellStringMap * ths, const struct AspellStringMap * other);
00658
00659 int aspell_string_map_empty(const struct AspellStringMap * ths);
00660
00661 unsigned int aspell_string_map_size(const struct AspellStringMap * ths);
00662
00663 struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths);
00664
00665
00666
00667
00668 int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value);
00669
00670
00671
00672
00673 int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value);
00674
00675
00676
00677
00678
00679 const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key);
00680
00681
00682
00683
00684
00685
00686 struct AspellStringPair {
00687
00688 const char * first;
00689
00690 const char * second;
00691
00692 };
00693
00694
00695 typedef struct AspellStringPair AspellStringPair;
00696
00697
00698
00699
00700
00701 typedef struct AspellStringPairEnumeration AspellStringPairEnumeration;
00702
00703
00704 int aspell_string_pair_enumeration_at_end(const struct AspellStringPairEnumeration * ths);
00705
00706 struct AspellStringPair aspell_string_pair_enumeration_next(struct AspellStringPairEnumeration * ths);
00707
00708 void delete_aspell_string_pair_enumeration(struct AspellStringPairEnumeration * ths);
00709
00710 struct AspellStringPairEnumeration * aspell_string_pair_enumeration_clone(const struct AspellStringPairEnumeration * ths);
00711
00712 void aspell_string_pair_enumeration_assign(struct AspellStringPairEnumeration * ths, const struct AspellStringPairEnumeration * other);
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724 int aspell_reset_cache(const char * which);
00725
00726 #ifdef __cplusplus
00727 }
00728 #endif
00729 #endif