ptype.h

00001 /*
00002  * ptype.h
00003  */
00015 #ifndef _clish_ptype_h
00016 #define _clish_ptype_h
00017 
00018 typedef struct clish_ptype_s clish_ptype_t;
00019 
00020 #include "lub/types.h"
00021 #include "lub/bintree.h"
00022 
00023 #include <stddef.h>
00024 
00025 /*=====================================
00026  * PTYPE INTERFACE
00027  *===================================== */
00028 /*-----------------
00029  * public types
00030  *----------------- */
00035 typedef enum
00036 {
00040     CLISH_PTYPE_REGEXP,
00044     CLISH_PTYPE_INTEGER,
00045     CLISH_PTYPE_UNSIGNEDINTEGER,
00054     CLISH_PTYPE_SELECT
00055     
00056 } clish_ptype_method_e;
00061 typedef enum
00062 {
00066     CLISH_PTYPE_NONE,
00070     CLISH_PTYPE_TOUPPER,
00074     CLISH_PTYPE_TOLOWER
00075 } clish_ptype_preprocess_e;
00076 
00077 /*-----------------
00078  * meta functions
00079  *----------------- */
00080 int
00081     clish_ptype_bt_compare(const void *clientnode,
00082                            const void *clientkey);
00083 void
00084     clish_ptype_bt_getkey(const void        *clientnode,
00085                           lub_bintree_key_t *key);
00086 size_t
00087     clish_ptype_bt_offset(void);
00088 const char *
00089     clish_ptype_method__get_name(clish_ptype_method_e method);
00090 clish_ptype_method_e
00091     clish_ptype_method_resolve(const char *method_name);
00092 const char *
00093     clish_ptype_preprocess__get_name(clish_ptype_preprocess_e preprocess);
00094 clish_ptype_preprocess_e 
00095     clish_ptype_preprocess_resolve(const char *preprocess_name);
00096 clish_ptype_t *
00097     clish_ptype_new(const char              *name,
00098                     const char              *text,
00099                     const char              *pattern,
00100                     clish_ptype_method_e     method,
00101                     clish_ptype_preprocess_e preprocess);
00102 /*-----------------
00103  * methods
00104  *----------------- */
00105 void
00106     clish_ptype_delete(clish_ptype_t *instance);
00115 char *
00116     clish_ptype_validate(const clish_ptype_t *instance,
00117                          const char          *text);
00128 char *
00129     clish_ptype_translate(const clish_ptype_t *instance,
00130                           const char          *text);
00134 char *
00135     clish_ptype_word_generator(clish_ptype_t *instance,
00136                                const char    *text,
00137                                unsigned       state);
00138 void
00139     clish_ptype_dump(clish_ptype_t *instance);
00140 /*-----------------
00141  * attributes 
00142  *----------------- */
00143 const char *
00144     clish_ptype__get_name(const clish_ptype_t *instance);
00145 const char *
00146     clish_ptype__get_text(const clish_ptype_t *instance);
00147 const char *
00148     clish_ptype__get_range(const clish_ptype_t *instance);
00149 void
00150     clish_ptype__set_preprocess(clish_ptype_t            *instance,
00151                                 clish_ptype_preprocess_e  preprocess);
00152 void
00153     clish_ptype__set_pattern(clish_ptype_t       *instance,
00154                              const char          *pattern,
00155                              clish_ptype_method_e method);
00156 void
00157     clish_ptype__set_text(clish_ptype_t *instance,
00158                           const char    *text);
00159 #endif /* _clish_ptype_h */
00160 

Generated on Tue Apr 29 13:41:07 2008 for CLISH by  doxygen 1.5.1