A container library for C

  • Permalink
  • submit to reddit
  • Email
  • Follow


I have been talking about this since quite a long time. It is (maybe) 
time to offer the first release.

The URL is:
http://www.cs.virginia.edu/~lcc-win32/container.html

There you can download a zip file containing
(1) The specifications of the library
(2) The source code of the sample implementation
(3) a makefile for Unix systems

Enjoy!

jacob
0
Reply jacob 6/27/2010 4:26:34 PM

See related articles to this posting

comp.compilers.lcc 1243 articles. 0 followers. Post

0 Replies
568 Views

Similar Articles

[PageSpeed] 5


Reply:

Similar Artilces:

C library containing implementations of associative containers.
Hi. Is there anybody who knows a C (not c++) library containing implementations of associative containers (stack, queue, hash table, linked list). It would be great if the performance of algorithms where high. Regards Morten. On 7 May 2008 at 9:18, Morten wrote: > Is there anybody who knows a C (not c++) library containing > implementations of associative containers (stack, queue, hash table, > linked list). It would be great if the performance of algorithms where > high. libhx is one. I guess most C programmers roll their own at the start of their careers, and then use their...

A container library in C Part 4. The arraylist container
This implements the ararylist container arraylist.c ---------------------------------------------------- #include "containers.h" static int GetCount( ArrayList *AL); static int IsReadOnly( ArrayList *AL); static int SetReadOnly( ArrayList *AL,int newval); static int Add( ArrayList *AL,void *newval); static int AddRange( ArrayList *AL,void **newvalues); static int Clear( ArrayList *AL); static bool Contains( ArrayList *AL,void *str); static void **CopyTo( ArrayList *AL); static int IndexOf( ArrayList *AL,void *SearchedElement); static int Insert( ArrayList *AL,void *); static int Ins...

A container library in C: Part 3. List container implementation
This implements the list routines -----------------------------list.c cut here------------------------- /* ------------------------------------------------------------------- List routines --------------- This routines handle the List container class. This is a very general implementation and efficiency considerations aren't yet primordial. Lists can have elements of any size. This implement single linked Lists This is still experimental. ---------------------------------------------------------------------- */ #ifndef DEFAULT_START_SIZE #define DEFAULT_START_SIZE 20 #endif #include &q...

C Containers library
The project is going forward slowly but surely. I am trying to fix the bugs in the standard implementation, improve the specs, eliminate inconsistencies fo the definitions/interface of different containers, etc. The doc is no longer written in Word/Open Office, whatever. I have changed to latex (pdflatex) and the looks have improved a lot. The libraries compile under Macintosh (64 bits), Windows 7 (64 and 32 bits) and linux (64 and 32 bits) Thank You. -- Vincenzo Mercuri jacob navia <jacob@spamsink.net> writes: > The project is going forward slowly but su...

The C Containers library
A new addition to the C Containers library: Value arrays (ValArrays) Value arrays are a group of containers that store the basic types of the language: short, int, long, long long, float, double, long double and have some specialized operations that should be done in hardware when the underlying CPU allows it. The objective here is to simplify the vector interface replacing the void * with the concrete type that these arrays hold. This is a very rich interface with all operations necessary to realize any general purpose computation fast and efficiently. ValArrays implement also "Sl...

The C Containers Library
A new addition to the C Containers library: Value arrays (ValArrays) Value arrays are a group of containers that store the basic types of the language: short, int, long, long long, float, double, long double and have some specialized operations that should be done in hardware when the underlying CPU allows it. The objective here is to simplify the vector interface replacing the void * with the concrete type that these arrays hold. This is a very rich interface with all operations necessary to realize any general purpose computation fast and efficiently. ValArrays implement a...

C Containers Library
Hi I am working within the French section in a proposal for the next standard about a standardization of often used data structures like lists, flexible arrays, hash tables, etc. The latest version of the proposal can be downloaded here: http://www.cs.virginia.edu/~lcc-win32/container.html The proposal contains the source code to prove the feasibility of the proposed standards, and a detailed documentation of each function and the philosophy behind the design. The language used to write the sample implementation is C90. Not even // comments were used. To give you an ...

