/* SPDX-License-Identifier: GPL-3.0-or-later */ /* Copyright 2022 Ivan Polyakov */ #ifndef RAPIDA_UTILS_H_ENTRY #define RAPIDA_UTILS_H_ENTRY int count_char_entries(const char *str, char ch); char *rpd_strdup(const char *src); char *rpd_strsep(char **str, const char *sep); const char *rpd_splitbyc(char **dest1, char **dest2, const char *src, const char sep); /*! * \brief Erases part of the string. * * This function moves characters to the beginning of the string * and inserts '\0' at the original position without reallocation. * * To erase characters not from beginning of the string, * you can pass a pointer to the beginning of the desired * part of the string. * * \param src String to erase. * \param nchars Number of charecters to erase. */ void rpd_strerase(char *src, int nchars); #endif /* RAPIDA_UTILS_H_ENTRY */