1 /* see copyright notice in squirrel.h */ 2 #ifndef _SQSTD_STRING_H_ 3 #define _SQSTD_STRING_H_ 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 //#define SQRex_True 1 10 //#define SQRex_False 0 11 12 typedef unsigned int SQRexBool; 13 typedef struct SQRex SQRex; 14 15 typedef struct { 16 const SQChar *begin; 17 SQInteger len; 18 } SQRexMatch; 19 20 SQUIRREL_API SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error); 21 SQUIRREL_API void sqstd_rex_free(SQRex *exp); 22 SQUIRREL_API SQBool sqstd_rex_match(SQRex* exp,const SQChar* text); 23 SQUIRREL_API SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end); 24 SQUIRREL_API SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end); 25 SQUIRREL_API SQInteger sqstd_rex_getsubexpcount(SQRex* exp); 26 SQUIRREL_API SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp); 27 28 SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v); 29 30 #ifdef __cplusplus 31 } /*extern "C"*/ 32 #endif 33 34 #endif /*_SQSTD_STRING_H_*/ 35