-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrutils.h
37 lines (30 loc) · 1.01 KB
/
strutils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef STRUTILS_H
#define STRUTILS_H
#include <stdarg.h>
#include <stdlib.h>
int isint(const char *s);
int endswith(const char *s, const char *s2);
char *savestring(const char *);
char *savefmt(const char *fmt, ...);
char *appendstr(char *s, ...);
char *appendfmt(char *s, const char *fmt, ...);
char *indent(const char *);
char *format_muv_str(const char *);
size_t firstlen(const char *);
size_t lastlen(const char *);
size_t linecount(const char *);
char *wrapit(const char *pfx, const char *s, const char *sfx);
char *wrapit2(const char *pfx, const char *s, const char *mid, const char *s2, const char *sfx);
char *replace_words(char *s, const char *pat, const char *repl);
char *sanitize_path(char* out, size_t outlen, const char *path, const char *cwd);
typedef struct accessor_t {
const char *get;
const char *set;
const char *del;
const char *call;
const char *oper_pre;
const char *oper_post;
} accessor;
void getset_free(accessor *x);
#endif
/* vim: set ts=4 sw=4 et ai hlsearch nowrap : */