EasyScript C API
3.5.29
Platform Independent C Library for EasyScript ScripTouch Devices
|
#include <time.h>
Go to the source code of this file.
Data Structures | |
struct | scriptel_signature_protocol |
This structure contains information about a signature protocol that can be used to decode a signature buffer. More... | |
struct | scriptel_cardswipe_protocol |
This structure contains information about a card swipe protocol that can be used to decode a card swipe buffer. More... | |
struct | scriptel_financial_track_one |
This structure represents the first track of a financial card. More... | |
struct | scriptel_financial_track_two |
This structure represents the second track of a financial card. More... | |
struct | scriptel_financial_card |
This structure represents a financial card. More... | |
struct | scriptel_identification_track_one |
This structure represents the first track of an identification card. More... | |
struct | scriptel_identification_track_two |
This structure represents track two of an identification card. More... | |
struct | scriptel_identification_track_three |
This structure represents track three of an identification card. More... | |
struct | scriptel_identification_card |
This structure contains information from an identification card. More... | |
struct | scriptel_coordinate |
This structure represents a single coordinate. More... | |
struct | signature_meta_data |
This structure represents a data about the signature that will follow. More... | |
struct | scriptel_cardswipe |
This structure represents a parsed card swipe. More... | |
union | streaming_event_data |
struct | scriptel_stroke |
This structure represents a stroke which is made up of contingiously connected coordinates. More... | |
struct | scriptel_signature |
This structure represents a signature which is made up up the header information as well as zero or more strokes. More... | |
Macros | |
#define | SCRIPTEL_SYMBOL_EXPORT extern |
#define | SCRIPTEL_SYMBOL_LINKAGE extern |
#define | SCRIPTEL_ERROR_MAX_LEN 512 |
#define | SCRIPTEL_EASYSCRIPT_LIBRARY_VERSION = "3.5.29"; |
#define | SCRIPTEL_EASYSCRIPT_BUILD_DATE = "2022-08-30 17:12:23-0400"; |
Enumerations | |
enum | scriptel_return_status { SCRIPTEL_RETR_ERROR , SCRIPTEL_RETR_SUCCESS } |
This enumeration contains a set of return codes that functions in this library may return. More... | |
enum | scriptel_financial_card_vendor { AMERICAN_EXPRESS , DINERS_CLUB , CARTE_BLANCHE , DISCOVER , ENROUTE , JCB , MASTERCARD , VISA , UNKNOWN } |
This enumeration contains a set of known financial card issuers. More... | |
enum | callback_type { CBT_NEWSTROKE , CBT_COORDINATE , CBT_METADATA , CBT_CANCEL , CBT_END_OF_SIGNATURE , CBT_CARD_DATA } |
Variables | |
static const scriptel_signature_protocol | STN_SIGNATURE_PROTOCOL |
The standard signature protocol for the ScripTouch series devices. More... | |
static const scriptel_cardswipe_protocol | STN_CARDSWIPE_PROTOCOL |
The standard card swipe protocol for the ScripTouch series devices. More... | |
#define SCRIPTEL_EASYSCRIPT_BUILD_DATE = "2022-08-30 17:12:23-0400"; |
The date on which this library was produced. Please don't change this. It is used for support purposes.
#define SCRIPTEL_EASYSCRIPT_LIBRARY_VERSION = "3.5.29"; |
The version number of this EasyScript library. Please don't change this. It is used for support purposes.
#define SCRIPTEL_ERROR_MAX_LEN 512 |
Maximum length of any error message.
#define SCRIPTEL_SYMBOL_EXPORT extern |
This symbol is used to abstract the way in which DLL/shared library symbols are exported. This macro should always resolve to the call/keyword used to export a symbol.
For Linux/OSX this will always resolve to the extern keyword.
#define SCRIPTEL_SYMBOL_LINKAGE extern |
This symbol is used to abstract the way in which DLL/shared library symbols are exported. This macro should always resolve to the call/keyword used to produce or consume the shared library symbols. If the SCRIPTEL_EXPORT_DLL preprocessor define is set it should resolve to export, otherwise import.
For Linux/OSX this will always resolve to the extern keyword.
enum callback_type |
A set of constants indicating the type of data being sent to the application
This enumeration contains a set of return codes that functions in this library may return.
Enumerator | |
---|---|
SCRIPTEL_RETR_ERROR | This return code indicates that the last function called did not complete successfully. Call scriptel_get_last_error() to get a more friendly description of what failed. |
SCRIPTEL_RETR_SUCCESS | This return code indicates that the last function call completed successfully. |
SCRIPTEL_SYMBOL_LINKAGE void scriptel_add_event_listener | ( | void(*)(streaming_event_data *sd) | event_listener | ) |
This function adds an event listener function. The functions added to this list will be called when an event occurs. If an event handler is added more than once, it will be called more than once.
event_listener | a function that takes as a parameter a pointer to a streaming_data union. |
SCRIPTEL_SYMBOL_LINKAGE void scriptel_free_cardswipe | ( | scriptel_cardswipe * | swipe | ) |
This function will free a scriptel_meta_data structure and all members inside of it.
meta | data to be freed. |
SCRIPTEL_SYMBOL_LINKAGE void scriptel_free_memory | ( | ) |
Frees all memory that was allocated during calls. It is not really necessary to call this funcion. Some memory is allocated once and is used statically. This function frees that memory. It will be reallocated, if needed, later.
SCRIPTEL_SYMBOL_LINKAGE void scriptel_free_signature | ( | scriptel_signature * | signature | ) |
This function will free all allocated members inside of a signature structure. It does not free the signature structure itself. Do not attempt to use the structure after freeing it.
signature | Signature to free. |
SCRIPTEL_SYMBOL_LINKAGE const char* scriptel_get_card_issuer_name | ( | scriptel_financial_card_vendor | vendor | ) |
This method attempts to get the name of a financial card issuer by enumeration member.
vendor | Enumeration member pointing to card issuer. |
SCRIPTEL_SYMBOL_LINKAGE char * scriptel_get_last_error | ( | ) |
This function returns the most recent error generated by this library.
When a function returns SCRIPTEL_RETR_ERROR this call can be made to get a human readable English string explaining the error.
SCRIPTEL_SYMBOL_LINKAGE scriptel_return_status scriptel_keyboard_parse_cardswipe | ( | const scriptel_cardswipe_protocol * | swipe_protocol, |
scriptel_cardswipe * | swipe, | ||
char * | buffer, | ||
int | len | ||
) |
This function will attempt to parse a character buffer as a card swipe. You are responsible for allocating the scriptel_cardswipe structure as well as freeing the memory when you're done. The contents of the structure can be freed by calling scriptel_free_cardswipe() after this function returns a successful result.
swipe_protocol | Card swipe protocol to use. |
swipe | Card swipe structure to fill in. |
buffer | Buffer to parse. |
len | Length of buffer, used for bounds checking. |
SCRIPTEL_SYMBOL_LINKAGE scriptel_return_status scriptel_keyboard_parse_char | ( | const scriptel_signature_protocol * | sig_protocol, |
char | chr | ||
) |
This fuction allows you to stream in a set of characters and it will attempt to decode signatures and card swipes as the characters are passed in. To use this method be sure to implement your own EasyScriptEventListener and pass it to scriptel_add_event_listener() prior to passing characters to this function. This listener will be called when specific events are generated by decoding the stream.
sig_protocol | the protocol to use to interpret the data |
chr | Next character in the stream to parse |
SCRIPTEL_SYMBOL_LINKAGE scriptel_return_status scriptel_keyboard_parse_keycode | ( | const scriptel_signature_protocol * | sig_protocol, |
int | code, | ||
int | shift | ||
) |
This fuction allows you to stream in a set of keyboard scancodes and it will attempt to decode signatures and card swipes as the characters are passed in. To use this method be sure to implement your own EasyScriptEventListener and pass it to scriptel_add_event_listener() prior to passing characters to this function. This listener will be called when specific events are generated by decoding the stream.
sig_protocol | the protocol to use to interpret the data |
code | the scancode of the next keyboard event to process |
shift | 0 if the shift key was not down when the scancode was sent, non-zero if it was |
SCRIPTEL_SYMBOL_LINKAGE scriptel_return_status scriptel_keyboard_parse_signature | ( | scriptel_signature_protocol * | sig_protocol, |
scriptel_signature * | signature, | ||
char * | buffer, | ||
int | len | ||
) |
This function will attempt to parse a character buffer as a signature. You are responsible for allocating the scriptel_signature structure as well as freeing the memory when you're done. The contents of the structure can be freed by calling scriptel_free_signature() after this function returns a successful result.
sig_protocol | Signature protocol to use. |
signature | Signature structure to fill in. |
buffer | Null terminated buffer to parse. |
len | Length of buffer, used for bounds checking. The lesser of len and the actual length of the null terminated buffer are used. |
SCRIPTEL_SYMBOL_LINKAGE void scriptel_print_cardswipe | ( | scriptel_cardswipe * | swipe | ) |
This function is a convinence function used to print out the contents of a card swipe structure.
swipe | Card swipe to print. |
SCRIPTEL_SYMBOL_LINKAGE void scriptel_print_signature | ( | scriptel_signature * | signature | ) |
This function is a convinence function used to print out the contents of a signature structure.
signature | Signature to print. |
SCRIPTEL_SYMBOL_LINKAGE void scriptel_remove_all_event_listeners | ( | ) |
This function removes all event listeners.
SCRIPTEL_SYMBOL_LINKAGE void scriptel_remove_event_listener | ( | void(*)(streaming_event_data *sd) | event_listener | ) |
Removes a listener previously added through scriptel_add_event_listener. If it was never added or was previously removed, the call is ignored. If it was added more than once, it will have to be removed more than once...this function only removes the first instance.
event_listener | a pointer to a function that was previously added through scriptel_add_event_listener |
|
static |
The standard card swipe protocol for the ScripTouch series devices.
|
static |
The standard signature protocol for the ScripTouch series devices.