|
Data Structures | |
| struct | MqErrorS |
| struct | MqLinkS |
| the main libmsgque_private object. More... | |
| struct | MqS |
| Prototype for a context object. More... | |
Modules | |
| PUBLIC: struct MqBufferS | |
| the Msgque Buffer API is used to manage dynamic, generic, mixed typed data. | |
| PUBLIC: struct MqBufferLS | |
| the Msgque Buffer List API is used to manage a list of MqBufferS objects. | |
| PUBLIC: struct MqErrorS | |
| the MqErrorS API is used to manage error messages. | |
| PUBLIC: Read-Buffer object | |
| Read and split a libmsgque_private package into several items. | |
| PUBLIC: Send-Buffer object | |
| Collect and send data using a LibMsgque package. | |
| PUBLIC: struct MqLinkSlaveS | |
| Access to the master / slave feature. | |
Defines | |
| #define | MQ_NO 0 |
| boolean NO | |
| #define | MQ_YES 1 |
| boolean YES | |
| #define | MQ_MqS_SIGNATURE 0x212CF91 |
| #define | MQ_PRIVATE_CONFIG_CONST const |
Enumerations | |
| enum | MqIoSelectE { MQ_SELECT_RECV = (1 << 0), MQ_SELECT_SEND = (1 << 1) } |
| 'select' type for reading or writing More... | |
Functions | |
| MQ_EXTERN struct MqBufferLS * | MqInitCreate (void) |
| setup and return the init object | |
| MQ_EXTERN void | MqInitSysAPI (MqForkF forkF, MqVForkF vforkF) |
| MQ_EXTERN enum MqErrorE | MqLinkCreate (struct MqS *const context, struct MqBufferLS **argsP) |
| create a parent libmsgque_private object link | |
| MQ_EXTERN enum MqErrorE | MqLinkCreateChild (struct MqS *const context, struct MqS *const parent, struct MqBufferLS **argsP) |
| create a child libmsgque_private object link | |
| MQ_EXTERN enum MqErrorE | MqDefaultLinkCreate (struct MqS *const context, struct MqBufferLS **argsP) |
| wrapper for MqLinkCreate with argv error check | |
| MQ_EXTERN void | MqLinkDelete (struct MqS *const context) |
| delete a libmsgque_private object | |
| MQ_EXTERN void | MqExit (struct MqS *context) |
| exit the current process or thread | |
| MQ_EXTERN MQ_STR | MqHelp (MQ_CST tool) |
| write libmsgque_private specific user-help to stderr | |
| MQ_EXTERN enum MqErrorE | MqCheckForLeftOverArguments (struct MqS *const context, struct MqBufferLS **argvP) |
| MQ_EXTERN enum MqErrorE | MqServiceCreate (struct MqS *const context, MQ_CST const token, MqTokenF const proc, MQ_PTR data, MqTokenDataFreeF datafreeF) |
| create a service handle | |
| MQ_EXTERN enum MqErrorE | MqServiceDelete (struct MqS const *const context, MQ_CST const token) |
| delete service handle | |
| MQ_EXTERN MQ_BOL | MqIsTransaction (struct MqS const *const context) |
| check if the ongoing service-call belongs to an transaction | |
| MQ_EXTERN MQ_BOL | MqCurrentTokenIs (struct MqS const *const context, char const *const token) |
| check the current token | |
the MqS object is created just after the MqContextS object usually in the function ContextCreate. every external MqContextS object has only one MqS object and every MqS object has only one MqContextS object. the MqS object will be created with the MqLinkCreate and will be deleted with the MqLinkDelete function. during creation of a MqS object additional objects will be created too:
| #define MQ_MqS_SIGNATURE 0x212CF91 |
| #define MQ_NO 0 |
boolean NO
Definition at line 292 of file msgque.h.
Referenced by GenericServer(), MqBufferLCheckOptionO(), MqBufferLCheckOptionU(), MqBufferLGetU(), MqConfigSetMaster(), MqContextDelete(), MqIsTransaction(), MqLinkCreate(), MqLinkDelete(), MqReadItemExists(), MqReadL(), MqReadUndo(), MqSlaveWorker(), MqSysBasename(), pErrorReport(), pEventStart(), pIoCheck(), pIoIsRemote(), pIoStartServer(), pLogHDR(), pMqSendEND(), pReadCreate(), pReadHDR(), pSendCreate(), pTokenCheckSystem(), sMqCheckArg(), and SysSocketPair().
| #define MQ_YES 1 |
boolean YES
Definition at line 296 of file msgque.h.
Referenced by GenericDelete(), MqBufferLCheckOptionC(), MqBufferLCheckOptionO(), MqBufferLCheckOptionU(), MqConfigGetIsConnected(), MqConfigGetIsSilent(), MqConfigGetIsString(), MqConfigSetDaemon(), MqConfigSetFilterEOF(), MqConfigSetFilterFTR(), MqConfigSetServerCleanup(), MqConfigSetServerSetup(), MqContextDelete(), MqContextFree(), MqContextInit(), MqErrorReset(), MqErrorSet(), MqErrorStackP(), MqExit(), MqIsTransaction(), MqLinkCreate(), MqLinkDelete(), MqReadB(), MqReadC(), MqReadItemExists(), MqReadU(), MqSendSTART(), MqSlaveCreate(), pCallFactory(), pDeleteProtectionCreate(), pErrorSetup(), pEventCreate(), pEventStart(), pIoCloseSocket(), pIoIsRemote(), pIoStartServer(), PipeDelete(), pMqShutdown(), pTokenCheckSystem(), sBufferLCheckOptionA(), sMqCheckArg(), sReadA1(), sReadA2(), sReadA4(), sReadA8(), sSendA1(), sSendA2(), sSendA4(), sSendA8(), sSysServerThreadCreate(), SysServerFork(), and SysServerThread().
| enum MqIoSelectE |
| MQ_EXTERN enum MqErrorE MqCheckForLeftOverArguments | ( | struct MqS *const | context, | |
| struct MqBufferLS ** | argvP | |||
| ) |
check for left over arguments from parameter argv of MqLinkCreate
| [in] | context | the initial MqS object created by MqContextCreate |
| [in,out] | argvP | a pointer to the argv, the memory will be freed and the value will be set to NULL |
Definition at line 1170 of file msgque.c.
References MqBufferLS::cursize, MqBufferLS::data, MQ_ERROR, MQ_ERROR_INVALID_OPTION, MQ_OK, MqBufferGetC(), MqBufferLDelete(), MqErrorDb2, MqErrorGetCode(), MqErrorSAppendV(), and unlikely.
Referenced by MqDefaultLinkCreate(), and MqSlaveWorker().

check the current token
| [in] | context | the current context |
| [in] | token | the token to compare with |
Definition at line 1153 of file msgque.c.
References MqS::link, pTokenCheck(), and MqLinkS::srvT.
| MQ_EXTERN enum MqErrorE MqDefaultLinkCreate | ( | struct MqS *const | context, | |
| struct MqBufferLS ** | argsP | |||
| ) |
wrapper for MqLinkCreate with argv error check
create a parent libmsgque_private object link
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | argsP | command-line arguments will be freed and set to NULL on error |
Definition at line 725 of file msgque.c.
References MqS::error, MqBufferLDelete(), MqCheckForLeftOverArguments(), MqErrorCheck, MqErrorStack, and MqLinkCreate().
| MQ_EXTERN void MqExit | ( | struct MqS * | context | ) |
exit the current process or thread
| [in] | context | the initial MqS object created by MqContextCreate |
--fParentExit SysExit to exit the processDefinition at line 1245 of file msgque.c.
References MqSetupS::fProcessExit, MqSetupS::fThreadExit, MqS::link, MQ_ERROR_EXIT, MQ_IS_CHILD, MQ_STATUS_IS_THREAD, MQ_YES, MqDLogC, MqErrorCopy(), MqErrorGetNum(), MqLinkDelete(), MqPanicSYS, MqLinkS::onExit, pMqGetFirstParent(), MqS::setup, sEventFree(), MqS::statusIs, and SysExit().
Referenced by MqPanicVL(), sSysServerThreadCreate(), and SysServerFork().