A container library for the C language
I have been talking about this since quite a long time. It is (maybe) time to offer the first release. The URL is: http://www.cs.virginia.edu/~lcc-win32/container.html There you can download a zip file containing (1) The specifications of the library (2) The source code of the sample implementation (3) a makefile for Unix systems Enjoy! jacob In article <i02uid$kfv$1@speranza.aioe.org>, jacob@spamsink.net says... > > I have been talking about this since quite a long time. It is (maybe) > time to offer the first release. > > The URL is: > http://www.cs.virginia....

C Containers library #2
The C Containers library project aims to provide a portable specification of a container library for the C language. A sample implementation of the specification is provided, available at no cost. Available containers are: o lists (single/double linked) o vectors (extensible arrays) o valarrays (numeric arrays, extensible) o hash tables o trees o string collections o string lists o bitstrings o bloom filters auxiliary interfaces to heap management are provided. The full documentation and the source code is available at no cost from http://code.google.com/p/ccl The string list container...

The C Containers Library #3
To: John Benito Convener ISO/IEC JTC1/SC22/WG14 110 Shady Brook Court Santa Cruz, CA 95065-9728 USA From: Jacob Navia 41 rue Maurice Ravel 93430 Villetaneuse France Villetaneuse, July 8th 2012 Dear Sir, I would like to present the document: "The C Containers Library" to the committee for consideration for standardization. This document has been discussed in the French C++ standardization group of the AFNOR since there isn't a group for the C language exclusively any more. C and ...

The C Containers library #2
Hi I am continuing to progress in the specifications and the implementation of this proposal for the standards committee. o The observer interface is fully specified and implemented. This interface allows to be notified when a change in an observed container occurs. o ValArrays are fully specified and implemented for the basic types of the language. o Masks have been added, specified, and implemented in certain contexts. o I have been studying the new C++ standard, looking at similarities and adding footnotes with translations from the ccl to the stl. The current stand of th...

C container and persistent library ?
Hello, i have a few program parts that need a downgrade from C++ to C. I looked at it and while emulating the class system manually is not that hard, i really miss my templates and container types. Is there any any library for c that has generic (aka void* pointer) hashtables, linked lists and maybe btree's ? If there is a way to read/ write such containers to disk it would be perfect. Google didn't found anything but i can't believe that all you are rewritting this code all the time. llothar <llothar@web.de> wrote: > [ ... ] Is there > any any library for c that ...

C Containers Library project
Hi The date of discussion of this is approaching (Oct 22th). Please download the documentation, test the source code, see where changes would be useful. Thanks in advance for your help. URL of the ccl project: http://code.google.com/p/ccl Hello Mr. Navia, just downloaded the sources and tried to use OpenWatcom 1.9 (C89) to translate the sources (just for interest). 1. C99-Style in dequeue.c (corrected as below -> compiles) static ErrorFunction SetErrorFunction(Deque *l,ErrorFunction fn) { ErrorFunction old; /* <<< correction for C89 */ if (l...

Updates to the c containers library
Hi For the people that are using the containers library, I have updated the distribution. I added more implementations of Select and SelectCopy. Both functions take a container and a mask, producing either a modified container where non-selected elements are erased in place, or a copy of the selected elements. I added them for lists, string lists, vectors and string collections. This goes in a general direction that I want to build before presenting this work: the usage of masks is an interesting concept (taken from the APL language) You can download the containers libra...

C Containers library #2
I started presenting the work at the AFNOR here in France. I have some favorable reviews, but I am holding back until I get a good level of const correctness . I had always left that for later, but I can't present it before I have a good usage of const. This is important for the library since all functions now marked as receving a const container can be used freely within an iterator loop. All others are forbidden. This simplifies the specs and clarifies the library. ...

Improvements to the C containers library
What happens when you give a bad pointer instead of an iterator to a container? Well, nothing good :-) Instead of crashing, the library throws a nice error message and nothingcrashes in the library, the program will probably crash in the calling function, what is precisely what we want. Of course not ALL bad pointers will be catched, you still need a valid pointer to some memory that can be redeferenced. It is a cheap test (just a 64 bit memory comparison) and I think it is worth the trouble. In another development, the docs have been improved, several bugs fixed, etc. ...

C Containers Library vs STL
Hi I would like to compare the C containers library (written in C for C programmers) against the STL. Here is the code for the CCL. Maybe one C++ wizard would solve the same problem using the STL? I would be very ingterested in comparing code size, complexity, etc. Thanks in advance, and here is the C part: -------------------------------------------------------------- Unique ------ Given a text file, print in standard output the lines that are unique in it, i.e. filtering all duplicated lines. Algorithm: --------- Normally this involves keeping a sorted list/array of lines and testin...

C Containers Library #2 1695375
The C Containers library project aims to provide a portable specification of a container library for the C language. A sample implementation of the specification is provided, available at no cost. Available containers are: o lists (single/double linked) o vectors (extensible arrays) o valarrays (numeric arrays, extensible) o hash tables o trees o string collections o string lists o bitstrings o bloom filters auxiliary interfaces to heap management are provided. The full documentation and the source code is available at no cost from http://code.google.com/p/ccl The string list container...

C Containers library (ccl) project
Hi The date of discussion of this is approaching (Oct 22th). Please download the documentation, test the source code, see where changes would be useful. Thanks in advance for your help. URL of the ccl project: http://code.google.com/p/ccl jacob navia wrote: > Hi > The date of discussion of this is approaching (Oct 22th). Nuh uh: Your presentation is approaching. There is no "discussion". Not in the forum you suggest to be relevant. I don't wan't you to die. But if you do, I won't care. > Please download the documentation, test the sou...

C Containers Library #2 418009
I have set up a google project for the containers library. http://code.google.com/p/ccl/ This project tries to address the problem of the lack of an easy to use library that would complement the standard library so that not every c programmer has to reinvent hash tables, flexible arrays, red-black trees, and similar data structures. I will present this project to the french standardization group as soon as it is possible. Please read the documentation in downloads/ccl.pdf The source can be browsed in source/svn/trunk jacob ...

New release of the C Containers Library (CCL)
Hi The new release contains a significant innovation: generic containers. Generic containers are like virtual classes in the sense that you have no creation function, i.e. you can never create a generic container, only a specific kind of container (list, array, hash table, etc) The iGenericContainer interface allows to treat all containers for specific general functions the same. For instance iGenericContainer.GetSize(someContainer); will always return a size_t with the number of elements in the container, no matter which container it is that is passed as argument. Th...

Self contained 2D plotting library in C
http://plot2d.sourceforge.net Check out the documentation on cplot.h, cplot.c Only two files needed to generate the plots. It plots data directly to a compressed BMP file. It's great for quick plot generation - when you don't want to spend a lot of time integrating some of the more powerful plotting libraries. Challenge, can you compile and generate a plot in less than 10 minutes? The current record is 12 minutes. ...

A container library in C. Part 1: Header file
This is the first part of this posting. This is the header file containers.h --------------------------------------------------------cut here #ifndef __containers_h__ #define __containers_h__ #include <string.h> #include <stddef.h> #include <stdlib.h> #include <stdbool.h> /* A string collection is a table of zero terminated strings that will grow automatically when you add elements to it. As all other containers in this proposal, it uses an interface, i.e. a table of functions to provide the functionality and data access a string collection needs. Since the names ...

A container library in C. Part 2: String collection implementation
This is the implementation part of the string collection container ------------------------------------------------------------------ #include <string.h> #include "strcollection.h" #ifndef MALLOC #include <stdlib.h> #define MALLOC(s) malloc(s) #define FREE(p) free(p) #endif // Forward definitions static int GetCount(StringCollection *SC); static int IsReadOnly(StringCollection *SC); static int SetReadOnly(StringCollection *SC, int newval); static int Add(StringCollection *SC, const char *newval); static int AddRange(StringCollection *SC, const char * const *newval...