Pequenas correcoes esteticas.

This commit is contained in:
tomas 2003-10-24 10:48:12 +00:00
parent a22d551fa9
commit bfb70eaf4e
3 changed files with 9 additions and 11 deletions

View File

@ -2,7 +2,7 @@
** LuaSQL, PostgreSQL driver
** Authors: Pedro Rabinovitch, Roberto Ierusalimschy, Carlos Cassino
** Tomas Guisasola, Eduardo Quintao
** $Id: ls_pg.c,v 1.14 2003/05/30 10:04:59 tomas Exp $
** $Id: ls_pg.c,v 1.15 2003/10/24 10:48:12 tomas Exp $
*/
#include <assert.h>
@ -330,8 +330,7 @@ static int conn_close (lua_State *L) {
static int conn_execute (lua_State *L) {
conn_data *conn = getconnection (L);
const char *statement = luaL_checkstring (L, 2);
PGresult *res;
res = PQexec(conn->pg_conn, statement);
PGresult *res = PQexec(conn->pg_conn, statement);
if (res && PQresultStatus(res)==PGRES_COMMAND_OK) {
/* no tuples returned */
lua_pushnumber(L, atof(PQcmdTuples(res)));
@ -507,7 +506,7 @@ static int create_environment (lua_State *L) {
** Creates the metatables for the objects and registers the
** driver open method.
*/
LUASQL_API int luasql_libopen_postgres (lua_State *L) {
LUASQL_API int luasql_libopen_postgres (lua_State *L) {
luasql_getlibtable (L);
lua_pushstring(L, "postgres");
lua_pushcfunction(L, create_environment);

View File

@ -1,7 +1,7 @@
/*
** LuaSQL, MySQL driver
** Authors: Eduardo Quintao
** $Id: ls_mysql.c,v 1.6 2003/08/21 18:20:01 eduquintao Exp $
** $Id: ls_mysql.c,v 1.7 2003/10/24 10:48:12 tomas Exp $
*/
#include <assert.h>
@ -93,7 +93,6 @@ static cur_data *getcursor (lua_State *L) {
** Push the value of #i field of #tuple row.
*/
static void pushvalue (lua_State *L, void *row, long int len) {
/* Levar em consideracao os tipos mais proximos a lua */
if (row == NULL)
lua_pushnil (L);
else

View File

@ -1,7 +1,7 @@
/*
** LuaSQL, Oracle driver
** Authors: Tomas Guisasola, Leonardo Godinho
** $Id: ls_oci8.c,v 1.12 2003/06/09 20:07:54 tomas Exp $
** $Id: ls_oci8.c,v 1.13 2003/10/24 10:48:12 tomas Exp $
*/
#include <assert.h>
@ -497,8 +497,8 @@ static int cur_getcoltypes (lua_State *L) {
static int cur_numrows (lua_State *L) {
int n;
cur_data *cur = getcursor (L);
ASSERT (L, OCIAttrGet ((dvoid *) cur->stmthp, OCI_HTYPE_STMT, (dvoid *)&n, (ub4)0,
OCI_ATTR_NUM_ROWS, cur->errhp), cur->errhp);
ASSERT (L, OCIAttrGet ((dvoid *) cur->stmthp, OCI_HTYPE_STMT, (dvoid *)&n,
(ub4)0, OCI_ATTR_NUM_ROWS, cur->errhp), cur->errhp);
lua_pushnumber (L, n);
return 1;
}
@ -783,7 +783,7 @@ static int create_environment (lua_State *L) {
env->conn_counter = 0;
env->envhp = NULL;
env->errhp = NULL;
/* talvez OCI_SHARED e OCI_THREADED ??? */
/* maybe OCI_SHARED and OCI_THREADED ??? */
if (OCIEnvCreate ( &(env->envhp), (ub4)OCI_DEFAULT, (dvoid *)0,
(dvoid * (*)(dvoid *, size_t)) 0,
(dvoid * (*)(dvoid *, dvoid *, size_t)) 0,
@ -834,7 +834,7 @@ static void create_metatables (lua_State *L) {
** Creates the metatables for the objects and registers the
** driver open method.
*/
LUASQL_API int luasql_libopen_oracle (lua_State *L) {
LUASQL_API int luasql_libopen_oracle (lua_State *L) {
luasql_getlibtable (L);
lua_pushstring(L, "oracle");
lua_pushcfunction(L, create_environment);