From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: [PATCH 4/12] Guile-DBII: replace deprecated gh_ functions Date: Fri, 19 Sep 2008 09:09:46 -0500 Message-ID: <20080919140946.GD13684@linas.org> References: <3ae3aa420809190645o2fe2b746id80f53c5cb123e5b@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PHCdUe6m4AxPMzOu" X-Trace: ger.gmane.org 1221833823 6564 80.91.229.12 (19 Sep 2008 14:17:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2008 14:17:03 +0000 (UTC) Cc: Guile User Mailing List To: Maurizio Boriani Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Sep 19 16:18:00 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kggid-0005LD-TE for guile-user@m.gmane.org; Fri, 19 Sep 2008 16:12:25 +0200 Original-Received: from localhost ([127.0.0.1]:49685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kgghb-0007RP-G7 for guile-user@m.gmane.org; Fri, 19 Sep 2008 10:11:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgggD-00073S-Qz for guile-user@gnu.org; Fri, 19 Sep 2008 10:09:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgggC-00072s-7Y for guile-user@gnu.org; Fri, 19 Sep 2008 10:09:53 -0400 Original-Received: from [199.232.76.173] (port=57191 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgggC-00072o-1l for guile-user@gnu.org; Fri, 19 Sep 2008 10:09:52 -0400 Original-Received: from rv-out-0708.google.com ([209.85.198.246]:48845) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KgggB-0004Z4-Ah for guile-user@gnu.org; Fri, 19 Sep 2008 10:09:51 -0400 Original-Received: by rv-out-0708.google.com with SMTP id k29so498337rvb.6 for ; Fri, 19 Sep 2008 07:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:from; bh=Jgb+H4FZsvBh/9sWA67yO2ZhS/eBm/GYDwvJVK8jngo=; b=psqstwQ+UDO2CAugaZAGwn3fqTL1S5TvSZYWBcc/RBKuq0P21O5ezFmx7RtYVKKyhs O7pCw27MNwFtvQVE+PO5TQJ1SThGetXur4ECbVGh2Eke2pGDcYQhOZ50gPvMYa6IiJsb SB3TGb8N5w9y7wif9xnLpH6rs9Wo+fr6SCpkc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:from; b=pqxui4CQrcugETiN1Mv0WpJhkvJH78wvKyoJqvbyL6x35W2buer24FIO9Wb2mhCheq mcx1pOQOWgLKPgGks70gp88FHUmdCgjM4A239BsyYYrJWbSo77v5Q5KJR2q0nuo7UFZN 1AmX0kaIjdvU8dRGR7yFoe3z8zpeqTjhQPvl4= Original-Received: by 10.140.157.1 with SMTP id f1mr53061rve.220.1221833389532; Fri, 19 Sep 2008 07:09:49 -0700 (PDT) Original-Received: from linas.org ( [67.100.217.179]) by mx.google.com with ESMTPS id 34sm1202263yxm.0.2008.09.19.07.09.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Sep 2008 07:09:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: <3ae3aa420809190645o2fe2b746id80f53c5cb123e5b@mail.gmail.com> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6788 Archived-At: --PHCdUe6m4AxPMzOu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Replace deprecated gh_ functions with modern scm_ functions Also, another memory leak. Signed-off-by: Linas Vepstas --- src/guile-dbi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Index: guile-dbi-2.0.0/src/guile-dbi.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- guile-dbi-2.0.0.orig/src/guile-dbi.c 2008-09-16 18:44:31.000000000 -0500 +++ guile-dbi-2.0.0/src/guile-dbi.c 2008-09-16 18:47:11.000000000 -0500 @@ -214,7 +214,7 @@ SCM_DEFINE (query_g_db_handle, "dbi-quer SCM_ASSERT (scm_is_string (query), query, SCM_ARG2, "query_g_db_handle"); =20 g_db_handle =3D (struct g_db_handle*)SCM_SMOB_DATA(db_handle); - query_str =3D (char*) gh_scm2newstr(query,NULL); + query_str =3D scm_to_locale_string(query); =20 __gdbi_dbd_wrap(g_db_handle,(char*) __FUNCTION__,(void**) &dbi_query); = =20 if (scm_equal_p (SCM_CAR(g_db_handle->status),scm_from_int(0)) =3D=3D SC= M_BOOL_F) @@ -315,11 +315,12 @@ __gdbi_dbd_wrap(gdbi_db_handle_t* dbh, c char *func =3D NULL; char *bcknd =3D NULL; =20 - bcknd =3D (char*) gh_scm2newstr(dbh->bcknd,NULL); + bcknd =3D scm_to_locale_string(dbh->bcknd); =20 if((func=3Dmalloc(sizeof(char)*(strlen(function_name)+ 20))) =3D=3D NULL) { + free(bcknd); dbh->status =3D (SCM) scm_cons(scm_from_int(errno), scm_makfrom0str(strerror(errno))); return; @@ -329,6 +330,7 @@ __gdbi_dbd_wrap(gdbi_db_handle_t* dbh, c *(void **) (function_pointer) =3D dlsym(dbh->handle,func); if((ret =3D dlerror()) !=3D NULL) { + free(bcknd); dbh->status =3D (SCM) scm_cons(scm_from_int(1), scm_makfrom0str(ret)); return; --PHCdUe6m4AxPMzOu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBSNOyqoSDRXfAOJJBAQI3wwgAsuYYBS6jUYniIWr/o0Ircgw9V9xwYKgI vNVOe2T9csGqWi6kgWzdlvnKZkLRXcZulFkTonliqwgPpFIk8LcxuVfq63l4HEWO EKAli6O4jAnvGgtjB4nx9yzEKAkwMEvWzuXeFhoEJBB9drgNCOVa9gzjnvvcc3s2 VkFh50cCK0a6dSIdFWcfhDOGIfZ6pGujzgEqT3AfjjPy9YkoLpvuqG0ubGuCWQRs w0l5oim7kGxuyLoiEwDBk+0lfDjXKts3uzBcIFvqZf4AB4T8XJ4xrvcdTIjAjJ7c I/WdtqbZKEu5LHzxw1wNizVe+Ucfi9qbp7gswKBAxUqN0vqyAMm0ZQ== =kVzn -----END PGP SIGNATURE----- --PHCdUe6m4AxPMzOu--