2023-02-11 15:06:47 +01:00
|
|
|
#ifndef CUTILS_CSTR_H_
|
|
|
|
#define CUTILS_CSTR_H_
|
|
|
|
|
2023-02-12 17:34:54 +01:00
|
|
|
#include <stdbool.h>
|
2023-02-11 15:06:47 +01:00
|
|
|
#include <stddef.h>
|
2023-02-12 17:04:36 +01:00
|
|
|
#include <sys/types.h>
|
2023-02-11 15:06:47 +01:00
|
|
|
|
|
|
|
char *strtrim (char *str); /* trim whitespace of a cstring (both beginning and end) */
|
2023-02-12 17:10:26 +01:00
|
|
|
char *strtriml (char *str); /* trim whitespace of a cstring on the left (beginning of string) */
|
2023-02-12 17:04:36 +01:00
|
|
|
ssize_t strtrimr (char *str); /* trim whitespace of a cstring on the right (end of string) */
|
2023-02-12 17:10:26 +01:00
|
|
|
ssize_t strcount (const char *str, char c); /* count number of occurances of a character within a string */
|
|
|
|
void strdowncase (char *str); /* transform all uppercase letters of a string into lowercase letters */
|
|
|
|
void strupcase (char *str); /* transform all lowercase letters of a string into uppercase letters */
|
2023-02-12 17:34:54 +01:00
|
|
|
bool strisblank (const char *str); /* check if a string only consists of whitespace characters */
|
2023-02-11 15:06:47 +01:00
|
|
|
|
|
|
|
#endif // CUTILS_CSTR_H_
|