git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fwd: permission to re-license strbuf subsystem as LGPL

From
Brandon Casey <drafnel@gmail.com>
Date
Sep 23, 2011, 22:50 UTC
Message-ID
<CA+sFfMdt-95rfaZmiYAHx02Ukjt_WN-kLJr410AzZfGHYkSv5w@mail.gmail.com>
In-Reply-To
<m3mxdvqj31.fsf@localhost.localdomain>
2011/9/23 Jakub Narebski <jnareb@gmail.com>:
Show 15 quoted lines
> Brandon Casey <drafnel@gmail.com> writes:
>
>> ---------- Forwarded message ----------
>> From: Brandon Casey <drafnel@gmail.com>
>> Date: Thu, Sep 22, 2011 at 11:21 PM
>> Subject: permission to re-license strbuf subsystem as LGPL
>>
>> To those who have contributed to git's strbuf subsystem,
>>
>> I'd like to turn git's strbufs into a library.  So with your consent
>> I'd like to re-license the code in strbuf.c and strbuf.h, and any
>> compat/ dependencies as LGPL so that I can create a strbuf library.
>
> That's a laudable goal.  Do you plan on librarizing other universal
> mini-libraries, like parseopt or test-lib?
Not at the moment.
> I wonder if for example "perf" tool in Linux kernel sources (userspace
> companion to perf events subsystem) will move to using it; currently
> it reuses some of internal git minilibraries, IIRC strbuf and parseopt
> included.
I would be pleased if it was useful to them.
Show 6 quoted lines
> By the way, how the 'strbuf' from git (which I think was created among
> others to avoid additional external dependencies) differs from
> existing C (not C++) string libraries, like 'bstring'[1], The Better
> String Library, or the C libraries in http://bstring.sourceforge.net/features.html?
>
> [1]: http://bstring.sourceforge.net

Hmm, I forgot about bstring. I think strbuf is a little smaller in scope than bstring, perhaps less ambitious. Less abstraction, and less protection too. With strbuf, you never forget that you're dealing with C char arrays. The data structures are pretty similar, but I don't think strbuf will ever have a function like

   bconcat(bstring1, bstring2)
instead, you'd just do
   strbuf_add(strbuf1, strbuf2.buf, strbuf2.len)

The benefit, of course, of a bconcat function is that either bstring1 or bstring2 can be NULL (like if a previous bstring2 = bfromcstr() initialization failed). This allows you to perform a sequence of bstring operations and only check errors at the end.

-Brandon
Previous: Jakub NarebskiNext: Jeff King
Message 4 of 6 in “Fwd: permission to re-license strbuf subsystem as LGPL”
  1. Brandon CaseySep 23, 2011
  2. Michael WittenSep 23, 2011
  3. Jakub NarebskiSep 23, 2011
  4. Brandon CaseySep 23, 2011
  5. Jeff KingSep 24, 2011
  6. Jonathan NiederSep 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.