find good buffer library in c - c

We are on designing a software in C(just C) need buffer structure in some part of that.
But I do know how to choose a good one?
Actually our program is open source and we need an open source and efficient buffer and queue library in C to implement this part.
Thanks for your helps.

you can use this container library :
https://github.com/jacob-navia/ccl
its from eccentric genius jacob navia (if you are not regular at comp.lang.c you will not understand it). But the thing is the library is quiet efficient and unusually "EXCELLENT" manual. The Documentation will surely buy c coders.
It has most common data structures like lists/queues/deques/circular linked lists etc/etc.

Consider using libevent. The newer version comes with a buffer interface suitable for the event framework that libevent provides. From their web page:
Libevent additionally provides a sophisticated framework for buffered network IO, with support for sockets, filters, rate-limiting, SSL, zero-copy file transmission, and IOCP. Libevent includes support for several useful protocols, including DNS, HTTP, and a minimal RPC framework.

Related

AMQP C Library for Small Embedded Devices

I am looking for a AMQP library, preferably written in C, that will work on a small embedded device. i.e. no OS and limited RAM and code size space (256k between both RAM and code).
I have seen the following post and number of others, I have looked into Qpid and RabbitMQ, but none seem suited to a small device.
Is there a AMQP implementation that has stable C++ Client library
Can anyone suggest a AMQP library that will work on a microcontroller? All functionality is not essential, even just support for telemetry would be good.
This seems to be an old question, but maybe this still helps.
Disclaimer: I am one of the authors of uamqp-c.
There are 2 choices I know of:
-Qpic Proton C: https://github.com/apache/qpid-proton
-uamqp-c: https://github.com/Azure/azure-uamqp-c
Cheers,
/Dan

C cross-platform RPC that requires minimal boilerplate?

I have an existing library in C, which I want to be able to allow remote access to (either from Linux or Windows).
I looked at the usual RPC suspects like Thrift and Protobuf, but neither of these deal cleanly with C-style function calls (things like pass-by-ref, char* instead of string, * instead of List<> etc).
In short, to use either of these it looks like I would need to write a complete IDL from scratch, and add a lot of boilerplate code to transfer C-style function calls into these environments.
Are there any RPC libraries around that
can deal directly with C header files (or have tools to auto
generate the initial IDL from C definitions)?
are cross-platform Linux/Windows compatible?
require the absolute minimum of boilerplate code?
support sockets
are relatively high performance (XML-RPC i'm looking at you)?
Well, there's protobuf-c, an implementation of protobuf in C.
And then there's the classical XDR, found on most/(all?) unix-like systems, versions exist for windows as well. See also the Linux xdr(3) man page which contains an overview of the API.
Note that both protobuf and XDR are serialization libraries, they don't provide RPC. The "companion RPC library" to XDR is called, well, RPC, but I don't think anyone writes new code with that, and AFAICS it's unix-specific (portmap doesn't run on windows, does it? And it's generally a bad idea anyway.). Then there's protobuf-c-rpc which is the C version of the protobuf RPC library; probably a better bet than classic RPC.

C cross-platform toolkit

I'm looking for a "core" C cross-platform toolbox, because I need lots of "useful" functions (read/write ini files, network routines, arrays, lists...)
I was thinking about GLib, may be Qt (the core part) but I would appreciate a pure "C" stuff
I think glib is a fantastic choice, but it's perhaps somewhat less widely scoped than what you're after, there is no networking in glib as far as I know.
For that, you need to add GIO from the same family of libraries.
Apache Portable Runtime (APR) may be the solution you are looking for. It is used, among other projects, for the Apache http server and Subversion.
I think glib is great. It comes with a great deal of core algorithms and data types. There are many libraries build around GLib and GObject. You have indeed GIO for all kinds of different input and output on files, over network etc (will remind you a bit of the Java like IO operations), and you gtk for Gui applications. All These libraries were designed with portability in mind and extendibility to other languages (eg. python, perl etc). But learn to use GOjbect as well, because the best work comes from using these libraries ( http://www.gtk.org/documentation.php ) together.

Network Library for C

I am looking for a NIO type of library for C. I want to implement a multi threaded UDP network server that will have a lot of clients connecting to it.
Instead of attempting to code my own program to handle packets and 'connections'. I thought I would have a look if there is not already an existing library that has been tested and build for scalability and high performance.
I have found a few for Java but none for C. such as Apache Mina.
I am hoping that some one out there knows of a good one that may assist me.
Thaks
It sounds like you want something to abstract select(), poll(), or whatever the most efficient mechanism is for your platform.
Have you looked at libevent and libev? There is a nice writeup here.
First of all, C has no classes. Secondly, C provides you with everything you need to implement a scalable and high performance solution. It's more low level than java's NIO, but there are good tutorials out there in google.
And if you want a library - try boosts' asio. It is C++, but perhaps you can use it.
If you are using Linux I strongly recommend you to use the POSIX API. It gives you resources for multithreading and networking acrosss any Linux box.
GNU C library

Input/output stream abstraction layers for plain C

Are there any widely used I/O stream abstraction layers for plain C?
By an I/O stream abstraction layer I mean any layer that at least allows the creation of custom read/write functions. For C++, there's the standard iostream and boost::iostreams. For glibc users, there's a possibility to use custom streams. These won't do any good if the requirement is to write portable C code.
It is better to use a library that is either widely used or easy to embed to the source code, or both.
SDL_RWops is an undocumented but widely used feature of SDL, and zziplib can use it. However, it does not make much sense to add a dependency to SDL just to get this feature.
GLib contains a GIOChannel abstraction, but the library is again quite large and they say that "support for Windows is only partially complete".
However, the above are not quite satisfactory for small libraries, such as decoders, file format readers and signal processors: they contain lots of unnecessary stuff and the LGPL licensing prevents embedding the relevant parts to non-GPL code.
The BIO abstraction in OpenSSL sounds like it fits the bill.
I think you answered your own question.
No, there are no widely used steam abstraction libraries. Those that exist are usually a small part of libraries that most people don't want to depend on, or are very specialized.
What are your requirements? What is it you are looking for out of an abstraction library? I have to admit that every time I've looked at one, or started writing one, I usually end up back at the standard POSIX interfaces... what more abstraction could one want?
There is libslack (GNU GPL) which may provide some of the functionality you are after and this MIT License-ed input stream wrapper:
http://attractivechaos.wordpress.com/2008/10/11/a-generic-buffered-stream-wrapper/
The lexical analyzer generator Quex comes along with an input stream abtraction for POSIX, C++ stream, etc. It consists of a collection of classes derived from a class called ByteLoader.
It is easily adaptable to any infrastructure-simply by deriving from ByteLoader and implemting the interface. See: Link to Code.
A 'real' ByteLoader is only instantiated upon generation of a lexer, though.

Resources