IDZEBRA  2.1.2
Functions
scan.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "dict-p.h"

Go to the source code of this file.

Functions

static void scan_direction (Dict dict, Dict_ptr ptr, int pos, Dict_char *str, int start, int *count, void *client, int(*userfunc)(char *, const char *, int, void *), int dir)
 
void dict_scan_r (Dict dict, Dict_ptr ptr, int pos, Dict_char *str, int *before, int *after, void *client, int(*userfunc)(char *, const char *, int, void *))
 
int dict_scan (Dict dict, char *str, int *before, int *after, void *client, int(*f)(char *name, const char *info, int pos, void *client))
 dictionary scan More...
 

Function Documentation

int dict_scan ( Dict  dict,
char *  str,
int *  before,
int *  after,
void *  client,
int(*)(char *name, const char *info, int pos, void *client)  f 
)

dictionary scan

Parameters
dictdictionary handle
strstart pint term (string-z)
beforenumber of terms to be visited preceding str
afternumber of terms to be visited following str
clientclient data pointer to be passed to match function f
ffunction be called for each matching term
Return values
0Successful
-1error

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.

Definition at line 242 of file scan.c.

References dict_scan_r(), Dict_struct::head, and Dict_head::root.

Referenced by dirs_open(), dirs_read(), do_scan(), main(), rpn_scan_norm(), and zebra_register_statistics().

void dict_scan_r ( Dict  dict,
Dict_ptr  ptr,
int  pos,
Dict_char str,
int *  before,
int *  after,
void *  client,
int(*)(char *, const char *, int, void *)  userfunc 
)
static void scan_direction ( Dict  dict,
Dict_ptr  ptr,
int  pos,
Dict_char str,
int  start,
int *  count,
void *  client,
int(*)(char *, const char *, int, void *)  userfunc,
int  dir 
)
static

Definition at line 31 of file scan.c.

References Dict_struct::dbf, dict_bf_readp(), DICT_bsize, DICT_EOS, DICT_nodir, and rset_private::pos.

Referenced by dict_scan_r().