What are the common libraries for C? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
C++ has STL and Boost and C# has the .net Framework library. Similarly, what are the most common libraries useful to a C programmer? (Other than the C standard library.)
I am looking for most of the capabilities available in the STL: containers (vectors, linked lists, trees, hash table), algorithms (sorting, searching), file IO and strings.
Ideally, the library should be open-source, work on Windows (cross-platform is fine) and is being used actively.

If you want general-purpose data-structures like STL has, glib is probably the answer to your question. But a better question might be why are you writing your program in C? C's potential to shine comes when you don't use overly-general code to perform tasks that could be better performed in ways specific to your particular task at hand. glib just gives you "C++ with ugly syntax" (and less ability for the compiler to optimize).

The closest I know if is glib from GTK, see http://library.gnome.org/devel/glib/2.26/

Yes. GLib is the closest thing to STL in C. If you find it quite complex to use, try Vala. It is much easier. http://live.gnome.org/Vala

Related

std::vector alternative for C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I wonder if there is an alternative for the std::vector in C? I found this implementation but it seems to contain some issues with memory reallocation.
You can give glib and its arrays (GArray) a try.
glib is actively maintained, cross platform, open source (LGPLv2+), and it doesn't stop on arrays/vectors. You also have hash tables, linked lists, queues and many other data structures.
While reading C Array vs. C++ Vector, I found an interesting implementation of a simple vector container in C, which also includes push/pop operations. It's worth reading it!
If you focus is on mathematics you can work with GSL, there have a more bare bones math centric concept.

C libraries for mathematical matrix operations [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I know there are some optimized algorithms around for all kind of matrix decompositions (QR decomposition, SVD,...), multiplications and the likes. Yet, I couldn't find a good overview. For C++, there is quite some useful information in this question, but I'm looking for those things in C.
You did not mention whether you wanted an open-source or a commercial software, so here is a list containing both:
GNU Scientific Library (GSL)
Basic Linear Algebra Subprograms (BLAS)
Meschach
Numerical Algorithms Group (NAG)
There was also this previous question on the subject.
You might want to take a look at BLAS and LAPACK. These are written in Fortran, but are callable from C, and are pretty much the standard libraries of this type.
Most serious linear algebra packages that I know of (MATLAB, Octave, NumPy) are built using these.
Perhaps GNU Scientific Library (GSL) would be of interest.
http://www.gnu.org/software/gsl/
Documentation topics: http://www.gnu.org/software/gsl/manual/html_node/

What would be a good open source lightweight c library with basic utility functionality to use in an embedded system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm thinking of something like glib, but possibly a slim version with a minimal foot print. It would need basic utilities such as linked lists, vectors and hash tables. It should also have a minimal runtime footprint.
Not exactly a library, but a tested, optimized and documented piece of code: sys/queue.h on *BSD and Linux systems has macros for various kinds of intrusive linked lists and queues.
uthash is a nice hash table library (made entirely of macros), it also comes with a linked list, dynamic string and dynamic array macros.
I also highly recommend sys/queue.h (suggested by larsmans) for simple and well tested linked lists.

Mature standard library for C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking for a library for C that gives me at least some of the things I really miss from C++ and the STL/Boost. (I have to use C, so please no "use C++" posts)
I need
dynamic strings (that grow and shrink automatically)
some sort of list (std::vector replacement)
something like stringstream (for type conversations & buffers)
Furthermore, it has to have a mature and Open Source implementation and it has to be platform independant (Windows, Linux and Mac are required to be supported).
Any recommendations?
What about the GLib from GTK?
I'd recommend the Apache Portable Runtime. It's reasonably small, portable, and powerful - powers the Apache httpd across multiple platforms, at least.
You could always consider embedding a dynamic language runtime in your application. The Lua core is not large at all, provides data types that meet your requirements, is open source, and MIT licensed so it is compatible with both FOSS and commercial projects.
You wouldn't necessarily need to use code written in Lua to benefit, as its C API provides complete access to its data types and their values. However, you could later move some of the logic of your application into Lua, for the improved clarity of expression and other benefits of coding in a dynamic language with functions as first-class values.
Take a look at Gnulib

Good STL-like library for C [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.
The Glib library used on the Gnome project may also be some use. Moreover it is pretty well tested.
IBM developer works has a good tutorial on its use: Manage C data using the GLib collections
As always, Google is your friend:
http://nixbit.com/cat/programming/libraries/c-generic-library/
specifically:
http://nixbit.com/cat/programming/libraries/generic-data-structures-library/
There's some stuff in the Apache Portable Runtime (APR) that I'd expect to be very solid.
Maybe http://sglib.sourceforge.net/ if you want an easy to use, very fast, macro based library.
If hash tables, extensible strings and dynamic vector are enough for your needs, please have a look at the library I put toghether: http://code.google.com/p/c-libutl/.
I also would welcome any feedback!

Resources