diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2024-01-24 23:17:28 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-02-05 11:09:52 +0000 |
| commit | e0f3703ae6c4084f9275cfc78d87e5604cc27a10 (patch) | |
| tree | cdfeebf67f6bb962c5543337b952fe6cf9d40587 /util.h | |
| parent | csi: simplify handling of Set/Reset Mode (SM/RM) sequences (diff) | |
util: add streq() function and use in place of strcmp(...) == 0
Diffstat (limited to 'util.h')
| -rw-r--r-- | util.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,12 +1,20 @@ #pragma once +#include <stdbool.h> #include <stdint.h> +#include <string.h> #include <threads.h> #define ALEN(v) (sizeof(v) / sizeof((v)[0])) #define min(x, y) ((x) < (y) ? (x) : (y)) #define max(x, y) ((x) > (y) ? (x) : (y)) +static inline bool +streq(const char *a, const char *b) +{ + return strcmp(a, b) == 0; +} + static inline const char * thrd_err_as_string(int thrd_err) { |
