[GetReuse Home] [SDK Start Page] [Usage] [Reference] [Bindings] [ChangeLog] [Download SDK]

Note: GetReuse SDK texts have not been proofread yet. Please be patient.

This is the reference page for the GetReuse SDK API.

Name

gr_registered_to — Returns a name to whom GetReuse SDK is registered

Synopsis

char* gr_registered_to();

Description

Returns NULL in an unregistered version of the GetReuse SDK.

In registered version function gr_registered_to returns a name of the registered user or company. This string is statically allocated in an internal buffer of the GetReuse SDK. You must not free the pointer to the string.


Name

gr_error — Returns a text of the last error

Synopsis

char* gr_error();

Description

Returns NULL if all calls to the GetReuse SDK were successful. Otherwise returns a text of the last error. This string is statically allocated in an internal buffer of the GetReuse SDK. You must not free the pointer to the string. Successful call to the GetReuse SDK does not clear a text of the last error.


Name

gr_measure — Calculates similarity between data

Synopsis

float gr_measure(buf1,  
 buf1_size,  
 buf2,  
 buf2_size); 
void*  buf1;
unsigned int  buf1_size;
void*  buf2;
unsigned int  buf2_size;

Description

Calculates a value of similarity between the content of the buffer buf1 and the content of the buffer buf2. Sizes of buffers in bytes are buf1_size and buf2_size respectively. The calculated value is in range from 0 to 1. If data are exacly the same then the value is 1, if data are independent then the value is 0.

Total size of data (buf1_size plus buf2_size) should be less than 32 Kb.

In case of an error the function returns negative value and sets a text of the error (see the function gr_error).

Pointers to the buffers must be valid, so it is a task of a calling program to check the pointers before passing them to the function.

The similarity between buf1 and buf2 and the similarity between buf2 and buf1 may differ (although theoretically these values should be equal). But the difference is less then 0.01 for high values of similarity (more than 0.60), so you can ignore the difference or you can use the function gr_adjust to calculate an average similarity.

Note for the core GetReuse SDK developers: calculations are performed using buf1 as “dictionary” or “given value”.


Name

gr_adjust — Calculates an average similarity

Synopsis

float gr_adjust(dist1, dist2);
float dist1;
float dist2;

Description

From the description of the function gr_measure: “The similarity between buf1 and buf2 and the similarity between buf2 and buf1 may differ (although theoretically these values should be equal).” The function adjust calculates an average similarity.

© 2003, 2004 DataHansa software. All rights reserved.
All registered names are the property of their respective owners.