13 #ifndef __TRANSFORMER_H__ 14 #define __TRANSFORMER_H__ 24 #define TRANSFORMER_VERSION "8.0.2" 26 #define TRANSFORMER_MAJOR_VERSION 8 27 #define TRANSFORMER_MINOR_VERSION 0 28 #define TRANSFORMER_PATCH_VERSION 2 32 #ifndef TRANSFORMER_EXPORT 33 #define TRANSFORMER_EXPORT extern 35 #ifndef TRANSFORMER_MODULE_EXPORT 36 #define TRANSFORMER_MODULE_EXPORT extern 39 #ifndef TRANSFORMER_EXPORT 40 #define TRANSFORMER_EXPORT __declspec(dllimport) 42 #ifndef TRANSFORMER_MODULE_EXPORT 43 #define TRANSFORMER_MODULE_EXPORT __declspec(dllexport) 124 typedef int (*
tf_nodata_cb)(
tf_handle_t *handle,
int peer,
const char *subject,
short nodata_flags,
int flags,
int id,
void *data);
141 typedef int (*
tf_status_cb)(
tf_handle_t *handle,
int peer,
const char *subject,
int status, u_short code,
const char *message,
int flags,
int id,
void *data);
204 TRANSFORMER_EXPORT
void free_array(
int argc,
char *argv[]);
228 #define PROVIDER_DENY -1 234 #define PROVIDER_OK 0 240 #define TF_LISTENER_DEFAULT 0 249 #define TF_LISTENER_WILDNOW 2 258 #define TF_LISTENER_WILDNEXT 4 270 #define TF_LISTENER_WILDREMOVE 8 276 #define TF_LISTENER_WILDCARD (TF_LISTENER_WILDNOW|TF_LISTENER_WILDNEXT) 283 #define TF_LISTENER_NOASKPEERS 16 289 #define TF_LISTENER_NOASKMODULES 32 299 #define TF_LISTENER_ACCESSORY (1|TF_LISTENER_NOASKPEERS|TF_LISTENER_NOASKMODULES) 309 #define TF_LISTENER_PROVIDEONCE 64 317 #define TF_LISTENER_NOREGEX 128 325 #define TF_LISTENER_ONCE 256 345 TRANSFORMER_EXPORT
void tf_handle_set_listener_data(
tf_handle_t *handle,
void *data);
406 int (*discard_object)(
int peer,
char *orig,
char *mapname,
void **userptr);
407 int *(*return_peers)(
char *name,
int *peers_num);
408 ds_data_t *(*map_fields)(
int peerno,
char *basename,
ds_data_t *orig,
void **userptr,
int *cancel_sub);
423 TRANSFORMER_EXPORT
int file_reading();
425 TRANSFORMER_EXPORT
void file_write_pkt(FILE *fp,
ds_data_t *pkt, time_t tim);
431 TRANSFORMER_EXPORT
char *filename_expand(
char *format);
441 TRANSFORMER_EXPORT
int c_debug_level;
443 #define DBG(level) ( ( c_debug_level >= (level) ) ) 455 TRANSFORMER_EXPORT
int debug_level(
char *text);
457 TRANSFORMER_EXPORT
char *debug_string(
int level);
467 #define PACKET_STORE 1 477 #define PACKET_PUBLISH 2 491 #define PACKET_OWRITE 4 508 #define PACKET_FREE 8 520 #define PACKET_NOLISTEN 32 527 #define PACKET_UPDATE 128 538 #define PACKET_NOFEEDTIME 256 574 #define SYMBOL_PUBLISH 2 586 #define SYMBOL_NOSAVE 16 598 #define SYMBOL_NOLISTEN 32 600 TRANSFORMER_EXPORT
int symbol_create(
const char *name,
unsigned flags);
616 TRANSFORMER_EXPORT
void symbol_add_constant(
const char *name,
int fid,
const char *value);
618 TRANSFORMER_EXPORT
char *symbol_get_constant(
const char *name,
int fid);
620 TRANSFORMER_EXPORT
char **
symbol_match(
const char *name,
int *num);
624 TRANSFORMER_EXPORT
void symbol_delete_type2(
const char *name,
const char *index,
int fieldnum);
634 TRANSFORMER_EXPORT
int symbol_request(
const char *name,
update_cb update,
int id,
void *data);
636 TRANSFORMER_EXPORT
int symbol_discard(
const char *name,
update_cb update,
int id,
void *data);
652 TRANSFORMER_EXPORT
char **
tf_symbol_match(
const char *pattern,
int *number);
656 TRANSFORMER_EXPORT
void symbol_unset_flag(
const char *subject,
unsigned int flags);
658 TRANSFORMER_EXPORT
void symbol_set_flag(
const char *subject,
unsigned int flags);
678 int (*strprint)(
char *dest,
size_t len,
void *data);
682 void (*filewrite)(FILE *fp,
void *data);
685 void *(*fileread)(FILE *fp,
char *name);
692 TRANSFORMER_EXPORT
void symbol_remove_alluserdata(
const char *wildcard,
unsigned int id,
void (*dataremover)(
void *data));
722 TRANSFORMER_EXPORT
int udpsignal_addjob(
const char *cmd,
udpcmd_t callback,
const char *msg);
724 TRANSFORMER_EXPORT
int udpsignal_deljob(
const char *cmd,
udpcmd_t callback);
726 TRANSFORMER_EXPORT
void udpsignal_send(
const char *message);
728 TRANSFORMER_EXPORT
void udpsignal_send_argv(
const char *command,
char *argv[]);
744 #define CMD_DUMP_MEMORY "memory_write" 763 #define CMD_RESTORE_MEMORY "memory_read" 774 #define CMD_SYMBOL_DEL_PKTS "symbol_delete" 783 #define CMD_SYMBOL_PUBLISH "symbol_publish" 792 #define CMD_SOURCE_UP "source_up" 801 #define CMD_SOURCE_DOWN "source_down" 814 TRANSFORMER_MODULE_EXPORT
void mod_init(
char *module_name);
820 TRANSFORMER_EXPORT
char *
mon_module_setup(
const char *name,
const char *description,
const char *version);
TRANSFORMER_EXPORT ds5_namespace_t * tf_create_regex_namespace(const char *expr)
Creates a DataSource namespace which will match subject names using a regular expression.
Definition: namespaces.c:63
int symbol_create(const char *name, unsigned int flags)
Create a new symbol within the Transformer memory.
Definition: symbols.c:263
_authdirection
Define the mapping direction used for the authfuncs_t::map_object() call.
Definition: transformer.h:371
TRANSFORMER_EXPORT int tf_symbol_get_type(const char *objname)
Return the type of a particular object.
Definition: symbols.c:605
Define the callback functions that should be implemented by a permissioning module.
Definition: transformer.h:380
int(* tf_update_cb)(tf_handle_t *handle, int peer, ds_data_t *dsdata, int flags, int id, void *data)
Definition of the function type used to process updates.
Definition: transformer.h:109
TRANSFORMER_EXPORT char ** symbol_return_permission_keys(const char *name, int *num)
Returns a list of all the cached permission object keys.
Definition: symbols.c:245
TRANSFORMER_EXPORT void auth_invalidate_perms()
Invalidate permissions for all peers.
Definition: auth.c:164
TRANSFORMER_EXPORT int tf_register_function(const char *name, void *function)
Register a new function against the extension system.
Definition: extender.c:79
int(* provider_cb)(int peer, char *name, int isrequest)
Definition of the function type used for provider callbacks.
Definition: transformer.h:221
TRANSFORMER_EXPORT int tf_handle_set_listener_params(tf_handle_t *handle, tf_update_cb update, tf_nodata_cb nodata, tf_status_cb status, int val, void *data)
Set the the callback parameters for a listener.
Definition: listener.c:728
TRANSFORMER_EXPORT void mod_config_parse_file(const char *file)
Parse a mandatory module configuration file.
Definition: modules.c:368
TRANSFORMER_EXPORT tf_handle_t * tf_add_listener(const char *pattern, int listener_typeflags, tf_update_cb update, tf_nodata_cb nodata, tf_status_cb status, int val, void *data, tf_finalize_cb finalize)
Create a new object listener.
Definition: listener.c:323
TRANSFORMER_EXPORT int packet_update_field(ds_data_t *dest, int fid, const char *value)
Update a field within a packet.
Definition: packet.c:284
TRANSFORMER_EXPORT void symbol_set_userdata(const char *name, unsigned int id, void *ptr)
Register a piece of data against a particular symbol and unique id.
Definition: symboluser.c:237
TRANSFORMER_EXPORT int deregister_type_interest(int typ, update_cb update, int id, void *data)
Deregister an interest in a particular DataSource type.
Definition: compat.c:306
TRANSFORMER_EXPORT void symbol_send_nodata(const char *symname, u_short flags)
Send a "nodata" message to the cache and to interested peers.
Definition: symbols.c:35
Definition: transformer.h:374
TRANSFORMER_MODULE_EXPORT void mod_init(char *module_name)
Module initialisation function.
Definition: formatter.c:95
TRANSFORMER_EXPORT char * symbol_last_field_byname(const char *name, const char *field)
Return the last recieved fieldvalue for a symbol.
Definition: symbols.c:292
TRANSFORMER_EXPORT int tf_symbol_get_status(const char *name, char **status_message_ptr)
Return the status for an object within the cache.
Definition: symbols.c:742
char * desc
Definition: transformer.h:675
Defines the functions required to support userdata preservation.
Definition: transformer.h:667
TRANSFORMER_EXPORT void symbol_remove_userdata(const char *name, unsigned int id)
Remove userdata for a given symbol and unique id.
Definition: symboluser.c:210
TRANSFORMER_EXPORT ds_data_t * symbol_last_permission_update(const char *name, const char *key)
Returns the currently cached permission object data.
Definition: symbols.c:160
TRANSFORMER_EXPORT void packet_contrib(ds_data_t *pkt, void *data, int storeflags)
Contribute an update to the memory core/DataSource.
Definition: packet.c:57
TRANSFORMER_EXPORT void symbol_delete_all_mmaker(const char *name)
Delete all the Type 2 data associated with a symbol.
Definition: symbols.c:571
TRANSFORMER_EXPORT void symbol_delete_permission_key(const char *name, const char *index)
Delete the data associated with a permission key.
Definition: symbols.c:533
TRANSFORMER_EXPORT tf_handle_t * tf_add_listener_get_cache(const char *pattern, int listener_typeflags, tf_update_cb update, tf_nodata_cb nodata, tf_status_cb status, int val, void *data, tf_finalize_cb finalize, ds_data_t **dsdata_ptr)
Create a new object listener returning the cache contents.
Definition: listener.c:411
TRANSFORMER_EXPORT int packet_delete_field(ds_data_t *pkt, int index)
Remove a field in a dsdata.
Definition: packet.c:334
TRANSFORMER_EXPORT int tf_handle_set_status_cb(tf_handle_t *handle, tf_status_cb status)
Set the status callback on a listener.
Definition: listener.c:816
TRANSFORMER_EXPORT int packet_update_field_byname(ds_data_t *dest, const char *field, const char *value)
Update a field within a packet by name.
Definition: packet.c:245
TRANSFORMER_EXPORT tf_handle_t * tf_add_type_listener(int data_type, int listener_typeflags, tf_update_cb update, tf_nodata_cb nodata, tf_status_cb status, int val, void *data, tf_finalize_cb finalize)
Register an interest in a particular DataSource type.
Definition: listener.c:508
TRANSFORMER_EXPORT char * packet_get_field(ds_data_t *pkt, int fid)
Find a field within a packet.
Definition: packet.c:127
TRANSFORMER_EXPORT void symbol_delete_all_permission_keys(const char *name)
Delete all the data associated with a permission object.
Definition: symbols.c:588
enum _authdirection authdirection_t
Define the mapping direction used for the authfuncs_t::map_object() call.
TRANSFORMER_EXPORT char ** tf_symbol_match(const char *pattern, int *number)
Return a list of symbols matching the specifier.
Definition: symbols.c:684
Definition: transformer.h:373
TRANSFORMER_EXPORT int packet_update(ds_data_t *dest, ds_data_t *src)
Update the contents of one packet based on the contents of the other.
Definition: packet.c:149
TRANSFORMER_EXPORT ds_data_t * symbol_last_mmaker_update(const char *name, const char *mmaker)
Returns the currently cached Type 2 data for a symbol/Type 2 index.
Definition: symbols.c:114
TRANSFORMER_EXPORT time_t symbol_last_updatetime(const char *name)
Return the time that the last update was received for this symbol.
Definition: symbols.c:45
TRANSFORMER_EXPORT int tf_handle_set_discard_cb(tf_handle_t *handle, tf_discard_cb discard)
Set the discard callback on a provider.
Definition: listener.c:895
TRANSFORMER_EXPORT char ** symbol_return_mmakers(const char *name, int *num)
Returns a list of all the cached Type 2 market makers.
Definition: symbols.c:188
TRANSFORMER_EXPORT void deregister_provider(const char *wildcard, provider_cb provider)
Deregisters the data provider with the Transformer core for the specified object name pattern...
Definition: legacy_listeners.c:933
TRANSFORMER_EXPORT int tf_handle_set_nodata_cb(tf_handle_t *handle, tf_nodata_cb nodata)
Set the nodata callback on a listener.
Definition: listener.c:792
TRANSFORMER_EXPORT char ** tf_symbol_match_bytype(const char *pattern, int type, int *number)
Return a list of symbols matching the pattern and of the specified type.
Definition: symbols.c:706
TRANSFORMER_EXPORT void register_provider(const char *wildcard, provider_cb provider)
Registers the specified data provider with the Transformer core for the specified object name pattern...
Definition: legacy_listeners.c:901
TRANSFORMER_EXPORT void deregister_userdata_funcs(unsigned int id)
Deregister a set of functions that handled a specific id.
Definition: symboluser.c:92
TRANSFORMER_EXPORT char ** symbol_historic_field(const char *name, int fid, int *number)
Get all data for a particular field number within a symbol.
Definition: symbols.c:405
TRANSFORMER_EXPORT int symbol_get_type(const char *objname)
Return the type of a particular object.
Definition: symbols.c:622
TRANSFORMER_EXPORT void symbol_delete_mmaker(const char *symname, const char *mmaker)
Delete the data associated with a type 2 index.
Definition: symbols.c:552
TRANSFORMER_EXPORT ds5_namespace_t * tf_create_globbed_namespace(const char *globbed)
Creates a DataSource namespace which will match subject names using globbing.
Definition: namespaces.c:29
TRANSFORMER_EXPORT int tf_handle_set_callback_params(tf_handle_t *handle, int id, void *data)
Set the callback parameters on a handle.
Definition: listener.c:919
TRANSFORMER_EXPORT ds_data_t * packet_clone(ds_data_t *src)
Duplicate a DataSource packet.
Definition: packet.c:307
int(* tf_status_cb)(tf_handle_t *handle, int peer, const char *subject, int status, u_short code, const char *message, int flags, int id, void *data)
Definition of the function type used to process status updates.
Definition: transformer.h:141
Definition of the interface that you should implement if you require custom subject matching logic...
Definition: datasrc.h:431
TRANSFORMER_EXPORT void * tf_find_function(const char *name)
Lookup an extension function.
Definition: extender.c:115
TRANSFORMER_EXPORT int register_interest(const char *name, update_cb update, int id, void *data)
Register an interest in a particular group of symbols.
Definition: legacy_listeners.c:537
void(* update_cb)(int peer, ds_data_t *dsdata, time_t update_time, int val, void *data)
Definition of the function type used for update callbacks.
Definition: transformer.h:167
TRANSFORMER_EXPORT void symbol_delete_type2(const char *name, const char *index, int fieldnum)
Delete the data associated with a type 2 index.
Definition: symbols.c:495
TRANSFORMER_EXPORT int register_type_interest(int typ, update_cb update, int id, void *data)
Register an interest in a particular DataSource type.
Definition: compat.c:277
TRANSFORMER_EXPORT char * packet_get_field_byname(ds_data_t *pkt, const char *field)
Find a field within a packet.
Definition: packet.c:92
TRANSFORMER_EXPORT ds_log_t * rtas_log
Name of the Transformer's event log.
Definition: transformer.h:439
int(* tf_nodata_cb)(tf_handle_t *handle, int peer, const char *subject, short nodata_flags, int flags, int id, void *data)
Definition of the function type used to process nodata messages.
Definition: transformer.h:124
TRANSFORMER_EXPORT ds_data_t * symbol_last_update(const char *name)
Returns the currently cached Type 1 data for a symbol.
Definition: symbols.c:70
int(* request_object)(int peer, char *orig, char *mapname, void **userptr)
Definition: transformer.h:395
TRANSFORMER_EXPORT tf_handle_t * tf_add_provider(const char *pattern, int provider_typeflags, tf_request_cb request, tf_discard_cb discard, int val, void *data, tf_finalize_cb finalize)
Registers the specified data provider with the Transformer core.
Definition: listener.c:581
TRANSFORMER_EXPORT int packet_merge(ds_data_t *dest, ds_data_t *src, int *newfields)
Merge the contents of one packet into the other.
Definition: packet.c:178
TRANSFORMER_EXPORT int tf_handle_set_listener_finalize_cb(tf_handle_t *handle, tf_finalize_cb finalize)
Associate a callback for handle deletion with a listener.
Definition: listener.c:548
struct _ds_log ds_log_t
The log file object.
Definition: datasrc.h:174
unsigned int id
Definition: transformer.h:669
TRANSFORMER_EXPORT void * symbol_get_userdata(const char *name, unsigned int id)
Retrieve module specific data for a given symbol and unique id.
Definition: symboluser.c:127
TRANSFORMER_EXPORT int deregister_interest(const char *name, update_cb update, int id, void *data)
Deregister an interest in a particular group of symbols.
Definition: legacy_listeners.c:690
TRANSFORMER_EXPORT void auth_invalidate_peer_perms(int peernum)
Invalidate permissions for an individual peer.
Definition: auth.c:178
char * ident
Definition: transformer.h:672
A data update object.
Definition: datasrc.h:2477
TRANSFORMER_EXPORT int tf_regex_namespace_add_expr(ds5_namespace_t *nspace, const char *expr, int exclude)
Adds a regular expression to a namespace.
Definition: namespaces.c:48
TRANSFORMER_EXPORT void register_userdata_funcs(userinfo_t *user)
Register a set of functions to handle a specific id.
Definition: symboluser.c:65
TRANSFORMER_EXPORT void tf_symbol_send_status(const char *name, int status, const char *message)
Send a status message for an object within the cache.
Definition: symbols.c:778
int(* tf_request_cb)(tf_handle_t *handle, int peer, const char *subject, int flags, int id, void *data)
Definition of the function type used to handle provider requests.
Definition: transformer.h:79
TRANSFORMER_EXPORT int tf_handle_set_provider_params(tf_handle_t *handle, tf_request_cb request, tf_discard_cb discard, int val, void *data)
Set the the callback parameters for a provider.
Definition: listener.c:844
TRANSFORMER_EXPORT void auth_deregister_functions()
Disable the auth API.
Definition: auth.c:151
TRANSFORMER_EXPORT int register_interest_check(const char *name, update_cb update, int id, void *data)
Register an interest in a particular group of symbols checking the provider if necessary.
Definition: legacy_listeners.c:574
void(* udpcmd_t)(int argc, char *argv[])
Definition of the function type used for udp command callbacks.
Definition: transformer.h:720
int(* tf_discard_cb)(tf_handle_t *handle, int peer, const char *subject, int flags, int id, void *data)
Definition of the function type used to handle provider discards.
Definition: transformer.h:94
TRANSFORMER_EXPORT void tf_handle_delete(tf_handle_t *handle)
Delete a handle to a listener or a provider.
Definition: listener.c:672
TRANSFORMER_EXPORT int tf_handle_set_request_cb(tf_handle_t *handle, tf_request_cb request)
Set the request callback on a provider.
Definition: listener.c:871
TRANSFORMER_EXPORT int tf_handle_set_update_cb(tf_handle_t *handle, tf_update_cb update)
Set the update callback on a listener.
Definition: listener.c:768
TRANSFORMER_EXPORT void symbol_remove_alluserdata(const char *wildcard, unsigned int id, void(*dataremover)(void *data))
Delete all userdata associated with a particular id for a group of symbols.
Definition: symboluser.c:159
TRANSFORMER_EXPORT tf_handle_t * tf_add_listener_nspace(ds5_namespace_t *nspace, int listener_typeflags, tf_update_cb update, tf_nodata_cb nodata, tf_status_cb status, int val, void *data, tf_finalize_cb finalize)
Create a new object listener for subjects that match the supplied namespace.
Definition: listener.c:364
void(* tf_finalize_cb)(int val, void *data, tf_handle_t *handle)
Definition of the function type used to call back to application when last callback for a deleted han...
Definition: transformer.h:181
TRANSFORMER_EXPORT void auth_register_functions(authfuncs_t *auth)
Register a set of functions for handling auth capabilities.
Definition: auth.c:138
TRANSFORMER_EXPORT char ** symbol_match_bytype(const char *name, int type, int *number)
Return a list of symbols matching the pattern and of the specified type.
Definition: legacy_misc.c:109
int(* map_object)(int peer, char *orig, char *destbuf, int destlen, authdirection_t direction)
Definition: transformer.h:382
TRANSFORMER_EXPORT char ** symbol_match(const char *name, int *num)
Return a list of symbols matching the specifier.
Definition: legacy_misc.c:82
TRANSFORMER_EXPORT void mod_config_parse_optional_file(const char *file)
Parse an optional module configuration file.
Definition: modules.c:385
TRANSFORMER_EXPORT char * symbol_last_field(const char *name, int fid)
Return the last received fieldvalue for a symbol.
Definition: symbols.c:319
TRANSFORMER_EXPORT tf_handle_t * tf_add_provider_nspace(ds5_namespace_t *nspace, int provider_typeflags, tf_request_cb request, tf_discard_cb discard, int val, void *data, tf_finalize_cb finalize)
Registers the specified data provider with the Transformer core.
Definition: listener.c:635