YAZ 5.37.0
matchstr.h File Reference

Header for YAZ iconv interface. More...

#include <stddef.h>
#include <yaz/yconfig.h>

Go to the source code of this file.

Functions

int yaz_matchstr (const char *s1, const char *s2)
 match strings - independent of case and '-'
int yaz_strcmp_del (const char *a, const char *b, const char *b_del)
 match a and b with some delimitor for b
int yaz_memcmp (const void *a, const void *b, size_t len_a, size_t len_b)
 compares two buffers of different size
int yaz_strncasecmp (const char *s1, const char *s2, size_t n)
 ala strncasecmp - no locale
int yaz_strcasecmp (const char *s1, const char *s2)
 ala strcasecmp - no locale
int yaz_strcmp_null (const char *s1, const char *s2)
 strcmp, null may be passed

Detailed Description

Header for YAZ iconv interface.

Definition in file matchstr.h.

Function Documentation

◆ yaz_matchstr()

◆ yaz_memcmp()

int yaz_memcmp ( const void * a,
const void * b,
size_t len_a,
size_t len_b )

compares two buffers of different size

Parameters
afirst buffer
bsecond buffer
len_alength of first buffer
Return values
len_blength of second buffer
0buffers are equal
>0a > b
<0a < b

Definition at line 86 of file matchstr.c.

Referenced by compare_attr().

◆ yaz_strcasecmp()

int yaz_strcasecmp ( const char * s1,
const char * s2 )

ala strcasecmp - no locale

Parameters
s1first buffer
s2second buffer
Return values
0buffers are equal
>0a > b
<0a < b

Definition at line 21 of file matchstr.c.

References yaz_strncasecmp().

Referenced by decode_headers_content(), yaz_encode_http_request(), yaz_encode_http_response(), z_HTTP_header_lookup(), z_HTTP_header_remove(), and z_HTTP_header_set().

◆ yaz_strcmp_del()

int yaz_strcmp_del ( const char * a,
const char * b,
const char * b_del )

match a and b with some delimitor for b

Parameters
afirst second
bsecond string
b_deldelimitor for b
Return values
0strings are similar
!=0strings are different

Definition at line 72 of file matchstr.c.

Referenced by yaz_sru_decode(), yaz_srw_check_content_type(), and yaz_srw_decode().

◆ yaz_strcmp_null()

int yaz_strcmp_null ( const char * s1,
const char * s2 )

strcmp, null may be passed

Parameters
s1first buffer or NULL
s2second buffer or NULL
Return values
0buffers are equal
>0a > b
<0a < b

Definition at line 95 of file matchstr.c.

Referenced by record_cache_add(), and ZOOM_record_cache_lookup_i().

◆ yaz_strncasecmp()

int yaz_strncasecmp ( const char * s1,
const char * s2,
size_t n )

ala strncasecmp - no locale

Parameters
s1first buffer
s2second buffer
nnumber of bytes to compare
Return values
0buffers are equal
>0a > b
<0a < b

Definition at line 26 of file matchstr.c.

References yaz_isupper, and yaz_tolower.

Referenced by cs_complete_http(), and yaz_strcasecmp().