luasandbox  1.4.0
Generic Lua sandbox for dynamic data analysis
Functions
string_matcher.h File Reference

C API for the Lua string pattern matcher. More...

#include <stdbool.h>
#include <stddef.h>
#include "util.h"
Include dependency graph for string_matcher.h:

Go to the source code of this file.

Functions

LSB_UTIL_EXPORT bool lsb_string_match (const char *s, size_t len, const char *p)
 Matches a string using a Lua string match pattern. More...
 
LSB_UTIL_EXPORT bool lsb_string_find (const char *s, size_t ls, const char *p, size_t lp)
 Searches for a string literal within a string. More...
 

Detailed Description

C API for the Lua string pattern matcher.

Definition in file string_matcher.h.

Function Documentation

LSB_UTIL_EXPORT bool lsb_string_find ( const char *  s,
size_t  ls,
const char *  p,
size_t  lp 
)

Searches for a string literal within a string.

Parameters
sString to search
lsLength of the string
pLiteral match string
lpLength of the match string
Returns
bool True if the string contains the literal
LSB_UTIL_EXPORT bool lsb_string_match ( const char *  s,
size_t  len,
const char *  p 
)

Matches a string using a Lua string match pattern.

Parameters
sString to match
lenLength of the string
pLua match pattern http://www.lua.org/manual/5.1/manual.html#pdf-string.match
Returns
bool True if the string matches the pattern