dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Call for testing Swig + Pnet = SwigSharp (For Debian)


From: minddog
Subject: Re: [DotGNU]Call for testing Swig + Pnet = SwigSharp (For Debian)
Date: Wed, 12 Mar 2003 17:13:37 -0700
User-agent: KMail/1.5.9

Okay so I did a little hacking today with your swigsharp...

I decided to try the libpq libs for postgresql, pretty much:
swig -csharp -m libpgsharp libpg-fe.h 
gcc libpg-fe_wrapper.c  
gcc -shared libpg.so libpg-fe_wrapper.c -o libpgsharp.so
cscc *.cs -o libpgsharp.dll
done =)  ...with a fix in some of the autogenerated code
theres a bug with get/set methods where value is supposed to be an IntPtr, but 
is another Object so you must run a static method on that type to receive the 
private address. 

okay so i ran a simple test case(still need to have more time looking at the 
assembly):

using System;

public class Test : libpgsharp
{
        public static void Main(String[] args)
        {
                String dbName = "test";
                
                SWIGTYPE_p_pg_conn conn =  libpgsharp.PQsetdbLogin("localhost", 
"5432", "", 
"", dbName, "minddog", null);
                
                if (libpgsharp.PQstatus(conn) == libpgsharp.CONNECTION_BAD)
                {
                        Console.WriteLine("Connection to database {0} 
failed.\n", dbName);
                        Console.WriteLine(libpgsharp.PQerrorMessage(conn));
                
                }               
        }

}

And a test of it

address@hidden:~/postgresql-7.3.2/src/interfaces/libpq/libpgsharp-test$ 
ilrun test.exe 
Connection to database test failed.

FATAL:  IDENT authentication failed for user "minddog"


So it doesn't quite work yet, but it will be nice to _finally_ have a GNU 
compatible library for database connections.  This will work tomorrow, =)

Hopefully I can get the Virtual Identities FOAF server setup with the database 
soon.  

Mdupont, great work on getting that going!  

What next? OpenGL, pnet itself?! hehe 

regards,
-- 
--minddog( Adam Ballai )

"I try to take it one day at a time, but several of them attack me at once."
-mistyflip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]