UDF: cbm_cx_set(properties, tld, recursive). */
| 468 | |
| 469 | /* UDF: cbm_cx_set(properties, tld, recursive). */ |
| 470 | static void sql_complexity_set(sqlite3_context *c, int argc, sqlite3_value **argv) { |
| 471 | if (argc != 3) { |
| 472 | sqlite3_result_error(c, "cbm_cx_set arity", -1); |
| 473 | return; |
| 474 | } |
| 475 | char *neu = complexity_set_props((const char *)sqlite3_value_text(argv[0]), |
| 476 | sqlite3_value_int(argv[1]), sqlite3_value_int(argv[2]) != 0); |
| 477 | if (!neu) { |
| 478 | sqlite3_result_error(c, "cbm_cx_set: malformed complexity properties", -1); |
| 479 | return; |
| 480 | } |
| 481 | sqlite3_result_text(c, neu, -1, SQLITE_TRANSIENT); |
| 482 | cbm_free(CBM_MEM_CLASS_OTHER, neu); |
| 483 | } |
| 484 | |
| 485 | static bool tld_step_int64(sqlite3_stmt *st, int64_t *out) { |
| 486 | if (sqlite3_step(st) != SQLITE_ROW) { |
nothing calls this directly
no test coverage detected