/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/DynamicArray.h

  • Committer: Gustav Hartvigsson
  • Date: 2017-01-24 20:55:19 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20170124205519-gtr18o3dwbunrrnx
* Fixed the tests in the CMake file
* Made doxygen output static declarations.
* Started work on SApplication
* Played with BaseN.c
  * Now it is a lil' bit better
* Spilt defs.h
  * Added types.h
    * Started work on the full typesystem.
      (Still needs testing)
  * Added primes.[c,h]
    * Contains some static array with primes.
      ("Good" primes, and all primes up to 5 000.
    * And helper functions related to Primes (Needs Tests).
* fixed s_dynamic_array_dump_array.
  (The old version did not make much sense)
* removed some functions from DymanicArray.c
* fixed compiler warnings in Mainloop.c
* removed s_map_(de)serialize_json functions.
* Made s_thread_status_get_name be less prone to error
  (This due to the C11 standard not specifing what these
   values should be)
* fixed s_thread_run
* fixed s_threa_stop

  TODO:
* Write tests for the s_prime_* functions
* Write tests for the s_type_* functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
 */
126
126
spointer
127
127
s_dynamic_array_get (SDynamicArray * self,
128
 
                     size_t index);
 
128
                     size_t index);
129
129
 
130
130
/**
131
131
 * Set an item at index.
175
175
s_dynamic_array_last_item (SDynamicArray * self);
176
176
 
177
177
/**
178
 
 * Dumps a copy of the array. Must be cast.
179
 
 *
180
 
 * Is not freed when the dynamic array is freed.
181
 
 *
182
 
 * Is null-terminated.
 
178
 * Dumps a truncation copy of the array. Must be cast.
 
179
 *
 
180
 * @param self The Dynamic Array to dump.
 
181
 * @param out_size Where the size of the array is stored.
 
182
 *
 
183
 * @note Freed by caller.
 
184
 *
 
185
 * @warning You can not use s_dynamic_array_len to get the length output array.
 
186
 *
183
187
 */
184
188
S_EXPORTED
185
189
spointer *
186
 
s_dynamic_array_dump_array (SDynamicArray * self);
 
190
s_dynamic_array_dump_array (SDynamicArray * self, size_t * out_size);
187
191
 
188
192
/**
189
193
 * Use a function on the array.
193
197
s_dynamic_array_for_each (SDynamicArray * self, ForEachFunc func,
194
198
                          spointer data);
195
199
 
196
 
#if 0
197
 
This function is removed, it would have been a pain in the arse to implement.
198
 
/**
199
 
 * same as s_dynamic_array_for_each (), with the difference that it returns a new
200
 
 * SDynamicArray.
201
 
 */
202
 
SDynamicArray *
203
 
s_dynamic_array_for_each_with_return (SDynamicArray * self,
204
 
                                      ForEachFunc func,
205
 
                                      spointer data);
206
 
#endif
207
 
 
208
 
/**
209
 
 * Returns a JSON representation of the array.
210
 
 *
211
 
 * If the to_json function is not set, this will return <tt>(pointer)</tt> for
212
 
 * each object.
213
 
 *
214
 
 * @param self The SDynamicArray to get the JSON representation from.
215
 
 *
216
 
 * @return a string with the JSON representation of the SDynamicArray.
217
 
 */
218
 
S_EXPORTED
219
 
char *
220
 
s_dynamic_array_serialize_json (SDynamicArray * self);
221
 
 
222
 
/**
223
 
 * appends itmes to an the array
224
 
 *
225
 
 * If the from_json function is not set, this will couse undefined behaviour.
226
 
 */
227
 
S_EXPORTED
228
 
void
229
 
s_dynamic_array_deserialize_json (SDynamicArray * self, char * json);
 
200
 
230
201
 
231
202
/** @} */
232
203