YAZ  5.23.1
Functions
matchstr.c File Reference

a couple of string utilities More...

#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <yaz/yaz-iconv.h>
#include <yaz/matchstr.h>

Go to the source code of this file.

Functions

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

Detailed Description

a couple of string utilities

Definition in file matchstr.c.

Function Documentation

int yaz_matchstr ( const char *  s1,
const char *  s2 
)
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().

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_response(), z_HTTP_header_lookup(), z_HTTP_header_remove(), and z_HTTP_header_set().

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().

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().

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