i3/include/regex.h
Michael Stapelberg d638e3029a don’t use reversed identifiers for include guards (Thanks Markus)
Done with:

    sed -in 's/\(ifndef\|define\) _\([0-9A-Z_]*\)$/\1 I3_\2/' include/**/*.h

fixes #804
2012-09-21 15:36:25 +02:00

40 lines
1.1 KiB
C

/*
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
*
* regex.c: Interface to libPCRE (perl compatible regular expressions).
*
*/
#ifndef I3_REGEX_H
#define I3_REGEX_H
/**
* Creates a new 'regex' struct containing the given pattern and a PCRE
* compiled regular expression. Also, calls pcre_study because this regex will
* most likely be used often (like for every new window and on every relevant
* property change of existing windows).
*
* Returns NULL if the pattern could not be compiled into a regular expression
* (and ELOGs an appropriate error message).
*
*/
struct regex *regex_new(const char *pattern);
/**
* Frees the given regular expression. It must not be used afterwards!
*
*/
void regex_free(struct regex *regex);
/**
* Checks if the given regular expression matches the given input and returns
* true if it does. In either case, it logs the outcome using LOG(), so it will
* be visible without debug logging.
*
*/
bool regex_matches(struct regex *regex, const char *input);
#endif