gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

str-two-way.h File Reference
#include <limits.h>
#include <stdint.h>
Include dependency graph for str-two-way.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LONG_NEEDLE_THRESHOLD   32U
 
#define MAX(a, b)   ((a < b) ? (b) : (a))
 
#define CANON_ELEMENT(c)   c
 
#define CMP_FUNC   memcmp
 

Functions

static size_t critical_factorization (const unsigned char *needle, size_t needle_len, size_t *period)
 
static RETURN_TYPE two_way_short_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len)
 
static RETURN_TYPE two_way_long_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len)
 

Macro Definition Documentation

◆ CANON_ELEMENT

#define CANON_ELEMENT (   c)    c

Definition at line 75 of file str-two-way.h.

◆ CMP_FUNC

#define CMP_FUNC   memcmp

Definition at line 78 of file str-two-way.h.

◆ LONG_NEEDLE_THRESHOLD

#define LONG_NEEDLE_THRESHOLD   32U

Definition at line 65 of file str-two-way.h.

◆ MAX

#define MAX (   a,
 
)    ((a < b) ? (b) : (a))

Definition at line 71 of file str-two-way.h.

Function Documentation

◆ critical_factorization()

static size_t critical_factorization ( const unsigned char *  needle,
size_t  needle_len,
size_t period 
)
static

Definition at line 108 of file str-two-way.h.

References CANON_ELEMENT, p, and SIZE_MAX.

Referenced by two_way_long_needle(), and two_way_short_needle().

◆ two_way_long_needle()

static RETURN_TYPE two_way_long_needle ( const unsigned char *  haystack,
size_t  haystack_len,
const unsigned char *  needle,
size_t  needle_len 
)
static

Definition at line 329 of file str-two-way.h.

References AVAILABLE, CANON_ELEMENT, CMP_FUNC, critical_factorization(), MAX, NULL, RETURN_TYPE, and SIZE_MAX.

Referenced by memmem().

◆ two_way_short_needle()

static RETURN_TYPE two_way_short_needle ( const unsigned char *  haystack,
size_t  haystack_len,
const unsigned char *  needle,
size_t  needle_len 
)
static

Definition at line 235 of file str-two-way.h.

References AVAILABLE, CANON_ELEMENT, CMP_FUNC, critical_factorization(), MAX, NULL, RETURN_TYPE, and SIZE_MAX.

Referenced by memmem().