2017-02-16 22:48:13 +01:00
|
|
|
#ifndef __REGEX_H
|
|
|
|
|
#define __REGEX_H
|
|
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
|
|
#ifdef USE_GREGEX
|
|
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
typedef GRegex Regex;
|
2017-06-05 11:41:50 +02:00
|
|
|
typedef struct _MatchInfo MatchInfo;
|
2017-02-16 22:48:13 +01:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
#include <regex.h>
|
|
|
|
|
typedef regex_t Regex;
|
|
|
|
|
typedef regmatch_t MatchInfo;
|
|
|
|
|
|
2017-06-05 11:41:50 +02:00
|
|
|
#endif
|
|
|
|
|
|
2017-02-16 22:48:13 +01:00
|
|
|
gboolean
|
|
|
|
|
i_match_info_matches (const MatchInfo *match_info);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
i_match_info_free (MatchInfo *match_info);
|
|
|
|
|
|
|
|
|
|
Regex *
|
|
|
|
|
i_regex_new (const gchar *pattern,
|
|
|
|
|
GRegexCompileFlags compile_options,
|
|
|
|
|
GRegexMatchFlags match_options,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
i_regex_unref (Regex *regex);
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
i_regex_match (const Regex *regex,
|
|
|
|
|
const gchar *string,
|
|
|
|
|
GRegexMatchFlags match_options,
|
2017-06-05 11:41:50 +02:00
|
|
|
MatchInfo **match_info);
|
2017-02-16 22:48:13 +01:00
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
i_match_info_fetch_pos (const MatchInfo *match_info,
|
|
|
|
|
gint match_num,
|
|
|
|
|
gint *start_pos,
|
2017-06-05 11:41:50 +02:00
|
|
|
gint *end_pos);
|
2017-02-16 22:48:13 +01:00
|
|
|
|
|
|
|
|
#endif
|