Data Structures | |
| struct | MqFactoryS |
| used for factory function pointer management More... | |
| struct | MqCallbackS |
| used for callback function pointer management More... | |
| struct | MqLinkSetupS |
| used to Create/Delete of object More... | |
| struct | MqIoUdsConfigS |
| struct | MqIoTcpConfigS |
| struct | MqIoPipeConfigS |
| struct | MqIoConfigS |
| struct | MqConfigS |
| end-user configuration data, also available as command-line options More... | |
| struct | MqSetupS |
| application-programmer configuration data More... | |
Defines | |
| #define | MqFactoryS_NULL { {NULL, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL} } |
Typedefs | |
| typedef pid_t(* | MqForkF )(void) |
prototype for the fork syscall | |
| typedef pid_t(* | MqVForkF )(void) |
prototype for the vfork syscall | |
| typedef void(* | MqDeleteF )(struct MqS *const context) |
| the prototype for a ContextDelete function | |
| typedef void(* | MqTokenDataFreeF )(struct MqS const *const context, MQ_PTR *dataP) |
| prototype for a free additional token data function | |
| typedef void(* | MqHelpF )(MQ_CST) |
| application specific help function type | |
| typedef void(* | MqFactoryDeleteF )(struct MqS *context, MQ_BOL doFactoryCleanup, MQ_PTR data) |
| prototype for a Object-Delete factory function | |
| typedef void(* | MqExitF )(int num) |
| prototype for exit a process or thread | |
| typedef void(* | MqSetupF )(struct MqS *const ) |
used to setup (initialize) a new thread/fork/process created by libmsgque using the SysServer? style commands | |
Enumerations | |
| enum | MqFactoryE { MQ_FACTORY_NEW_INIT = 0, MQ_FACTORY_NEW_CHILD = 1, MQ_FACTORY_NEW_SLAVE = 2, MQ_FACTORY_NEW_FORK = 3, MQ_FACTORY_NEW_THREAD = 4 } |
| the factory is called to create an object for ... More... | |
| enum | MqStatusIsE { MQ_STATUS_IS_INITIAL = 0, MQ_STATUS_IS_DUP = 1<<0, MQ_STATUS_IS_THREAD = 1<<1, MQ_STATUS_IS_FORK = 1<<2, MQ_STATUS_IS_SPAWN = 1<<3 } |
| Information about how the context was created. More... | |
| enum | MqStartE { MQ_START_DEFAULT = 0, MQ_START_FORK = 1, MQ_START_THREAD = 2, MQ_START_SPAWN = 3 } |
| User preferences on HOWTO start a new entity. More... | |
| enum | MqIoComE { MQ_IO_UDS, MQ_IO_TCP, MQ_IO_PIPE } |
| what kind of socket interface to use? More... | |
Functions | |
| MQ_EXTERN void | MqContextInit (struct MqS *const context, MQ_SIZE size, struct MqS const *const tmpl) |
| initialize the MqS object related data but do not create the object self | |
| MQ_EXTERN void | MqContextFree (struct MqS *const context) |
| free the MqS object related data but do not free the object self | |
| MQ_EXTERN struct MqS * | MqContextCreate (MQ_SIZE size, struct MqS const *const tmpl) |
| create the MqS object | |
| MQ_EXTERN void | MqContextDelete (struct MqS **contextP) |
| delete the entire MqS object | |
| MQ_EXTERN void | MqConfigReset (struct MqS *const context) |
| clean the MqS::config data | |
| MQ_EXTERN void | MqConfigDup (struct MqS *const to, struct MqS const *const from) |
| copy the MqS::config data | |
| MQ_EXTERN enum MqErrorE | MqSetupDup (struct MqS *const to, struct MqS const *const from) |
| copy the MqS::setup data | |
| MQ_EXTERN void | MqConfigSetName (struct MqS *const context, MQ_CST data) |
| set the MqConfigS::name value and cleanup old value | |
| MQ_EXTERN void | MqConfigSetSrvName (struct MqS *const context, MQ_CST data) |
| set the MqConfigS::srvname value and cleanup old value | |
| MQ_EXTERN void | MqConfigSetBuffersize (struct MqS *const context, MQ_INT data) |
| set the MqIoConfigS::buffersize value | |
| MQ_EXTERN void | MqConfigSetDebug (struct MqS *const context, MQ_INT data) |
| set the MqConfigS::debug value | |
| MQ_EXTERN void | MqConfigSetTimeout (struct MqS *const context, MQ_TIME_T data) |
| set the MqIoConfigS::timeout value | |
| MQ_EXTERN void | MqConfigSetIsSilent (struct MqS *const context, MQ_BOL data) |
| set the MqConfigS::isSilent value | |
| MQ_EXTERN void | MqConfigSetIsString (struct MqS *const context, MQ_BOL data) |
| set the MqConfigS::isString value | |
| MQ_EXTERN void | MqConfigSetParent (struct MqS *const context, struct MqS *const parent) |
| set the MqConfigS::parent value | |
| MQ_EXTERN void | MqConfigSetMaster (struct MqS *const context, struct MqS *const master, int master_id) |
| set the MqConfigS::master and MqConfigS::master_id value | |
| MQ_EXTERN void | MqConfigSetFactory (struct MqS *const context, MqFactoryCreateF fCreate, MQ_PTR CreateData, MqTokenDataFreeF fCreateFree, MqTokenDataCopyF fCreateCopy, MqFactoryDeleteF fDelete, MQ_PTR DeleteData, MqTokenDataFreeF fDeleteFree, MqTokenDataCopyF fDeleteCopy) |
| setup the factory pattern | |
| MQ_EXTERN void | MqConfigSetDefaultFactory (struct MqS *const context) |
| setup the factory pattern | |
| MQ_EXTERN void | MqConfigSetIgnoreFork (struct MqS *const context, MQ_BOL data) |
| set the MqConfigS::ignoreFork value | |
| MQ_EXTERN void | MqConfigSetIgnoreThread (struct MqS *const context, MQ_BOL data) |
| set the MqConfigS::ignoreThread value | |
| MQ_EXTERN void | MqConfigSetStartAs (struct MqS *const context, enum MqStartE data) |
| set the MqConfigS::startAs value | |
| MQ_EXTERN void | MqConfigSetSetup (struct MqS *const context, MqCreateF fChildCreate, MqDeleteF fChildDelete, MqCreateF fParentCreate, MqDeleteF fParentDelete, MqExitF fProcessExit, MqExitF fThreadExit) |
| set various attributes from MqConfigS struct | |
| MQ_EXTERN void | MqConfigSetFilterFTR (struct MqS *const context, MqTokenF fFunc, MQ_PTR data, MqTokenDataFreeF fFree, MqTokenDataCopyF fCopy) |
| set the MqSetupS::FilterFTR | |
| MQ_EXTERN void | MqConfigSetFilterEOF (struct MqS *const context, MqTokenF fFunc, MQ_PTR data, MqTokenDataFreeF fFree, MqTokenDataCopyF fCopy) |
| set the MqSetupS::FilterEOF | |
| MQ_EXTERN void | MqConfigSetServerSetup (struct MqS *const context, MqTokenF fFunc, MQ_PTR data, MqTokenDataFreeF fFree, MqTokenDataCopyF fCopy) |
| set the MqSetupS::ServerSetup | |
| MQ_EXTERN void | MqConfigSetServerCleanup (struct MqS *const context, MqTokenF fTok, MQ_PTR data, MqTokenDataFreeF fFree, MqTokenDataCopyF fCopy) |
| set the MqSetupS::ServerCleanup | |
| MQ_EXTERN void | MqConfigSetBgError (struct MqS *const context, MqTokenF fTok, MQ_PTR data, MqTokenDataFreeF fFree, MqTokenDataCopyF fCopy) |
| set the MqSetupS::BgError | |
| MQ_EXTERN enum MqErrorE | MqConfigSetIoUds (struct MqS *const context, MQ_CST file) |
| set the MqIoUdsConfigS::file | |
| MQ_EXTERN enum MqErrorE | MqConfigSetIoTcp (struct MqS *const context, MQ_CST host, MQ_CST port, MQ_CST myhost, MQ_CST myport) |
| set the MqIoTcpConfigS data | |
| MQ_EXTERN enum MqErrorE | MqConfigSetIoPipe (struct MqS *const context, MQ_SOCK socket) |
| set the pipe configuration data | |
| MQ_EXTERN enum MqErrorE | MqConfigSetDaemon (struct MqS *const context, MQ_CST pidfile) |
| start the server in daemon mode | |
| MQ_EXTERN int | MqConfigGetIsServer (struct MqS const *const context) |
| does the context object is a server ? | |
| MQ_EXTERN int | MqConfigGetIsParent (struct MqS const *const context) |
| does the context object is a parent ? | |
| MQ_EXTERN int | MqConfigGetIsSlave (struct MqS const *const context) |
| does the context object is a slave ? | |
| MQ_EXTERN int | MqConfigGetIsString (struct MqS const *const context) |
| does the context object is a string ? | |
| MQ_EXTERN int | MqConfigGetIsSilent (struct MqS const *const context) |
| does the context object is silent ? | |
| MQ_EXTERN int | MqConfigGetIsConnected (struct MqS const *const context) |
| does the context object is connected ? | |
| MQ_EXTERN int | MqConfigGetIsDupAndThread (struct MqS const *const context) |
| does the context object is Duplicate and Thread ? | |
| MQ_EXTERN MQ_CST | MqConfigGetName (struct MqS const *const context) |
| get the name of the context object | |
| MQ_EXTERN MQ_CST | MqConfigGetSrvName (struct MqS const *const context) |
| get the srvname of the context object | |
| MQ_EXTERN MQ_INT | MqConfigGetBuffersize (struct MqS const *const context) |
| get the minimum of the read/send buffersize value of the context object | |
| MQ_EXTERN MQ_INT | MqConfigGetDebug (struct MqS const *const context) |
| get the debug value of the context object | |
| MQ_EXTERN MQ_TIME_T | MqConfigGetTimeout (struct MqS const *const context) |
| get the timeout value of the context object | |
| MQ_EXTERN struct MqS * | MqConfigGetParent (struct MqS const *const context) |
| get the parent value of the config object | |
| MQ_EXTERN struct MqS * | MqConfigGetMaster (struct MqS const *const context) |
| get the master value of the config object | |
| MQ_EXTERN MQ_SIZE | MqConfigGetCtxId (struct MqS const *const context) |
| return the context-identification | |
| MQ_EXTERN MQ_CST | MqConfigGetToken (struct MqS const *const context) |
| return the current transaction token | |
| MQ_EXTERN MQ_CST | MqConfigGetIoUdsFile (struct MqS *const context) |
| return the MqIoUdsConfigS::file value | |
| MQ_EXTERN MQ_CST | MqConfigGetIoTcpHost (struct MqS *const context) |
| get the MqIoTcpConfigS::host configuration data | |
| MQ_EXTERN MQ_CST | MqConfigGetIoTcpPort (struct MqS *const context) |
| get the MqIoTcpConfigS::port configuration data | |
| MQ_EXTERN MQ_CST | MqConfigGetIoTcpMyHost (struct MqS *const context) |
| get the MqIoTcpConfigS::myhost configuration data | |
| MQ_EXTERN MQ_CST | MqConfigGetIoTcpMyPort (struct MqS *const context) |
| get the MqIoTcpConfigS::myport configuration data | |
| MQ_EXTERN MQ_SOCK | MqConfigGetIoPipeSocket (struct MqS *const context) |
| get the pipe configuration data | |
| MQ_EXTERN enum MqStartE | MqConfigGetStartAs (struct MqS *const context) |
| return the MqConfigS::startAs value | |
| MQ_EXTERN void | MqConfigSetSelf (struct MqS *const context, void *self) |
| set the MqS::self value | |
| MQ_EXTERN void * | MqConfigGetSelf (struct MqS const *const context) |
| get the MqS::self value | |
Variables | |
| enum MqErrorE(* | MqCreateF )(struct MqS *, struct MqBufferLS **) |
| the prototype for a ContextCreate function | |
| enum MqErrorE(* | MqTokenF )(struct MqS *const context, MQ_PTR const data) |
| prototype for an object method function | |
| enum MqErrorE(* | MqTokenDataCopyF )(struct MqS *const context, MQ_PTR *dataP) |
| prototype for a copy additional token data function | |
| enum MqErrorE(* | MqFactoryCreateF )(struct MqS *const tmpl, enum MqFactoryE create, MQ_PTR data, struct MqS **contextP) |
| prototype for a Object-Creation factory function | |
| struct MqFactoryS(* | MqFactorySelectorF )(MQ_CST name) |
| Return a main factory function found by name. | |
| #define MqFactoryS_NULL { {NULL, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL} } |
| typedef void( * MqExitF)(int num) |
| typedef void( * MqFactoryDeleteF)(struct MqS *context, MQ_BOL doFactoryCleanup, MQ_PTR data) |
| typedef pid_t( * MqForkF)(void) |
| typedef void( * MqTokenDataFreeF)(struct MqS const *const context, MQ_PTR *dataP) |
| typedef pid_t( * MqVForkF)(void) |
| enum MqFactoryE |
| enum MqIoComE |
| enum MqStartE |
| enum MqStatusIsE |
Information about how the context was created.
copy the MqS::config data
get the minimum of the read/send buffersize value of the context object
| [in] | context | the initial MqS object created by MqContextCreate |
context.config.buffersize(R/S) value return the context-identification
| [in] | context | the initial MqS object created by MqContextCreate |
msgque->io) of a parent-context is used by the child-context too.
get the debug value of the context object
| [in] | context | the initial MqS object created by MqContextCreate |
context.config.debug value get the pipe configuration data
| [in] | context | the initial MqS object created by MqContextCreate |
get the MqIoTcpConfigS::host configuration data
get the MqIoTcpConfigS::myhost configuration data
get the MqIoTcpConfigS::myport configuration data
get the MqIoTcpConfigS::port configuration data
return the MqIoUdsConfigS::file value
| MQ_EXTERN int MqConfigGetIsConnected | ( | struct MqS const *const | context | ) |
does the context object is connected ?
| [in] | context | the initial MqS object created by MqContextCreate |
(context->link != NULL) value | MQ_EXTERN int MqConfigGetIsDupAndThread | ( | struct MqS const *const | context | ) |
does the context object is Duplicate and Thread ?
| [in] | context | the initial MqS object created by MqContextCreate |
((config->statusIs & MQ_STATUS_IS_DUP) && (config->statusIs & MQ_STATUS_IS_THREAD)) value | MQ_EXTERN int MqConfigGetIsParent | ( | struct MqS const *const | context | ) |
does the context object is a parent ?
| [in] | context | the initial MqS object created by MqContextCreate |
(context->config.parent == NULL) value | MQ_EXTERN int MqConfigGetIsServer | ( | struct MqS const *const | context | ) |
does the context object is a server ?
| [in] | context | the initial MqS object created by MqContextCreate |
(context->setup.isServer == MQ_YES) value | MQ_EXTERN int MqConfigGetIsSilent | ( | struct MqS const *const | context | ) |
does the context object is silent ?
| [in] | context | the initial MqS object created by MqContextCreate |
(context->config.isSilent == MQ_YES) value | MQ_EXTERN int MqConfigGetIsSlave | ( | struct MqS const *const | context | ) |
does the context object is a slave ?
| [in] | context | the initial MqS object created by MqContextCreate |
(context->config.master != NULL) value | MQ_EXTERN int MqConfigGetIsString | ( | struct MqS const *const | context | ) |
does the context object is a string ?
| [in] | context | the initial MqS object created by MqContextCreate |
(context->config.isString == MQ_YES) value get the master value of the config object
| [in] | context | the initial MqS object created by MqContextCreate |
get the name of the context object
| [in] | context | the initial MqS object created by MqContextCreate |
context.config.name value get the parent value of the config object
| [in] | context | the initial MqS object created by MqContextCreate |
| MQ_EXTERN void* MqConfigGetSelf | ( | struct MqS const *const | context | ) |
get the srvname of the context object
| [in] | context | the initial MqS object created by MqContextCreate |
context.config.srvname value return the MqConfigS::startAs value
get the timeout value of the context object
| [in] | context | the initial MqS object created by MqContextCreate |
context.config.timeout value return the current transaction token
| [in] | context | the initial MqS object created by MqContextCreate |
| MQ_EXTERN void MqConfigReset | ( | struct MqS *const | context | ) |
clean the MqS::config data
| MQ_EXTERN void MqConfigSetBgError | ( | struct MqS *const | context, | |
| MqTokenF | fTok, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | fFree, | |||
| MqTokenDataCopyF | fCopy | |||
| ) |
set the MqSetupS::BgError
set the MqIoConfigS::buffersize value
start the server in daemon mode
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | pidfile | write the PID of the daemon into this file |
set the MqConfigS::debug value
| MQ_EXTERN void MqConfigSetDefaultFactory | ( | struct MqS *const | context | ) |
setup the factory pattern
| [in] | context | the initial MqS object created by MqContextCreate |
| MQ_EXTERN void MqConfigSetFactory | ( | struct MqS *const | context, | |
| MqFactoryCreateF | fCreate, | |||
| MQ_PTR | CreateData, | |||
| MqTokenDataFreeF | fCreateFree, | |||
| MqTokenDataCopyF | fCreateCopy, | |||
| MqFactoryDeleteF | fDelete, | |||
| MQ_PTR | DeleteData, | |||
| MqTokenDataFreeF | fDeleteFree, | |||
| MqTokenDataCopyF | fDeleteCopy | |||
| ) |
setup the factory pattern
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | fCreate | set the MqSetupS::Factory - MqFactoryS::MqFactoryCreateS::fCall value |
| [in] | CreateData | set the MqSetupS::Factory - MqFactoryS::MqFactoryCreateS::data value |
| [in] | fCreateFree | free the CreateData |
| [in] | fCreateCopy | copy the CreateData |
| [in] | fDelete | set the MqSetupS::Factory - MqFactoryS::MqFactoryDeleteS::fCall value |
| [in] | DeleteData | set the MqSetupS::Factory - MqFactoryS::MqFactoryDeleteS::data value |
| [in] | fDeleteFree | delete the DeleteData |
| [in] | fDeleteCopy | copy the DeleteData |
| MQ_EXTERN void MqConfigSetFilterEOF | ( | struct MqS *const | context, | |
| MqTokenF | fFunc, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | fFree, | |||
| MqTokenDataCopyF | fCopy | |||
| ) |
set the MqSetupS::FilterEOF
| MQ_EXTERN void MqConfigSetFilterFTR | ( | struct MqS *const | context, | |
| MqTokenF | fFunc, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | fFree, | |||
| MqTokenDataCopyF | fCopy | |||
| ) |
set the MqSetupS::FilterFTR
set the MqConfigS::ignoreFork value
set the MqConfigS::ignoreThread value
set the pipe configuration data
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | socket | the name of the known socket |
| MQ_EXTERN enum MqErrorE MqConfigSetIoTcp | ( | struct MqS *const | context, | |
| MQ_CST | host, | |||
| MQ_CST | port, | |||
| MQ_CST | myhost, | |||
| MQ_CST | myport | |||
| ) |
set the MqIoTcpConfigS data
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | host | client: the remote host name server: the local interface name |
| [in] | port | client: the remote port name server: the local port name |
| [in] | myhost | client: the local host name |
| [in] | myport | client: the local port name |
set the MqIoUdsConfigS::file
set the MqConfigS::isSilent value
set the MqConfigS::isString value
| MQ_EXTERN void MqConfigSetMaster | ( | struct MqS *const | context, | |
| struct MqS *const | master, | |||
| int | master_id | |||
| ) |
set the MqConfigS::master and MqConfigS::master_id value
set the MqConfigS::name value and cleanup old value
set the MqConfigS::parent value
| MQ_EXTERN void MqConfigSetSelf | ( | struct MqS *const | context, | |
| void * | self | |||
| ) |
set the MqS::self value
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | self | a pointer to the managed context usually self or this |
| MQ_EXTERN void MqConfigSetServerCleanup | ( | struct MqS *const | context, | |
| MqTokenF | fTok, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | fFree, | |||
| MqTokenDataCopyF | fCopy | |||
| ) |
set the MqSetupS::ServerCleanup
| MQ_EXTERN void MqConfigSetServerSetup | ( | struct MqS *const | context, | |
| MqTokenF | fFunc, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | fFree, | |||
| MqTokenDataCopyF | fCopy | |||
| ) |
set the MqSetupS::ServerSetup
| MQ_EXTERN void MqConfigSetSetup | ( | struct MqS *const | context, | |
| MqCreateF | fChildCreate, | |||
| MqDeleteF | fChildDelete, | |||
| MqCreateF | fParentCreate, | |||
| MqDeleteF | fParentDelete, | |||
| MqExitF | fProcessExit, | |||
| MqExitF | fThreadExit | |||
| ) |
set various attributes from MqConfigS struct
set the MqConfigS::srvname value and cleanup old value
set the MqConfigS::startAs value
set the MqIoConfigS::timeout value
create the MqS object
| MQ_EXTERN void MqContextFree | ( | struct MqS *const | context | ) |
free the MqS object related data but do not free the object self
| MQ_EXTERN void MqContextInit | ( | struct MqS *const | context, | |
| MQ_SIZE | size, | |||
| struct MqS const *const | tmpl | |||
| ) |
initialize the MqS object related data but do not create the object self
copy the MqS::setup data
| enum MqErrorE( * MqCreateF)(struct MqS *,struct MqBufferLS **) |
the prototype for a ContextCreate function
This function is the MqS::fCreate and MqS::fThreadCreate parameter and is used to :
| enum MqErrorE( * MqFactoryCreateF)(struct MqS *const tmpl, enum MqFactoryE create, MQ_PTR data, struct MqS **contextP) |
prototype for a Object-Creation factory function
| struct MqFactoryS( * MqFactorySelectorF)(MQ_CST name) |
Return a main factory function found by name.
| [in] | name | the string name of the function to select |
atool.c) and have to return the main function of type MqFactoryS, The result is used as Entry-Point for fork and thread startup.
| enum MqErrorE( * MqTokenDataCopyF)(struct MqS *const context, MQ_PTR *dataP) |
prototype for a copy additional token data function
prototype for an object method function
1.5.8