f_string_length size; // total amount of allocated space
f_string_length used; // total number of allocated spaces used
f_array_length variables; // total number of serialized variables stored
- f_u_short strategy, // serialized strategy in use
} f_serialized;
- #define f_serialized_initialize { f_string_initialize, f_string_length_initialize, f_string_length_initialize, f_array_length_initialize, 0 }
+ #define f_serialized_initialize { f_string_initialize, f_string_length_initialize, f_string_length_initialize, f_array_length_initialize }
#define f_delete_serialized(status, serialized) \
status = f_delete((void **) & serialized.string, sizeof(f_string), serialized.size); \
#endif
#ifndef _di_fl_serialize_
- f_return_status fl_serialize(const f_dynamic_string value, f_serialized *serialized) {
+ f_return_status fl_serialize(const f_u_short strategy, const f_dynamic_string value, f_serialized *serialized) {
#ifndef _di_level_0_parameter_checking_
if (serialized == f_null) return f_invalid_parameter;
#endif // _di_level_0_parameter_checking_
- if (serialized.strategy != f_serialized_strategy_simple) {
+ if (strategy != f_serialized_strategy_simple) {
return f_unsupported;
}
#endif // _di_fl_serialize_
#ifndef _di_fl_unserialize_
- f_return_status fl_unserialize(const f_serialized *serialized, f_string_locations *locations) {
+ f_return_status fl_unserialize(const f_u_short strategy, const f_serialized *serialized, f_string_locations *locations) {
#ifndef _di_level_0_parameter_checking_
if (serialized == f_null) return f_invalid_parameter;
if (locations == f_null) return f_invalid_parameter;
#endif // _di_level_0_parameter_checking_
- if (serialized.strategy != f_serialized_strategy_simple) {
+ if (strategy != f_serialized_strategy_simple) {
return f_unsupported;
}
#endif // _di_fl_unserialize_
#ifndef _di_fl_unserialize_get_
- f_return_status fl_unserialize_get(const f_serialized serialized, const f_array_length index, f_string_location *location) {
+ f_return_status fl_unserialize_get(const f_u_short strategy, const f_serialized serialized, const f_array_length index, f_string_location *location) {
#ifndef _di_level_0_parameter_checking_
if (serialized == f_null) return f_invalid_parameter;
if (location == f_null) return f_invalid_parameter;
#endif // _di_level_0_parameter_checking_
- if (serialized.strategy != f_serialized_strategy_simple) {
+ if (strategy != f_serialized_strategy_simple) {
return f_unsupported;
}
#ifndef _di_fl_serialize_
// this function will append a string to the serialize.
- extern f_return_status fl_serialize(const f_dynamic_string value, f_serialized *serialized);
+ extern f_return_status fl_serialize(const f_u_short strategy, const f_dynamic_string value, f_serialized *serialized);
#endif // _di_fl_serialize_
#ifndef _di_fl_unserialize_
// this function will unserialize a serialized string and store the results in an array of strings.
- extern f_return_status fl_unserialize(const f_serialized serialized, f_string_locations *locations);
+ extern f_return_status fl_unserialize(const f_u_short strategy, const f_serialized serialized, f_string_locations *locations);
#endif // _di_fl_unserialize_
#ifndef _di_fl_unserialize_get_
// this function will pull a single serialized value from the serialized string at the given index.
- extern f_return_status fl_unserialize_get(const f_serialized serialized, const f_array_length index, f_string_location *location);
+ extern f_return_status fl_unserialize_get(const f_u_short strategy, const f_serialized serialized, const f_array_length index, f_string_location *location);
#endif // _di_fl_unserialize_get_
#ifdef __cplusplus