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

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

#define FREE_AND_NULLIFY(x) do{if(x)free(x); x = NULL;}while(0)

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);

#endif