Re: Contributing to glib.



From: Mark Mielke <mark mark mielke cc>
>
> On Fri, Oct 06, 2000 at 08:48:18AM -0400, Mark Mielke wrote:
> > I am willing to write code, provide patches, or whatever the normal
> > protocol is for this sort of thing. Using the above example, I believe
> > it would desirable to have String objects act similarly to perl strings,
> > where the '\0' is kept at the end, but is allowed in the middle as well,
> > with the actual size not including the final '\0'. This should be
> > compatible with current applications using glib.
>
> I come back to this post of mine, as I find myself wishing I could
> make use of GLIB once again. Previously, somebody mentioned that
> my requirements are already implemented within GLIB.
>
> I am unable to find these methods that provide for my requirements.
>
> The API documents describes methods such as "g_string_append()",
> however, a Z-string is accepted as an argument. There is no mention of
> a "appendn" or "append2" function that will accept both a "char *",
> and a length.

This is in glib-2.0 as g_string_append_len(). Look at the development
branch (1.3) to see all the new functions.

> Is it intended that these functions will ever be added? Are they in
> existence, and I am simply not aware of them?
>
> If they do not exist, what form of patch will be accepted to glib, and
> what naming convention is preferable for defining these functions? I am
> specifically thinking along the lines of: (= is current, + is new)

[snip]

The various functions for assigning, etc. from one GString to another
can be emulated by using the "str" and "len" arguments of the GString
structure. A g_string_new_c(gchar) function (following the current
naming convention) might be interesting, though. Anything like
this seems like 2.2 material, since 2.0 is nearing a code freeze.

If you're interested in contributing, keep at it. A good first step
would be to download 1.3, either as a tarball or straight from CVS,
to see where development is currently at.

Ron Steinke



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