summaryrefslogtreecommitdiff
path: root/src/utils/utils.h
blob: 5a26cf24d4634470ce7cbab0eebcf801286d4d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef UTILS_H_
#define UTILS_H_

#include <stddef.h>
#include "types.h"

int regex_match(const char *, str_array_t, str_array_t *);

int substitute_str(const char *subject, const char *pattern,
                   const char *replacement, char **presult);

const char *mimeType2ext(const char *mimeType);

int repchr(char *str, char t, char r);

/* NOTICE: pass a pointer-to-pointer to free the original pointer. */
void free_and_nullify(void *p);

#endif