- /*
- * Define the SQL functions for substring
- * and regular expression matching.
- */
-
- c = sqlite3_create_function(db, "match", 2,
- SQLITE_UTF8 | SQLITE_DETERMINISTIC,
- NULL, sql_match, NULL, NULL);
- assert(SQLITE_OK == c);
- c = sqlite3_create_function(db, "regexp", 2,
- SQLITE_UTF8 | SQLITE_DETERMINISTIC,
- NULL, sql_regexp, NULL, NULL);
- assert(SQLITE_OK == c);
-
- j = 1;
- c = sqlite3_prepare_v2(db, sql, -1, &s, NULL);
- if (SQLITE_OK != c)
- fprintf(stderr, "%s\n", sqlite3_errmsg(db));
-
- for (ep = e; NULL != ep; ep = ep->next) {
- if (NULL == ep->substr) {
- SQL_BIND_BLOB(db, s, j, ep->regexp);
- } else
- SQL_BIND_TEXT(db, s, j, ep->substr);
- if (0 == ((TYPE_Nd | TYPE_Nm) & ep->bits))
- SQL_BIND_INT64(db, s, j, ep->bits);