Diffusion C API  6.7.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
delta.h File Reference

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_Tdiff_apply_binary (BUF_T *old_value, BUF_T *diff)
 Apply a delta to a value, producing a new value. More...
 
BUF_Tdiff_generate_binary (BUF_T *old_value, BUF_T *new_value)
 Generate a delta between two binary values. More...
 
BUF_Tdiff_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...
 

Detailed Description

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.

Macro Definition Documentation

#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.

Function Documentation

BUF_T* diff_apply_binary ( BUF_T old_value,
BUF_T diff 
)

Apply a delta to a value, producing a new value.

buf_free should be called on the pointer when no longer needed.

Parameters
old_valueThe original value
diffThe delta (diff) to apply to the original value.
Return values
BUF_T *A pointer to a BUF_T containing the result of applying the delta to the original value.
BUF_T* diff_generate_binary ( BUF_T old_value,
BUF_T new_value 
)

Generate a delta between two binary values.

buf_free should be called on the pointer when no longer needed.

Parameters
old_valueThe source value
new_valueThe target value
Return values
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.
Parameters
old_valueThe source value
new_valueThe target value
max_storageThe maximum amount of internal storage to use.
bailout_factorInfluences 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.
Return values
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.