rpastat.h
Go to the documentation of this file.
00001 /*
00002  *  Regular Pattern Analyzer Toolkit (RPA/Tk)
00003  *  Copyright (c) 2009-2012 Martin Stoilov
00004  *
00005  *  This program is free software: you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation, either version 3 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  *
00018  *  Martin Stoilov <martin@rpasearch.com>
00019  */
00020 
00021 #ifndef _RPASTAT_H_
00022 #define _RPASTAT_H_
00023 
00024 #include "rtypes.h"
00025 #include "rlib/rarray.h"
00026 #include "rvm/rvmreg.h"
00027 #include "rpa/rpadbex.h"
00028 
00029 #define RPA_ENCODING_UTF8 0
00030 #define RPA_ENCODING_BYTE 1
00031 #define RPA_ENCODING_UTF16LE 2
00032 #define RPA_ENCODING_ICASE (1 << 8)
00033 #define RPA_ENCODING_ICASE_BYTE (RPA_ENCODING_BYTE | RPA_ENCODING_ICASE)
00034 #define RPA_ENCODING_ICASE_UTF8 (RPA_ENCODING_UTF8 | RPA_ENCODING_ICASE)
00035 #define RPA_ENCODING_ICASE_UTF16LE (RPA_ENCODING_UTF16LE | RPA_ENCODING_ICASE)
00036 #define RPA_ENCODING_MASK ((1 << 8) - 1)
00037 #define RPA_DEFAULT_STACKSIZE (256 * 1024)
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00061 typedef struct rpastat_s rpastat_t;
00062 
00082 rpastat_t *rpa_stat_create(rpadbex_t *dbex, unsigned long stacksize);
00083 
00084 
00093 void rpa_stat_destroy(rpastat_t *stat);
00094 
00095 
00118 long rpa_stat_scan(rpastat_t *stat, rparule_t rid, unsigned int encoding, const char *input, const char *start, const char *end, const char **where);
00119 
00143 long rpa_stat_parse(rpastat_t *stat, rparule_t rid, unsigned int encoding, const char *input, const char *start, const char *end, rarray_t *records);
00144 
00166 long rpa_stat_match(rpastat_t *stat, rparule_t rid, unsigned int encoding, const char *input, const char *start, const char *end);
00167 
00168 
00194 long rpa_stat_exec(rpastat_t *stat, rvm_asmins_t *prog, ruword off, unsigned int encoding, const char *input, const char *start, const char *end, rarray_t *records);
00195 
00196 
00204 int rpa_stat_abort(rpastat_t *stat);
00205 
00206 
00214 long rpa_stat_lasterror(rpastat_t *stat);
00215 
00225 long rpa_stat_lasterrorinfo(rpastat_t *stat, rpa_errinfo_t *errinfo);
00226 
00227 
00233 #ifdef __cplusplus
00234 }
00235 #endif
00236 
00237 #endif