Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

nix-common/stringsearch.c File Reference

implementation of a memory searching algorithm More...

#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stringsearch.h>

Go to the source code of this file.

Functions

void fillBM (const char *srch, size_t srch_len, size_t *bml, size_t bm_len)
 fill up an array with offset values used to advance the pointer

void * inMem (const char *space, size_t space_len, const char *item, size_t item_len)
 find the item in the space concerned


Detailed Description

implementation of a memory searching algorithm

It's the horspool string search algorithm, except used for searching for memory patterns.

Definition in file stringsearch.c.


Function Documentation

void fillBM const char *    srch,
size_t    srch_len,
size_t *    bml,
size_t    bm_len
[static]
 

fill up an array with offset values used to advance the pointer

Parameters:
srch  the search string
srch_len  the length of the search string
bml  the alphabet array to occupy
bm_len  the length of the alphabet

Definition at line 24 of file stringsearch.c.

Referenced by inMem().

void* inMem const char *    space,
size_t    space_len,
const char *    item,
size_t    item_len
 

find the item in the space concerned

Parameters:
space  the haystack to search
space_len  the size of the haystack
item  the needle to find
item_len  the size of the needle
Returns:
NULL if the string could not be found, otherwise it's location.

Definition at line 36 of file stringsearch.c.

References fillBM().

Referenced by savegame_open().


Generated on Mon Aug 30 19:44:17 2004 for pocketcity by doxygen1.2.18