Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38091 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26628 invoked from network); 3 Jun 2008 07:32:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2008 07:32:48 -0000 Authentication-Results: pb1.pair.com header.from=tony@daylessday.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tony@daylessday.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daylessday.org designates 89.208.40.236 as permitted sender) X-PHP-List-Original-Sender: tony@daylessday.org X-Host-Fingerprint: 89.208.40.236 mail.daylessday.org Linux 2.6 Received: from [89.208.40.236] ([89.208.40.236:42511] helo=daylessday.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/78-58719-F93F4484 for ; Tue, 03 Jun 2008 03:32:48 -0400 Received: from [192.168.3.91] (unknown [212.42.62.198]) by daylessday.org (Postfix) with ESMTP id 398B46400E4; Tue, 3 Jun 2008 11:32:44 +0400 (MSD) Message-ID: <4844F39B.6040508@daylessday.org> Date: Tue, 03 Jun 2008 11:32:43 +0400 User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Adam Klobukowski CC: internals@lists.php.net References: <4843CE26.40902@daylessday.org> <6E.AD.26717.18424484@pb1.pair.com> In-Reply-To: <6E.AD.26717.18424484@pb1.pair.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Global structures in extension From: tony@daylessday.org (Antony Dovgal) On 02.06.2008 20:49, Adam Klobukowski wrote: > HYAMIAGENT agent; > > PHP_MINIT_FUNCTION(gra) > { > yamiNetInitialize(); > > yamiCreateAgent(&agent, 0, NULL); > > yamiAgentDomainRegister(agent, SERVER_NAME, SERVER_ADDRES, > SERVER_PORT, 2); > > return SUCCESS; > } > /* }}} */ Well, this is clearly wrong as the agent object has to be created by your functions each time - in the same way as MySQL are created each time you connect to a MySQL server. But I guess the NetInitialize() function might be called once per process. Also you didn't mention whether you're developing on Windows or not - there seem to be quite a noticeable difference in the way that library works. -- Wbr, Antony Dovgal