summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2012-02-26 00:10:30 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2013-06-13 01:06:19 +0200
commit3611dd8cce29874aca2b54819d49ba61e2f426f3 (patch)
treecfa83a76c73350d732e7ead512fe4edbfeb1be4b
parent75fccb3870050a24de1e6665187b0291e0854b33 (diff)
downloadeurephia-3611dd8cce29874aca2b54819d49ba61e2f426f3.tar.gz
eurephia-3611dd8cce29874aca2b54819d49ba61e2f426f3.tar.xz
eurephia-3611dd8cce29874aca2b54819d49ba61e2f426f3.zip
edb-pgsql: Added ePGprepParamsAddArgumentChar()
This is used to add a single char value to the prepared arguments stack. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--database/postgresql/prepared-sql.c9
-rw-r--r--database/postgresql/prepared-sql.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/database/postgresql/prepared-sql.c b/database/postgresql/prepared-sql.c
index 7697478..1353038 100644
--- a/database/postgresql/prepared-sql.c
+++ b/database/postgresql/prepared-sql.c
@@ -634,6 +634,15 @@ int ePGprepParamsAddArgumentInt(eurephiaCTX *ctx, ePGprepParams *prms, const int
}
+int ePGprepParamsAddArgumentChar(eurephiaCTX *ctx, ePGprepParams *prms, const char arg) {
+ char argstr[3];
+
+ memset(&argstr, 0, 3);
+ snprintf(argstr, 2, "%c", arg);
+ return ePGprepParamsAddArgument(ctx, prms, argstr);
+}
+
+
PGresult * ePGprepExec(eurephiaCTX *ctx, ePGprepParams *qry_args)
{
int i = 0;
diff --git a/database/postgresql/prepared-sql.h b/database/postgresql/prepared-sql.h
index f5325b6..b932d5e 100644
--- a/database/postgresql/prepared-sql.h
+++ b/database/postgresql/prepared-sql.h
@@ -69,6 +69,7 @@ int ePGprepLoadStatements(eurephiaCTX *ctx);
ePGprepParams * ePGprepParamsAlloc(eurephiaCTX *ctx, ePG_prepID prepid);
int ePGprepParamsAddArgument(eurephiaCTX *ctx, ePGprepParams *prms, const char *arg);
int ePGprepParamsAddArgumentInt(eurephiaCTX *ctx, ePGprepParams *prms, const int arg);
+int ePGprepParamsAddArgumentChar(eurephiaCTX *ctx, ePGprepParams *prms, const char arg);
PGresult * ePGprepExec(eurephiaCTX *ctx, ePGprepParams *qry_args);
#endif