#ifndef _di_f_fss_delimits_
typedef f_string_locations f_fss_delimits;
+
#define f_fss_delimits_initialize f_string_locations_initialize
- #define f_delete_fss_delimits(status, array) f_delete_string_location_array(status, array)
- #define f_destroy_fss_delimits(status, array) f_destroy_string_location_array(status, array)
+ #define f_macro_fss_delimits_clear(delimits) f_macro_memory_structure_clear(delimits)
+
+ #define f_macro_fss_delimits_new(status, delimits) f_macro_strings_string_locations_new(status, delimits)
+ #define f_macro_fss_delimits_delete(status, delimits) f_macro_strings_string_locations_delete(status, delimits)
+ #define f_macro_fss_delimits_destroy(status, delimits) f_macro_strings_string_locations_destroy(status, delimits)
- #define f_resize_fss_delimits(status, array, new_length) f_resize_string_location_array(status, array, new_length)
- #define f_adjust_fss_delimits(status, array, new_length) f_adjust_string_location_array(status, array, new_length)
+ #define f_macro_fss_delimits_resize(status, delimits, new_length) f_macro_strings_string_locations_resize(status, delimits, new_length)
+ #define f_macro_fss_delimits_adjust(status, delimits, new_length) f_macro_strings_string_locations_adjust(status, delimits , new_length)
#endif // _di_f_fss_delimits_
/**
#define f_fss_headers_initialize { 0, 0, 0 }
- #define f_delete_fss_headers(status, headers) \
- f_delete_structure(status, headers, f_fss_header)
+ #define f_clear_fss_headers(headers) f_macro_memory_structure_clear(headers)
- #define f_destroy_fss_headers(status, headers) \
- f_destroy_structure(status, headers, f_fss_header)
+ #define f_macro_fss_headers_new(status, headers, length) f_macro_memory_structure_new(status, headers, f_fss_header, length)
- #define f_resize_fss_headers(status, headers, new_length) \
- f_resize_structure(status, headers, f_fss_header, new_length)
+ #define f_macro_fss_headers_delete(status, headers) f_macro_memory_structure_delete(status, headers, f_fss_header)
+ #define f_macro_fss_headers_destroy(status, headers) f_macro_memory_structure_destroy(status, headers, f_fss_header)
-
- #define f_adjust_fss_headers(status, headers, new_length) \
- f_adjust_structure(status, headers, f_fss_header, new_length)
+ #define f_macro_fss_headers_resize(status, headers, new_length) f_macro_memory_structure_resize(status, headers, f_fss_header, new_length)
+ #define f_macro_fss_headers_adjust(status, headers, new_length) f_macro_memory_structure_adjust(status, headers, f_fss_header, new_length)
#endif // _di_f_fss_headers_
typedef f_string_location f_fss_object;
#define f_fss_object_initialize f_string_location_initialize
- #define f_new_fss_object(status, object, length) status = f_new_array((void **) & object, sizeof(f_fss_object), length)
- #define f_delete_fss_object(status, object) status = f_delete((void **) & object)
- #define f_destroy_fss_object(status, object, size) status = f_destroy((void **) & object, sizeof(f_fss_object), size)
+ #define f_macro_fss_object_new(status, object, length) status = f_new_array((void **) & object, sizeof(f_fss_object), length)
+
+ #define f_macro_fss_object_delete(status, object) status = f_delete((void **) & object)
+ #define f_macro_fss_object_destroy(status, object, size) status = f_destroy((void **) & object, sizeof(f_fss_object), size)
- #define f_resize_fss_object(status, object, old_length, new_length) \
- status = f_resize((void **) & object, sizeof(f_fss_object), old_length, new_length)
+ #define f_macro_fss_object_resize(status, object, old_length, new_length) status = f_resize((void **) & object, sizeof(f_fss_object), old_length, new_length)
- #define f_adjust_fss_object(status, object, old_length, new_length) \
- status = f_adjust((void **) & object, sizeof(f_fss_object), old_length, new_length)
+ #define f_macro_fss_object_adjust(status, object, old_length, new_length) status = f_adjust((void **) & object, sizeof(f_fss_object), old_length, new_length)
#endif // _di_fss_object_
/**
#define f_fss_objects_initialize { 0, 0, 0 }
- #define f_delete_fss_objects(status, objects) \
- f_delete_structure(status, objects, f_fss_object)
+ #define f_macro_fss_objects_clear(objects) f_macro_memory_structure_clear(objects)
- #define f_destroy_fss_objects(status, objects) \
- f_destroy_structure(status, objects, f_fss_object)
+ #define f_macro_fss_objects_new(status, objects, length) f_macro_memory_structure_new(status, objects, f_fss_object, length)
- #define f_resize_fss_objects(status, objects, new_length) \
- f_resize_structure(status, objects, f_fss_object, new_length)
+ #define f_macro_fss_objects_delete(status, objects) f_macro_memory_structure_delete(status, objects, f_fss_object)
+ #define f_macro_fss_objects_destroy(status, objects) f_macro_memory_structure_destroy(status, objects, f_fss_object)
- #define f_adjust_fss_objects(status, objects, new_length) \
- f_destroy_structure(status, objects, f_fss_object, new_length)
+ #define f_macro_fss_objects_resize(status, objects, new_length) f_macro_memory_structure_resize(status, objects, f_fss_object, new_length)
+ #define f_macro_fss_objects_adjust(status, objects, new_length) f_macro_memory_structure_destroy(status, objects, f_fss_object, new_length)
#endif // _di_fss_objects_
/**
#define f_fss_content_initialize { 0, 0, 0 }
- #define f_delete_fss_content(status, content) \
- f_delete_structure(status, content, f_string_location)
+ #define f_macro_fss_content_clear(content) f_macro_memory_structure_new(content)
- #define f_destroy_fss_content(status, content) \
- f_destroy_structure(status, content, f_string_location)
+ #define f_macro_fss_content_new(status, content, length) f_macro_memory_structure_new(status, content, f_string_location, length)
- #define f_resize_fss_content(status, content, new_length) \
- f_resize_structure(status, content, f_string_location, new_length)
+ #define f_macro_fss_content_delete(status, content) f_macro_memory_structure_delete(status, content, f_string_location)
+ #define f_macro_fss_content_destroy(status, content) f_macro_memory_structure_destroy(status, content, f_string_location)
- #define f_adjust_fss_content(status, content, new_length) \
- f_adjust_structure(status, content, f_string_location, new_length)
+ #define f_macro_fss_content_resize(status, content, new_length) f_macro_memory_structure_resize(status, content, f_string_location, new_length)
+ #define f_macro_fss_content_adjust(status, content, new_length) f_macro_memory_structure_adjust(status, content, f_string_location, new_length)
#endif // _di_fss_content_
/**
#define f_fss_contents_initialize { 0, 0, 0 }
- #define f_delete_fss_contents(status, contents) \
- f_delete_structures(status, contents, f_fss_content)
+ #define f_macro_fss_contents_clear(contents) f_macro_memory_structures_clear(contents)
- #define f_destroy_fss_contents(status, contents) \
- f_destroy_structures(status, contents, f_fss_content)
+ #define f_macro_fss_contents_new(status, contents, length) f_macro_memory_structures_delete(status, contents, f_fss_content, length)
- #define f_resize_fss_contents(status, contents, new_length) \
- f_resize_structures(status, contents, f_fss_content, new_length, f_array_length)
+ #define f_macro_fss_contents_delete(status, contents) f_macro_memory_structures_delete(status, contents, f_fss_content)
+ #define f_macro_fss_contents_destroy(status, contents) f_macro_memory_structures_destroy(status, contents, f_fss_content)
- #define f_adjust_fss_contents(status, contents, new_length) \
- f_resize_structures(status, contents, f_fss_content, new_length, f_array_length)
+ #define f_macro_fss_contents_resize(status, contents, new_length) f_macro_memory_structures_resize(status, contents, f_fss_content, new_length, f_array_length)
+ #define f_macro_fss_contents_adjust(status, contents, new_length) f_macro_memory_structures_resize(status, contents, f_fss_content, new_length, f_array_length)
#endif // _di_f_fss_contents_
#ifdef __cplusplus
#ifndef _di_f_new_
// Create some dynamically allocated array of some length
- #define f_new(pointer,type) f_new_array(pointer, type, 1)
extern f_return_status f_new_array(void **pointer, const f_memory_size_t type, const f_memory_length length);
#endif // _di_f_new_
// centralize allocation for all FLL structures that follow the size+used approach.
-#ifndef _di_f_clear_structure_
+#ifndef _di_f_macro_memory_structure_clear_
/**
* structure: the structure to operate on.
*/
- #define f_clear_structure(structure) \
+ #define f_macro_memory_structure_clear(structure) \
structure.array = 0; \
structure.size = 0; \
structure.used = 0;
-#endif // _di_f_clear_structure_
+#endif // _di_f_macro_memory_structure_clear_
-#ifndef _di_f_new_structure_
+#ifndef _di_f_macro_memory_structure_new_
/**
* status: the status to return.
* structure: the structure to operate on.
* type: the structure type.
*/
- #define f_new_structure(status, structure, type, length) \
+ #define f_macro_memory_structure_new(status, structure, type, length) \
structure.array = 0; \
structure.size = 0; \
structure.used = 0; \
structure.size = length; \
structure.used = 0; \
}
-#endif // _di_f_new_structure_
+#endif // _di_f_macro_memory_structure_new_
// improper use of these defines can lead to memory leaks and compilation errors
-#ifndef _di_f_delete_structure_
+#ifndef _di_f_macro_memory_structure_delete_
/**
* status: the status to return.
* structure: the structure to operate on.
* type: the structure type.
*/
- #define f_delete_structure(status, structure, type) \
+ #define f_macro_memory_structure_delete(status, structure, type) \
status = f_delete((void **) & structure.array, sizeof(type), structure.size); \
if (status == f_none) { \
structure.size = 0; \
structure.used = 0; \
}
-#endif // _di_f_delete_structure_
+#endif // _di_f_macro_memory_structure_delete_
-#ifndef _di_f_destroy_structure_
+#ifndef _di_f_macro_memory_structure_destroy_
/**
* status: the status to return.
* structure: the structure to operate on.
* type: the structure type.
*/
- #define f_destroy_structure(status, structure, type) \
+ #define f_macro_memory_structure_destroy(status, structure, type) \
status = f_destroy((void **) & structure.array, sizeof(type), structure.size); \
if (status == f_none) { \
structure.size = 0; \
structure.used = 0; \
}
-#endif // _di_f_destroy_structure_
+#endif // _di_f_macro_memory_structure_destroy_
-#ifndef _di_f_resize_structure_
+#ifndef _di_f_macro_memory_structure_resize_
/**
* status: the status to return.
* structure: the structure to operate on.
* type: the structure type.
*/
- #define f_resize_structure(status, structure, type, new_length) \
+ #define f_macro_memory_structure_resize(status, structure, type, new_length) \
status = f_resize((void **) & structure.array, sizeof(type), structure.size, new_length); \
if (status == f_none) { \
structure.size = new_length; \
if (structure.used > structure.size) structure.used = new_length; \
}
-#endif // _di_f_resize_structure_
+#endif // _di_f_macro_memory_structure_resize_
-#ifndef _di_f_adjust_structure_
+#ifndef _di_f_macro_memory_structure_adjust_
/**
* status: the status to return.
* structure: the structure to operate on.
* type: the structure type.
*/
- #define f_adjust_structure(status, structure, type, new_length) \
+ #define f_macro_memory_structure_adjust(status, structure, type, new_length) \
status = f_adjust((void **) & structure.array, sizeof(type), structure.size, new_length); \
if (status == f_none) { \
structure.size = new_length; \
if (structure.used > structure.size) structure.used = new_length; \
}
-#endif // _di_f_adjust_structure_
+#endif // _di_f_macro_memory_structure_adjust_
// Structures defines function in the same way that the structure defines do
// however, these hold an array of structure
// improper use of these defines can lead to memory leaks and compilation errors
-#ifndef _di_f_clear_structures_
+#ifndef _di_f_macro_memory_structures_clear_
/**
* structure: the structure to operate on.
*/
- #define f_clear_structures(structures) \
+ #define f_macro_memory_structures_clear(structures) \
structures.array = 0; \
structures.size = 0; \
structures.used = 0;
-#endif // _di_f_clear_structures_
+#endif // _di_f_macro_memory_structures_clear_
-#ifndef _di_f_new_structures_
+#ifndef _di_f_macro_memory_structures_new_
/**
* status: the status to return.
* structures: the structure to operate on.
* type: the structure type.
*/
- #define f_new_structures(status, structures, type, new_length) \
+ #define f_macro_memory_structures_new(status, structures, type, new_length) \
structures.array = 0; \
structures.size = 0; \
structures.used = 0; \
structures.size = new_length; \
structures.used = 0; \
}
-#endif // _di_f_new_structures_
+#endif // _di_f_macro_memory_structures_new_
-#ifndef _di_f_delete_structures_
+#ifndef _di_f_macro_memory_structures_delete_
/**
* status: the status to return.
* structures: the structure to operate on.
* type: the structure type.
*/
- #define f_delete_structures(status, structures, type) \
+ #define f_macro_memory_structures_delete(status, structures, type) \
status = f_none; \
while (structures.size > 0) { \
--structures.size; \
- f_delete_structure(status, structures.array[structures.size], type); \
+ f_macro_memory_structure_delete(status, structures.array[structures.size], type); \
if (status != f_none) break; \
} \
if (status == f_none) status = f_delete((void **) & structures.array, sizeof(type), structures.size); \
if (status == f_none) structures.used = 0;
-#endif // _di_f_delete_structures_
+#endif // _di_f_macro_memory_structures_delete_
-#ifndef _di_f_destroy_structures_
+#ifndef _di_f_macro_memory_structures_destroy_
/**
* status: the status to return.
* structures: the structure to operate on.
* type: the structure type.
*/
- #define f_destroy_structures(status, structures, type) \
+ #define f_macro_memory_structures_destroy(status, structures, type) \
status = f_none; \
while (structures.size > 0) { \
--structures.size; \
- f_destroy_structure(status, structures.array[structures.size], type); \
+ f_macro_memory_structure_destroy(status, structures.array[structures.size], type); \
if (status != f_none) break; \
} \
if (status == f_none) status = f_destroy((void **) & structures.array, sizeof(type), structures.size); \
if (status == f_none) structures.used = 0;
-#endif // _di_f_destroy_structures_
+#endif // _di_f_macro_memory_structures_destroy_
-#ifndef _di_f_resize_structures_
+#ifndef _di_f_macro_memory_structures_resize_
/**
* status: the status to return.
* structures: the structure to operate on.
* type: the structure type.
*/
- #define f_resize_structures(status, structures, type, new_length, length_variable) \
+ #define f_macro_memory_structures_resize(status, structures, type, new_length, length_variable) \
status = f_none; \
if (new_length < structures.size) { \
length_variable i = structures.size - new_length; \
for (; i < structures.size; ++i) { \
- f_delete_structure(status, structures.array[i], type); \
+ f_macro_memory_structure_delete(status, structures.array[i], type); \
if (status != f_none) break; \
} \
} \
structures.size = new_length; \
if (structures.used > structures.size) structures.used = new_length; \
}
-#endif // _di_f_resize_structures_
+#endif // _di_f_macro_memory_structures_resize_
-#ifndef _di_f_adjust_structures_
+#ifndef _di_f_macro_memory_structures_adjust_
/**
* status: the status to return.
* structures: the structure to operate on.
* type: the structure type.
*/
- #define f_adjust_structures(status, structures, type, new_length, length_variable) \
+ #define f_macro_memory_structures_adjust(status, structures, type, new_length, length_variable) \
status = f_none; \
if (new_length < structures.size) { \
length_variable i = structures.size - new_length; \
for (; i < structures.size; ++i) { \
- f_destroy_structure(status, structures.array[i], type); \
+ f_macro_memory_structure_destroy(status, structures.array[i], type); \
if (status != f_none) break; \
} \
} \
structures.size = new_length; \
if (structures.used > structures.size) structures.used = new_length; \
}
-#endif // _di_f_adjust_structures_
+#endif // _di_f_macro_memory_structures_adjust_
#ifdef __cplusplus
} // extern "C"
#define f_string_max_size f_signed_long_size
#define f_string_initialize f_eos
- #define f_new_string(status, string, length) status = f_new_array((void **) & string, sizeof(f_string), length)
- #define f_delete_string(status, string, size) status = f_delete((void **) & string, sizeof(f_string), size)
- #define f_destroy_string(status, string, size) status = f_destroy((void **) & string, sizeof(f_string), size)
+ #define f_macro_strings_string_new(status, string, length) status = f_new_array((void **) & string, sizeof(f_string), length)
+ #define f_macro_strings_string_delete(status, string, size) status = f_delete((void **) & string, sizeof(f_string), size)
+ #define f_macro_strings_string_destroy(status, string, size) status = f_destroy((void **) & string, sizeof(f_string), size)
- #define f_resize_string(status, string, old_length, new_length) \
+ #define f_macro_strings_string_resize(status, string, old_length, new_length) \
status = f_resize((void **) & string, sizeof(f_string), old_length, new_length)
- #define f_adjust_string(status, string, old_length, new_length) \
+ #define f_macro_strings_string_adjust(status, string, old_length, new_length) \
status = f_adjust((void **) & string, sizeof(f_string), old_length, new_length)
#endif // _di_f_have_string_
#define f_string_length_printf string_format_long_integer
- #define f_new_string_length(status, string, length) status = f_new_array((void **) & string, sizeof(f_string_length), length)
- #define f_delete_string_length(status, string, length) status = f_delete((void **) & string, sizeof(f_string_length), length)
- #define f_destroy_string_length(status, string, size) status = f_destroy((f_void_P *) & string, sizeof(f_string_length), size)
+ #define f_macro_strings_string_length_new(status, string, length) status = f_new_array((void **) & string, sizeof(f_string_length), length)
+ #define f_macro_strings_string_length_delete(status, string, length) status = f_delete((void **) & string, sizeof(f_string_length), length)
+ #define f_macro_strings_string_length_destroy(status, string, size) status = f_destroy((f_void_P *) & string, sizeof(f_string_length), size)
- #define f_resize_string_length(status, length, old_length, new_length) \
+ #define f_macro_strings_string_length_resize(status, length, old_length, new_length) \
status = f_resize((void **) & length, sizeof(f_string_length), old_length, new_length)
- #define f_adjust_string_length(status, length, old_length, new_length) \
+ #define f_macro_strings_string_length_adjust(status, length, old_length, new_length) \
status = f_adjust((void **) & length, sizeof(f_string_length), old_length, new_length)
#endif // _di_f_string_length_
#define f_string_lengths_initialize { 0, 0, 0 }
- #define f_new_string_lengths(status, lengths) \
- f_new_structure(status, lengths, f_string_length)
+ #define f_macro_strings_string_lengths_new(status, lengths) \
+ f_macro_memory_structure_new(status, lengths, f_string_length)
- #define f_delete_string_lengths(status, lengths) \
- f_delete_structure(status, lengths, f_string_length)
+ #define f_macro_strings_string_lengths_delete(status, lengths) \
+ f_macro_memory_structure_delete(status, lengths, f_string_length)
- #define f_destroy_string_lengths(status, lengths) \
- f_destroy_structure(status, lengths, f_string_length)
+ #define f_macro_strings_string_lengths_destroy(status, lengths) \
+ f_macro_memory_structure_destroy(status, lengths, f_string_length)
- #define f_resize_string_lengths(status, lengths, new_length) \
- f_resize_structure(status, lengths, f_string_length, new_length)
+ #define f_macro_strings_string_lengths_resize(status, lengths, new_length) \
+ f_macro_memory_structure_resize(status, lengths, f_string_length, new_length)
- #define f_adjust_string_lengths(status, lengths, new_length) \
- f_adjust_structure(status, lengths, f_string_length, new_length)
+ #define f_macro_strings_string_lengths_adjust(status, lengths, new_length) \
+ f_macro_memory_structure_adjust(status, lengths, f_string_length, new_length)
#endif // _di_f_string_lengths_
/**
#define f_string_location_initialize { 1, 0 }
- #define f_new_string_location(status, string_location, length) status = f_new_array((void **) & string_location, sizeof(f_string_location), length)
- #define f_delete_string_location(status, string_location, size) status = f_delete((void **) & string_location, sizeof(f_string_location), size)
- #define f_destroy_string_location(status, string_location, size) status = f_destroy((void **) & string_location, sizeof(f_string_location), size)
+ #define f_macro_strings_string_location_new(status, string_location, length) status = f_new_array((void **) & string_location, sizeof(f_string_location), length)
+ #define f_macro_strings_string_location_delete(status, string_location, size) status = f_delete((void **) & string_location, sizeof(f_string_location), size)
+ #define f_macro_strings_string_location_destroy(status, string_location, size) status = f_destroy((void **) & string_location, sizeof(f_string_location), size)
- #define f_resize_string_location(status, string_location, old_length, new_length) \
+ #define f_macro_strings_string_location_resize(status, string_location, old_length, new_length) \
status = f_resize((void **) & string_location, sizeof(f_string_location), old_length, new_length)
- #define f_adjust_string_location(status, string_location, old_length, new_length) \
+ #define f_macro_strings_string_location_adjust(status, string_location, old_length, new_length) \
status = f_adjust((void **) & string_location, sizeof(f_string_location), old_length, new_length)
#endif // _di_f_string_location_
#define f_string_locations_initialize {0, 0, 0}
#define f_clear_string_locations(locations) \
- f_clear_structure(locations)
+ f_macro_memory_structure_clear(locations)
- #define f_new_string_locations(status, locations, length) \
- f_new_structure(status, locations, f_string_location, length)
+ #define f_macro_strings_string_locations_new(status, locations, length) \
+ f_macro_memory_structure_new(status, locations, f_string_location, length)
- #define f_delete_string_locations(status, locations) \
- f_delete_structure(status, locations, f_string_location)
+ #define f_macro_strings_string_locations_delete(status, locations) \
+ f_macro_memory_structure_delete(status, locations, f_string_location)
- #define f_destroy_string_locations(status, locations) \
- f_destroy_structure(status, locations, f_string_location)
+ #define f_macro_strings_string_locations_destroy(status, locations) \
+ f_macro_memory_structure_destroy(status, locations, f_string_location)
- #define f_resize_string_locations(status, locations, new_length) \
- f_resize_structure(status, locations, f_string_location, new_length)
+ #define f_macro_strings_string_locations_resize(status, locations, new_length) \
+ f_macro_memory_structure_resize(status, locations, f_string_location, new_length)
- #define f_adjust_string_locations(status, locations, new_length) \
- f_adjust_structure(status, locations, f_string_location, new_length)
+ #define f_macro_strings_string_locations_adjust(status, locations, new_length) \
+ f_macro_memory_structure_adjust(status, locations, f_string_location, new_length)
#endif // _di_f_string_locations_
/**
dynamic.size = 0; \
dynamic.used = 0;
- #define f_new_dynamic_string(status, dynamic, new_length) \
+ #define f_macro_string_dynamic_new(status, dynamic, new_length) \
f_clear_dynamic_string(dynamic) \
status = f_new_array((void **) & dynamic.string, sizeof(f_string), new_length); \
if (status == f_none) { \
dynamic.used = 0; \
}
- #define f_delete_dynamic_string(status, dynamic) \
+ #define f_macro_string_dynamic_delete(status, dynamic) \
status = f_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \
if (status == f_none) { \
dynamic.size = 0; \
dynamic.used = 0; \
}
- #define f_destroy_dynamic_string(status, dynamic) \
+ #define f_macro_string_dynamic_destroy(status, dynamic) \
status = f_destroy((void **) & dynamic.string, sizeof(f_string), dynamic.size); \
if (status == f_none) { \
dynamic.size = 0; \
dynamic.used = 0; \
}
- #define f_resize_dynamic_string(status, dynamic, new_length) \
+ #define f_macro_string_dynamic_resize(status, dynamic, new_length) \
status = f_resize((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \
if (status == f_none) { \
dynamic.size = new_length; \
if (dynamic.used > dynamic.size) dynamic.used = new_length; \
}
- #define f_adjust_dynamic_string(status, dynamic, new_length) \
+ #define f_macro_string_dynamic_adjust(status, dynamic, new_length) \
status = f_adjust((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \
if (status == f_none) { \
dynamic.size = new_length; \
dynamics.size = 0; \
dynamics.used = 0;
- #define f_new_dynamic_strings(status, dynamics, length) \
+ #define f_macro_string_dynamics_new(status, dynamics, length) \
dynamics.array = 0; \
dynamics.size = 0; \
dynamics.used = 0; \
dynamics.used = 0; \
}
- #define f_delete_dynamic_strings(status, dynamics) \
+ #define f_macro_string_dynamics_delete(status, dynamics) \
status = f_none; \
while (dynamics.size > 0) { \
--dynamics.size; \
- f_destroy_dynamic_string(status, dynamics.array[dynamics.size]); \
+ f_macro_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \
if (status != f_none) break; \
} \
if (status == f_none) status = f_delete((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \
if (status == f_none) dynamics.used = 0;
- #define f_destroy_dynamic_strings(status, dynamics) \
+ #define f_macro_string_dynamics_destroy(status, dynamics) \
status = f_none; \
while (dynamics.size > 0) { \
--dynamics.size; \
- f_destroy_dynamic_string(status, dynamics.array[dynamics.size]); \
+ f_macro_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \
if (status != f_none) break; \
} \
if (status == f_none) status = f_destroy((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \
if (status == f_none) dynamics.used = 0;
- #define f_resize_dynamic_strings(status, dynamics, new_length) \
+ #define f_macro_string_dynamics_resize(status, dynamics, new_length) \
status = f_none; \
if (new_length < dynamics.size) { \
f_string_length i = dynamics.size - new_length; \
for (; i < dynamics.size; ++i) { \
- f_destroy_dynamic_string(status, dynamics.array[i]); \
+ f_macro_string_dynamic_destroy(status, dynamics.array[i]); \
if (status != f_none) break; \
} \
} \
if (dynamics.used > dynamics.size) dynamics.used = new_length; \
}
- #define f_adjust_dynamic_strings(status, dynamics, new_length) \
+ #define f_macro_string_dynamics_adjust(status, dynamics, new_length) \
status = f_none; \
if (new_length < dynamics.size) { \
f_string_length i = dynamics.size - new_length; \
for (; i < dynamics.size; ++i) { \
- f_destroy_dynamic_string(status, dynamics.array[i], f_dynamic_string); \
+ f_macro_string_dynamic_destroy(status, dynamics.array[i], f_dynamic_string); \
if (status != f_none) break; \
} \
} \
#define f_array_lengths_initialize { 0, 0, 0 }
- #define f_new_array_lengths(status, lengths, length) \
- f_new_structure(status, lengths, f_array_length, length)
+ #define f_macro_types_array_lengths_new(status, lengths, length) \
+ f_macro_memory_structure_new(status, lengths, f_array_length, length)
- #define f_delete_array_lengths(status, lengths) \
- f_delete_structure(status, lengths, f_array_length)
+ #define f_macro_types_array_lengths_delete(status, lengths) \
+ f_macro_memory_structure_delete(status, lengths, f_array_length)
- #define f_destroy_array_lengths(status, lengths) \
- f_destroy_structure(status, lengths, f_array_length)
+ #define f_macro_types_array_lengths_destroy(status, lengths) \
+ f_macro_memory_structure_destroy(status, lengths, f_array_length)
- #define f_resize_array_lengths(status, lengths, new_length) \
- f_resize_structure(status, lengths, f_array_length, new_length)
+ #define f_macro_types_array_lengths_resize(status, lengths, new_length) \
+ f_macro_memory_structure_resize(status, lengths, f_array_length, new_length)
- #define f_adjust_array_lengths(status, lengths, new_length) \
- f_adjust_structure(status, lengths, f_array_length, new_length)
+ #define f_macro_types_array_lengths_adjust(status, lengths, new_length) \
+ f_macro_memory_structure_adjust(status, lengths, f_array_length, new_length)
#endif // _di_f_array_lengths_
#ifdef __cplusplus
f_u_short width = f_macro_utf_character_width_is(utf_character);
if (max_width == 0) {
- f_new_string(status, *character, width);
+ f_macro_strings_string_new(status, *character, width);
if (f_status_is_error(status)) return status;
typedef f_utf_character *f_utf_string;
#define f_utf_string_max_size f_signed_long_size
- #define f_utf_string_initialize f_eos
+ #define f_utf_string_initialize f_utf_character_eos
- #define f_new_utf_char(status, string, length) status = f_new_array((void **) & string, sizeof(f_utf_string), length)
- #define f_delete_utf_char(status, string, size) status = f_delete((void **) & string, sizeof(f_utf_string), size)
- #define f_destroy_utf_char(status, string, size) status = f_destroy((void **) & string, sizeof(f_utf_string), size)
+ #define f_macro_utf_string_new(status, string, length) status = f_new_array((void **) & string, sizeof(f_utf_string), length)
+ #define f_macro_utf_string_delete(status, string, size) status = f_delete((void **) & string, sizeof(f_utf_string), size)
+ #define f_macro_utf_string_destroy(status, string, size) status = f_destroy((void **) & string, sizeof(f_utf_string), size)
- #define f_resize_utf_char(status, string, old_length, new_length) \
+ #define f_macro_utf_string_resize(status, string, old_length, new_length) \
status = f_resize((void **) & string, sizeof(f_utf_string), old_length, new_length)
- #define f_adjust_utf_char(status, string, old_length, new_length) \
+ #define f_macro_utf_string_adjust(status, string, old_length, new_length) \
status = f_adjust((void **) & string, sizeof(f_utf_string), old_length, new_length)
#endif // _di_f_utf_string_
#ifndef _di_f_utf_string_length_
typedef f_s_long f_utf_string_length;
- #define f_new_utf_string_length(status, string, length) status = f_new_array((void **) & string, sizeof(f_utf_string_length), length)
- #define f_delete_utf_string_length(status, string, length) status = f_delete((void **) & string, sizeof(f_utf_string_length), length)
- #define f_destroy_utf_string_length(status, string, size) status = f_destroy((f_void_P *) & string, sizeof(f_utf_string_length), size)
+ #define f_macro_utf_string_length_new(status, string, length) status = f_new_array((void **) & string, sizeof(f_utf_string_length), length)
+ #define f_macro_utf_string_length_delete(status, string, length) status = f_delete((void **) & string, sizeof(f_utf_string_length), length)
+ #define f_macro_utf_string_length_destroy(status, string, size) status = f_destroy((f_void_P *) & string, sizeof(f_utf_string_length), size)
- #define f_resize_utf_string_length(status, length, old_length, new_length) \
+ #define f_macro_utf_string_length_resize(status, length, old_length, new_length) \
status = f_resize((void **) & length, sizeof(f_utf_string_length), old_length, new_length)
- #define f_adjust_utf_string_length(status, length, old_length, new_length) \
+ #define f_macro_utf_string_length_adjust(status, length, old_length, new_length) \
status = f_adjust((void **) & length, sizeof(f_utf_string_length), old_length, new_length)
#endif // _di_f_utf_string_length_
#define f_utf_string_lengths_initialize { 0, 0, 0 }
- #define f_new_utf_string_lengths(status, lengths) \
- f_new_structure(status, lengths, f_utf_string_length)
+ #define f_macro_utf_string_length_news(status, lengths) \
+ f_macro_memory_structure_new(status, lengths, f_utf_string_length)
- #define f_delete_utf_string_lengths(status, lengths) \
- f_delete_structure(status, lengths, f_utf_string_length)
+ #define f_macro_utf_string_length_deletes(status, lengths) \
+ f_macro_memory_structure_delete(status, lengths, f_utf_string_length)
- #define f_destroy_utf_string_lengths(status, lengths) \
- f_destroy_structure(status, lengths, f_utf_string_length)
+ #define f_macro_utf_string_length_destroys(status, lengths) \
+ f_macro_memory_structure_destroy(status, lengths, f_utf_string_length)
- #define f_resize_utf_string_lengths(status, lengths, new_length) \
- f_resize_structure(status, lengths, f_utf_string_length, new_length)
+ #define f_macro_utf_string_length_resizes(status, lengths, new_length) \
+ f_macro_memory_structure_resize(status, lengths, f_utf_string_length, new_length)
- #define f_adjust_utf_string_lengths(status, lengths, new_length) \
- f_adjust_structure(status, lengths, f_utf_string_length, new_length)
+ #define f_macro_utf_string_length_adjusts(status, lengths, new_length) \
+ f_macro_memory_structure_adjust(status, lengths, f_utf_string_length, new_length)
#endif // _di_f_utf_string_lengths_
/**
#define f_utf_string_location_initialize { 1, 0 }
- #define f_new_utf_string_location(status, utf_string_location, length) status = f_new_array((void **) & utf_string_location, sizeof(f_utf_string_location), length)
- #define f_delete_utf_string_location(status, utf_string_location, size) status = f_delete((void **) & utf_string_location, sizeof(f_utf_string_location), size)
- #define f_destroy_utf_string_location(status, utf_string_location, size) status = f_destroy((void **) & utf_string_location, sizeof(f_utf_string_location), size)
+ #define f_macro_utf_string_location_new(status, utf_string_location, length) status = f_new_array((void **) & utf_string_location, sizeof(f_utf_string_location), length)
+ #define f_macro_utf_string_location_delete(status, utf_string_location, size) status = f_delete((void **) & utf_string_location, sizeof(f_utf_string_location), size)
+ #define f_macro_utf_string_location_destroy(status, utf_string_location, size) status = f_destroy((void **) & utf_string_location, sizeof(f_utf_string_location), size)
- #define f_resize_utf_string_location(status, utf_string_location, old_length, new_length) \
+ #define f_macro_utf_string_location_resize(status, utf_string_location, old_length, new_length) \
status = f_resize((void **) & utf_string_location, sizeof(f_utf_string_location), old_length, new_length)
- #define f_adjust_utf_string_location(status, utf_string_location, old_length, new_length) \
+ #define f_macro_utf_string_location_adjust(status, utf_string_location, old_length, new_length) \
status = f_adjust((void **) & utf_string_location, sizeof(f_utf_string_location), old_length, new_length)
#endif // _di_f_utf_string_location_
#define f_utf_string_locations_initialize {0, 0, 0}
#define f_clear_utf_string_locations(locations) \
- f_clear_structure(locations)
+ f_macro_memory_structure_clear(locations)
- #define f_new_utf_string_locations(status, locations, length) \
- f_new_structure(status, locations, f_utf_string_location, length)
+ #define f_macro_utf_string_location_news(status, locations, length) \
+ f_macro_memory_structure_new(status, locations, f_utf_string_location, length)
- #define f_delete_utf_string_locations(status, locations) \
- f_delete_structure(status, locations, f_utf_string_location)
+ #define f_macro_utf_string_location_deletes(status, locations) \
+ f_macro_memory_structure_delete(status, locations, f_utf_string_location)
- #define f_destroy_utf_string_locations(status, locations) \
- f_destroy_structure(status, locations, f_utf_string_location)
+ #define f_macro_utf_string_location_destroys(status, locations) \
+ f_macro_memory_structure_destroy(status, locations, f_utf_string_location)
- #define f_resize_utf_string_locations(status, locations, new_length) \
- f_resize_structure(status, locations, f_utf_string_location, new_length)
+ #define f_macro_utf_string_location_resizes(status, locations, new_length) \
+ f_macro_memory_structure_resize(status, locations, f_utf_string_location, new_length)
- #define f_adjust_utf_string_locations(status, locations, new_length) \
- f_adjust_structure(status, locations, f_utf_string_location, new_length)
+ #define f_macro_utf_string_location_adjusts(status, locations, new_length) \
+ f_macro_memory_structure_adjust(status, locations, f_utf_string_location, new_length)
#endif // _di_f_utf_string_locations_
/**
dynamic.size = 0; \
dynamic.used = 0;
- #define f_new_utf_string_dynamic(status, dynamic, new_length) \
+ #define f_macro_utf_string_dynamic_new(status, dynamic, new_length) \
f_clear_utf_string_dynamic(dynamic) \
status = f_new_array((void **) & dynamic.string, sizeof(f_utf_string), new_length); \
if (status == f_none) { \
dynamic.used = 0; \
}
- #define f_delete_utf_string_dynamic(status, dynamic) \
+ #define f_macro_utf_string_dynamic_delete(status, dynamic) \
status = f_delete((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \
if (status == f_none) { \
dynamic.size = 0; \
dynamic.used = 0; \
}
- #define f_destroy_utf_string_dynamic(status, dynamic) \
+ #define f_macro_utf_string_dynamic_destroy(status, dynamic) \
status = f_destroy((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \
if (status == f_none) { \
dynamic.size = 0; \
dynamic.used = 0; \
}
- #define f_resize_utf_string_dynamic(status, dynamic, new_length) \
+ #define f_macro_utf_string_dynamic_resize(status, dynamic, new_length) \
status = f_resize((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size, new_length); \
if (status == f_none) { \
dynamic.size = new_length; \
if (dynamic.used > dynamic.size) dynamic.used = new_length; \
}
- #define f_adjust_utf_string_dynamic(status, dynamic, new_length) \
+ #define f_macro_utf_string_dynamic_adjust(status, dynamic, new_length) \
status = f_adjust((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size, new_length); \
if (status == f_none) { \
dynamic.size = new_length; \
dynamics.size = 0; \
dynamics.used = 0;
- #define f_new_utf_string_dynamics(status, dynamics, length) \
+ #define f_macro_utf_string_dynamics_new(status, dynamics, length) \
dynamics.array = 0; \
dynamics.size = 0; \
dynamics.used = 0; \
dynamics.used = 0; \
}
- #define f_delete_utf_string_dynamics(status, dynamics) \
+ #define f_macro_utf_string_dynamics_delete(status, dynamics) \
status = f_none; \
while (dynamics.size > 0) { \
--dynamics.size; \
- f_destroy_utf_string_dynamic(status, dynamics.array[dynamics.size]); \
+ f_macro_utf_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \
if (status != f_none) break; \
} \
if (status == f_none) status = f_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \
if (status == f_none) dynamics.used = 0;
- #define f_destroy_utf_string_dynamics(status, dynamics) \
+ #define f_macro_utf_string_dynamics_destroy(status, dynamics) \
status = f_none; \
while (dynamics.size > 0) { \
--dynamics.size; \
- f_destroy_utf_string_dynamic(status, dynamics.array[dynamics.size]); \
+ f_macro_utf_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \
if (status != f_none) break; \
} \
if (status == f_none) status = f_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \
if (status == f_none) dynamics.used = 0;
- #define f_resize_utf_string_dynamics(status, dynamics, new_length) \
+ #define f_macro_utf_string_dynamics_resize(status, dynamics, new_length) \
status = f_none; \
if (new_length < dynamics.size) { \
f_utf_string_length i = dynamics.size - new_length; \
for (; i < dynamics.size; ++i) { \
- f_destroy_utf_string_dynamic(status, dynamics.array[i]); \
+ f_macro_utf_string_dynamic_destroy(status, dynamics.array[i]); \
if (status != f_none) break; \
} \
} \
if (dynamics.used > dynamics.size) dynamics.used = new_length; \
}
- #define f_adjust_utf_string_dynamics(status, dynamics, new_length) \
+ #define f_macro_utf_string_dynamics_adjust(status, dynamics, new_length) \
status = f_none; \
if (new_length < dynamics.size) { \
f_utf_string_length i = dynamics.size - new_length; \
for (; i < dynamics.size; ++i) { \
- f_destroy_utf_string_dynamic(status, dynamics.array[i], f_utf_string_dynamic); \
+ f_macro_utf_string_dynamic_destroy(status, dynamics.array[i], f_utf_string_dynamic); \
if (status != f_none) break; \
} \
} \
if (buffer->size - buffer->used - 1 < string_size) {
f_status status = f_none;
- f_resize_dynamic_string(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS
+ f_macro_string_dynamic_resize(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS
if (f_status_is_error(status)) {
return status;
#define fl_color_context_initialize { f_colors_initialize_linux, f_colors_format_initialize_linux, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize, f_dynamic_string_initialize }
#define fl_new_color_context(status, color_context) \
- f_resize_dynamic_string(status, color_context.reset, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.warning, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.error, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.title, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.notable, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.important, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.standout, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.normal, f_color_max_size + 1); \
- if (f_status_is_not_error(status)) f_resize_dynamic_string(status, color_context.normal_reset, f_color_max_size + 1);
+ f_macro_string_dynamic_resize(status, color_context.reset, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1);
#define fl_delete_color_context(status, color_context) \
- f_delete_dynamic_string(status, color_context.reset); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.warning); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.error); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.title); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.notable); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.important); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.standout); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.normal); \
- if (f_status_is_not_error(status)) f_delete_dynamic_string(status, color_context.normal_reset);
+ f_macro_string_dynamic_delete(status, color_context.reset); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.warning); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.error); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.title); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.notable); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.important); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.standout); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal_reset);
#define fl_destroy_color_context(status, color_context, size) \
- f_destroy_dynamic_string(status, color_context.reset); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.warning, size); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.error, size); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.title, size); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.notable, size); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.important, size); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.standout, size); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.normal); \
- if (f_status_is_not_error(status)) f_destroy_dynamic_string(status, color_context.normal_reset);
+ f_macro_string_dynamic_destroy(status, color_context.reset); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.warning, size); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.error, size); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.title, size); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.notable, size); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.important, size); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.standout, size); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal); \
+ if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal_reset);
#endif // _di_fl_color_context_
/**
if (parameters[parameter_counter].additional.used >= parameters[parameter_counter].additional.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, parameters[parameter_counter].additional, parameters[parameter_counter].additional.size + f_console_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, parameters[parameter_counter].additional, parameters[parameter_counter].additional.size + f_console_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(status, needs_additional);
+ f_macro_strings_string_lengths_delete(status, needs_additional);
return f_status_set_error(allocation_status);
}
}
if (needs_additional.used + parameters[parameter_counter].has_additional > needs_additional.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, needs_additional, needs_additional.used + parameters[parameter_counter].has_additional);
+ f_macro_strings_string_lengths_resize(allocation_status, needs_additional, needs_additional.used + parameters[parameter_counter].has_additional);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(status, needs_additional);
+ f_macro_strings_string_lengths_delete(status, needs_additional);
return f_status_set_error(allocation_status);
}
}
if (needs_additional.used + parameters[parameter_counter].has_additional > needs_additional.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, needs_additional, needs_additional.used + parameters[parameter_counter].has_additional);
+ f_macro_strings_string_lengths_resize(allocation_status, needs_additional, needs_additional.used + parameters[parameter_counter].has_additional);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(status, needs_additional);
+ f_macro_strings_string_lengths_delete(status, needs_additional);
return f_status_set_error(allocation_status);
}
}
if (remaining->used >= remaining->size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, (*remaining), remaining->size + f_console_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, (*remaining), remaining->size + f_console_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(status, needs_additional);
+ f_macro_strings_string_lengths_delete(status, needs_additional);
return f_status_set_error(allocation_status);
}
}
{
f_status allocation_status = f_none;
- f_delete_string_lengths(allocation_status, needs_additional);
+ f_macro_strings_string_lengths_delete(allocation_status, needs_additional);
}
return status;
// there is no reason to include "." and ".." in the directory listing
if (strncmp(listing[counter]->d_name, "..", 3) != 0 && strncmp(listing[counter]->d_name, ".", 2) != 0) {
if (names->used >= names->size) {
- f_resize_dynamic_strings(status, (*names), names->used + fl_directory_default_allocation_step);
+ f_macro_string_dynamics_resize(status, (*names), names->used + fl_directory_default_allocation_step);
if (f_status_is_error(status)) {
return status;
}
}
- f_resize_dynamic_string(status, names->array[names->used], size);
+ f_macro_string_dynamic_resize(status, names->array[names->used], size);
if (f_status_is_error(status)) {
return status;
}
// populate the buffer
do {
if (buffer->size <= size) {
- f_resize_dynamic_string(status, (*buffer), size);
+ f_macro_string_dynamic_resize(status, (*buffer), size);
if (f_status_is_error(status)) {
return status;
// populate the buffer
do {
if (buffer->size <= size) {
- f_resize_dynamic_string(status, (*buffer), size);
+ f_macro_string_dynamic_resize(status, (*buffer), size);
if (f_status_is_error(status)) {
return status;
// 1: Prepare the buffer to handle a size of f_fss_max_header_length
location.total_elements = f_fss_max_header_length;
- f_adjust_dynamic_string(status, buffer, location.total_elements + 1);
+ f_macro_string_dynamic_adjust(status, buffer, location.total_elements + 1);
if (f_status_is_error(status)) {
return status;
if (delimits.used >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
{
f_status allocation_status = f_none;
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
}
status = fl_fss_increment_buffer(*buffer, input, 1);
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
{
f_status allocation_status = f_none;
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
}
status = fl_fss_increment_buffer(*buffer, input, 1);
{
f_status allocation_status = f_none;
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
}
status = fl_fss_increment_buffer(*buffer, input, 1);
{
f_status allocation_status = f_none;
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
}
pre_allocate_size = buffer->used + (input->stop - input->start) + 3 + f_fss_default_allocation_step_string;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size += slash_count;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
buffer_position.stop = buffer->used;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size);
if (f_status_is_error(status)) return status;
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
pre_allocate_size = buffer->used + (input->stop - input->start) + 2 + f_fss_default_allocation_step_string;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size);
if (f_status_is_error(status)) return status;
}
pre_allocate_size += slash_count;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size = buffer->used + (input->stop - input->start) + 2 + f_fss_default_allocation_step_string;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size);
if (f_status_is_error(status)) return status;
}
pre_allocate_size += slash_count + 1;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
if (delimits.used >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
quoted = f_eos;
if (found->used >= found->size) {
- f_resize_fss_content(status, (*found), found->size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, (*found), found->size + f_fss_default_allocation_step);
if (f_status_is_error(status)){
f_status allocation_status = f_none;
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return status;
}
if (delimits.used >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
if (delimits.used + (slash_count / 2) >= delimits.size) {
f_status allocation_status = f_none;
- f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+ f_macro_strings_string_lengths_resize(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
if (f_status_is_error(allocation_status)) {
- f_delete_string_lengths(allocation_status, delimits);
+ f_macro_strings_string_lengths_delete(allocation_status, delimits);
return allocation_status;
}
}
pre_allocate_size = buffer->used + (input->stop - input->start) + 3 + f_fss_default_allocation_step_string;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size += slash_count;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
buffer_position.stop = buffer->used;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size += 2;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size += slash_count + 1;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
pre_allocate_size++;
if (pre_allocate_size > buffer->size) {
- f_resize_dynamic_string(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
i++; \
} \
\
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
}
#endif // _di_fl_macro_fss_apply_delimit_placeholders_
#define fl_macro_fss_object_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \
if (input.start >= buffer.used) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.stop = buffer.used - 1; \
return eos_status; \
} \
else if (input.start > input.stop) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.stop = input.stop; \
return stop_status; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.stop = buffer.used - 1; \
return eos_status; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.stop = input.stop; \
return stop_status; \
#define fl_macro_fss_content_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \
if (input.start >= buffer.used) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = buffer.used - 1; \
return eos_status; \
} \
else if (input.start > input.stop) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = input.stop; \
return stop_status; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = buffer.used - 1; \
return eos_status; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = input.stop; \
return stop_status; \
#define fl_macro_fss_content_return_on_overflow_reset(buffer, input, found, delimits, eos_status, stop_status, set_stop) \
if (input.start >= buffer.used) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
input.start = set_stop; \
found.array[found.used].stop = set_stop; \
} \
else if (input.start > input.stop) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
input.start = set_stop; \
found.array[found.used].stop = set_stop; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
input.start = set_stop; \
found.array[found.used].stop = set_stop; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
input.start = set_stop; \
found.array[found.used].stop = set_stop; \
if (content.used >= content.size) { \
f_status status = f_none; \
\
- f_resize_fss_content(status, content, content.size + f_fss_default_allocation_step); \
+ f_macro_fss_content_resize(status, content, content.size + f_fss_default_allocation_step); \
if (f_status_is_error(status)) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
return status; \
} \
++input.start; \
if (input.start >= buffer.used) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
return eos_status; \
} \
if (input.start > input.stop) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
return stop_status; \
} \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
return eos_status; \
} \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
return stop_status; \
} \
++input.start; \
if (input.start >= buffer.used) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = input.stop; \
return eos_status; \
} \
if (input.start > input.stop) { \
f_status allocation_status = f_none; \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = input.stop; \
return stop_status; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = input.stop; \
return eos_status; \
buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
i++; \
} \
- f_delete_string_lengths(allocation_status, delimits); \
+ f_macro_strings_string_lengths_delete(allocation_status, delimits); \
\
found.array[found.used].stop = input.stop; \
return stop_status; \
f_status status = f_none;
if (serialized->used + value.used + 1 >= serialized->size) {
- f_resize_dynamic_string(status, (*serialized), serialized->size + value.used + 1);
+ f_macro_string_dynamic_resize(status, (*serialized), serialized->size + value.used + 1);
if (f_status_is_error(status)) return status;
}
if (serialized.string[i] == f_serialized_simple_splitter || i == serialized.used) {
if (locations->used + width >= locations->size) {
- f_resize_string_locations(status, (*locations), locations->size + f_serialized_default_allocation_step);
+ f_macro_strings_string_locations_resize(status, (*locations), locations->size + f_serialized_default_allocation_step);
if (f_status_is_error(status)) return status;
}
f_status status = f_none;
if (result == 0) {
- f_new_dynamic_string(status, (*result), size);
+ f_macro_string_dynamic_new(status, (*result), size);
}
else {
- f_resize_dynamic_string(status, (*result), size);
+ f_macro_string_dynamic_resize(status, (*result), size);
}
if (f_status_is_error(status)) {
f_status status = f_none;
if (result == 0) {
- f_new_utf_string_dynamic(status, (*result), size);
+ f_macro_utf_string_new_dynamic(status, (*result), size);
}
else {
- f_resize_utf_string_dynamic(status, (*result), size);
+ f_macro_utf_string_dynamic_resize(status, (*result), size);
}
if (f_status_is_error(status)) {
name_size = strnlen(last_slash, PATH_MAX);
if (name_size > 1) {
- f_new_string(status, program_name, name_size + 1);
+ f_macro_strings_string_new(status, program_name, name_size + 1);
if (f_status_is_error(status)) return status;
}
for (f_string_length i = 0; i < arguments.used; i++) {
- f_new_string(status, fixed_arguments[i + 1], arguments.array[i].used + 1);
+ f_macro_strings_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1);
if (f_status_is_error(status)) {
f_status status2 = f_none;
- if (name_size > 0) f_delete_string(status, program_name, name_size);
+ if (name_size > 0) f_macro_strings_string_delete(status, program_name, name_size);
for (f_string_length j = 0; j < i; j++) {
- f_delete_string(status2, fixed_arguments[i + 1], arguments.array[j].used + 1);
+ f_macro_strings_string_delete(status2, fixed_arguments[i + 1], arguments.array[j].used + 1);
}
return status;
if (process_id < 0) {
f_status status2 = f_none;
- if (name_size > 0) f_delete_string(status, program_name, name_size);
+ if (name_size > 0) f_macro_strings_string_delete(status, program_name, name_size);
for (f_string_length i = 0; i < arguments.used; i++) {
- f_delete_string(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
+ f_macro_strings_string_delete(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
} // for
return f_status_set_error(f_fork_failed);
// have the parent wait for the child process to finish
waitpid(process_id, results, 0);
- if (name_size > 0) f_delete_string(status, program_name, name_size);
+ if (name_size > 0) f_macro_strings_string_delete(status, program_name, name_size);
{
f_status status2 = f_none;
for (f_string_length i = 0; i < arguments.used; i++) {
- f_delete_string(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
+ f_macro_strings_string_delete(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
} // for
}
f_status status = f_none;
for (f_string_length i = 0; i < arguments.used; i++) {
- f_new_string(status, fixed_arguments[i + 1], arguments.array[i].used + 1);
+ f_macro_strings_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1);
if (f_status_is_error(status)) {
f_status status2 = f_none;
for (f_string_length j = 0; j < i; j++) {
- f_delete_string(status2, fixed_arguments[i + 1], arguments.array[j].used + 1);
+ f_macro_strings_string_delete(status2, fixed_arguments[i + 1], arguments.array[j].used + 1);
}
return status;
f_status status2 = f_none;
for (f_string_length i = 0; i < arguments.used; i++) {
- f_delete_string(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
+ f_macro_strings_string_delete(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
} // for
return f_status_set_error(f_fork_failed);
f_status status2 = f_none;
for (f_string_length i = 0; i < arguments.used; i++) {
- f_delete_string(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
+ f_macro_strings_string_delete(status2, fixed_arguments[i + 1], arguments.array[i].used + 1);
}
}
do {
if (objects->used >= objects->size) {
- f_resize_fss_objects(status, (*objects), objects->used + f_fss_default_allocation_step);
+ f_macro_fss_objects_resize(status, (*objects), objects->used + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
}
- f_resize_fss_contents(status, (*contents), contents->used + f_fss_default_allocation_step);
+ f_macro_fss_contents_resize(status, (*contents), contents->used + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
if (contents->array[contents->used].used >= contents->array[contents->used].size) {
f_status status = f_none;
- f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
if (contents->array[contents->used].used >= contents->array[contents->used].size) {
f_status status = f_none;
- f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
}
else {
if (buffer->used >= buffer->size) {
- f_resize_dynamic_string(status, (*buffer), buffer->size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), buffer->size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
do {
if (objects->used >= objects->size) {
- f_resize_fss_objects(status, (*objects), objects->used + f_fss_default_allocation_step);
+ f_macro_fss_objects_resize(status, (*objects), objects->used + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
}
- f_resize_fss_contents(status, (*contents), contents->used + f_fss_default_allocation_step);
+ f_macro_fss_contents_resize(status, (*contents), contents->used + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
if (contents->array[contents->used].used >= contents->array[contents->used].size) {
f_status status = f_none;
- f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
if (contents->array[contents->used].used >= contents->array[contents->used].size) {
f_status status = f_none;
- f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
}
else {
if (buffer->used >= buffer->size) {
- f_resize_dynamic_string(status, (*buffer), buffer->size + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, (*buffer), buffer->size + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) return status;
}
do {
if (objects->used >= objects->size) {
- f_resize_fss_objects(status, (*objects), objects->used + f_fss_default_allocation_step);
+ f_macro_fss_objects_resize(status, (*objects), objects->used + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
}
- f_resize_fss_contents(status, (*contents), contents->used + f_fss_default_allocation_step);
+ f_macro_fss_contents_resize(status, (*contents), contents->used + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
if (contents->array[contents->used].used >= contents->array[contents->used].size) {
f_status status = f_none;
- f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
if (contents->array[contents->used].used >= contents->array[contents->used].size) {
f_status status = f_none;
- f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+ f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
if (f_status_is_error(status)) {
return status;
} // for
}
- f_resize_dynamic_strings(status, arguments, 7);
+ f_macro_string_dynamics_resize(status, arguments, 7);
if (f_status_is_error(status)) {
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory");
arguments.array[5].used = 0;
arguments.array[6].used = 0;
- f_delete_dynamic_strings(status, arguments);
+ f_macro_string_dynamics_delete(status, arguments);
firewall_delete_local_data(&local);
firewall_delete_data(data);
return status;
{
f_dynamic_string file_path = f_dynamic_string_initialize;
- f_resize_dynamic_string(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1);
+ f_macro_string_dynamic_resize(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1);
if (f_status_is_error(status)) {
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: unable to allocate memory.");
status = firewall_buffer_rules(file_path.string, f_true, &local, data);
- f_delete_dynamic_string(status2, file_path);
+ f_macro_string_dynamic_delete(status2, file_path);
}
if (f_status_is_error(status)) {
f_string_length i = 0;
while (i < firewall_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_dynamic_strings(status, data->chains);
- f_delete_string_lengths(status, data->remaining);
- f_delete_dynamic_strings(status, data->devices);
+ f_macro_string_dynamics_delete(status, data->chains);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
+ f_macro_string_dynamics_delete(status, data->devices);
fl_delete_color_context(status, data->context);
}
else {
if (data.devices.array[local.device].used > 0) {
- f_new_dynamic_string(status, device, data.devices.array[local.device].used);
+ f_macro_string_dynamic_new(status, device, data.devices.array[local.device].used);
if (f_status_is_error(status)) {
- f_delete_dynamic_string(status2, device);
+ f_macro_string_dynamic_delete(status2, device);
return status;
}
is_ip_list = f_false;
ip_list_direction = f_false;
- f_delete_dynamic_string(status2, ip_list);
+ f_macro_string_dynamic_delete(status2, ip_list);
// process chain rule
if (length >= firewall_chain_length && fl_compare_strings(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_chain, length, firewall_chain_length) == f_equal_to) {
invalid = f_true;
}
else if (length >= firewall_device_all_length && fl_compare_strings(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == f_equal_to) {
- f_delete_dynamic_string(status, device);
+ f_macro_string_dynamic_delete(status, device);
device_all = f_true;
continue;
}
else if (length >= firewall_device_this_length && fl_compare_strings(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_this, length, firewall_device_this_length) == f_equal_to) {
if (data.devices.array[local.device].used > 0) {
if (data.devices.array[local.device].used > device.size) {
- f_resize_dynamic_string(status, device, data.devices.array[local.device].used);
+ f_macro_string_dynamic_resize(status, device, data.devices.array[local.device].used);
if (f_status_is_error(status)) break;
}
device.used = data.devices.array[local.device].used;
}
else {
- f_delete_dynamic_string(status, device);
+ f_macro_string_dynamic_delete(status, device);
}
device_all = f_false;
if (!invalid) {
if (length > 0) {
if (length > device.size) {
- f_resize_dynamic_string(status, device, length);
+ f_macro_string_dynamic_resize(status, device, length);
if (f_status_is_error(status)) break;
}
device.used = length;
}
else {
- f_delete_dynamic_string(status, device);
+ f_macro_string_dynamic_delete(status, device);
}
device_all = f_false;
use_protocol = f_false;
}
else if (length > 0) {
- f_delete_dynamic_string(status, protocol);
- f_new_dynamic_string(status, protocol, length);
+ f_macro_string_dynamic_delete(status, protocol);
+ f_macro_string_dynamic_new(status, protocol, length);
if (f_status_is_error(status)) break;
for (r = repeat; r > 0; r--) {
// first add the program name
- f_delete_dynamic_strings(status, arguments);
- f_new_dynamic_strings(status, arguments, firewall_default_allocation_step);
+ f_macro_string_dynamics_delete(status, arguments);
+ f_macro_string_dynamics_new(status, arguments, firewall_default_allocation_step);
if (f_status_is_error(status)) break;
}
}
- f_delete_dynamic_string(status, argument);
+ f_macro_string_dynamic_delete(status, argument);
if (f_status_is_error(status)) break;
// process the action when a non-none chain is specified.
if (chain != firewall_chain_none_id && action != firewall_action_none_id) {
if (action == firewall_action_append_id) {
- f_new_dynamic_string(status, argument, firewall_action_append_command_length);
+ f_macro_string_dynamic_new(status, argument, firewall_action_append_command_length);
if (f_status_is_error(status)) break;
argument.used = firewall_action_append_command_length;
}
else if (action == firewall_action_insert_id) {
- f_new_dynamic_string(status, argument, firewall_action_insert_command_length);
+ f_macro_string_dynamic_new(status, argument, firewall_action_insert_command_length);
if (f_status_is_error(status)) break;
argument.used = firewall_action_insert_command_length;
}
else if (action == firewall_action_policy_id) {
- f_new_dynamic_string(status, argument, firewall_action_policy_command_length);
+ f_macro_string_dynamic_new(status, argument, firewall_action_policy_command_length);
if (f_status_is_error(status)) break;
if (argument.used > 0) {
firewall_macro_append_argument_to_arguments(status, arguments, argument)
if (f_status_is_error(status)) {
- f_delete_dynamic_string(status2, argument);
+ f_macro_string_dynamic_delete(status2, argument);
break;
}
// process the chain, which is required by the action.
if (chain == firewall_chain_custom_id) {
if (data.chains.array[local.chain_ids.array[local.chain]].used > 0) {
- f_new_dynamic_string(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used);
+ f_macro_string_dynamic_new(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used);
if (f_status_is_error(status)) break;
}
}
else if (chain == firewall_chain_forward_id) {
- f_new_dynamic_string(status, argument, firewall_chain_forward_length);
+ f_macro_string_dynamic_new(status, argument, firewall_chain_forward_length);
if (f_status_is_error(status)) break;
argument.used = firewall_chain_forward_length;
}
else if (chain == firewall_chain_postrouting_id) {
- f_new_dynamic_string(status, argument, firewall_chain_postrouting_length);
+ f_macro_string_dynamic_new(status, argument, firewall_chain_postrouting_length);
if (f_status_is_error(status)) break;
argument.used += firewall_chain_postrouting_length;
}
else if (chain == firewall_chain_prerouting_id) {
- f_new_dynamic_string(status, argument, firewall_chain_prerouting_length);
+ f_macro_string_dynamic_new(status, argument, firewall_chain_prerouting_length);
if (f_status_is_error(status)) break;
argument.used = firewall_chain_prerouting_length;
}
else if (chain == firewall_chain_input_id) {
- f_new_dynamic_string(status, argument, firewall_chain_input_length);
+ f_macro_string_dynamic_new(status, argument, firewall_chain_input_length);
if (f_status_is_error(status)) break;
argument.used = firewall_chain_input_length;
}
else if (chain == firewall_chain_output_id) {
- f_new_dynamic_string(status, argument, firewall_chain_output_length);
+ f_macro_string_dynamic_new(status, argument, firewall_chain_output_length);
if (f_status_is_error(status)) break;
if (device.used > 0 && (direction == firewall_direction_input_id || direction == firewall_direction_output_id)) {
if (length < firewall_device_all_length || fl_compare_strings(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == f_not_equal_to) {
if (direction == firewall_direction_input_id) {
- f_new_dynamic_string(status, argument, firewall_device_input_command_length);
+ f_macro_string_dynamic_new(status, argument, firewall_device_input_command_length);
if (f_status_is_error(status)) break;
firewall_macro_concat_string(argument.string, firewall_device_input_command, firewall_device_input_command_length);
argument.used = firewall_device_input_command_length;
}
else if (direction == firewall_direction_output_id) {
- f_new_dynamic_string(status, argument, firewall_device_output_command_length);
+ f_macro_string_dynamic_new(status, argument, firewall_device_output_command_length);
if (f_status_is_error(status)) break;
firewall_macro_concat_string(argument.string, firewall_device_output_command, firewall_device_output_command_length);
// add the device.
if (device.used > 0) {
- f_new_dynamic_string(status, argument, device.used);
+ f_macro_string_dynamic_new(status, argument, device.used);
if (f_status_is_error(status)) break;
}
if (use_protocol) {
- f_new_dynamic_string(status, argument, firewall_protocol_command_length);
+ f_macro_string_dynamic_new(status, argument, firewall_protocol_command_length);
if (f_status_is_error(status)) break;
}
if (protocol.used > 0) {
- f_new_dynamic_string(status, argument, protocol.used);
+ f_macro_string_dynamic_new(status, argument, protocol.used);
if (f_status_is_error(status)) break;
length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter);
if (length > 0) {
- f_new_dynamic_string(status, ip_list, length);
+ f_macro_string_dynamic_new(status, ip_list, length);
if (f_status_is_error(status)) {
// prevent the loop below from being processed.
length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter);
if (length > 0) {
- f_new_dynamic_string(status, argument, length);
+ f_macro_string_dynamic_new(status, argument, length);
if (f_status_is_error(status)) break;
f_fss_objects basic_objects = f_fss_objects_initialize;
f_fss_contents basic_contents = f_fss_objects_initialize;
- f_new_dynamic_string(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step);
+ f_macro_string_dynamic_new(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step);
if (status == f_none) {
firewall_macro_concat_string(file_path.string, network_path, network_path_length);
f_dynamic_string ip_list_action = f_dynamic_string_initialize;
if (ip_list_direction) {
- f_resize_dynamic_string(status, ip_list_action, firewall_ip_list_destination_action_length);
+ f_macro_string_dynamic_resize(status, ip_list_action, firewall_ip_list_destination_action_length);
if (f_status_is_error(status)) break;
ip_list_action.used = firewall_ip_list_destination_action_length;
}
else {
- f_resize_dynamic_string(status, ip_list_action, firewall_ip_list_source_action_length);
+ f_macro_string_dynamic_resize(status, ip_list_action, firewall_ip_list_source_action_length);
if (f_status_is_error(status)) break;
status = f_none;
if (arguments.used + 2 > arguments.size) {
- f_resize_dynamic_strings(status, arguments, arguments.size + 2);
+ f_macro_string_dynamics_resize(status, arguments, arguments.size + 2);
}
if (f_status_is_error(status)) {
fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: unable to allocate memory");
- f_delete_dynamic_string(status2, ip_list_action);
+ f_macro_string_dynamic_delete(status2, ip_list_action);
}
else {
f_dynamic_string ip_argument = f_dynamic_string_initialize;
firewall_macro_append_argument_to_arguments(status, arguments, ip_list_action)
if (f_status_is_error(status)) {
- f_delete_dynamic_string(status2, ip_argument);
+ f_macro_string_dynamic_delete(status2, ip_argument);
break;
}
for (; buffer_counter < basic_objects.used; buffer_counter++) {
ip_length = firewall_macro_structure_size(basic_objects, buffer_counter);
- f_new_dynamic_string(status, ip_argument, ip_length);
+ f_macro_string_dynamic_new(status, ip_argument, ip_length);
if (f_status_is_error(status)) {
fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: unable to allocate memory");
fprintf(f_standard_error, "\n");
// remove ip_argument from arguments string.
- f_delete_dynamic_string(status2, arguments.array[arguments.used]);
+ f_macro_string_dynamic_delete(status2, arguments.array[arguments.used]);
arguments.used--;
break;
fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
// remove ip_argument from arguments string.
- f_delete_dynamic_string(status2, arguments.array[arguments.used]);
+ f_macro_string_dynamic_delete(status2, arguments.array[arguments.used]);
arguments.used--;
break;
}
// remove ip_argument from arguments string.
- f_delete_dynamic_string(status2, arguments.array[arguments.used]);
+ f_macro_string_dynamic_delete(status2, arguments.array[arguments.used]);
arguments.used--;
} // for
- f_delete_dynamic_string(status2, ip_argument);
+ f_macro_string_dynamic_delete(status2, ip_argument);
// remove ip_list_action from arguments string.
- f_delete_dynamic_string(status2, arguments.array[arguments.used]);
+ f_macro_string_dynamic_delete(status2, arguments.array[arguments.used]);
arguments.used--;
}
}
}
}
- f_delete_dynamic_string(status2, local_buffer);
- f_delete_dynamic_string(status2, file_path);
- f_delete_fss_objects(status2, basic_objects);
- f_delete_fss_contents(status2, basic_contents);
+ f_macro_string_dynamic_delete(status2, local_buffer);
+ f_macro_string_dynamic_delete(status2, file_path);
+ f_macro_fss_objects_delete(status2, basic_objects);
+ f_macro_fss_contents_delete(status2, basic_contents);
if (status == f_failure || status == f_invalid_parameter) break;
}
} // for
} // for
- f_delete_dynamic_string(status2, ip_list);
- f_delete_dynamic_string(status2, argument);
- f_delete_dynamic_strings(status2, arguments);
- f_delete_dynamic_string(status2, device);
- f_delete_dynamic_string(status2, protocol);
+ f_macro_string_dynamic_delete(status2, ip_list);
+ f_macro_string_dynamic_delete(status2, argument);
+ f_macro_string_dynamics_delete(status2, arguments);
+ f_macro_string_dynamic_delete(status2, device);
+ f_macro_string_dynamic_delete(status2, protocol);
return status;
}
f_dynamic_string fixed_string = f_dynamic_string_initialize;
- f_delete_array_lengths(status, local->chain_ids);
- f_new_array_lengths(status, local->chain_ids, local->chain_objects.used);
+ f_macro_types_array_lengths_delete(status, local->chain_ids);
+ f_macro_types_array_lengths_new(status, local->chain_ids, local->chain_objects.used);
if (f_status_is_error(status)) {
return status;
}
- f_new_dynamic_strings(status, arguments, 2);
+ f_macro_string_dynamics_new(status, arguments, 2);
if (f_status_is_error(status)) {
return status;
}
- f_new_dynamic_string(status, arguments.array[0], firewall_chain_create_command_length);
+ f_macro_string_dynamic_new(status, arguments.array[0], firewall_chain_create_command_length);
if (f_status_is_error(status)) {
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
arguments.array[0].used = firewall_chain_create_command_length;
- f_new_dynamic_string(status, arguments.array[1], firewall_default_allocation_step);
+ f_macro_string_dynamic_new(status, arguments.array[1], firewall_default_allocation_step);
if (f_status_is_error(status)) {
arguments.used = 1;
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
if (new_chain) {
if (data->chains.used >= data->chains.size) {
- f_resize_dynamic_strings(status, data->chains, data->chains.used + firewall_default_allocation_step);
+ f_macro_string_dynamics_resize(status, data->chains, data->chains.used + firewall_default_allocation_step);
if (f_status_is_error(status)) {
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
arguments.array[1].used = 0;
if (length > arguments.array[1].size) {
- f_resize_dynamic_string(status, arguments.array[1], length);
+ f_macro_string_dynamic_resize(status, arguments.array[1], length);
if (f_status_is_error(status)) {
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
}
- f_new_dynamic_string(status, data->chains.array[data->chains.used], length);
+ f_macro_string_dynamic_new(status, data->chains.array[data->chains.used], length);
if (f_status_is_error(status)) {
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_execute_program()", f_status_set_error(status));
}
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
}
i++;
} // while
- f_delete_dynamic_strings(status2, arguments);
+ f_macro_string_dynamics_delete(status2, arguments);
return status;
}
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling firewall_perform_commands().", f_status_set_error(status));
}
- f_delete_fss_objects(status2, local->rule_objects);
- f_delete_fss_contents(status2, local->rule_contents);
+ f_macro_fss_objects_delete(status2, local->rule_objects);
+ f_macro_fss_contents_delete(status2, local->rule_contents);
return status;
}
}
- f_delete_fss_objects(status2, local->rule_objects);
- f_delete_fss_contents(status2, local->rule_contents);
+ f_macro_fss_objects_delete(status2, local->rule_objects);
+ f_macro_fss_contents_delete(status2, local->rule_contents);
return status;
}
local->device = 0;
local->chain = 0;
- f_delete_dynamic_string(status, local->buffer);
- f_delete_array_lengths(status, local->chain_ids);
- f_delete_fss_objects(status, local->chain_objects);
- f_delete_fss_contents(status, local->chain_contents);
- f_delete_fss_objects(status, local->rule_objects);
- f_delete_fss_contents(status, local->rule_contents);
+ f_macro_string_dynamic_delete(status, local->buffer);
+ f_macro_types_array_lengths_delete(status, local->chain_ids);
+ f_macro_fss_objects_delete(status, local->chain_objects);
+ f_macro_fss_contents_delete(status, local->chain_contents);
+ f_macro_fss_objects_delete(status, local->rule_objects);
+ f_macro_fss_contents_delete(status, local->rule_contents);
return f_none;
}
}
#define firewall_macro_delete_fss_buffers(status, buffer, objects, contents) \
- f_delete_dynamic_string(status, buffer); \
- f_delete_fss_objects(status, objects); \
- f_delete_fss_contents(status, contents);
+ f_macro_string_dynamic_delete(status, buffer); \
+ f_macro_fss_objects_delete(status, objects); \
+ f_macro_fss_contents_delete(status, contents);
#define firewall_macro_concat_string(destination, source, length) \
memcpy((void *)(destination), source, sizeof(char) * length);
// TODO: also report: fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: unable to allocate memory");
#define firewall_macro_append_argument_to_arguments(status, arguments, argument) \
if (arguments.used >= arguments.size) { \
- f_resize_dynamic_strings(status, arguments, arguments.used + firewall_default_allocation_step); \
+ f_macro_string_dynamics_resize(status, arguments, arguments.used + firewall_default_allocation_step); \
\
if (f_status_is_error(status)) break; \
} \
}
// clear buffers before continuing
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
}
for (; counter < data->remaining.used; counter++) {
}
// clear buffers before repeating the loop
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
} // for
}
else {
}
else if (status == f_no_data_on_stop || status == f_no_data_on_eos) {
// clear buffers, then attempt the next file
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
return f_status_set_warning(status);
}
f_string_length i = 0;
while (i < fss_basic_list_read_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_fss_contents(status, data->contents);
- f_delete_fss_objects(status, data->objects);
- f_delete_dynamic_string(status, data->buffer);
- f_delete_string_lengths(status, data->remaining);
+ f_macro_fss_contents_delete(status, data->contents);
+ f_macro_fss_objects_delete(status, data->objects);
+ f_macro_string_dynamic_delete(status, data->buffer);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", f_status_set_error(status));
}
- f_delete_dynamic_string(status2, input);
+ f_macro_string_dynamic_delete(status2, input);
fss_basic_list_write_delete_data(data);
return f_status_set_error(status);
}
}
}
- f_delete_dynamic_string(status, input);
+ f_macro_string_dynamic_delete(status, input);
}
else if (data->parameters[fss_basic_list_write_parameter_string].result == f_console_result_additional) {
f_dynamic_string input = f_dynamic_string_initialize;
f_string_length i = 0;
while (i < fss_basic_list_write_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_string_lengths(status, data->remaining);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
return f_none;
}
// clear buffers before continuing
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
}
if (data->remaining.used > 0) {
}
// clear buffers before repeating the loop
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
} // for
}
}
}
else if (status == f_no_data_on_stop || status == f_no_data_on_eos) {
// clear buffers, then attempt the next file
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
return f_status_set_warning(status);
}
f_string_length i = 0;
while (i < fss_basic_read_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_fss_contents(status, data->contents);
- f_delete_fss_objects(status, data->objects);
- f_delete_dynamic_string(status, data->buffer);
- f_delete_string_lengths(status, data->remaining);
+ f_macro_fss_contents_delete(status, data->contents);
+ f_macro_fss_objects_delete(status, data->objects);
+ f_macro_string_dynamic_delete(status, data->buffer);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", f_status_set_error(status));
}
- f_delete_dynamic_string(status2, input);
+ f_macro_string_dynamic_delete(status2, input);
fss_basic_write_delete_data(data);
return f_status_set_error(status);
}
}
}
- f_delete_dynamic_string(status, input);
+ f_macro_string_dynamic_delete(status, input);
}
else if (data->parameters[fss_basic_write_parameter_string].result == f_console_result_additional) {
f_dynamic_string input = f_dynamic_string_initialize;
f_string_length i = 0;
while (i < fss_basic_write_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_string_lengths(status, data->remaining);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
return f_none;
}
// clear buffers before continuing
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
}
for (; counter < data->remaining.used; counter++) {
}
// clear buffers before repeating the loop
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
} // for
}
else {
}
else if (status == f_no_data_on_stop || status == f_no_data_on_eos) {
// clear buffers, then attempt the next file
- f_delete_fss_contents(status2, data->contents);
- f_delete_fss_objects(status2, data->objects);
- f_delete_dynamic_string(status2, data->buffer);
+ f_macro_fss_contents_delete(status2, data->contents);
+ f_macro_fss_objects_delete(status2, data->objects);
+ f_macro_string_dynamic_delete(status2, data->buffer);
return f_status_set_warning(status);
}
f_string_length i = 0;
while (i < fss_extended_read_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_fss_contents(status, data->contents);
- f_delete_fss_objects(status, data->objects);
- f_delete_dynamic_string(status, data->buffer);
- f_delete_string_lengths(status, data->remaining);
+ f_macro_fss_contents_delete(status, data->contents);
+ f_macro_fss_objects_delete(status, data->objects);
+ f_macro_string_dynamic_delete(status, data->buffer);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", f_status_set_error(status));
}
- f_delete_dynamic_string(status2, input);
+ f_macro_string_dynamic_delete(status2, input);
fss_extended_write_delete_data(data);
return f_status_set_error(status);
}
if (data->parameters[fss_extended_write_parameter_partial].result == f_console_result_none) {
if (buffer.used >= buffer.size) {
- f_resize_dynamic_string(status, buffer, buffer.used + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) {
return status;
}
}
- f_delete_dynamic_string(status, input);
+ f_macro_string_dynamic_delete(status, input);
}
else if (data->parameters[fss_extended_write_parameter_string].result == f_console_result_additional) {
f_dynamic_string input = f_dynamic_string_initialize;
if (data->parameters[fss_extended_write_parameter_partial].result == f_console_result_none) {
if (buffer.used >= buffer.size) {
- f_resize_dynamic_string(status, buffer, buffer.used + f_fss_default_allocation_step_string);
+ f_macro_string_dynamic_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string);
if (f_status_is_error(status)) {
return status;
f_string_length i = 0;
while (i < fss_extended_write_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_string_lengths(status, data->remaining);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
return f_none;
f_string_length i = 0;
while (i < fss_status_code_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_string_lengths(status, data->remaining);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
return f_none;
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling firewall_perform_commands().", f_status_set_error(status));
}
- f_delete_fss_objects(status2, local->rule_objects);
- f_delete_fss_contents(status2, local->rule_contents);
+ f_macro_fss_objects_delete(status2, local->rule_objects);
+ f_macro_fss_contents_delete(status2, local->rule_contents);
return f_status_set_error(status);
}
}
- f_delete_fss_objects(status2, local->rule_objects);
- f_delete_fss_contents(status2, local->rule_contents);
+ f_macro_fss_objects_delete(status2, local->rule_objects);
+ f_macro_fss_contents_delete(status2, local->rule_contents);
return status;
}
#endif // _init_rules_process_main_
if (kernel_command_line_string) {
f_status status_free = f_none;
- f_delete_string(status_free, kernel_command_line_string, string_length);
+ f_macro_strings_string_delete(status_free, kernel_command_line_string, string_length);
}
}
fl_color_print_line(f_standard_error, argument.context.error, argument.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_fss_basic_list_read() for the file '%s'.", f_status_set_error(status), init_rule_core_file);
}
- f_delete_dynamic_string(buffer);
- f_delete_fss_objects(objects);
- f_delete_fss_contents(contents);
+ f_macro_string_dynamic_delete(buffer);
+ f_macro_fss_objects_delete(objects);
+ f_macro_fss_contents_delete(contents);
return status;
}
fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling firewall_perform_commands().", f_status_set_error(status));
}
- f_delete_fss_objects(status2, (*rule_objects));
- f_delete_fss_contents(status2, (*rule_contents));
+ f_macro_fss_objects_delete(status2, (*rule_objects));
+ f_macro_fss_contents_delete(status2, (*rule_contents));
return f_status_set_error(status);
}
}
}
}
- f_delete_fss_objects(status2, (*rule_objects));
- f_delete_fss_contents(status2, (*rule_contents));
+ f_macro_fss_objects_delete(status2, (*rule_objects));
+ f_macro_fss_contents_delete(status2, (*rule_contents));
*/
- f_delete_dynamic_string(buffer);
- f_delete_fss_objects(objects);
- f_delete_fss_contents(contents);
+ f_macro_string_dynamic_delete(buffer);
+ f_macro_fss_objects_delete(objects);
+ f_macro_fss_contents_delete(contents);
return status;
}
#endif // _di_init_process_main_rule_
}
#define delete_init_rule(status, rule) \
- f_delete_dynamic_string(status, rule.name); \
+ f_macro_string_dynamic_delete(status, rule.name); \
if (status == f_none) { \
- f_delete_dynamic_string(status, rule.directory); \
+ f_macro_string_dynamic_delete(status, rule.directory); \
} \
if (status == f_none) { \
- f_delete_dynamic_string(status, rule.file); \
+ f_macro_string_dynamic_delete(status, rule.file); \
} \
if (status == f_none) { \
rule.require = 0; \
}
#define destroy_init_rule(status, rule) \
- f_destroy_dynamic_string(status, rule.name); \
+ f_macro_string_dynamic_destroy(status, rule.name); \
if (status == f_none) { \
- f_destroy_dynamic_string(status, rule.directory); \
+ f_macro_string_dynamic_destroy(status, rule.directory); \
} \
if (status == f_none) { \
- f_destroy_dynamic_string(status, rule.file); \
+ f_macro_string_dynamic_destroy(status, rule.file); \
} \
if (status == f_none) { \
rule.require = 0; \
#define init_rules_initialize { 0, 0, 0 }
- #define f_delete_init_rules(status, rules) \
+ #define f_init_rules_delete(status, rules) \
status = f_none; \
while (rules.size > 0) { \
--rules.size; \
if (status == f_none) status = f_delete((f_void_p *) & rules.array, sizeof(init_rule), rules.size); \
if (status == f_none) rules.used = 0;
- #define f_destroy_init_rules(status, rules) \
+ #define f_init_rules_destroy(status, rules) \
status = f_none; \
while (rules.size > 0) { \
--rules.size; \
if (status == f_none) status = f_destroy((f_void_p *) & rules.array, sizeof(init_rule), rules.size); \
if (status == f_none) rules.used = 0;
- #define f_resize_init_rules(status, rules, new_length) \
+ #define f_init_rules_resize(status, rules, new_length) \
status = f_none; \
if (new_length < rules.size) { \
f_string_length i = rules.size - new_length; \
if (rules.used > rules.size) rules.used = new_length; \
}
- #define f_adjust_init_rules(status, rules, new_length) \
+ #define f_init_rules_adjust(status, rules, new_length) \
status = f_none; \
if (new_length < rules.size) { \
f_string_length i = rules.size - new_length; \
}
#define delete_init_category(status, category) \
- f_delete_dynamic_string(status, category.name); \
+ f_macro_string_dynamic_delete(status, category.name); \
if (status == f_none) { \
delete_init_rule(status, category.last); \
}
#define destroy_init_category(status, category) \
- f_destroy_dynamic_string(status, category.name); \
+ f_macro_string_dynamic_destroy(status, category.name); \
if (status == f_none) { \
destroy_init_rule(status, category.last); \
}
#define init_categorys_initialize { 0, 0, 0 }
- #define f_delete_init_categorys(status, categorys) \
+ #define f_init_categorys_delete(status, categorys) \
status = f_none; \
while (categorys.size > 0) { \
--categorys.size; \
if (status == f_none) status = f_delete((f_void_p *) & categorys.array, sizeof(init_category), categorys.size); \
if (status == f_none) categorys.used = 0;
- #define f_destroy_init_categorys(status, categorys) \
+ #define f_init_categorys_destroy(status, categorys) \
status = f_none; \
while (categorys.size > 0) { \
--categorys.size; \
if (status == f_none) status = f_destroy((f_void_p *) & categorys.array, sizeof(init_category), categorys.size); \
if (status == f_none) categorys.used = 0;
- #define f_resize_init_categorys(status, categorys, new_length) \
+ #define f_init_categorys_resize(status, categorys, new_length) \
status = f_none; \
if (new_length < categorys.size) { \
f_string_length i = categorys.size - new_length; \
if (categorys.used > categorys.size) categorys.used = new_length; \
}
- #define f_adjust_init_categorys(status, categorys, new_length) \
+ #define f_init_categorys_adjust(status, categorys, new_length) \
status = f_none; \
if (new_length < categorys.size) { \
f_string_length i = categorys.size - new_length; \
f_string_length i = 0;
while (i < status_code_total_parameters) {
- f_delete_string_lengths(status, data->parameters[i].additional);
+ f_macro_strings_string_lengths_delete(status, data->parameters[i].additional);
i++;
} // while
- f_delete_string_lengths(status, data->remaining);
+ f_macro_strings_string_lengths_delete(status, data->remaining);
fl_delete_color_context(status, data->context);
return f_none;