This converts a lot of the projects to use the f_memory_array_*() functions.
Break the f_thread private functions into their own files.
build_sources_library utf/private-string.c
build_sources_library utf/private-triples.c utf/private-tripless.c
-build_sources_library-thread thread.c private-thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c
+build_sources_library-thread thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c
+build_sources_library-thread thread/private-attribute.c thread/private-barrier.c thread/private-barrier_attribute.c thread/private-condition.c thread/private-condition_attribute.c thread/private-id.c thread/private-key.c thread/private-lock.c thread/private-lock_attribute.c thread/private-mutex.c thread/private-mutex_attribute.c thread/private-once.c thread/private-semaphore.c thread/private-set.c thread/private-spin.c
build_sources_headers account.h account/accounts.h account/common.h
build_sources_headers capability.h capability/common.h
build_sources_library level_2/print.c
build_sources_library level_2/program.c level_2/program/common.c level_2/program/print.c level_2/private-program.c
-build_sources_library-thread level_0/thread.c level_0/private-thread.c level_0/thread/attribute.c level_0/thread/barrier.c level_0/thread/barrier_attribute.c level_0/thread/condition.c level_0/thread/condition_attribute.c level_0/thread/id.c level_0/thread/key.c level_0/thread/lock.c level_0/thread/lock_attribute.c level_0/thread/mutex.c level_0/thread/mutex_attribute.c level_0/thread/once.c level_0/thread/semaphore.c level_0/thread/set.c level_0/thread/spin.c
+build_sources_library-thread level_0/thread.c level_0/thread/attribute.c level_0/thread/barrier.c level_0/thread/barrier_attribute.c level_0/thread/condition.c level_0/thread/condition_attribute.c level_0/thread/id.c level_0/thread/key.c level_0/thread/lock.c level_0/thread/lock_attribute.c level_0/thread/mutex.c level_0/thread/mutex_attribute.c level_0/thread/once.c level_0/thread/semaphore.c level_0/thread/set.c level_0/thread/spin.c
+build_sources_library-thread level_0/thread/private-attribute.c level_0/thread/private-barrier.c level_0/thread/private-barrier_attribute.c level_0/thread/private-condition.c level_0/thread/private-condition_attribute.c level_0/thread/private-id.c level_0/thread/private-key.c level_0/thread/private-lock.c level_0/thread/private-lock_attribute.c level_0/thread/private-mutex.c level_0/thread/private-mutex_attribute.c level_0/thread/private-once.c level_0/thread/private-semaphore.c level_0/thread/private-set.c level_0/thread/private-spin.c
build_sources_headers level_0/account.h level_0/account/accounts.h level_0/account/common.h
build_sources_headers level_0/capability.h level_0/capability/common.h
#define _di_f_memory_array_adjust_
#define _di_f_memory_array_decimate_by_
#define _di_f_memory_array_decrease_by_
-#define _di_f_memory_array_increase_
-#define _di_f_memory_array_increase_by_
+//#define _di_f_memory_array_increase_
+//#define _di_f_memory_array_increase_by_
//#define _di_f_memory_array_resize_
//#define _di_f_memory_default_d_
//#define _di_f_memory_delete_
build_sources_program fll/level_0/utf/common.c fll/level_0/utf/convert.c fll/level_0/utf/dynamic.c fll/level_0/utf/dynamics.c fll/level_0/utf/dynamicss.c fll/level_0/utf/is.c fll/level_0/utf/is_character.c fll/level_0/utf/map.c fll/level_0/utf/maps.c fll/level_0/utf/mapss.c fll/level_0/utf/map_multi.c fll/level_0/utf/map_multis.c fll/level_0/utf/map_multiss.c fll/level_0/utf/static.c fll/level_0/utf/statics.c fll/level_0/utf/staticss.c fll/level_0/utf/string.c fll/level_0/utf/triple.c fll/level_0/utf/triples.c fll/level_0/utf/tripless.c
build_sources_program fll/level_0/utf/private-dynamic.c fll/level_0/utf/private-dynamics.c fll/level_0/utf/private-dynamicss.c fll/level_0/utf/private-maps.c fll/level_0/utf/private-mapss.c fll/level_0/utf/private-map_multis.c fll/level_0/utf/private-map_multiss.c fll/level_0/utf/private-string.c fll/level_0/utf/private-triples.c fll/level_0/utf/private-tripless.c
-build_sources_program-thread fll/level_0/thread.c fll/level_0/private-thread.c fll/level_0/thread/attribute.c fll/level_0/thread/barrier.c fll/level_0/thread/barrier_attribute.c fll/level_0/thread/condition.c fll/level_0/thread/condition_attribute.c fll/level_0/thread/id.c fll/level_0/thread/key.c fll/level_0/thread/lock.c fll/level_0/thread/lock_attribute.c fll/level_0/thread/mutex.c fll/level_0/thread/mutex_attribute.c fll/level_0/thread/once.c fll/level_0/thread/semaphore.c fll/level_0/thread/set.c fll/level_0/thread/spin.c
+build_sources_program-thread fll/level_0/thread.c fll/level_0/thread/attribute.c fll/level_0/thread/barrier.c fll/level_0/thread/barrier_attribute.c fll/level_0/thread/condition.c fll/level_0/thread/condition_attribute.c fll/level_0/thread/id.c fll/level_0/thread/key.c fll/level_0/thread/lock.c fll/level_0/thread/lock_attribute.c fll/level_0/thread/mutex.c fll/level_0/thread/mutex_attribute.c fll/level_0/thread/once.c fll/level_0/thread/semaphore.c fll/level_0/thread/set.c fll/level_0/thread/spin.c
+build_sources_program-thread fll/level_0/thread/private-attribute.c fll/level_0/thread/private-barrier.c fll/level_0/thread/private-barrier_attribute.c fll/level_0/thread/private-condition.c fll/level_0/thread/private-condition_attribute.c fll/level_0/thread/private-id.c fll/level_0/thread/private-key.c fll/level_0/thread/private-lock.c fll/level_0/thread/private-lock_attribute.c fll/level_0/thread/private-mutex.c fll/level_0/thread/private-mutex_attribute.c fll/level_0/thread/private-once.c fll/level_0/thread/private-semaphore.c fll/level_0/thread/private-set.c fll/level_0/thread/private-spin.c
build_sources_program fll/level_1/control_group.c
build_sources_program fll/level_1/conversion.c fll/level_1/private-conversion.c fll/level_1/conversion/common.c
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (nests->size > amount) return private_f_fss_nests_adjust(nests->size - amount, nests);
- return private_f_fss_nests_adjust(0, nests);
+ return private_f_fss_nests_adjust((nests->size > amount) ? nests->size - amount : 0, nests);
}
#endif // _di_f_fss_nests_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (nests->size > amount) return private_f_fss_nests_resize(nests->size - amount, nests);
- return private_f_fss_nests_resize(0, nests);
+ return private_f_fss_nests_resize((nests->size > amount) ? nests->size - amount : 0, nests);
}
#endif // _di_f_fss_nests_decrease_by_
extern "C" {
#endif
-#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
+#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
f_status_t private_f_fss_items_adjust(const f_number_unsigned_t length, f_fss_items_t * const items) {
f_status_t status = F_none;
return f_memory_array_adjust(length, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
}
-#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
+#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
-#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
+#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
f_status_t private_f_fss_items_resize(const f_number_unsigned_t length, f_fss_items_t * const items) {
f_status_t status = F_none;
return f_memory_array_resize(length, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
}
-#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
+#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
#ifdef __cplusplus
} // extern "C"
*
* @see f_memory_array_adjust()
* @see f_string_dynamic_adjust()
+ *
+ * @see f_fss_items_adjust()
+ * @see f_fss_items_decimate_by()
+ * @see f_fss_nest_adjust()
+ * @see f_fss_nest_decimate_by()
*/
-#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
+#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
extern f_status_t private_f_fss_items_adjust(const f_number_unsigned_t length, f_fss_items_t * const items) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
+#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_) || !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
/**
* Private implementation for resizing.
*
* @see f_memory_array_resize()
* @see f_string_dynamic_resize()
+ *
+ * @see f_fss_items_decrease_by()
+ * @see f_fss_items_resize()
+ * @see f_fss_nest_decrease_by()
+ * @see f_fss_nest_resize()
*/
-#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_)
+#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
extern f_status_t private_f_fss_items_resize(const f_number_unsigned_t length, f_fss_items_t * const items) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_)
+#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_) || !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
+#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
f_status_t private_f_fss_named_resize(const f_number_unsigned_t length, f_fss_named_t * const named) {
f_status_t status = f_string_ranges_resize(length, &named->objects);
return F_none;
}
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
+#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
f_status_t private_f_fss_nameds_adjust(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) {
* @see f_uint8ss_resize()
*
* @see f_fss_nameds_decrease_by()
+ * @see f_fss_nameds_increase()
+ * @see f_fss_nameds_increase_by()
* @see f_fss_nameds_resize()
*/
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
+#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
extern f_status_t private_f_fss_nameds_resize(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
+#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_named_increase_) || !defined(_di_f_fss_named_increase_by_) || !defined(_di_f_fss_nameds_resize_)
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
-#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
+#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
f_status_t private_f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests) {
{
return f_memory_array_resize(length, sizeof(f_fss_nest_t), (void **) &nests->array, &nests->used, &nests->size);
}
-#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
+#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
#ifdef __cplusplus
} // extern "C"
* @see f_string_dynamic_resize()
*
* @see f_fss_nests_decrease_by()
+ * @see f_fss_nests_increase()
+ * @see f_fss_nests_increase_by()
* @see f_fss_nests_resize()
*/
-#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
+#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
extern f_status_t private_f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
+#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
-#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
+#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
f_status_t private_f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t *set) {
f_status_t status = f_string_ranges_resize(length, &set->objects);
return F_none;
}
-#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
+#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
f_status_t private_f_fss_sets_adjust(const f_number_unsigned_t length, f_fss_sets_t * const sets) {
* @see f_string_rangess_resize()()
*
* @see f_fss_set_decrease_by()
+ * @see f_fss_set_increase()
+ * @see f_fss_set_increase_by()
* @see f_fss_set_resize()
*/
-#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
+#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
extern f_status_t private_f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t * const set) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
+#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
/**
* Private implementation for resizing.
}
#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
-#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
+#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
f_status_t private_f_fss_set_quote_resize(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) {
f_status_t status = f_string_ranges_resize(length, &set_quote->objects);
return F_none;
}
-#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
+#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
f_status_t private_f_fss_set_quotes_adjust(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) {
* @see f_uint8ss_adjust()
*
* @see f_fss_set_quotes_decrease_by()
+ * @see f_fss_set_quotes_increase()
+ * @see f_fss_set_quotes_increase_by()
* @see f_fss_set_quotes_resize()
* @see f_memory_resize()
*/
-#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
+#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
extern f_status_t private_f_fss_set_quotes_resize(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
+#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
#ifdef __cplusplus
} // extern "C"
if (!source.used) return F_data_not;
- f_status_t status = f_memory_array_increase(source.used, sizeof(f_fss_simple_packet_ranges_t), (void **) &destination->array, &destination->used, &destination->size);
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fss_simple_packet_ranges_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase_by().
+ * Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_memory_array_increase_by()
+ * @see f_memory_array_increase()
* @see f_memory_array_resize()
*/
#ifndef _di_f_fss_simple_packet_ranges_append_
if (!source.used) return F_data_not;
- f_status_t status = f_memory_array_increase(source.used, sizeof(f_limit_sets_t), (void **) &destination->array, &destination->used, &destination->size);
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_limit_sets_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase_by().
+ * Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_memory_array_increase_by()
+ * @see f_memory_array_increase()
* @see f_memory_array_resize()
*/
#ifndef _di_f_limit_setss_append_
if (!source.used) return F_data_not;
- f_status_t status = f_memory_array_increase(source.used, sizeof(f_limit_values_t), (void **) &destination->array, &destination->used, &destination->size);
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_limit_values_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_array_increase_by().
+ * Errors (with error bit) from: f_memory_array_increase().
* Errors (with error bit) from: f_memory_array_resize().
*
- * @see f_memory_array_increase_by()
+ * @see f_memory_array_increase()
* @see f_memory_array_resize()
*/
#ifndef _di_f_limit_valuess_append_
extern "C" {
#endif
-#if !defined(_di_f_sockets_append_) || !defined(_di_f_socketss_append_)
- extern f_status_t private_f_sockets_append(const f_socket_t source, f_sockets_t * const destination) {
-
- const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_socket_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
-
- destination->array[destination->used++] = source;
-
- return F_none;
- }
-#endif // !defined(_di_f_sockets_append_) || !defined(_di_f_socketss_append_)
-
-#if !defined(_di_f_sockets_append_) || !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_all_)
+#if !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_) || !defined(_di_f_socketss_append_all_)
extern f_status_t private_f_sockets_append_all(const f_sockets_t source, f_sockets_t * const destination) {
const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_socket_t), (void **) &destination->array, &destination->used, &destination->size);
return F_none;
}
-#endif // !defined(_di_f_sockets_append_) || !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_all_)
+#endif // !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_) || !defined(_di_f_socketss_append_all_)
#if !defined(_di_f_socketss_adjust_) || !defined(_di_f_socketss_decimate_by_)
f_status_t private_f_socketss_adjust(const f_number_unsigned_t length, f_socketss_t * const socketss) {
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source socket to append.
- * @param destination
- * The destination lengths the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_sockets_append()
- * @see f_socketss_append()
- */
-#if !defined(_di_f_sockets_append_) || !defined(_di_f_socketss_append_)
- extern f_status_t private_f_sockets_append(const f_socket_t source, f_sockets_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_sockets_append_) || !defined(_di_f_socketss_append_)
-
-/**
- * Private implementation for appending the socket array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
* The source sockets to append.
* @param destination
* The destination lengths the source is appended onto.
* Errors (with error bit) from: f_memory_resize().
*
* @see f_memory_resize()
+ *
* @see f_sockets_append_all()
* @see f_socketss_append()
* @see f_socketss_append_all()
*/
-#if !defined(_di_f_sockets_append_) || !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_all_)
+#if !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_) || !defined(_di_f_socketss_append_all_)
extern f_status_t private_f_sockets_append_all(const f_sockets_t source, f_sockets_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_sockets_append_) || !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_all_)
+#endif // !defined(_di_f_sockets_append_all_) || !defined(_di_f_socketss_append_) || !defined(_di_f_socketss_append_all_)
/**
* Private implementation for resizing the socketss array.
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_sockets_append(source, destination);
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_socket_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
}
#endif // _di_f_sockets_append_
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
f_status_t private_f_string_append(const f_string_t source, const f_number_unsigned_t length, f_string_dynamic_t * const destination) {
- if (destination->used + length + 1 > destination->size) {
- const f_status_t status = private_f_string_dynamic_increase_by(length + 1, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(length + 1, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
f_status_t private_f_string_append_nulless(const f_string_t source, const f_number_unsigned_t length, f_string_dynamic_t * const destination) {
- f_status_t status = F_none;
+ if (destination->used >= F_string_t_size_d) return F_status_set_error(F_string_too_large);
+ f_status_t status = F_none;
f_number_unsigned_t i = 0;
f_number_unsigned_t size = 0;
if (source[i]) ++size;
} // for
- if (destination->used + size + 1 > destination->size) {
- status = private_f_string_dynamic_increase_by(size + 1, destination);
- if (F_status_is_error(status)) return status;
- }
+ if (size + 1 > F_string_t_size_d) return F_status_set_error(F_string_too_large);
+
+ status = f_memory_array_increase_by(size + 1, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
f_number_unsigned_t first = 0;
#if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
f_status_t private_f_string_prepend(const f_string_t source, const f_number_unsigned_t length, f_string_dynamic_t * const destination) {
- if (destination->used + length > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
+ if (destination->used >= F_string_t_size_d) return F_status_set_error(F_string_too_large);
+ if (destination->used + length + 1 > F_string_t_size_d) return F_status_set_error(F_string_too_large);
- if (destination->used + length > destination->size) {
- const f_status_t status = private_f_string_dynamic_increase_by(length, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(length + 1, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
f_status_t private_f_string_prepend_nulless(const f_string_t source, const f_number_unsigned_t length, f_string_dynamic_t * const destination) {
- if (destination->used + length > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
+ if (destination->used + length > F_string_t_size_d) return F_status_set_error(F_string_too_large);
f_status_t status = F_none;
-
f_number_unsigned_t first = 0;
f_number_unsigned_t offset = 0;
if (i > first) {
size = i - first;
- if (destination->used + size > destination->size) {
- status = private_f_string_dynamic_increase_by(size, destination);
- if (F_status_is_error(status)) return status;
- }
+ status = f_memory_array_increase_by(size + 1, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
memmove(destination->string + offset + size, destination->string + offset, sizeof(f_char_t) * (destination->used - offset));
memcpy(destination->string + offset, source + first, sizeof(f_char_t) * size);
if (i > first) {
size = i - first;
- if (destination->used + size > destination->size) {
- status = private_f_string_dynamic_increase_by(size, destination);
- if (F_status_is_error(status)) return status;
- }
+ status = f_memory_array_increase_by(size + 1, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
memmove(destination->string + offset + size, destination->string + offset, sizeof(f_char_t) * (destination->used - offset));
memcpy(destination->string + offset, source + first, sizeof(f_char_t) * size);
#endif // _di_level_0_parameter_checking_
if (!length) return F_data_not;
-
- if (destination->used < length) {
- return private_f_string_append(source, length, destination);
- }
+ if (destination->used < length) return private_f_string_append(source, length, destination);
f_number_unsigned_t i = 1;
f_number_unsigned_t j = 1;
#endif // _di_level_0_parameter_checking_
if (!length) return F_data_not;
-
- if (!destination->used) {
- return private_f_string_append_nulless(source, length, destination);
- }
+ if (!destination->used) return private_f_string_append_nulless(source, length, destination);
f_number_unsigned_t i = 1;
f_number_unsigned_t j = 1;
if (!length) return F_data_not;
if (glue_length && destination->used) {
- f_status_t status = private_f_string_append(glue, glue_length, destination);
+ const f_status_t status = private_f_string_append(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (!length) return F_data_not;
if (glue_length && destination->used) {
- f_status_t status = private_f_string_prepend(glue, glue_length, destination);
+ const f_status_t status = private_f_string_prepend(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
if (!length) return F_data_not;
if (glue_length && destination->used) {
- f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination);
+ const f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination);
if (F_status_is_error(status)) return status;
}
#endif // _di_level_0_parameter_checking_
if (!length) return F_data_not;
-
- if (destination->used < length) {
- return private_f_string_prepend(source, length, destination);
- }
+ if (destination->used < length) return private_f_string_prepend(source, length, destination);
f_number_unsigned_t i = 0;
f_number_unsigned_t j = 0;
#endif // _di_level_0_parameter_checking_
if (!length) return F_data_not;
-
- if (!destination->used) {
- return private_f_string_prepend_nulless(source, length, destination);
- }
+ if (!destination->used) return private_f_string_prepend_nulless(source, length, destination);
f_number_unsigned_t i = 0;
f_number_unsigned_t j = 0;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) {
- return F_data_not_stop;
- }
+ if (range->start > range->stop) return F_data_not_stop;
while (string[range->start] != f_string_eol_s.string[0]) {
++range->start;
- if (range->start > range->stop) {
- return F_none_stop;
- }
+ if (range->start > range->stop) return F_none_stop;
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) {
- return F_data_not_stop;
- }
+ if (range->start > range->stop) return F_data_not_stop;
while (string[range->start] != seek_to) {
- if (string[range->start] == f_string_eol_s.string[0]) {
- return F_none_eol;
- }
+ if (string[range->start] == f_string_eol_s.string[0]) return F_none_eol;
++range->start;
- if (range->start > range->stop) {
- return F_none_stop;
- }
+ if (range->start > range->stop) return F_none_stop;
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) {
- return F_data_not_stop;
- }
+ if (range->start > range->stop) return F_data_not_stop;
while (string[range->start] != seek_to) {
++range->start;
- if (range->start > range->stop) {
- return F_none_stop;
- }
+ if (range->start > range->stop) return F_none_stop;
} // while
return F_none;
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_string_dynamic_adjust(length, dynamic);
+ return f_memory_array_adjust(length, sizeof(f_string_t), (void **) &dynamic->string, &dynamic->used, &dynamic->size);
}
#endif // _di_f_string_dynamic_adjust_
#endif // _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
-
- if (destination->used < source.used) {
- return private_f_string_append(source.string, source.used, destination);
- }
+ if (destination->used < source.used) return private_f_string_append(source.string, source.used, destination);
f_number_unsigned_t i = 1;
f_number_unsigned_t j = 1;
#endif // _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
-
- if (!destination->used) {
- return private_f_string_append_nulless(source.string, source.used, destination);
- }
+ if (!destination->used) return private_f_string_append_nulless(source.string, source.used, destination);
f_number_unsigned_t i = 1;
f_number_unsigned_t j = 1;
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (dynamic->size > amount) {
- return private_f_string_dynamic_adjust(dynamic->size - amount, dynamic);
- }
-
- return private_f_string_dynamic_adjust(0, dynamic);
+ return f_memory_array_decimate_by(amount, sizeof(f_string_t), (void **) &dynamic->string, &dynamic->used, &dynamic->size);
}
#endif // _di_f_string_dynamic_decimate_by_
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (dynamic->size > amount) {
- return private_f_string_dynamic_resize(dynamic->size - amount, dynamic);
- }
-
- return private_f_string_dynamic_resize(0, dynamic);
+ return f_memory_array_decrease_by(amount, sizeof(f_string_t), (void **) &dynamic->string, &dynamic->used, &dynamic->size);
}
#endif // _di_f_string_dynamic_decrease_by_
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && dynamic->used + 1 > dynamic->size) {
- f_number_unsigned_t size = dynamic->used + step;
-
- if (size > F_string_t_size_d) {
- if (dynamic->used + 1 > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
-
- size = F_string_t_size_d;
- }
-
- return private_f_string_dynamic_resize(size, dynamic);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_string_t), (void **) &dynamic->string, &dynamic->used, &dynamic->size);
}
#endif // _di_f_string_dynamic_increase_
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- return private_f_string_dynamic_increase_by(amount, dynamic);
+ return f_memory_array_increase_by(amount, sizeof(f_string_t), (void **) &dynamic->string, &dynamic->used, &dynamic->size);
}
#endif // _di_f_string_dynamic_increase_by_
const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
- if (destination->used < length) {
- return private_f_string_append(source.string + range.start, length, destination);
- }
+ if (destination->used < length) return private_f_string_append(source.string + range.start, length, destination);
const f_number_unsigned_t stop = range.stop >= source.used ? source.used : range.stop + 1;
f_number_unsigned_t i = 1;
const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
- if (!destination->used) {
- return private_f_string_append_nulless(source.string + range.start, length, destination);
- }
+ if (!destination->used) return private_f_string_append_nulless(source.string + range.start, length, destination);
const f_number_unsigned_t stop = range.stop >= source.used ? source.used : range.stop + 1;
f_number_unsigned_t i = 1;
const f_number_unsigned_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
- if (destination->used < length) {
- return private_f_string_prepend(source.string + range.start, length, destination);
- }
+ if (destination->used < length) return private_f_string_prepend(source.string + range.start, length, destination);
f_number_unsigned_t i = 0;
f_number_unsigned_t j = 0;
#endif // _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
-
- if (destination->used < source.used) {
- return private_f_string_prepend(source.string, source.used, destination);
- }
+ if (destination->used < source.used) return private_f_string_prepend(source.string, source.used, destination);
f_number_unsigned_t i = 0;
f_number_unsigned_t j = 0;
while (i < source.used && j < destination->used) {
- if (source.string[i] != destination->string[j]) {
- return private_f_string_prepend(source.string, source.used, destination);
- }
+ if (source.string[i] != destination->string[j]) return private_f_string_prepend(source.string, source.used, destination);
++i;
++j;
#endif // _di_level_0_parameter_checking_
if (!source.used) return F_data_not;
-
- if (!destination->used) {
- return private_f_string_prepend_nulless(source.string, source.used, destination);
- }
+ if (!destination->used) return private_f_string_prepend_nulless(source.string, source.used, destination);
f_number_unsigned_t i = 0;
f_number_unsigned_t j = 0;
continue;
}
- if (source.string[i] != destination->string[j]) {
- return private_f_string_prepend_nulless(source.string, source.used, destination);
- }
+ if (source.string[i] != destination->string[j]) return private_f_string_prepend_nulless(source.string, source.used, destination);
++i;
++j;
if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_string_dynamic_resize(length, buffer);
+ return f_memory_array_resize(length, sizeof(f_string_t), (void **) &buffer->string, &buffer->used, &buffer->size);
}
#endif // _di_f_string_dynamic_resize_
if (destination->used && !destination->string[destination->used - 1]) return F_none;
if (destination->used == F_string_t_size_d) return F_status_set_error(F_string_too_large);
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_string_dynamic_resize(destination->used + (destination->used + 1 == F_string_t_size_d ? 1 : F_memory_default_allocation_small_d), destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#endif // _di_level_0_parameter_checking_
if (destination->used < destination->size) {
- if (!destination->string[destination->used]) {
- return F_none;
- }
+ if (!destination->string[destination->used]) return F_none;
}
if (destination->used == F_string_t_size_d) return F_status_set_error(F_string_too_large);
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_string_dynamic_resize(destination->used + (destination->used + 1 == F_string_t_size_d ? 1 : F_memory_default_allocation_small_d), destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_t), (void **) &destination->string, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
if (!amount) return F_data_not;
- if (dynamics->size > amount) {
- return private_f_string_dynamics_adjust(dynamics->size - amount, dynamics);
- }
-
- return private_f_string_dynamics_adjust(0, dynamics);
+ return private_f_string_dynamics_adjust((dynamics->size > amount) ? dynamics->size - amount : 0, dynamics);
}
#endif // _di_f_string_dynamics_decimate_by_
if (!amount) return F_data_not;
- if (dynamics->size > amount) {
- return private_f_string_dynamics_resize(dynamics->size - amount, dynamics);
- }
-
- return private_f_string_dynamics_resize(0, dynamics);
+ return private_f_string_dynamics_resize((dynamics->size > amount) ? dynamics->size - amount : 0, dynamics);
}
#endif // _di_f_string_dynamics_decrease_by_
f_number_unsigned_t size = dynamics->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (dynamics->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (dynamics->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!amount) return F_data_not;
- if (dynamicss->size > amount) {
- return private_f_string_dynamicss_adjust(dynamicss->size - amount, dynamicss);
- }
-
- return private_f_string_dynamicss_adjust(0, dynamicss);
+ return private_f_string_dynamicss_adjust((dynamicss->size > amount) ? dynamicss->size - amount : 0, dynamicss);
}
#endif // _di_f_string_dynamicss_decimate_by_
if (!amount) return F_data_not;
- if (dynamicss->size > amount) {
- return private_f_string_dynamicss_resize(dynamicss->size - amount, dynamicss);
- }
-
- return private_f_string_dynamicss_resize(0, dynamicss);
+ return private_f_string_dynamicss_resize((dynamicss->size > amount) ? dynamicss->size - amount : 0, dynamicss);
}
#endif // _di_f_string_dynamicss_decrease_by_
f_number_unsigned_t size = dynamicss->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (dynamicss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (dynamicss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!amount) return F_data_not;
- if (map_multis->size > amount) {
- return private_f_string_map_multis_adjust(map_multis->size - amount, map_multis);
- }
-
- return private_f_string_map_multis_adjust(0, map_multis);
+ return private_f_string_map_multis_adjust((map_multis->size > amount) ? map_multis->size - amount : 0, map_multis);
}
#endif // _di_f_string_map_multis_decimate_by_
if (!amount) return F_data_not;
- if (map_multis->size > amount) {
- return private_f_string_map_multis_resize(map_multis->size - amount, map_multis);
- }
-
- return private_f_string_map_multis_resize(0, map_multis);
+ return private_f_string_map_multis_resize((map_multis->size > amount) ? map_multis->size - amount : 0, map_multis);
}
#endif // _di_f_string_map_multis_decrease_by_
f_number_unsigned_t size = map_multis->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (map_multis->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (map_multis->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!amount) return F_data_not;
- if (map_multiss->size > amount) {
- return private_f_string_map_multiss_adjust(map_multiss->size - amount, map_multiss);
- }
-
- return private_f_string_map_multiss_adjust(0, map_multiss);
+ return private_f_string_map_multiss_adjust((map_multiss->size > amount) ? map_multiss->size - amount : 0, map_multiss);
}
#endif // _di_f_string_map_multiss_decimate_by_
if (!amount) return F_data_not;
- if (map_multiss->size > amount) {
- return private_f_string_map_multiss_resize(map_multiss->size - amount, map_multiss);
- }
-
- return private_f_string_map_multiss_resize(0, map_multiss);
+ return private_f_string_map_multiss_resize((map_multiss->size > amount) ? map_multiss->size - amount : 0, map_multiss);
}
#endif // _di_f_string_map_multiss_decrease_by_
f_number_unsigned_t size = map_multiss->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (map_multiss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (map_multiss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!amount) return F_data_not;
- if (maps->size > amount) {
- return private_f_string_maps_adjust(maps->size - amount, maps);
- }
-
- return private_f_string_maps_adjust(0, maps);
+ return private_f_string_maps_adjust((maps->size > amount) ? maps->size - amount : 0, maps);
}
#endif // _di_f_string_maps_decimate_by_
if (!amount) return F_data_not;
- if (maps->size > amount) {
- return private_f_string_maps_resize(maps->size - amount, maps);
- }
-
- return private_f_string_maps_resize(0, maps);
+ return private_f_string_maps_resize((maps->size > amount) ? maps->size - amount : 0, maps);
}
#endif // _di_f_string_maps_decrease_by_
f_number_unsigned_t size = maps->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (maps->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (maps->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!amount) return F_data_not;
- if (mapss->size > amount) {
- return private_f_string_mapss_adjust(mapss->size - amount, mapss);
- }
-
- return private_f_string_mapss_adjust(0, mapss);
+ return private_f_string_mapss_adjust((mapss->size > amount) ? mapss->size - amount : 0, mapss);
}
#endif // _di_f_string_mapss_decimate_by_
if (!amount) return F_data_not;
- if (mapss->size > amount) {
- return private_f_string_mapss_resize(mapss->size - amount, mapss);
- }
-
- return private_f_string_mapss_resize(0, mapss);
+ return private_f_string_mapss_resize((mapss->size > amount) ? mapss->size - amount : 0, mapss);
}
#endif // _di_f_string_mapss_decrease_by_
f_number_unsigned_t size = mapss->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (mapss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (mapss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
extern "C" {
#endif
-#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- f_status_t private_f_string_dynamic_adjust(const f_number_unsigned_t length, f_string_dynamic_t * const dynamic) {
-
- const f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
- if (F_status_is_error(status)) return status;
-
- dynamic->size = length;
-
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_dynamic_increase_by(const f_number_unsigned_t amount, f_string_dynamic_t * const dynamic) {
-
- const f_number_unsigned_t length = dynamic->used + amount;
-
- if (length > dynamic->size) {
- if (length > F_string_t_size_d) return F_status_set_error(F_string_too_large);
-
- return private_f_string_dynamic_resize(length, dynamic);
- }
-
- return F_data_not;
- }
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_dynamic_resize(const f_number_unsigned_t length, f_string_dynamic_t * const dynamic) {
-
- const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
- if (F_status_is_error(status)) return status;
-
- dynamic->size = length;
-
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-
#ifdef __cplusplus
} // extern "C"
#endif
extern "C" {
#endif
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param dynamic
- * The string to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_dynamic_adjust()
- * @see f_string_dynamic_decimate_by()
- * @see f_string_dynamics_adjust()
- * @see f_string_dynamics_append()
- * @see f_string_dynamics_decimate_by()
- * @see f_string_map_multis_adjust()
- * @see f_string_map_multis_append()
- * @see f_string_triples_adjust()
- * @see f_string_triples_decimate_by()
- */
-#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- extern f_status_t private_f_string_dynamic_adjust(const f_number_unsigned_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-/**
- * Private implementation of f_string_dynamic_increase_by().
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param dynamic
- * The string to resize.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_string_too_large (with error bit) if the combined string is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see memcpy()
- *
- * @see f_string_append()
- * @see f_string_append_assure()
- * @see f_string_append_mash()
- * @see f_string_append_nulless()
- * @see f_string_dynamic_append()
- * @see f_string_dynamic_append_assure()
- * @see f_string_dynamic_append_nulless()
- * @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_mash()
- * @see f_string_dynamic_mash_nulless()
- * @see f_string_dynamic_partial_append)
- * @see f_string_dynamic_partial_append_assure()
- * @see f_string_dynamic_partial_mash()
- * @see f_string_dynamic_prepend()
- * @see f_string_dynamic_prepend_nulless()
- * @see f_string_dynamics_append()
- * @see f_string_map_multis_append()
- * @see f_string_mash()
- * @see f_string_mash_nulless()
- * @see f_string_maps_append()
- * @see f_string_prepend()
- * @see f_string_prepend_nulless()
- * @see f_string_triples_append()
- */
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- extern f_status_t private_f_string_dynamic_increase_by(const f_number_unsigned_t amount, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param dynamic
- * The string to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_append()
- * @see f_string_append_assure()
- * @see f_string_append_mash()
- * @see f_string_append_nulless()
- * @see f_string_dynamic_append()
- * @see f_string_dynamic_append_assure()
- * @see f_string_dynamic_append_nulless()
- * @see f_string_dynamic_decrease_by()
- * @see f_string_dynamic_increase()
- * @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_mash()
- * @see f_string_dynamic_mash_nulless()
- * @see f_string_dynamic_partial_append)
- * @see f_string_dynamic_partial_append_assure()
- * @see f_string_dynamic_partial_mash()
- * @see f_string_dynamic_prepend()
- * @see f_string_dynamic_prepend_nulless()
- * @see f_string_dynamic_terminate()
- * @see f_string_dynamic_terminate_after()
- * @see f_string_dynamics_append()
- * @see f_string_map_multis_append()
- * @see f_string_mash_nulless()
- * @see f_string_mash()
- * @see f_string_maps_append()
- * @see f_string_prepend()
- * @see f_string_prepend_nulless()
- * @see f_string_triples_append()
- */
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- extern f_status_t private_f_string_dynamic_resize(const f_number_unsigned_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
f_status_t private_f_string_dynamics_adjust(const f_number_unsigned_t length, f_string_dynamics_t * const dynamics) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < dynamics->size; ++i) {
- status = private_f_string_dynamic_adjust(0, &dynamics->array[i]);
+ status = f_memory_array_adjust(0, sizeof(f_string_t), (void **) &dynamics->array[i].string, &dynamics->array[i].used, &dynamics->array[i].size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(dynamics->size, length, sizeof(f_string_dynamic_t), (void **) & dynamics->array);
- if (F_status_is_error(status)) return status;
-
- dynamics->size = length;
-
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_dynamic_t), (void **) &dynamics->array, &dynamics->used, &dynamics->size);
}
#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
f_status_t private_f_string_dynamics_resize(const f_number_unsigned_t length, f_string_dynamics_t * const dynamics) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < dynamics->size; ++i) {
- status = private_f_string_dynamic_resize(0, &dynamics->array[i]);
+ status = f_memory_array_resize(0, sizeof(f_string_t), (void **) &dynamics->array[i].string, &dynamics->array[i].used, &dynamics->array[i].size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(dynamics->size, length, sizeof(f_string_dynamic_t), (void **) & dynamics->array);
- if (F_status_is_error(status)) return status;
-
- dynamics->size = length;
-
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_dynamic_t), (void **) &dynamics->array, &dynamics->used, &dynamics->size);
}
#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
* @param length
* The new size to use.
* @param dynamics
- * The strings to adjust.
+ * The dynamics to adjust.
*
* @return
* F_none on success.
* @param source
* The source string to append.
* @param destination
- * The destination strings the source is appended onto.
+ * The destination dynamics the source is appended onto.
*
* @return
* F_none on success.
* @param source
* The source strings to append.
* @param destination
- * The destination strings the source is appended onto.
+ * The destination dynamics the source is appended onto.
*
* @return
* F_none on success.
* @param length
* The new size to use.
* @param dynamics
- * The strings to resize.
+ * The dynamics to resize.
*
* @return
* F_none on success.
#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
f_status_t private_f_string_dynamicss_adjust(const f_number_unsigned_t length, f_string_dynamicss_t * const dynamicss) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < dynamicss->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(dynamicss->size, length, sizeof(f_string_dynamics_t), (void **) & dynamicss->array);
- if (F_status_is_error(status)) return status;
-
- dynamicss->size = length;
-
- if (dynamicss->used > dynamicss->size) {
- dynamicss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_dynamics_t), (void **) &dynamicss->array, &dynamicss->used, &dynamicss->size);
}
#endif // !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
f_status_t private_f_string_dynamicss_resize(const f_number_unsigned_t length, f_string_dynamicss_t * const dynamicss) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < dynamicss->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(dynamicss->size, length, sizeof(f_string_dynamics_t), (void **) & dynamicss->array);
- if (F_status_is_error(status)) return status;
-
- dynamicss->size = length;
-
- if (dynamicss->used > dynamicss->size) {
- dynamicss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_dynamics_t), (void **) &dynamicss->array, &dynamicss->used, &dynamicss->size);
}
#endif // !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
* @param length
* The new size to use.
* @param dynamicss
- * The strings to adjust.
+ * The dynamicss to adjust.
*
* @return
* F_none on success.
* @param length
* The new size to use.
* @param dynamicss
- * The strings to resize.
+ * The dynamicss to resize.
*
* @return
* F_none on success.
#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
f_status_t private_f_string_map_multis_adjust(const f_number_unsigned_t length, f_string_map_multis_t * const map_multis) {
- if (map_multis->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < map_multis->size; ++i) {
- status = private_f_string_dynamic_adjust(0, &map_multis->array[i].name);
+ status = f_memory_array_adjust(0, sizeof(f_string_t), (void **) &map_multis->array[i].name.string, &map_multis->array[i].name.used, &map_multis->array[i].name.size);
if (F_status_is_error(status)) return status;
status = private_f_string_dynamics_adjust(0, &map_multis->array[i].value);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(map_multis->size, length, sizeof(f_string_map_multi_t), (void **) & map_multis->array);
- if (F_status_is_error(status)) return status;
-
- map_multis->size = length;
-
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_map_multi_t), (void **) &map_multis->array, &map_multis->used, &map_multis->size);
}
#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
#if !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
f_status_t private_f_string_map_multis_resize(const f_number_unsigned_t length, f_string_map_multis_t * const map_multis) {
- if (map_multis->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < map_multis->size; ++i) {
- status = private_f_string_dynamic_resize(0, &map_multis->array[i].name);
+ status = f_memory_array_resize(0, sizeof(f_string_t), (void **) &map_multis->array[i].name.string, &map_multis->array[i].name.used, &map_multis->array[i].name.size);
if (F_status_is_error(status)) return status;
status = private_f_string_dynamics_resize(0, &map_multis->array[i].value);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(map_multis->size, length, sizeof(f_string_map_multi_t), (void **) & map_multis->array);
- if (F_status_is_error(status)) return status;
-
- map_multis->size = length;
-
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_map_multi_t), (void **) &map_multis->array, &map_multis->used, &map_multis->size);
}
#endif // !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source map_multis to append.
+ * The source destination to append.
* @param destination
* The destination map_multis the source is appended onto.
*
#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
f_status_t private_f_string_map_multiss_adjust(const f_number_unsigned_t length, f_string_map_multiss_t * const map_multiss) {
- if (map_multiss->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < map_multiss->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(map_multiss->size, length, sizeof(f_string_map_multis_t), (void **) & map_multiss->array);
- if (F_status_is_error(status)) return status;
-
- map_multiss->size = length;
-
- if (map_multiss->used > map_multiss->size) {
- map_multiss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_map_multis_t), (void **) &map_multiss->array, &map_multiss->used, &map_multiss->size);
}
#endif // !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
f_status_t private_f_string_map_multiss_resize(const f_number_unsigned_t length, f_string_map_multiss_t * const map_multiss) {
- if (map_multiss->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < map_multiss->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(map_multiss->size, length, sizeof(f_string_map_multis_t), (void **) & map_multiss->array);
- if (F_status_is_error(status)) return status;
-
- map_multiss->size = length;
-
- if (map_multiss->used > map_multiss->size) {
- map_multiss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_map_multis_t), (void **) &map_multiss->array, &map_multiss->used, &map_multiss->size);
}
#endif // !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
f_status_t private_f_string_maps_adjust(const f_number_unsigned_t length, f_string_maps_t * const maps) {
- if (maps->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < maps->size; ++i) {
- status = private_f_string_dynamic_adjust(0, &maps->array[i].name);
+ status = f_memory_array_adjust(0, sizeof(f_string_t), (void **) &maps->array[i].name.string, &maps->array[i].name.used, &maps->array[i].name.size);
if (F_status_is_error(status)) return status;
- status = private_f_string_dynamic_adjust(0, &maps->array[i].value);
+ status = f_memory_array_adjust(0, sizeof(f_string_t), (void **) &maps->array[i].value.string, &maps->array[i].value.used, &maps->array[i].value.size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(maps->size, length, sizeof(f_string_map_t), (void **) & maps->array);
- if (F_status_is_error(status)) return status;
-
- maps->size = length;
-
- if (maps->used > maps->size) {
- maps->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_map_t), (void **) &maps->array, &maps->used, &maps->size);
}
#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
#if !defined(_di_f_string_maps_append_) || !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_resize_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
f_status_t private_f_string_maps_resize(const f_number_unsigned_t length, f_string_maps_t * const maps) {
- if (maps->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < maps->size; ++i) {
- status = private_f_string_dynamic_resize(0, &maps->array[i].name);
+ status = f_memory_array_resize(0, sizeof(f_string_t), (void **) &maps->array[i].name.string, &maps->array[i].name.used, &maps->array[i].name.size);
if (F_status_is_error(status)) return status;
- status = private_f_string_dynamic_resize(0, &maps->array[i].value);
+ status = f_memory_array_resize(0, sizeof(f_string_t), (void **) &maps->array[i].value.string, &maps->array[i].value.used, &maps->array[i].value.size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(maps->size, length, sizeof(f_string_map_t), (void **) & maps->array);
- if (F_status_is_error(status)) return status;
-
- maps->size = length;
-
- if (maps->used > maps->size) {
- maps->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_map_t), (void **) &maps->array, &maps->used, &maps->size);
}
#endif // !defined(_di_f_string_maps_append_) || !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_resize_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
* Errors (with error bit) from: f_memory_adjust().
*
* @see f_memory_adjust()
+ *
* @see f_string_maps_adjust()
*/
#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source maps to append.
+ * The source destination to append.
* @param destination
* The destination maps the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*
* @see f_memory_resize()
+ *
* @see f_string_maps_append_all()
* @see f_string_mapss_append()
* @see f_string_mapss_append_all()
#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
f_status_t private_f_string_mapss_adjust(const f_number_unsigned_t length, f_string_mapss_t * const mapss) {
- if (mapss->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < mapss->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(mapss->size, length, sizeof(f_string_maps_t), (void **) & mapss->array);
- if (F_status_is_error(status)) return status;
-
- mapss->size = length;
-
- if (mapss->used > mapss->size) {
- mapss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_maps_t), (void **) &mapss->array, &mapss->used, &mapss->size);
}
#endif // !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
f_status_t private_f_string_mapss_resize(const f_number_unsigned_t length, f_string_mapss_t * const mapss) {
- if (mapss->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < mapss->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(mapss->size, length, sizeof(f_string_maps_t), (void **) & mapss->array);
- if (F_status_is_error(status)) return status;
-
- mapss->size = length;
-
- if (mapss->used > mapss->size) {
- mapss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_maps_t), (void **) &mapss->array, &mapss->used, &mapss->size);
}
#endif // !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_)
* Errors (with error bit) from: f_memory_adjust().
*
* @see f_memory_adjust()
+ *
* @see f_string_mapss_adjust()
*/
#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
* Errors (with error bit) from: f_memory_resize().
*
* @see f_memory_resize()
+ *
* @see f_string_mapss_decrease_by()
* @see f_string_mapss_increase()
* @see f_string_mapss_increase_by()
extern "C" {
#endif
-#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
- f_status_t private_f_string_quantitys_adjust(const f_number_unsigned_t length, f_string_quantitys_t * const quantitys) {
-
- if (quantitys->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_adjust(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array);
- if (F_status_is_error(status)) return status;
-
- quantitys->size = length;
-
- if (quantitys->used > quantitys->size) {
- quantitys->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
-
#if !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_append_all_)
f_status_t private_f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_string_quantitys_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_quantity_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_append_all_)
-#if !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_)
- f_status_t private_f_string_quantitys_resize(const f_number_unsigned_t length, f_string_quantitys_t * const quantitys) {
-
- if (quantitys->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_resize(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array);
- if (F_status_is_error(status)) return status;
-
- quantitys->size = length;
-
- if (quantitys->used > quantitys->size) {
- quantitys->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif
/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param quantitys
- * The quantitys to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_quantitys_adjust()
- */
-#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
- extern f_status_t private_f_string_quantitys_adjust(const f_number_unsigned_t length, f_string_quantitys_t * const quantitys) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
-
-/**
* Private implementation for appending.
*
* Intended to be shared to each of the different implementation variations.
* Errors (with error bit) from: f_memory_resize().
*
* @see f_memory_resize()
+ *
* @see f_string_quantitys_append_all()
* @see f_string_quantityss_append()
* @see f_string_quantityss_append_all()
extern f_status_t private_f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_append_all_)
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param quantitys
- * The quantitys to resize.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_quantitys_decrease_by()
- * @see f_string_quantitys_increase()
- * @see f_string_quantitys_increase_by()
- */
-#if !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_)
- extern f_status_t private_f_string_quantitys_resize(const f_number_unsigned_t length, f_string_quantitys_t * const quantitys) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
f_status_t private_f_string_quantityss_adjust(const f_number_unsigned_t length, f_string_quantityss_t * const quantityss) {
- if (quantityss->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < quantityss->size; ++i) {
- status = private_f_string_quantitys_adjust(0, &quantityss->array[i]);
+ status = f_memory_array_adjust(length, sizeof(f_string_quantitys_t), (void **) &quantityss->array[i].array, &quantityss->array[i].used, &quantityss->array[i].size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array);
- if (F_status_is_error(status)) return status;
-
- quantityss->size = length;
-
- if (quantityss->used > quantityss->size) {
- quantityss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_quantitys_t), (void **) &quantityss->array, &quantityss->used, &quantityss->size);
}
#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
#if !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_)
f_status_t private_f_string_quantityss_resize(const f_number_unsigned_t length, f_string_quantityss_t * const quantityss) {
- if (quantityss->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < quantityss->size; ++i) {
- status = private_f_string_quantitys_resize(0, &quantityss->array[i]);
+ status = f_memory_array_resize(0, sizeof(f_string_quantity_t), (void **) &quantityss->array[i].array, &quantityss->array[i].used, &quantityss->array[i].size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array);
- if (F_status_is_error(status)) return status;
-
- quantityss->size = length;
-
- if (quantityss->used > quantityss->size) {
- quantityss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_quantitys_t), (void **) &quantityss->array, &quantityss->used, &quantityss->size);
}
#endif // !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_)
* Errors (with error bit) from: f_memory_adjust().
*
* @see f_memory_adjust()
+ *
* @see f_string_quantityss_adjust()
*/
#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
* Errors (with error bit) from: f_memory_resize().
*
* @see f_memory_resize()
+ *
* @see f_string_quantityss_decrease_by()
* @see f_string_quantityss_increase()
* @see f_string_quantityss_increase_by()
extern "C" {
#endif
-#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
- f_status_t private_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const ranges) {
-
- if (ranges->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_adjust(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array);
- if (F_status_is_error(status)) return status;
-
- ranges->size = length;
-
- if (ranges->used > ranges->size) {
- ranges->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
-
#if !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
f_status_t private_f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination) {
if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_string_ranges_resize(destination->used + source.used, destination);
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_range_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
-#if !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
- f_status_t private_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const ranges) {
-
- if (ranges->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_resize(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array);
- if (F_status_is_error(status)) return status;
-
- ranges->size = length;
-
- if (ranges->used > ranges->size) {
- ranges->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif
/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param ranges
- * The ranges to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_string_ranges_adjust()
- */
-#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
- extern f_status_t private_f_string_ranges_adjust(const f_number_unsigned_t length, f_string_ranges_t * const ranges) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
-
-/**
* Private implementation for appending.
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param ranges
- * The ranges to resize.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_string_ranges_append()
- * @see f_string_ranges_append_all()
- * @see f_string_ranges_decrease_by()
- * @see f_string_ranges_increase()
- * @see f_string_ranges_increase_by()
- * @see f_string_ranges_resize()
- * @see f_string_rangess_append()
- * @see f_string_rangess_append_all()
- * @see f_string_rangess_decrease_by()
- * @see f_string_rangess_increase()
- * @see f_string_rangess_increase_by()
- */
-#if !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
- extern f_status_t private_f_string_ranges_resize(const f_number_unsigned_t length, f_string_ranges_t * const ranges) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
f_status_t private_f_string_rangess_adjust(const f_number_unsigned_t length, f_string_rangess_t * const rangess) {
- if (rangess->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
- status = private_f_string_ranges_adjust(0, &rangess->array[i]);
+ status = f_memory_array_adjust(0, sizeof(f_string_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array);
- if (F_status_is_error(status)) return status;
-
- rangess->size = length;
-
- if (rangess->used > rangess->size) {
- rangess->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_ranges_t), (void **) &rangess->array, &rangess->used, &rangess->size);
}
#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
#if !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
f_status_t private_f_string_rangess_resize(const f_number_unsigned_t length, f_string_rangess_t * const rangess) {
- if (rangess->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
- status = private_f_string_ranges_resize(0, &rangess->array[i]);
+ status = f_memory_array_resize(0, sizeof(f_string_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array);
- if (F_status_is_error(status)) return status;
-
- rangess->size = length;
-
- if (rangess->used > rangess->size) {
- rangess->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_ranges_t), (void **) &rangess->array, &rangess->used, &rangess->size);
}
#endif // !defined(_di_f_string_ranges_append_) || !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_resize_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_)
#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
f_status_t private_f_string_triples_adjust(const f_number_unsigned_t length, f_string_triples_t * const triples) {
- if (triples->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < triples->size; ++i) {
- status = private_f_string_dynamic_adjust(0, &triples->array[i].a);
+ status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &triples->array[i].a.string, &triples->array[i].a.used, &triples->array[i].a.size);
if (F_status_is_error(status)) return status;
- status = private_f_string_dynamic_adjust(0, &triples->array[i].b);
+ status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &triples->array[i].b.string, &triples->array[i].b.used, &triples->array[i].b.size);
if (F_status_is_error(status)) return status;
- status = private_f_string_dynamic_adjust(0, &triples->array[i].c);
+ status = f_memory_array_adjust(0, sizeof(f_string_triple_t), (void **) &triples->array[i].c.string, &triples->array[i].c.used, &triples->array[i].c.size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(triples->size, length, sizeof(f_string_triple_t), (void **) & triples->array);
- if (F_status_is_error(status)) return status;
-
- triples->size = length;
-
- if (triples->used > triples->size) {
- triples->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_triple_t), (void **) &triples->array, &triples->used, &triples->size);
}
#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
#if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_)
f_status_t private_f_string_triples_resize(const f_number_unsigned_t length, f_string_triples_t * const triples) {
- if (triples->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < triples->size; ++i) {
- status = private_f_string_dynamic_resize(0, &triples->array[i].a);
+ status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &triples->array[i].a.string, &triples->array[i].a.used, &triples->array[i].a.size);
if (F_status_is_error(status)) return status;
- status = private_f_string_dynamic_resize(0, &triples->array[i].b);
+ status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &triples->array[i].b.string, &triples->array[i].b.used, &triples->array[i].b.size);
if (F_status_is_error(status)) return status;
- status = private_f_string_dynamic_resize(0, &triples->array[i].c);
+ status = f_memory_array_resize(0, sizeof(f_string_triple_t), (void **) &triples->array[i].c.string, &triples->array[i].c.used, &triples->array[i].c.size);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(triples->size, length, sizeof(f_string_triple_t), (void **) & triples->array);
- if (F_status_is_error(status)) return status;
-
- triples->size = length;
-
- if (triples->used > triples->size) {
- triples->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_triple_t), (void **) &triples->array, &triples->used, &triples->size);
}
#endif // !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source triples to append.
+ * The source destination to append.
* @param destination
* The destination triples the source is appended onto.
*
#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
f_status_t private_f_string_tripless_adjust(const f_number_unsigned_t length, f_string_tripless_t * const tripless) {
- if (tripless->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < tripless->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(tripless->size, length, sizeof(f_string_triples_t), (void **) & tripless->array);
- if (F_status_is_error(status)) return status;
-
- tripless->size = length;
-
- if (tripless->used > tripless->size) {
- tripless->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_string_triples_t), (void **) &tripless->array, &tripless->used, &tripless->size);
}
#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
f_status_t private_f_string_tripless_resize(const f_number_unsigned_t length, f_string_tripless_t * const tripless) {
- if (tripless->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
f_status_t status = F_none;
for (f_number_unsigned_t i = length; i < tripless->size; ++i) {
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(tripless->size, length, sizeof(f_string_triples_t), (void **) & tripless->array);
- if (F_status_is_error(status)) return status;
-
- tripless->size = length;
-
- if (tripless->used > tripless->size) {
- tripless->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_string_triples_t), (void **) &tripless->array, &tripless->used, &tripless->size);
}
#endif // !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_)
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_string_quantitys_adjust(length, quantitys);
+ return f_memory_array_adjust(length, sizeof(f_string_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
}
#endif // _di_f_string_quantitys_adjust_
#endif // _di_level_0_parameter_checking_
if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_string_quantitys_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_quantity_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (quantitys->size > amount) {
- return private_f_string_quantitys_adjust(quantitys->size - amount, quantitys);
- }
-
- return private_f_string_quantitys_adjust(0, quantitys);
+ return f_memory_array_decimate_by(amount, sizeof(f_string_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
}
#endif // _di_f_string_quantitys_decimate_by_
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (quantitys->size > amount) {
- return private_f_string_quantitys_resize(quantitys->size - amount, quantitys);
- }
- return private_f_string_quantitys_resize(0, quantitys);
+ return f_memory_array_decrease_by(amount, sizeof(f_string_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
}
#endif // _di_f_string_quantitys_decrease_by_
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && quantitys->used + 1 > quantitys->size) {
- f_number_unsigned_t size = quantitys->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (quantitys->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_string_quantitys_resize(size, quantitys);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_string_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
}
#endif // _di_f_string_quantitys_increase_
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (amount) {
- if (quantitys->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- const f_number_unsigned_t length = quantitys->used + amount;
-
- if (length > quantitys->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_string_quantitys_resize(length, quantitys);
- }
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_string_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
}
#endif // _di_f_string_quantitys_increase_by_
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_string_quantitys_resize(length, quantitys);
+ return f_memory_array_resize(length, sizeof(f_string_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
}
#endif // _di_f_string_quantitys_resize_
if (!amount) return F_data_not;
- if (quantityss->size > amount) {
- return private_f_string_quantityss_adjust(quantityss->size - amount, quantityss);
- }
-
- return private_f_string_quantityss_adjust(0, quantityss);
+ return private_f_string_quantityss_adjust((quantityss->size > amount) ? quantityss->size - amount : 0, quantityss);
}
#endif // _di_f_string_quantityss_decimate_by_
if (!amount) return F_data_not;
- if (quantityss->size > amount) {
- return private_f_string_quantityss_resize(quantityss->size - amount, quantityss);
- }
-
- return private_f_string_quantityss_resize(0, quantityss);
+ return private_f_string_quantityss_resize((quantityss->size > amount) ? quantityss->size - amount : 0, quantityss);
}
#endif // _di_f_string_quantityss_decrease_by_
f_number_unsigned_t size = quantityss->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (quantityss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (quantityss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_string_ranges_adjust(length, ranges);
+ return f_memory_array_adjust(length, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
}
#endif // _di_f_string_ranges_adjust_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_string_ranges_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_range_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
if (!source.used) return F_data_not;
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_string_ranges_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_string_range_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
if (!amount) return F_data_not;
- if (ranges->size > amount) {
- return private_f_string_ranges_adjust(ranges->size - amount, ranges);
- }
-
- return private_f_string_ranges_adjust(0, ranges);
+ return f_memory_array_decimate_by(amount, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
}
#endif // _di_f_string_ranges_decimate_by_
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (ranges->size > amount) {
- return private_f_string_ranges_resize(ranges->size - amount, ranges);
- }
-
- return private_f_string_ranges_resize(0, ranges);
+ return f_memory_array_decrease_by(amount, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
}
#endif // _di_f_string_ranges_decrease_by_
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && ranges->used + 1 > ranges->size) {
- f_number_unsigned_t size = ranges->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (ranges->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_string_ranges_resize(size, ranges);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
}
#endif // _di_f_string_ranges_increase_
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (amount) {
- if (ranges->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- const f_number_unsigned_t length = ranges->used + amount;
-
- if (length > ranges->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_string_ranges_resize(length, ranges);
- }
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
}
#endif // _di_f_string_ranges_increase_by_
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_string_ranges_resize(length, ranges);
+ return f_memory_array_resize(length, sizeof(f_string_range_t), (void **) &ranges->array, &ranges->used, &ranges->size);
}
#endif // _di_f_string_ranges_resize_
if (!amount) return F_data_not;
- if (rangess->size > amount) {
- return private_f_string_rangess_adjust(rangess->size - amount, rangess);
- }
-
- return private_f_string_rangess_adjust(0, rangess);
+ return private_f_string_rangess_adjust((rangess->size > amount) ? rangess->size - amount : 0, rangess);
}
#endif // _di_f_string_rangess_decimate_by_
if (!amount) return F_data_not;
- if (rangess->size > amount) {
- return private_f_string_rangess_resize(rangess->size - amount, rangess);
- }
-
- return private_f_string_rangess_resize(0, rangess);
+ return private_f_string_rangess_resize((rangess->size > amount) ? rangess->size - amount : 0, rangess);
}
#endif // _di_f_string_rangess_decrease_by_
f_number_unsigned_t size = rangess->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (rangess->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (rangess->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (triples->size > amount) {
- return private_f_string_triples_adjust(triples->size - amount, triples);
- }
+ if (!amount) return F_data_not;
- return private_f_string_triples_adjust(0, triples);
+ return private_f_string_triples_adjust((triples->size > amount) ? triples->size - amount : 0, triples);
}
#endif // _di_f_string_triples_decimate_by_
if (!amount) return F_data_not;
- if (triples->size > amount) {
- return private_f_string_triples_resize(triples->size - amount, triples);
- }
-
- return private_f_string_triples_resize(0, triples);
+ return private_f_string_triples_resize((triples->size > amount) ? triples->size - amount : 0, triples);
}
#endif // _di_f_string_triples_decrease_by_
f_number_unsigned_t size = triples->used + F_memory_default_allocation_small_d;
if (size > F_number_t_size_unsigned_d) {
- if (triples->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (triples->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
if (!amount) return F_data_not;
- if (tripless->size > amount) {
- return private_f_string_tripless_adjust(tripless->size - amount, tripless);
- }
-
- return private_f_string_tripless_adjust(0, tripless);
+ return private_f_string_tripless_adjust((tripless->size > amount) ? tripless->size - amount : 0, tripless);
}
#endif // _di_f_string_tripless_decimate_by_
if (!amount) return F_data_not;
- if (tripless->size > amount) {
- return private_f_string_tripless_resize(tripless->size - amount, tripless);
- }
-
- return private_f_string_tripless_resize(0, tripless);
+ return private_f_string_tripless_resize((tripless->size > amount) ? tripless->size - amount : 0, tripless);
}
#endif // _di_f_string_tripless_decrease_by_
f_number_unsigned_t size = tripless->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (tripless->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (tripless->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
+++ /dev/null
-#include "thread.h"
-#include "private-thread.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
- f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *attribute) {
-
- if (pthread_attr_destroy(attribute)) {
- return F_status_set_error(F_failure);
- }
-
- attribute = 0;
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
-
-#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
- f_status_t private_f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(attributes->size, length, sizeof(f_thread_attribute_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
-
-#if !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
- f_status_t private_f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(attributes->size, length, sizeof(f_thread_attribute_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
-
-#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
- f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) {
-
- const int error = pthread_barrier_destroy(barrier);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- barrier = 0;
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
-
-#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
- f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < barriers->size; ++i) {
-
- status = private_f_thread_barrier_delete(&barriers->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(barriers->size, length, sizeof(f_thread_barrier_t), (void **) & barriers->array);
- if (F_status_is_error(status)) return status;
-
- barriers->size = length;
-
- if (barriers->used > barriers->size) {
- barriers->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
-
-#if !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
- f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < barriers->size; ++i) {
-
- status = private_f_thread_barrier_delete(&barriers->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(barriers->size, length, sizeof(f_thread_barrier_t), (void **) & barriers->array);
- if (F_status_is_error(status)) return status;
-
- barriers->size = length;
-
- if (barriers->used > barriers->size) {
- barriers->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
-
-#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
- f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) {
-
- if (pthread_barrierattr_destroy(attribute)) {
- return F_status_set_error(F_failure);
- }
-
- attribute = 0;
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
-
-#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
- f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_barrier_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(attributes->size, length, sizeof(f_thread_barrier_attribute_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
-
-#if !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
- f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_barrier_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(attributes->size, length, sizeof(f_thread_barrier_attribute_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
-
-#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
- f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t * const attribute) {
-
- const int error = pthread_condattr_destroy(attribute);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
-
-#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
- f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_condition_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(attributes->size, length, sizeof(f_thread_condition_attribute_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
-
-#if !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
- f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_condition_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(attributes->size, length, sizeof(f_thread_condition_attribute_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
-
-#if !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
- f_status_t private_f_thread_condition_delete(f_thread_condition_t *condition) {
-
- const int error = pthread_cond_destroy(condition);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
-
-#if !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
- f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < conditions->size; ++i) {
-
- status = private_f_thread_condition_delete(&conditions->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(conditions->size, length, sizeof(f_thread_condition_t), (void **) & conditions->array);
- if (F_status_is_error(status)) return status;
-
- conditions->size = length;
-
- if (conditions->used > conditions->size) {
- conditions->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
-
-#if !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
- f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < conditions->size; ++i) {
-
- status = private_f_thread_condition_delete(&conditions->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(conditions->size, length, sizeof(f_thread_condition_t), (void **) & conditions->array);
- if (F_status_is_error(status)) return status;
-
- conditions->size = length;
-
- if (conditions->used > conditions->size) {
- conditions->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
-
-#if !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
- f_status_t private_f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < ids->size; ++i) {
- memset(&ids->array[i], 0, sizeof(f_thread_id_t));
- } // for
-
- status = f_memory_adjust(ids->size, length, sizeof(f_thread_id_t), (void **) & ids->array);
- if (F_status_is_error(status)) return status;
-
- ids->size = length;
-
- if (ids->used > ids->size) {
- ids->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
-
-#if !defined(_di_f_thread_ids_decrease_) || !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
- f_status_t private_f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
-
- const f_status_t status = f_memory_resize(ids->size, length, sizeof(f_thread_id_t), (void **) & ids->array);
- if (F_status_is_error(status)) return status;
-
- ids->size = length;
-
- if (ids->used > ids->size) {
- ids->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_ids_decrease_) || !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
-
-#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
- f_status_t private_f_thread_key_delete(f_thread_key_t *key) {
-
- if (pthread_key_delete(*key)) {
- return F_status_set_error(F_failure);
- }
-
- *key = 0;
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
-
-#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
- f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < keys->size; ++i) {
-
- status = private_f_thread_key_delete(&keys->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(keys->size, length, sizeof(f_thread_key_t), (void **) & keys->array);
- if (F_status_is_error(status)) return status;
-
- keys->size = length;
-
- if (keys->used > keys->size) {
- keys->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
-
-#if !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
- f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < keys->size; ++i) {
-
- status = private_f_thread_key_delete(&keys->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(keys->size, length, sizeof(f_thread_key_t), (void **) & keys->array);
- if (F_status_is_error(status)) return status;
-
- keys->size = length;
-
- if (keys->used > keys->size) {
- keys->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
-
-#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
- f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *attribute) {
-
- const int error = pthread_rwlockattr_destroy(attribute);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
-
-#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
- f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_lock_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(attributes->size, length, sizeof(f_thread_lock_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
-
-#if !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
- f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_lock_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(attributes->size, length, sizeof(f_thread_lock_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
-
-#if !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
- f_status_t private_f_thread_lock_delete(f_thread_lock_t *lock) {
-
- const int error = pthread_rwlock_destroy(lock);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
-
-#if !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
- f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < locks->size; ++i) {
-
- status = private_f_thread_lock_delete(&locks->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(locks->size, length, sizeof(f_thread_lock_t), (void **) & locks->array);
- if (F_status_is_error(status)) return status;
-
- locks->size = length;
-
- if (locks->used > locks->size) {
- locks->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
-
-#if !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
- f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < locks->size; ++i) {
-
- status = private_f_thread_lock_delete(&locks->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(locks->size, length, sizeof(f_thread_lock_t), (void **) & locks->array);
- if (F_status_is_error(status)) return status;
-
- locks->size = length;
-
- if (locks->used > locks->size) {
- locks->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
-
-#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
- f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *attribute) {
-
- const int error = pthread_mutexattr_destroy(attribute);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
-
-#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
- f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_mutex_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(attributes->size, length, sizeof(f_thread_mutex_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
-
-#if !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
- f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
-
- status = private_f_thread_mutex_attribute_delete(&attributes->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(attributes->size, length, sizeof(f_thread_mutex_t), (void **) & attributes->array);
- if (F_status_is_error(status)) return status;
-
- attributes->size = length;
-
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
-
-
-#if !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
- f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *mutex) {
-
- const int error = pthread_mutex_destroy(mutex);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
-
-#if !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
- f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < mutexs->size; ++i) {
-
- status = private_f_thread_mutex_delete(&mutexs->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(mutexs->size, length, sizeof(f_thread_mutex_t), (void **) & mutexs->array);
- if (F_status_is_error(status)) return status;
-
- mutexs->size = length;
-
- if (mutexs->used > mutexs->size) {
- mutexs->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
-
-#if !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
- f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < mutexs->size; ++i) {
-
- status = private_f_thread_mutex_delete(&mutexs->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(mutexs->size, length, sizeof(f_thread_mutex_t), (void **) & mutexs->array);
- if (F_status_is_error(status)) return status;
-
- mutexs->size = length;
-
- if (mutexs->used > mutexs->size) {
- mutexs->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
-
-#if !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
- f_status_t private_f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
-
- for (f_number_unsigned_t i = length; i < onces->size; ++i) {
- memset(&onces->array[i], 0, sizeof(f_thread_once_t));
- } // for
-
- const f_status_t status = f_memory_adjust(onces->size, length, sizeof(f_thread_once_t), (void **) & onces->array);
- if (F_status_is_error(status)) return status;
-
- onces->size = length;
-
- if (onces->used > onces->size) {
- onces->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
-
-#if !defined(_di_f_thread_onces_decrease_) || !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
- f_status_t private_f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
-
- f_status_t status = F_none;
-
- status = f_memory_resize(onces->size, length, sizeof(f_thread_once_t), (void **) & onces->array);
- if (F_status_is_error(status)) return status;
-
- onces->size = length;
-
- if (onces->used > onces->size) {
- onces->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_onces_decrease_) || !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
-
-#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
- f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *semaphore) {
-
- const int result = sem_destroy(semaphore);
-
- if (result == -1) {
- if (errno == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
-
-#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
- f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < semaphores->size; ++i) {
-
- status = private_f_thread_semaphore_delete(&semaphores->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(semaphores->size, length, sizeof(f_thread_semaphore_t), (void **) & semaphores->array);
-
- if (F_status_is_error_not(status)) {
- semaphores->size = length;
-
- if (semaphores->used > semaphores->size) {
- semaphores->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
-
-#if !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
- f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < semaphores->size; ++i) {
-
- status = private_f_thread_semaphore_delete(&semaphores->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(semaphores->size, length, sizeof(f_thread_semaphore_t), (void **) & semaphores->array);
- if (F_status_is_error(status)) return status;
-
- semaphores->size = length;
-
- if (semaphores->used > semaphores->size) {
- semaphores->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
-
-#if !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
- f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < sets->size; ++i) {
-
- status = private_f_thread_attribute_delete(&sets->array[i].attribute);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(sets->size, length, sizeof(f_thread_set_t), (void **) & sets->array);
- if (F_status_is_error(status)) return status;
-
- sets->size = length;
-
- if (sets->used > sets->size) {
- sets->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
-
-#if !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
- f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < sets->size; ++i) {
-
- status = private_f_thread_attribute_delete(&sets->array[i].attribute);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(sets->size, length, sizeof(f_thread_set_t), (void **) & sets->array);
- if (F_status_is_error(status)) return status;
-
- sets->size = length;
-
- if (sets->used > sets->size) {
- sets->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
-
-#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
- f_status_t private_f_thread_spin_delete(f_thread_spin_t *spin) {
-
- const int error = pthread_spin_destroy(spin);
-
- if (error) {
- if (error == EBUSY) return F_status_set_error(F_busy);
- if (error == EINVAL) return F_status_set_error(F_parameter);
-
- return F_status_set_error(F_failure);
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
-
-#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
- f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < spins->size; ++i) {
-
- status = private_f_thread_spin_delete(&spins->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(spins->size, length, sizeof(f_thread_spin_t), (void **) & spins->array);
- if (F_status_is_error(status)) return status;
-
- spins->size = length;
-
- if (spins->used > spins->size) {
- spins->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
-
-#if !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
- f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
-
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < spins->size; ++i) {
-
- status = private_f_thread_spin_delete(&spins->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(spins->size, length, sizeof(f_thread_spin_t), (void **) & spins->array);
- if (F_status_is_error(status)) return status;
-
- spins->size = length;
-
- if (spins->used > spins->size) {
- spins->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_thread_h
-#define _PRIVATE_F_thread_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_attr_destroy()
- *
- * @see f_thread_attributes_adjust()
- * @see f_thread_attributes_decimate_by()
- * @see f_thread_attributes_decrease()
- * @see f_thread_attributes_decrease_by()
- * @see f_thread_attributes_increase()
- * @see f_thread_attributes_increase_by()
- * @see f_thread_attributes_resize()
- * @see f_thread_sets_adjust()
- * @see f_thread_sets_decimate_by()
- * @see f_thread_sets_decrease()
- * @see f_thread_sets_decrease_by()
- * @see f_thread_sets_increase()
- * @see f_thread_sets_increase_by()
- * @see f_thread_sets_resize()
- */
-#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
- extern f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *attribute) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_attributes_adjust()
- * @see f_thread_attributes_decimate_by()
- */
-#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
- extern f_status_t private_f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_attributes_decrease_by()
- * @see f_thread_attributes_increase()
- * @see f_thread_attributes_increase_by()
- */
-#if !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
- extern f_status_t private_f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param barriers
- * The barriers to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_attr_destroy()
- *
- * @see f_thread_barriers_adjust()
- * @see f_thread_barriers_decimate_by()
- * @see f_thread_barriers_decrease()
- * @see f_thread_barriers_decrease_by()
- * @see f_thread_barriers_increase()
- * @see f_thread_barriers_increase_by()
- * @see f_thread_barriers_resize()
- */
-#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
- extern f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param barriers
- * The barriers to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_barriers_adjust()
- * @see f_thread_barriers_decimate_by()
- */
-#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
- extern f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param barriers
- * The barriers to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_barriers_decrease_by()
- * @see f_thread_barriers_increase()
- * @see f_thread_barriers_increase_by()
- */
-#if !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
- extern f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_attr_destroy()
- *
- * @see f_thread_barrier_attributes_adjust()
- * @see f_thread_barrier_attributes_decimate_by()
- * @see f_thread_barrier_attributes_decrease()
- * @see f_thread_barrier_attributes_decrease_by()
- * @see f_thread_barrier_attributes_increase()
- * @see f_thread_barrier_attributes_increase_by()
- * @see f_thread_barrier_attributes_resize()
- */
-#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
- extern f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_barrier_attributes_adjust()
- * @see f_thread_barrier_attributes_decimate_by()
- */
-#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
- extern f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_barrier_attributes_decrease_by()
- * @see f_thread_barrier_attributes_increase()
- * @see f_thread_barrier_attributes_increase_by()
- */
-#if !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
- extern f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attribute
- * The attribute to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_condattr_destroy()
- *
- * @see f_thread_condition_attributes_adjust()
- * @see f_thread_condition_attributes_decimate_by()
- * @see f_thread_condition_attributes_decrease()
- * @see f_thread_condition_attributes_decrease_by()
- * @see f_thread_condition_attributes_increase()
- * @see f_thread_condition_attributes_increase_by()
- * @see f_thread_condition_attributes_resize()
- */
-#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
- extern f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t *attribute) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_condition_attributes_adjust()
- * @see f_thread_condition_attributes_decimate_by()
- */
-#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
- extern f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_condition_attributes_decrease_by()
- * @see f_thread_condition_attributes_increase()
- * @see f_thread_condition_attributes_increase_by()
- */
-#if !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
- extern f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param conditions
- * The conditions to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_cond_destroy()
- *
- * @see f_thread_condition_delete()
- * @see f_thread_conditions_adjust()
- * @see f_thread_conditions_decimate_by()
- * @see f_thread_conditions_decrease()
- * @see f_thread_conditions_decrease_by()
- * @see f_thread_conditions_increase()
- * @see f_thread_conditions_increase_by()
- * @see f_thread_conditions_resize()
- */
-#if !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
- extern f_status_t private_f_thread_condition_delete(f_thread_condition_t *condition) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param conditions
- * The conditions to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_conditions_adjust()
- * @see f_thread_conditions_decimate_by()
- */
-#if !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
- extern f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param conditions
- * The conditions to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_conditions_decrease_by()
- * @see f_thread_conditions_increase()
- * @see f_thread_conditions_increase_by()
- */
-#if !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
- extern f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param ids
- * The ids to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_ids_adjust()
- * @see f_thread_ids_decimate_by()
- */
-#if !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
- extern f_status_t private_f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param ids
- * The ids to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_ids_decrease_by()
- * @see f_thread_ids_increase()
- * @see f_thread_ids_increase_by()
- */
-#if !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
- extern f_status_t private_f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param key
- * The keys to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_key_destroy()
- *
- * @see f_thread_keys_adjust()
- * @see f_thread_keys_decimate_by()
- * @see f_thread_keys_decrease()
- * @see f_thread_keys_decrease_by()
- * @see f_thread_keys_increase()
- * @see f_thread_keys_increase_by()
- * @see f_thread_keys_resize()
- */
-#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
- extern f_status_t private_f_thread_key_delete(f_thread_key_t *key) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param keys
- * The keys to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_keys_adjust()
- * @see f_thread_keys_decimate_by()
- */
-#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
- extern f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param keys
- * The keys to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_keys_decrease_by()
- * @see f_thread_keys_increase()
- * @see f_thread_keys_increase_by()
- */
-#if !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
- extern f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param attribute
- * The attribute to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_rwlockattr_destroy()
- *
- * @see f_thread_lock_attributes_adjust()
- * @see f_thread_lock_attributes_decimate_by()
- * @see f_thread_lock_attributes_decrease()
- * @see f_thread_lock_attributes_decrease_by()
- * @see f_thread_lock_attributes_increase()
- * @see f_thread_lock_attributes_increase_by()
- * @see f_thread_lock_attributes_resize()
- */
-#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
- extern f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *attribute) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_lock_attributes_adjust()
- * @see f_thread_lock_attributes_decimate_by()
- */
-#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
- extern f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_lock_attributes_decrease_by()
- * @see f_thread_lock_attributes_increase()
- * @see f_thread_lock_attributes_increase_by()
- */
-#if !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
- extern f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param lock
- * The locks to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_rwlock_destroy()
- *
- * @see f_thread_lock_delete()
- * @see f_thread_locks_adjust()
- * @see f_thread_locks_decimate_by()
- * @see f_thread_locks_decrease()
- * @see f_thread_locks_decrease_by()
- * @see f_thread_locks_increase()
- * @see f_thread_locks_increase_by()
- * @see f_thread_locks_resize()
- */
-#if !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
- extern f_status_t private_f_thread_lock_delete(f_thread_lock_t *lock) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param locks
- * The locks to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_locks_adjust()
- * @see f_thread_locks_decimate_by()
- */
-#if !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
- extern f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param locks
- * The locks to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_locks_decrease_by()
- * @see f_thread_locks_increase()
- * @see f_thread_locks_increase_by()
- */
-#if !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
- extern f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param attribute
- * The attribute to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_mutexattr_destroy()
- *
- * @see f_thread_mutex_attributes_adjust()
- * @see f_thread_mutex_attributes_decimate_by()
- * @see f_thread_mutex_attributes_decrease()
- * @see f_thread_mutex_attributes_decrease_by()
- * @see f_thread_mutex_attributes_increase()
- * @see f_thread_mutex_attributes_increase_by()
- * @see f_thread_mutex_attributes_resize()
- */
-#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
- extern f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *attribute) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_mutex_attributes_adjust()
- * @see f_thread_mutex_attributes_decimate_by()
- */
-#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
- extern f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param attributes
- * The attributes to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_mutex_attributes_decrease_by()
- * @see f_thread_mutex_attributes_increase()
- * @see f_thread_mutex_attributes_increase_by()
- */
-#if !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
- extern f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param mutex
- * The mutexs to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_mutex_destroy()
- *
- * @see f_thread_mutex_delete()
- * @see f_thread_mutexs_adjust()
- * @see f_thread_mutexs_decimate_by()
- * @see f_thread_mutexs_decrease()
- * @see f_thread_mutexs_decrease_by()
- * @see f_thread_mutexs_increase()
- * @see f_thread_mutexs_increase_by()
- * @see f_thread_mutexs_resize()
- */
-#if !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
- extern f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *mutex) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param mutexs
- * The mutexs to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_mutexs_adjust()
- * @see f_thread_mutexs_decimate_by()
- */
-#if !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
- extern f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param mutexs
- * The mutexs to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_mutexs_decrease_by()
- * @see f_thread_mutexs_increase()
- * @see f_thread_mutexs_increase_by()
- */
-#if !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
- extern f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param onces
- * The onces to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_onces_adjust()
- * @see f_thread_onces_decimate_by()
- */
-#if !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
- extern f_status_t private_f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param onces
- * The onces to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_onces_decrease_by()
- * @see f_thread_onces_increase()
- * @see f_thread_onces_increase_by()
- */
-#if !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
- extern f_status_t private_f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param semaphore
- * The semaphores to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see sem_destroy()
- *
- * @see f_thread_semaphores_adjust()
- * @see f_thread_semaphores_decimate_by()
- * @see f_thread_semaphores_decrease()
- * @see f_thread_semaphores_decrease_by()
- * @see f_thread_semaphores_increase()
- * @see f_thread_semaphores_increase_by()
- * @see f_thread_semaphores_resize()
- */
-#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
- extern f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *semaphore) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param semaphores
- * The semaphores to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_semaphores_adjust()
- * @see f_thread_semaphores_decimate_by()
- */
-#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
- extern f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param semaphores
- * The semaphores to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_semaphores_decrease_by()
- * @see f_thread_semaphores_increase()
- * @see f_thread_semaphores_increase_by()
- */
-#if !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
- extern f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param sets
- * The sets to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_sets_adjust()
- * @see f_thread_sets_decimate_by()
- */
-#if !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
- extern f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param sets
- * The sets to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_sets_decrease_by()
- * @see f_thread_sets_increase()
- * @see f_thread_sets_increase_by()
- */
-#if !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
- extern f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
-
-/**
- * Private implementation for deleting (and destroying).
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param spin
- * The spins to delete.
- *
- * @return
- * F_none on success.
- *
- * F_busy (with error bit) if the lock is busy.
- * F_failure (with error bit) on error.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * @see pthread_spin_destroy()
- *
- * @see f_thread_spins_adjust()
- * @see f_thread_spins_decimate_by()
- * @see f_thread_spins_decrease()
- * @see f_thread_spins_decrease_by()
- * @see f_thread_spins_increase()
- * @see f_thread_spins_increase_by()
- * @see f_thread_spins_resize()
- */
-#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
- extern f_status_t private_f_thread_spin_delete(f_thread_spin_t *spin) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param spins
- * The spins to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_spins_adjust()
- * @see f_thread_spins_decimate_by()
- */
-#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
- extern f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param spins
- * The spins to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_spins_decrease_by()
- * @see f_thread_spins_increase()
- * @see f_thread_spins_increase_by()
- */
-#if !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
- extern f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_thread_h
#include "thread.h"
-#include "private-thread.h"
+#include "thread/private-attribute.h"
+#include "thread/private-barrier_attribute.h"
+#include "thread/private-condition.h"
+#include "thread/private-condition_attribute.h"
+#include "thread/private-key.h"
+#include "thread/private-lock.h"
+#include "thread/private-lock_attribute.h"
+#include "thread/private-mutex.h"
+#include "thread/private-mutex_attribute.h"
+#include "thread/private-semaphore.h"
+#include "thread/private-spin.h"
#ifdef __cplusplus
extern "C" {
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-attribute.h"
#include "attribute.h"
#ifdef __cplusplus
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_attributes_adjust(attributes->size - amount, attributes);
- }
-
- return private_f_thread_attributes_adjust(0, attributes);
+ return private_f_thread_attributes_adjust((attributes->size > amount) ? attributes->size - amount : 0, attributes);
}
#endif // _di_f_thread_attributes_decimate_by_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_attributes_resize(attributes->size - amount, attributes);
- }
-
- return private_f_thread_attributes_resize(0, attributes);
+ return private_f_thread_attributes_resize((attributes->size > amount) ? attributes->size - amount : 0, attributes);
}
#endif // _di_f_thread_attributes_decrease_by_
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-barrier.h"
#include "barrier.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-barrier_attribute.h"
#include "barrier_attribute.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-condition.h"
#include "condition.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-condition_attribute.h"
#include "condition_attribute.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-id.h"
#include "id.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-key.h"
#include "key.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-lock.h"
#include "lock.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-lock_attribute.h"
#include "lock_attribute.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-mutex.h"
#include "mutex.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-mutex_attribute.h"
#include "mutex_attribute.h"
#ifdef __cplusplus
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-once.h"
#include "once.h"
#ifdef __cplusplus
--- /dev/null
+#include "../thread.h"
+#include "private-attribute.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
+ f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *attribute) {
+
+ if (pthread_attr_destroy(attribute)) return F_status_set_error(F_failure);
+
+ attribute = 0;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
+
+#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
+ f_status_t private_f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
+
+#if !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
+ f_status_t private_f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_attribute_h
+#define _PRIVATE_F_thread_attribute_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_attr_destroy()
+ *
+ * @see f_thread_attributes_adjust()
+ * @see f_thread_attributes_decimate_by()
+ * @see f_thread_attributes_decrease()
+ * @see f_thread_attributes_decrease_by()
+ * @see f_thread_attributes_increase()
+ * @see f_thread_attributes_increase_by()
+ * @see f_thread_attributes_resize()
+ * @see f_thread_sets_adjust()
+ * @see f_thread_sets_decimate_by()
+ * @see f_thread_sets_decrease()
+ * @see f_thread_sets_decrease_by()
+ * @see f_thread_sets_increase()
+ * @see f_thread_sets_increase_by()
+ * @see f_thread_sets_resize()
+ */
+#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
+ extern f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_attributes_adjust()
+ * @see f_thread_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
+ extern f_status_t private_f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_attributes_decrease_by()
+ * @see f_thread_attributes_increase()
+ * @see f_thread_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
+ extern f_status_t private_f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param barriers
+ * The barriers to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_attr_destroy()
+ *
+ * @see f_thread_barriers_adjust()
+ * @see f_thread_barriers_decimate_by()
+ * @see f_thread_barriers_decrease()
+ * @see f_thread_barriers_decrease_by()
+ * @see f_thread_barriers_increase()
+ * @see f_thread_barriers_increase_by()
+ * @see f_thread_barriers_resize()
+ */
+#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
+ extern f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param barriers
+ * The barriers to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_barriers_adjust()
+ * @see f_thread_barriers_decimate_by()
+ */
+#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
+ extern f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param barriers
+ * The barriers to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_barriers_decrease_by()
+ * @see f_thread_barriers_increase()
+ * @see f_thread_barriers_increase_by()
+ */
+#if !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
+ extern f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_attr_destroy()
+ *
+ * @see f_thread_barrier_attributes_adjust()
+ * @see f_thread_barrier_attributes_decimate_by()
+ * @see f_thread_barrier_attributes_decrease()
+ * @see f_thread_barrier_attributes_decrease_by()
+ * @see f_thread_barrier_attributes_increase()
+ * @see f_thread_barrier_attributes_increase_by()
+ * @see f_thread_barrier_attributes_resize()
+ */
+#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
+ extern f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_barrier_attributes_adjust()
+ * @see f_thread_barrier_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
+ extern f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_barrier_attributes_decrease_by()
+ * @see f_thread_barrier_attributes_increase()
+ * @see f_thread_barrier_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
+ extern f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attribute
+ * The attribute to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_condattr_destroy()
+ *
+ * @see f_thread_condition_attributes_adjust()
+ * @see f_thread_condition_attributes_decimate_by()
+ * @see f_thread_condition_attributes_decrease()
+ * @see f_thread_condition_attributes_decrease_by()
+ * @see f_thread_condition_attributes_increase()
+ * @see f_thread_condition_attributes_increase_by()
+ * @see f_thread_condition_attributes_resize()
+ */
+#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
+ extern f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_condition_attributes_adjust()
+ * @see f_thread_condition_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
+ extern f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_condition_attributes_decrease_by()
+ * @see f_thread_condition_attributes_increase()
+ * @see f_thread_condition_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
+ extern f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_attribute_h
--- /dev/null
+#include "../thread.h"
+#include "private-barrier.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
+ f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) {
+
+ const int error = pthread_barrier_destroy(barrier);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ barrier = 0;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
+
+#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
+ f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < barriers->size; ++i) {
+
+ status = private_f_thread_barrier_delete(&barriers->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_barrier_t), (void **) &barriers->array, &barriers->used, &barriers->size);
+ }
+#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
+
+#if !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
+ f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < barriers->size; ++i) {
+
+ status = private_f_thread_barrier_delete(&barriers->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &barriers->array, &barriers->used, &barriers->size);
+ }
+#endif // !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_barrier_h
+#define _PRIVATE_F_thread_barrier_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param barriers
+ * The barriers to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_attr_destroy()
+ *
+ * @see f_thread_barriers_adjust()
+ * @see f_thread_barriers_decimate_by()
+ * @see f_thread_barriers_decrease()
+ * @see f_thread_barriers_decrease_by()
+ * @see f_thread_barriers_increase()
+ * @see f_thread_barriers_increase_by()
+ * @see f_thread_barriers_resize()
+ */
+#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
+ extern f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param barriers
+ * The barriers to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_barriers_adjust()
+ * @see f_thread_barriers_decimate_by()
+ */
+#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
+ extern f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param barriers
+ * The barriers to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_barriers_decrease_by()
+ * @see f_thread_barriers_increase()
+ * @see f_thread_barriers_increase_by()
+ */
+#if !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
+ extern f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_barrier_h
--- /dev/null
+#include "../thread.h"
+#include "private-barrier_attribute.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
+ f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) {
+
+ if (pthread_barrierattr_destroy(attribute)) return F_status_set_error(F_failure);
+
+ attribute = 0;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
+
+#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
+ f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_barrier_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_barrier_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
+
+#if !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
+ f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_barrier_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_barrier_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_barrier_attribute_h
+#define _PRIVATE_F_thread_barrier_attribute_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_attr_destroy()
+ *
+ * @see f_thread_barrier_attributes_adjust()
+ * @see f_thread_barrier_attributes_decimate_by()
+ * @see f_thread_barrier_attributes_decrease()
+ * @see f_thread_barrier_attributes_decrease_by()
+ * @see f_thread_barrier_attributes_increase()
+ * @see f_thread_barrier_attributes_increase_by()
+ * @see f_thread_barrier_attributes_resize()
+ */
+#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
+ extern f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_barrier_attributes_adjust()
+ * @see f_thread_barrier_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
+ extern f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_barrier_attributes_decrease_by()
+ * @see f_thread_barrier_attributes_increase()
+ * @see f_thread_barrier_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
+ extern f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_barrier_attribute_h
--- /dev/null
+#include "../thread.h"
+#include "private-condition.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
+ f_status_t private_f_thread_condition_delete(f_thread_condition_t *condition) {
+
+ const int error = pthread_cond_destroy(condition);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
+
+#if !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
+ f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < conditions->size; ++i) {
+
+ status = private_f_thread_condition_delete(&conditions->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_condition_t), (void **) &conditions->array, &conditions->used, &conditions->size);
+ }
+#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
+
+#if !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
+ f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < conditions->size; ++i) {
+
+ status = private_f_thread_condition_delete(&conditions->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &conditions->array, &conditions->used, &conditions->size);
+ }
+#endif // !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_condition_h
+#define _PRIVATE_F_thread_condition_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param conditions
+ * The conditions to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_cond_destroy()
+ *
+ * @see f_thread_condition_delete()
+ * @see f_thread_conditions_adjust()
+ * @see f_thread_conditions_decimate_by()
+ * @see f_thread_conditions_decrease()
+ * @see f_thread_conditions_decrease_by()
+ * @see f_thread_conditions_increase()
+ * @see f_thread_conditions_increase_by()
+ * @see f_thread_conditions_resize()
+ */
+#if !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
+ extern f_status_t private_f_thread_condition_delete(f_thread_condition_t *condition) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param conditions
+ * The conditions to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_conditions_adjust()
+ * @see f_thread_conditions_decimate_by()
+ */
+#if !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
+ extern f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param conditions
+ * The conditions to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_conditions_decrease_by()
+ * @see f_thread_conditions_increase()
+ * @see f_thread_conditions_increase_by()
+ */
+#if !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
+ extern f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_condition_h
--- /dev/null
+#include "../thread.h"
+#include "private-condition_attribute.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
+ f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t * const attribute) {
+
+ const int error = pthread_condattr_destroy(attribute);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
+
+#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
+ f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_condition_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_condition_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
+
+#if !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
+ f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_condition_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_condition_attribute_h
+#define _PRIVATE_F_thread_condition_attribute_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attribute
+ * The attribute to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_condattr_destroy()
+ *
+ * @see f_thread_condition_attributes_adjust()
+ * @see f_thread_condition_attributes_decimate_by()
+ * @see f_thread_condition_attributes_decrease()
+ * @see f_thread_condition_attributes_decrease_by()
+ * @see f_thread_condition_attributes_increase()
+ * @see f_thread_condition_attributes_increase_by()
+ * @see f_thread_condition_attributes_resize()
+ */
+#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
+ extern f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_condition_attributes_adjust()
+ * @see f_thread_condition_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
+ extern f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_condition_attributes_decrease_by()
+ * @see f_thread_condition_attributes_increase()
+ * @see f_thread_condition_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
+ extern f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_condition_attribute_h
--- /dev/null
+#include "../thread.h"
+#include "private-id.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
+ f_status_t private_f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
+
+ if (ids->size) {
+ memset(ids->array, 0, sizeof(f_thread_id_t) * ids->size);
+ }
+
+ return f_memory_array_adjust(length, sizeof(f_thread_id_t), (void **) &ids->array, &ids->used, &ids->size);
+ }
+#endif // !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
+
+#if !defined(_di_f_thread_ids_decrease_) || !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
+ f_status_t private_f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
+
+ return f_memory_array_resize(length, sizeof(f_thread_id_t), (void **) &ids->array, &ids->used, &ids->size);
+ }
+#endif // !defined(_di_f_thread_ids_decrease_) || !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_id_h
+#define _PRIVATE_F_thread_id_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param ids
+ * The ids to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_ids_adjust()
+ * @see f_thread_ids_decimate_by()
+ */
+#if !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
+ extern f_status_t private_f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param ids
+ * The ids to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_ids_decrease_by()
+ * @see f_thread_ids_increase()
+ * @see f_thread_ids_increase_by()
+ */
+#if !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
+ extern f_status_t private_f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_id_h
--- /dev/null
+#include "../thread.h"
+#include "private-key.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
+ f_status_t private_f_thread_key_delete(f_thread_key_t *key) {
+
+ if (pthread_key_delete(*key)) return F_status_set_error(F_failure);
+
+ *key = 0;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
+
+#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
+ f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < keys->size; ++i) {
+
+ status = private_f_thread_key_delete(&keys->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_key_t), (void **) &keys->array, &keys->used, &keys->size);
+ }
+#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
+
+#if !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
+ f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < keys->size; ++i) {
+
+ status = private_f_thread_key_delete(&keys->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &keys->array, &keys->used, &keys->size);
+ }
+#endif // !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_key_h
+#define _PRIVATE_F_thread_key_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param key
+ * The keys to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_key_destroy()
+ *
+ * @see f_thread_keys_adjust()
+ * @see f_thread_keys_decimate_by()
+ * @see f_thread_keys_decrease()
+ * @see f_thread_keys_decrease_by()
+ * @see f_thread_keys_increase()
+ * @see f_thread_keys_increase_by()
+ * @see f_thread_keys_resize()
+ */
+#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
+ extern f_status_t private_f_thread_key_delete(f_thread_key_t *key) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param keys
+ * The keys to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_keys_adjust()
+ * @see f_thread_keys_decimate_by()
+ */
+#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
+ extern f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param keys
+ * The keys to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_keys_decrease_by()
+ * @see f_thread_keys_increase()
+ * @see f_thread_keys_increase_by()
+ */
+#if !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
+ extern f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_key_h
--- /dev/null
+#include "../thread.h"
+#include "private-lock.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
+ f_status_t private_f_thread_lock_delete(f_thread_lock_t *lock) {
+
+ const int error = pthread_rwlock_destroy(lock);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
+
+#if !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
+ f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < locks->size; ++i) {
+
+ status = private_f_thread_lock_delete(&locks->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) &locks->array, &locks->used, &locks->size);
+ }
+#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
+
+#if !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
+ f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < locks->size; ++i) {
+
+ status = private_f_thread_lock_delete(&locks->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &locks->array, &locks->used, &locks->size);
+ }
+#endif // !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_lock_h
+#define _PRIVATE_F_thread_lock_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param lock
+ * The locks to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_rwlock_destroy()
+ *
+ * @see f_thread_lock_delete()
+ * @see f_thread_locks_adjust()
+ * @see f_thread_locks_decimate_by()
+ * @see f_thread_locks_decrease()
+ * @see f_thread_locks_decrease_by()
+ * @see f_thread_locks_increase()
+ * @see f_thread_locks_increase_by()
+ * @see f_thread_locks_resize()
+ */
+#if !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
+ extern f_status_t private_f_thread_lock_delete(f_thread_lock_t *lock) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param locks
+ * The locks to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_locks_adjust()
+ * @see f_thread_locks_decimate_by()
+ */
+#if !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
+ extern f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param locks
+ * The locks to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_locks_decrease_by()
+ * @see f_thread_locks_increase()
+ * @see f_thread_locks_increase_by()
+ */
+#if !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
+ extern f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_lock_h
--- /dev/null
+#include "../thread.h"
+#include "private-lock_attribute.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
+ f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *attribute) {
+
+ const int error = pthread_rwlockattr_destroy(attribute);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
+
+#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
+ f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_lock_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_lock_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
+
+#if !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
+ f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_lock_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_lock_attribute_h
+#define _PRIVATE_F_thread_lock_attribute_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param attribute
+ * The attribute to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_rwlockattr_destroy()
+ *
+ * @see f_thread_lock_attributes_adjust()
+ * @see f_thread_lock_attributes_decimate_by()
+ * @see f_thread_lock_attributes_decrease()
+ * @see f_thread_lock_attributes_decrease_by()
+ * @see f_thread_lock_attributes_increase()
+ * @see f_thread_lock_attributes_increase_by()
+ * @see f_thread_lock_attributes_resize()
+ */
+#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
+ extern f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_lock_attributes_adjust()
+ * @see f_thread_lock_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
+ extern f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_lock_attributes_decrease_by()
+ * @see f_thread_lock_attributes_increase()
+ * @see f_thread_lock_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
+ extern f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_lock_attribute_h
--- /dev/null
+#include "../thread.h"
+#include "private-mutex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
+ f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *mutex) {
+
+ const int error = pthread_mutex_destroy(mutex);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
+
+#if !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
+ f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < mutexs->size; ++i) {
+
+ status = private_f_thread_mutex_delete(&mutexs->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_mutex_t), (void **) &mutexs->array, &mutexs->used, &mutexs->size);
+ }
+#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
+
+#if !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
+ f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < mutexs->size; ++i) {
+
+ status = private_f_thread_mutex_delete(&mutexs->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &mutexs->array, &mutexs->used, &mutexs->size);
+ }
+#endif // !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_mutex_h
+#define _PRIVATE_F_thread_mutex_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param mutex
+ * The mutexs to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_mutex_destroy()
+ *
+ * @see f_thread_mutex_delete()
+ * @see f_thread_mutexs_adjust()
+ * @see f_thread_mutexs_decimate_by()
+ * @see f_thread_mutexs_decrease()
+ * @see f_thread_mutexs_decrease_by()
+ * @see f_thread_mutexs_increase()
+ * @see f_thread_mutexs_increase_by()
+ * @see f_thread_mutexs_resize()
+ */
+#if !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
+ extern f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *mutex) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param mutexs
+ * The mutexs to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_mutexs_adjust()
+ * @see f_thread_mutexs_decimate_by()
+ */
+#if !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
+ extern f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param mutexs
+ * The mutexs to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_mutexs_decrease_by()
+ * @see f_thread_mutexs_increase()
+ * @see f_thread_mutexs_increase_by()
+ */
+#if !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
+ extern f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_mutex_h
--- /dev/null
+#include "../thread.h"
+#include "private-mutex_attribute.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
+ f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *attribute) {
+
+ const int error = pthread_mutexattr_destroy(attribute);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
+
+#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
+ f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_mutex_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_mutex_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
+
+#if !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
+ f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+
+ status = private_f_thread_mutex_attribute_delete(&attributes->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ }
+#endif // !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_mutex_attribute_h
+#define _PRIVATE_F_thread_mutex_attribute_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param attribute
+ * The attribute to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_mutexattr_destroy()
+ *
+ * @see f_thread_mutex_attributes_adjust()
+ * @see f_thread_mutex_attributes_decimate_by()
+ * @see f_thread_mutex_attributes_decrease()
+ * @see f_thread_mutex_attributes_decrease_by()
+ * @see f_thread_mutex_attributes_increase()
+ * @see f_thread_mutex_attributes_increase_by()
+ * @see f_thread_mutex_attributes_resize()
+ */
+#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
+ extern f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *attribute) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_mutex_attributes_adjust()
+ * @see f_thread_mutex_attributes_decimate_by()
+ */
+#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
+ extern f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param attributes
+ * The attributes to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_mutex_attributes_decrease_by()
+ * @see f_thread_mutex_attributes_increase()
+ * @see f_thread_mutex_attributes_increase_by()
+ */
+#if !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
+ extern f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_mutex_attribute_h
--- /dev/null
+#include "../thread.h"
+#include "private-once.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
+ f_status_t private_f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
+
+ if (onces->size) {
+ memset(onces->array, 0, sizeof(f_thread_once_t) * onces->size);
+ }
+
+ return f_memory_array_adjust(length, sizeof(f_thread_once_t), (void **) &onces->array, &onces->used, &onces->size);
+ }
+#endif // !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
+
+#if !defined(_di_f_thread_onces_decrease_) || !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
+ f_status_t private_f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
+
+ return f_memory_array_resize(length, sizeof(f_thread_once_t), (void **) &onces->array, &onces->used, &onces->size);
+ }
+#endif // !defined(_di_f_thread_onces_decrease_) || !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_once_h
+#define _PRIVATE_F_thread_once_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param onces
+ * The onces to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_onces_adjust()
+ * @see f_thread_onces_decimate_by()
+ */
+#if !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
+ extern f_status_t private_f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param onces
+ * The onces to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_onces_decrease_by()
+ * @see f_thread_onces_increase()
+ * @see f_thread_onces_increase_by()
+ */
+#if !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
+ extern f_status_t private_f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_once_h
--- /dev/null
+#include "../thread.h"
+#include "private-semaphore.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
+ f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *semaphore) {
+
+ const int result = sem_destroy(semaphore);
+
+ if (result == -1) {
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
+
+#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
+ f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < semaphores->size; ++i) {
+
+ status = private_f_thread_semaphore_delete(&semaphores->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_semaphore_t), (void **) &semaphores->array, &semaphores->used, &semaphores->size);
+ }
+#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
+
+#if !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
+ f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < semaphores->size; ++i) {
+
+ status = private_f_thread_semaphore_delete(&semaphores->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &semaphores->array, &semaphores->used, &semaphores->size);
+ }
+#endif // !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_semaphore_h
+#define _PRIVATE_F_thread_semaphore_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param semaphore
+ * The semaphores to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see sem_destroy()
+ *
+ * @see f_thread_semaphores_adjust()
+ * @see f_thread_semaphores_decimate_by()
+ * @see f_thread_semaphores_decrease()
+ * @see f_thread_semaphores_decrease_by()
+ * @see f_thread_semaphores_increase()
+ * @see f_thread_semaphores_increase_by()
+ * @see f_thread_semaphores_resize()
+ */
+#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
+ extern f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *semaphore) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param semaphores
+ * The semaphores to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_semaphores_adjust()
+ * @see f_thread_semaphores_decimate_by()
+ */
+#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
+ extern f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param semaphores
+ * The semaphores to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_semaphores_decrease_by()
+ * @see f_thread_semaphores_increase()
+ * @see f_thread_semaphores_increase_by()
+ */
+#if !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
+ extern f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_semaphore_h
--- /dev/null
+#include "../thread.h"
+#include "private-attribute.h"
+#include "private-set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
+ f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < sets->size; ++i) {
+
+ status = private_f_thread_attribute_delete(&sets->array[i].attribute);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_set_t), (void **) &sets->array, &sets->used, &sets->size);
+ }
+#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
+
+#if !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
+ f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < sets->size; ++i) {
+
+ status = private_f_thread_attribute_delete(&sets->array[i].attribute);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &sets->array, &sets->used, &sets->size);
+ }
+#endif // !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_set_h
+#define _PRIVATE_F_thread_set_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param sets
+ * The sets to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_sets_adjust()
+ * @see f_thread_sets_decimate_by()
+ */
+#if !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
+ extern f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param sets
+ * The sets to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_sets_decrease_by()
+ * @see f_thread_sets_increase()
+ * @see f_thread_sets_increase_by()
+ */
+#if !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
+ extern f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_set_h
--- /dev/null
+#include "../thread.h"
+#include "private-spin.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
+ f_status_t private_f_thread_spin_delete(f_thread_spin_t *spin) {
+
+ const int error = pthread_spin_destroy(spin);
+
+ if (error) {
+ if (error == EBUSY) return F_status_set_error(F_busy);
+ if (error == EINVAL) return F_status_set_error(F_parameter);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
+
+#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
+ f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < spins->size; ++i) {
+
+ status = private_f_thread_spin_delete(&spins->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_adjust(length, sizeof(f_thread_spin_t), (void **) &spins->array, &spins->used, &spins->size);
+ }
+#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
+
+#if !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
+ f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
+
+ f_status_t status = F_none;
+
+ for (f_number_unsigned_t i = length; i < spins->size; ++i) {
+
+ status = private_f_thread_spin_delete(&spins->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &spins->array, &spins->used, &spins->size);
+ }
+#endif // !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_thread_spin_h
+#define _PRIVATE_F_thread_spin_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for deleting (and destroying).
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param spin
+ * The spins to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_busy (with error bit) if the lock is busy.
+ * F_failure (with error bit) on error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see pthread_spin_destroy()
+ *
+ * @see f_thread_spins_adjust()
+ * @see f_thread_spins_decimate_by()
+ * @see f_thread_spins_decrease()
+ * @see f_thread_spins_decrease_by()
+ * @see f_thread_spins_increase()
+ * @see f_thread_spins_increase_by()
+ * @see f_thread_spins_resize()
+ */
+#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
+ extern f_status_t private_f_thread_spin_delete(f_thread_spin_t *spin) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param spins
+ * The spins to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_thread_spins_adjust()
+ * @see f_thread_spins_decimate_by()
+ */
+#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
+ extern f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param spins
+ * The spins to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_thread_spins_decrease_by()
+ * @see f_thread_spins_increase()
+ * @see f_thread_spins_increase_by()
+ */
+#if !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
+ extern f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_thread_spin_h
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-semaphore.h"
#include "semaphore.h"
#ifdef __cplusplus
if (!amount) return F_data_not;
- if (semaphores->size > amount) {
- return private_f_thread_semaphores_adjust(semaphores->size - amount, semaphores);
- }
-
- return private_f_thread_semaphores_adjust(0, semaphores);
+ return private_f_thread_semaphores_adjust((semaphores->size > amount) ? semaphores->size - amount : 0, semaphores);
}
#endif // _di_f_thread_semaphores_decimate_by_
if (!amount) return F_data_not;
- if (semaphores->size > amount) {
- return private_f_thread_semaphores_resize(semaphores->size - amount, semaphores);
- }
-
- return private_f_thread_semaphores_resize(0, semaphores);
+ return private_f_thread_semaphores_resize((semaphores->size > amount) ? semaphores->size - amount : 0, semaphores);
}
#endif // _di_f_thread_semaphores_decrease_by_
f_number_unsigned_t size = semaphores->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (semaphores->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (semaphores->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-set.h"
#include "set.h"
#ifdef __cplusplus
if (!amount) return F_data_not;
- if (sets->size > amount) {
- return private_f_thread_sets_adjust(sets->size - amount, sets);
- }
-
- return private_f_thread_sets_adjust(0, sets);
+ return private_f_thread_sets_adjust((sets->size > amount) ? sets->size - amount : 0, sets);
}
#endif // _di_f_thread_sets_decimate_by_
if (!amount) return F_data_not;
- if (sets->size > amount) {
- return private_f_thread_sets_resize(sets->size - amount, sets);
- }
-
- return private_f_thread_sets_resize(0, sets);
+ return private_f_thread_sets_resize((sets->size > amount) ? sets->size - amount : 0, sets);
}
#endif // _di_f_thread_sets_decrease_by_
f_number_unsigned_t size = sets->used + step;
if (size > F_number_t_size_unsigned_d) {
- if (sets->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (sets->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
size = F_number_t_size_unsigned_d;
}
#include "../thread.h"
-#include "../private-thread.h"
+#include "private-spin.h"
#include "spin.h"
#ifdef __cplusplus
if (!amount) return F_data_not;
- if (spins->size > amount) {
- return private_f_thread_spins_adjust(spins->size - amount, spins);
- }
-
- return private_f_thread_spins_adjust(0, spins);
+ return private_f_thread_spins_adjust((spins->size > amount) ? spins->size - amount : 0, spins);
}
#endif // _di_f_thread_spins_decimate_by_
if (!amount) return F_data_not;
- if (spins->size > amount) {
- return private_f_thread_spins_resize(spins->size - amount, spins);
- }
-
- return private_f_thread_spins_resize(0, spins);
+ return private_f_thread_spins_resize((spins->size > amount) ? spins->size - amount : 0, spins);
}
#endif // _di_f_thread_spins_decrease_by_
build_libraries -lc
build_libraries-individual -lf_memory -lf_string
-build_sources_library thread.c private-thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c
+build_sources_library thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c
+build_sources_library thread/private-attribute.c thread/private-barrier.c thread/private-barrier_attribute.c thread/private-condition.c thread/private-condition_attribute.c thread/private-id.c thread/private-key.c thread/private-lock.c thread/private-lock_attribute.c thread/private-mutex.c thread/private-mutex_attribute.c thread/private-once.c thread/private-semaphore.c thread/private-set.c thread/private-spin.c
build_sources_headers thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h
build_libraries -pthread -lc
build_libraries-individual -lf_memory -lf_string
-build_sources_library thread.c private-thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c ../../tests/unit/c/mock-thread.c
+build_sources_library thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c ../../tests/unit/c/mock-thread.c
+build_sources_library thread/private-attribute.c thread/private-barrier.c thread/private-barrier_attribute.c thread/private-condition.c thread/private-condition_attribute.c thread/private-id.c thread/private-key.c thread/private-lock.c thread/private-lock_attribute.c thread/private-mutex.c thread/private-mutex_attribute.c thread/private-once.c thread/private-semaphore.c thread/private-set.c thread/private-spin.c
build_sources_headers thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h