diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-03-15 22:13:14 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-03-15 22:13:14 +0200 |
commit | 5c3643f95a9d5568b64875ddf96a7e007050de72 (patch) | |
tree | ef0b514e194dfdc4257040b8f2554df8f081895e /src/pgsql.c | |
parent | 7c6a94930dae634efd8af6db16578d8317153a9a (diff) | |
download | gamma-5c3643f95a9d5568b64875ddf96a7e007050de72.tar.gz gamma-5c3643f95a9d5568b64875ddf96a7e007050de72.tar.bz2 |
Use scm_from_locale_string instead of scm_makfrom0str.
Diffstat (limited to 'src/pgsql.c')
-rw-r--r-- | src/pgsql.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pgsql.c b/src/pgsql.c index 759795e..7fceacd 100644 --- a/src/pgsql.c +++ b/src/pgsql.c @@ -68,14 +68,14 @@ s_pgsql_connect (SCM parmlist, const char *func_name) free(hostname); free(port); free(user); free(pass); - pmsg = scm_makfrom0str(PQerrorMessage(pgconn)); - args = scm_list_1(scm_makfrom0str("Cannot connect to the database")); + pmsg = scm_from_locale_string(PQerrorMessage(pgconn)); + args = scm_list_1(scm_from_locale_string("Cannot connect to the database")); PQfinish(pgconn); scm_error(gamma_sql_error, func_name, "~A", args, scm_list_2(SCM_BOOL_F, pmsg)); } @@ -101,13 +101,13 @@ result_to_list(PGresult *res) for (i = 0; i < ntuples; i++) { SCM new_row; SCM head = SCM_EOL, tail; for (j = 0; j < nfields; j++) { char *val = PQgetvalue(res, i, j); - SCM new_elt = scm_cons(scm_makfrom0str(val), SCM_EOL); + SCM new_elt = scm_cons(scm_from_locale_string(val), SCM_EOL); if (head == SCM_EOL) head = new_elt; else SCM_SETCDR(tail, new_elt); tail = new_elt; } @@ -132,15 +132,15 @@ s_pgsql_query(struct sql_connect *conn, const char *query) ExecStatusType stat; res = PQexec(pgconn, query); if (!res) scm_error(gamma_sql_error, "sql-query", "~A", - scm_list_1(scm_makfrom0str("Error executing PostgreSQL query")), + scm_list_1(scm_from_locale_string("Error executing PostgreSQL query")), scm_list_2(SCM_BOOL_F, - scm_makfrom0str(PQerrorMessage(pgconn)))); + scm_from_locale_string(PQerrorMessage(pgconn)))); stat = PQresultStatus(res); switch (stat) { case PGRES_COMMAND_OK: /* Successful completion of a command returning no data */ @@ -151,13 +151,13 @@ s_pgsql_query(struct sql_connect *conn, const char *query) cell = result_to_list(res); PQclear(res); break; default: scm_error(gamma_sql_error, "sql-query", "~A", - scm_list_1(scm_makfrom0str("PostgreSQL error")), + scm_list_1(scm_from_locale_string("PostgreSQL error")), scm_list_2(scm_from_uint(stat), scm_from_locale_string(PQresStatus(stat)))); } return cell; } |