write libmsgque_private specific user-help to stderr
| tool | the name of the tool (e.g. argv[0]) or NULL. |
tool [ARGUMENT]... syntax:
aclient [OPTION]... @ tool [OPTION]... @...
Definition at line 78 of file msgque.c.
References MQ_ALFA, MqBufferAppendV(), and MqBufferCreateStatic.
| MQ_EXTERN struct MqBufferLS* MqInitCreate | ( | void | ) | [read] |
setup and return the init object
struct MqBufferLS * initB = MqInitCreate(); MqBufferLAppendC(initB, "myExec"); MqBufferLAppendC(initB, "myExecArgument_1"); ...
Definition at line 403 of file msgque.c.
References MqBufferLCreate(), and MqBufferLDelete().
Referenced by sMqCheckArg().

check if the ongoing service-call belongs to an transaction
| [in] | context | the current context |
Definition at line 1162 of file msgque.c.
References MqLinkS::_trans, MqS::link, MQ_NO, and MQ_YES.
Referenced by pEventStart().

| MQ_EXTERN enum MqErrorE MqLinkCreate | ( | struct MqS *const | context, | |
| struct MqBufferLS ** | argsP | |||
| ) |
create a parent libmsgque_private object link
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | argsP | command-line arguments will be freed and set to NULL on error |
Definition at line 434 of file msgque.c.
References MqBufferU::C, CacheCF, MqSetupS::Child, MqLinkS::childs, MqIoConfigS::com, MqS::config, pChildS::context, MqLinkS::ctxId, MqLinkS::ctxIdA, MqLinkS::ctxIdP, MqLinkS::ctxIdR, MqLinkS::ctxIdZ, MqBufferS::cur, MqBufferLS::cursize, MqCallbackS::data, MqBufferLS::data, MqConfigS::debug, MqLinkS::doFactoryCleanup, MqLinkS::endian, MqS::error, MqLinkSetupS::fCreate, MqCallbackS::fFunc, MqLinkS::flagServerSetup, MqLinkS::io, MqConfigS::io, MqConfigS::isSilent, MqConfigS::isString, MqLinkS::isWORKER, pChildS::left, MqS::link, MqConfigS::master, MQ_ALFA_STR, MQ_CONTINUE, MQ_ERROR, MQ_ERROR_CAN_NOT_START_SERVER, MQ_ERROR_CONNECTED, MQ_ERROR_PANIC, MQ_EXIT, MQ_IS_CHILD, MQ_IS_CLIENT, MQ_IS_PARENT, MQ_IS_SLAVE, MQ_NO, MQ_OK, MQ_START_SERVER_AS_PIPE, mq_strdup, MQ_TIMEOUT_USER, MQ_YES, MqBufferCreateC(), MqBufferLAppend(), MqBufferLAppendL(), MqBufferLDelete(), MqBufferLDeleteItem(), MqConfigSetIsString(), MqConfigSetMaster(), MqContextCreate(), MqContextDelete(), MqDLogV, MqDLogX(), MqErrorCheck, MqErrorCheckI, MqErrorCopy(), MqErrorDbV, MqErrorDbV2, MqErrorGetCode(), MqErrorReset(), MqErrorStack, MqInitGetFirst(), MqLinkCreate(), MqReadO(), MqSendC(), MqSendEND_AND_WAIT(), MqSendI(), MqSendO(), MqSendSTART(), MqSysCalloc(), MqSysFree, MqSysMalloc(), MqSysRealloc(), MqConfigS::name, MqLinkS::onCreate, MqSetupS::Parent, MqConfigS::parent, pBufferLSetError(), pBufferLSplitAlfa(), pCacheCreate(), pIoCloseSocket(), pIoConnect(), pIoCreate(), pIoIsRemote(), pIoLogCom(), pIoStartServer(), pReadCreate(), pReadDelete(), pSendCreate(), pSlaveCreate(), pTokenCreate(), pTransCreate(), pWaitForToken(), MqLinkS::read, MqLinkS::readCache, pChildS::right, MqLinkS::self, MqLinkS::send, MqSetupS::ServerSetup, MqS::setup, MqLinkS::slave, sMqCheckArg(), MqConfigS::srvname, MqLinkS::srvT, MqLinkS::trans, and unlikely.
Referenced by MqDefaultLinkCreate(), MqLinkCreate(), MqLinkCreateChild(), MqSlaveWorker(), pSlaveCreate(), pTokenCheckSystem(), sSysServerThreadCreate(), and SysServerFork().

| MQ_EXTERN enum MqErrorE MqLinkCreateChild | ( | struct MqS *const | context, | |
| struct MqS *const | parent, | |||
| struct MqBufferLS ** | argsP | |||
| ) |
create a child libmsgque_private object link
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | parent | the parent object link |
| [in] | argsP | command-line arguments will be freed and set to NULL on error |
Definition at line 417 of file msgque.c.
References MQ_ERROR_CONNECTED, MqBufferLDelete(), MqConfigDup(), MqConfigSetParent(), MqErrorDbV, MqLinkCreate(), and unlikely.
| MQ_EXTERN void MqLinkDelete | ( | struct MqS *const | context | ) |
delete a libmsgque_private object
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 752 of file msgque.c.
References MqSetupS::Child, MqLinkS::childs, MqS::config, pChildS::context, MqLinkS::ctxId, MqLinkS::ctxIdA, MqLinkS::ctxIdP, MqLinkS::ctxIdR, MqLinkS::ctxIdZ, MqCallbackS::data, MqLinkS::deleteProtection, MqLinkS::doFactoryCleanup, MqLinkSetupS::fDelete, MqCallbackS::fFunc, MqLinkS::flagServerSetup, MqLinkS::io, pChildS::left, MqS::link, MQ_IS_CHILD, MQ_IS_PARENT, MQ_NO, MQ_YES, MqContextDelete(), MqDLogC, MqDLogV, MqLinkDelete(), MqLinkS::MqLinkDelete_LOCK, MqSysFree, MqLinkS::onCreate, MqConfigS::parent, MqSetupS::Parent, pCacheDelete(), pErrorReport(), pErrorSetEXIT(), pIoDelete(), pMqShutdown(), pReadDelete(), pSendDelete(), pSlaveDelete(), pTokenDelete(), pTransDelete(), MqLinkS::read, MqLinkS::readCache, pChildS::right, MqLinkS::self, MqLinkS::send, MqSetupS::ServerCleanup, MqS::setup, MqLinkS::slave, MqLinkS::srvT, MqLinkS::trans, and unlikely.
Referenced by MqContextFree(), MqExit(), MqLinkDelete(), pEventStart(), and pSlaveItemDelete().

| MQ_EXTERN enum MqErrorE MqServiceCreate | ( | struct MqS *const | context, | |
| MQ_CST const | token, | |||
| MqTokenF const | proc, | |||
| MQ_PTR | data, | |||
| MqTokenDataFreeF | datafreeF | |||
| ) |
create a service handle
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | token | a 4 byte string used to identify the remote service |
| proc | an external (non libmsgque) function to provide the service | |
| data | an external (non libmsgque) pointer to a data structure linked to the MqTokenF function | |
| datafreeF | function to free data pointer |
Definition at line 1205 of file msgque.c.
References HDR_TOK_LEN, MqS::link, MQ_ERROR_TOKEN_LENGTH, MqErrorDbV, pTokenAddHdl(), and MqLinkS::srvT.
delete service handle
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | token | a 4 byte string used to identify the remote service |
Definition at line 1222 of file msgque.c.
References MqS::link, pTokenDelHdl(), and MqLinkS::srvT.
1.5.8