2014-05-14 22:10:34 -04:00
|
|
|
/*
|
2014-05-16 08:22:25 -04:00
|
|
|
* r3_str.h
|
2014-05-14 22:10:34 -04:00
|
|
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
|
|
|
*
|
|
|
|
* Distributed under terms of the MIT license.
|
|
|
|
*/
|
|
|
|
#ifndef STR_H
|
|
|
|
#define STR_H
|
|
|
|
|
2014-05-16 08:22:25 -04:00
|
|
|
#include "r3_define.h"
|
2014-05-16 19:26:47 -04:00
|
|
|
#include "config.h"
|
2014-05-15 10:57:13 -04:00
|
|
|
|
|
|
|
int strndiff(char * d1, char * d2, unsigned int n);
|
|
|
|
|
|
|
|
int strdiff(char * d1, char * d2);
|
|
|
|
|
2014-05-15 12:00:19 -04:00
|
|
|
int count_slug(char * p, int len);
|
|
|
|
|
2014-05-15 11:46:49 -04:00
|
|
|
char * compile_slug(char * str, int len);
|
|
|
|
|
2014-05-16 00:33:59 -04:00
|
|
|
bool contains_slug(char * str);
|
|
|
|
|
2014-05-18 08:08:43 -04:00
|
|
|
char * find_slug_pattern(char *s1, int *len);
|
2014-05-18 06:58:31 -04:00
|
|
|
|
|
|
|
char * find_slug_placeholder(char *s1, int *len);
|
|
|
|
|
|
|
|
char * inside_slug(char * needle, int needle_len, char *offset);
|
2014-05-15 08:38:07 -04:00
|
|
|
|
2014-05-15 00:53:48 -04:00
|
|
|
char * ltrim_slash(char* str);
|
|
|
|
|
|
|
|
char** str_split(char* a_str, const char a_delim);
|
2014-05-14 22:10:34 -04:00
|
|
|
|
2014-05-15 06:02:10 -04:00
|
|
|
void str_repeat(char *s, char *c, int len);
|
|
|
|
|
|
|
|
void print_indent(int level);
|
|
|
|
|
2014-05-16 19:26:47 -04:00
|
|
|
#ifndef HAVE_STRDUP
|
|
|
|
char *strdup(const char *s);
|
|
|
|
#endif
|
2014-05-16 12:35:56 -04:00
|
|
|
|
2014-05-16 19:26:47 -04:00
|
|
|
#ifndef HAVE_STRNDUP
|
|
|
|
char *strndup(const char *s, int n);
|
|
|
|
#endif
|
2014-05-16 12:35:56 -04:00
|
|
|
|
2014-05-15 08:38:07 -04:00
|
|
|
|
2014-05-14 22:10:34 -04:00
|
|
|
#endif /* !STR_H */
|
2014-05-15 06:02:10 -04:00
|
|
|
|