summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-03 01:16:53 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-03 01:16:53 +0200
commitf1cc1ca2085de9b112d42f7e2c68d21e4753781b (patch)
tree5040bcdcd199660c883608d979cc52bb15d913d6 /src/include
parentad27d52bdbfd0569ac9c87153c73d575beaca89e (diff)
downloadexchange-f1cc1ca2085de9b112d42f7e2c68d21e4753781b.tar.gz
exchange-f1cc1ca2085de9b112d42f7e2c68d21e4753781b.tar.bz2
exchange-f1cc1ca2085de9b112d42f7e2c68d21e4753781b.zip
expose language check logic
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_mhd_lib.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h
index 4b34f41df..7d281662d 100644
--- a/src/include/taler_mhd_lib.h
+++ b/src/include/taler_mhd_lib.h
@@ -97,6 +97,22 @@ TALER_MHD_can_compress (struct MHD_Connection *connection);
/**
+ * Check if @a lang matches the @a language_pattern, and if so with
+ * which preference.
+ * See also: https://tools.ietf.org/html/rfc7231#section-5.3.1
+ *
+ * @param language_pattern a language preferences string
+ * like "fr-CH, fr;q=0.9, en;q=0.8, *;q=0.1"
+ * @param lang the 2-digit language to match
+ * @return q-weight given for @a lang in @a language_pattern, 1.0 if no weights are given;
+ * 0 if @a lang is not in @a language_pattern
+ */
+double
+TALER_MHD_language_matches (const char *language_pattern,
+ const char *lang);
+
+
+/**
* Send JSON object as response.
*
* @param connection the MHD connection