13 #ifndef __TRANSFORMER_H__ 14 #define __TRANSFORMER_H__ 24 #define TRANSFORMER_VERSION "6.2.11" 26 #define TRANSFORMER_MAJOR_VERSION 6 27 #define TRANSFORMER_MINOR_VERSION 2 28 #define TRANSFORMER_PATCH_VERSION 11 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);
202 TRANSFORMER_EXPORT
void free_array(
int argc,
char *argv[]);
225 #define PROVIDER_DENY -1 231 #define PROVIDER_OK 0 237 #define TF_LISTENER_DEFAULT 0 246 #define TF_LISTENER_WILDNOW 2 255 #define TF_LISTENER_WILDNEXT 4 268 #define TF_LISTENER_WILDREMOVE 8 274 #define TF_LISTENER_WILDCARD (TF_LISTENER_WILDNOW|TF_LISTENER_WILDNEXT) 281 #define TF_LISTENER_NOASKPEERS 16 287 #define TF_LISTENER_NOASKMODULES 32 297 #define TF_LISTENER_ACCESSORY (1|TF_LISTENER_NOASKPEERS|TF_LISTENER_NOASKMODULES) 307 #define TF_LISTENER_PROVIDEONCE 64 315 #define TF_LISTENER_NOREGEX 128 323 #define TF_LISTENER_ONCE 256 402 int (*discard_object)(
int peer,
char *orig,
char *mapname,
void **userptr);
403 int *(*return_peers)(
char *name,
int *peers_num);
404 ds_data_t *(*map_fields)(
int peerno,
char *basename,
ds_data_t *orig,
void **userptr,
int *cancel_sub);
419 TRANSFORMER_EXPORT
int file_reading();
421 TRANSFORMER_EXPORT
void file_write_pkt(FILE *fp,
ds_data_t *pkt, time_t tim);
427 TRANSFORMER_EXPORT
char *filename_expand(
char *format);
437 TRANSFORMER_EXPORT
int c_debug_level;
439 #define DBG(level) ( ( c_debug_level >= (level) ) ) 451 TRANSFORMER_EXPORT
int debug_level(
char *text);
453 TRANSFORMER_EXPORT
char *debug_string(
int level);
463 #define PACKET_STORE 1 473 #define PACKET_PUBLISH 2 487 #define PACKET_OWRITE 4 504 #define PACKET_FREE 8 516 #define PACKET_NOLISTEN 32 523 #define PACKET_UPDATE 128 534 #define PACKET_NOFEEDTIME 256 570 #define SYMBOL_PUBLISH 2 582 #define SYMBOL_NOSAVE 16 594 #define SYMBOL_NOLISTEN 32 596 TRANSFORMER_EXPORT
int symbol_create(
const char *name,
unsigned flags);
612 TRANSFORMER_EXPORT
void symbol_add_constant(
const char *name,
int fid,
const char *value);
614 TRANSFORMER_EXPORT
char *symbol_get_constant(
const char *name,
int fid);
616 TRANSFORMER_EXPORT
char **
symbol_match(
const char *name,
int *num);
620 TRANSFORMER_EXPORT
void symbol_delete_type2(
const char *name,
const char *index,
int fieldnum);
630 TRANSFORMER_EXPORT
int symbol_request(
const char *name,
update_cb update,
int id,
void *data);
632 TRANSFORMER_EXPORT
int symbol_discard(
const char *name,
update_cb update,
int id,
void *data);
648 TRANSFORMER_EXPORT
char **
tf_symbol_match(
const char *pattern,
int *number);
652 TRANSFORMER_EXPORT
void symbol_unset_flag(
const char *subject,
unsigned int flags);
654 TRANSFORMER_EXPORT
void symbol_set_flag(
const char *subject,
unsigned int flags);
674 int (*strprint)(
char *dest,
size_t len,
void *data);
678 void (*filewrite)(FILE *fp,
void *data);
681 void *(*fileread)(FILE *fp,
char *name);
688 TRANSFORMER_EXPORT
void symbol_remove_alluserdata(
const char *wildcard,
unsigned int id,
void (*dataremover)(
void *data));
718 TRANSFORMER_EXPORT
int udpsignal_addjob(
const char *cmd,
udpcmd_t callback,
const char *msg);
720 TRANSFORMER_EXPORT
int udpsignal_deljob(
const char *cmd,
udpcmd_t callback);
722 TRANSFORMER_EXPORT
void udpsignal_send(
const char *message);
724 TRANSFORMER_EXPORT
void udpsignal_send_argv(
const char *command,
char *argv[]);
740 #define CMD_DUMP_MEMORY "memory_write" 759 #define CMD_RESTORE_MEMORY "memory_read" 769 #define CMD_MODULE_LOAD "module_load" 778 #define CMD_MODULE_UNLOAD "module_unload" 789 #define CMD_SYMBOL_DEL_PKTS "symbol_delete" 798 #define CMD_SYMBOL_PUBLISH "symbol_publish" 807 #define CMD_SOURCE_UP "source_up" 816 #define CMD_SOURCE_DOWN "source_down" 829 TRANSFORMER_MODULE_EXPORT
void mod_init(
char *module_name);
838 TRANSFORMER_MODULE_EXPORT
void mod_exit();
844 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
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:199
_authdirection
Define the mapping direction used for the authfuncs_t::map_object() call.
Definition: transformer.h:367
TRANSFORMER_EXPORT int tf_symbol_get_type(const char *objname)
Return the type of a particular object.
Definition: symbols.c:602
Define the callback functions that should be implemented by a permissioning module.
Definition: transformer.h:376
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:219
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:727
TRANSFORMER_EXPORT void mod_config_parse_file(const char *file)
Parse a mandatory module configuration file.
Definition: modules.c:589
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: test_autopub.c:68
TRANSFORMER_EXPORT int packet_update_field(ds_data_t *dest, int fid, const char *value)
Update a field within a packet.
Definition: packet.c:305
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:370
TRANSFORMER_MODULE_EXPORT void mod_init(char *module_name)
Module initialisation function.
Definition: formatter.c:107
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:739
char * desc
Definition: transformer.h:671
Defines the functions required to support userdata preservation.
Definition: transformer.h:663
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:78
TRANSFORMER_EXPORT void symbol_delete_all_mmaker(const char *name)
Delete all the Type 2 data associated with a symbol.
Definition: symbols.c:568
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:355
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:803
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:266
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:148
TRANSFORMER_EXPORT void symbol_delete_all_permission_keys(const char *name)
Delete all the data associated with a permission object.
Definition: symbols.c:585
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: test_autopub.c:51
Definition: transformer.h:369
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:170
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:882
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:932
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:779
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:703
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:900
TRANSFORMER_EXPORT int tf_handle_set_callback_params(tf_handle_t *handle, int id, void *data)
Set the callback parameters on a handle.
Definition: test_autopub.c:62
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:619
TRANSFORMER_EXPORT void symbol_delete_mmaker(const char *symname, const char *mmaker)
Delete the data associated with a type 2 index.
Definition: symbols.c:549
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 ds_data_t * packet_clone(ds_data_t *src)
Duplicate a DataSource packet.
Definition: packet.c:328
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:443
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:536
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:113
TRANSFORMER_EXPORT ds_log_t * rtas_log
Name of the Transformer's event log.
Definition: transformer.h:435
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: test_autopub.c:41
int(* request_object)(int peer, char *orig, char *mapname, void **userptr)
Definition: transformer.h:391
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:186
unsigned int id
Definition: transformer.h:665
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, void *reserved)
Registers the specified data provider with the Transformer core.
Definition: listener.c:581
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, void *reserved)
Registers the specified data provider with the Transformer core.
Definition: listener.c:634
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:689
TRANSFORMER_EXPORT void auth_invalidate_peer_perms(int peernum)
Invalidate permissions for an individual peer.
Definition: auth.c:178
char * ident
Definition: transformer.h:668
TRANSFORMER_MODULE_EXPORT void mod_exit()
Module exit function.
A data update object.
Definition: datasrc.h:2425
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:775
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:831
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:573
void(* udpcmd_t)(int argc, char *argv[])
Definition of the function type used for udp command callbacks.
Definition: transformer.h:716
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:671
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:858
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:755
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:378
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:606
TRANSFORMER_EXPORT char * symbol_last_field(const char *name, int fid)
Return the last received fieldvalue for a symbol.
Definition: symbols.c:319