⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aspell.h

📁 SpellChecker平写检测程序原代码,希望大家喜欢,他非常好用
💻 H
📖 第 1 页 / 共 3 页
字号:
/* Automatically generated file.  Do not edit directly. */

/* This file is part of The New Aspell
 * Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL
 * license version 2.0 or 2.1.  You should have received a copy of the
 * LGPL license along with this library if you did not you can find it
 * at http://www.gnu.org/.                                              */

#ifndef ASPELL_ASPELL__H
#define ASPELL_ASPELL__H


BOOL LoadAspell(void);
void UnloadAspell(void);

#ifdef __cplusplus
extern "C" {
#endif


/******************************* type id *******************************/


union AspellTypeId {

  unsigned int num;

  char str[4];

};


typedef union AspellTypeId AspellTypeId;


/************************** mutable container **************************/


typedef struct AspellMutableContainer AspellMutableContainer;


typedef int (__cdecl * PFUNC_aspell_mutable_container_add)(struct AspellMutableContainer * ths, const char * to_add);

typedef int (__cdecl * PFUNC_aspell_mutable_container_remove)(struct AspellMutableContainer * ths, const char * to_rem);

typedef void (__cdecl * PFUNC_aspell_mutable_container_clear)(struct AspellMutableContainer * ths);

typedef struct AspellMutableContainer * (__cdecl * PFUNC_aspell_mutable_container_to_mutable_container)(struct AspellMutableContainer * ths);



/******************************* key info *******************************/



enum AspellKeyInfoType {AspellKeyInfoString, AspellKeyInfoInt, AspellKeyInfoBool, AspellKeyInfoList};
typedef enum AspellKeyInfoType AspellKeyInfoType;


struct AspellKeyInfo {

  /* the name of the key */
  const char * name;

  /* the key type */
  enum AspellKeyInfoType type;

  /* the default value of the key */
  const char * def;

  /* a brief description of the key or null if internal value */
  const char * desc;

  /* other data used by config implementations
   * should be set to 0 if not used */
  char otherdata[16];

};


typedef struct AspellKeyInfo AspellKeyInfo;


/******************************** config ********************************/


typedef struct AspellKeyInfoEnumeration AspellKeyInfoEnumeration;


typedef int (__cdecl * PFUNC_aspell_key_info_enumeration_at_end)(const struct AspellKeyInfoEnumeration * ths);

typedef const struct AspellKeyInfo * (__cdecl * PFUNC_aspell_key_info_enumeration_next)(struct AspellKeyInfoEnumeration * ths);

typedef void (__cdecl * PFUNC_delete_aspell_key_info_enumeration)(struct AspellKeyInfoEnumeration * ths);

typedef struct AspellKeyInfoEnumeration * (__cdecl * PFUNC_aspell_key_info_enumeration_clone)(const struct AspellKeyInfoEnumeration * ths);

typedef void (__cdecl * PFUNC_aspell_key_info_enumeration_assign)(struct AspellKeyInfoEnumeration * ths, const struct AspellKeyInfoEnumeration * other);



typedef struct AspellConfig AspellConfig;


typedef struct AspellConfig * (__cdecl * PFUNC_new_aspell_config)();

typedef void (__cdecl * PFUNC_delete_aspell_config)(struct AspellConfig * ths);

typedef struct AspellConfig * (__cdecl * PFUNC_aspell_config_clone)(const struct AspellConfig * ths);

typedef void (__cdecl * PFUNC_aspell_config_assign)(struct AspellConfig * ths, const struct AspellConfig * other);

typedef unsigned int (__cdecl * PFUNC_aspell_config_error_number)(const struct AspellConfig * ths);

typedef const char * (__cdecl * PFUNC_aspell_config_error_message)(const struct AspellConfig * ths);

typedef const struct AspellError * (__cdecl * PFUNC_aspell_config_error)(const struct AspellConfig * ths);

/* sets extra keys which this config class should accept
 * begin and end are expected to point to the begging
 * and end of an array of Aspell Key Info */
typedef void (__cdecl * PFUNC_aspell_config_set_extra)(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end);

/* returns the KeyInfo object for the
 * corresponding key or returns null and sets
 * error_num to PERROR_UNKNOWN_KEY if the key is
 * not valid. The pointer returned is valid for
 * the lifetime of the object. */
typedef const struct AspellKeyInfo * (__cdecl * PFUNC_aspell_config_keyinfo)(struct AspellConfig * ths, const char * key);

/* returns a newly allocated enumeration of all the
 * possible objects this config class uses */
typedef struct AspellKeyInfoEnumeration * (__cdecl * PFUNC_aspell_config_possible_elements)(struct AspellConfig * ths, int include_extra);

/* returns the default value for given key which
 * way involve substating variables, thus it is
 * not the same as keyinfo(key)->def returns null
 * and sets error_num to PERROR_UNKNOWN_KEY if
 * the key is not valid. Uses the temporary
 * string. */
typedef const char * (__cdecl * PFUNC_aspell_config_get_default)(struct AspellConfig * ths, const char * key);

/* returns a newly alloacted enumeration of all the
 * key/value pairs. This DOES not include ones
 * which are set to their default values */
typedef struct AspellStringPairEnumeration * (__cdecl * PFUNC_aspell_config_elements)(struct AspellConfig * ths);

/* inserts an item, if the item already exists it
 * will be replaced. returns true if it succesed
 * or false on error. If the key in not valid it
 * sets error_num to PERROR_UNKNOWN_KEY, if the
 * value is not valid it will sets error_num to
 * PERROR_BAD_VALUE, if the value can not be
 * changed it sets error_num to
 * PERROR_CANT_CHANGE_VALUE, and if the value is
 * a list and you are trying to set it directory
 * it sets error_num to PERROR_LIST_SET */
typedef int (__cdecl * PFUNC_aspell_config_replace)(struct AspellConfig * ths, const char * key, const char * value);

/* remove a key and returns true if it exists
 * otherise return false. This effictly sets the
 * key to its default value. Calling replace with
 * a value of "<default>" will also call
 * remove. If the key does not exists sets
 * error_num to 0 or PERROR_NOT, if the key in
 * not valid sets error_num to
 * PERROR_UNKNOWN_KEY, if the value can not be
 * changed sets error_num to
 * PERROR_CANT_CHANGE_VALUE */
typedef int (__cdecl * PFUNC_aspell_config_remove)(struct AspellConfig * ths, const char * key);

typedef int (__cdecl * PFUNC_aspell_config_have)(const struct AspellConfig * ths, const char * key);

/* returns null on error */
typedef const char * (__cdecl * PFUNC_aspell_config_retrieve)(struct AspellConfig * ths, const char * key);

typedef int (__cdecl * PFUNC_aspell_config_retrieve_list)(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst);

/* return -1 on error, 0 if false, 1 if true */
typedef int (__cdecl * PFUNC_aspell_config_retrieve_bool)(struct AspellConfig * ths, const char * key);

/* return -1 on error */
typedef int (__cdecl * PFUNC_aspell_config_retrieve_int)(struct AspellConfig * ths, const char * key);



/******************************** error ********************************/


struct AspellError {

  const char * mesg;

  const struct AspellErrorInfo * err;

};


typedef struct AspellError AspellError;

int aspell_error_is_a(const struct AspellError * ths, const struct AspellErrorInfo * e);


struct AspellErrorInfo {

  const struct AspellErrorInfo * isa;

  const char * mesg;

  unsigned int num_parms;

  const char * parms[3];

};


typedef struct AspellErrorInfo AspellErrorInfo;


/**************************** can have error ****************************/


typedef struct AspellCanHaveError AspellCanHaveError;


typedef unsigned int (__cdecl * PFUNC_aspell_error_number)(const struct AspellCanHaveError * ths);

typedef const char * (__cdecl * PFUNC_aspell_error_message)(const struct AspellCanHaveError * ths);

typedef const struct AspellError * (__cdecl * PFUNC_aspell_error)(const struct AspellCanHaveError * ths);

typedef void (__cdecl * PFUNC_delete_aspell_can_have_error)(struct AspellCanHaveError * ths);



/******************************** errors ********************************/


extern const struct AspellErrorInfo * const aerror_other;
extern const struct AspellErrorInfo * const aerror_operation_not_supported;
extern const struct AspellErrorInfo * const   aerror_cant_copy;
extern const struct AspellErrorInfo * const aerror_file;
extern const struct AspellErrorInfo * const   aerror_cant_open_file;
extern const struct AspellErrorInfo * const     aerror_cant_read_file;
extern const struct AspellErrorInfo * const     aerror_cant_write_file;
extern const struct AspellErrorInfo * const   aerror_invalid_name;
extern const struct AspellErrorInfo * const   aerror_bad_file_format;
extern const struct AspellErrorInfo * const aerror_dir;
extern const struct AspellErrorInfo * const   aerror_cant_read_dir;
extern const struct AspellErrorInfo * const aerror_config;
extern const struct AspellErrorInfo * const   aerror_unknown_key;
extern const struct AspellErrorInfo * const   aerror_cant_change_value;
extern const struct AspellErrorInfo * const   aerror_bad_key;
extern const struct AspellErrorInfo * const   aerror_bad_value;
extern const struct AspellErrorInfo * const   aerror_duplicate;
extern const struct AspellErrorInfo * const aerror_language_related;
extern const struct AspellErrorInfo * const   aerror_unknown_language;
extern const struct AspellErrorInfo * const   aerror_unknown_soundslike;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -