ragged_array.h

00001 #ifndef RAGGED_ARRAY_H
00002 #define RAGGED_ARRAY_H
00003 
00004 struct ragged_array {
00005     char** arr;
00006     int row_count;
00007     int array_size;
00008 };
00009 
00010 struct ragged_array ragged_array_initialize(const int size);
00011 struct ragged_array ragged_array_populate(const char *path, const char *prefix, const int line_max);
00012 
00013 // Expand the capacity of the array, without adding new data.
00014 int ragged_array_expand(struct ragged_array* set,const int new_size);
00015 
00016 // Add a line, expanding if necessary.
00017 int ragged_array_add_line(struct ragged_array* set, const char* line);
00018 
00019 // Delete a line while retaining continuity of the array -- warning: potentially slow!
00020 int ragged_array_delete_line(struct ragged_array* set, const int line_index);
00021 
00022 #endif

Generated on Fri Jan 8 15:30:03 2010 for cctools by  doxygen 1.6.1