Re: set handle to NULL
John DeSoi <[email protected]> Wed, 14 Aug 2002 02:22:49 -0400
| Newsgroups | gmane.lisp.uffi.general |
|---|---|
| Message-ID | <p05111b04b97fa21c6051@[192.168.1.6]> |
Kevin, At 10:57 PM -0600 8/13/02, Kevin Rosenberg wrote: >On Mon, Aug 12, 2002 at 11:11:29PM -0400, John DeSoi wrote: >> isc_db_handle newdb = NULL; /* database handle */ >> isc_tr_handle trans = NULL; /* transaction handle */ >[...] > > if (isc_dsql_execute_immediate(status, &newdb, &trans, 0, create_db, 1, >> NULL)) > >I think you need to make a void-pointer object, then set the value of >that object to 0, then pass the address of the objet. This way, >isc_dsql_execute_immediate can store some value in the storage that >you allocated for the object. So (setf newdb (uffi:allocate-foreign-object :pointer-void)) (setf (uffi:deref-pointer newdb) 0) Then call isc_dsql_execute_immediate with (uffi:pointer-address newdb) ? I also tried passing another pointer: (fli:make-pointer :address (uffi:pointer-address newdb)) I always get a processor fault error. I have the db-handle parameter typed as (* isc-db-handle) and (uffi:def-foreign-type isc-db-handle :pointer-void) I get the "bad db handle" error if I create the handle like this: (setf newdb (uffi:allocate-foreign-object (:pointer isc-db-handle)) So I'm assuming the part I'm missing is getting it set to NULL. What is the correct way to do this? Sorry if I'm being dense. All the C pointer stuff makes me really like Lisp :) Thanks, John DeSoi, Ph.D.