GLib queue and stack, alloca discussion



I recently checked in basic implementations of stack and queue ADTs into
the new GLIB_1_3_HACKS branch.  Question for the crowd --

should GStack and GQueue be extended to provide analogues to g_list_*
functions?  ie. I can either provide simple function wrappers that do
something like

	GList * g_queue_nth (GQueue *q, guint position) {
		return q ? 0 : g_list_nth (q->list, position);
	}

or have the programmer directly access this by using q->list directly.

I don't want to wrap all those functions, but at the same time I don't
want to violate the opaqueness of GStack and GQueue -- especially
GQueue, since it caches the list-end ptr and list size.


On another topic, I threw the gettext alloca into CVS under the same
branch.  It doesn't look too difficult to GLib-ize.  It will be tough
finding someone to test the Cray-specific code, though :)  Since the
implementation is small, I think we should always link it in, as
_g_alloca, and then define it to g_alloca if necessary.

	Jeff






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