#include "config.h"#include <unistd.h>#include <pthread.h>#include <sys/socket.h>#include <netdb.h>#include <embedch.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/time.h>#include <b64/cdecode.h>#include "include/libmc.h"#include "include/mc_error.h"#include "include/macros.h"#include "include/mc_platform.h"#include "include/message.h"#include "include/data_structures.h"#include "include/fipa_acl_envelope.h"#include "include/fipa_acl.h"#include "include/agent.h"#include "include/agent_task.h"#include "include/agent_lib.h"Go to the source code of this file.
Functions | |
| EXPORTMC int | MC_AclDestroy (struct fipa_acl_message_s *message) |
| Destroy a FIPA ACL message. | |
| EXPORTMC fipa_acl_message_t * | MC_AclNew (void) |
| Allocate a new ACL Message. | |
| EXPORTMC int | MC_AclPost (MCAgent_t agent, struct fipa_acl_message_s *message) |
| Post ACL message to agent. | |
| EXPORTMC fipa_acl_message_t * | MC_AclReply (fipa_acl_message_t *acl_message) |
| Reply to an ACL message. | |
| EXPORTMC fipa_acl_message_t * | MC_AclRetrieve (MCAgent_t agent) |
| Retrieve an ACL message. | |
| EXPORTMC int | MC_AclSend (MCAgency_t attr, fipa_acl_message_t *acl) |
| Send a composed ACL Message. | |
| EXPORTMC fipa_acl_message_t * | MC_AclWaitRetrieve (MCAgent_t agent) |
| Wait for and retrieve an ACL message. | |
| EXPORTMC enum fipa_protocol_e | MC_AclGetProtocol (struct fipa_acl_message_s *acl) |
| EXPORTMC char * | MC_AclGetConversationID (struct fipa_acl_message_s *acl) |
| EXPORTMC enum fipa_performative_e | MC_AclGetPerformative (struct fipa_acl_message_s *acl) |
| EXPORTMC int | MC_AclGetSender (struct fipa_acl_message_s *acl, char **name, char **address) |
| EXPORTMC const char * | MC_AclGetContent (struct fipa_acl_message_s *acl) |
| EXPORTMC int | MC_AclSetProtocol (fipa_acl_message_t *acl, enum fipa_protocol_e protocol) |
| EXPORTMC int | MC_AclSetConversationID (fipa_acl_message_t *acl, char *id) |
| EXPORTMC int | MC_AclSetPerformative (fipa_acl_message_t *acl, enum fipa_performative_e performative) |
| EXPORTMC int | MC_AclSetSender (fipa_acl_message_t *acl, const char *name, const char *address) |
| EXPORTMC int | MC_AclAddReceiver (fipa_acl_message_t *acl, const char *name, const char *address) |
| EXPORTMC int | MC_AclAddReplyTo (fipa_acl_message_t *acl, const char *name, const char *address) |
| EXPORTMC int | MC_AclSetContent (fipa_acl_message_t *acl, const char *content) |
| EXPORTMC int | MC_AddAgent (MCAgency_t attr, MCAgent_t agent) |
| Add an agent to the agency 'attr'. | |
| EXPORTMC int | MC_AddStationaryAgent (MCAgency_t agency, void *(*agent_thread)(stationary_agent_info_t *), const char *name, void *agent_args) |
| Add a stationary agent to the agency. | |
| EXPORTMC int | MC_AddAgentInitCallback (MCAgency_t agency, MC_AgentInitCallbackFunc_t function, void *user_data) |
| Add an agenct initialization callback function. | |
| EXPORTMC MCAgency_t | MC_AgentInfo_GetAgency (stationary_agent_info_t *stationary_agent_info) |
| Get the host Mobile-C agency handle from a "stationary_agent_info_t" data structure. | |
| EXPORTMC MCAgent_t | MC_AgentInfo_GetAgent (stationary_agent_info_t *stationary_agent_info) |
| Retrieve an agent handle from the stationary agent info from within a stationary agent. | |
| EXPORTMC void * | MC_AgentInfo_GetAgentArgs (stationary_agent_info_t *stationary_agent_info) |
| Retrieve the agent argument supplied as the "agent_args" parameter in the MC_AddStationaryAgent() function. | |
| EXPORTMC int | MC_AgentAddTask (MCAgent_t agent, const char *code, const char *return_var_name, const char *server, int persistent) |
| Add a new task to an already existing agent. | |
| EXPORTMC int | MC_AgentAddTaskFromFile (MCAgent_t agent, const char *filename, const char *return_var_name, const char *server, int persistent) |
| Add a new task to an already existing agent. | |
| EXPORTMC int | MC_AgentAttachFile (MCAgent_t agent, const char *name, const char *filepath) |
| Attach a file to the agent's current task. | |
| EXPORTMC int | MC_AgentListFiles (MCAgent_t agent, int task_num, char ***names, int *num_files) |
| Get a list of an agent's attached files. | |
| EXPORTMC int | MC_AgentRetrieveFile (MCAgent_t agent, int task_num, const char *name, const char *save_path) |
| Saves an agent's attached file to the filesystem. | |
| EXPORTMC int | MC_AgentReturnArrayExtent (MCAgent_t agent, int task_num, int index) |
| Get the extent of a dimension of an agent's return data, if it is an array. | |
| EXPORTMC int | MC_AgentReturnArrayDim (MCAgent_t agent, int task_num) |
| Get the dimension of an agent's return data, if it is an array. | |
| EXPORTMC int | MC_AgentReturnArrayNum (MCAgent_t agent, int task_num) |
| Get the total number of elements of the agent return data. | |
| EXPORTMC const void * | MC_AgentReturnDataGetSymbolAddr (MCAgent_t agent, int task_num) |
| Get a pointer to the agent's return data. | |
| EXPORTMC size_t | MC_AgentReturnDataSize (MCAgent_t agent, int task_num) |
| Get the size of an agent's return data type. | |
| EXPORTMC int | MC_AgentReturnDataType (MCAgent_t agent, int task_num) |
| Get the type of an agent's return data. | |
| EXPORTMC int | MC_AgentReturnIsArray (MCAgent_t agent, int task_num) |
| Check to see whether or not an agent's return data is an array. | |
| EXPORTMC const void * | MC_AgentVariableRetrieve (MCAgent_t agent, const char *var_name, int task_num) |
| Retrieve a pointer to a previously saved variable. | |
| EXPORTMC int | MC_AgentVariableRetrieveInfo (MCAgent_t agent, const char *var_name, int task_num, const void **data, int *dim, const int **extent) |
| Retrieve a info about a previously saved variable. | |
| EXPORTMC int | MC_AgentVariableSave (MCAgent_t agent, const char *var_name) |
| Mark an agent variable for saving. | |
| EXPORTMC int | MC_Barrier (MCAgency_t attr, int id) |
| EXPORTMC int | MC_BarrierInit (MCAgency_t attr, int id, int num_procs) |
| Initialize a MobileC Barrier. | |
| EXPORTMC int | MC_BarrierDelete (MCAgency_t attr, int id) |
| Find and delete an initialized MobileC Barrier. | |
| EXPORTMC int | MC_CallAgentFunc (MCAgent_t agent, const char *funcName, void *returnVal, int numArgs,...) |
| Use custom ChOptions_t type for internal Ch interpretor. | |
| EXPORTMC int | MC_CallAgentFuncArg (MCAgent_t agent, const char *funcName, void *returnVal, void *arg) |
| Calls a function defined in an agent. | |
| EXPORTMC int | MC_CallAgentFuncV (MCAgent_t agent, const char *funcName, void *returnVal, va_list ap) |
| Calls a function defined in an agent. | |
| EXPORTMC int | MC_CallAgentFuncVar (MCAgent_t agent, const char *funcName, void *returnVal, ChVaList_t varg) |
| EXPORTMC MCAgent_t | MC_ComposeAgent (const char *name, const char *home, const char *owner, const char *code, const char *return_var_name, const char *server, int persistent) |
| Compose a new agent dynamically without using a prewritten XML file. | |
| EXPORTMC MCAgent_t | MC_ComposeAgentS (const char *name, const char *home, const char *owner, const char *code, const char *return_var_name, const char *server, int persistent, const char *workgroup_code) |
| Compose a new agent dynamically without using a prewritten XML file. | |
| EXPORTMC MCAgent_t | MC_ComposeAgentWithWorkgroup (const char *name, const char *home, const char *owner, const char *code, const char *return_var_name, const char *server, int persistent, const char *workgroup_code) |
| Compose a new agent dynamically without using a prewritten XML file. | |
| EXPORTMC MCAgent_t | MC_ComposeAgentFromFile (const char *name, const char *home, const char *owner, const char *filename, const char *return_var_name, const char *server, int persistent) |
| Compose a new agent dynamically from a source code file. | |
| EXPORTMC MCAgent_t | MC_ComposeAgentFromFileS (const char *name, const char *home, const char *owner, const char *filename, const char *return_var_name, const char *server, int persistent, const char *workgroup_code) |
| Compose a new agent dynamically from a source code file. | |
| EXPORTMC MCAgent_t | MC_ComposeAgentFromFileWithWorkgroup (const char *name, const char *home, const char *owner, const char *filename, const char *return_var_name, const char *server, int persistent, const char *workgroup_code) |
| Compose a new agent dynamically from a source code file. | |
| EXPORTMC int | MC_CondBroadcast (MCAgency_t attr, int id) |
| Wakes up all agents/threads waiting on a condition variable. | |
| EXPORTMC int | MC_CondSignal (MCAgency_t attr, int id) |
| Wakes up at least one thread waiting on a condition variable. | |
| EXPORTMC int | MC_CondWait (MCAgency_t attr, int id) |
| Wait on a MobileC synchronization variable. | |
| EXPORTMC int | MC_CondReset (MCAgency_t attr, int id) |
| Reset a previously signalled MobileC condition variable. | |
| EXPORTMC int | MC_CopyAgent (MCAgent_t *agent_out, const MCAgent_t agent_in) |
| Performs a deep-copy of an agent structure. | |
| EXPORTMC int | MC_DeleteAgent (MCAgent_t agent) |
| Stop and remove an agent. | |
| EXPORTMC int | MC_DeleteAgentWG (MCAgent_t calling_agent, MCAgent_t agent) |
| Stop and remove an agent in the same workgroup. | |
| EXPORTMC int | MC_DestroyServiceSearchResult (char **agentName, char **serviceName, int *agentID, int numResult) |
| Free memory allocated by a Service Search operation. | |
| EXPORTMC int | MC_DeregisterService (MCAgency_t agency, int agentID, const char *serviceName) |
| EXPORTMC int | MC_End (MCAgency_t agency) |
| End an agency. | |
| EXPORTMC MCAgent_t | MC_FindAgentByName (MCAgency_t attr, const char *name) |
| Find an agent by its name. | |
| EXPORTMC MCAgent_t | MC_FindAgentByID (MCAgency_t attr, int ID) |
| Find an agent by its id. | |
| EXPORTMC time_t | MC_GetAgentArrivalTime (MCAgent_t agent) |
| EXPORTMC int | MC_GetAgentStatus (MCAgent_t agent) |
| Get an agent's current status. | |
| EXPORTMC char * | MC_GetAgentXMLString (MCAgent_t agent) |
| Get an agent's xml string. | |
| EXPORTMC void * | MC_GetAgentExecEngine (MCAgent_t agent) |
| Retrieve an agent's Ch interpreter. | |
| EXPORTMC int | MC_GetAgentID (MCAgent_t agent) |
| Retrieve an agent's id. | |
| EXPORTMC char * | MC_GetAgentName (MCAgent_t agent) |
| EXPORTMC int | MC_GetAgentReturnData (MCAgent_t agent, int task_num, void **data, int *dim, int **extent) |
| Get an agent's return data. | |
| EXPORTMC int | MC_GetAgentNumTasks (MCAgent_t agent) |
| Retrive the number of tasks an agent has. | |
| EXPORTMC enum MC_AgentType_e | MC_GetAgentType (MCAgent_t agent) |
| Get an agent's type. | |
| EXPORTMC int | MC_GetAllAgents (MCAgency_t attr, MCAgent_t **agents, int *num_agents) |
| EXPORTMC int | MC_HaltAgency (MCAgency_t attr) |
| Halt an agency: Do not process new entries in queues. | |
| EXPORTMC MCAgency_t | MC_Initialize (int port, MCAgencyOptions_t *options) |
| Initialize and start a MobileC agency. | |
| EXPORTMC int | MC_InitializeAgencyOptions (struct MCAgencyOptions_s *options) |
| Initialize MobileC options. | |
| EXPORTMC int | MC_LoadAgentFromFile (MCAgency_t attr, const char *filename) |
| Load an agent from a file into an agency. | |
| EXPORTMC int | MC_MigrateAgent (MCAgent_t agent, const char *hostname, int port) |
| Migrates a running agent to another host. | |
| EXPORTMC int | MC_MutexLock (MCAgency_t attr, int id) |
| Locks a MobileC synchronization variable as a mutex. | |
| EXPORTMC int | MC_MutexUnlock (MCAgency_t attr, int id) |
| EXPORTMC int | MC_PrintAgentCode (MCAgent_t agent) |
| Prints an agents code to stdout. | |
| EXPORTMC int | MC_RegisterService (MCAgency_t agency, MCAgent_t agent, int agentID, const char *agentName, char **serviceNames, int numServices) |
| Register a new service with the Directory Facilitator. | |
| EXPORTMC int | MC_ResumeAgency (MCAgency_t attr) |
| Resumes a halted agency. | |
| EXPORTMC MCAgent_t | MC_RetrieveAgent (MCAgency_t attr) |
| Retrieves the oldest agent from an agency. | |
| EXPORTMC char * | MC_RetrieveAgentCode (MCAgent_t agent) |
| Retrieves an agent's Ch code. | |
| EXPORTMC int | MC_ResetSignal (MCAgency_t attr) |
| Reset a MobileC signal. | |
| EXPORTMC int | MC_SearchForService (MCAgency_t attr, const char *searchString, char ***agentNames, char ***serviceNames, int **agentIDs, int *numResults) |
| Search the directory facilitator for a service. | |
| EXPORTMC int | MC_SemaphorePost (MCAgency_t attr, int id) |
| Post to a MobileC synchronization variable semaphore. | |
| EXPORTMC int | MC_SemaphoreWait (MCAgency_t attr, int id) |
| Decreases a MobileC synchronization variable semaphore count by one. | |
| EXPORTMC int | MC_SendCh (MCAgency_t attr, const char *filename, const char *remotehost, int port) |
| EXPORTMC int | MC_SendAgent (MCAgency_t attr, const char *string) |
| Sends an agent migration message. | |
| EXPORTMC int | MC_SendAgentFile (MCAgency_t attr, const char *filename) |
| Sends an agent migration message. | |
| EXPORTMC int | MC_SendAgentMigrationMessage (MCAgency_t attr, const char *string, const char *hostname, int port) |
| Sends an agent migration message. | |
| EXPORTMC int | MC_SendAgentMigrationMessageFile (MCAgency_t attr, const char *filename, const char *hostname, int port) |
| Sends an agent migration message. | |
| EXPORTMC int | MC_SendSteerCommand (MCAgency_t attr, enum MC_SteerCommand_e cmd) |
| EXPORTMC int | MC_SetAgentStatus (MCAgent_t agent, enum MC_AgentStatus_e status) |
| Set an agent's status. | |
| EXPORTMC int | MC_SetDefaultAgentStatus (MCAgency_t agency, enum MC_AgentStatus_e status) |
| Sets default incoming agent status. | |
| EXPORTMC int | MC_SetThreadOn (MCAgencyOptions_t *options, enum MC_ThreadIndex_e index) |
| Sets a MobileC thread to "on" status. | |
| EXPORTMC int | MC_SetThreadsAllOn (MCAgencyOptions_t *options) |
| Set all Mobile-C threads on. | |
| EXPORTMC int | MC_SetThreadOff (MCAgencyOptions_t *options, enum MC_ThreadIndex_e index) |
| Sets a MobileC thread to "off" status. | |
| EXPORTMC int | MC_SetThreadsAllOff (MCAgencyOptions_t *options) |
| Set all MobileC threads to 'off' status. | |
| EXPORTMC int | MC_Steer (MCAgency_t attr, int(*funcptr)(void *data), void *arg) |
| Set up a steerable algorithm. | |
| EXPORTMC enum MC_SteerCommand_e | MC_SteerControl (void) |
| The MobileC user-algorithm steering function. | |
| EXPORTMC int | MC_SyncDelete (MCAgency_t attr, int id) |
| Deletes a previously initialized synchronization variable. | |
| EXPORTMC int | MC_SyncInit (MCAgency_t attr, int id) |
| Initializes a new MobileC synchronization variable. | |
| EXPORTMC int | MC_TerminateAgent (MCAgent_t agent) |
| Halt a running agent. | |
| EXPORTMC int | MC_TerminateAgentWG (MCAgent_t calling_agent, MCAgent_t agent) |
| EXPORTMC int | MC_MainLoop (MCAgency_t attr) |
| Wait indefinitely. | |
| EXPORTMC int | MC_WaitAgent (MCAgency_t attr) |
| Wait indefinitely. | |
| EXPORTMC MCAgent_t | MC_WaitRetrieveAgent (MCAgency_t attr) |
| Wait and retrieve an agent. | |
| EXPORTMC int | MC_WaitSignal (MCAgency_t attr, int signals) |
| Wait for a MobileC signal. | |
| EXPORTMC int | MC_AclDestroy_chdl (void *varg) |
| EXPORTMC void * | MC_AclNew_chdl (void *varg) |
| EXPORTMC int | MC_AclPost_chdl (void *varg) |
| EXPORTCH void * | MC_AclReply_chdl (void *varg) |
| EXPORTCH void * | MC_AclRetrieve_chdl (void *varg) |
| EXPORTCH int | MC_AclSend_chdl (void *varg) |
| EXPORTCH void * | MC_AclWaitRetrieve_chdl (void *varg) |
| EXPORTCH int | MC_AclGetProtocol_chdl (void *varg) |
| EXPORTCH char * | MC_AclGetConversationID_chdl (void *varg) |
| EXPORTCH int | MC_AclGetPerformative_chdl (void *varg) |
| EXPORTCH int | MC_AclGetSender_chdl (void *varg) |
| EXPORTCH char * | MC_AclGetContent_chdl (void *varg) |
| EXPORTCH int | MC_AclSetProtocol_chdl (void *varg) |
| EXPORTCH int | MC_AclSetConversationID_chdl (void *varg) |
| EXPORTCH int | MC_AclSetPerformative_chdl (void *varg) |
| EXPORTCH int | MC_AclSetSender_chdl (void *varg) |
| EXPORTCH int | MC_AclAddReceiver_chdl (void *varg) |
| EXPORTCH int | MC_AclAddReplyTo_chdl (void *varg) |
| EXPORTCH int | MC_AclSetContent_chdl (void *varg) |
| EXPORTCH int | MC_AddAgent_chdl (void *varg) |
| EXPORTCH int | MC_AgentAddTask_chdl (void *varg) |
| EXPORTCH int | MC_AgentAttachFile_chdl (void *varg) |
| EXPORTCH int | MC_AgentListFiles_chdl (void *varg) |
| EXPORTCH int | MC_AgentRetrieveFile_chdl (void *varg) |
| EXPORTCH const void * | MC_AgentVariableRetrieve_chdl (void *varg) |
| EXPORTCH int | MC_AgentVariableSave_chdl (void *varg) |
| EXPORTCH int | MC_CallAgentFunc_chdl (void *varg) |
| EXPORTCH int | MC_Barrier_chdl (void *varg) |
| EXPORTCH int | MC_BarrierDelete_chdl (void *varg) |
| EXPORTCH int | MC_BarrierInit_chdl (void *varg) |
| EXPORTCH int | MC_CondBroadcast_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_ComposeAgent_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_ComposeAgentWithWorkgroup_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_ComposeAgentFromFile_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_ComposeAgentFromFileWithWorkgroup_chdl (void *varg) |
| EXPORTCH int | MC_CondSignal_chdl (void *varg) |
| EXPORTCH int | MC_CondReset_chdl (void *varg) |
| EXPORTCH int | MC_CondWait_chdl (void *varg) |
| EXPORTCH int | MC_DeleteAgent_chdl (void *varg) |
| EXPORTCH int | MC_DeleteAgentWG_chdl (void *varg) |
| EXPORTCH int | MC_DestroyServiceSearchResult_chdl (void *varg) |
| EXPORTCH int | MC_DeregisterService_chdl (void *varg) |
| EXPORTCH int | MC_End_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_FindAgentByID_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_FindAgentByName_chdl (void *varg) |
| EXPORTCH time_t | MC_GetAgentArrivalTime_chdl (void *varg) |
| EXPORTCH int | MC_GetAgentID_chdl (void *varg) |
| EXPORTCH char * | MC_GetAgentName_chdl (void *varg) |
| EXPORTCH int | MC_GetAgentNumTasks_chdl (void *varg) |
| EXPORTCH int | MC_GetAgentStatus_chdl (void *varg) |
| EXPORTCH char * | MC_GetAgentXMLString_chdl (void *varg) |
| EXPORTCH int | MC_GetTimeOfDay_chdl (void *varg) |
| EXPORTCH int | MC_HaltAgency_chdl (void *varg) |
| EXPORTCH int | MC_MigrateAgent_chdl (void *varg) |
| EXPORTCH int | MC_MutexLock_chdl (void *varg) |
| EXPORTCH int | MC_MutexUnlock_chdl (void *varg) |
| EXPORTCH int | MC_PrintAgentCode_chdl (void *varg) |
| EXPORTCH int | MC_RegisterService_chdl (void *varg) |
| EXPORTCH int | MC_ResumeAgency_chdl (void *varg) |
| EXPORTCH MCAgent_t | MC_RetrieveAgent_chdl (void *varg) |
| EXPORTCH char * | MC_RetrieveAgentCode_chdl (void *varg) |
| EXPORTCH int | MC_SaveData_chdl (void *varg) |
| EXPORTCH int | MC_SearchForService_chdl (void *varg) |
| EXPORTCH int | MC_SemaphorePost_chdl (void *varg) |
| EXPORTCH int | MC_SemaphoreWait_chdl (void *varg) |
| EXPORTCH int | MC_SendAgentMigrationMessage_chdl (void *varg) |
| EXPORTCH int | MC_SendAgentMigrationMessageFile_chdl (void *varg) |
| EXPORTCH int | MC_SendSteerCommand_chdl (void *varg) |
| EXPORTCH int | MC_SetAgentStatus_chdl (void *varg) |
| EXPORTCH int | MC_SetDefaultAgentStatus_chdl (void *varg) |
| EXPORTCH int | MC_SyncDelete_chdl (void *varg) |
| EXPORTCH int | MC_SyncInit_chdl (void *varg) |
| EXPORTCH int | MC_TerminateAgent_chdl (void *varg) |
| EXPORTCH int | MC_TerminateAgentWG_chdl (void *varg) |
Variables | |
| mc_platform_p | g_mc_platform |
| EXPORTMC int MC_AclAddReceiver | ( | fipa_acl_message_t * | acl, | |
| const char * | name, | |||
| const char * | address | |||
| ) |
Definition at line 321 of file libmc.c.
References fipa_agent_identifier_s::addresses, fipa_agent_identifier_New(), fipa_agent_identifier_set_New(), fipa_agent_identifier_set_s::fipa_agent_identifiers, fipa_url_New(), fipa_url_sequence_New(), fipa_agent_identifier_s::name, fipa_url_sequence_s::num, fipa_agent_identifier_set_s::num, fipa_acl_message_s::receiver, fipa_acl_message_s::receiver_num, fipa_url_s::str, strdup, and fipa_url_sequence_s::urls.
Referenced by MC_AclAddReceiver_chdl().
| EXPORTCH int MC_AclAddReceiver_chdl | ( | void * | varg | ) |
Definition at line 3027 of file libmc.c.
References MC_AclAddReceiver().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclAddReplyTo | ( | fipa_acl_message_t * | acl, | |
| const char * | name, | |||
| const char * | address | |||
| ) |
Definition at line 357 of file libmc.c.
References fipa_agent_identifier_s::addresses, fipa_agent_identifier_New(), fipa_agent_identifier_set_New(), fipa_agent_identifier_set_s::fipa_agent_identifiers, fipa_url_New(), fipa_url_sequence_New(), fipa_agent_identifier_s::name, fipa_url_sequence_s::num, fipa_agent_identifier_set_s::num, fipa_acl_message_s::reply_to, fipa_url_s::str, strdup, and fipa_url_sequence_s::urls.
Referenced by MC_AclAddReplyTo_chdl().
| EXPORTCH int MC_AclAddReplyTo_chdl | ( | void * | varg | ) |
Definition at line 3047 of file libmc.c.
References MC_AclAddReplyTo().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclDestroy | ( | struct fipa_acl_message_s * | message | ) |
Destroy a FIPA ACL message.
| message | The ACL message to destroy |
Definition at line 84 of file libmc.c.
References fipa_acl_message_Destroy().
Referenced by MC_AclDestroy_chdl().
| EXPORTMC int MC_AclDestroy_chdl | ( | void * | varg | ) |
Definition at line 2759 of file libmc.c.
References MC_AclDestroy().
Referenced by agent_ChScriptInitVar().
| EXPORTMC const char* MC_AclGetContent | ( | struct fipa_acl_message_s * | acl | ) |
Definition at line 249 of file libmc.c.
References fipa_string_s::content, and fipa_acl_message_s::content.
Referenced by MC_AclGetContent_chdl().
| EXPORTCH char* MC_AclGetContent_chdl | ( | void * | varg | ) |
Definition at line 2938 of file libmc.c.
References MC_AclGetContent().
Referenced by agent_ChScriptInitVar().
| EXPORTMC char* MC_AclGetConversationID | ( | struct fipa_acl_message_s * | acl | ) |
Definition at line 224 of file libmc.c.
References fipa_string_s::content, fipa_expression_s::content, fipa_acl_message_s::conversation_id, and fipa_expression_s::content_u::string.
Referenced by MC_AclGetConversationID_chdl().
| EXPORTCH char* MC_AclGetConversationID_chdl | ( | void * | varg | ) |
Definition at line 2889 of file libmc.c.
References MC_AclGetConversationID().
Referenced by agent_ChScriptInitVar().
| EXPORTMC enum fipa_performative_e MC_AclGetPerformative | ( | struct fipa_acl_message_s * | acl | ) |
Definition at line 230 of file libmc.c.
References fipa_acl_message_s::performative.
Referenced by MC_AclGetPerformative_chdl().
| EXPORTCH int MC_AclGetPerformative_chdl | ( | void * | varg | ) |
Definition at line 2904 of file libmc.c.
References MC_AclGetPerformative().
Referenced by agent_ChScriptInitVar().
| EXPORTMC enum fipa_protocol_e MC_AclGetProtocol | ( | struct fipa_acl_message_s * | acl | ) |
Definition at line 218 of file libmc.c.
References fipa_acl_message_s::performative.
Referenced by MC_AclGetProtocol_chdl().
| EXPORTCH int MC_AclGetProtocol_chdl | ( | void * | varg | ) |
Definition at line 2874 of file libmc.c.
References MC_AclGetProtocol().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclGetSender | ( | struct fipa_acl_message_s * | acl, | |
| char ** | name, | |||
| char ** | address | |||
| ) |
Definition at line 236 of file libmc.c.
References fipa_agent_identifier_s::addresses, fipa_agent_identifier_s::name, fipa_acl_message_s::sender, fipa_url_s::str, strdup, and fipa_url_sequence_s::urls.
Referenced by MC_AclGetSender_chdl().
| EXPORTCH int MC_AclGetSender_chdl | ( | void * | varg | ) |
Definition at line 2919 of file libmc.c.
References MC_AclGetSender().
Referenced by agent_ChScriptInitVar().
| EXPORTMC fipa_acl_message_t* MC_AclNew | ( | void | ) | [read] |
Allocate a new ACL Message.
Definition at line 90 of file libmc.c.
References fipa_acl_message_New().
Referenced by MC_AclNew_chdl().
| EXPORTMC void* MC_AclNew_chdl | ( | void * | varg | ) |
Definition at line 2774 of file libmc.c.
References MC_AclNew().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclPost | ( | MCAgent_t | agent, | |
| struct fipa_acl_message_s * | message | |||
| ) |
Post ACL message to agent.
| agent | The agent to post the message to | |
| message | The message to post |
Definition at line 95 of file libmc.c.
References agent_mailbox_Post(), and agent_s::mailbox.
Referenced by MC_AclPost_chdl(), and MC_AclSend().
| EXPORTMC int MC_AclPost_chdl | ( | void * | varg | ) |
Definition at line 2782 of file libmc.c.
References MC_AclPost().
Referenced by agent_ChScriptInitVar().
| EXPORTMC fipa_acl_message_t* MC_AclReply | ( | struct fipa_acl_message_s * | acl_message | ) | [read] |
Reply to an ACL message.
| acl_message | The incoming acl message to reply to |
Definition at line 101 of file libmc.c.
References fipa_Reply().
Referenced by MC_AclReply_chdl().
| EXPORTCH void* MC_AclReply_chdl | ( | void * | varg | ) |
Definition at line 2800 of file libmc.c.
References MC_AclReply().
Referenced by agent_ChScriptInitVar().
| EXPORTMC fipa_acl_message_t* MC_AclRetrieve | ( | MCAgent_t | agent | ) | [read] |
Retrieve an ACL message.
| agent | Agent to retrieve message from. |
Definition at line 107 of file libmc.c.
References agent_mailbox_Retrieve(), and agent_s::mailbox.
Referenced by MC_AclRetrieve_chdl().
| EXPORTCH void* MC_AclRetrieve_chdl | ( | void * | varg | ) |
Definition at line 2816 of file libmc.c.
References MC_AclRetrieve().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclSend | ( | MCAgency_t | attr, | |
| struct fipa_acl_message_s * | acl | |||
| ) |
Send a composed ACL Message.
| attr | An initialized and running MobileC agency | |
| acl | An allocated and fully composed ACL message. |
Definition at line 113 of file libmc.c.
References fipa_agent_identifier_s::addresses, mtp_http_s::content, mtp_http_content_s::content_type, mtp_http_content_s::data, dynstring_Destroy(), FIPA_ACL, fipa_acl_Compose(), fipa_acl_message_Copy(), fipa_agent_identifier_set_s::fipa_agent_identifiers, fipa_envelope_Compose(), mtp_http_s::host, http_to_hostport(), MC_AclPost(), MC_FindAgentByName(), agency_s::mc_platform, dynstring_s::message, mtp_http_s::message_parts, message_Send(), message_s::message_type, mtp_http_CreateMessage(), mtp_http_Destroy(), mtp_http_New(), fipa_agent_identifier_s::name, fipa_url_sequence_s::num, fipa_agent_identifier_set_s::num, port, mc_platform_s::private_key, fipa_acl_message_s::receiver, fipa_url_s::str, strdup, message_s::target, mtp_http_s::target, and fipa_url_sequence_s::urls.
Referenced by MC_AclSend_chdl().
| EXPORTCH int MC_AclSend_chdl | ( | void * | varg | ) |
Definition at line 2832 of file libmc.c.
References CHECK_NULL, MC_AclSend(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclSetContent | ( | fipa_acl_message_t * | acl, | |
| const char * | content | |||
| ) |
Definition at line 392 of file libmc.c.
References fipa_string_s::content, fipa_acl_message_s::content, fipa_string_Destroy(), fipa_string_New(), and strdup.
Referenced by MC_AclSetContent_chdl().
| EXPORTCH int MC_AclSetContent_chdl | ( | void * | varg | ) |
Definition at line 3067 of file libmc.c.
References fipa_acl_message_s::content, and MC_AclSetContent().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclSetConversationID | ( | fipa_acl_message_t * | acl, | |
| char * | id | |||
| ) |
Definition at line 271 of file libmc.c.
References fipa_string_s::content, fipa_expression_s::content, fipa_acl_message_s::conversation_id, FIPA_EXPR_STRING, fipa_expression_New(), fipa_string_New(), strdup, fipa_expression_s::content_u::string, and fipa_expression_s::type.
Referenced by MC_AclSetConversationID_chdl().
| EXPORTCH int MC_AclSetConversationID_chdl | ( | void * | varg | ) |
Definition at line 2971 of file libmc.c.
References MC_AclSetConversationID().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclSetPerformative | ( | fipa_acl_message_t * | acl, | |
| enum fipa_performative_e | performative | |||
| ) |
Definition at line 290 of file libmc.c.
References fipa_acl_message_s::performative.
Referenced by MC_AclSetPerformative_chdl().
| EXPORTCH int MC_AclSetPerformative_chdl | ( | void * | varg | ) |
Definition at line 2989 of file libmc.c.
References MC_AclSetPerformative(), and fipa_acl_message_s::performative.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclSetProtocol | ( | fipa_acl_message_t * | acl, | |
| enum fipa_protocol_e | protocol | |||
| ) |
Definition at line 255 of file libmc.c.
References FIPA_PROTOCOL_END, FIPA_PROTOCOL_ERROR, and fipa_acl_message_s::protocol.
Referenced by MC_AclSetProtocol_chdl().
| EXPORTCH int MC_AclSetProtocol_chdl | ( | void * | varg | ) |
Definition at line 2953 of file libmc.c.
References MC_AclSetProtocol(), and fipa_acl_message_s::protocol.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AclSetSender | ( | fipa_acl_message_t * | acl, | |
| const char * | name, | |||
| const char * | address | |||
| ) |
Definition at line 298 of file libmc.c.
References fipa_agent_identifier_s::addresses, fipa_agent_identifier_Destroy(), fipa_agent_identifier_New(), fipa_url_New(), fipa_url_sequence_New(), fipa_agent_identifier_s::name, fipa_url_sequence_s::num, fipa_acl_message_s::sender, fipa_url_s::str, strdup, and fipa_url_sequence_s::urls.
Referenced by MC_AclSetSender_chdl().
| EXPORTCH int MC_AclSetSender_chdl | ( | void * | varg | ) |
Definition at line 3007 of file libmc.c.
References MC_AclSetSender().
Referenced by agent_ChScriptInitVar().
| EXPORTMC fipa_acl_message_t* MC_AclWaitRetrieve | ( | MCAgent_t | agent | ) | [read] |
Wait for and retrieve an ACL message.
| agent | Agent to retrieve message from. |
Definition at line 211 of file libmc.c.
References agent_mailbox_WaitRetrieve(), and agent_s::mailbox.
Referenced by MC_AclWaitRetrieve_chdl().
| EXPORTCH void* MC_AclWaitRetrieve_chdl | ( | void * | varg | ) |
Definition at line 2856 of file libmc.c.
References MC_AclWaitRetrieve().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AddAgent | ( | MCAgency_t | attr, | |
| MCAgent_t | agent | |||
| ) |
Add an agent to the agency 'attr'.
| attr | a MobileC agency | |
| agent | An initialized MobileC agent |
Definition at line 409 of file libmc.c.
References mc_platform_s::agent_queue, mc_platform_s::ams, COND_SIGNAL, agency_s::mc_platform, agent_s::mc_platform, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by handler_COMPOSE_SEND(), and MC_AddAgent_chdl().
| EXPORTCH int MC_AddAgent_chdl | ( | void * | varg | ) |
Definition at line 3087 of file libmc.c.
References CHECK_NULL, MC_AddAgent(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AddAgentInitCallback | ( | MCAgency_t | agency, | |
| MC_AgentInitCallbackFunc_t | function, | |||
| void * | user_data | |||
| ) |
Add an agenct initialization callback function.
| agency | a MobileC agency | |
| function | The callback function to add. This callback function will be called after an interpreter is initialized for an agent but before the agent is executed. | |
| user_data | A pointer to any user data that should be made available to the callback function |
Definition at line 450 of file libmc.c.
References agency_s::agentInitCallback, and agency_s::agentInitUserData.
| EXPORTMC int MC_AddStationaryAgent | ( | MCAgency_t | agency, | |
| void *(*)(stationary_agent_info_t *) | agent_thread, | |||
| const char * | name, | |||
| void * | agent_args | |||
| ) |
Add a stationary agent to the agency.
| agency | a MobileC agency | |
| agent_thread | The binary-space agent function | |
| name | The new agent's name | |
| agent_args | user arguments to pass to the agent |
Definition at line 422 of file libmc.c.
References stationary_agent_info_s::agency, stationary_agent_info_s::agent, agent_NewBinary(), mc_platform_s::agent_queue, stationary_agent_info_s::args, stationary_agent_info_s::attr, agency_s::mc_platform, agent_s::name, strdup, stationary_agent_info_s::thread, and THREAD_CREATE.
| EXPORTMC int MC_AgentAddTask | ( | MCAgent_t | agent, | |
| const char * | code, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent | |||
| ) |
Add a new task to an already existing agent.
| agent | An existing agent | |
| code | The C code to use in the new task | |
| return_var_name | The name of the the return variable, or NULL if there is no return variable. | |
| server | The server to perform the task on. | |
| persistent | Whether or not the task is persistent. '1' indicates persistent, and '0' indicates not-persistent (the default) |
Definition at line 475 of file libmc.c.
References agent_datastate_s::agent_code_ids, agent_datastate_s::agent_codes, agent_task_New(), agent_task_s::code_id, agent_s::datastate, agent_datastate_s::number_of_tasks, agent_task_s::persistent, agent_task_s::server_name, strdup, agent_datastate_s::tasks, and agent_task_s::var_name.
Referenced by MC_AgentAddTask_chdl(), and MC_AgentAddTaskFromFile().
| EXPORTCH int MC_AgentAddTask_chdl | ( | void * | varg | ) |
Definition at line 3111 of file libmc.c.
References MC_AgentAddTask().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AgentAddTaskFromFile | ( | MCAgent_t | agent, | |
| const char * | filename, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent | |||
| ) |
Add a new task to an already existing agent.
| agent | An existing agent | |
| filename | The C code to use in the new task | |
| return_var_name | The name of the the return variable, or NULL if there is no return variable. | |
| server | The server to perform the task on. | |
| persistent | Whether or not the task is persistent. '1' indicates persistent, and '0' indicates not-persistent (the default) |
Definition at line 548 of file libmc.c.
References MC_AgentAddTask().
Attach a file to the agent's current task.
| agent | An existing agent | |
| name | The name to give the file | |
| filepath | The absolute path of the file |
Definition at line 584 of file libmc.c.
References agent_file_data_InitializeFromFilename(), agent_task_s::agent_file_list, agent_s::datastate, agent_file_data_s::name, strdup, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
Referenced by MC_AgentAttachFile_chdl().
| EXPORTCH int MC_AgentAttachFile_chdl | ( | void * | varg | ) |
Definition at line 3145 of file libmc.c.
References MC_AgentAttachFile().
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgency_t MC_AgentInfo_GetAgency | ( | stationary_agent_info_t * | stationary_agent_info | ) |
Get the host Mobile-C agency handle from a "stationary_agent_info_t" data structure.
| stationary_agent_info | A stationary_agent_info_t type variable provided to a stationary agent function |
Definition at line 460 of file libmc.c.
References stationary_agent_info_s::agency.
| EXPORTMC MCAgent_t MC_AgentInfo_GetAgent | ( | stationary_agent_info_t * | stationary_agent_info | ) |
Retrieve an agent handle from the stationary agent info from within a stationary agent.
| stationary_agent_info | A stationary_agent_info_t type variable provided to a stationary agent function |
The following example demonstrates usage of MC_AgentInfo_GetAgent()
Definition at line 465 of file libmc.c.
References stationary_agent_info_s::agent.
| EXPORTMC void* MC_AgentInfo_GetAgentArgs | ( | stationary_agent_info_t * | stationary_agent_info | ) |
Retrieve the agent argument supplied as the "agent_args" parameter in the MC_AddStationaryAgent() function.
| stationary_agent_info | A stationary_agent_info_t type variable provided to a stationary agent function |
Definition at line 470 of file libmc.c.
References stationary_agent_info_s::args.
Get a list of an agent's attached files.
| agent | An existing agent | |
| names | A pointer two an unallocated two dimentional character array. The function will allocated any necessary memory for storing the names. If names are allocated, the array must be freed by the user. | |
| num_files | A pointer to an integer which will be filled with the number of filenames |
Definition at line 604 of file libmc.c.
References agent_task_s::agent_file_list, agent_s::datastate, agent_file_data_s::name, agent_datastate_s::number_of_tasks, size, strdup, and agent_datastate_s::tasks.
Referenced by MC_AgentListFiles_chdl().
| EXPORTCH int MC_AgentListFiles_chdl | ( | void * | varg | ) |
Definition at line 3169 of file libmc.c.
References MC_AgentListFiles().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AgentRetrieveFile | ( | MCAgent_t | agent, | |
| int | task_num, | |||
| const char * | name, | |||
| const char * | save_path | |||
| ) |
Saves an agent's attached file to the filesystem.
| name | The name of the agent's stored file | |
| save_path | The location to save the file (including the filename) |
Definition at line 631 of file libmc.c.
References agent_task_s::agent_file_list, base64_decode_block(), base64_init_decodestate(), agent_file_data_s::data, agent_s::datastate, agent_datastate_s::number_of_tasks, size, and agent_datastate_s::tasks.
Referenced by MC_AgentRetrieveFile_chdl().
| EXPORTCH int MC_AgentRetrieveFile_chdl | ( | void * | varg | ) |
Definition at line 3196 of file libmc.c.
References MC_AgentRetrieveFile().
Referenced by agent_ChScriptInitVar().
Get the dimension of an agent's return data, if it is an array.
| agent | A return agent | |
| task | task to retrieve the agent return data size from |
Definition at line 698 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::array_dim, agent_s::datastate, agent_datastate_s::number_of_tasks, and agent_datastate_s::tasks.
Get the extent of a dimension of an agent's return data, if it is an array.
| agent | A return agent | |
| task | task to retrieve the agent return data size from | |
| index | The dimension index to get the extent |
Definition at line 674 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::array_dim, interpreter_variable_data_s::array_extent, agent_s::datastate, agent_datastate_s::number_of_tasks, and agent_datastate_s::tasks.
Get the total number of elements of the agent return data.
| agent | A return agent | |
| task | task to retrieve the agent return data size from | |
| index | The dimension index to get the extent |
Definition at line 716 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::array_dim, agent_s::datastate, agent_datastate_s::number_of_tasks, and agent_datastate_s::tasks.
Get a pointer to the agent's return data.
| agent | A return agent | |
| task | task to retrieve the agent return data from |
Definition at line 746 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::data, agent_s::datastate, agent_datastate_s::number_of_tasks, and agent_datastate_s::tasks.
Get the size of an agent's return data type.
| agent | A return agent | |
| task | task to retrieve the agent return data type size from |
Definition at line 763 of file libmc.c.
References agent_task_s::agent_return_data, CH_DATATYPE_SIZE, interpreter_variable_data_s::data_type, agent_s::datastate, agent_datastate_s::number_of_tasks, size, and agent_datastate_s::tasks.
Get the type of an agent's return data.
| agent | A return agent | |
| task | task to retrieve the agent return data type from |
Definition at line 786 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::data_type, agent_s::datastate, agent_datastate_s::number_of_tasks, and agent_datastate_s::tasks.
Check to see whether or not an agent's return data is an array.
| agent | A return agent | |
| task | task to check to see if the return data is an array. |
Definition at line 796 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::array_dim, agent_s::datastate, agent_datastate_s::number_of_tasks, and agent_datastate_s::tasks.
| EXPORTMC const void* MC_AgentVariableRetrieve | ( | MCAgent_t | agent, | |
| const char * | var_name, | |||
| int | task_num | |||
| ) |
Retrieve a pointer to a previously saved variable.
| agent | A MobileC agent. | |
| var_name | The name of the saved variable that has previously been saved. | |
| task_num | The previous completed task from which to retrieve the saved variable. |
The following example demonstrates usage of MC_AgentVariableRetrieve() from agent space.
Definition at line 817 of file libmc.c.
References agent_task_s::agent_variable_list, interpreter_variable_data_s::data, agent_s::datastate, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
Referenced by MC_AgentVariableRetrieve_chdl().
| EXPORTCH const void* MC_AgentVariableRetrieve_chdl | ( | void * | varg | ) |
Definition at line 3224 of file libmc.c.
References MC_AgentVariableRetrieve().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_AgentVariableRetrieveInfo | ( | MCAgent_t | agent, | |
| const char * | var_name, | |||
| int | task_num, | |||
| const void ** | data, | |||
| int * | dim, | |||
| const int ** | extent | |||
| ) |
Retrieve a info about a previously saved variable.
| agent | A MobileC agent. | |
| var_name | The name of the saved variable that has previously been saved. | |
| task_num | The previous completed task from which to retrieve the saved variable. | |
| data | (Output) The Variable Data | |
| dim | (Output) The dimension of the data array | |
| extent | (Output) The extents of the output array |
Definition at line 835 of file libmc.c.
References agent_task_s::agent_variable_list, interpreter_variable_data_s::array_dim, interpreter_variable_data_s::array_extent, interpreter_variable_data_s::data, agent_s::datastate, MC_ERR_NOT_FOUND, MC_SUCCESS, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
Mark an agent variable for saving.
| agent | A MobileC agent. | |
| var_name | The name of the variable to mark for saving. |
See agent_saved_variables_example/test1.xml for an example of usage of this api function.
The following example demonstrates usage of MC_AgentVariableSave() from agent space.
Definition at line 856 of file libmc.c.
References agent_s::datastate, MC_ERR_MEMORY, agent_task_s::num_saved_variables, agent_task_s::saved_variables, strdup, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
Referenced by MC_AgentVariableSave_chdl().
| EXPORTCH int MC_AgentVariableSave_chdl | ( | void * | varg | ) |
Definition at line 3248 of file libmc.c.
References MC_AgentVariableSave().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_Barrier | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Definition at line 877 of file libmc.c.
References mc_platform_s::barrier_queue, barrier_queue_Get(), barrier_node_s::cond, COND_BROADCAST, COND_WAIT, barrier_node_s::lock, MC_ERR_NOT_FOUND, agency_s::mc_platform, MC_SUCCESS, MUTEX_LOCK, MUTEX_UNLOCK, node, barrier_node_s::num_registered, and barrier_node_s::num_waiting.
Referenced by MC_Barrier_chdl().
| EXPORTCH int MC_Barrier_chdl | ( | void * | varg | ) |
Definition at line 3300 of file libmc.c.
References CHECK_NULL, MC_Barrier(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_BarrierDelete | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Find and delete an initialized MobileC Barrier.
| attr | A running MobileC agency | |
| id | The id of the barrier node to delete |
Definition at line 917 of file libmc.c.
References mc_platform_s::barrier_queue, barrier_queue_Delete(), and agency_s::mc_platform.
Referenced by MC_BarrierDelete_chdl().
| EXPORTCH int MC_BarrierDelete_chdl | ( | void * | varg | ) |
Definition at line 3323 of file libmc.c.
References CHECK_NULL, MC_BarrierDelete(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_BarrierInit | ( | MCAgency_t | attr, | |
| int | id, | |||
| int | num_procs | |||
| ) |
Initialize a MobileC Barrier.
| attr | A running MobileC agency | |
| id | The requested barrier id | |
| num_procs | The number of agents/threads/processes that will wait on the barrier |
The following example demonstrates an agent which sets up an MC_Barrier.
Definition at line 903 of file libmc.c.
References barrier_node_Initialize(), mc_platform_s::barrier_queue, barrier_queue_Add(), barrier_queue_Get(), MC_ERR, agency_s::mc_platform, MC_SUCCESS, and node.
Referenced by MC_BarrierInit_chdl().
| EXPORTCH int MC_BarrierInit_chdl | ( | void * | varg | ) |
Definition at line 3346 of file libmc.c.
References CHECK_NULL, MC_BarrierInit(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_CallAgentFunc | ( | MCAgent_t | agent, | |
| const char * | funcName, | |||
| void * | returnVal, | |||
| int | numArgs, | |||
| ... | ||||
| ) |
Use custom ChOptions_t type for internal Ch interpretor.
| attr | A running MobileC agency | |
| options | Initialized Ch options structure |
| agent | An initialized and executed MobileC agent | |
| funcName | The name of the function to call | |
| returnVal | The agent function's return value | |
| numArgs | The number of arguments supplied to the agent function | |
| ... | A variable argument list to be supplied to the agent function |
Definition at line 923 of file libmc.c.
References agent_s::agent_interp, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::run_lock.
| EXPORTCH int MC_CallAgentFunc_chdl | ( | void * | varg | ) |
Definition at line 3270 of file libmc.c.
References MC_CallAgentFuncVar().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_CallAgentFuncArg | ( | MCAgent_t | agent, | |
| const char * | funcName, | |||
| void * | returnVal, | |||
| void * | arg | |||
| ) |
Calls a function defined in an agent.
| agent | An initialized and executed MobileC agent | |
| funcName | The name of the function to call | |
| returnVal | The agent function's return value | |
| arg | The agent functions argument |
Definition at line 944 of file libmc.c.
References agent_s::agent_interp, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::run_lock.
| EXPORTMC int MC_CallAgentFuncV | ( | MCAgent_t | agent, | |
| const char * | funcName, | |||
| void * | returnVal, | |||
| va_list | ap | |||
| ) |
Calls a function defined in an agent.
| agent | An initialized and executed MobileC agent | |
| funcName | The name of the function to call | |
| returnVal | The agent function's return value | |
| ap | A variable argument list |
Definition at line 963 of file libmc.c.
References agent_s::agent_interp, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::run_lock.
| EXPORTMC int MC_CallAgentFuncVar | ( | MCAgent_t | agent, | |
| const char * | funcName, | |||
| void * | returnVal, | |||
| ChVaList_t | varg | |||
| ) |
Definition at line 983 of file libmc.c.
References agent_s::agent_interp, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::run_lock.
Referenced by MC_CallAgentFunc_chdl().
| EXPORTMC MCAgent_t MC_ComposeAgent | ( | const char * | name, | |
| const char * | home, | |||
| const char * | owner, | |||
| const char * | code, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent | |||
| ) |
Compose a new agent dynamically without using a prewritten XML file.
| name | The desired name of the new agent. | |
| home | The home of the new agent. | |
| owner | The owner of the new agent. | |
| code | The agent code | |
| return_var_name | The name of the agent's return variable. Set to "no-return" if no return variable is desired. | |
| server | The target destination of the agent. | |
| persitent | A flag indicating whether or not the agent should be persistent. A value of '1' indicates persistence, while a value of '0' indicates default non-persistent behaviour. |
Definition at line 1023 of file libmc.c.
References MC_ComposeAgentWithWorkgroup().
| EXPORTCH MCAgent_t MC_ComposeAgent_chdl | ( | void * | varg | ) |
Definition at line 3394 of file libmc.c.
References MC_ComposeAgentWithWorkgroup().
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgent_t MC_ComposeAgentFromFile | ( | const char * | name, | |
| const char * | home, | |||
| const char * | owner, | |||
| const char * | filename, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent | |||
| ) |
Compose a new agent dynamically from a source code file.
| filename | The filename of the source file | |
| name | The desired name of the new agent. | |
| home | The home of the new agent. | |
| owner | The owner of the new agent. | |
| code | The agent code | |
| return_var_name | The name of the agent's return variable. Set to "no-return" if no return variable is desired. | |
| server | The target destination of the agent. | |
| persitent | A flag indicating whether or not the agent should be persistent. A value of '1' indicates persistence, while a value of '0' indicates default non-persistent behaviour. |
Definition at line 1149 of file libmc.c.
References MC_ComposeAgentFromFileWithWorkgroup().
Referenced by handler_COMPOSE_SEND().
| EXPORTCH MCAgent_t MC_ComposeAgentFromFile_chdl | ( | void * | varg | ) |
Definition at line 3478 of file libmc.c.
References MC_ComposeAgentFromFileWithWorkgroup().
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgent_t MC_ComposeAgentFromFileS | ( | const char * | name, | |
| const char * | home, | |||
| const char * | owner, | |||
| const char * | filename, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent, | |||
| const char * | workgroup_code | |||
| ) |
Compose a new agent dynamically from a source code file.
| filename | The filename of the source file | |
| name | The desired name of the new agent. | |
| home | The home of the new agent. | |
| owner | The owner of the new agent. | |
| code | The agent code | |
| return_var_name | The name of the agent's return variable. Set to "no-return" if no return variable is desired. | |
| server | The target destination of the agent. | |
| workgroup_code | The secret workgroup code of the agent. Only agents with the same workgroup code may perform certain interactions. | |
| persitent | A flag indicating whether or not the agent should be persistent. A value of '1' indicates persistence, while a value of '0' indicates default non-persistent behaviour. |
Definition at line 1171 of file libmc.c.
References MC_ComposeAgentFromFileWithWorkgroup().
| EXPORTMC MCAgent_t MC_ComposeAgentFromFileWithWorkgroup | ( | const char * | name, | |
| const char * | home, | |||
| const char * | owner, | |||
| const char * | filename, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent, | |||
| const char * | workgroup_code | |||
| ) |
Compose a new agent dynamically from a source code file.
| filename | The filename of the source file | |
| name | The desired name of the new agent. | |
| home | The home of the new agent. | |
| owner | The owner of the new agent. | |
| code | The agent code | |
| return_var_name | The name of the agent's return variable. Set to "no-return" if no return variable is desired. | |
| server | The target destination of the agent. | |
| workgroup_code | The secret workgroup code of the agent. Only agents with the same workgroup code may perform certain interactions. | |
| persitent | A flag indicating whether or not the agent should be persistent. A value of '1' indicates persistence, while a value of '0' indicates default non-persistent behaviour. |
Definition at line 1196 of file libmc.c.
References MC_ComposeAgentWithWorkgroup().
Referenced by MC_ComposeAgentFromFile(), MC_ComposeAgentFromFile_chdl(), MC_ComposeAgentFromFileS(), and MC_ComposeAgentFromFileWithWorkgroup_chdl().
| EXPORTCH MCAgent_t MC_ComposeAgentFromFileWithWorkgroup_chdl | ( | void * | varg | ) |
Definition at line 3519 of file libmc.c.
References MC_ComposeAgentFromFileWithWorkgroup().
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgent_t MC_ComposeAgentS | ( | const char * | name, | |
| const char * | home, | |||
| const char * | owner, | |||
| const char * | code, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent, | |||
| const char * | workgroup_code | |||
| ) |
Compose a new agent dynamically without using a prewritten XML file.
| name | The desired name of the new agent. | |
| home | The home of the new agent. | |
| owner | The owner of the new agent. | |
| code | The agent code | |
| return_var_name | The name of the agent's return variable. Set to "no-return" if no return variable is desired. | |
| server | The target destination of the agent. | |
| workgroup_code | The secret workgroup code of the agent. Only agents with the same workgroup code may perform certain interactions. | |
| persitent | A flag indicating whether or not the agent should be persistent. A value of '1' indicates persistence, while a value of '0' indicates default non-persistent behaviour. |
Definition at line 1046 of file libmc.c.
References MC_ComposeAgentWithWorkgroup().
Referenced by MC_ComposeAgentWithWorkgroup_chdl().
| EXPORTMC MCAgent_t MC_ComposeAgentWithWorkgroup | ( | const char * | name, | |
| const char * | home, | |||
| const char * | owner, | |||
| const char * | code, | |||
| const char * | return_var_name, | |||
| const char * | server, | |||
| int | persistent, | |||
| const char * | workgroup_code | |||
| ) |
Compose a new agent dynamically without using a prewritten XML file.
| name | The desired name of the new agent. | |
| home | The home of the new agent. | |
| owner | The owner of the new agent. | |
| code | The agent code | |
| return_var_name | The name of the agent's return variable. Set to "no-return" if no return variable is desired. | |
| server | The target destination of the agent. | |
| workgroup_code | The secret workgroup code of the agent. Only agents with the same workgroup code may perform certain interactions. | |
| persitent | A flag indicating whether or not the agent should be persistent. A value of '1' indicates persistence, while a value of '0' indicates default non-persistent behaviour. |
Definition at line 1072 of file libmc.c.
References agent_datastate_s::agent_code, agent_datastate_s::agent_code_ids, agent_datastate_s::agent_codes, agent_datastate_New(), agent_New(), agent_s::agent_status, agent_task_New(), agent_s::agent_type, agent_s::datastate, agent_s::home, MC_LOCAL_AGENT, MC_WAIT_MESSGSEND, agent_s::name, agent_datastate_s::number_of_tasks, agent_s::orphan, agent_s::owner, agent_task_s::persistent, agent_task_s::server_name, strdup, agent_datastate_s::tasks, agent_task_s::var_name, and agent_s::wg_code.
Referenced by MC_ComposeAgent(), MC_ComposeAgent_chdl(), MC_ComposeAgentFromFileWithWorkgroup(), and MC_ComposeAgentS().
| EXPORTCH MCAgent_t MC_ComposeAgentWithWorkgroup_chdl | ( | void * | varg | ) |
Definition at line 3435 of file libmc.c.
References MC_ComposeAgentS().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_CondBroadcast | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Wakes up all agents/threads waiting on a condition variable.
| attr | A MobileC agency | |
| id | Synchronization variable id to broadcast to |
Definition at line 1242 of file libmc.c.
References syncListNode_s::cond, COND_BROADCAST, syncListNode_s::lock, MC_ERR_NOT_FOUND, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, syncListNode_s::signalled, mc_platform_s::syncList, and syncListFind().
Referenced by MC_CondBroadcast_chdl().
| EXPORTCH int MC_CondBroadcast_chdl | ( | void * | varg | ) |
Definition at line 3371 of file libmc.c.
References CHECK_NULL, MC_CondBroadcast(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_CondReset | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Reset a previously signalled MobileC condition variable.
| attr | A MobileC Agency | |
| id | The synchronization variable id to reset |
Definition at line 1294 of file libmc.c.
References syncListNode_s::lock, MC_ERR_NOT_FOUND, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, syncListNode_s::signalled, mc_platform_s::syncList, and syncListFind().
Referenced by MC_CondReset_chdl().
| EXPORTCH int MC_CondReset_chdl | ( | void * | varg | ) |
Definition at line 3585 of file libmc.c.
References CHECK_NULL, MC_CondReset(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_CondSignal | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Wakes up at least one thread waiting on a condition variable.
| attr | A MobileC agency | |
| id | synchronization variable id |
The following example demonstrates the agent-space version of the function, which is nearly identical to the binary space api function.
Definition at line 1257 of file libmc.c.
References syncListNode_s::cond, COND_SIGNAL, syncListNode_s::lock, MC_ERR_NOT_FOUND, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, syncListNode_s::signalled, mc_platform_s::syncList, and syncListFind().
Referenced by MC_CondSignal_chdl().
| EXPORTCH int MC_CondSignal_chdl | ( | void * | varg | ) |
Definition at line 3562 of file libmc.c.
References CHECK_NULL, MC_CondSignal(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_CondWait | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Wait on a MobileC synchronization variable.
| attr | A MobileC agency | |
| id | a synchronization variable id |
The following example demonstrates the agent-space version of this function.
Definition at line 1272 of file libmc.c.
References syncListNode_s::cond, COND_WAIT, syncListNode_s::lock, MC_ERR_NOT_FOUND, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, syncListNode_s::signalled, mc_platform_s::syncList, and syncListFind().
Referenced by MC_CondWait_chdl().
| EXPORTCH int MC_CondWait_chdl | ( | void * | varg | ) |
Definition at line 3608 of file libmc.c.
References CHECK_NULL, MC_CondWait(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
Performs a deep-copy of an agent structure.
| agent_out | A pointer to the agent to copy to. | |
| agent_in | The agent to copy |
Definition at line 1312 of file libmc.c.
References agent_Copy(), and MC_SUCCESS.
Stop and remove an agent.
| agent | An agent in any state (running, waiting, etc) |
Definition at line 1319 of file libmc.c.
References agent_s::agent_status, mc_platform_s::ams, CHECK_NULL, COND_SIGNAL, MC_ERR_INVALID, MC_ERR_INVALID_ARGS, agent_s::mc_platform, mc_platform_s::MC_signal_lock, MC_SUCCESS, MC_TerminateAgent(), MC_WAIT_FINISHED, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::wg_code.
Referenced by MC_DeleteAgent_chdl().
| EXPORTCH int MC_DeleteAgent_chdl | ( | void * | varg | ) |
Definition at line 3630 of file libmc.c.
References MC_DeleteAgent(), MC_ERR_NOT_FOUND, and MC_FindAgentByName().
Referenced by agent_ChScriptInitVar().
Stop and remove an agent in the same workgroup.
| calling_agent | The calling agent | |
| agent | An agent in any state (running, waiting, etc) |
Definition at line 1348 of file libmc.c.
References agent_s::agent_status, mc_platform_s::ams, CHECK_NULL, COND_SIGNAL, MC_ERR_INVALID, MC_ERR_INVALID_ARGS, agent_s::mc_platform, mc_platform_s::MC_signal_lock, MC_SUCCESS, MC_TerminateAgentWG(), MC_WAIT_FINISHED, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::wg_code.
Referenced by MC_DeleteAgentWG_chdl().
| EXPORTCH int MC_DeleteAgentWG_chdl | ( | void * | varg | ) |
Definition at line 3650 of file libmc.c.
References MC_DeleteAgentWG(), MC_ERR_NOT_FOUND, and MC_FindAgentByName().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_DeregisterService | ( | MCAgency_t | agency, | |
| int | agentID, | |||
| const char * | serviceName | |||
| ) |
Definition at line 1400 of file libmc.c.
References mc_platform_s::df, df_AddRequest(), df_request_list_node_New(), and agency_s::mc_platform.
Referenced by MC_DeregisterService_chdl().
| EXPORTCH int MC_DeregisterService_chdl | ( | void * | varg | ) |
Definition at line 3699 of file libmc.c.
References CHECK_NULL, MC_DeregisterService(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_DestroyServiceSearchResult | ( | char ** | agentName, | |
| char ** | serviceName, | |||
| int * | agentID, | |||
| int | numResult | |||
| ) |
Free memory allocated by a Service Search operation.
| agentName | agent names returned by a search operation. | |
| serviceName | service names return by a search operation. | |
| agentID | list of agent id's returned by a search operation. | |
| numResult | The number of hits returned by a search operation. |
Definition at line 1380 of file libmc.c.
Referenced by MC_DestroyServiceSearchResult_chdl().
| EXPORTCH int MC_DestroyServiceSearchResult_chdl | ( | void * | varg | ) |
Definition at line 3672 of file libmc.c.
References MC_DestroyServiceSearchResult().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_End | ( | MCAgency_t | attr | ) |
End an agency.
| attr | A running agency |
Definition at line 1429 of file libmc.c.
References mc_platform_s::acc, mc_platform_s::ams, buf, mc_platform_s::cmd_prompt, COND_BROADCAST, COND_SIGNAL, mc_platform_s::connection_queue, mc_platform_s::df, GET_THREAD_MODE, agency_s::hostName, agency_s::mc_platform, mc_platform_Destroy(), MC_THREAD_ACC, MC_THREAD_AMS, MC_THREAD_CP, MC_THREAD_DF, mc_platform_s::message_queue, MUTEX_LOCK, MUTEX_UNLOCK, agency_s::portno, mc_platform_s::quit, mc_platform_s::quit_cond, mc_platform_s::quit_lock, send, cmd_prompt_s::thread, THREAD_CANCEL, THREAD_JOIN, and agency_s::threads.
Referenced by MC_End_chdl().
| EXPORTCH int MC_End_chdl | ( | void * | varg | ) |
Definition at line 3726 of file libmc.c.
References CHECK_NULL, MC_End(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgent_t MC_FindAgentByID | ( | MCAgency_t | attr, | |
| int | ID | |||
| ) |
Find an agent by its id.
| attr | the agency to search | |
| ID | the id to search for |
Definition at line 1544 of file libmc.c.
References mc_platform_s::agent_queue, and agency_s::mc_platform.
Referenced by MC_FindAgentByID_chdl().
| EXPORTCH MCAgent_t MC_FindAgentByID_chdl | ( | void * | varg | ) |
Definition at line 3743 of file libmc.c.
References CHECK_NULL, MC_FindAgentByID(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgent_t MC_FindAgentByName | ( | MCAgency_t | attr, | |
| const char * | name | |||
| ) |
Find an agent by its name.
| attr | a running agency | |
| name | name to search for |
Definition at line 1531 of file libmc.c.
References mc_platform_s::agent_queue, and agency_s::mc_platform.
Referenced by MC_AclSend(), MC_DeleteAgent_chdl(), MC_DeleteAgentWG_chdl(), MC_FindAgentByName_chdl(), MC_TerminateAgent_chdl(), and MC_TerminateAgentWG_chdl().
| EXPORTCH MCAgent_t MC_FindAgentByName_chdl | ( | void * | varg | ) |
Definition at line 3766 of file libmc.c.
References CHECK_NULL, MC_FindAgentByName(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC time_t MC_GetAgentArrivalTime | ( | MCAgent_t | agent | ) |
Definition at line 1562 of file libmc.c.
References agent_s::arrival_time.
Referenced by MC_GetAgentArrivalTime_chdl().
| EXPORTCH time_t MC_GetAgentArrivalTime_chdl | ( | void * | varg | ) |
Definition at line 3793 of file libmc.c.
References MC_GetAgentArrivalTime().
| EXPORTMC void* MC_GetAgentExecEngine | ( | MCAgent_t | agent | ) |
Retrieve an agent's Ch interpreter.
| agent | a valid agent |
Definition at line 1601 of file libmc.c.
References agent_s::agent_interp.
Retrieve an agent's id.
Definition at line 1607 of file libmc.c.
References agent_s::id.
Referenced by MC_GetAgentID_chdl().
| EXPORTCH int MC_GetAgentID_chdl | ( | void * | varg | ) |
Definition at line 3813 of file libmc.c.
References MC_GetAgentID().
Referenced by agent_ChScriptInitVar().
| EXPORTMC char* MC_GetAgentName | ( | MCAgent_t | agent | ) |
Definition at line 1615 of file libmc.c.
References agent_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::name.
Referenced by MC_GetAgentName_chdl().
| EXPORTCH char* MC_GetAgentName_chdl | ( | void * | varg | ) |
Definition at line 3829 of file libmc.c.
References MC_GetAgentName().
Referenced by agent_ChScriptInitVar().
Retrive the number of tasks an agent has.
Definition at line 1698 of file libmc.c.
References agent_s::datastate, and agent_datastate_s::number_of_tasks.
Referenced by MC_GetAgentNumTasks_chdl().
| EXPORTCH int MC_GetAgentNumTasks_chdl | ( | void * | varg | ) |
Definition at line 3845 of file libmc.c.
References MC_GetAgentNumTasks().
| EXPORTMC int MC_GetAgentReturnData | ( | MCAgent_t | agent, | |
| int | task_num, | |||
| void ** | data, | |||
| int * | dim, | |||
| int ** | extent | |||
| ) |
Get an agent's return data.
| agent | a valid agent | |
| task_num | the task for which to retrieve the return data. The task must already be completed. | |
| data | the return data. May be multi dimensional array. | |
| dim | the number of dimensions of the return array. | |
| extent | the extent of each one of the array dimensions. |
This file demonstrates the retrieval of agent return data from an agent
This is the agent which gets the data
Definition at line 1633 of file libmc.c.
References agent_task_s::agent_return_data, interpreter_variable_data_s::array_dim, interpreter_variable_data_s::array_extent, CH_DATATYPE_SIZE, interpreter_variable_data_s::data_type, agent_s::datastate, agent_datastate_s::number_of_tasks, size, and agent_datastate_s::tasks.
Get an agent's current status.
Definition at line 1577 of file libmc.c.
References agent_s::agent_status, agent_s::agent_status_lock, agent_s::lock, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_GetAgentStatus_chdl().
| EXPORTCH int MC_GetAgentStatus_chdl | ( | void * | varg | ) |
Definition at line 3861 of file libmc.c.
References MC_GetAgentStatus().
Referenced by agent_ChScriptInitVar().
| EXPORTMC enum MC_AgentType_e MC_GetAgentType | ( | MCAgent_t | agent | ) |
Get an agent's type.
Definition at line 1704 of file libmc.c.
References agent_s::agent_type.
| EXPORTMC char* MC_GetAgentXMLString | ( | MCAgent_t | agent | ) |
Get an agent's xml string.
Definition at line 1589 of file libmc.c.
References agent_s::datastate, mxmlSaveAllocString(), and agent_datastate_s::xml_agent_root.
Referenced by MC_GetAgentXMLString_chdl().
| EXPORTCH char* MC_GetAgentXMLString_chdl | ( | void * | varg | ) |
Definition at line 3877 of file libmc.c.
References MC_GetAgentXMLString().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_GetAllAgents | ( | MCAgency_t | attr, | |
| MCAgent_t ** | agents, | |||
| int * | num_agents | |||
| ) |
Definition at line 1714 of file libmc.c.
References mc_platform_s::agent_queue, mc_platform_s::giant, mc_platform_s::giant_lock, MC_HaltAgency(), agency_s::mc_platform, MC_ResumeAgency(), MUTEX_LOCK, and MUTEX_UNLOCK.
| EXPORTCH int MC_GetTimeOfDay_chdl | ( | void * | varg | ) |
Definition at line 3893 of file libmc.c.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_HaltAgency | ( | MCAgency_t | agency | ) |
Halt an agency: Do not process new entries in queues.
| agency | A handle to a running MobileC agency. |
Definition at line 1750 of file libmc.c.
References mc_platform_s::giant, mc_platform_s::giant_lock, agency_s::mc_platform, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_GetAllAgents(), and MC_HaltAgency_chdl().
| EXPORTCH int MC_HaltAgency_chdl | ( | void * | varg | ) |
Definition at line 3908 of file libmc.c.
References CHECK_NULL, MC_HaltAgency(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgency_t MC_Initialize | ( | int | port, | |
| MCAgencyOptions_t * | options | |||
| ) |
Initialize and start a MobileC agency.
| port | the TCP port the agency should bind to | |
| options | initialized MobileC options or NULL for default options |
Definition at line 1759 of file libmc.c.
References agency_s::agentInitCallback, agency_s::agentInitUserData, MCAgencyOptions_s::bluetooth, agency_s::bluetooth, buf, MCAgencyOptions_s::ch_options, agency_s::client, MCAgencyOptions_s::default_agent_status, agency_s::default_agentstatus, f, agency_s::hostName, MCAgencyOptions_s::initialized, MCAgencyOptions_s::initInterps, agency_s::initInterps, agency_s::known_host_filename, MCAgencyOptions_s::known_host_filename, MC_InitializeAgencyOptions(), MC_INITIALIZED_CODE, mc_platform, agency_s::mc_platform, mc_platform_Initialize(), MC_THREAD_ALL, MCAgencyOptions_s::passphrase, agency_s::portno, agency_s::priv_key_filename, MCAgencyOptions_s::priv_key_filename, read_encrypted_file(), agency_s::server, MCAgencyOptions_s::stack_size, agency_s::stack_size, strdup, MCAgencyOptions_s::threads, and agency_s::threads.
| EXPORTMC int MC_InitializeAgencyOptions | ( | struct MCAgencyOptions_s * | options | ) |
Initialize MobileC options.
| options | options to initialize. |
Definition at line 1879 of file libmc.c.
References MCAgencyOptions_s::bluetooth, MCAgencyOptions_s::default_agent_status, MCAgencyOptions_s::initialized, MCAgencyOptions_s::initInterps, MCAgencyOptions_s::known_host_filename, MC_INITIALIZED_CODE, MC_THREAD_ALL, MC_WAIT_CH, MCAgencyOptions_s::modified, MCAgencyOptions_s::passphrase, MCAgencyOptions_s::priv_key_filename, MCAgencyOptions_s::stack_size, and MCAgencyOptions_s::threads.
Referenced by MC_Initialize().
| EXPORTMC int MC_LoadAgentFromFile | ( | MCAgency_t | attr, | |
| const char * | filename | |||
| ) |
Load an agent from a file into an agency.
| agency | A valid and running Mobile-C agency | |
| filename | Filename containing the agent to load |
Definition at line 1902 of file libmc.c.
References buf, agency_s::mc_platform, message_Destroy(), message_InitializeFromString(), message_New(), mc_platform_s::message_queue, MXML_DESCEND, mxmlFindElement(), mxmlLoadString(), message_s::to_address, message_s::xml_payload, and message_s::xml_root.
| EXPORTMC int MC_MainLoop | ( | MCAgency_t | attr | ) |
Wait indefinitely.
Definition at line 2689 of file libmc.c.
References COND_WAIT, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, mc_platform_s::quit, mc_platform_s::quit_cond, and mc_platform_s::quit_lock.
Migrates a running agent to another host.
| agent | The agent to migrate | |
| hostname | The new host to migrate the agent to | |
| port | The new port to migrate the agent to |
Definition at line 1974 of file libmc.c.
References agent_s::datastate, agent_datastate_s::progress_modifier, agent_task_s::server_name, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
Referenced by MC_MigrateAgent_chdl().
| EXPORTCH int MC_MigrateAgent_chdl | ( | void * | varg | ) |
Definition at line 3925 of file libmc.c.
References MC_MigrateAgent(), and port.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_MutexLock | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Locks a MobileC synchronization variable as a mutex.
| attr | a MobileC agency handle | |
| id | the synchronization variable id to lock |
Consider the following agents, which use the agent-space version of this api function. Note that the 'sleep' agent is sent first, followed by the 'wake' agent.
Definition at line 1996 of file libmc.c.
References syncListNode_s::lock, agency_s::mc_platform, MUTEX_LOCK, mc_platform_s::syncList, and syncListFind().
Referenced by MC_MutexLock_chdl().
| EXPORTCH int MC_MutexLock_chdl | ( | void * | varg | ) |
Definition at line 3944 of file libmc.c.
References CHECK_NULL, MC_MutexLock(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_MutexUnlock | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Definition at line 2008 of file libmc.c.
References syncListNode_s::lock, agency_s::mc_platform, MUTEX_UNLOCK, mc_platform_s::syncList, and syncListFind().
Referenced by MC_MutexUnlock_chdl().
| EXPORTCH int MC_MutexUnlock_chdl | ( | void * | varg | ) |
Definition at line 3968 of file libmc.c.
References CHECK_NULL, MC_MutexUnlock(), and agency_s::mc_platform.
Referenced by agent_ChScriptInitVar().
Prints an agents code to stdout.
Definition at line 2020 of file libmc.c.
References agent_datastate_s::agent_code, agent_s::datastate, agent_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, agent_datastate_s::number_of_tasks, and agent_datastate_s::task_progress.
Referenced by MC_PrintAgentCode_chdl().
| EXPORTCH int MC_PrintAgentCode_chdl | ( | void * | varg | ) |
Definition at line 3992 of file libmc.c.
References MC_PrintAgentCode().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_RegisterService | ( | MCAgency_t | agency, | |
| MCAgent_t | agent, | |||
| int | agentID, | |||
| const char * | agentName, | |||
| char ** | serviceNames, | |||
| int | numServices | |||
| ) |
Register a new service with the Directory Facilitator.
| agency | a MobileC agency handle | |
| agent | (OPTIONAL: See note) a MobileC agent | |
| agentID | (OPTIONAL: See note) a MobileC agent id | |
| agentName | (OPTIONAL: See note) a MobileC agent name | |
| serviceNames | an array of character strings of service names | |
| numServices | the number of services described in 'serviceNames' |
Definition at line 2036 of file libmc.c.
References CHECK_NULL, mc_platform_s::df, df_AddRequest(), df_request_list_node_New(), agent_s::id, MC_ERR_INVALID_ARGS, MC_ERR_MEMORY, agency_s::mc_platform, MUTEX_INIT, MUTEX_T, and agent_s::name.
Referenced by MC_RegisterService_chdl().
| EXPORTCH int MC_RegisterService_chdl | ( | void * | varg | ) |
Definition at line 4008 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_RegisterService().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_ResetSignal | ( | MCAgency_t | attr | ) |
Reset a MobileC signal.
Definition at line 2175 of file libmc.c.
References COND_SIGNAL, mc_platform_s::giant, mc_platform_s::giant_cond, mc_platform_s::giant_lock, MC_NO_SIGNAL, agency_s::mc_platform, mc_platform_s::MC_signal, MUTEX_LOCK, and MUTEX_UNLOCK.
| EXPORTMC int MC_ResumeAgency | ( | MCAgency_t | agency | ) |
Resumes a halted agency.
| agency | An agency previously halted with the MC_HaltAgency() function. |
Definition at line 2115 of file libmc.c.
References mc_platform_s::giant, mc_platform_s::giant_lock, agency_s::mc_platform, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_GetAllAgents(), and MC_ResumeAgency_chdl().
| EXPORTCH int MC_ResumeAgency_chdl | ( | void * | varg | ) |
Definition at line 4045 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_ResumeAgency().
Referenced by agent_ChScriptInitVar().
| EXPORTMC MCAgent_t MC_RetrieveAgent | ( | MCAgency_t | attr | ) |
Retrieves the oldest agent from an agency.
Definition at line 2124 of file libmc.c.
References mc_platform_s::agent_queue, agent_s::agent_status, agent_s::agent_status_lock, ListSearch(), MC_AGENT_NEUTRAL, agency_s::mc_platform, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_RetrieveAgent_chdl().
| EXPORTCH MCAgent_t MC_RetrieveAgent_chdl | ( | void * | varg | ) |
Definition at line 4063 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_RetrieveAgent().
Referenced by agent_ChScriptInitVar().
| EXPORTMC char* MC_RetrieveAgentCode | ( | MCAgent_t | agent | ) |
Retrieves an agent's Ch code.
Definition at line 2159 of file libmc.c.
References agent_datastate_s::agent_code, buf, agent_s::datastate, agent_s::lock, MUTEX_LOCK, MUTEX_UNLOCK, and agent_datastate_s::task_progress.
Referenced by MC_RetrieveAgentCode_chdl().
| EXPORTCH char* MC_RetrieveAgentCode_chdl | ( | void * | varg | ) |
Definition at line 4080 of file libmc.c.
References MC_RetrieveAgentCode().
Referenced by agent_ChScriptInitVar().
| EXPORTCH int MC_SaveData_chdl | ( | void * | varg | ) |
Definition at line 4096 of file libmc.c.
References agent_task_s::agent_variable_list, interpreter_variable_data_s::data, interpreter_variable_data_s::data_type, agent_s::datastate, interpreter_variable_data_New(), interpreter_variable_data_s::name, interpreter_variable_data_s::size, size, strdup, agent_datastate_s::task_progress, and agent_datastate_s::tasks.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SearchForService | ( | MCAgency_t | attr, | |
| const char * | searchString, | |||
| char *** | agentNames, | |||
| char *** | serviceNames, | |||
| int ** | agentIDs, | |||
| int * | numResults | |||
| ) |
Search the directory facilitator for a service.
| attr | (input) a MobileC agency handle | |
| searchString | (input) substring to search services for | |
| agentNames | (return) array of agent names with matching services | |
| serviceNames | (return) array of matching service names | |
| agentIDs | (return) array of matching agent IDs | |
| numResults | (return) number of matching results |
Definition at line 2186 of file libmc.c.
References CHECK_NULL, COND_SLEEP_ACTION, mc_platform_s::df, df_AddRequest(), df_request_list_node_Destroy(), df_request_list_node_New(), df_request_search_Destroy(), df_request_search_New(), MC_ERR_MEMORY, agency_s::mc_platform, MC_SUCCESS, and search.
Referenced by MC_SearchForService_chdl().
| EXPORTCH int MC_SearchForService_chdl | ( | void * | varg | ) |
Definition at line 4131 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_SearchForService().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SemaphorePost | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Post to a MobileC synchronization variable semaphore.
| attr | a MobileC agency handle | |
| id | the synchronization variable id to post to |
Definition at line 2236 of file libmc.c.
References agency_s::mc_platform, syncListNode_s::sem, SEMAPHORE_POST, mc_platform_s::syncList, and syncListFind().
Referenced by MC_SemaphorePost_chdl().
| EXPORTCH int MC_SemaphorePost_chdl | ( | void * | varg | ) |
Definition at line 4172 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_SemaphorePost().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SemaphoreWait | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Decreases a MobileC synchronization variable semaphore count by one.
| attr | a MobileC agency handle | |
| id | synchronization variable id to wait on |
Definition at line 2248 of file libmc.c.
References agency_s::mc_platform, syncListNode_s::sem, SEMAPHORE_WAIT, mc_platform_s::syncList, and syncListFind().
Referenced by MC_SemaphoreWait_chdl().
| EXPORTCH int MC_SemaphoreWait_chdl | ( | void * | varg | ) |
Definition at line 4196 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_SemaphoreWait().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SendAgent | ( | MCAgency_t | attr, | |
| const char * | message | |||
| ) |
Sends an agent migration message.
| attr | a MobileC agency handle | |
| message | a valid MobileC xml agent migration message |
Definition at line 2270 of file libmc.c.
References agent_Initialize(), mc_platform_s::agent_queue, agent_s::agent_status, agent_s::agent_status_cond, agent_s::agent_status_lock, mc_platform_s::ams, COND_BROADCAST, MC_ERR, agency_s::mc_platform, MC_WAIT_MESSGSEND, message_Destroy(), message_InitializeFromString(), message_New(), MUTEX_LOCK, and MUTEX_UNLOCK.
| EXPORTMC int MC_SendAgentFile | ( | MCAgency_t | attr, | |
| const char * | filename | |||
| ) |
Sends an agent migration message.
| attr | a MobileC agency handle | |
| filename | file containing a valid MobileC xml agent migration message |
Definition at line 2321 of file libmc.c.
References agent_Initialize(), mc_platform_s::agent_queue, agent_s::agent_status, agent_s::agent_status_cond, agent_s::agent_status_lock, mc_platform_s::ams, buf, COND_BROADCAST, agency_s::mc_platform, MC_WAIT_MESSGSEND, message_Destroy(), message_InitializeFromString(), message_New(), MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by handler_SEND().
| EXPORTMC int MC_SendAgentMigrationMessage | ( | MCAgency_t | attr, | |
| const char * | message, | |||
| const char * | hostname, | |||
| int | port | |||
| ) |
Sends an agent migration message.
| attr | a MobileC agency handle | |
| message | a valid MobileC xml agent migration message | |
| hostname | host to send the message to | |
| port | port to send the message to |
Definition at line 2392 of file libmc.c.
References MC_ERR, agency_s::mc_platform, message_Destroy(), message_InitializeFromString(), message_New(), and mc_platform_s::message_queue.
Referenced by MC_SendAgentMigrationMessage_chdl().
| EXPORTCH int MC_SendAgentMigrationMessage_chdl | ( | void * | varg | ) |
Definition at line 4220 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, MC_SendAgentMigrationMessage(), and port.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SendAgentMigrationMessageFile | ( | MCAgency_t | attr, | |
| const char * | filename, | |||
| const char * | hostname, | |||
| int | port | |||
| ) |
Sends an agent migration message.
| attr | a MobileC agency handle | |
| filename | file containing a valid MobileC xml agent migration message | |
| hostname | hostname to send the agent to | |
| port | port to send the agent to |
Definition at line 2426 of file libmc.c.
References agent_Initialize(), mc_platform_s::agent_queue, agent_s::agent_status, agent_s::agent_status_cond, agent_s::agent_status_lock, mc_platform_s::ams, buf, COND_BROADCAST, agency_s::mc_platform, MC_WAIT_MESSGSEND, message_Destroy(), message_InitializeFromString(), message_New(), MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_SendAgentMigrationMessageFile_chdl().
| EXPORTCH int MC_SendAgentMigrationMessageFile_chdl | ( | void * | varg | ) |
Definition at line 4245 of file libmc.c.
References MC_SendAgentMigrationMessageFile(), and port.
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SendCh | ( | MCAgency_t | attr, | |
| const char * | filename, | |||
| const char * | remotehost, | |||
| int | port | |||
| ) |
| EXPORTMC int MC_SendSteerCommand | ( | MCAgency_t | attr, | |
| enum MC_SteerCommand_e | cmd | |||
| ) |
Definition at line 2499 of file libmc.c.
References COND_BROADCAST, agency_s::mc_platform, mc_platform_s::MC_steer_command, mc_platform_s::MC_steer_cond, mc_platform_s::MC_steer_lock, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_SendSteerCommand_chdl().
| EXPORTCH int MC_SendSteerCommand_chdl | ( | void * | varg | ) |
Definition at line 4265 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_SendSteerCommand().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SetAgentStatus | ( | MCAgent_t | agent, | |
| enum MC_AgentStatus_e | status | |||
| ) |
Set an agent's status.
| agent | a MobileC agent | |
| status | agent status of type 'enum MC_AgentStatus_e' |
Definition at line 2509 of file libmc.c.
References agent_s::agent_status, agent_s::agent_status_cond, agent_s::agent_status_lock, mc_platform_s::ams, COND_BROADCAST, COND_SIGNAL, agent_s::lock, agent_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, and agent_s::orphan.
Referenced by MC_SetAgentStatus_chdl().
| EXPORTCH int MC_SetAgentStatus_chdl | ( | void * | varg | ) |
Definition at line 4288 of file libmc.c.
References MC_SetAgentStatus().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SetDefaultAgentStatus | ( | MCAgency_t | agency, | |
| enum MC_AgentStatus_e | status | |||
| ) |
Sets default incoming agent status.
| agency | a MobileC agency handle | |
| status | the status to set all incoming agents |
Definition at line 2527 of file libmc.c.
References mc_platform_s::default_agentstatus, and agency_s::mc_platform.
Referenced by MC_SetDefaultAgentStatus_chdl().
| EXPORTCH int MC_SetDefaultAgentStatus_chdl | ( | void * | varg | ) |
Definition at line 4306 of file libmc.c.
References CHECK_NULL, int, agency_s::mc_platform, and MC_SetDefaultAgentStatus().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SetThreadOff | ( | MCAgencyOptions_t * | options, | |
| enum MC_ThreadIndex_e | index | |||
| ) |
Sets a MobileC thread to "off" status.
| options | MobileC options previously initialized with MC_InitializeAgencyOptions() | |
| index | the thread to set |
Definition at line 2554 of file libmc.c.
References SET_THREAD_OFF, and MCAgencyOptions_s::threads.
| EXPORTMC int MC_SetThreadOn | ( | MCAgencyOptions_t * | options, | |
| enum MC_ThreadIndex_e | index | |||
| ) |
Sets a MobileC thread to "on" status.
| options | MobileC options previously initialized with MC_InitializeAgencyOptions() | |
| index | the thread to set |
Definition at line 2537 of file libmc.c.
References SET_THREAD_ON, and MCAgencyOptions_s::threads.
| EXPORTMC int MC_SetThreadsAllOff | ( | MCAgencyOptions_t * | options | ) |
Set all MobileC threads to 'off' status.
| options | a MobileC options structure initialized with with the MC_InitializeAgencyOptions() function. |
Definition at line 2561 of file libmc.c.
References MC_THREAD_ALL, SET_THREAD_OFF, and MCAgencyOptions_s::threads.
| EXPORTMC int MC_SetThreadsAllOn | ( | MCAgencyOptions_t * | options | ) |
Set all Mobile-C threads on.
| options | MobileC options structure, initialized with MC_InitializeAgencyOptions() |
Definition at line 2544 of file libmc.c.
References MC_THREAD_ALL, SET_THREAD_ON, and MCAgencyOptions_s::threads.
| EXPORTMC int MC_Steer | ( | MCAgency_t | attr, | |
| int(*)(void *data) | funcptr, | |||
| void * | arg | |||
| ) |
Set up a steerable algorithm.
| attr | a MobileC agency handle | |
| funcptr | a function pointer to the algorithm | |
| arg | an argument for the algorithm function |
Definition at line 2571 of file libmc.c.
References agency_s::mc_platform, MC_RESTART, MC_RUN, mc_platform_s::MC_steer_command, mc_platform_s::MC_steer_lock, MUTEX_LOCK, and MUTEX_UNLOCK.
| EXPORTMC enum MC_SteerCommand_e MC_SteerControl | ( | void | ) |
The MobileC user-algorithm steering function.
Definition at line 2590 of file libmc.c.
References COND_WAIT, mc_platform_s::MC_steer_command, mc_platform_s::MC_steer_cond, mc_platform_s::MC_steer_lock, MC_SUSPEND, MUTEX_LOCK, and MUTEX_UNLOCK.
| EXPORTMC int MC_SyncDelete | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Deletes a previously initialized synchronization variable.
| attr | a MobileC agency handle | |
| id | the sync variable id to delete |
Definition at line 2606 of file libmc.c.
References syncList_s::giant_lock, syncListNode_s::lock, MC_ERR_NOT_FOUND, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, mc_platform_s::syncList, syncListFind(), syncListNodeDestroy(), and syncListRemove().
Referenced by MC_SyncDelete_chdl().
| EXPORTCH int MC_SyncDelete_chdl | ( | void * | varg | ) |
Definition at line 4329 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_SyncDelete().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_SyncInit | ( | MCAgency_t | attr, | |
| int | id | |||
| ) |
Initializes a new MobileC synchronization variable.
| attr | a MobileC agency handle | |
| id | the requested sync variable id |
Definition at line 2636 of file libmc.c.
References syncList_s::giant_lock, syncListNode_s::id, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, node, mc_platform_s::syncList, syncListAddNode(), syncListFind(), and syncListNodeNew().
Referenced by MC_SyncInit_chdl().
| EXPORTCH int MC_SyncInit_chdl | ( | void * | varg | ) |
Definition at line 4352 of file libmc.c.
References CHECK_NULL, agency_s::mc_platform, and MC_SyncInit().
Referenced by agent_ChScriptInitVar().
Halt a running agent.
Definition at line 2661 of file libmc.c.
References agent_s::agent_interp.
Referenced by ams_ManageAgentList(), MC_DeleteAgent(), and MC_TerminateAgent_chdl().
| EXPORTCH int MC_TerminateAgent_chdl | ( | void * | varg | ) |
Definition at line 4376 of file libmc.c.
References MC_ERR_NOT_FOUND, MC_FindAgentByName(), and MC_TerminateAgent().
Referenced by agent_ChScriptInitVar().
Definition at line 2671 of file libmc.c.
References agent_s::agent_interp, MC_ERR_INVALID_ARGS, and agent_s::wg_code.
Referenced by MC_DeleteAgentWG(), and MC_TerminateAgentWG_chdl().
| EXPORTCH int MC_TerminateAgentWG_chdl | ( | void * | varg | ) |
Definition at line 4397 of file libmc.c.
References MC_ERR_NOT_FOUND, MC_FindAgentByName(), and MC_TerminateAgentWG().
Referenced by agent_ChScriptInitVar().
| EXPORTMC int MC_WaitAgent | ( | MCAgency_t | attr | ) |
Wait indefinitely.
Definition at line 2700 of file libmc.c.
References mc_platform_s::agent_queue, COND_WAIT, mc_platform, agency_s::mc_platform, MUTEX_LOCK, MUTEX_UNLOCK, and size.
| EXPORTMC MCAgent_t MC_WaitRetrieveAgent | ( | MCAgency_t | attr | ) |
Wait and retrieve an agent.
Definition at line 2720 of file libmc.c.
References mc_platform_s::agent_queue, ListSearch(), agency_s::mc_platform, MC_RECV_AGENT, MC_WaitSignal(), MUTEX_LOCK, and MUTEX_UNLOCK.
| EXPORTMC int MC_WaitSignal | ( | MCAgency_t | attr, | |
| int | signals | |||
| ) |
Wait for a MobileC signal.
| attr | a MobileC agency handle | |
| signals | a flag of signals to wait for, of type 'enum MC_Signal_e' |
Definition at line 2738 of file libmc.c.
References COND_WAIT, mc_platform_s::giant, mc_platform_s::giant_lock, agency_s::mc_platform, mc_platform_s::MC_signal, mc_platform_s::MC_signal_cond, mc_platform_s::MC_signal_lock, MUTEX_LOCK, and MUTEX_UNLOCK.
Referenced by MC_WaitRetrieveAgent().
Definition at line 77 of file libmc.c.
Referenced by fipa_envelope_Compose__from().
1.6.3