#include <stdbool.h>
#include <stddef.h>
Include dependency graph for fret.h:
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | Gram |
Describes a data structure that is found in a raw data buffer. More... | |
struct | FBuffer |
Struct describes a buffer in memory. More... | |
struct | GramReport |
Struct holds an array of Grams that are a response to a query. More... | |
struct | ScanOptions |
Structure holds options that affect scanning which are specified by the client. More... | |
Typedefs | |
typedef size_t | BufferId |
Uniquely identifies a Buffer. | |
typedef unsigned long | HashValue |
The hash value of the raw data that makes up a Gram. | |
typedef void(* | fret_sendProgressFunc )(unsigned char progress) |
A callback function used to notify the client of the progress of the current scans. | |
Enumerations | |
enum | FretReturn |
Indicates the failure or success of a FRET API call. | |
enum | FretError { NO_ERROR, INCORRECT_PARAM, NULL_PARAM, NON_NULL_PARAM, LIB_NOT_INIT, LIB_DEINIT, NO_BUFFERS, NO_SCANS, CALLBACK_SET, CALLBACK_NULL, INTERNAL_ERROR } |
Describes the failure mode of the last called API function. More... | |
enum | PhaseId { NO_PHASE = 0, PHASE1, PHASE2, PHASE3, PHASE4, PHASE5, PHASE6 } |
Identifies the Phase of scanning the raw data. More... | |
enum | ScanId { , SCAN_ASCII, SCAN_FILL, SCAN_OFFSETS_BYTE, SCAN_OFFSETS_SHORT, SCAN_OFFSETS_LONG, SCAN_GRIND, SCAN_COMMON_OFFSET, SCAN_COMMON_HASH, SCAN_AMALG_OFFHASH, SCAN_PURGE_OVERLAP } |
Identifies an individual scan. More... | |
enum | GramClass |
Class of a Gram. Class if a high level way of grouping Grams. More... | |
enum | GramType |
Describes the exact type of a Gram. Several types of Gram may exist within the same class of Gram. More... | |
Functions | |
bool | fret_init (void) |
bool | fret_deinit (void) |
bool | fret_getError (FretError *const pError) |
bool | fret_setOptions (const ScanOptions *const pOpts) |
bool | fret_putBuffer (FBuffer *pBuffer) |
Pass a buffer containing data to be analysed to the library. | |
bool | fret_deleteBuffer (BufferId bufferId) |
Remove a buffer from the data set that may be examined by the library. | |
bool | fret_deleteAll (void) |
Delete all stored Buffers. | |
bool | fret_runScan (BufferId bufferId, PhaseId phaseId, ScanId scanId) |
Run a scan or batch of scans on a buffer or all of the buffers. | |
bool | fret_getReport (BufferId bufferId, size_t offset, size_t length, GramReport *pReport) |
Retrieve an array of Grams that describe the data structure in a buffer(s). | |
bool | fret_freeReport (GramReport *pReport) |
Frees the memory that is dynamically allocated to a GramReport. | |
bool | fret_setProgressCallback (fret_sendProgressFunc pCallback) |
Passes a pointer to a callback function which is used to notify the client about the progress of the current operation. | |
bool | fret_cancelScan (void) |
Passes a pointer to a callback function which is used to notify the client about the progress of the current operation. |
The FRET library provides functionality to aid the identification of the structure and layout of all types of data buffers. It requires no previous knowledge of the buffers data format. It bases its conclusions on a series of heuristic tests or Scans of the data. Each discovered structure within a buffer is called a Gram and each Gram is described by its Type, Position, Length and Risk. A Grams Risk is a measure of the probability that it is a randomly occuring pattern within the data. The lower a Gramīs Risk, the higher the confidence that it is correctly detected.
|
A callback function used to notify the client of the progress of the current scans. The current progress is sent as a value in the range 0-255, with 0 indicating none of the current scan has been completed.
|
|
The hash value of the raw data that makes up a Gram. A 4 byte hash value that represents the data in a Gram. This can be used for the analysis and comparison of Grams. |
|
|
Class of a Gram. Class if a high level way of grouping Grams. The Class of a Gram tells you the general type of Gram it is and also indicates what type of Scan detected the Gram. |
|
Describes the exact type of a Gram. Several types of Gram may exist within the same class of Gram. The type of a Gram indicates the type of raw data that in the Gram. It does not indicate how the Gram is detected as more than one Scan may detect the same type of Gram or a single Scan may detect multiple types of Gram. |
|
Identifies the Phase of scanning the raw data.
|
|
Identifies an individual scan.
|
|
Passes a pointer to a callback function which is used to notify the client about the progress of the current operation. Passes a pointer to a callback function, which is provided by the client, that is used by the library to send updates on the progress of the current scan. The current scan must have been initiated using a call to fret_runScan(). fret_runScan is not atomic i.e. Grams that have already been generated will remain after the scans are cancelled.
|
|
De-initializes the FRET library and deallocates internal resources.
|
|
Delete all stored Buffers. Delete all memory that has been allocated to Buffer storage. Allocated Buffer identifiers cannot be used again.
|
|
Remove a buffer from the data set that may be examined by the library. Passes the identifier of a buffer. This buffer will be removed from the list of buffers that may be scanned. The identifier of this buffer can never be used again. Memory allocated to the buffer will also be deallocated.
|
|
Frees the memory that is dynamically allocated to a GramReport. Deallocates the memory that is allocated to the Gram array attached to a Gram report. This function should be passed a pointer to a GramReport object that was previously allocated using the function fret_getReport.
|
|
Get an error code describing the cause of the last known error.
|
|
Retrieve an array of Grams that describe the data structure in a buffer(s). Passes a Buffer Id to the library. If there are available Grams for this buffer, the data is returned as an array of Grams. If no Buffer Id is passed, the Grams for all Buffers are returned. There is also the option of specifying that only Grams for a range within a buffer or buffers are required using the offset and length.
|
|
Initialize the FRET library and allocate internal resources.
|
|
Pass a buffer containing data to be analysed to the library. Passes a pointer to a data buffer to the library. The length of the buffer (in bytes) is also passed. A Buffer ID is allocated to the buffer if it is accepted. The library makes a private copy of the buffer and is responsible for its deletion when not required. Therefore, the clientīs copy of the buffer can be safely deleted.
|
|
Run a scan or batch of scans on a buffer or all of the buffers. If a Buffer ID is passed, then only that Buffer is scanned, otherwise all Buffers are scanned. If a Phase Id is specified then only the scans for that phase are applied. If a specific Scan Id is passed then only that scan is applied to the buffer(s).
|
|
Passes client specified options, which affecting scanning behaviour, to the library.
|
|
Passes a pointer to a callback function which is used to notify the client about the progress of the current operation. Passes a pointer to a callback function, which is provided by the client, that is used by the library to send updates on the progress of the current scan.
|