示例#1
0
static void registerClass(X_IPC_MSG_CLASS_TYPE className, char *format)
{
  CONST_FORMAT_PTR form;
  CLASS_FORM_PTR classForm;
  
  form = ParseFormatString(format);
  classForm = GET_CLASS_FORMAT(&className);
  
  if (classForm)
    classForm->format = form;
  else {
    classForm = NEW(CLASS_FORM_TYPE);
    classForm->className = className;
    classForm->format = form;
    
    ADD_CLASS_FORMAT(&className, classForm);
  }
}
示例#2
0
void x_ipc_classModInitialize(void)
{
  X_IPC_MSG_CLASS_TYPE msg_class;
  CLASS_FORM_PTR classForm=NULL;
  
  /* 31-Aug-90: fedor: more and more difficult to do 
     query msg ref with a QueryClass format of "int" */
  
  msg_class = GoalClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
			(void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = CommandClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = ExceptionClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = PointMonitorClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = PollingMonitorClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = DemonMonitorClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = ExecHndClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = FailureClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = FireDemonClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
  
  msg_class = MultiQueryClass;
  if (x_ipcQueryCentral(X_IPC_CLASS_INFO_QUERY, (void *)&msg_class,
		      (void *)&classForm) == Success) {
    LOCK_M_MUTEX;
    ADD_CLASS_FORMAT(&msg_class, classForm);
    UNLOCK_M_MUTEX;
  }
}