[PHP-DEV] CVS Account Request: thesee

2006-02-15 Thread Giuseppe Dess
I need CVS account to mantain this accepted proposal :
http://pear.php.net/pepr/pepr-proposal-show.php?id=308
The pear group agreed.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DEV] [PATCH] Custom Streams, fclose & stream_close

2006-02-15 Thread Jared Williams

Hi,

> stream_close can return any value it likes... however, it is 
> ignored and php_userstreamop_close always returns success to 
> the streams layer.
> This is a bug, but should be simple to fix. (volunteers 
> welcome; I don't have a current cvs checkout).
> 
> --Wez.

This should fix it, I think. :)
 
> >
> >
> > Hi,
> > Is the PHP manual correct in that fclose() returns 
> a bool, but 
> > a custom wrapper stream_close() is void? Would like to 
> signal a problem if I have a problem closing a custom stream.
> >


Jared

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DEV] [PATCH] Custom Streams, fclose & stream_close

2006-02-15 Thread Derick Rethans
On Wed, 15 Feb 2006, Jared Williams wrote:

> > stream_close can return any value it likes... however, it is 
> > ignored and php_userstreamop_close always returns success to 
> > the streams layer.
> > This is a bug, but should be simple to fix. (volunteers 
> > welcome; I don't have a current cvs checkout).
> 
> This should fix it, I think. :)

Please put it online and provide a link. We blcok all attachments which 
are not text/plain.

regards,
Derick

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DEV] [PATCH] Custom Streams, fclose & stream_close

2006-02-15 Thread Jared Williams

> > > stream_close can return any value it likes... however, it 
> is ignored 
> > > and php_userstreamop_close always returns success to the streams 
> > > layer.
> > > This is a bug, but should be simple to fix. (volunteers 
> welcome; I 
> > > don't have a current cvs checkout).
> > 
> > This should fix it, I think. :)
> 
> Please put it online and provide a link. We blcok all 
> attachments which are not text/plain.

http://ren.dotgeek.org/phppatches/userspace_stream_close_return.diff

Jared 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] C Level Iterators and Userland Classes

2006-02-15 Thread l0t3k
A quick question about using iterators in C code:

If it sufficient to use the interface gotten from 
zend_class_entry->get_iterator to handle userland classes  which implement 
Iterator ?
The attachment is part of code i'm using to do Unicode based collation. Will 
this work for userland iterators as well ?

l0t3k 


begin 666 sort.txt
M4$A07TDQ.$Y?05!)('IE;F1?8F]O;"!I8W5?8V]L;&%T;W)?F5N9%]B
M;V]L(&%S8V5N9&[EMAIL PROTECTED])"0D)"[EMAIL PROTECTED])E7,@/2!.54Q,.PT*"[EMAIL PROTECTED];G1R>3L-"@EZ
M=F%L("IZ:71E;7,@/2!.54Q,.PT*"[EMAIL PROTECTED]'([#0H)>F5N9%]B;V]L
M(&9R;VU?:71EF5N9%]C;&%S2 J8V4@/2!:7T]"2D-%
M7U H:71E;7,I.PT*"0EI;G0S,E]T(&-A<&%C:71Y(#T@,38[#0H-"@D):68@
M*"$H8V4@)[EMAIL PROTECTED]/F=E=%]I=&5R871O&-E<'1I;VXI*2![
M#0H)"0EI9B H(45'*&5X8V5P=&EO;BDI('L-"@D)"0EZ96YD7W1H"A.54Q,+" P(%134DU,4U]#0RP@(D]B:F5C="!O9B!T>7!E
M("5S(&1I9"!N;[EMAIL PROTECTED])E871E(&%N($ET97)A=&]R([EMAIL 
PROTECTED]/FYA;64I.PT*
M"0D)?0T*"0D)9V]T;R!C;&5A;G5P.PT*"0E]#0H-"@D)[EMAIL PROTECTED]('1H92!E
M>'1R82!E>&-E<'1I;[EMAIL PROTECTED](&%R92!F;W(@=7-E2!B92!T:')O=VEN9R!E>&-E<'1I;VYS(&EN(&ET
M97)A=&]R(&UE=&AO9',L(')A=&AEPT*"0D):71E
MPT*"0D)"6=O=&[EMAIL PROTECTED]<#L-"@D)"7T-"@D)?0T*
M#0H)"6EN9&5X(#T@,#L-"@D)PT*"0D):[EMAIL PROTECTED]&ET97(M/FEN9&5X*RLI('L-"@D)"0EI
M=&5R+3YF=6YC&-E<'1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)T7VME
M>7-;:5TN2D[#0H)"7T-"@D):[EMAIL PROTECTED]"AF7-;:5TN:71E;2D@>PT*"0D)
M1E)%15]:5D%,*'-O7,I.PT*"7)E='5R;B [EMAIL PROTECTED]("HO
`
end

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] C Level Iterators and Userland Classes

2006-02-15 Thread Marcus Boerger
Hello l0t3k,

  first of all your question does not make any sense to me whatsoever.

Anyway looking at the code you seem to be using a c-level iterator
manually instead of using it inside foreach() construct.

The first thing i can see is that you use the iterator index while the
source code (zend_interface.h) says:
ulong index; /* private to fe_reset/fe_fetch opcodes */
Unil now noone tried to emulate this stuff so i am not sure whether this
is correct or not. But one thing i can say is that your usage revealed
an error in the engien code. Index is incremented to early. Which is fixed
by now.

The second thing is that you did not use the dtor() handler so you have
a memory leak.

Otherwise i cannot see anything wrong with your iterator usage. And the
more i think over it you are probably right in using that index.

To try to answer what i think you want to know: What ever object you use.
If it implements Traversable or derived its zend_class_entry has a
get_iterator function that gets you access to an iteator struct and the
handler table. You should never touch the data member of that iterator
struct and the handlers are documented. In your case there is no need to
use handler invalidate_current().

hope this helps
marcus

Wednesday, February 15, 2006, 6:23:44 PM, you wrote:

> A quick question about using iterators in C code:

> If it sufficient to use the interface gotten from 
> zend_class_entry->get_iterator to handle userland classes  which implement 
> Iterator ?
> The attachment is part of code i'm using to do Unicode based collation. Will
> this work for userland iterators as well ?

> l0t3k 

Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] C Level Iterators and Userland Classes

2006-02-15 Thread l0t3k

"Marcus Boerger" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello l0t3k,
>
>  first of all your question does not make any sense to me whatsoever.
What im trying to allow for is sorting by iterator as well as standard 
arrays, for example :
// assume en_US as default locale

$coll = new Collator("en_US");

$iter = new TextIterator("The rain in Spain drop gently on the Plains", 
TextIterator::WORD);

var_dump( $coll->sort($iter));// returns the sorted list of words

$expr = new Regex($patttern, $input, $flags);
var_dump($coll->sort($expr, SORT_DESC));// Sorts matches in descending 
order

> Anyway looking at the code you seem to be using a c-level iterator
> manually instead of using it inside foreach() construct.
see above...

> The first thing i can see is that you use the iterator index while the
> source code (zend_interface.h) says:
>ulong index; /* private to fe_reset/fe_fetch opcodes */
> Unil now noone tried to emulate this stuff so i am not sure whether this
> is correct or not.
i wrote this more than ayear ago and i remember copying it from engine code.

> The second thing is that you did not use the dtor() handler so you have
> a memory leak.
which dtor handler ?

> To try to answer what i think you want to know: What ever object you use.
> If it implements Traversable or derived its zend_class_entry has a
> get_iterator function that gets you access to an iteator struct and the
> handler table. You should never touch the data member of that iterator
> struct and the handlers are documented. In your case there is no need to
> use handler invalidate_current().

That helps. Thanks a lot

clayton

> hope this helps
> marcus
>
> Wednesday, February 15, 2006, 6:23:44 PM, you wrote:
>
>> A quick question about using iterators in C code:
>
>> If it sufficient to use the interface gotten from
>> zend_class_entry->get_iterator to handle userland classes  which 
>> implement
>> Iterator ?
>> The attachment is part of code i'm using to do Unicode based collation. 
>> Will
>> this work for userland iterators as well ?
>
>> l0t3k
>
> Best regards,
> Marcus 



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] C Level Iterators and Userland Classes

2006-02-15 Thread Marcus Boerger
Hello l0t3k, Anrei,

Wednesday, February 15, 2006, 11:28:15 PM, you wrote:

> "Marcus Boerger" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Hello l0t3k,
>>
>>  first of all your question does not make any sense to me whatsoever.
> What im trying to allow for is sorting by iterator as well as standard 
> arrays, for example :
> // assume en_US as default locale

> $coll = new Collator("en_US");

> $iter = new TextIterator("The rain in Spain drop gently on the Plains", 
> TextIterator::WORD);

> var_dump( $coll->sort($iter));// returns the sorted list of words

> $expr = new Regex($patttern, $input, $flags);
> var_dump($coll->sort($expr, SORT_DESC));// Sorts matches in descending 
> order

>> Anyway looking at the code you seem to be using a c-level iterator
>> manually instead of using it inside foreach() construct.
> see above...

ic, sounds interesting. Actually Andrei doesn't it look like something for
ext/unicode?

>> The first thing i can see is that you use the iterator index while the
>> source code (zend_interface.h) says:
>>ulong index; /* private to fe_reset/fe_fetch opcodes */
>> Unil now noone tried to emulate this stuff so i am not sure whether this
>> is correct or not.
> i wrote this more than ayear ago and i remember copying it from engine code.

>> The second thing is that you did not use the dtor() handler so you have
>> a memory leak.
> which dtor handler ?

Zend/zend_iterators.h:
typedef struct _zend_object_iterator_funcs {
/* release all resources associated with this iterator instance */
void (*dtor)(zend_object_iterator *iter TSRMLS_DC);

^^^that one :-)

>> To try to answer what i think you want to know: What ever object you use.
>> If it implements Traversable or derived its zend_class_entry has a
>> get_iterator function that gets you access to an iteator struct and the
>> handler table. You should never touch the data member of that iterator
>> struct and the handlers are documented. In your case there is no need to
>> use handler invalidate_current().

> That helps. Thanks a lot

> clayton

>> hope this helps
>> marcus
>>
>> Wednesday, February 15, 2006, 6:23:44 PM, you wrote:
>>
>>> A quick question about using iterators in C code:
>>
>>> If it sufficient to use the interface gotten from
>>> zend_class_entry->get_iterator to handle userland classes  which 
>>> implement
>>> Iterator ?
>>> The attachment is part of code i'm using to do Unicode based collation. 
>>> Will
>>> this work for userland iterators as well ?
>>
>>> l0t3k
>>
>> Best regards,
>> Marcus 






Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] C Level Iterators and Userland Classes

2006-02-15 Thread l0t3k

> ic, sounds interesting. Actually Andrei doesn't it look like something for
> ext/unicode?
that's what it's for, actually...

>>> The second thing is that you did not use the dtor() handler so you have
>>> a memory leak.
>> which dtor handler ?
>
> Zend/zend_iterators.h:
> typedef struct _zend_object_iterator_funcs {
>/* release all resources associated with this iterator instance */
>void (*dtor)(zend_object_iterator *iter TSRMLS_DC);
>
> ^^^that one :-)

Solid ! Thanks again..

clayton



>
>
>
>
>
> Best regards,
> Marcus 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php