Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
strfilter.c File Reference
#include "util.h"
#include "string.h"
#include "strfilter.h"

Go to the source code of this file.

Macros

#define is_operator(c)   ((c) == '|' || (c) == '&' || (c) == '!')
 
#define is_separator(c)   (is_operator(c) || (c) == '(' || (c) == ')')
 

Functions

void strfilter__delete (struct strfilter *self)
 
struct strfilterstrfilter__new (const char *rules, const char **err)
 
bool strfilter__compare (struct strfilter *self, const char *str)
 

Macro Definition Documentation

#define is_operator (   c)    ((c) == '|' || (c) == '&' || (c) == '!')

Definition at line 10 of file strfilter.c.

#define is_separator (   c)    (is_operator(c) || (c) == '(' || (c) == ')')

Definition at line 11 of file strfilter.c.

Function Documentation

bool strfilter__compare ( struct strfilter self,
const char str 
)

strfilter__compare - compare given string and a string filter : String filter : target string

Compare and . Return true if the str match the rule

Definition at line 194 of file strfilter.c.

void strfilter__delete ( struct strfilter self)

strfilter__delete - delete a string filter : String filter to delete

Delete .

Definition at line 24 of file strfilter.c.

struct strfilter* strfilter__new ( const char rules,
const char **  err 
)
read

strfilter__new - Create a new string filter : Filter rule, which is a combination of glob expressions. : Pointer which points an error detected on

Parse and return new strfilter. Return NULL if an error detected. In that case, * will indicate where it is detected, and * is NULL if a memory allocation is failed.

Definition at line 155 of file strfilter.c.