IDZEBRA 2.2.11
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

Function Documentation

◆ dict_scan()

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

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, and dict_scan_r().

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

◆ dict_scan_r()

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 *) )

◆ scan_direction()

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 )
static

Definition at line 31 of file scan.c.

References dict, dict_bf_readp(), DICT_bsize, DICT_EOS, DICT_nodir, and scan_direction().

Referenced by dict_scan_r(), and scan_direction().