NULL -> f

[ ] [ ] catch -> [ ] catch [ ] when
ifte -> if
cvs
Doug Coleman 2005-09-27 04:54:53 +00:00
parent 5c966a354e
commit 0505f630d3
3 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ win32? [
! "postgresql" "dll" "stdcall" add-library ! "postgresql" "dll" "stdcall" add-library
] [ ] [
"postgresql" "libpq.so" "cdecl" add-library "postgresql" "libpq.so" "cdecl" add-library
] ifte ] if
[ "postgresql.factor" ] [ "postgresql.factor" ]
[ "contrib/postgresql/" swap append run-file ] each [ "contrib/postgresql/" swap append run-file ] each

View File

@ -31,11 +31,12 @@ USING: kernel postgresql alien errors io ;
: do-query-drop-nofail ( PGconn query -- PGresult * ) : do-query-drop-nofail ( PGconn query -- PGresult * )
[ do-query ] [ do-query ]
catch
[ [
"non-fatal error, continuing" print "non-fatal error, continuing" print
drop drop
PQclear ! clear memory PQclear ! clear memory
] catch ; ] when ;
! just a basic demo ! just a basic demo
: run-test ( -- ) : run-test ( -- )

View File

@ -88,7 +88,7 @@ FUNCTION: PGconn* PQsetdbLogin ( char* pghost, char* pgport,
! PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL) ! PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
: PQsetdb ( M_PGHOST M_PGPORT M_PGOPT M_PGTTY M_DBNAME -- PGconn* ) : PQsetdb ( M_PGHOST M_PGPORT M_PGOPT M_PGTTY M_DBNAME -- PGconn* )
NULL NULL PQsetdbLogin ; f f PQsetdbLogin ;
! close the current connection and free the PGconn data structure ! close the current connection and free the PGconn data structure
FUNCTION: void PQfinish ( PGconn* conn ) ; FUNCTION: void PQfinish ( PGconn* conn ) ;