diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-10-06 03:40:52 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-10-10 02:38:46 +0200 |
commit | f31445915e79cc07236941c5fd5ce16268eaa255 (patch) | |
tree | 85b93482dce5a297217c49cd73366c61ac15be47 /src/db_hlr.c | |
parent | 518335e688ea79a41cb6ce0b6b65ad829ece6f3f (diff) |
cosmetic: refactor db_bind_imsi() as db_bind_text()
There are more uses for a generalized db_bind_text(), and in an upcoming patch
there will be similar functions like db_bind_int().
Also, add argument param_name, optionally indicating a named SQL parameter to
bind to, which will be used in subsequent patches. So far, all callers pass
NULL to yield previous db_bind_imsi() behavior of binding to the first param.
Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394
Diffstat (limited to 'src/db_hlr.c')
-rw-r--r-- | src/db_hlr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db_hlr.c b/src/db_hlr.c index fa962f3..3bf3912 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -43,7 +43,7 @@ int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, sqlite3_stmt *stmt = dbc->stmt[DB_STMT_SEL_BY_IMSI]; int rc; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; /* execute the statement */ @@ -86,7 +86,7 @@ int db_subscr_ps(struct db_context *dbc, const char *imsi, bool enable) dbc->stmt[enable ? DB_STMT_SET_NAM_PS_BY_IMSI : DB_STMT_UNSET_NAM_PS_BY_IMSI]; int rc; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; rc = sqlite3_step(stmt); /* execute the statement */ @@ -158,7 +158,7 @@ int db_subscr_purge(struct db_context *dbc, const char *imsi, bool is_ps) else stmt = dbc->stmt[DB_STMT_UPD_PURGE_CS_BY_IMSI]; - if (!db_bind_imsi(stmt, imsi)) + if (!db_bind_text(stmt, NULL, imsi)) return -EINVAL; /* execute the statement */ |