RPA Toolkit
added rpa_dbex_dumptree to the PHP extension.
authorMartin Stoilov <martin@rpasearch.com>
Mon, 4 Jul 2011 05:51:10 +0000 (22:51 -0700)
committerMartin Stoilov <martin@rpasearch.com>
Mon, 4 Jul 2011 05:51:10 +0000 (22:51 -0700)
phpext/prpa/php_prpa.h
phpext/prpa/prpa.c

index f73e642..c3210f2 100644 (file)
@@ -55,6 +55,7 @@ PHP_FUNCTION(rpa_dbex_first);
 PHP_FUNCTION(rpa_dbex_last);
 PHP_FUNCTION(rpa_dbex_cfgset);
 PHP_FUNCTION(rpa_dbex_dumpproductions);
+PHP_FUNCTION(rpa_dbex_dumptree);
 PHP_FUNCTION(rpa_dbex_error);
 PHP_FUNCTION(rpa_stat_create);
 PHP_FUNCTION(rpa_stat_scan);
index 918d72e..72676f5 100644 (file)
@@ -84,6 +84,7 @@ zend_function_entry prpa_functions[] = {
        PHP_FE(rpa_dbex_last, NULL)
        PHP_FE(rpa_dbex_cfgset, NULL)
        PHP_FE(rpa_dbex_dumpproductions, NULL)
+       PHP_FE(rpa_dbex_dumptree, NULL)
        PHP_FE(rpa_dbex_error, NULL)
        PHP_FE(rpa_stat_create, NULL)
        PHP_FE(rpa_stat_match, NULL)
@@ -394,6 +395,22 @@ PHP_FUNCTION(rpa_dbex_dumpproductions)
 }
 
 
+PHP_FUNCTION(rpa_dbex_dumptree)
+{
+       zval *zres;
+       php_rpa_dbex *phpdbex;
+       long rid = 0;
+       long ret;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zres, &rid) == FAILURE) {
+               RETURN_LONG(-1);
+       }
+       ZEND_FETCH_RESOURCE(phpdbex, php_rpa_dbex*, &zres, -1, PHP_RPA_DBEX_RES_NAME, le_rpa_dbex);
+       ret = rpa_dbex_dumptree(phpdbex->dbex, rid);
+       RETURN_LONG(ret);
+}
+
+
 PHP_FUNCTION(rpa_dbex_cfgset)
 {
        zval *zres;