Skip to content
Extraits de code Groupes Projets
Vérifiée Valider c0b29298 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

LKT: Case incensitive for types/languages/categories and update CHANGELOG

parent 04175995
Branches
Étiquettes
1 requête de fusion!127Lkt update
Pipeline #1959 réussi
......@@ -4,6 +4,7 @@
- Add json-c to the download dependency script (add cmake as a requirement for that)
- Choose between static or shared library for liblektor
- Download the bakabase with obfuscation or not
- Implicit types for queries with lkt
# v2.1 (df74b85f)
......
......@@ -55,26 +55,6 @@ static const char *LKT_QUEUE_DEFAULT[] = { "10" };
/* Communication functions and fonction that interact with lektor stuff. */
static inline int
__string_is_lower(const char *str)
{
while (*str != '\0') {
if (!islower(*str))
return 1;
}
return 0;
}
static inline int
__string_is_upper(const char *str)
{
while (*str != '\0') {
if (!isupper(*str))
return 1;
}
return 0;
}
static inline void
__concat_strings(char *const res, size_t len, const char **tab, size_t count)
{
......@@ -105,24 +85,12 @@ lkt_get_query_type(struct cmd_args *args, char *const regex, size_t regex_len)
return 0;
}
/* Type ?== type */
else if (__string_is_upper(args->argv[0])) {
#define kara_category(unused)
#define kara_language(unused)
/* Type ?== type OR Type ?== category OR Type ?== lang */
#define kara_type(tp) \
if (STR_MATCH(tp, args->argv[0])) { \
safe_snprintf(regex, regex_len, "type://%s", args->argv[0]); \
return 0; \
}
#include <lektor/database.def>
#undef kara_category
#undef kara_language
#undef kara_type
}
/* Type ?== category OR Type ?== lang */
else if (__string_is_lower(args->argv[0])) {
#define kara_type(unused)
#define kara_category(ct) \
if (STR_MATCH(ct, args->argv[0])) { \
safe_snprintf(regex, regex_len, "category://%s", args->argv[0]); \
......@@ -138,7 +106,6 @@ if (STR_MATCH(lg, args->argv[0])) { \
#undef kara_language
#undef kara_type
}
}
memset(regex, 0, regex_len * sizeof(char));
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter