ORBit_sequence helpers ...



Hi guys,

	So - I just added a set of 'ORBit_sequence' helpers to HEAD; they do
helpful things:

/* More friendly(?) sequence allocators */
gpointer       ORBit_sequence_alloc    (CORBA_TypeCode      sequence_tc,
					CORBA_unsigned_long length);
void           ORBit_sequence_append   (gpointer            sequence,
					gconstpointer       element);
void           ORBit_sequence_set_size (gpointer            sequence,
					CORBA_unsigned_long length);
#define        ORBit_sequence_index(sequence,idx)
(sequence)->_buffer[(idx)]
void           ORBit_sequence_concat   (gpointer            sequence,
					gconstpointer       append);

	Which should make a sequence approaching as friendly as a GArray, that
should clean some nasty cruft out of bonobo-activation at least - with
GLists' being turned into sequences later etc. etc.

	The patch is: 
http://primates.ximian.com/~michael/sequence-helpers.diff

	I'm slightly concerned that I'm mis-using _maximum - is that supposed
to be a 'bounded sequence' thing ? either way - we can trivially support
the API by using the smart allocation n_elements stuff with a little
more work.

	If anyone wants other Sequence / GArray type methods - speak soon ...

	HTH,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]