#include <pthread.h>#include <semaphore.h>#include "config.h"Go to the source code of this file.
Value:
switch(type) { \ case CH_CHARTYPE: \ size = sizeof(char); \ break; \ case CH_INTTYPE: \ size = sizeof(int); \ break; \ case CH_UINTTYPE: \ size = sizeof(unsigned int); \ break; \ case CH_SHORTTYPE: \ size = sizeof(short); \ break; \ case CH_USHORTTYPE: \ size = sizeof(unsigned short); \ break; \ case CH_FLOATTYPE: \ size = sizeof(float); \ break; \ case CH_DOUBLETYPE: \ size = sizeof(double); \ break; \ default: \ fprintf(stderr, "Unknown data type: %d at %s:%d", \ type, __FILE__, __LINE__); \ size=0; \ }
Definition at line 460 of file macros.h.
Referenced by agent_AddPersistentVariable(), agent_xml_compose__create_row_nodes(), agent_xml_parse__data(), agent_xml_parse__fill_row_data(), agent_xml_parse__row(), interpreter_variable_data_Initialize(), interpreter_variable_data_InitializeFromAgent(), and MC_GetAgentReturnData().
Value:
switch (type) { \ case CH_INTTYPE: \ *(int*)val = atoi(string); \ break; \ case CH_UINTTYPE: \ *(unsigned int*)val = atoi(string); \ break; \ case CH_SHORTTYPE: \ *(short*)val = (short)atoi(string); /*FIXME*/ \ break; \ case CH_USHORTTYPE: \ *(unsigned short*)val = (unsigned short)atoi(string); /*FIXME*/ \ break; \ case CH_FLOATTYPE: \ *(float*)val = strtof(string, NULL); \ break; \ case CH_DOUBLETYPE: \ *(double*)val = strtod(string, NULL); \ break; \ default: \ fprintf(stderr, \ "Unsupported data type: %d %s:%d\n", \ type, __FILE__, __LINE__ ); \ }
Definition at line 574 of file macros.h.
Referenced by agent_xml_parse__data().
Value:
switch(type) { \ case CH_CHARTYPE: \ strcpy(string, "char"); \ break; \ case CH_INTTYPE: \ strcpy(string, "int"); \ break; \ case CH_UINTTYPE: \ strcpy(string, "unsigned int"); \ break; \ case CH_SHORTTYPE: \ strcpy(string, "short"); \ break; \ case CH_USHORTTYPE: \ strcpy(string, "unsigned short"); \ break; \ case CH_FLOATTYPE: \ strcpy(string, "float"); \ break; \ case CH_DOUBLETYPE: \ strcpy(string, "double"); \ break; \ default: \ fprintf(stderr, \ "Unsupported data type: %d %s:%d\n", \ type, __FILE__, __LINE__ ); \ }
Definition at line 491 of file macros.h.
Referenced by agent_xml_compose__data().
Value:
switch(type) { \ case CH_CHARTYPE: \ sprintf(string, "%c", *((char*)p)); \ break; \ case CH_INTTYPE: \ sprintf(string, "%d", *((int*)p)); \ break; \ case CH_UINTTYPE: \ sprintf(string, "%d", *((unsigned int*)p)); \ break; \ case CH_SHORTTYPE: \ sprintf(string, "%d", *((short*)p)); \ break; \ case CH_USHORTTYPE: \ sprintf(string, "%d", *((unsigned short*)p)); \ break; \ case CH_FLOATTYPE: \ sprintf(string, "%f", *((float*)p)); \ break; \ case CH_DOUBLETYPE: \ sprintf(string, "%f", *((double*)p)); \ break; \ default: \ fprintf(stderr, \ "Unsupported data type: %d %s:%d\n", \ type, __FILE__, __LINE__); \ }
Definition at line 523 of file macros.h.
Referenced by agent_xml_compose__create_row_nodes(), and agent_xml_compose__data().
Value:
if (!strcmp(string, "int")) { \ type = CH_INTTYPE; \ } else if (!strcmp(string, "float")) { \ type = CH_FLOATTYPE; \ } else if (!strcmp(string, "double")) { \ type = CH_DOUBLETYPE; \ } else if (!strcmp(string, "unsigned int")) { \ type = CH_UINTTYPE; \ } else if (!strcmp(string, "short")) { \ type = CH_SHORTTYPE; \ } else if (!strcmp(string, "unsigned short")) { \ type = CH_USHORTTYPE; \ } else if (!strcmp(string, "char")) { \ type = CH_CHARTYPE; \ } else { \ fprintf(stderr, \ "Unsupported data type: %d %s:%d\n", \ type, __FILE__, __LINE__ ); \ }
Definition at line 552 of file macros.h.
Referenced by agent_xml_parse__data().
Value:
if ( var == NULL ) { \ fprintf(stderr, "Pointer var is null: expected otherwise.\n"); \ fprintf(stderr, "Error occured at %s:%d", __FILE__, __LINE__); \ action; \ }
Definition at line 443 of file macros.h.
Referenced by agent_AddPersistentVariable(), agent_datastate_New(), agent_xml_parse__home(), agent_xml_parse__name(), agent_xml_parse__owner(), agent_xml_parse__task(), ams_Initialize(), barrier_node_Initialize(), barrier_queue_New(), df_request_list_New(), df_request_list_node_New(), df_request_search_New(), fipa_agent_identifier_Parse(), fipa_word_Parse(), http_ParseExpression(), interpreter_variable_data_Initialize(), interpreter_variable_data_InitializeFromAgent(), interpreter_variable_data_New(), listen_Thread(), MC_AclSend_chdl(), MC_AddAgent_chdl(), MC_Barrier_chdl(), MC_BarrierDelete_chdl(), MC_BarrierInit_chdl(), MC_CondBroadcast_chdl(), MC_CondReset_chdl(), MC_CondSignal_chdl(), MC_CondWait_chdl(), MC_DeleteAgent(), MC_DeregisterService_chdl(), MC_End_chdl(), MC_FindAgentByID_chdl(), MC_FindAgentByName_chdl(), MC_HaltAgency_chdl(), MC_Initialize(), MC_MutexLock_chdl(), MC_MutexUnlock_chdl(), mc_platform_Initialize(), MC_RegisterService(), MC_RegisterService_chdl(), MC_ResumeAgency_chdl(), MC_RetrieveAgent_chdl(), mc_rwlock_init(), MC_SearchForService(), MC_SearchForService_chdl(), MC_SemaphorePost_chdl(), MC_SemaphoreWait_chdl(), MC_SendAgentMigrationMessage_chdl(), MC_SendSteerCommand_chdl(), MC_SetDefaultAgentStatus_chdl(), MC_SyncDelete_chdl(), MC_SyncInit_chdl(), message_InitializeFromAgent(), message_InitializeFromConnection(), message_InitializeFromString(), message_New(), message_queue_SendOutgoing(), message_Send(), message_xml_parse__message(), mtp_http_InitializeFromConnection(), mtp_http_New(), syncListNodeInit(), syncListNodeNew(), xml_get_cdata(), xml_get_text(), and xml_new_cdata().
Definition at line 206 of file macros.h.
Referenced by acc_MessageHandlerThread(), acc_Thread(), ams_Thread(), df_Thread(), listen_Thread(), MC_Barrier(), MC_CondBroadcast(), and MC_SendSteerCommand().
Definition at line 182 of file macros.h.
Referenced by ams_Destroy(), barrier_node_Destroy(), df_Destroy(), df_request_list_node_Destroy(), df_request_search_Destroy(), mc_platform_Destroy(), mc_rwlock_destroy(), and syncListNodeDestroy().
Definition at line 179 of file macros.h.
Referenced by acc_Initialize(), ams_Initialize(), barrier_node_Initialize(), df_Initialize(), df_request_list_New(), df_request_list_node_New(), df_request_search_New(), mc_platform_Initialize(), mc_rwlock_init(), syncListNodeInit(), and syncListNodeNew().
Definition at line 208 of file macros.h.
Referenced by acc_MessageHandlerThread(), agent_RunChScriptThread(), MC_AddAgent(), MC_CondSignal(), MC_End(), MC_ResetSignal(), mc_rwlock_rdunlock(), mc_rwlock_wrunlock(), and MC_SetAgentStatus().
Value:
if (pthread_mutex_lock( mutex )) \ printf("pthread lock error: %s:%d\n", __FILE__, __LINE__); \ action; \ pthread_cond_wait( cond, mutex );
Definition at line 196 of file macros.h.
Referenced by MC_SearchForService().
Definition at line 177 of file macros.h.
Referenced by acc_Initialize(), ams_Initialize(), barrier_node_Initialize(), df_Initialize(), df_request_list_New(), df_request_list_node_New(), df_request_search_New(), mc_platform_Initialize(), mc_rwlock_init(), syncListNodeInit(), and syncListNodeNew().
Definition at line 185 of file macros.h.
Referenced by acc_MessageHandlerThread(), acc_Thread(), agent_mailbox_WaitRetrieve(), ams_Thread(), df_Thread(), MC_Barrier(), MC_CondWait(), mc_platform_Initialize(), mc_rwlock_rdlock(), mc_rwlock_wrlock(), MC_SteerControl(), MC_WaitAgent(), and MC_WaitSignal().
Definition at line 160 of file macros.h.
Referenced by agent_Destroy(), agent_Initialize(), ams_Destroy(), barrier_node_Destroy(), df_Destroy(), df_request_list_node_Destroy(), df_request_search_Destroy(), mc_platform_Destroy(), mc_rwlock_destroy(), and syncListNodeDestroy().
Definition at line 157 of file macros.h.
Referenced by acc_Initialize(), agent_Copy(), agent_Initialize(), agent_New(), ams_Initialize(), barrier_node_Initialize(), df_Initialize(), df_request_list_New(), df_request_list_node_New(), df_request_search_New(), mc_platform_Initialize(), MC_RegisterService(), mc_rwlock_init(), syncListInit(), syncListNodeInit(), and syncListNodeNew().
Value:
if (pthread_mutex_lock( mutex )) \ fprintf(stderr, "pthread lock error: %s:%d\n", __FILE__, __LINE__)
Definition at line 163 of file macros.h.
Referenced by acc_MessageHandlerThread(), acc_Thread(), agent_Copy(), agent_Destroy(), agent_mailbox_WaitRetrieve(), agent_RunChScriptThread(), ams_ManageAgentList(), ams_Print(), ams_Thread(), AP_QUEUE_SEARCH_TEMPLATE(), AP_QUEUE_STD_DEFN_TEMPLATE(), df_Destroy(), df_node_Destroy(), df_request_list_Pop(), df_SearchForService(), df_Thread(), interpreter_variable_data_Initialize(), listen_Thread(), MC_AddAgent(), MC_Barrier(), MC_CallAgentFunc(), MC_CallAgentFuncArg(), MC_CallAgentFuncV(), MC_CallAgentFuncVar(), MC_CondBroadcast(), MC_CondReset(), MC_CondSignal(), MC_CondWait(), MC_End(), MC_GetAgentName(), MC_GetAgentStatus(), MC_GetAllAgents(), MC_HaltAgency(), MC_MutexLock(), mc_platform_Initialize(), MC_PrintAgentCode(), MC_ResetSignal(), MC_ResumeAgency(), MC_RetrieveAgent(), MC_RetrieveAgentCode(), mc_rwlock_rdlock(), mc_rwlock_rdunlock(), mc_rwlock_wrlock(), mc_rwlock_wrunlock(), MC_SendSteerCommand(), MC_SetAgentStatus(), MC_Steer(), MC_SteerControl(), MC_SyncDelete(), MC_SyncInit(), MC_WaitAgent(), MC_WaitRetrieveAgent(), MC_WaitSignal(), message_queue_SendOutgoing(), and request_handler_DEREGISTER().
Value:
mutex = (pthread_mutex_t*)malloc(sizeof(pthread_mutex_t)); \ if (mutex == NULL) \ fprintf(stderr, "Memory Error. %s:%d\n", __FILE__,__LINE__); \
Definition at line 168 of file macros.h.
Referenced by agent_New().
Definition at line 155 of file macros.h.
Referenced by acc_Initialize(), agent_Copy(), agent_Initialize(), ams_Initialize(), barrier_node_Initialize(), df_Initialize(), df_request_list_New(), df_request_list_node_New(), df_request_search_New(), mc_platform_Initialize(), MC_RegisterService(), mc_rwlock_init(), syncListInit(), syncListNodeInit(), and syncListNodeNew().
Definition at line 166 of file macros.h.
Referenced by acc_MessageHandlerThread(), acc_Thread(), agent_mailbox_WaitRetrieve(), agent_RunChScriptThread(), ams_ManageAgentList(), ams_Print(), ams_Thread(), AP_QUEUE_SEARCH_TEMPLATE(), AP_QUEUE_STD_DEFN_TEMPLATE(), df_request_list_Pop(), df_SearchForService(), df_Thread(), interpreter_variable_data_Initialize(), listen_Thread(), MC_AddAgent(), MC_Barrier(), MC_CallAgentFunc(), MC_CallAgentFuncArg(), MC_CallAgentFuncV(), MC_CallAgentFuncVar(), MC_CondBroadcast(), MC_CondReset(), MC_CondSignal(), MC_CondWait(), MC_End(), MC_GetAgentName(), MC_GetAgentStatus(), MC_GetAllAgents(), MC_HaltAgency(), MC_MutexUnlock(), mc_platform_Initialize(), MC_PrintAgentCode(), MC_ResetSignal(), MC_ResumeAgency(), MC_RetrieveAgent(), MC_RetrieveAgentCode(), mc_rwlock_rdlock(), mc_rwlock_rdunlock(), mc_rwlock_wrlock(), mc_rwlock_wrunlock(), MC_SendSteerCommand(), MC_SetAgentStatus(), MC_Steer(), MC_SteerControl(), MC_SyncDelete(), MC_SyncInit(), MC_WaitAgent(), MC_WaitRetrieveAgent(), MC_WaitSignal(), message_queue_SendOutgoing(), and request_handler_DEREGISTER().
Definition at line 272 of file macros.h.
Referenced by barrier_queue_Add(), barrier_queue_Delete(), syncListAddNode(), syncListDelete(), and syncListRemove().
Definition at line 274 of file macros.h.
Referenced by barrier_queue_Add(), barrier_queue_Delete(), syncListAddNode(), syncListDelete(), and syncListRemove().
Definition at line 115 of file macros.h.
Referenced by MC_SetThreadOff(), and MC_SetThreadsAllOff().
Value:
pthread_mutex_lock( mutex ); \ action; \ pthread_cond_signal( cond ); \ pthread_mutex_unlock( mutex )
Definition at line 201 of file macros.h.
Referenced by agent_RunChScriptThread(), df_Add(), df_AddRequest(), and request_handler_SEARCH().
Value:
pthread_create( \
thread_handle, \
&attr, \
function, \
(void*) arg \
)
Definition at line 136 of file macros.h.
Referenced by acc_Start(), agent_RunChScript(), ams_Start(), cmd_prompt_Start(), and df_Start().
Value:
fprintf(stderr, "WARNING: "); \ fprintf(stderr, message ); \ fprintf(stderr, " %s:%d\n", __FILE__, __LINE__ )
Definition at line 450 of file macros.h.
Referenced by acc_MessageHandlerThread(), acc_Thread(), and message_InitializeFromAgent().