-int dict_lookup_grep (Dict dict, const char *p, int range, void *client,
- int *max_pos, int init_pos,
- int (*f)(char *name, const char *info, void *client));
-
+int dict_lookup_ec(Dict dict, char *p, int range, int (*f)(char *name));
+
+/** \brief regular expression search with error correction
+ \param dict dictionary handle
+ \param p regular expression string-z
+ \param range number of allowed errors(extra/substituted/missing char)
+ \param client client data pointer to be passed to match function f
+ \param max_pos on return holds maximum number of chars that match (prefix)
+ \param init_pos number of leading non-error corrected chars.
+ \param f function be called for each match
+ \retval 0 Operation complete. Function f returned zero value always
+ \retval >0 Operation incomplete. Function f returned a non-zero value
+ \retval -1 error (such as bad regular expression)
+
+ The function f is called for each match. If function f returns
+ non-zero value the grep operation is stopped and the returned
+ non-zero value is also returned by dict_lookup_ec.
+*/
+YAZ_EXPORT
+int dict_lookup_grep(Dict dict, const char *p, int range, void *client,
+ int *max_pos, int init_pos,
+ int (*f)(char *name, const char *info, void *client));
+
+/** \brief dictionary scan
+ \param dict dictionary handle
+ \param str start pint term (string-z)
+ \param before number of terms to be visited preceding str
+ \param after number of terms to be visited following str
+ \param client client data pointer to be passed to match function f
+ \param f function be called for each matching term
+ \retval 0 Successful
+ \retval -1 error
+
+ If the callback function f returns 0 the scan operation visits
+ all terms in range (before to after); if the function returns non-zero
+ the scan operation is cancelled.
+*/