diff options
Diffstat (limited to 'src/libmdsserver/util.h')
-rw-r--r-- | src/libmdsserver/util.h | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/libmdsserver/util.h b/src/libmdsserver/util.h index 77cfa17..9f2953d 100644 --- a/src/libmdsserver/util.h +++ b/src/libmdsserver/util.h @@ -1,6 +1,6 @@ /** * mds — A micro-display server - * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (maandree@kth.se) + * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (m@maandree.se) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,20 +23,9 @@ #include <stdint.h> #include <sys/types.h> +#include <libsimple.h> -#ifndef __USE_GNU -static inline void *__attribute__((pure, nonnull)) -rawmemchr(const void *str, int chr) -{ - intptr_t str_address = (intptr_t)str; - void *str_nonconst = (void*)str_address; - char *s = str_nonconst; - while ((int)*s++ != chr); - return s - 1; -} -#endif - /** * Convert a client ID string into a client ID integer @@ -48,15 +37,6 @@ __attribute__((pure, nonnull)) uint64_t parse_client_id(const char *str); /** - * Read an environment variable, but handle it as undefined if empty - * - * @param var The environment variable's name - * @return The environment variable's value, `NULL` if empty or not defined - */ -__attribute__((nonnull)) -char *getenv_nonempty(const char *var); - -/** * Prepare the server so that it can reexec into * a newer version of the executed file. * @@ -409,16 +389,6 @@ int startswith_n(const char *haystack, const char *needle, size_t haystack_n, si pid_t uninterruptable_waitpid(pid_t pid, int *restrict status, int options); /** - * Check whether a NUL-terminated string is encoded in UTF-8 - * - * @param string The string - * @param allow_modified_nul Whether Modified UTF-8 is allowed, which allows a two-byte encoding for NUL - * @return Zero if good, -1 on encoding error - */ -__attribute__((pure, nonnull)) -int verify_utf8(const char *string, int allow_modified_nul); - -/** * Construct an error message to be sent to a client * * @param recv_client_id The client ID attached on the message that was received, must not be `NULL` |