]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add allowed chars merge function
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 16 May 2024 05:18:38 +0000 (23:18 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 16 May 2024 05:18:38 +0000 (23:18 -0600)
src/lib/util/sbuff.h

index 5a2a09e2a7e50ef804a080c15cc1597f4ff860a0..7ee0f8296e8f06cee9bcedc895a551b8633d9114 100644 (file)
@@ -1419,6 +1419,15 @@ do { \
  *
  * @{
  */
+
+/** Toggle any chars to 'true' in out, that were present in, out or in
+ *
+ */
+static inline void fr_sbuff_allowed_merge(bool out[static UINT8_MAX + 1], bool const in[static UINT8_MAX + 1])
+{
+       for (size_t i = 0; i <= UINT8_MAX; i++) out[i] = out[i] || in[i];
+}
+
 fr_sbuff_term_t        *fr_sbuff_terminals_amerge(TALLOC_CTX *ctx,
                                           fr_sbuff_term_t const *a, fr_sbuff_term_t const *b);