rpadbex.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 
00039 #ifndef _RPADBEX_H_
00040 #define _RPADBEX_H_
00041 
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 #include "rtypes.h"
00048 #include "rvm/rvmcpu.h"
00049 #include "rpa/rpaerror.h"
00050 
00051 
00056 typedef struct rpadbex_s rpadbex_t;
00067 typedef long rparule_t;
00068 
00069 #define RPA_VERSION "2.0"
00070 #define RPA_DBEXCFG_OPTIMIZATIONS 1
00071 #define RPA_DBEXCFG_DEBUG 2
00072 #define RPA_DBEXCFG_BITMAP 3
00073 
00079 const char *rpa_dbex_version();
00080 
00081 
00088 rpadbex_t *rpa_dbex_create(void);
00089 
00090 
00098 void rpa_dbex_destroy(rpadbex_t *dbex);
00099 
00100 
00108 long rpa_dbex_lasterror(rpadbex_t *dbex);
00109 
00119 long rpa_dbex_lasterrorinfo(rpadbex_t *dbex, rpa_errinfo_t *errinfo);
00120 
00121 
00135 int rpa_dbex_open(rpadbex_t *dbex);
00136 
00137 
00146 void rpa_dbex_close(rpadbex_t *dbex);
00147 
00148 
00161 int rpa_dbex_compile(rpadbex_t *dbex);
00162 
00163 
00175 long rpa_dbex_load(rpadbex_t *dbex, const char *buffer, unsigned long size);
00176 
00177 
00189 long rpa_dbex_load_s(rpadbex_t *dbex, const char *buffer);
00190 
00191 
00201 rvm_asmins_t *rpa_dbex_executable(rpadbex_t *dbex);
00202 
00203 
00218 long rpa_dbex_executableoffset(rpadbex_t *dbex, rparule_t rid);
00219 
00220 
00234 rparule_t rpa_dbex_lookup(rpadbex_t *dbex, const char *name, unsigned int namesize);
00235 
00236 
00242 rparule_t rpa_dbex_lookup_s(rpadbex_t *dbex, const char *name);
00243 
00244 
00256 const char *rpa_dbex_name(rpadbex_t *dbex, rparule_t rid);
00257 
00258 
00268 rparule_t rpa_dbex_first(rpadbex_t *dbex);
00269 
00270 
00280 rparule_t rpa_dbex_last(rpadbex_t *dbex);
00281 
00282 
00290 rparule_t rpa_dbex_next(rpadbex_t *dbex, rparule_t rid);
00291 
00292 
00300 rparule_t rpa_dbex_prev(rpadbex_t *dbex, rparule_t rid);
00301 
00302 
00310 long rpa_dbex_strlen(rpadbex_t *dbex, rparule_t rid);
00311 
00312 
00322 long rpa_dbex_strncpy(rpadbex_t *dbex, char *dest, rparule_t rid, unsigned long size);
00323 
00324 
00343 long rpa_dbex_cfgset(rpadbex_t *dbex, unsigned long cfg, unsigned long val);
00344 
00345 
00358 long rpa_dbex_cfgget(rpadbex_t *dbex, unsigned long cfg);
00359 
00360 
00369 int rpa_dbex_dumptree(rpadbex_t *dbex, rparule_t rid);
00370 
00379 int rpa_dbex_dumpcode(rpadbex_t* dbex, rparule_t rid);
00380 
00381 
00391 int rpa_dbex_dumprecords(rpadbex_t *dbex);
00392 
00400 int rpa_dbex_dumpproductions(rpadbex_t *dbex);
00401 
00409 int rpa_dbex_dumpinfo(rpadbex_t *dbex);
00410 
00418 int rpa_dbex_dumpuids(rpadbex_t *dbex);
00419 
00429 #ifdef __cplusplus
00430 }
00431 #endif
00432 
00433 #endif