CLISH  0.7.3
ptype.h
1 /*
2  * ptype.h
3  */
15 #ifndef _clish_ptype_h
16 #define _clish_ptype_h
17 
18 typedef struct clish_ptype_s clish_ptype_t;
19 
20 #include "lub/types.h"
21 #include "lub/bintree.h"
22 
23 #include <stddef.h>
24 
25 /*=====================================
26  * PTYPE INTERFACE
27  *===================================== */
28 /*-----------------
29  * public types
30  *----------------- */
35 typedef enum
36 {
45  CLISH_PTYPE_UNSIGNEDINTEGER,
55 
61 typedef enum
62 {
76 
77 /*-----------------
78  * meta functions
79  *----------------- */
80 int
81  clish_ptype_bt_compare(const void *clientnode,
82  const void *clientkey);
83 void
84  clish_ptype_bt_getkey(const void *clientnode,
85  lub_bintree_key_t *key);
86 size_t
87  clish_ptype_bt_offset(void);
88 const char *
89  clish_ptype_method__get_name(clish_ptype_method_e method);
91  clish_ptype_method_resolve(const char *method_name);
92 const char *
93  clish_ptype_preprocess__get_name(clish_ptype_preprocess_e preprocess);
95  clish_ptype_preprocess_resolve(const char *preprocess_name);
96 clish_ptype_t *
97  clish_ptype_new(const char *name,
98  const char *text,
99  const char *pattern,
100  clish_ptype_method_e method,
101  clish_ptype_preprocess_e preprocess);
102 /*-----------------
103  * methods
104  *----------------- */
105 void
106  clish_ptype_delete(clish_ptype_t *instance);
115 char *
116  clish_ptype_validate(const clish_ptype_t *instance,
117  const char *text);
128 char *
129  clish_ptype_translate(const clish_ptype_t *instance,
130  const char *text);
134 char *
135  clish_ptype_word_generator(clish_ptype_t *instance,
136  const char *text,
137  unsigned state);
138 void
139  clish_ptype_dump(clish_ptype_t *instance);
140 /*-----------------
141  * attributes
142  *----------------- */
143 const char *
144  clish_ptype__get_name(const clish_ptype_t *instance);
145 const char *
146  clish_ptype__get_text(const clish_ptype_t *instance);
147 const char *
148  clish_ptype__get_range(const clish_ptype_t *instance);
149 void
150  clish_ptype__set_preprocess(clish_ptype_t *instance,
151  clish_ptype_preprocess_e preprocess);
152 void
153  clish_ptype__set_pattern(clish_ptype_t *instance,
154  const char *pattern,
155  clish_ptype_method_e method);
156 void
157  clish_ptype__set_text(clish_ptype_t *instance,
158  const char *text);
159 #endif /* _clish_ptype_h */
160 
Definition: ptype.h:40
Definition: ptype.h:54
Definition: ptype.h:70
Definition: ptype.h:74
char * clish_ptype_validate(const clish_ptype_t *instance, const char *text)
char * clish_ptype_translate(const clish_ptype_t *instance, const char *text)
Definition: bintree.h:158
Definition: ptype.h:66
clish_ptype_method_e
Definition: ptype.h:35
char * clish_ptype_word_generator(clish_ptype_t *instance, const char *text, unsigned state)
clish_ptype_preprocess_e
Definition: ptype.h:61
Definition: ptype.h:44