From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FJeHw-0005FO-1j for garchives@archives.gentoo.org; Wed, 15 Mar 2006 22:16:16 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5.20060308/8.13.5) with SMTP id k2FMF1Ef027341; Wed, 15 Mar 2006 22:15:01 GMT Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.200]) by robin.gentoo.org (8.13.5.20060308/8.13.5) with ESMTP id k2FMF052028718 for ; Wed, 15 Mar 2006 22:15:00 GMT Received: by nproxy.gmail.com with SMTP id a25so160606nfc for ; Wed, 15 Mar 2006 14:15:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=r0GuJyU7FmD8ygSI0aBKSApBUCHbLiyPmYxywg4a5nqFLEc77goIJXPqndoO0mCqVL5089GYjggv/U5xAN+VUHQsOS2MuwPje/yTu20lCk1TabG4F3pEHjHWfvWEABWwXQHR7jHcF0Bmc8HxavPwm9EXmaeyfoSLuMXYpsKvlVU= Received: by 10.48.239.5 with SMTP id m5mr514506nfh; Wed, 15 Mar 2006 14:14:59 -0800 (PST) Received: by 10.49.29.4 with HTTP; Wed, 15 Mar 2006 14:14:59 -0800 (PST) Message-ID: Date: Thu, 16 Mar 2006 00:14:59 +0200 From: tvali To: gentoo-portage-dev@lists.gentoo.org Subject: Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline References: <4416DEAF.30008@gentoo.org> <200603151051.32777.pauldv@gentoo.org> <1142434334.25069.110.camel@onyx> <20060315214248.5ef51202@c1358217.kevquinn.com> <1142458625.10619.131.camel@onyx> X-MIME-Autoconverted: from quoted-printable to 8bit by robin.gentoo.org id k2FMF052028718 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by robin.gentoo.org id k2FMF1G0027341 X-Archives-Salt: e5d55fd2-bcdf-4741-852f-6db88f38fff5 X-Archives-Hash: c6bc28cf1df7156208d8036744a06d64 sorry lines char tt; for (tt=3D0; tt<40; tt++) fputc(tt, inputf); /.../ fputc(EOF, inputf); are not needed at all and do nothing -- i was just testing a thought before i catched how those pipes and forks work in linux :) i have mostly done things in windows and c++ and WinApi so i dont catch everything immedietly yet :) 2006/3/16, tvali : > So I was the last one :) > > My example is using python interpreter -- it's maybe simpler to use in > many cases, but theoretically slower. > > It is, anyway, not so advanced to import portage, but you can add that = line ;) > > 2006/3/15, solar : > > On Wed, 2006-03-15 at 21:42 +0100, Kevin F. Quinn (Gentoo) wrote: > > > On Wed, 15 Mar 2006 09:52:13 -0500 > > > solar wrote: > > > > > > > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote: > > > > > > > > [snip] > > > > > > > > > Actually, C++ being strongly related to C, can just use the C > > > > > python api's. As such it could directly interface with python, = and > > > > > use the python portage api. > > > > > > > > If you could demonstrate an 'import portage' and a simple > > > > printf("PORTDIR=3D%s\n", PORTDIR); in C I'd be highly interested. > > > > > > Try attached :) Had a go 'coz I was curious. Compile with: > > > > > > gcc -o getportdir getportdir.c -lpython2.4 > > > > > > Does the equivalent of: > > > > > > #!/usr/bin/portage > > > import portage; > > > print portage.settings["PORTDIR"]; > > > > > > (more or less). Docs on the API itself (which comes with Python) a= re at > > > http://docs.python.org/api/api.html > > > > thanks Kevin, > > marienz also put 3 examples together to demonstrate it. > > > > /me feels like a kid in a candy store. > > > > thanks guys. > > > > > > -- > > solar > > Gentoo Linux > > > > -- > > gentoo-portage-dev@gentoo.org mailing list > > > > > > > -- > tvali > (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com"; > icq: "317-492-912") > > =DChe eesti internetifirma lehel kohtasin tsitaati: > If you don't do it excellently, dont do it at all. Because if it's not > excellent, it won't be profitable or fun, and if you're not in > business for fun or profit, what the hell are you doing here? > Robert Townsend > > > -- tvali (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com"; icq: "317-492-912") =DChe eesti internetifirma lehel kohtasin tsitaati: If you don't do it excellently, dont do it at all. Because if it's not excellent, it won't be profitable or fun, and if you're not in business for fun or profit, what the hell are you doing here? Robert Townsend --=20 gentoo-portage-dev@gentoo.org mailing list