NeoMutt  2025-12-11-769-g906513
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Hash Table Compare API

Prototype for a function to compare two Hash keys. More...

Functions

static int cmp_key_string (union HashKey a, union HashKey b)
 Compare two string keys - Implements hash_cmp_key_t -.
 
static int cmp_key_case_string (union HashKey a, union HashKey b)
 Compare two string keys (ignore case) - Implements hash_cmp_key_t -.
 
static int cmp_key_int (union HashKey a, union HashKey b)
 Compare two integer keys - Implements hash_cmp_key_t -.
 

Detailed Description

Prototype for a function to compare two Hash keys.

Parameters
aFirst key to compare
bSecond key to compare
Return values
-1a precedes b
0a and b are identical
1b precedes a

This works like strcmp().

Function Documentation

◆ cmp_key_string()

static int cmp_key_string ( union HashKey a,
union HashKey b )
static

Compare two string keys - Implements hash_cmp_key_t -.

Definition at line 63 of file hash.c.

64{
65 return mutt_str_cmp(a.strkey, b.strkey);
66}
int mutt_str_cmp(const char *a, const char *b)
Compare two strings, safely.
Definition string.c:403
const char * strkey
String key.
Definition hash.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cmp_key_case_string()

static int cmp_key_case_string ( union HashKey a,
union HashKey b )
static

Compare two string keys (ignore case) - Implements hash_cmp_key_t -.

Definition at line 90 of file hash.c.

91{
92 return mutt_istr_cmp(a.strkey, b.strkey);
93}
int mutt_istr_cmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition string.c:416
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cmp_key_int()

static int cmp_key_int ( union HashKey a,
union HashKey b )
static

Compare two integer keys - Implements hash_cmp_key_t -.

Definition at line 106 of file hash.c.

107{
108 if (a.intkey == b.intkey)
109 return 0;
110 if (a.intkey < b.intkey)
111 return -1;
112 return 1;
113}
unsigned int intkey
Integer key.
Definition hash.h:37
+ Here is the caller graph for this function: