diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-11-18 22:24:33 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-11-18 22:24:33 +0900 |
commit | 3b0c3b8206964b85bf3716c962d26dd15c4f285f (patch) | |
tree | 2f0973dbf96c2892d19a55b6f846f130e7399a48 /debian/uncrustify-trinity/uncrustify-trinity-0.78.1/src/logmask.h | |
parent | ff287d2f48d4f4253bf84f19bd7fe937b61ede45 (diff) | |
download | extra-dependencies-master.tar.gz extra-dependencies-master.zip |
It is no longer necessary to maintain a customize trinity version.
Upstream version can be used as is.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.78.1/src/logmask.h')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.78.1/src/logmask.h | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/src/logmask.h b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/src/logmask.h deleted file mode 100644 index ef00e1d0..00000000 --- a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/src/logmask.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @file logmask.h - * - * Functions to manipulate a log severity mask. - * - * @author Ben Gardner - * @license GPL v2+ - */ -#ifndef LOGMASK_H_INCLUDED -#define LOGMASK_H_INCLUDED - -#include "base_types.h" -#include "log_levels.h" - -#include <bitset> -#include <cstring> // memset() - -/* - * the test suite Coveralls: https://coveralls.io - * will complains because these functions are only - * used at development time. - * Don't worry about unused lines for the functions: - * logmask_test - * logmask_set_all - */ - -//! A simple array of 256 bits -typedef std::bitset<256> log_mask_t; - - -/** - * Tests whether a sev bit is set in the mask - * - * @param mask log mask to evaluate - * @param sev severity bit to check - * - * @return true (is set) or false (not set) - */ -static inline bool logmask_test(const log_mask_t &mask, log_sev_t sev) -{ - return(mask.test(sev)); -} - - -/** - * Sets a set bit in the mask - * - * @param mask log mask to modify - * @param sev The severity to check - * @param value true (set bit) or false (clear bit) - */ -static inline void logmask_set_sev(log_mask_t &mask, log_sev_t sev, bool value) -{ - mask.set(sev, value); -} - - -/** - * Sets all bits to the same value - * - * @param mast log mask to operate on - * @param value true (set bit) or false (clear bit) - */ -static inline void logmask_set_all(log_mask_t &mask, bool value) -{ - if (value) - { - mask.set(); - } - else - { - mask.reset(); - } -} - - -#ifdef DEVELOP_ONLY -/** - * Convert a logmask into a string. - * The string is a comma-delimited list of severities. - * Example: 1,3,5-10 - * - * @param mask the mask to convert - * @param buf the buffer to hold the string - * @param size the size of the buffer - * - * @return buf (pass through) - */ -char *logmask_to_str(const log_mask_t &mask, char *buf, int size); - -#endif /* DEVELOP_ONLY */ - - -/** - * Parses a string into a log severity - * - * @param str string to parse - * @param mask bit mask to populate with log levels - */ -void logmask_from_string(const char *str, log_mask_t &mask); - - -#endif /* LOGMASK_H_INCLUDED */ |