orcm/mca/sensor/file/sensor_file_component.c
/**
  * component register/open/close/init function
  */
component register/open/close/init function
component register / open / close / init function
static int orcm_sensor_file_register (void)
{
    mca_base_component_t *c = &mca_sensor_file_component.super.base_version;
    mca_sensor_file_component.file = NULL;
    (void) mca_base_component_var_register (c, "filename", "File to be monitored",
                                            MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
                                            OPAL_INFO_LVL_9,
                                            MCA_BASE_VAR_SCOPE_ALL_EQ,
                                            &mca_sensor_file_component.file);
    mca_sensor_file_component.check_size = false;
    (void) mca_base_component_var_register (c, "check_size", "Check the file size",
                                            MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
                                            OPAL_INFO_LVL_9,
                                            MCA_BASE_VAR_SCOPE_ALL_EQ,
                                            &mca_sensor_file_component.check_size);
    mca_sensor_file_component.check_access = false;
    (void) mca_base_component_var_register (c, "check_access", "Check access time",
                                            MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
                                            OPAL_INFO_LVL_9,
                                            MCA_BASE_VAR_SCOPE_ALL_EQ,
                                            &mca_sensor_file_component.check_access);
    mca_sensor_file_component.check_mod = false;
    (void) mca_base_component_var_register (c, "check_mod", "Check modification time",
                                            MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
                                            OPAL_INFO_LVL_9,
                                            MCA_BASE_VAR_SCOPE_ALL_EQ,
                                            &mca_sensor_file_component.check_mod);
    mca_sensor_file_component.limit = 3;
    (void) mca_base_component_var_register (c, "limit",
                                            "Number of times the sensor can detect no motion before declaring error (default=3)",
                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
                                            OPAL_INFO_LVL_9,
                                            MCA_BASE_VAR_SCOPE_ALL_EQ,
                                            &mca_sensor_file_component.limit);
    return ORCM_SUCCESS;
}
static int orcm_sensor_file_register ( void ) { mca_base_component_t * c = & mca_sensor_file_component . super . base_version ; mca_sensor_file_component . file = NULL ; ( void ) mca_base_component_var_register ( c , " " , " " , MCA_BASE_VAR_TYPE_STRING , NULL , 0 , 0 , OPAL_INFO_LVL_9 , MCA_BASE_VAR_SCOPE_ALL_EQ , & mca_sensor_file_component . file ) ; mca_sensor_file_component . check_size = false ; ( void ) mca_base_component_var_register ( c , " " , " " , MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 , OPAL_INFO_LVL_9 , MCA_BASE_VAR_SCOPE_ALL_EQ , & mca_sensor_file_component . check_size ) ; mca_sensor_file_component . check_access = false ; ( void ) mca_base_component_var_register ( c , " " , " " , MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 , OPAL_INFO_LVL_9 , MCA_BASE_VAR_SCOPE_ALL_EQ , & mca_sensor_file_component . check_access ) ; mca_sensor_file_component . check_mod = false ; ( void ) mca_base_component_var_register ( c , " " , " " , MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 , OPAL_INFO_LVL_9 , MCA_BASE_VAR_SCOPE_ALL_EQ , & mca_sensor_file_component . check_mod ) ; mca_sensor_file_component . limit = 3 ; ( void ) mca_base_component_var_register ( c , " " , " " , MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 , OPAL_INFO_LVL_9 , MCA_BASE_VAR_SCOPE_ALL_EQ , & mca_sensor_file_component . limit ) ; return ORCM_SUCCESS ; }
component register/open/close/init function
component register / open / close / init function
/* lookup parameters */