ded0b83151
FossilOrigin-Name: 8766275cac121ced2142c9dee80f2c21a0337e9eb65501961807aba8fca0f252
33 lines
756 B
C
33 lines
756 B
C
/*
|
|
* Treebird - Lightweight frontend for Pleroma
|
|
*
|
|
* Licensed under the BSD 3-Clause License
|
|
*/
|
|
|
|
#ifndef TREE_STRING_H
|
|
#define TREE_STRING_H
|
|
#include <stddef.h>
|
|
#include <time.h>
|
|
|
|
#define STRREPL_ALL 1
|
|
|
|
/**
|
|
* Converts unix time into relative string format
|
|
*
|
|
* Longer variants for months and years to emphasize age
|
|
*
|
|
* Example: 5s, 5m, 5h, 5d, 5mon, 5yr
|
|
* @param time Unix timestamp
|
|
* @return char[16] containing time string
|
|
*/
|
|
char* reltime_to_str(time_t time);
|
|
|
|
int streql(char* cmp1, char* cmp2);
|
|
int strneql(char* cmp1, char* cmp2, size_t cmp1_n);
|
|
char* strnstr(const char* haystack, const char* needle, size_t s);
|
|
char* strrepl(char* source, char* find, char* replace, int flags);
|
|
|
|
char* sanitize_html(char* html);
|
|
|
|
#endif // TREE_STRING_H
|