Renamed KTV to Val.

This commit is contained in:
2022-07-31 17:15:32 +02:00
parent 996446d115
commit a05bbf5fd6
86 changed files with 365 additions and 347 deletions

View File

@ -1,9 +1,9 @@
#include <ctype.h>
#include "ktv.h"
#include "val.h"
/**
* @brief Default function to compare two values of type #cw_KTV_t.
* @brief Default function to compare two values of type #cw_Val_t.
*
* @param v1
* @param v2
@ -14,8 +14,8 @@ int cw_ktv_mavlcmp (const void *v1, const void *v2)
char *d1, *d2, *k1, *k2;
int l1, l2, rc, i1, i2;
k1 = ( (cw_KTV_t *) v1)->key;
k2 = ( (cw_KTV_t *) v2)->key;
k1 = ( (cw_Val_t *) v1)->key;
k2 = ( (cw_Val_t *) v2)->key;
while (1) {
/* Find dots in both keys */
@ -28,16 +28,16 @@ int cw_ktv_mavlcmp (const void *v1, const void *v2)
/* calculate the length of the key till dots */
l1 = d1 - k1; /*((cw_KTV_t *) v1)->key;*/
l2 = d2 - k2; /*((cw_KTV_t *) v2)->key;*/
l1 = d1 - k1; /*((cw_Val_t *) v1)->key;*/
l2 = d2 - k2; /*((cw_Val_t *) v2)->key;*/
/* if length differs do a normal compare */
if (l1 != l2) {
return strcmp (k1, k2); /*((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key);*/
return strcmp (k1, k2); /*((cw_Val_t *) v1)->key, ((cw_Val_t *) v2)->key);*/
}
rc = strncmp (k1, k2, l1); /*((cw_KTV_t *) v1)->key,((cw_KTV_t *) v2)->key,l1);*/
rc = strncmp (k1, k2, l1); /*((cw_Val_t *) v1)->key,((cw_Val_t *) v2)->key,l1);*/
if (rc != 0) {
return rc;