However, it seems that C library is much less than the above mentioned
languages. Besides the following library, I'm wondering what other
libraries are available to C. Is there a central place to look for C
libraries? If there is not such a place, should there be one?
http://www.gnu.org/software/libc/manual/html_node/index.html#toc_Searching-and-Sorting
--
comp.lang.c.moderated - moderation address: cl...@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
> However, it seems that C library is much less than the above mentioned
> languages.
You're going about your search from a position based on incorrect
assumptions. You assume that libraries usable by a C programmer would
necessarily have to be in some single, central library project to be
useful. C has more libraries than anyone can shake a stick at ---
they're just not centrally monopolized anywhere.
C is, by intention and by design, a _small_ language. A monstrous
library to carry around would go rather wildly against that.
I note that all of those are FOS projects
> However, it seems that C library is much less than the above mentioned
> languages. Besides the following library, I'm wondering what other
> libraries are available to C. Is there a central place to look for C
> libraries?
sf.net? - but that won't find you everything
> If there is not such a place, should there be one?
linux has distros, windows has dll-files.com
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
Could you recommend what libraries in C are roughly equivalent to STL
in C++?
What are FOS projects?
> > However, it seems that C library is much less than the above mentioned
> > languages. Besides the following library, I'm wondering what other
> > libraries are available to C. Is there a central place to look for C
> > libraries?
>
> sf.net? - but that won't find you everything
>
> > If there is not such a place, should there be one?
>
> linux has distros, windows has dll-files.com
>
> --- news://freenews.netfront.net/ - complaints: n...@netfront.net ---
> --
> comp.lang.c.moderated - moderation address: c...@plethora.net -- you must
Wrong question. There is no reason for C to have something "equivalent
to STL" because STL solves a problem that doesn't even make sense for
C. C libraries tend to be things like libz (compression), libjpeg,,
and so on -- things that do a specific thing well. Most of the time, if
you're writing C, your requirements of your data structures are specific
enough that a general-purpose library won't be a great fit, although
some people have done some. (I think glibc has a pretty decent hash
implementation.)
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
Are there packages for some other commonly used data structures, such
as double and single linked lists and tree, and commonly used
algorithms, such as search and tree traversal?
> Could you recommend what libraries in C are roughly equivalent to STL
> in C++?
Dodging the equivalence question,
http://library.gnome.org/devel/glib/stable/glib.html
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities, a
main loop abstraction, and so on. It works on many UNIX-like platforms,
Windows, OS/2 and BeOS. GLib is released under the GNU Library General
Public License (GNU LGPL).
In my understanding, it is used by many. It may meet your container needs.
http://library.gnome.org/devel/glib/stable/glib-data-types.html
Another summary seems to be available under
http://en.wikipedia.org/wiki/GLib
It claims,
For many applications, C with GLib is an alternative to C++ with STL
Cheers,
lacos
Many of them.
There's no canonical source that you should regard as The Central Source
For C Libraries. There's a ton of libraries out there. I have a
singly-linked list library that I wrote once and haven't probably used
in ten years or more. For the most part, these things are simple
enough in C that they are just coded in place directly. (Also note
that STL relies heavily on the template feature of C++; C has no
corresponding feature, so people tend to write their list structures
directly.)
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I think he means glib (or libglib) glibc is a GNU libc
> Are there packages for some other commonly used data structures, such
> as double and single linked lists and tree, and commonly used
> algorithms, such as search and tree traversal?
Glib has all that for hash tables and for lists. does trees too, I have not
used the tree stuff.
http://library.gnome.org/devel/glib/stable/
performance is likely to be worse than STL gets you in C++
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
free open source.
there's a lot of libraries out there that aren't free
trying to get their distributors to cooperate could be tricky
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
--
It could be that a great deal of C is in smallish programs and so people
do not worry about hand-coding containers. One advantage of hand-coding
is that the design can be focused on the requirements of the problem domain.
However you can get pretty close to C++ templates by using typedef.
Write and debug a linked list in the context of:
typedef int type;
Now replace the int by double and continue debugging.
Now use a struct as the type.
By now you have a pretty robust linked list. The downside is when you
want two linked lists of different types of object.
Actually the above is the way I used to teach inexperienced programmers
to develop a class template. The final step was replacing the typedef with
template<typename type>
You mentioned elsewhere that you're running Ubuntu Linux. Check the
packages on and available for your system -- almost everything named
lib* or lib*-dev is C libraries, hundreds or thousands of them.
C++ Unix programmers like me sometimes complain that all the good
stuff comes with C interfaces only, so we have to wrap it lightly to
make it behave sensibly in the context of C++.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
The correct term is F/OSS (Free and Open Source software). "Free
software" and "Open Source software" are two distinct (if somewhat
overlapping) terms.
DES
--
Dag-Erling Smørgrav - d...@des.no
They should be, and certainly are, catalogged somewhere though. Sure this
group's faq has a list?
>
> C is, by intention and by design, a _small_ language.
A small language proper. There are many, many libraries available. I
think the reason why ISO avoids standardizing a container-n-algorithm
library is because the language facilities for implementation of such is
weak and also then the resulting implementation would not only be weak
but paltry compared C++ libraries (std or not) and that exposure would
drive some people away from C. (Which begs the question: does C hide it's
shortcomings so that naive programmers will still use it?). The answer
is, of course and IMO, to add elements to C which would make C a better
C++ as far as containers and algorithms go (of course the elements that
enable elegant container library implementation are more general than
just containers: OO and parameterization for examples).
> A monstrous library to carry around would go rather wildly against
> that.
Supposedly, one goal of the ISO committees is to standardize current best
practices and in that way build on foundations rather than being at
square one for eternity. Or at least it should be IMO. Also, a container
library need not be "monstrous".
"Francis Glassborow" <francis.g...@btinternet.com> wrote in message
news:clcm-2010...@plethora.net...
That's not a problem. Use headers, the preprocessor and some clever
supporting macros:
#define TYPE int
#include listT.h
// TYPE is undefined at the end of listT.h
#define TYPE double
#included listT.h
I do the above sort of thing even in C++ when creating classes that I
know are not totally general "templates" but rather there is a very small
finite set of the parameterized class or function. You'll need some
support techniques to generate unique names. Google "supermacros" and
also "generic.h C++" for more on the techniques. The preprocessor is your
friend.
The is NO one place where C libraries are cataloged. Some are in source
forge, many are in various Linux distributions (and sourced from else
where).
Anywhere attempting to catalogue all the C libraries would be having to
do a continual crawl through the web, various computer journals and
probably all sorts of other places.
You can find the FAQ at http://c-faq.com/
>> C is, by intention and by design, a _small_ language.
>
> A small language proper. There are many, many libraries available.
If you want to include all the things written to work with C then Perl
and Java are part of C as well.
> I
> think the reason why ISO avoids standardizing a container-n-algorithm
> library is because the language facilities for implementation of such is
> weak and also then the resulting implementation would not only be weak
> but paltry compared C++ libraries (std or not)
The most likely reason is there is not sufficient demand for a
standardised container library.
> and that exposure would
> drive some people away from C.
If people need a container library they will either find one or write
one, doing so will show up any short commings that using a standardised
one would show up.
> (Which begs the question: does C hide it's
> shortcomings so that naive programmers will still use it?). The answer
> is, of course and IMO, to add elements to C which would make C a better
> C++ as far as containers and algorithms go (of course the elements that
> enable elegant container library implementation are more general than
> just containers: OO and parameterization for examples).
Objective-C and C++ are (amongst other things) the result of taking C
and adding OO to it. If you want OO there are already languages to give
it to you.
>> A monstrous library to carry around would go rather wildly against
>> that.
>
> Supposedly, one goal of the ISO committees is to standardize current best
> practices and in that way build on foundations rather than being at
> square one for eternity. Or at least it should be IMO. Also, a container
> library need not be "monstrous".
They are adding things to the C standard, but it is a slow process and
they may well not be adding the things you want.
--
Flash Gordon
I wasn't suggesting a "one and only" catalog, just reasonably
comprehensive lists, and surely they exist. In the C++ group, someone
regularly posts a msg that lists a bunch of C++ libraries. I'm surprised
someone doesn't do that in the C groups.
Who's to say? Maybe C's user base would greatly expand if there was such
a thing. Maybe even bringing back those who moved to C++ for such
facilities. A poll of EXISTING users is nearly meaningless in such
regard.
>> (Which begs the question: does C hide it's
>> shortcomings so that naive programmers will still use it?). The
>> answer is, of course and IMO, to add elements to C which would make
>> C a better C++ as far as containers and algorithms go (of course the
>> elements that enable elegant container library implementation are
>> more general than just containers: OO and parameterization for
>> examples).
>
> Objective-C and C++ are (amongst other things) the result of taking C
> and adding OO to it. If you want OO there are already languages to
> give it to you.
That's not the point at all. Think in these terms: C = too little, C++ =
too much, something in-between = mmmm!
> I wasn't suggesting a "one and only" catalog, just reasonably
> comprehensive lists, and surely they exist.
I don't think so. I csan think of all sorts of possible reasons why this
might be the case, but it's mainly speculation. In any case, I've never
heard of any such list with wider scope than a given manufacturer's
products.
> In the C++ group, someone regularly posts a msg that lists a bunch
> of C++ libraries.
Do you have any information on what proportion of the "available C++
libraries" this covers? It might well be quite small.
--
John Dallman, j...@cix.co.uk, HTML mail is treated as probable spam.
who would want to read a posting with thousands of entries.
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
It's still useful and much more useful than nothing!
I don't think there are that many. The niche ones hardly need to be
listed, for those who work in those niches already know what the good
ones are and are using something. I was thinking more about such things
as container libraries and databases for client-server applications. That
said, categorization is your friend, so reading through thousands of
entries is a peculiar thing to bring up.
There are more.
> The niche ones hardly need to be
> listed, for those who work in those niches already know what the good
> ones are and are using something.
How do you think they find out about them? The same methods apply to
finding out non-niche libraries as niche ones.
> I was thinking more about such things
> as container libraries and databases for client-server applications.
That would probably be in the thousands. It also includes a lot of
commercial libraries.
For instance the company I work for is a small company, we use something
like 10 different databases in our various products, each database has
at least one C library for Linux and some have two or three, and under
other OSs we use there are *different* libraries. So that would probably
be somewhere between 20 and 100 libraries for databases alone before we
get on to the ones which are not used in my little company (and there
are a *lot* of databases we do not use).
> That
> said, categorization is your friend, so reading through thousands of
> entries is a peculiar thing to bring up.
Cataloging them is not a small job. Keeping the catalog up to date once
it has been produced would not be a small job either.
--
Flash Gordon
>> who would want to read a posting with thousands of entries.
>>
>
>
> I don't think there are that many. The niche ones hardly need to be
> listed, for those who work in those niches already know what the good
> ones are and are using something. I was thinking more about such things
> as container libraries and databases for client-server applications. That
> said, categorization is your friend, so reading through thousands of
> entries is a peculiar thing to bring up.
But niche libraries is exactly where a catalogue has the greatest
potential benefit. Those are the ones that are hard to find. I really do
not want to have a list of 200+ container libraries with no idea which
are any good. And assessing their value is not a simple task (and often
subjective or application dependant).
We also have the problem of deciding when something is actually a
library rather than just support for a particular application. There is
a great deal of useful stuff that just happens to have been published as
part of the source code for an app even though it has much wider
application.
The problem is really twofold. There really are thousands of potential
entries to a catalogue of C++ libraries and most of them are poor. But
who is to decide the quality? And sometimes a poorly written library is
actually a good starting point for a better one.
Whatever. I'd only be interested in the top 2% of them (actually, the top
2 or 3 in a given category). This thread is moving quickly toward
uselessness, so I'm out of it. Good luck.
> I wasn't suggesting a "one and only" catalog, just reasonably
> comprehensive lists, and surely they exist. In the C++ group, someone
> regularly posts a msg that lists a bunch of C++ libraries. I'm
> surprised someone doesn't do that in the C groups.
You could readily show us that we're missing out on information that
could save us lots of time and work. Compile the kind of list that you
feel the lack of, and show that people find it useful.
--
John Dallman, j...@cix.co.uk, HTML mail is treated as probable spam.