Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Admin : Admin Operations : tibasAdmin_Execute()

tibasAdmin_Execute()
Function
Declaration
tibas_status tibasAdmin_Execute
(tibasAdmin     admin,
char**          result,
tibasMetaspace  metaspace,
const char*     cmd)   
Purpose
Executes an TIBCO ActiveSpaces administration language command.
For commands such as define space <space-name>, the execute command may return a pointer to a string depending on the command being executed. The Metaspace on which the command should be executed must be passed in.
Parameters
 
Remarks
Use the tibasAdmin_Execute() function to execute an Admin command on a specified metaspace, using a specified Admin manager.
The result parameter contains a pointer to a NULL-terminated character buffer that contains the results of the command.
Before processing the result buffer:
1.
Call strlen() to determine the size of the buffer. Based on the value returned by strlen(), you can allocate memory to store the result for processing.
2.
If you use a non-NULL pointer to point to the result parameter, ActiveSpaces returns an error. After you are done processing the result, free the memory used by the result by calling the tibas_FreeData() function.
The value for the admin parameter is returned when you call tibasAdmin_Create() to create an Admin manager.
Example
The following example illustrates the recommended way to use tibasAdminExecute():
 
char adminCommand[1024];
char* userMessagePtr = NULL;
 
sprintf(adminCommand, "help");
if (tibasAdmin_Execute(admin, &userMessagePtr, *metaspace, adminCommand) != TIBAS_OK)
{ do some error handling… }
/* when finished with the contents of userMessagePtr, free it */
tibas_FreeData(&userMessagePtr);
/* if you want to re-use userMessagePtr for another admin command, set it to NULL again */
userMessagePtr = NULL;
 
See Also
tibasAdmin_Create(), tibasAdmin_Connect(), tibas_FreeData()

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved