Diffusion C API
6.7.4
|
Functions for generating deltas describing the changes to data, and applying deltas to data. More...
Macros | |
#define | DIFF_DEFAULT_MAX_STORAGE |
When generating a delta, a chunk of memory is set aside for working storage. More... | |
#define | DIFF_DEFAULT_BAILOUT_FACTOR |
In order to prevent complex delta generation from using up too much CPU (especially with larger messages), a bailout factor is referenced to abort the process early. More... | |
Functions | |
BUF_T * | diff_apply_binary (BUF_T *old_value, BUF_T *diff) |
Apply a delta to a value, producing a new value. More... | |
BUF_T * | diff_generate_binary (BUF_T *old_value, BUF_T *new_value) |
Generate a delta between two binary values. More... | |
BUF_T * | diff_generate_binary_ex (BUF_T *old_value, BUF_T *new_value, int max_storage, int bailout_factor) |
Generate a delta between two binary values, with additional control over variables that influence the process. More... | |
Functions for generating deltas describing the changes to data, and applying deltas to data.
Copyright © 2016, 2021 Push Technology Ltd., All Rights Reserved.
Use is subject to license terms.
NOTICE: All information contained herein is, and remains the property of Push Technology. The intellectual and technical concepts contained herein are proprietary to Push Technology and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.
#define DIFF_DEFAULT_BAILOUT_FACTOR |
In order to prevent complex delta generation from using up too much CPU (especially with larger messages), a bailout factor is referenced to abort the process early.
If not explicitly specified, this is the value used. If the process does bail out, then a delta may still be generated but may not be of optimal length.
#define DIFF_DEFAULT_MAX_STORAGE |
When generating a delta, a chunk of memory is set aside for working storage.
This is the default value if not explicity specified.
Apply a delta to a value, producing a new value.
buf_free
should be called on the pointer when no longer needed.
old_value | The original value |
diff | The delta (diff) to apply to the original value. |
BUF_T * | A pointer to a BUF_T containing the result of applying the delta to the original value. |
Generate a delta between two binary values.
buf_free
should be called on the pointer when no longer needed.
old_value | The source value |
new_value | The target value |
BUF_T * | A pointer to a BUF_T containing a delta describing how to transform the source value into the target value. If there are no differences or an error occurs, then NULL is returned. |
BUF_T* diff_generate_binary_ex | ( | BUF_T * | old_value, |
BUF_T * | new_value, | ||
int | max_storage, | ||
int | bailout_factor | ||
) |
Generate a delta between two binary values, with additional control over variables that influence the process.
`buf_free` should be called on the pointer when no longer needed.
old_value | The source value |
new_value | The target value |
max_storage | The maximum amount of internal storage to use. |
bailout_factor | Influences when to abort delta generation; smaller values will abort sooner. This is useful with larger messages where the process may use a significant amount of CPU time. |
BUF_T * | A pointer to a BUF_T containing a delta describing how to transform the source value into the target value. If there are no differences or an error occurs, then NULL is returned. |