From: <uli...@us...> - 2010-12-14 13:25:10
|
Revision: 7197 http://openhpi.svn.sourceforge.net/openhpi/?rev=7197&view=rev Author: ulikleber Date: 2010-12-14 13:25:03 +0000 (Tue, 14 Dec 2010) Log Message: ----------- Fix for Bug 2717565 -werror produces many 'unused variable' errors Modified Paths: -------------- openhpi/trunk/openhpid/session.c openhpi/trunk/openhpid/t/ohpi/ohpi_031.c openhpi/trunk/openhpid/t/ohpi/ohpi_036.c openhpi/trunk/plugins/oa_soap/oa_soap_sel.h openhpi/trunk/plugins/simulator/t/sim_sanity_021.c openhpi/trunk/plugins/simulator/t/sim_sanity_022.c openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c Modified: openhpi/trunk/openhpid/session.c =================================================================== --- openhpi/trunk/openhpid/session.c 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/openhpid/session.c 2010-12-14 13:25:03 UTC (rev 7197) @@ -266,7 +266,8 @@ } if (param.u.evt_queue_limit != OH_MAX_EVT_QUEUE_LIMIT) { - SaHpiSessionIdT tmp_sid = session->id; + SaHpiSessionIdT tmp_sid; + tmp_sid = session->id; gint qlength = g_async_queue_length(session->eventq); if (qlength > 0 && qlength >= param.u.evt_queue_limit) { /* Don't proceed with event push if queue is overflowed */ Modified: openhpi/trunk/openhpid/t/ohpi/ohpi_031.c =================================================================== --- openhpi/trunk/openhpid/t/ohpi/ohpi_031.c 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/openhpid/t/ohpi/ohpi_031.c 2010-12-14 13:25:03 UTC (rev 7197) @@ -45,7 +45,7 @@ if (oHpiHandlerCreate(sid, config, &hid)) return -1; - if (!oHpiHandlerInfo(sid, 555, &hinfo, &configinfo)) + if (!oHpiHandlerInfo(sid, 555, &hinfo, configinfo)) return -1; Modified: openhpi/trunk/openhpid/t/ohpi/ohpi_036.c =================================================================== --- openhpi/trunk/openhpid/t/ohpi/ohpi_036.c 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/openhpid/t/ohpi/ohpi_036.c 2010-12-14 13:25:03 UTC (rev 7197) @@ -27,13 +27,13 @@ int main(int argc, char **argv) { + /* Unset config file env variable * + oHpiGlobalParamT path_param = { .Type = OHPI_PATH, .u.Path = "/mylibdir" }; - /* Unset config file env variable * - This test doesn't make sense anymore setenv("OPENHPI_CONF","./noconfig", 1); Modified: openhpi/trunk/plugins/oa_soap/oa_soap_sel.h =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_sel.h 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/plugins/oa_soap/oa_soap_sel.h 2010-12-14 13:25:03 UTC (rev 7197) @@ -43,6 +43,10 @@ SaHpiResourceIdT resource_id, SaHpiEventLogInfoT *info); +SaErrorT oa_soap_get_sel_caps(void *oh_handler, + SaHpiResourceIdT resource_id, + SaHpiEventLogCapabilitiesT *caps); + SaErrorT oa_soap_set_sel_time(void *oh_handler, SaHpiResourceIdT resource_id, SaHpiTimeT time); Modified: openhpi/trunk/plugins/simulator/t/sim_sanity_021.c =================================================================== --- openhpi/trunk/plugins/simulator/t/sim_sanity_021.c 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/plugins/simulator/t/sim_sanity_021.c 2010-12-14 13:25:03 UTC (rev 7197) @@ -14,6 +14,7 @@ */ #include <stdlib.h> +#include <string.h> #include <SaHpi.h> #include <oh_utils.h> #include <sahpi_struct_utils.h> Modified: openhpi/trunk/plugins/simulator/t/sim_sanity_022.c =================================================================== --- openhpi/trunk/plugins/simulator/t/sim_sanity_022.c 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/plugins/simulator/t/sim_sanity_022.c 2010-12-14 13:25:03 UTC (rev 7197) @@ -14,6 +14,7 @@ */ #include <stdlib.h> +#include <string.h> #include <SaHpi.h> #include <oh_utils.h> #include <sahpi_struct_utils.h> Modified: openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c =================================================================== --- openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c 2010-12-14 09:25:17 UTC (rev 7196) +++ openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c 2010-12-14 13:25:03 UTC (rev 7197) @@ -15,7 +15,7 @@ #include <stdio.h> #include <stdlib.h> - +#include <string.h> #include <SaHpi.h> #include <oh_utils.h> #include <oh_error.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <uli...@us...> - 2010-12-14 14:22:51
|
Revision: 7198 http://openhpi.svn.sourceforge.net/openhpi/?rev=7198&view=rev Author: ulikleber Date: 2010-12-14 14:22:44 +0000 (Tue, 14 Dec 2010) Log Message: ----------- Fix for Bug 2012381 make using of -werror configurable This fixes also duplicate 2717574. Modified Paths: -------------- openhpi/trunk/configure.ac openhpi/trunk/openhpid/openhpid.cpp Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2010-12-14 13:25:03 UTC (rev 7197) +++ openhpi/trunk/configure.ac 2010-12-14 14:22:44 UTC (rev 7198) @@ -623,6 +623,17 @@ -fno-strict-aliasing \ -Wno-unused-value " +AC_ARG_ENABLE([werror], + [ --enable-werror appends -Werror to CFLAGS and CXXFLAGS [[default=yes]]], + [if test "x$enableval" = "xyes"; then + CC_WARNINGS="$CC_WARNINGS -Werror" + CXX_WARNINGS="$CXX_WARNINGS -Werror" + fi], + [ + CC_WARNINGS="$CC_WARNINGS -Werror" + CXX_WARNINGS="$CXX_WARNINGS -Werror" + ]) + if test -n "`gcc --version | grep ' 3.2'`" ; then CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'` CXX_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'` Modified: openhpi/trunk/openhpid/openhpid.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid.cpp 2010-12-14 13:25:03 UTC (rev 7197) +++ openhpi/trunk/openhpid/openhpid.cpp 2010-12-14 14:22:44 UTC (rev 7198) @@ -497,7 +497,8 @@ uint32_t& data_len, SaHpiSessionIdT& changed_sid) { - gpointer thrdid = g_thread_self(); + gpointer thrdid; + thrdid = g_thread_self(); PVERBOSE1("%p Processing RPC request %d.\n", thrdid, hm->m_id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-14 14:38:01
|
Revision: 7199 http://openhpi.svn.sourceforge.net/openhpi/?rev=7199&view=rev Author: avpak Date: 2010-12-14 14:37:53 +0000 (Tue, 14 Dec 2010) Log Message: ----------- More in Feature Request #3129960 struct Params is moved in separate header file include/oh_rpc_params. And renamed to RpcParams/ClientRpcParams. Demarshal_Rq and Marshal_Rp are capitalized. Modified Paths: -------------- openhpi/trunk/baselib/oh_client.cpp openhpi/trunk/baselib/oh_client_session.cpp openhpi/trunk/baselib/oh_client_session.h openhpi/trunk/openhpid/openhpid.cpp Added Paths: ----------- openhpi/trunk/include/oh_rpc_params.h Modified: openhpi/trunk/baselib/oh_client.cpp =================================================================== --- openhpi/trunk/baselib/oh_client.cpp 2010-12-14 14:22:44 UTC (rev 7198) +++ openhpi/trunk/baselib/oh_client.cpp 2010-12-14 14:37:53 UTC (rev 7199) @@ -27,9 +27,10 @@ #include <SaHpi.h> #include <oHpi.h> #include <config.h> +#include <marshal_hpi.h> #include <oh_domain.h> #include <oh_error.h> -#include <marshal_hpi.h> +#include <oh_rpc_params.h> #include "oh_client.h" #include "oh_client_conf.h" @@ -250,8 +251,8 @@ { SaErrorT rv; - Params iparams; - Params oparams; + ClientRpcParams iparams; + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiDiscover, SessionId, iparams, oparams); return rv; @@ -272,8 +273,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams; - Params oparams(DomainInfo); + ClientRpcParams iparams; + ClientRpcParams oparams(DomainInfo); rv = ohc_sess_rpc(eFsaHpiDomainInfoGet, SessionId, iparams, oparams); /* Set Domain Id to real Domain Id */ @@ -302,8 +303,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&EntryId); - Params oparams(NextEntryId, DrtEntry); + ClientRpcParams iparams(&EntryId); + ClientRpcParams oparams(NextEntryId, DrtEntry); rv = ohc_sess_rpc(eFsaHpiDrtEntryGet, SessionId, iparams, oparams); /* Set Domain Id to real Domain Id */ @@ -332,8 +333,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(DomainTag); - Params oparams; + ClientRpcParams iparams(DomainTag); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiDomainTagSet, SessionId, iparams, oparams); return rv; @@ -359,8 +360,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&EntryId); - Params oparams(NextEntryId, RptEntry); + ClientRpcParams iparams(&EntryId); + ClientRpcParams oparams(NextEntryId, RptEntry); rv = ohc_sess_rpc(eFsaHpiRptEntryGet, SessionId, iparams, oparams); return rv; @@ -382,8 +383,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(RptEntry); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(RptEntry); rv = ohc_sess_rpc(eFsaHpiRptEntryGetByResourceId, SessionId, iparams, oparams); return rv; @@ -408,8 +409,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Severity); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Severity); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceSeveritySet, SessionId, iparams, oparams); return rv; @@ -431,8 +432,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, ResourceTag); - Params oparams; + ClientRpcParams iparams(&ResourceId, ResourceTag); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceTagSet, SessionId, iparams, oparams); return rv; @@ -453,8 +454,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams; - Params oparams(EntityPath); + ClientRpcParams iparams; + ClientRpcParams oparams(EntityPath); rv = ohc_sess_rpc(eFsaHpiMyEntityPathGet, SessionId, iparams, oparams); return rv; @@ -475,8 +476,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams; - Params oparams(ResourceId); + ClientRpcParams iparams; + ClientRpcParams oparams(ResourceId); rv = ohc_sess_rpc(eFsaHpiResourceIdGet, SessionId, iparams, oparams); return rv; @@ -509,8 +510,8 @@ InstrumentId = &instrument_id; } - Params iparams(&EntityPath, &InstrumentType, InstanceId); - Params oparams(InstanceId, ResourceId, InstrumentId, RptUpdateCount); + ClientRpcParams iparams(&EntityPath, &InstrumentType, InstanceId); + ClientRpcParams oparams(InstanceId, ResourceId, InstrumentId, RptUpdateCount); rv = ohc_sess_rpc(eFsaHpiGetIdByEntityPath, SessionId, iparams, oparams); return rv; @@ -534,8 +535,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ParentEntityPath, InstanceId); - Params oparams(InstanceId, ChildEntityPath, RptUpdateCount); + ClientRpcParams iparams(&ParentEntityPath, InstanceId); + ClientRpcParams oparams(InstanceId, ChildEntityPath, RptUpdateCount); rv = ohc_sess_rpc(eFsaHpiGetChildEntityPath, SessionId, iparams, oparams); return rv; @@ -552,8 +553,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams; + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceFailedRemove, SessionId, iparams, oparams); return rv; @@ -574,8 +575,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(Info); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(Info); rv = ohc_sess_rpc(eFsaHpiEventLogInfoGet, SessionId, iparams, oparams); return rv; @@ -596,8 +597,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(EventLogCapabilities); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(EventLogCapabilities); rv = ohc_sess_rpc(eFsaHpiEventLogCapabilitiesGet, SessionId, iparams, oparams); return rv; @@ -628,8 +629,8 @@ SaHpiRdrT rdr; SaHpiRptEntryT rpte; - Params iparams(&ResourceId, &EntryId); - Params oparams(PrevEntryId, NextEntryId, EventLogEntry, &rdr, &rpte); + ClientRpcParams iparams(&ResourceId, &EntryId); + ClientRpcParams oparams(PrevEntryId, NextEntryId, EventLogEntry, &rdr, &rpte); rv = ohc_sess_rpc(eFsaHpiEventLogEntryGet, SessionId, iparams, oparams); if (Rdr) { @@ -681,8 +682,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, EvtEntry); - Params oparams; + ClientRpcParams iparams(&ResourceId, EvtEntry); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiEventLogEntryAdd, SessionId, iparams, oparams); return rv; @@ -699,8 +700,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams; + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiEventLogClear, SessionId, iparams, oparams); return rv; @@ -722,8 +723,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(Time); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(Time); rv = ohc_sess_rpc(eFsaHpiEventLogTimeGet, SessionId, iparams, oparams); return rv; @@ -741,8 +742,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &Time); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Time); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiEventLogTimeSet, SessionId, iparams, oparams); return rv; @@ -764,8 +765,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(EnableState); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(EnableState); rv = ohc_sess_rpc(eFsaHpiEventLogStateGet, SessionId, iparams, oparams); return rv; @@ -783,8 +784,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &EnableState); - Params oparams; + ClientRpcParams iparams(&ResourceId, &EnableState); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiEventLogStateSet, SessionId, iparams, oparams); return rv; @@ -801,8 +802,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams; + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiEventLogOverflowReset, SessionId, iparams, oparams); return rv; @@ -818,8 +819,8 @@ { SaErrorT rv; - Params iparams; - Params oparams; + ClientRpcParams iparams; + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiSubscribe, SessionId, iparams, oparams); return rv; @@ -835,8 +836,8 @@ { SaErrorT rv; - Params iparams; - Params oparams; + ClientRpcParams iparams; + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiUnsubscribe, SessionId, iparams, oparams); return rv; @@ -865,8 +866,8 @@ SaHpiRptEntryT rpte; SaHpiEvtQueueStatusT status; - Params iparams(&Timeout); - Params oparams(Event, &rdr, &rpte, &status); + ClientRpcParams iparams(&Timeout); + ClientRpcParams oparams(Event, &rdr, &rpte, &status); rv = ohc_sess_rpc(eFsaHpiEventGet, SessionId, iparams, oparams); if (Rdr) { @@ -896,8 +897,8 @@ rv = oh_valid_addevent(Event); if (rv != SA_OK) return rv; - Params iparams(Event); - Params oparams; + ClientRpcParams iparams(Event); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiEventAdd, SessionId, iparams, oparams); return rv; @@ -926,8 +927,8 @@ return SA_ERR_HPI_NOT_PRESENT; } - Params iparams(&Severity, &Unack, Alarm); - Params oparams(Alarm); + ClientRpcParams iparams(&Severity, &Unack, Alarm); + ClientRpcParams oparams(Alarm); rv = ohc_sess_rpc(eFsaHpiAlarmGetNext, SessionId, iparams, oparams); /* Set Alarm DomainId to DomainId that HPI Application sees */ @@ -954,8 +955,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&AlarmId); - Params oparams(Alarm); + ClientRpcParams iparams(&AlarmId); + ClientRpcParams oparams(Alarm); rv = ohc_sess_rpc(eFsaHpiAlarmGet, SessionId, iparams, oparams); /* Set Alarm DomainId to DomainId that HPI Application sees */ @@ -984,8 +985,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&AlarmId, &Severity); - Params oparams; + ClientRpcParams iparams(&AlarmId, &Severity); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAlarmAcknowledge, SessionId, iparams, oparams); return rv; @@ -1009,8 +1010,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(Alarm); - Params oparams(Alarm); + ClientRpcParams iparams(Alarm); + ClientRpcParams oparams(Alarm); rv = ohc_sess_rpc(eFsaHpiAlarmAdd, SessionId, iparams, oparams); /* Set Alarm DomainId to DomainId that HPI Application sees */ @@ -1037,8 +1038,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&AlarmId, &Severity); - Params oparams; + ClientRpcParams iparams(&AlarmId, &Severity); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAlarmDelete, SessionId, iparams, oparams); return rv; @@ -1062,8 +1063,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &EntryId); - Params oparams(NextEntryId, Rdr); + ClientRpcParams iparams(&ResourceId, &EntryId); + ClientRpcParams oparams(NextEntryId, Rdr); rv = ohc_sess_rpc(eFsaHpiRdrGet, SessionId, iparams, oparams); return rv; @@ -1087,8 +1088,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &RdrType, &InstrumentId); - Params oparams(Rdr); + ClientRpcParams iparams(&ResourceId, &RdrType, &InstrumentId); + ClientRpcParams oparams(Rdr); rv = ohc_sess_rpc(eFsaHpiRdrGetByInstrumentId, SessionId, iparams, oparams); return rv; @@ -1110,8 +1111,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(UpdateCount); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(UpdateCount); rv = ohc_sess_rpc(eFsaHpiRdrUpdateCountGet, SessionId, iparams, oparams); return rv; @@ -1134,8 +1135,8 @@ SaHpiSensorReadingT reading; SaHpiEventStateT state; - Params iparams(&ResourceId, &SensorNum); - Params oparams(&reading, &state); + ClientRpcParams iparams(&ResourceId, &SensorNum); + ClientRpcParams oparams(&reading, &state); rv = ohc_sess_rpc(eFsaHpiSensorReadingGet, SessionId, iparams, oparams); if (Reading) { @@ -1165,8 +1166,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &SensorNum); - Params oparams(Thresholds); + ClientRpcParams iparams(&ResourceId, &SensorNum); + ClientRpcParams oparams(Thresholds); rv = ohc_sess_rpc(eFsaHpiSensorThresholdsGet, SessionId, iparams, oparams); return rv; @@ -1193,8 +1194,8 @@ rv = clean_thresholds(Thresholds, &tholds); if (rv != SA_OK) return rv; - Params iparams(&ResourceId, &SensorNum, &tholds); - Params oparams; + ClientRpcParams iparams(&ResourceId, &SensorNum, &tholds); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiSensorThresholdsSet, SessionId, iparams, oparams); return rv; @@ -1218,8 +1219,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &SensorNum); - Params oparams(Type, Category); + ClientRpcParams iparams(&ResourceId, &SensorNum); + ClientRpcParams oparams(Type, Category); rv = ohc_sess_rpc(eFsaHpiSensorTypeGet, SessionId, iparams, oparams); return rv; @@ -1242,8 +1243,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &SensorNum); - Params oparams(Enabled); + ClientRpcParams iparams(&ResourceId, &SensorNum); + ClientRpcParams oparams(Enabled); rv = ohc_sess_rpc(eFsaHpiSensorEnableGet, SessionId, iparams, oparams); return rv; @@ -1262,8 +1263,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &SensorNum, &Enabled); - Params oparams; + ClientRpcParams iparams(&ResourceId, &SensorNum, &Enabled); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiSensorEnableSet, SessionId, iparams, oparams); return rv; @@ -1286,8 +1287,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &SensorNum); - Params oparams(Enabled); + ClientRpcParams iparams(&ResourceId, &SensorNum); + ClientRpcParams oparams(Enabled); rv = ohc_sess_rpc(eFsaHpiSensorEventEnableGet, SessionId, iparams, oparams); return rv; @@ -1306,8 +1307,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &SensorNum, &Enabled); - Params oparams; + ClientRpcParams iparams(&ResourceId, &SensorNum, &Enabled); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiSensorEventEnableSet, SessionId, iparams, oparams); return rv; @@ -1329,8 +1330,8 @@ SaHpiEventStateT assert, deassert; - Params iparams(&ResourceId, &SensorNum, &assert, &deassert); - Params oparams(&assert, &deassert); + ClientRpcParams iparams(&ResourceId, &SensorNum, &assert, &deassert); + ClientRpcParams oparams(&assert, &deassert); rv = ohc_sess_rpc(eFsaHpiSensorEventMasksGet, SessionId, iparams, oparams); if (Assert) { @@ -1358,8 +1359,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &SensorNum, &Action, &Assert, &Deassert); - Params oparams; + ClientRpcParams iparams(&ResourceId, &SensorNum, &Action, &Assert, &Deassert); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiSensorEventMasksSet, SessionId, iparams, oparams); return rv; @@ -1382,8 +1383,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &CtrlNum); - Params oparams(Type); + ClientRpcParams iparams(&ResourceId, &CtrlNum); + ClientRpcParams oparams(Type); rv = ohc_sess_rpc(eFsaHpiControlTypeGet, SessionId, iparams, oparams); return rv; @@ -1416,8 +1417,8 @@ state.Type = SAHPI_CTRL_TYPE_TEXT; } - Params iparams(&ResourceId, &CtrlNum, &state); - Params oparams(&mode, &state); + ClientRpcParams iparams(&ResourceId, &CtrlNum, &state); + ClientRpcParams oparams(&mode, &state); rv = ohc_sess_rpc(eFsaHpiControlGet, SessionId, iparams, oparams); if (Mode) { @@ -1464,8 +1465,8 @@ pmystate = State; } - Params iparams(&ResourceId, &CtrlNum, &Mode, pmystate); - Params oparams; + ClientRpcParams iparams(&ResourceId, &CtrlNum, &Mode, pmystate); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiControlSet, SessionId, iparams, oparams); return rv; @@ -1488,8 +1489,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid); - Params oparams(Info); + ClientRpcParams iparams(&ResourceId, &Idrid); + ClientRpcParams oparams(Info); rv = ohc_sess_rpc(eFsaHpiIdrInfoGet, SessionId, iparams, oparams); return rv; @@ -1522,8 +1523,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, &AreaType, &AreaId); - Params oparams(NextAreaId, Header); + ClientRpcParams iparams(&ResourceId, &Idrid, &AreaType, &AreaId); + ClientRpcParams oparams(NextAreaId, Header); rv = ohc_sess_rpc(eFsaHpiIdrAreaHeaderGet, SessionId, iparams, oparams); return rv; @@ -1549,8 +1550,8 @@ return SA_ERR_HPI_INVALID_DATA; } - Params iparams(&ResourceId, &Idrid, &AreaType); - Params oparams(AreaId); + ClientRpcParams iparams(&ResourceId, &Idrid, &AreaType); + ClientRpcParams oparams(AreaId); rv = ohc_sess_rpc(eFsaHpiIdrAreaAdd, SessionId, iparams, oparams); return rv; @@ -1576,8 +1577,8 @@ return SA_ERR_HPI_INVALID_DATA; } - Params iparams(&ResourceId, &Idrid, &AreaType, &AreaId); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Idrid, &AreaType, &AreaId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiIdrAreaAddById, SessionId, iparams, oparams); return rv; @@ -1600,8 +1601,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, &AreaId); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Idrid, &AreaId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiIdrAreaDelete, SessionId, iparams, oparams); return rv; @@ -1633,8 +1634,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, &AreaId, &FieldType, &FieldId); - Params oparams(NextId, Field); + ClientRpcParams iparams(&ResourceId, &Idrid, &AreaId, &FieldType, &FieldId); + ClientRpcParams oparams(NextId, Field); rv = ohc_sess_rpc(eFsaHpiIdrFieldGet, SessionId, iparams, oparams); return rv; @@ -1663,8 +1664,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, Field); - Params oparams(Field); + ClientRpcParams iparams(&ResourceId, &Idrid, Field); + ClientRpcParams oparams(Field); rv = ohc_sess_rpc(eFsaHpiIdrFieldAdd, SessionId, iparams, oparams); return rv; @@ -1693,8 +1694,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, Field); - Params oparams(Field); + ClientRpcParams iparams(&ResourceId, &Idrid, Field); + ClientRpcParams oparams(Field); rv = ohc_sess_rpc(eFsaHpiIdrFieldAddById, SessionId, iparams, oparams); return rv; @@ -1720,8 +1721,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, Field); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Idrid, Field); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiIdrFieldSet, SessionId, iparams, oparams); return rv; @@ -1745,8 +1746,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Idrid, &AreaId, &FieldId); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Idrid, &AreaId, &FieldId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiIdrFieldDelete, SessionId, iparams, oparams); return rv; @@ -1769,8 +1770,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &WatchdogNum); - Params oparams(Watchdog); + ClientRpcParams iparams(&ResourceId, &WatchdogNum); + ClientRpcParams oparams(Watchdog); rv = ohc_sess_rpc(eFsaHpiWatchdogTimerGet, SessionId, iparams, oparams); return rv; @@ -1801,8 +1802,8 @@ return SA_ERR_HPI_INVALID_DATA; } - Params iparams(&ResourceId, &WatchdogNum, Watchdog); - Params oparams; + ClientRpcParams iparams(&ResourceId, &WatchdogNum, Watchdog); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiWatchdogTimerSet, SessionId, iparams, oparams); return rv; @@ -1820,8 +1821,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &WatchdogNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &WatchdogNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiWatchdogTimerReset, SessionId, iparams, oparams); return rv; @@ -1849,8 +1850,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &AnnNum, &Severity, &Unack, Announcement); - Params oparams(Announcement); + ClientRpcParams iparams(&ResourceId, &AnnNum, &Severity, &Unack, Announcement); + ClientRpcParams oparams(Announcement); rv = ohc_sess_rpc(eFsaHpiAnnunciatorGetNext, SessionId, iparams, oparams); return rv; @@ -1874,8 +1875,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &AnnNum, &EntryId); - Params oparams(Announcement); + ClientRpcParams iparams(&ResourceId, &AnnNum, &EntryId); + ClientRpcParams oparams(Announcement); rv = ohc_sess_rpc(eFsaHpiAnnunciatorGet, SessionId, iparams, oparams); return rv; @@ -1905,8 +1906,8 @@ } } - Params iparams(&ResourceId, &AnnNum, &EntryId, &sev); - Params oparams; + ClientRpcParams iparams(&ResourceId, &AnnNum, &EntryId, &sev); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAnnunciatorAcknowledge, SessionId, iparams, oparams); return rv; @@ -1937,8 +1938,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &AnnNum, Announcement); - Params oparams(Announcement); + ClientRpcParams iparams(&ResourceId, &AnnNum, Announcement); + ClientRpcParams oparams(Announcement); rv = ohc_sess_rpc(eFsaHpiAnnunciatorAdd, SessionId, iparams, oparams); return rv; @@ -1969,8 +1970,8 @@ } } - Params iparams(&ResourceId, &AnnNum, &EntryId, &sev); - Params oparams; + ClientRpcParams iparams(&ResourceId, &AnnNum, &EntryId, &sev); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAnnunciatorDelete, SessionId, iparams, oparams); return rv; @@ -1993,8 +1994,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &AnnNum); - Params oparams(Mode); + ClientRpcParams iparams(&ResourceId, &AnnNum); + ClientRpcParams oparams(Mode); rv = ohc_sess_rpc(eFsaHpiAnnunciatorModeGet, SessionId, iparams, oparams); return rv; @@ -2017,8 +2018,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &AnnNum, &Mode); - Params oparams; + ClientRpcParams iparams(&ResourceId, &AnnNum, &Mode); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAnnunciatorModeSet, SessionId, iparams, oparams); return rv; @@ -2041,8 +2042,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &DimiNum); - Params oparams(DimiInfo); + ClientRpcParams iparams(&ResourceId, &DimiNum); + ClientRpcParams oparams(DimiInfo); rv = ohc_sess_rpc(eFsaHpiDimiInfoGet, SessionId, iparams, oparams); return rv; @@ -2061,8 +2062,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &DimiNum, &TestNum); - Params oparams(DimiTest); + ClientRpcParams iparams(&ResourceId, &DimiNum, &TestNum); + ClientRpcParams oparams(DimiTest); rv = ohc_sess_rpc(eFsaHpiDimiTestInfoGet, SessionId, iparams, oparams); return rv; @@ -2081,8 +2082,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &DimiNum, &TestNum); - Params oparams(DimiReady); + ClientRpcParams iparams(&ResourceId, &DimiNum, &TestNum); + ClientRpcParams oparams(DimiReady); rv = ohc_sess_rpc(eFsaHpiDimiTestReadinessGet, SessionId, iparams, oparams); return rv; @@ -2106,8 +2107,8 @@ params_list.NumberOfParams = NumberOfParams; params_list.ParamsList = ParamsList; - Params iparams(&ResourceId, &DimiNum, &TestNum, ¶ms_list); - Params oparams; + ClientRpcParams iparams(&ResourceId, &DimiNum, &TestNum, ¶ms_list); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiDimiTestStart, SessionId, iparams, oparams); return rv; @@ -2121,8 +2122,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &DimiNum, &TestNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &DimiNum, &TestNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiDimiTestCancel, SessionId, iparams, oparams); return rv; @@ -2147,8 +2148,8 @@ ppercent = PercentCompleted; } - Params iparams(&ResourceId, &DimiNum, &TestNum); - Params oparams(ppercent, RunStatus); + ClientRpcParams iparams(&ResourceId, &DimiNum, &TestNum); + ClientRpcParams oparams(ppercent, RunStatus); rv = ohc_sess_rpc(eFsaHpiDimiTestStatusGet, SessionId, iparams, oparams); return rv; @@ -2167,8 +2168,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &DimiNum, &TestNum); - Params oparams(TestResults); + ClientRpcParams iparams(&ResourceId, &DimiNum, &TestNum); + ClientRpcParams oparams(TestResults); rv = ohc_sess_rpc(eFsaHpiDimiTestResultsGet, SessionId, iparams, oparams); return rv; @@ -2192,8 +2193,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum); - Params oparams(SpecInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams(SpecInfo); rv = ohc_sess_rpc(eFsaHpiFumiSpecInfoGet, SessionId, iparams, oparams); return rv; @@ -2211,8 +2212,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum); - Params oparams(ServiceImpact); + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams(ServiceImpact); rv = ohc_sess_rpc(eFsaHpiFumiServiceImpactGet, SessionId, iparams, oparams); return rv; @@ -2233,8 +2234,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &BankNum, SourceUri); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum, SourceUri); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiSourceSet, SessionId, iparams, oparams); return rv; @@ -2248,8 +2249,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiSourceInfoValidateStart, SessionId, iparams, oparams); return rv; @@ -2268,8 +2269,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams(SourceInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams(SourceInfo); rv = ohc_sess_rpc(eFsaHpiFumiSourceInfoGet, SessionId, iparams, oparams); return rv; @@ -2293,8 +2294,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &BankNum, &ComponentEntryId); - Params oparams(NextComponentEntryId, ComponentInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum, &ComponentEntryId); + ClientRpcParams oparams(NextComponentEntryId, ComponentInfo); rv = ohc_sess_rpc(eFsaHpiFumiSourceComponentInfoGet, SessionId, iparams, oparams); return rv; @@ -2313,8 +2314,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams(BankInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams(BankInfo); rv = ohc_sess_rpc(eFsaHpiFumiTargetInfoGet, SessionId, iparams, oparams); return rv; @@ -2338,8 +2339,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &BankNum, &ComponentEntryId); - Params oparams(NextComponentEntryId, ComponentInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum, &ComponentEntryId); + ClientRpcParams oparams(NextComponentEntryId, ComponentInfo); rv = ohc_sess_rpc(eFsaHpiFumiTargetComponentInfoGet, SessionId, iparams, oparams); return rv; @@ -2357,8 +2358,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum); - Params oparams(BankInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams(BankInfo); rv = ohc_sess_rpc(eFsaHpiFumiLogicalTargetInfoGet, SessionId, iparams, oparams); return rv; @@ -2381,8 +2382,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &ComponentEntryId); - Params oparams(NextComponentEntryId, ComponentInfo); + ClientRpcParams iparams(&ResourceId, &FumiNum, &ComponentEntryId); + ClientRpcParams oparams(NextComponentEntryId, ComponentInfo); rv = ohc_sess_rpc(eFsaHpiFumiLogicalTargetComponentInfoGet, SessionId, iparams, oparams); return rv; @@ -2395,8 +2396,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiBackupStart, SessionId, iparams, oparams); return rv; @@ -2411,8 +2412,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &BankNum, &Position); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum, &Position); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiBankBootOrderSet, SessionId, iparams, oparams); return rv; @@ -2427,8 +2428,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &SourceBankNum, &TargetBankNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &SourceBankNum, &TargetBankNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiBankCopyStart, SessionId, iparams, oparams); return rv; @@ -2442,8 +2443,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiInstallStart, SessionId, iparams, oparams); return rv; @@ -2462,8 +2463,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams(UpgradeStatus); + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams(UpgradeStatus); rv = ohc_sess_rpc(eFsaHpiFumiUpgradeStatusGet, SessionId, iparams, oparams); return rv; @@ -2477,8 +2478,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiTargetVerifyStart, SessionId, iparams, oparams); return rv; @@ -2491,8 +2492,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiTargetVerifyMainStart, SessionId, iparams, oparams); return rv; @@ -2506,8 +2507,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiUpgradeCancel, SessionId, iparams, oparams); return rv; @@ -2525,8 +2526,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &FumiNum); - Params oparams(Disable); + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams(Disable); rv = ohc_sess_rpc(eFsaHpiFumiAutoRollbackDisableGet, SessionId, iparams, oparams); return rv; @@ -2540,8 +2541,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &Disable); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &Disable); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiAutoRollbackDisableSet, SessionId, iparams, oparams); return rv; @@ -2554,8 +2555,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiRollbackStart, SessionId, iparams, oparams); return rv; @@ -2568,8 +2569,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiActivate, SessionId, iparams, oparams); return rv; @@ -2583,8 +2584,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &Logical); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &Logical); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiActivateStart, SessionId, iparams, oparams); return rv; @@ -2598,8 +2599,8 @@ { SaErrorT rv; - Params iparams(&ResourceId, &FumiNum, &BankNum); - Params oparams; + ClientRpcParams iparams(&ResourceId, &FumiNum, &BankNum); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiFumiCleanup, SessionId, iparams, oparams); return rv; @@ -2616,8 +2617,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams; + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiHotSwapPolicyCancel, SessionId, iparams, oparams); return rv; @@ -2633,8 +2634,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams; + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceActiveSet, SessionId, iparams, oparams); return rv; @@ -2651,8 +2652,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams; + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceInactiveSet, SessionId, iparams, oparams); return rv; @@ -2673,8 +2674,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams; - Params oparams(Timeout); + ClientRpcParams iparams; + ClientRpcParams oparams(Timeout); rv = ohc_sess_rpc(eFsaHpiAutoInsertTimeoutGet, SessionId, iparams, oparams); return rv; @@ -2698,8 +2699,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&Timeout); - Params oparams; + ClientRpcParams iparams(&Timeout); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAutoInsertTimeoutSet, SessionId, iparams, oparams); return rv; @@ -2721,8 +2722,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(Timeout); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(Timeout); rv = ohc_sess_rpc(eFsaHpiAutoExtractTimeoutGet, SessionId, iparams, oparams); return rv; @@ -2747,8 +2748,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Timeout); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Timeout); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiAutoExtractTimeoutSet, SessionId, iparams, oparams); return rv; @@ -2770,8 +2771,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(State); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(State); rv = ohc_sess_rpc(eFsaHpiHotSwapStateGet, SessionId, iparams, oparams); return rv; @@ -2793,8 +2794,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Action); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Action); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiHotSwapActionRequest, SessionId, iparams, oparams); return rv; @@ -2816,8 +2817,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(State); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(State); rv = ohc_sess_rpc(eFsaHpiHotSwapIndicatorStateGet, SessionId, iparams, oparams); return rv; @@ -2839,8 +2840,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &State); - Params oparams; + ClientRpcParams iparams(&ResourceId, &State); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiHotSwapIndicatorStateSet, SessionId, iparams, oparams); return rv; @@ -2862,8 +2863,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Action); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Action); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiParmControl, SessionId, iparams, oparams); return rv; @@ -2881,8 +2882,8 @@ { SaErrorT rv; - Params iparams(&ResourceId); - Params oparams(LoadId); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(LoadId); rv = ohc_sess_rpc(eFsaHpiResourceLoadIdGet, SessionId, iparams, oparams); return rv; @@ -2904,8 +2905,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, LoadId); - Params oparams; + ClientRpcParams iparams(&ResourceId, LoadId); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceLoadIdSet, SessionId, iparams, oparams); return rv; @@ -2927,8 +2928,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(Action); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(Action); rv = ohc_sess_rpc(eFsaHpiResourceResetStateGet, SessionId, iparams, oparams); return rv; @@ -2950,8 +2951,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &Action); - Params oparams; + ClientRpcParams iparams(&ResourceId, &Action); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourceResetStateSet, SessionId, iparams, oparams); return rv; @@ -2973,8 +2974,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId); - Params oparams(State); + ClientRpcParams iparams(&ResourceId); + ClientRpcParams oparams(State); rv = ohc_sess_rpc(eFsaHpiResourcePowerStateGet, SessionId, iparams, oparams); return rv; @@ -2996,8 +2997,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&ResourceId, &State); - Params oparams; + ClientRpcParams iparams(&ResourceId, &State); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFsaHpiResourcePowerStateSet, SessionId, iparams, oparams); return rv; @@ -3041,8 +3042,8 @@ g_hash_table_foreach(config, __dehash_config, &handler_config); // now create the handler - Params iparams(&handler_config); - Params oparams(id); + ClientRpcParams iparams(&handler_config); + ClientRpcParams oparams(id); rv = ohc_sess_rpc(eFoHpiHandlerCreate, sid, iparams, oparams); return rv; @@ -3063,8 +3064,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&id); - Params oparams; + ClientRpcParams iparams(&id); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFoHpiHandlerDestroy, sid, iparams, oparams); return rv; @@ -3091,8 +3092,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&id); - Params oparams(info, &config); + ClientRpcParams iparams(&id); + ClientRpcParams oparams(info, &config); rv = ohc_sess_rpc(eFoHpiHandlerInfo, sid, iparams, oparams); for (unsigned int n = 0; n < config.NumberOfParams; n++) { @@ -3121,8 +3122,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&id); - Params oparams(next_id); + ClientRpcParams iparams(&id); + ClientRpcParams oparams(next_id); rv = ohc_sess_rpc(eFoHpiHandlerGetNext, sid, iparams, oparams); return rv; @@ -3144,8 +3145,8 @@ *id = 0; //Initialize output var - Params iparams(&sid, &rid); - Params oparams(id); + ClientRpcParams iparams(&sid, &rid); + ClientRpcParams oparams(id); rv = ohc_sess_rpc(eFoHpiHandlerFind, sid, iparams, oparams); return rv; @@ -3164,8 +3165,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&id); - Params oparams; + ClientRpcParams iparams(&id); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFoHpiHandlerRetry, sid, iparams, oparams); return rv; @@ -3186,8 +3187,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(param); - Params oparams(param); + ClientRpcParams iparams(param); + ClientRpcParams oparams(param); rv = ohc_sess_rpc(eFoHpiGlobalParamGet, sid, iparams, oparams); return rv; @@ -3208,8 +3209,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(param); - Params oparams(param); + ClientRpcParams iparams(param); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFoHpiGlobalParamSet, sid, iparams, oparams); return rv; @@ -3232,8 +3233,8 @@ return SA_ERR_HPI_INVALID_PARAMS; } - Params iparams(&id, event, rpte, rdr); - Params oparams(&id, event, rpte, rdr); + ClientRpcParams iparams(&id, event, rpte, rdr); + ClientRpcParams oparams; rv = ohc_sess_rpc(eFoHpiInjectEvent, sid, iparams, oparams); return rv; Modified: openhpi/trunk/baselib/oh_client_session.cpp =================================================================== --- openhpi/trunk/baselib/oh_client_session.cpp 2010-12-14 14:22:44 UTC (rev 7198) +++ openhpi/trunk/baselib/oh_client_session.cpp 2010-12-14 14:37:53 UTC (rev 7199) @@ -46,14 +46,18 @@ SaErrorT RpcOpen( SaHpiDomainIdT did ); SaErrorT RpcClose(); - SaErrorT Rpc( uint32_t id, Params& iparams, Params& oparams ); + SaErrorT Rpc( uint32_t id, + ClientRpcParams& iparams, + ClientRpcParams& oparams ); private: cSession( const cSession& ); cSession& operator =( cSession& ); - SaErrorT DoRpc( uint32_t id, Params& iparams, Params& oparams ); + SaErrorT DoRpc( uint32_t id, + ClientRpcParams& iparams, + ClientRpcParams& oparams ); SaErrorT GetSock( cClientStreamSock * & sock ); static void DeleteSock( gpointer ptr ); @@ -84,25 +88,29 @@ m_did = did; SaHpiDomainIdT remote_did = SAHPI_UNSPECIFIED_DOMAIN_ID; - Params iparams, oparams( &m_remote_sid ); + ClientRpcParams iparams, oparams( &m_remote_sid ); iparams.SetFirst( &remote_did ); return DoRpc( eFsaHpiSessionOpen, iparams, oparams ); } SaErrorT cSession::RpcClose() { - Params iparams, oparams; + ClientRpcParams iparams, oparams; iparams.SetFirst( &m_remote_sid ); return DoRpc( eFsaHpiSessionClose, iparams, oparams ); } -SaErrorT cSession::Rpc( uint32_t id, Params& iparams, Params& oparams ) +SaErrorT cSession::Rpc( uint32_t id, + ClientRpcParams& iparams, + ClientRpcParams& oparams ) { iparams.SetFirst( &m_remote_sid ); return DoRpc( id, iparams, oparams ); } -SaErrorT cSession::DoRpc( uint32_t id, Params& iparams, Params& oparams ) +SaErrorT cSession::DoRpc( uint32_t id, + ClientRpcParams& iparams, + ClientRpcParams& oparams ) { SaErrorT rv; @@ -277,8 +285,8 @@ SaErrorT ohc_sess_rpc( uint32_t id, SaHpiSessionIdT sid, - Params& iparams, - Params& oparams ) + ClientRpcParams& iparams, + ClientRpcParams& oparams ) { cSession * session = sessions_get( sid ); if ( !session ) { Modified: openhpi/trunk/baselib/oh_client_session.h =================================================================== --- openhpi/trunk/baselib/oh_client_session.h 2010-12-14 14:22:44 UTC (rev 7198) +++ openhpi/trunk/baselib/oh_client_session.h 2010-12-14 14:37:53 UTC (rev 7199) @@ -24,39 +24,16 @@ #include <SaHpi.h> +#include <oh_rpc_params.h> -struct Params -{ - explicit Params( void * p2 = 0, void * p3 = 0, void * p4 = 0, - void * p5 = 0, void * p6 = 0 ) - { - array[0] = 0; - array[1] = p2; - array[2] = p3; - array[3] = p4; - array[4] = p5; - array[5] = p6; - } - void SetFirst( void * p1 ) - { - array[0] = p1; - } - - union { - void * array[6]; - const void * const_array[6]; - }; -}; - - void ohc_sess_init(); SaErrorT ohc_sess_open( SaHpiDomainIdT did, SaHpiSessionIdT& sid ); SaErrorT ohc_sess_close( SaHpiSessionIdT sid ); SaErrorT ohc_sess_rpc( uint32_t id, SaHpiSessionIdT sid, - Params& iparams, - Params& oparams ); + ClientRpcParams& iparams, + ClientRpcParams& oparams ); SaErrorT ohc_sess_get_did( SaHpiSessionIdT sid, SaHpiDomainIdT& did ); Added: openhpi/trunk/include/oh_rpc_params.h =================================================================== --- openhpi/trunk/include/oh_rpc_params.h (rev 0) +++ openhpi/trunk/include/oh_rpc_params.h 2010-12-14 14:37:53 UTC (rev 7199) @@ -0,0 +1,70 @@ +/* -*- c++ -*- + * + * (C) Pigeon Point Systems. 2010 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + * + */ + +#ifndef __OH_RPC_PARAMS_H +#define __OH_RPC_PARAMS_H + + +/********************************************************************** + * struct RpcParams + * Just a convenient container to pointers array. + * Used in Marshall Layer. + *********************************************************************/ +struct RpcParams +{ + explicit RpcParams( void * p1 = 0, void * p2 = 0, void * p3 = 0, + void * p4 = 0, void * p5 = 0, void * p6 = 0 ) + { + array[0] = p1; + array[1] = p2; + array[2] = p3; + array[3] = p4; + array[4] = p5; + array[5] = p6; + } + + union { + void * array[6]; + const void * const_array[6]; + }; +}; + + +/********************************************************************** + * struct ClientRpcParams + * Just a convenient container to pointers array. + * Allows to set in CTOR only p2-p6 + * For p1 there is a separate function + * Used in Marshall Layer. + *********************************************************************/ +struct ClientRpcParams : public RpcParams +{ + explicit ClientRpcParams( void * p2 = 0, void * p3 = 0, void * p4 = 0, + void * p5 = 0, void * p6 = 0 ) + : RpcParams( 0, p2, p3, p4, p5, p6 ) + { + // empty + } + + void SetFirst( void * p1 ) + { + array[0] = p1; + } +}; + + +#endif /* __OH_RPC_PARAMS_H */ + Modified: openhpi/trunk/openhpid/openhpid.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid.cpp 2010-12-14 14:22:44 UTC (rev 7198) +++ openhpi/trunk/openhpid/openhpid.cpp 2010-12-14 14:37:53 UTC (rev 7199) @@ -39,6 +39,7 @@ #include <oh_domain.h> #include <oh_error.h> #include <oh_init.h> +#include <oh_rpc_params.h> #include <strmsock.h> @@ -450,26 +451,7 @@ /* RPC Call Processing */ /*----------------------------------------------------------------------------*/ -struct Params -{ - explicit Params(void * p0 = 0, void * p1 = 0, void * p2 = 0, - void * p3 = 0, void * p4 = 0, void * p5 = 0) - { - array[0] = p0; - array[1] = p1; - array[2] = p2; - array[3] = p3; - array[4] = p4; - array[5] = p5; - } - - union { - void * array[6]; - const void * const_array[6]; - }; -}; - -#define Demarshal_Rq(rq_byte_order, hm, data, iparams) \ +#define DEMARSHAL_RQ(rq_byte_order, hm, data, iparams) \ { \ int mr = HpiDemarshalRequest(rq_byte_order, hm, data, iparams.array); \ if (mr < 0) { \ @@ -477,7 +459,7 @@ } \ } -#define Marshal_Rp(hm, data, data_len, oparams) \ +#define MARSHAL_RP(hm, data, data_len, oparams) \ { \ int mr = HpiMarshalReply(hm, data, oparams.const_array); \ if (mr < 0) { \ @@ -523,56 +505,56 @@ SaHpiDomainIdT did; void *security = 0; - Params iparams(&did); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&did); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiSessionOpen(OH_DEFAULT_DOMAIN_ID, &sid, security); if (rv == SA_OK) { changed_sid = sid; } - Params oparams(&rv, &sid); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &sid); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiSessionClose: { - Params iparams(&sid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiSessionClose(sid); if (rv == SA_OK) { changed_sid = sid; } - Params oparams(&rv); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiDiscover: { - Params iparams(&sid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiDiscover(sid); - Params oparams(&rv); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiDomainInfoGet: { SaHpiDomainInfoT info; - Params iparams(&sid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiDomainInfoGet(sid, &info); - Params oparams(&rv, &info); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &info); + MARSHAL_RP(hm, data, data_len, oparams); } break; @@ -581,26 +563,26 @@ SaHpiEntryIdT next_eid; SaHpiDrtEntryT drte; - Params iparams(&sid, &eid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &eid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiDrtEntryGet(sid, eid, &next_eid, &drte); - Params oparams(&rv, &next_eid, &drte); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &next_eid, &drte); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiDomainTagSet: { SaHpiTextBufferT tag; - Params iparams(&sid, &tag); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &tag); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiDomainTagSet(sid, &tag); - Params oparams(&rv); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv); + MARSHAL_RP(hm, data, data_len, oparams); } break; @@ -608,76 +590,76 @@ SaHpiEntryIdT eid; SaHpiEntryIdT next_eid; - Params iparams(&sid, &eid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &eid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiRptEntryGet(sid, eid, &next_eid, &rpte); - Params oparams(&rv, &next_eid, &rpte); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &next_eid, &rpte); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiRptEntryGetByResourceId: { - Params iparams(&sid, &rid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiRptEntryGetByResourceId(sid, rid, &rpte); - Params oparams(&rv, &rpte); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &rpte); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiResourceSeveritySet: { SaHpiSeverityT sev; - Params iparams(&sid, &rid, &sev); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid, &sev); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiResourceSeveritySet(sid, rid, sev); - Params oparams(&rv); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiResourceTagSet: { SaHpiTextBufferT tag; - Params iparams(&sid, &rid, &tag); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid, &tag); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiResourceTagSet(sid, rid, &tag); - Params oparams(&rv); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiMyEntityPathGet: { SaHpiEntityPathT ep; - Params iparams(&sid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiMyEntityPathGet(sid, &ep); - Params oparams(&rv, &ep); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &ep); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiResourceIdGet: { - Params iparams(&sid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiResourceIdGet(sid, &rid); - Params oparams(&rv, &rid); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &rid); + MARSHAL_RP(hm, data, data_len, oparams); } break; @@ -688,13 +670,13 @@ SaHpiInstrumentIdT instr_id; SaHpiUint32T rpt_update_cnt; - Params iparams(&sid, &ep, &instr_type, &instance); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &ep, &instr_type, &instance); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiGetIdByEntityPath(sid, ep, instr_type, &instance, &rid, &instr_id, &rpt_update_cnt); - Params oparams(&rv, &instance, &rid, &instr_id, &rpt_update_cnt); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &instance, &rid, &instr_id, &rpt_update_cnt); + MARSHAL_RP(hm, data, data_len, oparams); } break; @@ -704,51 +686,51 @@ SaHpiEntityPathT child_ep; SaHpiUint32T rpt_update_cnt; - Params iparams(&sid, &parent_ep, &instance); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &parent_ep, &instance); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiGetChildEntityPath(sid, parent_ep, &instance, &child_ep, &rpt_update_cnt); - Params oparams(&rv, &instance, &child_ep, &rpt_update_cnt); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &instance, &child_ep, &rpt_update_cnt); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiResourceFailedRemove: { - Params iparams(&sid, &rid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiResourceFailedRemove(sid, rid); - Params oparams(&rv); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiEventLogInfoGet: { SaHpiEventLogInfoT info; - Params iparams(&sid, &rid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiEventLogInfoGet(sid, rid, &info); - Params oparams(&rv, &info); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &info); + MARSHAL_RP(hm, data, data_len, oparams); } break; case eFsaHpiEventLogCapabilitiesGet: { SaHpiEventLogCapabilitiesT caps; - Params iparams(&sid, &rid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiEventLogCapabilitiesGet(sid, rid, &caps); - Params oparams(&rv, &caps); - Marshal_Rp(hm, data, data_len, oparams); + RpcParams oparams(&rv, &caps); + MARSHAL_RP(hm, data, data_len, oparams); } break; @@ -758,126 +740,126 @@ SaHpiEventLogEntryIdT next_eid; SaHpiEventLogEntryT ele; - Params iparams(&sid, &rid, &eid); - Demarshal_Rq(rq_byte_order, hm, data, iparams); + RpcParams iparams(&sid, &rid, &eid); + DEMARSHAL_RQ(rq_byte_order, hm, data, iparams); rv = saHpiEventLogEntryGet(sid, rid, eid, &prev_eid, &next_eid, &ele, &rdr, &rpte); - Params oparams(&rv, &prev_eid, &next_eid, &ele, &rdr, &rpte); - Marshal_Rp(hm, data, data_len, oparams); + ... [truncated message content] |
From: <av...@us...> - 2010-12-15 15:31:54
|
Revision: 7202 http://openhpi.svn.sourceforge.net/openhpi/?rev=7202&view=rev Author: avpak Date: 2010-12-15 15:31:47 +0000 (Wed, 15 Dec 2010) Log Message: ----------- More on feature request #3129960 Moved from open/read/write/seek to fopen/fread/fwrite/fseek Modified Paths: -------------- openhpi/trunk/openhpid/alarm.c openhpi/trunk/openhpid/config.c openhpi/trunk/utils/el_utils.c openhpi/trunk/utils/uid_utils.c Modified: openhpi/trunk/openhpid/alarm.c =================================================================== --- openhpi/trunk/openhpid/alarm.c 2010-12-15 14:26:45 UTC (rev 7201) +++ openhpi/trunk/openhpid/alarm.c 2010-12-15 15:31:47 UTC (rev 7202) @@ -14,10 +14,7 @@ * */ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> +#include <stdio.h> #include <string.h> #include <oh_alarm.h> @@ -684,30 +681,28 @@ SaErrorT oh_alarms_to_file(struct oh_dat *at, char *filename) { GSList *alarms = NULL; - int file; + FILE * fp; if (!at || !filename) { err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } - file = open(filename, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); - if (file < 0) { + fp = fopen(filename, "wb"); + if (!fp) { err("File '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } for (alarms = at->list; alarms; alarms = alarms->next) { - int bytes_written = 0; - bytes_written = write(file, (void *)alarms->data, sizeof(SaHpiAlarmT)); - if (bytes_written != sizeof(SaHpiAlarmT)) { + if (fwrite(alarms->data, sizeof(SaHpiAlarmT), 1, fp) != 1) { err("Couldn't write to file '%s'.", filename); - close(file); + fclose(fp); return SA_ERR_HPI_ERROR; } } - if (close(file) != 0) { + if (fclose(fp) != 0) { err("Couldn't close file '%s'.", filename); return SA_ERR_HPI_ERROR; } @@ -726,7 +721,7 @@ **/ SaErrorT oh_alarms_from_file(struct oh_domain *d, char *filename) { - int file; + FILE *fp; SaHpiAlarmT alarm; if (!d || !filename) { @@ -734,22 +729,22 @@ return SA_ERR_HPI_ERROR; } - file = open(filename, O_RDONLY); - if (file < 0) { + fp = fopen(filename, "rb"); + if (!fp) { err("File '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } - while (read(file, &alarm, sizeof(SaHpiAlarmT)) == sizeof(SaHpiAlarmT)) { + while (fread(&alarm, sizeof(SaHpiAlarmT), 1, fp) == 1) { SaHpiAlarmT *a = oh_add_alarm(d, &alarm, 1); if (!a) { - close(file); + fclose(fp); err("Error adding alarm read from file."); return SA_ERR_HPI_ERROR; } } - if (close(file) != 0) { + if (fclose(fp) != 0) { err("Couldn't close file '%s'.", filename); return SA_ERR_HPI_ERROR; } Modified: openhpi/trunk/openhpid/config.c =================================================================== --- openhpi/trunk/openhpid/config.c 2010-12-15 14:26:45 UTC (rev 7201) +++ openhpi/trunk/openhpid/config.c 2010-12-15 15:31:47 UTC (rev 7202) @@ -19,14 +19,15 @@ * Bryan Sutula <su...@us...> */ +#include <stdio.h> +#include <stdlib.h> #include <string.h> -#include <fcntl.h> -#include <unistd.h> + +#include <config.h> #include <oh_config.h> #include <oh_plugin.h> #include <oh_error.h> #include <oh_lock.h> -#include <config.h> /* * Global Parameters @@ -473,7 +474,8 @@ **/ int oh_load_config (char *filename, struct oh_parsed_config *config) { - int oh_conf_file, i; + FILE * fp; + int i; GScanner *oh_scanner; int done = 0; int num_tokens = sizeof(oh_conf_tokens) / sizeof(oh_conf_tokens[0]); @@ -493,14 +495,18 @@ oh_scanner->msg_handler = scanner_msg_handler; oh_scanner->input_name = filename; - oh_conf_file = open(filename, O_RDONLY); - if (oh_conf_file < 0) { + fp = fopen(filename, "r"); + if (!fp) { err("Configuration file '%s' could not be opened", filename); g_scanner_destroy(oh_scanner); return -4; } - g_scanner_input_file(oh_scanner, oh_conf_file); +#ifdef _WIN32 + g_scanner_input_file(oh_scanner, _fileno(fp)); +#else + g_scanner_input_file(oh_scanner, fileno(fp)); +#endif for (i = 0; i < num_tokens; i++) { g_scanner_scope_add_symbol( @@ -535,7 +541,7 @@ read_globals_from_env(1); - if (close(oh_conf_file) != 0) { + if (fclose(fp) != 0) { err("Couldn't close file '%s'.", filename); g_scanner_destroy(oh_scanner); return -5; Modified: openhpi/trunk/utils/el_utils.c =================================================================== --- openhpi/trunk/utils/el_utils.c 2010-12-15 14:26:45 UTC (rev 7201) +++ openhpi/trunk/utils/el_utils.c 2010-12-15 15:31:47 UTC (rev 7202) @@ -15,10 +15,7 @@ * Renier Morales <re...@op...> */ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> +#include <stdio.h> #include <string.h> #include <SaHpi.h> @@ -322,32 +319,28 @@ /* write a EL entry list to a file */ SaErrorT oh_el_map_to_file(oh_el *el, char *filename) { - int file; + FILE *fp; GList *node = NULL; if (el == NULL || filename == NULL) { return SA_ERR_HPI_INVALID_PARAMS; } -#ifdef _WIN32 - file = open(filename, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); -#else - file = open(filename, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP); -#endif /* _WIN32 */ - if (file < 0) { + fp = fopen(filename, "wb"); + if (!fp) { err("EL file '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } for (node = el->list; node; node = node->next) { - if (write(file, (void *)node->data, sizeof(oh_el_entry)) != sizeof(oh_el_entry)) { + if (fwrite((void *)node->data, sizeof(oh_el_entry), 1, fp) != 1) { err("Couldn't write to file '%s'.", filename); - close(file); + fclose(fp); return SA_ERR_HPI_ERROR; } } - if (close(file) != 0) { + if (fclose(fp) != 0) { err("Couldn't close file '%s'.", filename); return SA_ERR_HPI_ERROR; } @@ -359,7 +352,7 @@ /* read a EL entry list from a file */ SaErrorT oh_el_map_from_file(oh_el *el, char *filename) { - int file; + FILE *fp; oh_el_entry entry; /* check el params and state */ @@ -369,14 +362,14 @@ return SA_ERR_HPI_INVALID_REQUEST; } - file = open(filename, O_RDONLY); - if (file < 0) { + fp = fopen(filename, "rb"); + if (!fp) { err("EL file '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } oh_el_clear(el); // ensure list is empty - while (read(file, &entry, sizeof(oh_el_entry)) == sizeof(oh_el_entry)) { + while (fread(&entry, sizeof(oh_el_entry), 1, fp) == 1) { oh_el_entry *elentry = g_new0(oh_el_entry, 1); el->nextid = entry.event.EntryId; el->nextid++; @@ -384,7 +377,7 @@ el->list = g_list_append(el->list, elentry); } - if (close(file) != 0) { + if (fclose(fp) != 0) { err("Couldn't close file '%s'.", filename); return SA_ERR_HPI_ERROR; } Modified: openhpi/trunk/utils/uid_utils.c =================================================================== --- openhpi/trunk/utils/uid_utils.c 2010-12-15 14:26:45 UTC (rev 7201) +++ openhpi/trunk/utils/uid_utils.c 2010-12-15 15:31:47 UTC (rev 7202) @@ -17,11 +17,7 @@ #include <stdlib.h> #include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> #include <string.h> -#include <unistd.h> #include <glib.h> #include <config.h> @@ -70,7 +66,7 @@ /* use to build memory resident map table from file */ static int uid_map_from_file(void); -static int build_uid_map_data(int file); +static int build_uid_map_data(FILE *fp); /* used by oh_uid_remove() */ static void write_ep_xref(gpointer key, gpointer value, gpointer file); @@ -181,7 +177,7 @@ EP_XREF *ep_xref; char *uid_map_file; - int file; + FILE * fp; SaHpiEntityPathT entitypath; @@ -233,22 +229,21 @@ uid_map_file = OH_DEFAULT_UID_MAP; } - file = open(uid_map_file, O_WRONLY); - if (file >= 0) { - lseek(file, 0, SEEK_END); - if (write(file,ep_xref, sizeof(EP_XREF)) != sizeof(EP_XREF)) { + fp = fopen(uid_map_file, "r+b"); + if (fp) { + fseek(fp, 0, SEEK_END); + if (fwrite(ep_xref, sizeof(EP_XREF), 1, fp) == 1) { + fseek(fp, 0, SEEK_SET); + if (fwrite(&resource_id, sizeof(resource_id), 1, fp) != 1) { + err("write resource_id failed"); + ruid = 0; + } + } else { err("write ep_xref failed"); - close(file); - return 0; - } - lseek(file, 0, SEEK_SET); - if (write(file, &resource_id, sizeof(resource_id)) != sizeof(resource_id)) { - err("write resource_id failed"); - close(file); - return 0; - } + ruid = 0; + } + fclose(fp); } - close(file); uid_unlock(&oh_uid_lock); @@ -384,7 +379,7 @@ SaErrorT oh_uid_map_to_file(void) { char *uid_map_file; - int file; + FILE *fp; uid_map_file = (char *)getenv("OPENHPI_UID_MAP"); @@ -394,28 +389,25 @@ uid_lock(&oh_uid_lock); -#ifdef _WIN32 - file = open(uid_map_file, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); -#else - file = open(uid_map_file, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP); -#endif /* _WIN32 */ - if(file < 0) { + fp = fopen(uid_map_file, "wb"); + if(!fp) { err("Configuration file '%s' could not be opened", uid_map_file); uid_unlock(&oh_uid_lock); return SA_ERR_HPI_ERROR; } /* write resource id */ - if (write(file, (void *)&resource_id, sizeof(resource_id)) != sizeof(resource_id)) { + if (fwrite((void *)&resource_id, sizeof(resource_id), 1, fp) != 1) { err("write resource_id failed"); - close(file); + fclose(fp); + uid_unlock(&oh_uid_lock); return SA_ERR_HPI_ERROR; } /* write all EP_XREF data records */ - g_hash_table_foreach(oh_resource_id_table, write_ep_xref, &file); + g_hash_table_foreach(oh_resource_id_table, write_ep_xref, fp); - if(close(file) != 0) { + if(fclose(fp) != 0) { err("Couldn't close file '%s'.", uid_map_file); uid_unlock(&oh_uid_lock); return SA_ERR_HPI_ERROR; @@ -433,9 +425,9 @@ * * Return value: None (void). */ -static void write_ep_xref(gpointer key, gpointer value, gpointer file) +static void write_ep_xref(gpointer key, gpointer value, gpointer fp) { - if (write(*(int *)file, value, sizeof(EP_XREF)) != sizeof(EP_XREF)) { + if (fwrite(value, sizeof(EP_XREF), 1, (FILE *)fp) != 1) { err("write EP_XREF failed"); } } @@ -451,7 +443,7 @@ static gint uid_map_from_file() { char *uid_map_file; - int file; + FILE *fp; int rval; /* initialize uid map file */ @@ -459,26 +451,22 @@ if (uid_map_file == NULL) { uid_map_file = OH_DEFAULT_UID_MAP; } - file = open(uid_map_file, O_RDONLY); - if(file < 0) { + fp = fopen(uid_map_file, "rb"); + if(!fp) { /* create map file with resource id initial value */ err("Configuration file '%s' does not exist, initializing", uid_map_file); -#ifdef _WIN32 - file = open(uid_map_file, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); -#else - file = open(uid_map_file, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP); -#endif /* _WIN32 */ - if(file < 0) { + fp = fopen(uid_map_file, "wb"); + if(!fp) { err("Could not initialize uid map file, %s", uid_map_file ); return -1; } /* write initial uid value */ - if( write(file,(void *)&resource_id, sizeof(resource_id)) < 0 ) { + if(fwrite(&resource_id, sizeof(resource_id), 1, fp) != 1 ) { err("failed to write uid, on uid map file initialization"); - close(file); + fclose(fp); return -1; } - if(close(file) != 0) { + if(fclose(fp) != 0) { err("Couldn't close file '%s'.during uid map file initialization", uid_map_file); return -1; } @@ -487,13 +475,14 @@ } /* read uid/resouce_id highest count from uid map file */ - if (read(file,&resource_id, sizeof(resource_id)) != sizeof(resource_id)) { + if (fread(&resource_id, sizeof(resource_id), 1, fp) != 1) { err("error setting uid from existing uid map file"); + fclose(fp); return -1; } - rval = build_uid_map_data(file); - close(file); + rval = build_uid_map_data(fp); + fclose(fp); if (rval < 0) return -1; @@ -511,18 +500,15 @@ * * Return value: success 0, error -1. */ -static gint build_uid_map_data(int file) +static gint build_uid_map_data(FILE *fp) { - int rval; EP_XREF *ep_xref; EP_XREF ep_xref1; gpointer value; gpointer key; - rval = read(file, &ep_xref1, sizeof(EP_XREF)); + while (fread(&ep_xref1, sizeof(EP_XREF), 1, fp) == 1) { - while ( (rval != EOF) && (rval == sizeof(EP_XREF)) ) { - /* copy read record from ep_xref1 to malloc'd ep_xref */ ep_xref = g_new0(EP_XREF, 1); if (!ep_xref) @@ -538,13 +524,9 @@ /* resource id based key */ key = (gpointer)&ep_xref->resource_id; g_hash_table_insert(oh_resource_id_table, key, value); - - rval = read(file, &ep_xref1, sizeof(EP_XREF)); } - /* TODO thought EOF would return -1, its not so check other way */ - /* if (rval != EOF), rval of 0 seems to be EOF */ - if ( (rval > 0) && (rval < sizeof(EP_XREF)) ) { + if ((feof(fp) == 0) || (ferror(fp) != 0)) { err("error building ep xref from map file"); return -1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-16 14:23:54
|
Revision: 7205 http://openhpi.svn.sourceforge.net/openhpi/?rev=7205&view=rev Author: avpak Date: 2010-12-16 14:23:44 +0000 (Thu, 16 Dec 2010) Log Message: ----------- More on feature request #3129960 Removed useless header inclusions. Refactoring on baselib lock. Modified Paths: -------------- openhpi/trunk/baselib/conf.c openhpi/trunk/baselib/init.cpp openhpi/trunk/baselib/init.h openhpi/trunk/baselib/lock.c openhpi/trunk/baselib/lock.h openhpi/trunk/baselib/safhpi.cpp openhpi/trunk/baselib/session.cpp openhpi/trunk/clients/hpionIBMblade.c Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/conf.c 2010-12-16 14:23:44 UTC (rev 7205) @@ -45,7 +45,7 @@ void ohc_conf_init(void) { - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); // Create domain table if (!ohc_domains) { // Create domain table @@ -87,15 +87,15 @@ } } - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); } const struct ohc_domain_conf * ohc_get_domain_conf(SaHpiDomainIdT did) { struct ohc_domain_conf *dc; - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); dc = (struct ohc_domain_conf *)g_hash_table_lookup(ohc_domains, &did); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return dc; } @@ -104,7 +104,7 @@ unsigned short port, SaHpiDomainIdT *did) { - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); // get all known domain ids and sort them GList *keys = 0; @@ -126,18 +126,18 @@ g_list_free(keys); if (prev_did == SAHPI_UNSPECIFIED_DOMAIN_ID) { - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return SA_ERR_HPI_OUT_OF_SPACE; } if ((prev_did + 1) == SAHPI_UNSPECIFIED_DOMAIN_ID) { - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return SA_ERR_HPI_OUT_OF_SPACE; } *did = prev_did + 1; add_domain_conf(*did, host, port); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return SA_OK; } @@ -150,16 +150,16 @@ did==OH_DEFAULT_DOMAIN_ID) return SA_ERR_HPI_INVALID_PARAMS; - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); // check new did against all known domain ids if (ohc_get_domain_conf(did) != NULL) { - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return SA_ERR_HPI_DUPLICATE; } add_domain_conf(did, host, port); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return SA_OK; } @@ -169,7 +169,7 @@ struct ohc_domain_conf *dc; int did, nextdid = SAHPI_UNSPECIFIED_DOMAIN_ID; - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); // get all known domain ids and sort them GList *keys = 0; @@ -199,7 +199,7 @@ else *next_entry_id = SAHPI_LAST_ENTRY; g_list_free(keys); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return dc; } Modified: openhpi/trunk/baselib/init.cpp =================================================================== --- openhpi/trunk/baselib/init.cpp 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/init.cpp 2010-12-16 14:23:44 UTC (rev 7205) @@ -48,7 +48,7 @@ return SA_OK; } -SaErrorT ohc_fini(void) +SaErrorT ohc_finit(void) { SaErrorT rv; Modified: openhpi/trunk/baselib/init.h =================================================================== --- openhpi/trunk/baselib/init.h 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/init.h 2010-12-16 14:23:44 UTC (rev 7205) @@ -29,7 +29,7 @@ SaErrorT ohc_init(void); -SaErrorT ohc_fini(void); +SaErrorT ohc_finit(void); #ifdef __cplusplus } /* extern "C" */ Modified: openhpi/trunk/baselib/lock.c =================================================================== --- openhpi/trunk/baselib/lock.c 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/lock.c 2010-12-16 14:23:44 UTC (rev 7205) @@ -14,8 +14,20 @@ * */ +#include <glib.h> + #include "lock.h" -GStaticRecMutex ohc_lock; +static GStaticRecMutex ohc_main_lock = G_STATIC_REC_MUTEX_INIT; +void ohc_lock( void ) +{ + g_static_rec_mutex_lock(&ohc_main_lock); +} + +void ohc_unlock( void ) +{ + g_static_rec_mutex_unlock(&ohc_main_lock); +} + Modified: openhpi/trunk/baselib/lock.h =================================================================== --- openhpi/trunk/baselib/lock.h 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/lock.h 2010-12-16 14:23:44 UTC (rev 7205) @@ -17,13 +17,12 @@ #ifndef __BASELIB_LOCK_H #define __BASELIB_LOCK_H -#include <glib.h> - #ifdef __cplusplus extern "C" { #endif -extern GStaticRecMutex ohc_lock; +void ohc_lock( void ); +void ohc_unlock( void ); #ifdef __cplusplus } /* extern "C" */ Modified: openhpi/trunk/baselib/safhpi.cpp =================================================================== --- openhpi/trunk/baselib/safhpi.cpp 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/safhpi.cpp 2010-12-16 14:23:44 UTC (rev 7205) @@ -171,7 +171,7 @@ // TODO implement any library finalization code here // Current implementation does not utilize this function - return ohc_fini(); + return ohc_finit(); } /*----------------------------------------------------------------------------*/ Modified: openhpi/trunk/baselib/session.cpp =================================================================== --- openhpi/trunk/baselib/session.cpp 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/baselib/session.cpp 2010-12-16 14:23:44 UTC (rev 7205) @@ -158,9 +158,9 @@ if ( ptr ) { sock = reinterpret_cast<cClientStreamSock *>(ptr); } else { - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); const struct ohc_domain_conf * dc = ohc_get_domain_conf( m_did ); - g_static_rec_mutex_unlock( &ohc_lock ); + ohc_unlock(); if (!dc) { err( "Session: cannot find domain %u config.\n", m_did ); @@ -208,18 +208,18 @@ static void sessions_init() { - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); if ( !sessions ) { sessions = g_hash_table_new( g_direct_hash, g_direct_equal ); } - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); } static cSession * sessions_get( SaHpiSessionIdT sid ) { - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); gpointer value = g_hash_table_lookup( sessions, sid_key( sid ) ); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return reinterpret_cast<cSession*>(value); } @@ -232,10 +232,10 @@ static GList * sessions_take_all() { - g_static_rec_mutex_lock(&ohc_lock); + ohc_lock(); GList * sessions_list = 0; g_hash_table_foreach_remove( sessions, dehash_sessions, &sessions_list ); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return sessions_list; } @@ -244,20 +244,20 @@ { static SaHpiSessionIdT next_sid = 1; - g_static_rec_mutex_lock( &ohc_lock ); + ohc_lock(); SaHpiSessionIdT sid = next_sid; ++next_sid; g_hash_table_insert( sessions, sid_key( sid ), session ); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); return sid; } static void sessions_remove( SaHpiSessionIdT sid ) { - g_static_rec_mutex_lock( &ohc_lock ); + ohc_lock(); g_hash_table_remove( sessions, sid_key( sid ) ); - g_static_rec_mutex_unlock(&ohc_lock); + ohc_unlock(); } Modified: openhpi/trunk/clients/hpionIBMblade.c =================================================================== --- openhpi/trunk/clients/hpionIBMblade.c 2010-12-15 16:39:23 UTC (rev 7204) +++ openhpi/trunk/clients/hpionIBMblade.c 2010-12-16 14:23:44 UTC (rev 7205) @@ -68,7 +68,6 @@ #include <SaHpi.h> #include <oh_utils.h> -#include <oh_config.h> #include <oHpi.h> #include "oh_clients.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-17 21:59:43
|
Revision: 7208 http://openhpi.svn.sourceforge.net/openhpi/?rev=7208&view=rev Author: avpak Date: 2010-12-17 21:59:35 +0000 (Fri, 17 Dec 2010) Log Message: ----------- Feature request #3129962 Modified Paths: -------------- openhpi/trunk/configure.ac openhpi/trunk/include/oh_plugin.h openhpi/trunk/openhpid/Makefile.am openhpi/trunk/openhpid/plugin.c openhpi/trunk/openhpid/t/ohpi/Makefile.am Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2010-12-16 18:48:54 UTC (rev 7207) +++ openhpi/trunk/configure.ac 2010-12-17 21:59:35 UTC (rev 7208) @@ -98,6 +98,8 @@ dnl glib 2.x checks GLIB_REQUIRED_VERSION=2.2.0 GLIB=glib-2.0 +GTHREAD=gthread-2.0 +GMODULE=gmodule-2.0 if pkg-config --atleast-version $GLIB_REQUIRED_VERSION $GLIB; then : @@ -108,10 +110,12 @@ fi exact_version=`pkg-config --modversion $GLIB`; -GLIB_CFLAGS=`pkg-config --cflags $GLIB gthread-2.0` -GLIB_LIBS=`pkg-config --libs $GLIB gthread-2.0` +GLIB_CFLAGS=`pkg-config --cflags $GLIB $GTHREAD` +GLIB_LIBS=`pkg-config --libs $GLIB $GTHREAD` GLIB_ONLY_CFLAGS=`pkg-config --cflags $GLIB` GLIB_ONLY_LIBS=`pkg-config --libs $GLIB` +GMODULE_ONLY_CFLAGS=`pkg-config --cflags $GMODULE` +GMODULE_ONLY_LIBS=`pkg-config --libs $GMODULE` # On some versions of Solaris the pkg-config file for gthread-2.0 contains a # compiler option, '-mt', that is incompatible with gcc @@ -143,13 +147,10 @@ AC_SUBST(GLIB_ONLY_CFLAGS) AC_SUBST(GLIB_ONLY_LIBS) +AC_SUBST(GMODULE_ONLY_CFLAGS) +AC_SUBST(GMODULE_ONLY_LIBS) -AC_CHECK_LIB([ltdl], [lt_dlopen], [], [ - OH_CHECK_FAIL(libltdl,libltdl-devel,, - this is required for plugin loading) - ]) - AC_CHECK_LIB([sysfs], [sysfs_get_mnt_path], [have_sysfs=yes]) AC_CHECK_HEADER([sysfs/libsysfs.h], [], [have_sysfs=no]) Modified: openhpi/trunk/include/oh_plugin.h =================================================================== --- openhpi/trunk/include/oh_plugin.h 2010-12-16 18:48:54 UTC (rev 7207) +++ openhpi/trunk/include/oh_plugin.h 2010-12-17 21:59:35 UTC (rev 7208) @@ -17,6 +17,8 @@ #define __OH_PLUGIN_H #include <glib.h> +#include <gmodule.h> + #include <oh_handler.h> #ifdef __cplusplus @@ -33,7 +35,7 @@ struct oh_plugin { char *name; /* Name of plugin preceded by 'lib' (e.g. "libdummy"). */ /* handle returned by lt_dlopenext or 0 for static plugins */ - void *dl_handle; + GModule *dl_handle; struct oh_abi_v2 *abi; /* pointer to associated plugin interface */ int handler_count; /* How many handlers use this plugin */ Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-16 18:48:54 UTC (rev 7207) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-17 21:59:35 UTC (rev 7208) @@ -47,7 +47,7 @@ if HAVE_OPENSSL libopenhpidaemon_la_LIBADD += $(top_builddir)/$(SSLDIR)/libopenhpi_ssl.la endif -libopenhpidaemon_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ +libopenhpidaemon_la_LDFLAGS = @HPI_LIB_VERSION@ @GMODULE_ONLY_LIBS@ # daemon sbin_PROGRAMS = openhpid Modified: openhpi/trunk/openhpid/plugin.c =================================================================== --- openhpi/trunk/openhpid/plugin.c 2010-12-16 18:48:54 UTC (rev 7207) +++ openhpi/trunk/openhpid/plugin.c 2010-12-17 21:59:35 UTC (rev 7208) @@ -18,17 +18,21 @@ * Anton Pak <ant...@pi...> */ +#include <stddef.h> #include <string.h> -#include <ltdl.h> #include <glib.h> -#include <oh_plugin.h> +#include <gmodule.h> + +#include <config.h> + #include <oh_config.h> +#include <oh_domain.h> #include <oh_error.h> #include <oh_lock.h> -#include <oh_domain.h> -#include <config.h> +#include <oh_plugin.h> + /* * Structure containing global list of plugins (oh_plugin). */ @@ -76,69 +80,6 @@ g_static_rec_mutex_unlock(&oh_handlers.lock); } -/** - * oh_exit_ltdl - * - * Does everything needed to close the ltdl structures. - * - * Returns: 0 on Success. - **/ -static int oh_exit_ltdl(void) -{ - int rv; - - rv = lt_dlexit(); - if (rv < 0) { - err("Could not exit ltdl!"); - return -1; - } - - return 0; -} - -/** - * oh_init_ltdl - * - * Does all the initialization needed for the ltdl process to - * work. It takes no arguments, and returns 0 on success, < 0 on error - * - * Returns: 0 on Success. - **/ -static int oh_init_ltdl(void) -{ - struct oh_global_param path_param = { .type = OPENHPI_PATH }; - int err; - static int init_done = 0; - - data_access_lock(); - if (init_done) { - data_access_unlock(); - return 0; - } - - err = lt_dlinit(); - if (err != 0) { - err("Can not init ltdl"); - data_access_unlock(); - return -1; - } - - oh_get_global_param(&path_param); - - err = lt_dlsetsearchpath(path_param.u.path); - if (err != 0) { - err("Can not set lt_dl search path"); - oh_exit_ltdl(); - data_access_unlock(); - return -1; - } - - init_done = 1; - data_access_unlock(); - - return 0; -} - static void __inc_plugin_refcount(struct oh_plugin *p) { g_static_rec_mutex_lock(&p->refcount_lock); @@ -162,7 +103,7 @@ g_static_rec_mutex_free(&p->refcount_lock); g_free(p->abi); if (p->dl_handle) { - lt_dlclose(p->dl_handle); + g_module_close(p->dl_handle); } g_free(p); } @@ -290,6 +231,10 @@ **/ int oh_load_plugin(char *plugin_name) { + struct oh_global_param path_param = { .type = OPENHPI_PATH }; + gchar **plugin_search_dirs; + size_t i; + gchar *plugin_path; struct oh_plugin *plugin = NULL; struct oh_static_plugin *p = static_plugins; @@ -300,8 +245,8 @@ return -1; } - if (oh_init_ltdl()) { - err("ERROR. Could not initialize ltdl for loading plugins."); + if (g_module_supported() == FALSE) { + err("ERROR. GModule is not supported. Cannot load plugins."); return -1; } @@ -346,9 +291,19 @@ p++; } - plugin->dl_handle = lt_dlopenext(plugin->name); + oh_get_global_param(&path_param); + plugin_search_dirs = g_strsplit(path_param.u.path, ":", -1); + for( i = 0; plugin_search_dirs[i] != 0; ++i) { + plugin_path = g_module_build_path(plugin_search_dirs[i], plugin->name); + plugin->dl_handle = g_module_open(plugin_path, G_MODULE_BIND_LOCAL); + g_free(plugin_path); + if (plugin->dl_handle) { + break; + } + } + g_strfreev(plugin_search_dirs); if (plugin->dl_handle == NULL) { - err("Can not open %s plugin: %s", plugin->name, lt_dlerror()); + err("Can not open %s plugin: %s", plugin->name, g_module_error()); goto cleanup_and_quit; } @@ -744,194 +699,288 @@ return -1; } - (*abi)->open = lt_dlsym(plugin->dl_handle, - "oh_open"); - (*abi)->close = lt_dlsym(plugin->dl_handle, - "oh_close"); - (*abi)->get_event = lt_dlsym(plugin->dl_handle, - "oh_get_event"); - (*abi)->discover_resources = lt_dlsym(plugin->dl_handle, - "oh_discover_resources"); - (*abi)->set_resource_tag = lt_dlsym(plugin->dl_handle, - "oh_set_resource_tag"); - (*abi)->set_resource_severity = lt_dlsym(plugin->dl_handle, - "oh_set_resource_severity"); - (*abi)->resource_failed_remove = lt_dlsym(plugin->dl_handle, - "oh_resource_failed_remove"); - (*abi)->get_el_info = lt_dlsym(plugin->dl_handle, - "oh_get_el_info"); - (*abi)->get_el_caps = lt_dlsym(plugin->dl_handle, - "oh_get_el_caps"); - (*abi)->set_el_time = lt_dlsym(plugin->dl_handle, - "oh_set_el_time"); - (*abi)->add_el_entry = lt_dlsym(plugin->dl_handle, - "oh_add_el_entry"); - (*abi)->get_el_entry = lt_dlsym(plugin->dl_handle, - "oh_get_el_entry"); - (*abi)->clear_el = lt_dlsym(plugin->dl_handle, - "oh_clear_el"); - (*abi)->set_el_state = lt_dlsym(plugin->dl_handle, - "oh_set_el_state"); - (*abi)->reset_el_overflow = lt_dlsym(plugin->dl_handle, - "oh_reset_el_overflow"); - (*abi)->get_sensor_reading = lt_dlsym(plugin->dl_handle, - "oh_get_sensor_reading"); - (*abi)->get_sensor_thresholds = lt_dlsym(plugin->dl_handle, - "oh_get_sensor_thresholds"); - (*abi)->set_sensor_thresholds = lt_dlsym(plugin->dl_handle, - "oh_set_sensor_thresholds"); - (*abi)->get_sensor_enable = lt_dlsym(plugin->dl_handle, - "oh_get_sensor_enable"); - (*abi)->set_sensor_enable = lt_dlsym(plugin->dl_handle, - "oh_set_sensor_enable"); - (*abi)->get_sensor_event_enables = lt_dlsym(plugin->dl_handle, - "oh_get_sensor_event_enables"); - (*abi)->set_sensor_event_enables = lt_dlsym(plugin->dl_handle, - "oh_set_sensor_event_enables"); - (*abi)->get_sensor_event_masks = lt_dlsym(plugin->dl_handle, - "oh_get_sensor_event_masks"); - (*abi)->set_sensor_event_masks = lt_dlsym(plugin->dl_handle, - "oh_set_sensor_event_masks"); - (*abi)->get_control_state = lt_dlsym(plugin->dl_handle, - "oh_get_control_state"); - (*abi)->set_control_state = lt_dlsym(plugin->dl_handle, - "oh_set_control_state"); - (*abi)->get_idr_info = lt_dlsym(plugin->dl_handle, - "oh_get_idr_info"); - (*abi)->get_idr_area_header = lt_dlsym(plugin->dl_handle, - "oh_get_idr_area_header"); - (*abi)->add_idr_area = lt_dlsym(plugin->dl_handle, - "oh_add_idr_area"); - (*abi)->add_idr_area_id = lt_dlsym(plugin->dl_handle, - "oh_add_idr_area_id"); - (*abi)->del_idr_area = lt_dlsym(plugin->dl_handle, - "oh_del_idr_area"); - (*abi)->get_idr_field = lt_dlsym(plugin->dl_handle, - "oh_get_idr_field"); - (*abi)->add_idr_field = lt_dlsym(plugin->dl_handle, - "oh_add_idr_field"); - (*abi)->add_idr_field_id = lt_dlsym(plugin->dl_handle, - "oh_add_idr_field_id"); - (*abi)->set_idr_field = lt_dlsym(plugin->dl_handle, - "oh_set_idr_field"); - (*abi)->del_idr_field = lt_dlsym(plugin->dl_handle, - "oh_del_idr_field"); - (*abi)->get_watchdog_info = lt_dlsym(plugin->dl_handle, - "oh_get_watchdog_info"); - (*abi)->set_watchdog_info = lt_dlsym(plugin->dl_handle, - "oh_set_watchdog_info"); - (*abi)->reset_watchdog = lt_dlsym(plugin->dl_handle, - "oh_reset_watchdog"); - (*abi)->get_next_announce = lt_dlsym(plugin->dl_handle, - "oh_get_next_announce"); - (*abi)->get_announce = lt_dlsym(plugin->dl_handle, - "oh_get_announce"); - (*abi)->ack_announce = lt_dlsym(plugin->dl_handle, - "oh_ack_announce"); - (*abi)->add_announce = lt_dlsym(plugin->dl_handle, - "oh_add_announce"); - (*abi)->del_announce = lt_dlsym(plugin->dl_handle, - "oh_del_announce"); - (*abi)->get_annunc_mode = lt_dlsym(plugin->dl_handle, - "oh_get_annunc_mode"); - (*abi)->set_annunc_mode = lt_dlsym(plugin->dl_handle, - "oh_set_annunc_mode"); - (*abi)->get_dimi_info = lt_dlsym(plugin->dl_handle, - "oh_get_dimi_info"); - (*abi)->get_dimi_test = lt_dlsym(plugin->dl_handle, - "oh_get_dimi_test"); - (*abi)->get_dimi_test_ready = lt_dlsym(plugin->dl_handle, - "oh_get_dimi_test_ready"); - (*abi)->start_dimi_test = lt_dlsym(plugin->dl_handle, - "oh_start_dimi_test"); - (*abi)->cancel_dimi_test = lt_dlsym(plugin->dl_handle, - "oh_cancel_dimi_test"); - (*abi)->get_dimi_test_status = lt_dlsym(plugin->dl_handle, - "oh_get_dimi_test_status"); - (*abi)->get_dimi_test_results = lt_dlsym(plugin->dl_handle, - "oh_get_dimi_test_results"); - (*abi)->get_fumi_spec = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_spec"); - (*abi)->get_fumi_service_impact = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_service_impact"); - (*abi)->set_fumi_source = lt_dlsym(plugin->dl_handle, - "oh_set_fumi_source"); - (*abi)->validate_fumi_source = lt_dlsym(plugin->dl_handle, - "oh_validate_fumi_source"); - (*abi)->get_fumi_source = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_source"); - (*abi)->get_fumi_source_component = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_source_component"); - (*abi)->get_fumi_target = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_target"); - (*abi)->get_fumi_target_component = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_target_component"); - (*abi)->get_fumi_logical_target = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_logical_target"); - (*abi)->get_fumi_logical_target_component = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_logical_target_component"); - (*abi)->start_fumi_backup = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_backup"); - (*abi)->set_fumi_bank_order = lt_dlsym(plugin->dl_handle, - "oh_set_fumi_bank_order"); - (*abi)->start_fumi_bank_copy = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_bank_copy"); - (*abi)->start_fumi_install = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_install"); - (*abi)->get_fumi_status = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_status"); - (*abi)->start_fumi_verify = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_verify"); - (*abi)->start_fumi_verify_main = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_verify_main"); - (*abi)->cancel_fumi_upgrade = lt_dlsym(plugin->dl_handle, - "oh_cancel_fumi_upgrade"); - (*abi)->get_fumi_autorollback_disable = lt_dlsym(plugin->dl_handle, - "oh_get_fumi_autorollback_disable"); - (*abi)->set_fumi_autorollback_disable = lt_dlsym(plugin->dl_handle, - "oh_set_fumi_autorollback_disable"); - (*abi)->start_fumi_rollback = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_rollback"); - (*abi)->activate_fumi = lt_dlsym(plugin->dl_handle, - "oh_activate_fumi"); - (*abi)->start_fumi_activate = lt_dlsym(plugin->dl_handle, - "oh_start_fumi_activate"); - (*abi)->cleanup_fumi = lt_dlsym(plugin->dl_handle, - "oh_cleanup_fumi"); - (*abi)->hotswap_policy_cancel = lt_dlsym(plugin->dl_handle, - "oh_hotswap_policy_cancel"); - (*abi)->get_hotswap_state = lt_dlsym(plugin->dl_handle, - "oh_get_hotswap_state"); - (*abi)->set_autoinsert_timeout = lt_dlsym(plugin->dl_handle, - "oh_set_autoinsert_timeout"); - (*abi)->set_hotswap_state = lt_dlsym(plugin->dl_handle, - "oh_set_hotswap_state"); - (*abi)->request_hotswap_action = lt_dlsym(plugin->dl_handle, - "oh_request_hotswap_action"); - (*abi)->get_autoextract_timeout = lt_dlsym(plugin->dl_handle, - "oh_get_autoextract_timeout"); - (*abi)->set_autoextract_timeout = lt_dlsym(plugin->dl_handle, - "oh_set_autoextract_timeout"); - (*abi)->get_power_state = lt_dlsym(plugin->dl_handle, - "oh_get_power_state"); - (*abi)->set_power_state = lt_dlsym(plugin->dl_handle, - "oh_set_power_state"); - (*abi)->get_indicator_state = lt_dlsym(plugin->dl_handle, - "oh_get_indicator_state"); - (*abi)->set_indicator_state = lt_dlsym(plugin->dl_handle, - "oh_set_indicator_state"); - (*abi)->control_parm = lt_dlsym(plugin->dl_handle, - "oh_control_parm"); - (*abi)->load_id_get = lt_dlsym(plugin->dl_handle, - "oh_load_id_get"); - (*abi)->load_id_set = lt_dlsym(plugin->dl_handle, - "oh_load_id_set"); - (*abi)->get_reset_state = lt_dlsym(plugin->dl_handle, - "oh_get_reset_state"); - (*abi)->set_reset_state = lt_dlsym(plugin->dl_handle, - "oh_set_reset_state"); - (*abi)->inject_event = lt_dlsym(plugin->dl_handle, - "oh_inject_event"); + g_module_symbol(plugin->dl_handle, + "oh_open", + (gpointer*)(&(*abi)->open)); + g_module_symbol(plugin->dl_handle, + "oh_close", + (gpointer*)(&(*abi)->close)); + g_module_symbol(plugin->dl_handle, + "oh_get_event", + (gpointer*)(&(*abi)->get_event)); + g_module_symbol(plugin->dl_handle, + "oh_discover_resources", + (gpointer*)(&(*abi)->discover_resources)); + g_module_symbol(plugin->dl_handle, + "oh_set_resource_tag", + (gpointer*)(&(*abi)->set_resource_tag)); + g_module_symbol(plugin->dl_handle, + "oh_set_resource_severity", + (gpointer*)(&(*abi)->set_resource_severity)); + g_module_symbol(plugin->dl_handle, + "oh_resource_failed_remove", + (gpointer*)(&(*abi)->resource_failed_remove)); + g_module_symbol(plugin->dl_handle, + "oh_get_el_info", + (gpointer*)(&(*abi)->get_el_info)); + g_module_symbol(plugin->dl_handle, + "oh_get_el_caps", + (gpointer*)(&(*abi)->get_el_caps)); + g_module_symbol(plugin->dl_handle, + "oh_set_el_time", + (gpointer*)(&(*abi)->set_el_time)); + g_module_symbol(plugin->dl_handle, + "oh_add_el_entry", + (gpointer*)(&(*abi)->add_el_entry)); + g_module_symbol(plugin->dl_handle, + "oh_get_el_entry", + (gpointer*)(&(*abi)->get_el_entry)); + g_module_symbol(plugin->dl_handle, + "oh_clear_el", + (gpointer*)(&(*abi)->clear_el)); + g_module_symbol(plugin->dl_handle, + "oh_set_el_state", + (gpointer*)(&(*abi)->set_el_state)); + g_module_symbol(plugin->dl_handle, + "oh_reset_el_overflow", + (gpointer*)(&(*abi)->reset_el_overflow)); + g_module_symbol(plugin->dl_handle, + "oh_get_sensor_reading", + (gpointer*)(&(*abi)->get_sensor_reading)); + g_module_symbol(plugin->dl_handle, + "oh_get_sensor_thresholds", + (gpointer*)(&(*abi)->get_sensor_thresholds)); + g_module_symbol(plugin->dl_handle, + "oh_set_sensor_thresholds", + (gpointer*)(&(*abi)->set_sensor_thresholds)); + g_module_symbol(plugin->dl_handle, + "oh_get_sensor_enable", + (gpointer*)(&(*abi)->get_sensor_enable)); + g_module_symbol(plugin->dl_handle, + "oh_set_sensor_enable", + (gpointer*)(&(*abi)->set_sensor_enable)); + g_module_symbol(plugin->dl_handle, + "oh_get_sensor_event_enables", + (gpointer*)(&(*abi)->get_sensor_event_enables)); + g_module_symbol(plugin->dl_handle, + "oh_set_sensor_event_enables", + (gpointer*)(&(*abi)->set_sensor_event_enables)); + g_module_symbol(plugin->dl_handle, + "oh_get_sensor_event_masks", + (gpointer*)(&(*abi)->get_sensor_event_masks)); + g_module_symbol(plugin->dl_handle, + "oh_set_sensor_event_masks", + (gpointer*)(&(*abi)->set_sensor_event_masks)); + g_module_symbol(plugin->dl_handle, + "oh_get_control_state", + (gpointer*)(&(*abi)->get_control_state)); + g_module_symbol(plugin->dl_handle, + "oh_set_control_state", + (gpointer*)(&(*abi)->set_control_state)); + g_module_symbol(plugin->dl_handle, + "oh_get_idr_info", + (gpointer*)(&(*abi)->get_idr_info)); + g_module_symbol(plugin->dl_handle, + "oh_get_idr_area_header", + (gpointer*)(&(*abi)->get_idr_area_header)); + g_module_symbol(plugin->dl_handle, + "oh_add_idr_area", + (gpointer*)(&(*abi)->add_idr_area)); + g_module_symbol(plugin->dl_handle, + "oh_add_idr_area_id", + (gpointer*)(&(*abi)->add_idr_area_id)); + g_module_symbol(plugin->dl_handle, + "oh_del_idr_area", + (gpointer*)(&(*abi)->del_idr_area)); + g_module_symbol(plugin->dl_handle, + "oh_get_idr_field", + (gpointer*)(&(*abi)->get_idr_field)); + g_module_symbol(plugin->dl_handle, + "oh_add_idr_field", + (gpointer*)(&(*abi)->add_idr_field)); + g_module_symbol(plugin->dl_handle, + "oh_add_idr_field_id", + (gpointer*)(&(*abi)->add_idr_field_id)); + g_module_symbol(plugin->dl_handle, + "oh_set_idr_field", + (gpointer*)(&(*abi)->set_idr_field)); + g_module_symbol(plugin->dl_handle, + "oh_del_idr_field", + (gpointer*)(&(*abi)->del_idr_field)); + g_module_symbol(plugin->dl_handle, + "oh_get_watchdog_info", + (gpointer*)(&(*abi)->get_watchdog_info)); + g_module_symbol(plugin->dl_handle, + "oh_set_watchdog_info", + (gpointer*)(&(*abi)->set_watchdog_info)); + g_module_symbol(plugin->dl_handle, + "oh_reset_watchdog", + (gpointer*)(&(*abi)->reset_watchdog)); + g_module_symbol(plugin->dl_handle, + "oh_get_next_announce", + (gpointer*)(&(*abi)->get_next_announce)); + g_module_symbol(plugin->dl_handle, + "oh_get_announce", + (gpointer*)(&(*abi)->get_announce)); + g_module_symbol(plugin->dl_handle, + "oh_ack_announce", + (gpointer*)(&(*abi)->ack_announce)); + g_module_symbol(plugin->dl_handle, + "oh_add_announce", + (gpointer*)(&(*abi)->add_announce)); + g_module_symbol(plugin->dl_handle, + "oh_del_announce", + (gpointer*)(&(*abi)->del_announce)); + g_module_symbol(plugin->dl_handle, + "oh_get_annunc_mode", + (gpointer*)(&(*abi)->get_annunc_mode)); + g_module_symbol(plugin->dl_handle, + "oh_set_annunc_mode", + (gpointer*)(&(*abi)->set_annunc_mode)); + g_module_symbol(plugin->dl_handle, + "oh_get_dimi_info", + (gpointer*)(&(*abi)->get_dimi_info)); + g_module_symbol(plugin->dl_handle, + "oh_get_dimi_test", + (gpointer*)(&(*abi)->get_dimi_test)); + g_module_symbol(plugin->dl_handle, + "oh_get_dimi_test_ready", + (gpointer*)(&(*abi)->get_dimi_test_ready)); + g_module_symbol(plugin->dl_handle, + "oh_start_dimi_test", + (gpointer*)(&(*abi)->start_dimi_test)); + g_module_symbol(plugin->dl_handle, + "oh_cancel_dimi_test", + (gpointer*)(&(*abi)->cancel_dimi_test)); + g_module_symbol(plugin->dl_handle, + "oh_get_dimi_test_status", + (gpointer*)(&(*abi)->get_dimi_test_status)); + g_module_symbol(plugin->dl_handle, + "oh_get_dimi_test_results", + (gpointer*)(&(*abi)->get_dimi_test_results)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_spec", + (gpointer*)(&(*abi)->get_fumi_spec)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_service_impact", + (gpointer*)(&(*abi)->get_fumi_service_impact)); + g_module_symbol(plugin->dl_handle, + "oh_set_fumi_source", + (gpointer*)(&(*abi)->set_fumi_source)); + g_module_symbol(plugin->dl_handle, + "oh_validate_fumi_source", + (gpointer*)(&(*abi)->validate_fumi_source)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_source", + (gpointer*)(&(*abi)->get_fumi_source)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_source_component", + (gpointer*)(&(*abi)->get_fumi_source_component)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_target", + (gpointer*)(&(*abi)->get_fumi_target)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_target_component", + (gpointer*)(&(*abi)->get_fumi_target_component)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_logical_target", + (gpointer*)(&(*abi)->get_fumi_logical_target)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_logical_target_component", + (gpointer*)(&(*abi)->get_fumi_logical_target_component)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_backup", + (gpointer*)(&(*abi)->start_fumi_backup)); + g_module_symbol(plugin->dl_handle, + "oh_set_fumi_bank_order", + (gpointer*)(&(*abi)->set_fumi_bank_order)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_bank_copy", + (gpointer*)(&(*abi)->start_fumi_bank_copy)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_install", + (gpointer*)(&(*abi)->start_fumi_install)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_status", + (gpointer*)(&(*abi)->get_fumi_status)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_verify", + (gpointer*)(&(*abi)->start_fumi_verify)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_verify_main", + (gpointer*)(&(*abi)->start_fumi_verify_main)); + g_module_symbol(plugin->dl_handle, + "oh_cancel_fumi_upgrade", + (gpointer*)(&(*abi)->cancel_fumi_upgrade)); + g_module_symbol(plugin->dl_handle, + "oh_get_fumi_autorollback_disable", + (gpointer*)(&(*abi)->get_fumi_autorollback_disable)); + g_module_symbol(plugin->dl_handle, + "oh_set_fumi_autorollback_disable", + (gpointer*)(&(*abi)->set_fumi_autorollback_disable)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_rollback", + (gpointer*)(&(*abi)->start_fumi_rollback)); + g_module_symbol(plugin->dl_handle, + "oh_activate_fumi", + (gpointer*)(&(*abi)->activate_fumi)); + g_module_symbol(plugin->dl_handle, + "oh_start_fumi_activate", + (gpointer*)(&(*abi)->start_fumi_activate)); + g_module_symbol(plugin->dl_handle, + "oh_cleanup_fumi", + (gpointer*)(&(*abi)->cleanup_fumi)); + g_module_symbol(plugin->dl_handle, + "oh_hotswap_policy_cancel", + (gpointer*)(&(*abi)->hotswap_policy_cancel)); + g_module_symbol(plugin->dl_handle, + "oh_get_hotswap_state", + (gpointer*)(&(*abi)->get_hotswap_state)); + g_module_symbol(plugin->dl_handle, + "oh_set_autoinsert_timeout", + (gpointer*)(&(*abi)->set_autoinsert_timeout)); + g_module_symbol(plugin->dl_handle, + "oh_set_hotswap_state", + (gpointer*)(&(*abi)->set_hotswap_state)); + g_module_symbol(plugin->dl_handle, + "oh_request_hotswap_action", + (gpointer*)(&(*abi)->request_hotswap_action)); + g_module_symbol(plugin->dl_handle, + "oh_get_autoextract_timeout", + (gpointer*)(&(*abi)->get_autoextract_timeout)); + g_module_symbol(plugin->dl_handle, + "oh_set_autoextract_timeout", + (gpointer*)(&(*abi)->set_autoextract_timeout)); + g_module_symbol(plugin->dl_handle, + "oh_get_power_state", + (gpointer*)(&(*abi)->get_power_state)); + g_module_symbol(plugin->dl_handle, + "oh_set_power_state", + (gpointer*)(&(*abi)->set_power_state)); + g_module_symbol(plugin->dl_handle, + "oh_get_indicator_state", + (gpointer*)(&(*abi)->get_indicator_state)); + g_module_symbol(plugin->dl_handle, + "oh_set_indicator_state", + (gpointer*)(&(*abi)->set_indicator_state)); + g_module_symbol(plugin->dl_handle, + "oh_control_parm", + (gpointer*)(&(*abi)->control_parm)); + g_module_symbol(plugin->dl_handle, + "oh_load_id_get", + (gpointer*)(&(*abi)->load_id_get)); + g_module_symbol(plugin->dl_handle, + "oh_load_id_set", + (gpointer*)(&(*abi)->load_id_set)); + g_module_symbol(plugin->dl_handle, + "oh_get_reset_state", + (gpointer*)(&(*abi)->get_reset_state)); + g_module_symbol(plugin->dl_handle, + "oh_set_reset_state", + (gpointer*)(&(*abi)->set_reset_state)); + g_module_symbol(plugin->dl_handle, + "oh_inject_event", + (gpointer*)(&(*abi)->inject_event)); return 0; Modified: openhpi/trunk/openhpid/t/ohpi/Makefile.am =================================================================== --- openhpi/trunk/openhpid/t/ohpi/Makefile.am 2010-12-16 18:48:54 UTC (rev 7207) +++ openhpi/trunk/openhpid/t/ohpi/Makefile.am 2010-12-17 21:59:35 UTC (rev 7208) @@ -51,67 +51,89 @@ ohpi_007_SOURCES = ohpi_007.c ohpi_007_LDADD = $(TDEPLIB) +ohpi_007_LDFLAGS = -export-dynamic ohpi_008_SOURCES = ohpi_008.c ohpi_008_LDADD = $(TDEPLIB) +ohpi_008_LDFLAGS = -export-dynamic ohpi_009_SOURCES = ohpi_009.c ohpi_009_LDADD = $(TDEPLIB) +ohpi_009_LDFLAGS = -export-dynamic ohpi_010_SOURCES = ohpi_010.c ohpi_010_LDADD = $(TDEPLIB) +ohpi_010_LDFLAGS = -export-dynamic ohpi_024_SOURCES = ohpi_024.c ohpi_024_LDADD = $(TDEPLIB) +ohpi_024_LDFLAGS = -export-dynamic ohpi_025_SOURCES = ohpi_025.c ohpi_025_LDADD = $(TDEPLIB) +ohpi_025_LDFLAGS = -export-dynamic ohpi_026_SOURCES = ohpi_026.c ohpi_026_LDADD = $(TDEPLIB) +ohpi_026_LDFLAGS = -export-dynamic ohpi_027_SOURCES = ohpi_027.c ohpi_027_LDADD = $(TDEPLIB) +ohpi_027_LDFLAGS = -export-dynamic ohpi_028_SOURCES = ohpi_028.c ohpi_028_LDADD = $(TDEPLIB) +ohpi_028_LDFLAGS = -export-dynamic ohpi_029_SOURCES = ohpi_029.c ohpi_029_LDADD = $(TDEPLIB) +ohpi_029_LDFLAGS = -export-dynamic ohpi_030_SOURCES = ohpi_030.c ohpi_030_LDADD = $(TDEPLIB) +ohpi_030_LDFLAGS = -export-dynamic ohpi_031_SOURCES = ohpi_031.c ohpi_031_LDADD = $(TDEPLIB) +ohpi_031_LDFLAGS = -export-dynamic ohpi_032_SOURCES = ohpi_032.c ohpi_032_LDADD = $(TDEPLIB) +ohpi_032_LDFLAGS = -export-dynamic ohpi_033_SOURCES = ohpi_033.c ohpi_033_LDADD = $(TDEPLIB) +ohpi_033_LDFLAGS = -export-dynamic ohpi_034_SOURCES = ohpi_034.c ohpi_034_LDADD = $(TDEPLIB) +ohpi_034_LDFLAGS = -export-dynamic ohpi_035_SOURCES = ohpi_035.c ohpi_035_LDADD = $(TDEPLIB) +ohpi_035_LDFLAGS = -export-dynamic ohpi_036_SOURCES = ohpi_036.c ohpi_036_LDADD = $(TDEPLIB) +ohpi_036_LDFLAGS = -export-dynamic ohpi_037_SOURCES = ohpi_037.c ohpi_037_LDADD = $(TDEPLIB) +ohpi_037_LDFLAGS = -export-dynamic ohpi_038_SOURCES = ohpi_038.c ohpi_038_LDADD = $(TDEPLIB) +ohpi_038_LDFLAGS = -export-dynamic ohpi_039_SOURCES = ohpi_039.c ohpi_039_LDADD = $(TDEPLIB) +ohpi_039_LDFLAGS = -export-dynamic ohpi_version_SOURCES = ohpi_version.c ohpi_version_LDADD = $(TDEPLIB) +ohpi_version_LDFLAGS = -export-dynamic hpiinjector_SOURCES = hpiinjector.c hpiinjector_LDADD = $(TDEPLIB) +hpiinjector_LDFLAGS = -export-dynamic This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-17 22:43:00
|
Revision: 7209 http://openhpi.svn.sourceforge.net/openhpi/?rev=7209&view=rev Author: avpak Date: 2010-12-17 22:42:53 +0000 (Fri, 17 Dec 2010) Log Message: ----------- Feature request #3031797 Added Paths: ----------- openhpi/trunk/Makefile.mingw32 openhpi/trunk/Makefile.mingw32.def openhpi/trunk/README.windows openhpi/trunk/baselib/Makefile.mingw32 openhpi/trunk/clients/Makefile.mingw32 openhpi/trunk/marshal/Makefile.mingw32 openhpi/trunk/mingw32/ openhpi/trunk/mingw32/config.h openhpi/trunk/transport/Makefile.mingw32 openhpi/trunk/utils/Makefile.mingw32 Added: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 (rev 0) +++ openhpi/trunk/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,33 @@ +include Makefile.mingw32.def + +out := openhpi-${VERSION}-win32 +openhpi_libs := utils transport marshal baselib clients + +.PHONY: all clean $(openhpi_libs) + +all: $(openhpi_libs) + +$(openhpi_libs): + make -f Makefile.mingw32 -C $@ + +clean: + for d in $(openhpi_libs); \ + do \ + make -f Makefile.mingw32 -C $$d clean; \ + done + rm -rf ${out} + +out: + mkdir -p ${out} + cp README.windows ${out} + cat include/SaHpi.h | sed 's/ __attribute__.*/;/' > ${out}/SaHpi.h + cp utils/libopenhpiutils-${VERSION}.dll ${out}/ + cp utils/libopenhpiutils-${VERSION}.dll.a ${out}/ + cp utils/libopenhpiutils-${VERSION}.dll.def ${out}/ + cp transport/libopenhpitransport-${VERSION}.dll ${out}/ + cp marshal/libopenhpimarshal-${VERSION}.dll ${out}/ + cp baselib/libopenhpi-${VERSION}.dll ${out}/ + cp baselib/libopenhpi-${VERSION}.dll.a ${out}/ + cp baselib/libopenhpi-${VERSION}.dll.def ${out}/ + cp clients/*.exe ${out}/ + Added: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def (rev 0) +++ openhpi/trunk/Makefile.mingw32.def 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,21 @@ +VERSION := 2.17.0 + +############################################################################ +TOOLCHAIN_PATH := /home/avpak/environments/mingw32 + +CC := ${TOOLCHAIN_PATH}/bin/i386-mingw32-gcc +CXX := ${TOOLCHAIN_PATH}/bin/i386-mingw32-g++ + +GLIB_DIR := /home/avpak/environments/mingw32/i386-mingw32/glib-2.0 + +GLIB_INCLUDES := -I ${GLIB_DIR}/include/glib-2.0 -I ${GLIB_DIR}/lib/glib-2.0/include +GLIB_LIBS := -L ${GLIB_DIR}/lib -lglib-2.0 +GTHREAD_LIBS := -L ${GLIB_DIR}/lib -lgthread-2.0 +############################################################################ + +INCLUDES := -I ../include -I ../mingw32 + +CFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 ${INCLUDES} +CXXFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 ${INCLUDES} +LDFLAGS := -no-undefined --enable-runtime-pseudo-reloc + Added: openhpi/trunk/README.windows =================================================================== --- openhpi/trunk/README.windows (rev 0) +++ openhpi/trunk/README.windows 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,101 @@ +======================================================================== +OpenHPI provides windows version of +- Base HPI library (libopehpi-${VERSION}.dll) +- OpenHPI utils library (libopenhpiutils-${VERSION}.dll) +- OpenHPI marshal library (libopenhpimarshal-${VERSION}.dll) +- OpenHPI transport library (libopenhpitransport-${VERSION}.dll) +- OpenHPI clients: +-- hpialarms.exe +-- hpidomain.exe +-- hpiel.exe +-- hpievents.exe +-- hpifan.exe +-- hpigensimdata.exe +-- hpiinv.exe +-- hpionIBMblade.exe +-- hpipower.exe +-- hpireset.exe +-- hpisensor.exe +-- hpisettime.exe +-- hpithres.exe +-- hpitop.exe +-- hpitree.exe +-- hpiwdt.exe +-- ohdomainlist.exe +-- ohhandler.exe +-- ohparam.exe + +======================================================================== +Dependencies: + +The only dependence (save for mingw compiler) is glib2. +Windows version can be obtained at http://www.gtk.org/download-windows.html + +======================================================================== +Current windows build system supports only Mingw compiler. +http://www.mingw.org/ +However the built libraries can be use as ordinary windows DLL +in projects with any compiler. + +======================================================================== +The libraries' names are constructed in the following way: +lib + name + '-' + version + '.dll'. +I.e. libopenhpi-2.17.0.dll + +N.B. This naming schema can be changed in future releases. + +======================================================================== +Build instructions: + +- Get mingw (cross or native). +- Get archive with glib2 for windows and unpack it somewhere. +- Enter openhpi source tree root directory. +- Modify Makefile.mingw32.def: +-- TOOLCHAIN_PATH in order that CC and CXX point to C and C++ + compilers correspondingly. +-- GLIB_DIR: in order that GLIB_INCLUDES and GLIB_LIBS + point to valid directories with glib headers and libraries. +- run "make -f Makefile.mingw32". +- run "make -f Makefile.mingw32 bin". +- the bin subdirectory will contain all produced stuff. + +======================================================================== +Client Usage instructions: + +There are two ways: + +Way 1) prepare openhpiclient.conf and set env. var. OPENHPI_CLIENT_CONF +to its path + +Way 2) set env. var. OPENHPI_DAEMON_HOST to OpenHPI daemon address. + +======================================================================== +Library Usage instructions: + +Header file SaHpi.h contains declarations on provided functions. +The functions are in libopenhpi-${VERSION}.dll. + +Define "SAHPI_API" macro as "__declspec(dllexport)". + +For Mingw compiler it can be just linked. + +For MSVC: +- There is def file libopenhpi-${VERSION}.dll.def +- With lib tool you can create import library +- Command example "lib /machine:i386 /def:libopenhpi-${VERSION}.dll.def" + +And see Client Usage instrustions about configuring OpenHPI daemon address +to connect. + +======================================================================== +Troubleshouting: + +Mailing list: ope...@li... + +or + +IRC channel #openhpi on FreeNode. + + + Anton Pak + Added: openhpi/trunk/baselib/Makefile.mingw32 =================================================================== --- openhpi/trunk/baselib/Makefile.mingw32 (rev 0) +++ openhpi/trunk/baselib/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,34 @@ +include ../Makefile.mingw32.def + +TARGET := libopenhpi-${VERSION}.dll + +SRC := conf.c \ + init.cpp \ + lock.c \ + ohpi.cpp \ + safhpi.cpp \ + session.cpp + +OBJ := $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC})) + +INCLUDES := ${GLIB_INCLUDES} -I ../utils -I ../transport -I ../marshal +LIBS := ${GLIB_LIBS} ${GTHREAD_LIBS} +LIBS += -L ../utils -lopenhpiutils-${VERSION} +LIBS += -L ../transport -lopenhpitransport-${VERSION} +LIBS += -L ../marshal -lopenhpimarshal-${VERSION} + +CXXFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllexport)" +CFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllexport)" + +.PHONY: all clean + +all : ${TARGET} + +${TARGET} : ${OBJ} + ${CXX} -shared -o $@ $^ ${LIBS} \ + -Wl,--out-implib,$@.a \ + -Wl,--output-def,$@.def + +clean: + rm -f ${OBJ} ${TARGET} + Added: openhpi/trunk/clients/Makefile.mingw32 =================================================================== --- openhpi/trunk/clients/Makefile.mingw32 (rev 0) +++ openhpi/trunk/clients/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,42 @@ +include ../Makefile.mingw32.def + +TARGETS := hpialarms.exe \ + hpidomain.exe \ + hpiel.exe \ + hpievents.exe \ + hpifan.exe \ + hpigensimdata.exe \ + hpiinv.exe \ + hpionIBMblade.exe \ + hpipower.exe \ + hpireset.exe \ + hpisensor.exe \ + hpisettime.exe \ + hpithres.exe \ + hpitop.exe \ + hpitree.exe \ + hpiwdt.exe \ + ohdomainlist.exe \ + ohhandler.exe \ + ohparam.exe + +OBJS := $(patsubst %.exe, %.o, ${TARGETS}) clients.o + +INCLUDES := ${GLIB_INCLUDES} -I ../utils -I ../include +LIB_DIRS := ${GLIB_LIBS} -L ../baselib -L ../utils +LIB_DIRS += -L ../baselib -lopenhpi-${VERSION} +LIB_DIRS += -L ../utils -lopenhpiutils-${VERSION} + +CXXFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllimport)" +CFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllimport)" + +.PHONY: all clean + +all : ${TARGETS} + +%.exe : %.o clients.o + ${CXX} -o $@ $^ ${LIB_DIRS} + +clean: + rm -f ${OBJS} ${TARGETS} + Added: openhpi/trunk/marshal/Makefile.mingw32 =================================================================== --- openhpi/trunk/marshal/Makefile.mingw32 (rev 0) +++ openhpi/trunk/marshal/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,22 @@ +include ../Makefile.mingw32.def + +TARGET := libopenhpimarshal-${VERSION}.dll + +SRC := marshal.c \ + marshal_hpi.c \ + marshal_hpi_types.c + +OBJ := $(patsubst %.c, %.o, ${SRC}) + +CFLAGS += ${GLIB_INCLUDES} -I ../utils + +.PHONY: all clean + +all : ${TARGET} + +${TARGET} : ${OBJ} + ${CC} -shared -o $@ $^ ${GLIB_LIBS} + +clean: + rm -f ${OBJ} ${TARGET} + Added: openhpi/trunk/mingw32/config.h =================================================================== --- openhpi/trunk/mingw32/config.h (rev 0) +++ openhpi/trunk/mingw32/config.h 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,13 @@ +#ifndef __OPENHPI_CONFIG_H +#define __OPENHPI_CONFIG_H + + +#define OH_CLIENT_DEFAULT_CONF "" +#define OH_DEFAULT_CONF "" +#define OH_DEFAULT_UID_MAP "" +#define OH_PLUGIN_PATH "" +#define VARPATH "" + + +#endif /* __OPENHPI_CONFIG_H */ + Added: openhpi/trunk/transport/Makefile.mingw32 =================================================================== --- openhpi/trunk/transport/Makefile.mingw32 (rev 0) +++ openhpi/trunk/transport/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,20 @@ +include ../Makefile.mingw32.def + +TARGET := libopenhpitransport-${VERSION}.dll + +SRC := strmsock.cpp + +OBJ := $(patsubst %.cpp, %.o, ${SRC}) + +CXXFLAGS += ${GLIB_INCLUDES} + +.PHONY: all clean + +all : ${TARGET} + +${TARGET} : ${OBJ} + ${CXX} -shared -o $@ $^ -lws2_32 + +clean: + rm -f ${OBJ} ${TARGET} + Added: openhpi/trunk/utils/Makefile.mingw32 =================================================================== --- openhpi/trunk/utils/Makefile.mingw32 (rev 0) +++ openhpi/trunk/utils/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) @@ -0,0 +1,32 @@ +include ../Makefile.mingw32.def + +TARGET := libopenhpiutils-${VERSION}.dll + +SRC := announcement_utils.c \ + el_utils.c \ + epath_utils.c \ + rpt_utils.c \ + sahpi_enum_utils.c \ + sahpi_event_encode.c \ + sahpi_event_utils.c \ + sahpi_struct_utils.c \ + sahpi_time_utils.c \ + sahpiatca_enum_utils.c \ + sahpixtca_enum_utils.c \ + uid_utils.c +OBJ := $(patsubst %.c, %.o, ${SRC}) + +CFLAGS += ${GLIB_INCLUDES} -I . + +.PHONY: all clean + +all : ${TARGET} + +${TARGET} : ${OBJ} + ${CC} -shared -o $@ $^ ${GLIB_LIBS} \ + -Wl,--out-implib,$@.a \ + -Wl,--output-def,$@.def + +clean: + rm -f ${OBJ} ${TARGET} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-18 21:48:36
|
Revision: 7210 http://openhpi.svn.sourceforge.net/openhpi/?rev=7210&view=rev Author: avpak Date: 2010-12-18 21:48:30 +0000 (Sat, 18 Dec 2010) Log Message: ----------- More on feature request #3031797 Modified Paths: -------------- openhpi/trunk/Makefile.mingw32 openhpi/trunk/Makefile.mingw32.def openhpi/trunk/README.windows Added Paths: ----------- openhpi/trunk/openhpid/Makefile.mingw32 openhpi/trunk/openhpid/openhpid-win32.cpp Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2010-12-17 22:42:53 UTC (rev 7209) +++ openhpi/trunk/Makefile.mingw32 2010-12-18 21:48:30 UTC (rev 7210) @@ -1,7 +1,12 @@ include Makefile.mingw32.def out := openhpi-${VERSION}-win32 -openhpi_libs := utils transport marshal baselib clients +openhpi_libs := utils \ + transport \ + marshal \ + baselib \ + clients \ + openhpid .PHONY: all clean $(openhpi_libs) @@ -20,7 +25,7 @@ out: mkdir -p ${out} cp README.windows ${out} - cat include/SaHpi.h | sed 's/ __attribute__.*/;/' > ${out}/SaHpi.h + cat include/SaHpi.h | sed -e 's/ __attribute__.*/;/' -e 's/#define SAHPI_API/#define SAHPI_API __declspec(dllimport)/' > ${out}/SaHpi.h cp utils/libopenhpiutils-${VERSION}.dll ${out}/ cp utils/libopenhpiutils-${VERSION}.dll.a ${out}/ cp utils/libopenhpiutils-${VERSION}.dll.def ${out}/ Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2010-12-17 22:42:53 UTC (rev 7209) +++ openhpi/trunk/Makefile.mingw32.def 2010-12-18 21:48:30 UTC (rev 7210) @@ -1,12 +1,12 @@ VERSION := 2.17.0 ############################################################################ -TOOLCHAIN_PATH := /home/avpak/environments/mingw32 +TOOLCHAIN_PATH := /home/avpak/usr/cross/mingw32 CC := ${TOOLCHAIN_PATH}/bin/i386-mingw32-gcc CXX := ${TOOLCHAIN_PATH}/bin/i386-mingw32-g++ -GLIB_DIR := /home/avpak/environments/mingw32/i386-mingw32/glib-2.0 +GLIB_DIR := /home/avpak/usr/cross/mingw32/i386-mingw32/glib-2.0 GLIB_INCLUDES := -I ${GLIB_DIR}/include/glib-2.0 -I ${GLIB_DIR}/lib/glib-2.0/include GLIB_LIBS := -L ${GLIB_DIR}/lib -lglib-2.0 Modified: openhpi/trunk/README.windows =================================================================== --- openhpi/trunk/README.windows 2010-12-17 22:42:53 UTC (rev 7209) +++ openhpi/trunk/README.windows 2010-12-18 21:48:30 UTC (rev 7210) @@ -75,7 +75,7 @@ Header file SaHpi.h contains declarations on provided functions. The functions are in libopenhpi-${VERSION}.dll. -Define "SAHPI_API" macro as "__declspec(dllexport)". +Define "SAHPI_API" macro as "__declspec(dllimport)". For Mingw compiler it can be just linked. Added: openhpi/trunk/openhpid/Makefile.mingw32 =================================================================== --- openhpi/trunk/openhpid/Makefile.mingw32 (rev 0) +++ openhpi/trunk/openhpid/Makefile.mingw32 2010-12-18 21:48:30 UTC (rev 7210) @@ -0,0 +1,42 @@ +include ../Makefile.mingw32.def + +TARGET := openhpid.exe + +SRC := alarm.c \ + conf.c \ + domain.c \ + event.c \ + hotswap.c \ + init.c \ + lock.c \ + ohpi.c \ + plugin.c \ + plugin_static.c \ + safhpi.c \ + session.c \ + threaded.c \ + server.cpp \ + openhpid-win32.cpp + +OBJ := $(patsubst %.c, %.o,$(patsubst %.cpp, %.o, ${SRC} ) ) + +INCLUDES := ${GLIB_INCLUDES} -I ../utils -I ../transport -I ../marshal +LIB_DIRS := ${GLIB_LIBS} -L ../utils -L ../transport -L ../marshal + +CXXFLAGS += ${INCLUDES} +CFLAGS += ${INCLUDES} + +.PHONY: all clean + +all : ${TARGET} + +${TARGET} : ${OBJ} + ${CXX} -o $@ $^ ${LIB_DIRS} \ + -lglib-2.0 -lgthread-2.0 -lgmodule-2.0 \ + -lopenhpiutils-${VERSION} \ + -lopenhpitransport-${VERSION} \ + -lopenhpimarshal-${VERSION} + +clean: + rm -f ${OBJ} ${TARGET} + Added: openhpi/trunk/openhpid/openhpid-win32.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-win32.cpp (rev 0) +++ openhpi/trunk/openhpid/openhpid-win32.cpp 2010-12-18 21:48:30 UTC (rev 7210) @@ -0,0 +1,39 @@ +/* -*- linux-c -*- + * + * (C) Copyright Pigeon Point Systems. 2010 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + * + */ + +#include <stdio.h> + +#include <glib.h> + +#include <oHpi.h> + +#include <oh_init.h> + +#include "server.h" + + +/*--------------------------------------------------------------------*/ +/* Function: main */ +/*--------------------------------------------------------------------*/ + +int main(int argc, char *argv[]) +{ + // TODO implement + printf( "Hello World\n" ); + + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-18 22:25:41
|
Revision: 7211 http://openhpi.svn.sourceforge.net/openhpi/?rev=7211&view=rev Author: avpak Date: 2010-12-18 22:25:34 +0000 (Sat, 18 Dec 2010) Log Message: ----------- A part of feature request #3138629 Modified Paths: -------------- openhpi/trunk/baselib/conf.c openhpi/trunk/baselib/ohpi.cpp openhpi/trunk/baselib/safhpi.cpp openhpi/trunk/baselib/session.cpp openhpi/trunk/openhpid/ohpi.c openhpi/trunk/openhpid/safhpi.c Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2010-12-18 21:48:30 UTC (rev 7210) +++ openhpi/trunk/baselib/conf.c 2010-12-18 22:25:34 UTC (rev 7211) @@ -357,14 +357,12 @@ next_token = g_scanner_get_next_token(oh_scanner); if (next_token == HPI_CLIENT_CONF_TOKEN_DEFAULT) { did = OH_DEFAULT_DOMAIN_ID; - dbg("Processing domain: Found default domain definition"); } else if (next_token == G_TOKEN_INT) { if (oh_scanner->value.v_int == 0) { // Domain Id of 0 is invalid err("Processing domain: A domain id of 0 is invalid"); return -2; } did = (SaHpiDomainIdT)oh_scanner->value.v_int; - dbg("Processing domain: Found domain definition"); } else { err("Processing domain: Expected int or string ('default') token"); return -3; @@ -476,7 +474,6 @@ while (!done) { guint my_token; my_token = g_scanner_peek_next_token(oh_scanner); - /*dbg("token: %d", my_token);*/ switch (my_token) { case G_TOKEN_EOF: @@ -494,17 +491,11 @@ } } - if (fclose(fp) != 0) { - err("Couldn't close file '%s'.", filename); - g_scanner_destroy(oh_scanner); - return -4; - } + fclose(fp); done = oh_scanner->parse_errors; g_scanner_destroy(oh_scanner); - dbg("Done processing conf file.\nNumber of parse errors:%d", done); - return 0; } Modified: openhpi/trunk/baselib/ohpi.cpp =================================================================== --- openhpi/trunk/baselib/ohpi.cpp 2010-12-18 21:48:30 UTC (rev 7210) +++ openhpi/trunk/baselib/ohpi.cpp 2010-12-18 22:25:34 UTC (rev 7211) @@ -28,7 +28,6 @@ #include <oHpi.h> #include <config.h> #include <marshal_hpi.h> -#include <oh_error.h> #include <oh_rpc_params.h> #include "conf.h" Modified: openhpi/trunk/baselib/safhpi.cpp =================================================================== --- openhpi/trunk/baselib/safhpi.cpp 2010-12-18 21:48:30 UTC (rev 7210) +++ openhpi/trunk/baselib/safhpi.cpp 2010-12-18 22:25:34 UTC (rev 7211) @@ -27,7 +27,6 @@ #include <SaHpi.h> #include <marshal_hpi.h> #include <oh_domain.h> -#include <oh_error.h> #include <oh_rpc_params.h> #include "init.h" @@ -50,7 +49,6 @@ if (read_in->IsSupported == SAHPI_TRUE) { if (!oh_lookup_sensorreadingtype(read_in->Type)) { - //printf("Invalid reading type: %d\n", read_in->Type); return SA_ERR_HPI_INVALID_DATA; } read_out->Type = read_in->Type; @@ -1927,7 +1925,6 @@ if (EntryId == SAHPI_ENTRY_UNSPECIFIED) { if (!oh_lookup_severity(Severity)) { - printf("Bad severity %d passed in.\n", Severity); return SA_ERR_HPI_INVALID_PARAMS; } else { sev = Severity; Modified: openhpi/trunk/baselib/session.cpp =================================================================== --- openhpi/trunk/baselib/session.cpp 2010-12-18 21:48:30 UTC (rev 7210) +++ openhpi/trunk/baselib/session.cpp 2010-12-18 22:25:34 UTC (rev 7211) @@ -163,7 +163,6 @@ ohc_unlock(); if (!dc) { - err( "Session: cannot find domain %u config.\n", m_did ); return SA_ERR_HPI_INVALID_DOMAIN; } Modified: openhpi/trunk/openhpid/ohpi.c =================================================================== --- openhpi/trunk/openhpid/ohpi.c 2010-12-18 21:48:30 UTC (rev 7210) +++ openhpi/trunk/openhpid/ohpi.c 2010-12-18 22:25:34 UTC (rev 7211) @@ -176,7 +176,6 @@ h = oh_get_handler(id); if (!h) { - err("Handler %d not found.", id); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -282,7 +281,6 @@ hid = (unsigned int *)oh_get_resource_data(&d->rpt, rid); if (hid == NULL) { - err("No such Resource Id %d in Domain %d", rid, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_INVALID_RESOURCE; } @@ -367,7 +365,6 @@ if (sid == 0) return SA_ERR_HPI_INVALID_SESSION; if (!param || !param->Type) { - err("Invalid parameters. oHpiGlobalParamGet()"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -414,7 +411,6 @@ if (sid == 0) return SA_ERR_HPI_INVALID_SESSION; if (!param || !param->Type) { - err("Invalid parameters. oHpiGlobalParamSet()"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -477,23 +473,18 @@ SaErrorT error = SA_OK; if (sid == 0){ - err("Invalid session id %d passed",sid); return SA_ERR_HPI_INVALID_SESSION; } if (id == 0) { - err("Invalid handler id %d passed",id); return SA_ERR_HPI_INVALID_PARAMS; } if (!event) { - err("Invalid NULL event passed"); return SA_ERR_HPI_INVALID_PARAMS; } if (!rpte) { - err("Invalid NULL rpte passed"); return SA_ERR_HPI_INVALID_PARAMS; } if (!rdr) { - err("Invalid NULL rdr passed"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -515,9 +506,6 @@ } error = inject_event(h->hnd, event, rpte, rdr); - if (error) { - err("Event injection into handler %d failed", id); - } oh_release_handler(h); oh_release_domain(d); /* Unlock domain */ Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2010-12-18 21:48:30 UTC (rev 7210) +++ openhpi/trunk/openhpid/safhpi.c 2010-12-18 22:25:34 UTC (rev 7211) @@ -51,16 +51,12 @@ SaHpiDomainIdT did = DomainId; - dbg("saHpiSessionOpen DomainId [%d]", DomainId); - if (SessionId == NULL) { - err("Invalid Session Id pointer"); return SA_ERR_HPI_INVALID_PARAMS; } /* Security Params required to be NULL by the spec at this point */ if (SecurityParams != NULL) { - err("SecurityParams must be NULL"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -70,11 +66,9 @@ sid = oh_create_session(did); if(!sid) { - err("Domain %d does not exist or unable to create session!", did); return SA_ERR_HPI_INVALID_DOMAIN; } - dbg("Created session %d for domain %d", sid, did); *SessionId = sid; return SA_OK; @@ -234,7 +228,6 @@ /* if the entry was NULL, clearly have an issue */ if (req_entry == NULL) { - err("Invalid EntryId %d in Domain %d", EntryId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -283,7 +276,6 @@ */ if (req_entry == NULL) { - err("No such Resource Id %d in Domain %d", ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_INVALID_RESOURCE; } @@ -313,11 +305,9 @@ OH_CHECK_INIT_STATE(SessionId); if (ResourceId == SAHPI_UNSPECIFIED_RESOURCE_ID) { - err("Invalid resource id, SAHPI_UNSPECIFIED_RESOURCE_ID passed."); return SA_ERR_HPI_INVALID_PARAMS; } else if (!oh_lookup_severity(Severity) || Severity == SAHPI_ALL_SEVERITIES) { - err("Invalid severity %d passed.", Severity); return SA_ERR_HPI_INVALID_PARAMS; } @@ -335,8 +325,6 @@ if ((error = set_res_sev(h->hnd, ResourceId, Severity)) != SA_OK) { oh_release_handler(h); - err("Setting severity failed for ResourceId %d in Domain %d", - ResourceId, did); return error; } oh_release_handler(h); @@ -351,8 +339,6 @@ rptentry = oh_get_resource_by_id(&(d->rpt), ResourceId); if (!rptentry) { oh_release_domain(d); /* Unlock domain */ - err("Severity set failed: No Resource %d in Domain %d", - ResourceId, did); return SA_ERR_HPI_NOT_PRESENT; } rptentry->ResourceSeverity = Severity; @@ -393,8 +379,6 @@ rv = set_res_tag(h->hnd, ResourceId, ResourceTag); if (rv != SA_OK) { - err("Tag set failed for Resource %d in Domain %d", - ResourceId, did); oh_release_handler(h); return rv; } @@ -403,8 +387,6 @@ OH_GET_DOMAIN(did, d); /* Lock domain */ rptentry = oh_get_resource_by_id(&(d->rpt), ResourceId); if (!rptentry) { - err("Tag set failed: No Resource %d in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -435,8 +417,6 @@ ( ep_param.u.on_ep.Entry[0].EntityLocation == 0 ) ) { - err("Could not get entity we are running in." - "It is probably not set in openhpi.conf (OPENHPI_ON_EP)."); return SA_ERR_HPI_UNKNOWN; } @@ -466,8 +446,6 @@ rptentry = oh_get_resource_by_ep(&(d->rpt), &ep_param.u.on_ep); if (!rptentry) { oh_release_domain(d); /* Unlock domain */ - err("Could not get resource id we are running in." - "It is probably not set in openhpi.conf (OPENHPI_ON_EP)."); return SA_ERR_HPI_UNKNOWN; } @@ -754,7 +732,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -772,10 +749,6 @@ rv = get_func(h->hnd, ResourceId, Info); oh_release_handler(h); - if (rv != SA_OK) { - err("EL info get failed"); - } - return rv; } @@ -887,7 +860,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -898,7 +870,6 @@ get_el_entry = h ? h->abi->get_el_entry : NULL; if (!get_el_entry) { - err("This api is not supported"); oh_release_handler(h); return SA_ERR_HPI_INVALID_CMD; } @@ -909,9 +880,6 @@ Rdr, RptEntry); oh_release_handler(h); - if(rv != SA_OK) - err("EL entry get failed"); - return rv; } @@ -934,35 +902,27 @@ OH_CHECK_INIT_STATE(SessionId); if (EvtEntry == NULL) { - err("Error: Event Log Entry is NULL"); return SA_ERR_HPI_INVALID_PARAMS; } else if (EvtEntry->EventType != SAHPI_ET_USER) { - err("Error: Event Log Entry is not USER"); return SA_ERR_HPI_INVALID_PARAMS; } else if (EvtEntry->Source != SAHPI_UNSPECIFIED_RESOURCE_ID) { - err("Error: Event.Source not what it should be"); return SA_ERR_HPI_INVALID_PARAMS; } else if (EvtEntry->Severity == SAHPI_ALL_SEVERITIES) { - err("Error: SAHPI_ALL_SEVERITIES is not a valid here."); return SA_ERR_HPI_INVALID_PARAMS; } else if (!oh_lookup_severity(EvtEntry->Severity)) { - err("Error: Event Log Entry Severity is invalid"); return SA_ERR_HPI_INVALID_PARAMS; } else if (!oh_valid_textbuffer(&EvtEntry->EventDataUnion.UserEvent.UserEventData)) { - err("Error: Event Log UserData is invalid"); return SA_ERR_HPI_INVALID_PARAMS; } rv = saHpiEventLogInfoGet(SessionId, ResourceId, &info); if (rv != SA_OK) { - err("couldn't get loginfo"); return rv; } rv = saHpiEventLogCapabilitiesGet(SessionId, ResourceId, &caps); #if 0 if (rv != SA_OK) { - err("couldn't get log caps"); return rv; } if ((caps & SAHPI_EVTLOG_CAPABILITY_ENTRY_ADD) == 0) { @@ -977,11 +937,7 @@ } - if (EvtEntry->EventDataUnion.UserEvent.UserEventData.DataLength > - info.UserEventMaxSize) { - err("DataLength(%d) > info.UserEventMaxSize(%d)", - EvtEntry->EventDataUnion.UserEvent.UserEventData.DataLength, - info.UserEventMaxSize); + if (EvtEntry->EventDataUnion.UserEvent.UserEventData.DataLength > info.UserEventMaxSize) { return SA_ERR_HPI_INVALID_DATA; } @@ -1009,7 +965,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL.",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1025,7 +980,6 @@ } rv = add_el_entry(h->hnd, ResourceId, EvtEntry); - if (rv != SA_OK) err("EL add entry failed"); oh_release_handler(h); @@ -1059,7 +1013,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1067,7 +1020,6 @@ rv = saHpiEventLogCapabilitiesGet(SessionId, ResourceId, &caps); #if 0 if (rv != SA_OK) { - err("couldn't get log caps"); oh_release_domain(d); /* Unlock domain */ return rv; } @@ -1096,9 +1048,6 @@ rv = clear_el(h->hnd, ResourceId); oh_release_handler(h); - if(rv != SA_OK) { - err("EL delete entry failed"); - } return rv; } @@ -1155,7 +1104,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1164,7 +1112,6 @@ #if 0 if (rv != SA_OK) { oh_release_domain(d); /* Unlock domain */ - err("couldn't get log caps"); return rv; } if ((caps & SAHPI_EVTLOG_CAPABILITY_TIME_SET) == 0) { @@ -1181,7 +1128,6 @@ } if (Time == SAHPI_TIME_UNSPECIFIED) { - err("Time SAHPI_TIME_UNSPECIFIED"); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_INVALID_PARAMS; } @@ -1198,9 +1144,6 @@ rv = set_el_time(h->hnd, ResourceId, Time); oh_release_handler(h); - if (rv != SA_OK) { - err("Set EL time failed"); - } return rv; } @@ -1257,7 +1200,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1266,7 +1208,6 @@ #if 0 if (rv != SA_OK) { oh_release_domain(d); /* Unlock domain */ - err("couldn't get log caps"); return rv; } if ((caps & SAHPI_EVTLOG_CAPABILITY_STATE_SET) == 0) { @@ -1295,10 +1236,6 @@ rv = set_el_state(h->hnd, ResourceId, Enable); oh_release_handler(h); - if(rv != SA_OK) { - err("Set EL state failed Domain %d, Resource: %d", - did, ResourceId); - } return rv; } @@ -1329,7 +1266,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_EVENT_LOG)) { - err("Resource %d in Domain %d does not have EL",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1338,7 +1274,6 @@ #if 0 if (rv != SA_OK) { oh_release_domain(d); /* Unlock domain */ - err("couldn't get log caps"); return rv; } if ((caps & SAHPI_EVTLOG_CAPABILITY_OVERFLOW_RESET) == 0) { @@ -1366,9 +1301,6 @@ rv = reset_el_overflow(h->hnd, ResourceId); oh_release_handler(h); - if(rv != SA_OK) { - dbg("Reset EL Oveerflow not SA_OK"); - } return rv; @@ -1392,12 +1324,10 @@ error = oh_get_session_subscription(SessionId, &subscribed); if (error != SA_OK) { - err("Error subscribing to SessionId: %d", SessionId); return error; } if (subscribed) { - err("Cannot subscribe if session is not unsubscribed."); return SA_ERR_HPI_DUPLICATE; } @@ -1418,18 +1348,15 @@ error = oh_get_session_subscription(SessionId, &subscribed); if (error != SA_OK) { - err("Error reading session subscription from SessionId: %d", SessionId); return error; } if (!subscribed) { - err("Cannot unsubscribe if session is not subscribed."); return SA_ERR_HPI_INVALID_REQUEST; } error = oh_set_session_subscription(SessionId, SAHPI_FALSE); if (error != SA_OK) { - err("Error unsubscribing to SessionId: %d", SessionId); return error; } @@ -1455,11 +1382,9 @@ OH_GET_DID(SessionId, did); if (!Event) { - err("Event == NULL"); return SA_ERR_HPI_INVALID_PARAMS; } else if ((Timeout <= 0) && (Timeout != SAHPI_TIMEOUT_BLOCK) && (Timeout != SAHPI_TIMEOUT_IMMEDIATE)) { - err("Timeout is not positive"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -1467,12 +1392,10 @@ if (error != SA_OK) return error; if (!subscribed) { - err("session is not subscribed"); return SA_ERR_HPI_INVALID_REQUEST; } /* See if there is already an event in the queue */ - dbg("Getting event from session %d queue.", SessionId); error = oh_dequeue_session_event(SessionId, SAHPI_TIMEOUT_IMMEDIATE, &e, &qstatus1); @@ -1480,16 +1403,11 @@ if (error != SA_OK) { /* If queue empty then fetch more events */ oh_wake_event_thread(SAHPI_TRUE); /* Sent for more events. Ready to wait on queue. */ - dbg("Trying getting event again from session %d queue.", SessionId); error = oh_dequeue_session_event(SessionId, Timeout, &e, &qstatus2); if (error != SA_OK) { /* If no events after trying to fetch them, return error */ - if (error != SA_ERR_HPI_TIMEOUT) { - err("No events in session's %d queue: %s", - SessionId, oh_lookup_error(error)); - } return error; } } @@ -1526,7 +1444,6 @@ error = oh_valid_addevent(EvtEntry); if (error != SA_OK) { - err("event is not valid"); return error; } @@ -1535,15 +1452,11 @@ error = saHpiEventLogInfoGet(SessionId, SAHPI_UNSPECIFIED_RESOURCE_ID, &info); if (error != SA_OK) { - err("couldn't get loginfo"); return error; } if (EvtEntry->EventDataUnion.UserEvent.UserEventData.DataLength > info.UserEventMaxSize) { - err("DataLength(%d) > info.UserEventMaxSize(%d)", - EvtEntry->EventDataUnion.UserEvent.UserEventData.DataLength, - info.UserEventMaxSize); return SA_ERR_HPI_INVALID_DATA; } @@ -1807,7 +1720,6 @@ OH_RESOURCE_GET(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_RDR)) { - err("No RDRs for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1819,8 +1731,6 @@ } if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d], is not present", - did, ResourceId, EntryId); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -1867,7 +1777,6 @@ cap = res->ResourceCapabilities; if(!(cap & SAHPI_CAPABILITY_RDR)) { - err("No RDRs for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -1876,55 +1785,47 @@ switch(RdrType) { case SAHPI_CTRL_RDR: if(!(cap & SAHPI_CAPABILITY_CONTROL)) { - err("No Controls for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; case SAHPI_SENSOR_RDR: if(!(cap & SAHPI_CAPABILITY_SENSOR)) { - err("No Sensors for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; case SAHPI_INVENTORY_RDR: if(!(cap & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("No IDRs for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; case SAHPI_WATCHDOG_RDR: if(!(cap & SAHPI_CAPABILITY_WATCHDOG)) { - err("No Watchdogs for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; case SAHPI_ANNUNCIATOR_RDR: if(!(cap & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("No Annunciators for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; case SAHPI_DIMI_RDR: if(!(cap & SAHPI_CAPABILITY_DIMI)) { - dbg("No DIMI for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; case SAHPI_FUMI_RDR: if(!(cap & SAHPI_CAPABILITY_FUMI)) { - dbg("No FUMI for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } break; default: - err("Not a valid Rdr Type %d", RdrType); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_INVALID_PARAMS; } @@ -1933,8 +1834,6 @@ rdr_cur = oh_get_rdr_by_type(&(d->rpt), ResourceId, RdrType, InstrumentId); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, RdrType, InstrumentId); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -1965,7 +1864,6 @@ OH_RESOURCE_GET(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_RDR)) { - err("No RDRs for Resource %d in Domain %d",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2007,8 +1905,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d in Domain %d doesn't have sensors", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2016,8 +1912,6 @@ rdr = oh_get_rdr_by_type(&(d->rpt), ResourceId, SAHPI_SENSOR_RDR, SensorNum); if (!rdr) { - err("No Sensor %d found for ResourceId %d in Domain %d", - SensorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2076,8 +1970,6 @@ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { oh_release_domain(d); /* Unlock domain */ - err("Resource %d in Domain %d doesn't have sensors", - ResourceId, did); return SA_ERR_HPI_CAPABILITY; } @@ -2088,8 +1980,6 @@ if (rdr_cur == NULL) { oh_release_domain(d); /* Unlock domain */ - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); return SA_ERR_HPI_NOT_PRESENT; } @@ -2097,7 +1987,6 @@ if (thd->IsAccessible == SAHPI_FALSE || thd->ReadThold == 0) { oh_release_domain(d); /* Unlock domain */ - err("Sensor has no readable thresholds."); return SA_ERR_HPI_INVALID_CMD; } @@ -2140,7 +2029,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d in Domain %d doesn't have sensors",ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2148,15 +2036,12 @@ rdr = oh_get_rdr_by_type(&(d->rpt), ResourceId, SAHPI_SENSOR_RDR, SensorNum); if (!rdr) { - err("No Sensor %d found for ResourceId %d in Domain %d", - SensorNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } rv = oh_valid_thresholds(SensorThresholds, rdr); if (rv != SA_OK) { /* Invalid sensor threshold */ - err("Invalid sensor threshold."); oh_release_domain(d); return rv; } @@ -2167,8 +2052,6 @@ rv = saHpiSensorThresholdsGet( SessionId, ResourceId, SensorNum, &tmp ); if (rv != SA_OK) { - err("Can't get sensor thresholds. Sensor %d, ResourceId %d, Domain %d", - SensorNum, ResourceId, did); oh_release_domain(d); return rv; } @@ -2191,7 +2074,6 @@ rv = oh_valid_ordering(&tmp, rdr); if (rv != SA_OK) { /* Invalid sensor threshold */ - err("Invalid sensor threshold ordering."); oh_release_domain(d); return rv; } @@ -2231,8 +2113,6 @@ OH_RESOURCE_GET(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d in Domain %d doesn't have sensors", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2240,8 +2120,6 @@ rdr = oh_get_rdr_by_type(&(d->rpt), ResourceId, SAHPI_SENSOR_RDR, SensorNum); if (!rdr) { - err("No Sensor num %d found for Resource %d in Domain %d", - SensorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2284,8 +2162,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d doesn't have sensors in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2296,8 +2172,6 @@ SensorNum); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2339,8 +2213,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d doesn't have sensors in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2351,14 +2223,10 @@ SensorNum); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } if (!rdr_cur->RdrTypeUnion.SensorRec.EnableCtrl) { - err("Domain[%d]->Resource[%d]->Sensor[%d] - not EnableCtr", - did, ResourceId, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_READ_ONLY; } @@ -2406,8 +2274,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d doesn't have sensors in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2418,8 +2284,6 @@ SensorNum); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2462,8 +2326,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d doesn't have sensors in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2474,8 +2336,6 @@ SensorNum); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2529,8 +2389,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d doesn't have sensors in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2541,8 +2399,6 @@ SensorNum); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2594,8 +2450,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_SENSOR)) { - err("Resource %d doesn't have sensors in Domain %d", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2606,8 +2460,6 @@ SensorNum); if (rdr_cur == NULL) { - err("Requested RDR, Domain[%d]->Resource[%d]->RDR[%d,%d], is not present", - did, ResourceId, SAHPI_SENSOR_RDR, SensorNum); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -2685,8 +2537,6 @@ OH_RESOURCE_GET(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_CONTROL)) { - err("Resource %d in Domain %d doesn't have controls", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2729,8 +2579,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_CONTROL)) { - err("Resource %d in Domain %d doesn't have controls", - ResourceId, d->id); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2812,8 +2660,6 @@ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_CONTROL)) { oh_release_domain(d); /* Unlock domain */ - err("Resource %d in Domain %d doesn't have controls", - ResourceId, did); return SA_ERR_HPI_CAPABILITY; } @@ -2880,7 +2726,6 @@ SaErrorT (*set_func)(void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrInfoT *); if (IdrInfo == NULL) { - err("NULL IdrInfo"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -2891,8 +2736,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2908,12 +2751,10 @@ set_func = h ? h->abi->get_idr_info : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access IdrInfo from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, IdrInfo); oh_release_handler(h); @@ -2946,7 +2787,6 @@ (AreaId == SAHPI_LAST_ENTRY)|| (NextAreaId == NULL) || (Header == NULL))) { - err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -2957,8 +2797,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -2974,12 +2812,10 @@ set_func = h ? h->abi->get_idr_area_header : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access IdrAreaHeader from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, AreaType, AreaId, NextAreaId, Header); oh_release_handler(h); @@ -3004,10 +2840,8 @@ if (!oh_lookup_idrareatype(AreaType) || AreaId == NULL) { - err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } else if (AreaType == SAHPI_IDR_AREATYPE_UNSPECIFIED) { - err("AreaType == SAHPI_IDR_AREATYPE_UNSPECIFIED"); return SA_ERR_HPI_INVALID_DATA; } @@ -3018,8 +2852,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3035,12 +2867,10 @@ set_func = h ? h->abi->add_idr_area : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access IdrAreaAdd from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, AreaType, AreaId); oh_release_handler(h); @@ -3161,7 +2991,6 @@ SaErrorT (*set_func)(void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT); if (AreaId == SAHPI_LAST_ENTRY) { - err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -3172,8 +3001,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3189,12 +3016,10 @@ set_func = h ? h->abi->del_idr_area : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access IdrAreaDelete from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, AreaId); oh_release_handler(h); @@ -3226,7 +3051,6 @@ AreaId == SAHPI_LAST_ENTRY || FieldId == SAHPI_LAST_ENTRY || !NextFieldId) { - err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -3237,8 +3061,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3246,7 +3068,6 @@ rdr = oh_get_rdr_by_type(&(d->rpt), ResourceId, SAHPI_INVENTORY_RDR, IdrId); if (!rdr) { oh_release_domain(d); /* Unlock domain */ - err("Inventory RDR was not found."); return SA_ERR_HPI_NOT_PRESENT; } OH_HANDLER_GET(d, ResourceId, h); @@ -3255,12 +3076,10 @@ set_func = h ? h->abi->get_idr_field : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access saHpiIdrFieldGet from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, AreaId, FieldType, FieldId, NextFieldId, Field); oh_release_handler(h); @@ -3283,16 +3102,12 @@ SaErrorT (*set_func)(void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT * ); if (!Field) { - err("Invalid Parameter: Field is NULL "); return SA_ERR_HPI_INVALID_PARAMS; } else if (!oh_lookup_idrfieldtype(Field->Type)) { - err("Invalid Parameter in Field->Type"); return SA_ERR_HPI_INVALID_PARAMS; } else if (Field->Type == SAHPI_IDR_FIELDTYPE_UNSPECIFIED) { - err("Invalid unspecified type"); return SA_ERR_HPI_INVALID_PARAMS; } else if (oh_valid_textbuffer(&Field->Field) != SAHPI_TRUE) { - err("invalid text buffer"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -3303,8 +3118,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3312,7 +3125,6 @@ rdr = oh_get_rdr_by_type(&(d->rpt), ResourceId, SAHPI_INVENTORY_RDR, IdrId); if (!rdr) { oh_release_domain(d); /* Unlock domain */ - err("Could not find inventory rdr"); return SA_ERR_HPI_NOT_PRESENT; } OH_HANDLER_GET(d, ResourceId, h); @@ -3321,12 +3133,10 @@ set_func = h ? h->abi->add_idr_field : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access saHpiIdrFieldAdd from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, Field); oh_release_handler(h); @@ -3460,13 +3270,10 @@ SaErrorT (*set_func)(void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiIdrFieldT * ); if (!Field) { - err("Invalid Parameter: Field is NULL "); return SA_ERR_HPI_INVALID_PARAMS; } else if (Field->Type > SAHPI_IDR_FIELDTYPE_CUSTOM) { - err("Invalid Parameters in Field->Type"); return SA_ERR_HPI_INVALID_PARAMS; } else if (!oh_valid_textbuffer(&Field->Field)) { - err("Invalid Text Buffer in field."); return SA_ERR_HPI_INVALID_PARAMS; } @@ -3477,8 +3284,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3494,12 +3299,10 @@ set_func = h ? h->abi->set_idr_field : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access saHpiIdrFieldSet from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, Field); oh_release_handler(h); @@ -3522,7 +3325,6 @@ SaErrorT (*set_func)(void *, SaHpiResourceIdT, SaHpiIdrIdT, SaHpiEntryIdT, SaHpiEntryIdT ); if (FieldId == SAHPI_LAST_ENTRY || AreaId == SAHPI_LAST_ENTRY) { - err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -3533,8 +3335,6 @@ /* Interface and conformance checking */ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)) { - err("Resource %d in Domain %d doesn't have inventory data", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3550,12 +3350,10 @@ set_func = h ? h->abi->del_idr_field : NULL; if (!set_func) { oh_release_handler(h); - err("Plugin does not have this function in jump table."); return SA_ERR_HPI_INVALID_CMD; } /* Access Inventory Info from plugin */ - dbg("Access saHpiIdrFieldDelete from plugin."); rv = set_func(h->hnd, ResourceId, IdrId, AreaId, FieldId); oh_release_handler(h); @@ -3591,8 +3389,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_WATCHDOG)) { - err("Resource %d in Domain %d doesn't have watchdog", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3642,8 +3438,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_WATCHDOG)) { - err("Resource %d in Domain %d doesn't have watchdog", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3681,8 +3475,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_WATCHDOG)) { - err("Resource %d in Domain %d doesn't have watchdog", - ResourceId,did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3737,8 +3529,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3749,8 +3539,6 @@ AnnunciatorNum); if (!rdr) { - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -3801,8 +3589,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3813,8 +3599,6 @@ AnnunciatorNum); if (!rdr) { - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -3863,8 +3647,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3875,8 +3657,6 @@ AnnunciatorNum); if (!rdr) { - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -3930,8 +3710,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -3942,8 +3720,6 @@ AnnunciatorNum); if (!rdr) { - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -3996,7 +3772,6 @@ struct oh_domain *d = NULL; if ((EntryId == SAHPI_ENTRY_UNSPECIFIED) && !oh_lookup_severity(Severity)) { - err("Bad Severity %d passed in.", Severity); return SA_ERR_HPI_INVALID_PARAMS; } @@ -4007,8 +3782,6 @@ if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { oh_release_domain(d); /* Unlock domain */ - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); return SA_ERR_HPI_CAPABILITY; } @@ -4019,8 +3792,6 @@ if (!rdr) { oh_release_domain(d); /* Unlock domain */ - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); return SA_ERR_HPI_NOT_PRESENT; } @@ -4078,8 +3849,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -4090,8 +3859,6 @@ AnnunciatorNum); if (!rdr) { - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } @@ -4129,7 +3896,6 @@ /* if no valid mode, then this won't find a lookup */ if (!oh_lookup_annunciatormode(Mode)) { - err("Invalid Annunciator Mode"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -4139,8 +3905,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, res); if(!(res->ResourceCapabilities & SAHPI_CAPABILITY_ANNUNCIATOR)) { - err("Resource %d in Domain %d doesn't have annunciators", - ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_CAPABILITY; } @@ -4151,14 +3915,11 @@ AnnunciatorNum); if (!rdr) { - err("No Annunciator num %d found for Resource %d in Domain %d", - AnnunciatorNum, ResourceId, did); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_NOT_PRESENT; } if (rdr->RdrTypeUnion.AnnunciatorRec.ModeReadOnly) { - err("Can't set mode on a Read Only Annunciator"); oh_release_domain(d); /* Unlock domain */ return SA_ERR_HPI_READ_ONLY; } @@ -4209,8 +3970,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if(!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4221,8 +3980,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4260,8 +4017,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if(!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4272,8 +4027,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4311,8 +4064,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4323,8 +4074,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4364,8 +4113,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4376,8 +4123,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4412,8 +4157,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4424,8 +4167,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4465,8 +4206,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4477,8 +4216,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4517,8 +4254,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_DIMI)) { - err("Resource %d in Domain %d doesn't does not support DIMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4529,8 +4264,6 @@ DimiNum); if (!rdr) { - err("No DIMI num %d found for Resource %d in Domain %d", - DimiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4574,8 +4307,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_FUMI)) { - err("Resource %d in Domain %d doesn't does not support FUMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4586,8 +4317,6 @@ FumiNum); if (!rdr) { - err("No FUMI num %d found for Resource %d in Domain %d", - FumiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4625,8 +4354,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_FUMI)) { - err("Resource %d in Domain %d doesn't does not support FUMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4637,8 +4364,6 @@ FumiNum); if (!rdr) { - err("No FUMI num %d found for Resource %d in Domain %d", - FumiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4680,8 +4405,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_FUMI)) { - err("Resource %d in Domain %d doesn't does not support FUMIs", - ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_CAPABILITY; } @@ -4692,8 +4415,6 @@ FumiNum); if (!rdr) { - err("No FUMI num %d found for Resource %d in Domain %d", - FumiNum, ResourceId, did); oh_release_domain(d); return SA_ERR_HPI_NOT_PRESENT; } @@ -4728,8 +4449,6 @@ OH_RESOURCE_GET_CHECK(d, ResourceId, rpte); if (!(rpte->ResourceCapabilities & SAHPI_CAPABILITY_FUMI)) { - err("Resource %d in Domain %d doesn't does not support FUMIs", - ResourceId, did); oh_re... [truncated message content] |
From: <av...@us...> - 2010-12-19 12:20:40
|
Revision: 7212 http://openhpi.svn.sourceforge.net/openhpi/?rev=7212&view=rev Author: avpak Date: 2010-12-19 12:20:33 +0000 (Sun, 19 Dec 2010) Log Message: ----------- More on feature request #3031797 Add windows build files to "make dist" target Modified Paths: -------------- openhpi/trunk/Makefile.am openhpi/trunk/Makefile.mingw32 openhpi/trunk/baselib/Makefile.am openhpi/trunk/clients/Makefile.am openhpi/trunk/marshal/Makefile.am openhpi/trunk/openhpid/Makefile.am openhpi/trunk/transport/Makefile.am openhpi/trunk/utils/Makefile.am Modified: openhpi/trunk/Makefile.am =================================================================== --- openhpi/trunk/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -44,6 +44,10 @@ simulation.data.example \ openhpiclient.conf.example \ README.daemon \ + README.windows \ + Makefile.mingw32 \ + Makefile.mingw32.def \ + mingw32/config.h \ $(shell find $(srcdir)/include -name '*.h') AUTOMAKE_OPTIONS = foreign Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/Makefile.mingw32 2010-12-19 12:20:33 UTC (rev 7212) @@ -5,8 +5,8 @@ transport \ marshal \ baselib \ - clients \ - openhpid + clients +# openhpid .PHONY: all clean $(openhpi_libs) Modified: openhpi/trunk/baselib/Makefile.am =================================================================== --- openhpi/trunk/baselib/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/baselib/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -21,11 +21,20 @@ @OPENHPI_INCLUDES@ -I$(top_srcdir)/transport -I$(top_srcdir)/marshal @OH_SSL_INCLUDES@ EXTRA_DIST = \ - conf.h init.h lock.h session.h + Makefile.mingw32 \ + conf.h \ + init.h \ + lock.h \ + session.h lib_LTLIBRARIES = libopenhpi.la -libopenhpi_la_SOURCES = conf.c init.cpp lock.c ohpi.cpp safhpi.cpp session.cpp +libopenhpi_la_SOURCES = conf.c \ + init.cpp \ + lock.c \ + ohpi.cpp \ + safhpi.cpp \ + session.cpp libopenhpi_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ Modified: openhpi/trunk/clients/Makefile.am =================================================================== --- openhpi/trunk/clients/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/clients/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -3,7 +3,7 @@ INCLUDES = @OPENHPI_INCLUDES@ -EXTRA_DIST = oh_clients.h +EXTRA_DIST = Makefile.mingw32 oh_clients.h COMMONLIBS = @STATIC_PLUGIN_LIBS@ @STATIC_PLUGIN_EXTRA_LIBS@ Modified: openhpi/trunk/marshal/Makefile.am =================================================================== --- openhpi/trunk/marshal/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/marshal/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -19,6 +19,8 @@ MAINTAINERCLEANFILES = Makefile.in *~ +EXTRA_DIST = Makefile.mingw32 + INCLUDES = @OPENHPI_INCLUDES@ # just to clear LIBS LIBS = Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -24,7 +24,7 @@ DIST_SUBDIRS = t EXTRA_DIST = \ - openhpid.sh.in server.h + Makefile.mingw32 openhpid.sh.in server.h # daemon library noinst_LTLIBRARIES = libopenhpidaemon.la Modified: openhpi/trunk/transport/Makefile.am =================================================================== --- openhpi/trunk/transport/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/transport/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -16,6 +16,8 @@ MAINTAINERCLEANFILES = Makefile.in *~ +EXTRA_DIST = Makefile.mingw32 + INCLUDES = @OPENHPI_INCLUDES@ # just to clear LIBS LIBS = Modified: openhpi/trunk/utils/Makefile.am =================================================================== --- openhpi/trunk/utils/Makefile.am 2010-12-18 22:25:34 UTC (rev 7211) +++ openhpi/trunk/utils/Makefile.am 2010-12-19 12:20:33 UTC (rev 7212) @@ -46,6 +46,7 @@ GENERATED_FILES = $(GENERATED_HEADER_FILES) $(GENERATED_SRC_FILES) EXTRA_DIST = \ + Makefile.mingw32 \ $(GENERATED_HEADER_FILES) \ announcement_utils.h \ el_utils.h \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-19 14:02:31
|
Revision: 7213 http://openhpi.svn.sourceforge.net/openhpi/?rev=7213&view=rev Author: avpak Date: 2010-12-19 14:02:25 +0000 (Sun, 19 Dec 2010) Log Message: ----------- More on feature request #3129960 Moved OH_DEFAULT_DOMAIN_ID from oh_domain.h to oHpi.h Modified Paths: -------------- openhpi/trunk/baselib/safhpi.cpp openhpi/trunk/include/oHpi.h openhpi/trunk/include/oh_domain.h openhpi/trunk/openhpid/domain.c openhpi/trunk/openhpid/event.c openhpi/trunk/openhpid/init.c openhpi/trunk/openhpid/session.c Modified: openhpi/trunk/baselib/safhpi.cpp =================================================================== --- openhpi/trunk/baselib/safhpi.cpp 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/baselib/safhpi.cpp 2010-12-19 14:02:25 UTC (rev 7213) @@ -25,8 +25,9 @@ #include <glib.h> #include <SaHpi.h> +#include <oHpi.h> + #include <marshal_hpi.h> -#include <oh_domain.h> #include <oh_rpc_params.h> #include "init.h" Modified: openhpi/trunk/include/oHpi.h =================================================================== --- openhpi/trunk/include/oHpi.h 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/include/oHpi.h 2010-12-19 14:02:25 UTC (rev 7213) @@ -26,6 +26,8 @@ #include <glib.h> #include <oh_utils.h> +#define OH_DEFAULT_DOMAIN_ID 0 + #define OPENHPI_DEFAULT_DAEMON_PORT 4743 #define MAX_PLUGIN_NAME_LENGTH 32 Modified: openhpi/trunk/include/oh_domain.h =================================================================== --- openhpi/trunk/include/oh_domain.h 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/include/oh_domain.h 2010-12-19 14:02:25 UTC (rev 7213) @@ -17,8 +17,6 @@ #ifndef __OH_DOMAIN_H #define __OH_DOMAIN_H -#define OH_DEFAULT_DOMAIN_ID 0 - #include <SaHpi.h> #include <glib.h> #include <oh_utils.h> Modified: openhpi/trunk/openhpid/domain.c =================================================================== --- openhpi/trunk/openhpid/domain.c 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/openhpid/domain.c 2010-12-19 14:02:25 UTC (rev 7213) @@ -17,6 +17,8 @@ #include <stdio.h> #include <string.h> +#include <oHpi.h> + #include <oh_alarm.h> #include <oh_config.h> #include <oh_domain.h> Modified: openhpi/trunk/openhpid/event.c =================================================================== --- openhpi/trunk/openhpid/event.c 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/openhpid/event.c 2010-12-19 14:02:25 UTC (rev 7213) @@ -22,6 +22,8 @@ #include <string.h> +#include <oHpi.h> + #include <oh_event.h> #include <oh_config.h> #include <oh_handler.h> Modified: openhpi/trunk/openhpid/init.c =================================================================== --- openhpi/trunk/openhpid/init.c 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/openhpid/init.c 2010-12-19 14:02:25 UTC (rev 7213) @@ -17,6 +17,8 @@ #include <glib.h> +#include <oHpi.h> + #include <config.h> #include <oh_config.h> #include <oh_domain.h> Modified: openhpi/trunk/openhpid/session.c =================================================================== --- openhpi/trunk/openhpid/session.c 2010-12-19 12:20:33 UTC (rev 7212) +++ openhpi/trunk/openhpid/session.c 2010-12-19 14:02:25 UTC (rev 7213) @@ -15,12 +15,15 @@ */ #include <string.h> -#include <oh_utils.h> + +#include <oHpi.h> + +#include <oh_config.h> +#include <oh_domain.h> #include <oh_error.h> #include <oh_lock.h> #include <oh_session.h> -#include <oh_domain.h> -#include <oh_config.h> +#include <oh_utils.h> struct oh_session_table oh_sessions = { .table = NULL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-19 17:23:03
|
Revision: 7214 http://openhpi.svn.sourceforge.net/openhpi/?rev=7214&view=rev Author: avpak Date: 2010-12-19 16:56:15 +0000 (Sun, 19 Dec 2010) Log Message: ----------- Feature request #3139353 Modified Paths: -------------- openhpi/trunk/Makefile.mingw32.def openhpi/trunk/plugins/slave/Makefile.am openhpi/trunk/plugins/slave/baselib.cpp openhpi/trunk/plugins/slave/baselib.h openhpi/trunk/plugins/slave/slave.cpp Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2010-12-19 14:02:25 UTC (rev 7213) +++ openhpi/trunk/Makefile.mingw32.def 2010-12-19 16:56:15 UTC (rev 7214) @@ -11,6 +11,7 @@ GLIB_INCLUDES := -I ${GLIB_DIR}/include/glib-2.0 -I ${GLIB_DIR}/lib/glib-2.0/include GLIB_LIBS := -L ${GLIB_DIR}/lib -lglib-2.0 GTHREAD_LIBS := -L ${GLIB_DIR}/lib -lgthread-2.0 +GMODULE_LIBS := -L ${GLIB_DIR}/lib -lgmodule-2.0 ############################################################################ INCLUDES := -I ../include -I ../mingw32 Modified: openhpi/trunk/plugins/slave/Makefile.am =================================================================== --- openhpi/trunk/plugins/slave/Makefile.am 2010-12-19 14:02:25 UTC (rev 7213) +++ openhpi/trunk/plugins/slave/Makefile.am 2010-12-19 16:56:15 UTC (rev 7214) @@ -27,9 +27,9 @@ resourcemap.cpp \ resourcemap.h \ slave.cpp \ + slave.h \ util.cpp \ util.h -libslave_la_LIBADD = -ldl -libslave_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ +libslave_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ @GMODULE_ONLY_LIBS@ Modified: openhpi/trunk/plugins/slave/baselib.cpp =================================================================== --- openhpi/trunk/plugins/slave/baselib.cpp 2010-12-19 14:02:25 UTC (rev 7213) +++ openhpi/trunk/plugins/slave/baselib.cpp 2010-12-19 16:56:15 UTC (rev 7214) @@ -13,11 +13,12 @@ * Anton Pak <ant...@pi...> */ -#include <dlfcn.h> #include <string.h> #include <string> +#include <glib.h> + #include <oh_error.h> #include "baselib.h" @@ -32,7 +33,6 @@ cBaseLib::cBaseLib() : m_handle( 0 ) { - // empty memset( &m_abi, 0, sizeof(m_abi) ); } @@ -40,28 +40,29 @@ { if ( m_handle ) { m_abi.saHpiFinalize(); - dlclose( m_handle ); + g_module_close( m_handle ); } } -template <typename F> -void GetF( void * handle, const char * name, F& f, std::string& error ) +void GetF( GModule * handle, const char * name, gpointer * pf, std::string& error ) { - dlerror(); - f = 0; - void * ptr = dlsym( handle, name ); - const char * dlerr = dlerror(); - if ( dlerr ) { - error += dlerr; + gboolean rc = g_module_symbol( handle, name, pf ); + if ( rc == FALSE ) { + *pf = 0; + error += g_module_error(); error.push_back( '\n' ); } - f = reinterpret_cast<F>(ptr); } bool cBaseLib::LoadBaseLib() { - m_handle = dlopen( "libopenhpi.so", RTLD_NOW | RTLD_LOCAL ); + if ( g_module_supported() == FALSE ) { + err( "ERROR. GModule is not supported. Cannot load base lib." ); + return false; + } + + m_handle = g_module_open( "libopenhpi", G_MODULE_BIND_LOCAL ); if ( !m_handle ) { return false; } @@ -70,500 +71,500 @@ GetF( m_handle, "saHpiVersionGet", - m_abi.saHpiVersionGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiVersionGet ), error ); GetF( m_handle, "saHpiInitialize", - m_abi.saHpiInitialize, + reinterpret_cast<gpointer *>( &m_abi.saHpiInitialize ), error ); GetF( m_handle, "saHpiFinalize", - m_abi.saHpiFinalize, + reinterpret_cast<gpointer *>( &m_abi.saHpiFinalize ), error ); GetF( m_handle, "saHpiSessionOpen", - m_abi.saHpiSessionOpen, + reinterpret_cast<gpointer *>( &m_abi.saHpiSessionOpen ), error ); GetF( m_handle, "saHpiSessionClose", - m_abi.saHpiSessionClose, + reinterpret_cast<gpointer *>( &m_abi.saHpiSessionClose ), error ); GetF( m_handle, "saHpiDiscover", - m_abi.saHpiDiscover, + reinterpret_cast<gpointer *>( &m_abi.saHpiDiscover ), error ); GetF( m_handle, "saHpiDomainInfoGet", - m_abi.saHpiDomainInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDomainInfoGet ), error ); GetF( m_handle, "saHpiDrtEntryGet", - m_abi.saHpiDrtEntryGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDrtEntryGet ), error ); GetF( m_handle, "saHpiDomainTagSet", - m_abi.saHpiDomainTagSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDomainTagSet ), error ); GetF( m_handle, "saHpiRptEntryGet", - m_abi.saHpiRptEntryGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiRptEntryGet ), error ); GetF( m_handle, "saHpiRptEntryGetByResourceId", - m_abi.saHpiRptEntryGetByResourceId, + reinterpret_cast<gpointer *>( &m_abi.saHpiRptEntryGetByResourceId ), error ); GetF( m_handle, "saHpiResourceSeveritySet", - m_abi.saHpiResourceSeveritySet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceSeveritySet ), error ); GetF( m_handle, "saHpiResourceTagSet", - m_abi.saHpiResourceTagSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceTagSet ), error ); GetF( m_handle, "saHpiMyEntityPathGet", - m_abi.saHpiMyEntityPathGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiMyEntityPathGet ), error ); GetF( m_handle, "saHpiResourceIdGet", - m_abi.saHpiResourceIdGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceIdGet ), error ); GetF( m_handle, "saHpiGetIdByEntityPath", - m_abi.saHpiGetIdByEntityPath, + reinterpret_cast<gpointer *>( &m_abi.saHpiGetIdByEntityPath ), error ); GetF( m_handle, "saHpiGetChildEntityPath", - m_abi.saHpiGetChildEntityPath, + reinterpret_cast<gpointer *>( &m_abi.saHpiGetChildEntityPath ), error ); GetF( m_handle, "saHpiResourceFailedRemove", - m_abi.saHpiResourceFailedRemove, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceFailedRemove ), error ); GetF( m_handle, "saHpiEventLogInfoGet", - m_abi.saHpiEventLogInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogInfoGet ), error ); GetF( m_handle, "saHpiEventLogCapabilitiesGet", - m_abi.saHpiEventLogCapabilitiesGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogCapabilitiesGet ), error ); GetF( m_handle, "saHpiEventLogEntryGet", - m_abi.saHpiEventLogEntryGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogEntryGet ), error ); GetF( m_handle, "saHpiEventLogEntryAdd", - m_abi.saHpiEventLogEntryAdd, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogEntryAdd ), error ); GetF( m_handle, "saHpiEventLogClear", - m_abi.saHpiEventLogClear, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogClear ), error ); GetF( m_handle, "saHpiEventLogTimeGet", - m_abi.saHpiEventLogTimeGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogTimeGet ), error ); GetF( m_handle, "saHpiEventLogTimeSet", - m_abi.saHpiEventLogTimeSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogTimeSet ), error ); GetF( m_handle, "saHpiEventLogStateGet", - m_abi.saHpiEventLogStateGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogStateGet ), error ); GetF( m_handle, "saHpiEventLogStateSet", - m_abi.saHpiEventLogStateSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogStateSet ), error ); GetF( m_handle, "saHpiEventLogOverflowReset", - m_abi.saHpiEventLogOverflowReset, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogOverflowReset ), error ); GetF( m_handle, "saHpiSubscribe", - m_abi.saHpiSubscribe, + reinterpret_cast<gpointer *>( &m_abi.saHpiSubscribe ), error ); GetF( m_handle, "saHpiUnsubscribe", - m_abi.saHpiUnsubscribe, + reinterpret_cast<gpointer *>( &m_abi.saHpiUnsubscribe ), error ); GetF( m_handle, "saHpiEventGet", - m_abi.saHpiEventGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventGet ), error ); GetF( m_handle, "saHpiEventAdd", - m_abi.saHpiEventAdd, + reinterpret_cast<gpointer *>( &m_abi.saHpiEventAdd ), error ); GetF( m_handle, "saHpiAlarmGetNext", - m_abi.saHpiAlarmGetNext, + reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmGetNext ), error ); GetF( m_handle, "saHpiAlarmGet", - m_abi.saHpiAlarmGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmGet ), error ); GetF( m_handle, "saHpiAlarmAcknowledge", - m_abi.saHpiAlarmAcknowledge, + reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmAcknowledge ), error ); GetF( m_handle, "saHpiAlarmAdd", - m_abi.saHpiAlarmAdd, + reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmAdd ), error ); GetF( m_handle, "saHpiAlarmDelete", - m_abi.saHpiAlarmDelete, + reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmDelete ), error ); GetF( m_handle, "saHpiRdrGet", - m_abi.saHpiRdrGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiRdrGet ), error ); GetF( m_handle, "saHpiRdrGetByInstrumentId", - m_abi.saHpiRdrGetByInstrumentId, + reinterpret_cast<gpointer *>( &m_abi.saHpiRdrGetByInstrumentId ), error ); GetF( m_handle, "saHpiRdrUpdateCountGet", - m_abi.saHpiRdrUpdateCountGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiRdrUpdateCountGet ), error ); GetF( m_handle, "saHpiSensorReadingGet", - m_abi.saHpiSensorReadingGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorReadingGet ), error ); GetF( m_handle, "saHpiSensorThresholdsGet", - m_abi.saHpiSensorThresholdsGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorThresholdsGet ), error ); GetF( m_handle, "saHpiSensorThresholdsSet", - m_abi.saHpiSensorThresholdsSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorThresholdsSet ), error ); GetF( m_handle, "saHpiSensorTypeGet", - m_abi.saHpiSensorTypeGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorTypeGet ), error ); GetF( m_handle, "saHpiSensorEnableGet", - m_abi.saHpiSensorEnableGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEnableGet ), error ); GetF( m_handle, "saHpiSensorEnableSet", - m_abi.saHpiSensorEnableSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEnableSet ), error ); GetF( m_handle, "saHpiSensorEventEnableGet", - m_abi.saHpiSensorEventEnableGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventEnableGet ), error ); GetF( m_handle, "saHpiSensorEventEnableSet", - m_abi.saHpiSensorEventEnableSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventEnableSet ), error ); GetF( m_handle, "saHpiSensorEventMasksGet", - m_abi.saHpiSensorEventMasksGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventMasksGet ), error ); GetF( m_handle, "saHpiSensorEventMasksSet", - m_abi.saHpiSensorEventMasksSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventMasksSet ), error ); GetF( m_handle, "saHpiControlTypeGet", - m_abi.saHpiControlTypeGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiControlTypeGet ), error ); GetF( m_handle, "saHpiControlGet", - m_abi.saHpiControlGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiControlGet ), error ); GetF( m_handle, "saHpiControlSet", - m_abi.saHpiControlSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiControlSet ), error ); GetF( m_handle, "saHpiIdrInfoGet", - m_abi.saHpiIdrInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrInfoGet ), error ); GetF( m_handle, "saHpiIdrAreaHeaderGet", - m_abi.saHpiIdrAreaHeaderGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaHeaderGet ), error ); GetF( m_handle, "saHpiIdrAreaAdd", - m_abi.saHpiIdrAreaAdd, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaAdd ), error ); GetF( m_handle, "saHpiIdrAreaAddById", - m_abi.saHpiIdrAreaAddById, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaAddById ), error ); GetF( m_handle, "saHpiIdrAreaDelete", - m_abi.saHpiIdrAreaDelete, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaDelete ), error ); GetF( m_handle, "saHpiIdrFieldGet", - m_abi.saHpiIdrFieldGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldGet ), error ); GetF( m_handle, "saHpiIdrFieldAdd", - m_abi.saHpiIdrFieldAdd, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldAdd ), error ); GetF( m_handle, "saHpiIdrFieldAddById", - m_abi.saHpiIdrFieldAddById, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldAddById ), error ); GetF( m_handle, "saHpiIdrFieldSet", - m_abi.saHpiIdrFieldSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldSet ), error ); GetF( m_handle, "saHpiIdrFieldDelete", - m_abi.saHpiIdrFieldDelete, + reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldDelete ), error ); GetF( m_handle, "saHpiWatchdogTimerGet", - m_abi.saHpiWatchdogTimerGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiWatchdogTimerGet ), error ); GetF( m_handle, "saHpiWatchdogTimerSet", - m_abi.saHpiWatchdogTimerSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiWatchdogTimerSet ), error ); GetF( m_handle, "saHpiWatchdogTimerReset", - m_abi.saHpiWatchdogTimerReset, + reinterpret_cast<gpointer *>( &m_abi.saHpiWatchdogTimerReset ), error ); GetF( m_handle, "saHpiAnnunciatorGetNext", - m_abi.saHpiAnnunciatorGetNext, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorGetNext ), error ); GetF( m_handle, "saHpiAnnunciatorGet", - m_abi.saHpiAnnunciatorGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorGet ), error ); GetF( m_handle, "saHpiAnnunciatorAcknowledge", - m_abi.saHpiAnnunciatorAcknowledge, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorAcknowledge ), error ); GetF( m_handle, "saHpiAnnunciatorAdd", - m_abi.saHpiAnnunciatorAdd, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorAdd ), error ); GetF( m_handle, "saHpiAnnunciatorDelete", - m_abi.saHpiAnnunciatorDelete, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorDelete ), error ); GetF( m_handle, "saHpiAnnunciatorModeGet", - m_abi.saHpiAnnunciatorModeGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorModeGet ), error ); GetF( m_handle, "saHpiAnnunciatorModeSet", - m_abi.saHpiAnnunciatorModeSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorModeSet ), error ); GetF( m_handle, "saHpiDimiInfoGet", - m_abi.saHpiDimiInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiInfoGet ), error ); GetF( m_handle, "saHpiDimiTestInfoGet", - m_abi.saHpiDimiTestInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestInfoGet ), error ); GetF( m_handle, "saHpiDimiTestReadinessGet", - m_abi.saHpiDimiTestReadinessGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestReadinessGet ), error ); GetF( m_handle, "saHpiDimiTestStart", - m_abi.saHpiDimiTestStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestStart ), error ); GetF( m_handle, "saHpiDimiTestCancel", - m_abi.saHpiDimiTestCancel, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestCancel ), error ); GetF( m_handle, "saHpiDimiTestStatusGet", - m_abi.saHpiDimiTestStatusGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestStatusGet ), error ); GetF( m_handle, "saHpiDimiTestResultsGet", - m_abi.saHpiDimiTestResultsGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestResultsGet ), error ); GetF( m_handle, "saHpiFumiSpecInfoGet", - m_abi.saHpiFumiSpecInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSpecInfoGet ), error ); GetF( m_handle, "saHpiFumiServiceImpactGet", - m_abi.saHpiFumiServiceImpactGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiServiceImpactGet ), error ); GetF( m_handle, "saHpiFumiSourceSet", - m_abi.saHpiFumiSourceSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceSet ), error ); GetF( m_handle, "saHpiFumiSourceInfoValidateStart", - m_abi.saHpiFumiSourceInfoValidateStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceInfoValidateStart ), error ); GetF( m_handle, "saHpiFumiSourceInfoGet", - m_abi.saHpiFumiSourceInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceInfoGet ), error ); GetF( m_handle, "saHpiFumiSourceComponentInfoGet", - m_abi.saHpiFumiSourceComponentInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceComponentInfoGet ), error ); GetF( m_handle, "saHpiFumiTargetInfoGet", - m_abi.saHpiFumiTargetInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetInfoGet ), error ); GetF( m_handle, "saHpiFumiTargetComponentInfoGet", - m_abi.saHpiFumiTargetComponentInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetComponentInfoGet ), error ); GetF( m_handle, "saHpiFumiLogicalTargetInfoGet", - m_abi.saHpiFumiLogicalTargetInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiLogicalTargetInfoGet ), error ); GetF( m_handle, "saHpiFumiLogicalTargetComponentInfoGet", - m_abi.saHpiFumiLogicalTargetComponentInfoGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiLogicalTargetComponentInfoGet ), error ); GetF( m_handle, "saHpiFumiBackupStart", - m_abi.saHpiFumiBackupStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiBackupStart ), error ); GetF( m_handle, "saHpiFumiBankBootOrderSet", - m_abi.saHpiFumiBankBootOrderSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiBankBootOrderSet ), error ); GetF( m_handle, "saHpiFumiBankCopyStart", - m_abi.saHpiFumiBankCopyStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiBankCopyStart ), error ); GetF( m_handle, "saHpiFumiInstallStart", - m_abi.saHpiFumiInstallStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiInstallStart ), error ); GetF( m_handle, "saHpiFumiUpgradeStatusGet", - m_abi.saHpiFumiUpgradeStatusGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiUpgradeStatusGet ), error ); GetF( m_handle, "saHpiFumiTargetVerifyStart", - m_abi.saHpiFumiTargetVerifyStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetVerifyStart ), error ); GetF( m_handle, "saHpiFumiTargetVerifyMainStart", - m_abi.saHpiFumiTargetVerifyMainStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetVerifyMainStart ), error ); GetF( m_handle, "saHpiFumiUpgradeCancel", - m_abi.saHpiFumiUpgradeCancel, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiUpgradeCancel ), error ); GetF( m_handle, "saHpiFumiAutoRollbackDisableGet", - m_abi.saHpiFumiAutoRollbackDisableGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiAutoRollbackDisableGet ), error ); GetF( m_handle, "saHpiFumiAutoRollbackDisableSet", - m_abi.saHpiFumiAutoRollbackDisableSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiAutoRollbackDisableSet ), error ); GetF( m_handle, "saHpiFumiRollbackStart", - m_abi.saHpiFumiRollbackStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiRollbackStart ), error ); GetF( m_handle, "saHpiFumiActivate", - m_abi.saHpiFumiActivate, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiActivate ), error ); GetF( m_handle, "saHpiFumiActivateStart", - m_abi.saHpiFumiActivateStart, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiActivateStart ), error ); GetF( m_handle, "saHpiFumiCleanup", - m_abi.saHpiFumiCleanup, + reinterpret_cast<gpointer *>( &m_abi.saHpiFumiCleanup ), error ); GetF( m_handle, "saHpiHotSwapPolicyCancel", - m_abi.saHpiHotSwapPolicyCancel, + reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapPolicyCancel ), error ); GetF( m_handle, "saHpiResourceActiveSet", - m_abi.saHpiResourceActiveSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceActiveSet ), error ); GetF( m_handle, "saHpiResourceInactiveSet", - m_abi.saHpiResourceInactiveSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceInactiveSet ), error ); GetF( m_handle, "saHpiAutoInsertTimeoutGet", - m_abi.saHpiAutoInsertTimeoutGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAutoInsertTimeoutGet ), error ); GetF( m_handle, "saHpiAutoInsertTimeoutSet", - m_abi.saHpiAutoInsertTimeoutSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAutoInsertTimeoutSet ), error ); GetF( m_handle, "saHpiAutoExtractTimeoutGet", - m_abi.saHpiAutoExtractTimeoutGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAutoExtractTimeoutGet ), error ); GetF( m_handle, "saHpiAutoExtractTimeoutSet", - m_abi.saHpiAutoExtractTimeoutSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiAutoExtractTimeoutSet ), error ); GetF( m_handle, "saHpiHotSwapStateGet", - m_abi.saHpiHotSwapStateGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapStateGet ), error ); GetF( m_handle, "saHpiHotSwapActionRequest", - m_abi.saHpiHotSwapActionRequest, + reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapActionRequest ), error ); GetF( m_handle, "saHpiHotSwapIndicatorStateGet", - m_abi.saHpiHotSwapIndicatorStateGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapIndicatorStateGet ), error ); GetF( m_handle, "saHpiHotSwapIndicatorStateSet", - m_abi.saHpiHotSwapIndicatorStateSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapIndicatorStateSet ), error ); GetF( m_handle, "saHpiParmControl", - m_abi.saHpiParmControl, + reinterpret_cast<gpointer *>( &m_abi.saHpiParmControl ), error ); GetF( m_handle, "saHpiResourceLoadIdGet", - m_abi.saHpiResourceLoadIdGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceLoadIdGet ), error ); GetF( m_handle, "saHpiResourceLoadIdSet", - m_abi.saHpiResourceLoadIdSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceLoadIdSet ), error ); GetF( m_handle, "saHpiResourceResetStateGet", - m_abi.saHpiResourceResetStateGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceResetStateGet ), error ); GetF( m_handle, "saHpiResourceResetStateSet", - m_abi.saHpiResourceResetStateSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourceResetStateSet ), error ); GetF( m_handle, "saHpiResourcePowerStateGet", - m_abi.saHpiResourcePowerStateGet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourcePowerStateGet ), error ); GetF( m_handle, "saHpiResourcePowerStateSet", - m_abi.saHpiResourcePowerStateSet, + reinterpret_cast<gpointer *>( &m_abi.saHpiResourcePowerStateSet ), error ); GetF( m_handle, "oHpiDomainAdd", - m_abi.oHpiDomainAdd, + reinterpret_cast<gpointer *>( &m_abi.oHpiDomainAdd ), error ); if ( !error.empty() ) { - dlclose( m_handle ); + g_module_close( m_handle ); m_handle = 0; err( "Slave: %s\n", error.c_str() ); return false; @@ -571,7 +572,7 @@ SaErrorT rv = m_abi.saHpiInitialize( SAHPI_INTERFACE_VERSION, 0, 0, 0, 0 ); if ( rv != SA_OK ) { - dlclose( m_handle ); + g_module_close( m_handle ); m_handle = 0; err( "Slave: saHpiInitialize failed with rv = %d\n", rv ); return false; Modified: openhpi/trunk/plugins/slave/baselib.h =================================================================== --- openhpi/trunk/plugins/slave/baselib.h 2010-12-19 14:02:25 UTC (rev 7213) +++ openhpi/trunk/plugins/slave/baselib.h 2010-12-19 16:56:15 UTC (rev 7214) @@ -18,6 +18,8 @@ #include <string> +#include <gmodule.h> + #include <SaHpi.h> @@ -1142,7 +1144,7 @@ private: - void * m_handle; + GModule * m_handle; BaseLibAbi m_abi; }; Modified: openhpi/trunk/plugins/slave/slave.cpp =================================================================== --- openhpi/trunk/plugins/slave/slave.cpp 2010-12-19 14:02:25 UTC (rev 7213) +++ openhpi/trunk/plugins/slave/slave.cpp 2010-12-19 16:56:15 UTC (rev 7214) @@ -27,12 +27,10 @@ #include <oh_utils.h> #include "handler.h" +#include "slave.h" #include "util.h" -extern "C" { - - using Slave::cHandler; @@ -86,19 +84,10 @@ /************************************************************** * slave_open *************************************************************/ -static void * -slave_open( +oh_open( GHashTable * handler_config, unsigned int hid, - oh_evt_queue * eventq -) __attribute__((used)); - -static -void * -slave_open( - GHashTable * handler_config, - unsigned int hid, oh_evt_queue * eventq ) { if ( !handler_config ) { @@ -140,37 +129,21 @@ /************************************************************** * slave_close *************************************************************/ -static -SaErrorT -slave_close( - void * hnd -) __attribute__((used)); - -static -SaErrorT -slave_close( +void +oh_close( void * hnd ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); delete handler; - - return SA_OK; } /************************************************************** - * slave_discover + * slave_discover_resources *************************************************************/ -static SaErrorT -slave_discover( - void * hnd -) __attribute__((used)); - -static -SaErrorT -slave_discover( +oh_discover_resources( void * hnd ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -184,19 +157,10 @@ /************************************************************** * slave_set_resource_tag *************************************************************/ -static SaErrorT -slave_set_resource_tag( +oh_set_resource_tag( void * hnd, SaHpiResourceIdT id, - SaHpiTextBufferT * tag -) __attribute__((used)); - -static -SaErrorT -slave_set_resource_tag( - void * hnd, - SaHpiResourceIdT id, SaHpiTextBufferT * tag ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -217,19 +181,10 @@ /************************************************************** * slave_set_resource_severity *************************************************************/ -static SaErrorT -slave_set_resource_severity( +oh_set_resource_severity( void * hnd, SaHpiResourceIdT id, - SaHpiSeverityT sev -) __attribute__((used)); - -static -SaErrorT -slave_set_resource_severity( - void * hnd, - SaHpiResourceIdT id, SaHpiSeverityT sev ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -250,17 +205,9 @@ /************************************************************** * slave_resource_failed_remove *************************************************************/ -static SaErrorT -slave_resource_failed_remove( +oh_resource_failed_remove( void * hnd, - SaHpiResourceIdT id -) __attribute__((used)); - -static -SaErrorT -slave_resource_failed_remove( - void * hnd, SaHpiResourceIdT id ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -280,19 +227,10 @@ /************************************************************** * slave_get_el_info *************************************************************/ -static SaErrorT -slave_get_el_info( +oh_get_el_info( void * hnd, SaHpiResourceIdT id, - SaHpiEventLogInfoT * info -) __attribute__((used)); - -static -SaErrorT -slave_get_el_info( - void * hnd, - SaHpiResourceIdT id, SaHpiEventLogInfoT * info ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -313,19 +251,10 @@ /************************************************************** * slave_get_el_caps *************************************************************/ -static SaErrorT -slave_get_el_caps( +oh_get_el_caps( void * hnd, SaHpiResourceIdT id, - SaHpiEventLogCapabilitiesT * caps -) __attribute__((used)); - -static -SaErrorT -slave_get_el_caps( - void * hnd, - SaHpiResourceIdT id, SaHpiEventLogCapabilitiesT * caps ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -346,19 +275,10 @@ /************************************************************** * slave_set_el_time *************************************************************/ -static SaErrorT -slave_set_el_time( +oh_set_el_time( void * hnd, SaHpiResourceIdT id, - SaHpiTimeT time -) __attribute__((used)); - -static -SaErrorT -slave_set_el_time( - void * hnd, - SaHpiResourceIdT id, SaHpiTimeT time ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -379,19 +299,10 @@ /************************************************************** * slave_add_el_entry *************************************************************/ -static SaErrorT -slave_add_el_entry( +oh_add_el_entry( void * hnd, SaHpiResourceIdT id, - const SaHpiEventT * event -) __attribute__((used)); - -static -SaErrorT -slave_add_el_entry( - void * hnd, - SaHpiResourceIdT id, const SaHpiEventT * event ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -415,9 +326,8 @@ /************************************************************** * slave_get_el_entry *************************************************************/ -static SaErrorT -slave_get_el_entry( +oh_get_el_entry( void * hnd, SaHpiResourceIdT id, SaHpiEventLogEntryIdT current, @@ -425,19 +335,6 @@ SaHpiEventLogEntryIdT * next, SaHpiEventLogEntryT * entry, SaHpiRdrT * rdr, - SaHpiRptEntryT * rpte -) __attribute__((used)); - -static -SaErrorT -slave_get_el_entry( - void * hnd, - SaHpiResourceIdT id, - SaHpiEventLogEntryIdT current, - SaHpiEventLogEntryIdT * prev, - SaHpiEventLogEntryIdT * next, - SaHpiEventLogEntryT * entry, - SaHpiRdrT * rdr, SaHpiRptEntryT * rpte ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -474,17 +371,9 @@ /************************************************************** * slave_clear_el *************************************************************/ -static SaErrorT -slave_clear_el( +oh_clear_el( void * hnd, - SaHpiResourceIdT id -) __attribute__((used)); - -static -SaErrorT -slave_clear_el( - void * hnd, SaHpiResourceIdT id ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -504,19 +393,10 @@ /************************************************************** * slave_set_el_state *************************************************************/ -static SaErrorT -slave_set_el_state( +oh_set_el_state( void * hnd, SaHpiResourceIdT id, - SaHpiBoolT e -) __attribute__((used)); - -static -SaErrorT -slave_set_el_state( - void * hnd, - SaHpiResourceIdT id, SaHpiBoolT e ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -537,17 +417,9 @@ /************************************************************** * slave_reset_el_overflow *************************************************************/ -static SaErrorT -slave_reset_el_overflow( +oh_reset_el_overflow( void * hnd, - SaHpiResourceIdT id -) __attribute__((used)); - -static -SaErrorT -slave_reset_el_overflow( - void * hnd, SaHpiResourceIdT id ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -567,23 +439,12 @@ /************************************************************** * slave_get_sensor_reading *************************************************************/ -static SaErrorT -slave_get_sensor_reading( +oh_get_sensor_reading( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiSensorReadingT * reading, - SaHpiEventStateT * state -) __attribute__((used)); - -static -SaErrorT -slave_get_sensor_reading( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, - SaHpiSensorReadingT * reading, SaHpiEventStateT * state ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -606,21 +467,11 @@ /************************************************************** * slave_get_sensor_thresholds *************************************************************/ -static SaErrorT -slave_get_sensor_thresholds( +oh_get_sensor_thresholds( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, - SaHpiSensorThresholdsT * thres -) __attribute__((used)); - -static -SaErrorT -slave_get_sensor_thresholds( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, SaHpiSensorThresholdsT * thres ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -642,21 +493,11 @@ /************************************************************** * slave_set_sensor_thresholds *************************************************************/ -static SaErrorT -slave_set_sensor_thresholds( +oh_set_sensor_thresholds( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, - const SaHpiSensorThresholdsT * thres -) __attribute__((used)); - -static -SaErrorT -slave_set_sensor_thresholds( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, const SaHpiSensorThresholdsT * thres ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -681,21 +522,11 @@ /************************************************************** * slave_get_sensor_enable *************************************************************/ -static SaErrorT -slave_get_sensor_enable( +oh_get_sensor_enable( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, - SaHpiBoolT * enable -) __attribute__((used)); - -static -SaErrorT -slave_get_sensor_enable( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, SaHpiBoolT * enable ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -717,21 +548,11 @@ /************************************************************** * slave_set_sensor_enable *************************************************************/ -static SaErrorT -slave_set_sensor_enable( +oh_set_sensor_enable( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, - SaHpiBoolT enable -) __attribute__((used)); - -static -SaErrorT -slave_set_sensor_enable( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, SaHpiBoolT enable ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -753,21 +574,11 @@ /************************************************************** * slave_get_sensor_event_enables *************************************************************/ -static SaErrorT -slave_get_sensor_event_enables( +oh_get_sensor_event_enables( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, - SaHpiBoolT * enables -) __attribute__((used)); - -static -SaErrorT -slave_get_sensor_event_enables( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, SaHpiBoolT * enables ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -789,21 +600,11 @@ /************************************************************** * slave_set_sensor_event_enables *************************************************************/ -static SaErrorT -slave_set_sensor_event_enables( +oh_set_sensor_event_enables( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, - const SaHpiBoolT enables -) __attribute__((used)); - -static -SaErrorT -slave_set_sensor_event_enables( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, const SaHpiBoolT enables ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -825,23 +626,12 @@ /************************************************************** * slave_get_sensor_event_masks *************************************************************/ -static SaErrorT -slave_get_sensor_event_masks( +oh_get_sensor_event_masks( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiEventStateT * AssertEventMask, - SaHpiEventStateT * DeassertEventMask -) __attribute__((used)); - -static -SaErrorT -slave_get_sensor_event_masks( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, - SaHpiEventStateT * AssertEventMask, SaHpiEventStateT * DeassertEventMask ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -864,25 +654,13 @@ /************************************************************** * slave_set_sensor_event_masks *************************************************************/ -static SaErrorT -slave_set_sensor_event_masks( +oh_set_sensor_event_masks( void * hnd, SaHpiResourceIdT id, SaHpiSensorNumT num, SaHpiSensorEventMaskActionT act, SaHpiEventStateT AssertEventMask, - SaHpiEventStateT DeassertEventMask -) __attribute__((used)); - -static -SaErrorT -slave_set_sensor_event_masks( - void * hnd, - SaHpiResourceIdT id, - SaHpiSensorNumT num, - SaHpiSensorEventMaskActionT act, - SaHpiEventStateT AssertEventMask, SaHpiEventStateT DeassertEventMask ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -906,23 +684,12 @@ /************************************************************** * slave_get_control_state *************************************************************/ -static SaErrorT -slave_get_control_state( +oh_get_control_state( void * hnd, SaHpiResourceIdT id, SaHpiCtrlNumT num, SaHpiCtrlModeT * mode, - SaHpiCtrlStateT * state -) __attribute__((used)); - -static -SaErrorT -slave_get_control_state( - void * hnd, - SaHpiResourceIdT id, - SaHpiCtrlNumT num, - SaHpiCtrlModeT * mode, SaHpiCtrlStateT * state ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -945,23 +712,12 @@ /************************************************************** * slave_set_control_state *************************************************************/ -static SaErrorT -slave_set_control_state( +oh_set_control_state( void * hnd, SaHpiResourceIdT id, SaHpiCtrlNumT num, SaHpiCtrlModeT mode, - SaHpiCtrlStateT * state -) __attribute__((used)); - -static -SaErrorT -slave_set_control_state( - void * hnd, - SaHpiResourceIdT id, - SaHpiCtrlNumT num, - SaHpiCtrlModeT mode, SaHpiCtrlStateT * state ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -984,21 +740,11 @@ /************************************************************** * slave_get_idr_info *************************************************************/ -static SaErrorT -slave_get_idr_info( +oh_get_idr_info( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, - SaHpiIdrInfoT * idrinfo -) __attribute__((used)); - -static -SaErrorT -slave_get_idr_info( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, SaHpiIdrInfoT * idrinfo ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1020,27 +766,14 @@ /************************************************************** * slave_get_idr_area_header *************************************************************/ -static SaErrorT -slave_get_idr_area_header( +oh_get_idr_area_header( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, SaHpiIdrAreaTypeT areatype, SaHpiEntryIdT areaid, SaHpiEntryIdT * nextareaid, - SaHpiIdrAreaHeaderT * header -) __attribute__((used)); - -static -SaErrorT -slave_get_idr_area_header( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, - SaHpiIdrAreaTypeT areatype, - SaHpiEntryIdT areaid, - SaHpiEntryIdT * nextareaid, SaHpiIdrAreaHeaderT * header ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1065,23 +798,12 @@ /************************************************************** * slave_add_idr_area *************************************************************/ -static SaErrorT -slave_add_idr_area( +oh_add_idr_area( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, SaHpiIdrAreaTypeT areatype, - SaHpiEntryIdT * areaid -) __attribute__((used)); - -static -SaErrorT -slave_add_idr_area( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, - SaHpiIdrAreaTypeT areatype, SaHpiEntryIdT * areaid ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1104,23 +826,12 @@ /************************************************************** * slave_add_idr_area_id *************************************************************/ -static SaErrorT -slave_add_idr_area_id( +oh_add_idr_area_id( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, SaHpiIdrAreaTypeT areatype, - SaHpiEntryIdT areaid -) __attribute__((used)); - -static -SaErrorT -slave_add_idr_area_id( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, - SaHpiIdrAreaTypeT areatype, SaHpiEntryIdT areaid ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1143,21 +854,11 @@ /************************************************************** * slave_del_idr_area *************************************************************/ -static SaErrorT -slave_del_idr_area( +oh_del_idr_area( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, - SaHpiEntryIdT areaid -) __attribute__((used)); - -static -SaErrorT -slave_del_idr_area( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, SaHpiEntryIdT areaid ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1179,9 +880,8 @@ /************************************************************** * slave_get_idr_field *************************************************************/ -static SaErrorT -slave_get_idr_field( +oh_get_idr_field( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, @@ -1189,19 +889,6 @@ SaHpiIdrFieldTypeT fieldtype, SaHpiEntryIdT fieldid, SaHpiEntryIdT * nextfieldid, - SaHpiIdrFieldT * field -) __attribute__((used)); - -static -SaErrorT -slave_get_idr_field( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, - SaHpiEntryIdT areaid, - SaHpiIdrFieldTypeT fieldtype, - SaHpiEntryIdT fieldid, - SaHpiEntryIdT * nextfieldid, SaHpiIdrFieldT * field ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1227,21 +914,11 @@ /************************************************************** * slave_add_idr_field *************************************************************/ -static SaErrorT -slave_add_idr_field( +oh_add_idr_field( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, - SaHpiIdrFieldT * field -) __attribute__((used)); - -static -SaErrorT -slave_add_idr_field( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, SaHpiIdrFieldT * field ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1263,21 +940,11 @@ /************************************************************** * slave_add_idr_field_id *************************************************************/ -static SaErrorT -slave_add_idr_field_id( +oh_add_idr_field_id( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, - SaHpiIdrFieldT * field -) __attribute__((used)); - -static -SaErrorT -slave_add_idr_field_id( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, SaHpiIdrFieldT * field ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1299,21 +966,11 @@ /************************************************************** * slave_set_idr_field *************************************************************/ -static SaErrorT -slave_set_idr_field( +oh_set_idr_field( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, - SaHpiIdrFieldT * field -) __attribute__((used)); - -static -SaErrorT -slave_set_idr_field( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, SaHpiIdrFieldT * field ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1335,23 +992,12 @@ /************************************************************** * slave_del_idr_field *************************************************************/ -static SaErrorT -slave_del_idr_field( +oh_del_idr_field( void * hnd, SaHpiResourceIdT id, SaHpiIdrIdT idrid, SaHpiEntryIdT areaid, - SaHpiEntryIdT fieldid -) __attribute__((used)); - -static -SaErrorT -slave_del_idr_field( - void * hnd, - SaHpiResourceIdT id, - SaHpiIdrIdT idrid, - SaHpiEntryIdT areaid, SaHpiEntryIdT fieldid ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1374,21 +1020,11 @@ /************************************************************** * slave_get_watchdog_info *************************************************************/ -static SaErrorT -slave_get_watchdog_info( +oh_get_watchdog_info( void * hnd, SaHpiResourceIdT id, SaHpiWatchdogNumT num, - SaHpiWatchdogT * wdt -) __attribute__((used)); - -static -SaErrorT -slave_get_watchdog_info( - void * hnd, - SaHpiResourceIdT id, - SaHpiWatchdogNumT num, SaHpiWatchdogT * wdt ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1410,21 +1046,11 @@ /************************************************************** * slave_set_watchdog_info *************************************************************/ -static SaErrorT -slave_set_watchdog_info( +oh_set_watchdog_info( void * hnd, SaHpiResourceIdT id, SaHpiWatchdogNumT num, - SaHpiWatchdogT * wdt -) __attribute__((used)); - -static -SaErrorT -slave_set_watchdog_info( - void * hnd, - SaHpiResourceIdT id, - SaHpiWatchdogNumT num, SaHpiWatchdogT * wdt ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1446,19 +1072,10 @@ /************************************************************** * slave_reset_watchdog *************************************************************/ -static SaErrorT -slave_reset_watchdog( +oh_reset_watchdog( void * hnd, SaHpiResourceIdT id, - SaHpiWatchdogNumT num -) __attribute__((used)); - -static -SaErrorT -slave_reset_watchdog( - void * hnd, - SaHpiResourceIdT id, SaHpiWatchdogNumT num ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1479,25 +1096,13 @@ /************************************************************** * slave_get_next_announce *************************************************************/ -static SaErrorT -slave_get_next_announce( +oh_get_next_announce( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiSeverityT sev, SaHpiBoolT ack, - SaHpiAnnouncementT * ann -) __attribute__((used)); - -static -SaErrorT -slave_get_next_announce( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, - SaHpiSeverityT sev, - SaHpiBoolT ack, SaHpiAnnouncementT * ann ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1527,23 +1132,12 @@ /************************************************************** * slave_get_announce *************************************************************/ -static SaErrorT -slave_get_announce( +oh_get_announce( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiEntryIdT annid, - SaHpiAnnouncementT * ann -) __attribute__((used)); - -static -SaErrorT -slave_get_announce( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, SaHpiAnnouncementT * ann ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1572,23 +1166,12 @@ /************************************************************** * slave_ack_announce *************************************************************/ -static SaErrorT -slave_ack_announce( +oh_ack_announce( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiEntryIdT annid, - SaHpiSeverityT sev -) __attribute__((used)); - -static -SaErrorT -slave_ack_announce( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, SaHpiSeverityT sev ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1611,21 +1194,11 @@ /************************************************************** * slave_add_announce *************************************************************/ -static SaErrorT -slave_add_announce( +oh_add_announce( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, - SaHpiAnnouncementT * ann -) __attribute__((used)); - -static -SaErrorT -slave_add_announce( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, SaHpiAnnouncementT * ann ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1648,23 +1221,12 @@ /************************************************************** * slave_del_announce *************************************************************/ -static SaErrorT -slave_del_announce( +oh_del_announce( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, SaHpiEntryIdT annid, - SaHpiSeverityT sev -) __attribute__((used)); - -static -SaErrorT -slave_del_announce( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, SaHpiSeverityT sev ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1687,21 +1249,11 @@ /************************************************************** * slave_get_annunc_mode *************************************************************/ -static SaErrorT -slave_get_annunc_mode( +oh_get_annunc_mode( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, - SaHpiAnnunciatorModeT * mode -) __attribute__((used)); - -static -SaErrorT -slave_get_annunc_mode( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT * mode ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1723,21 +1275,11 @@ /************************************************************** * slave_set_annunc_mode *************************************************************/ -static SaErrorT -slave_set_annunc_mode( +oh_set_annunc_mode( void * hnd, SaHpiResourceIdT id, SaHpiAnnunciatorNumT num, - SaHpiAnnunciatorModeT mode -) __attribute__((used)); - -static -SaErrorT -slave_set_annunc_mode( - void * hnd, - SaHpiResourceIdT id, - SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT mode ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1759,21 +1301,11 @@ /************************************************************** * slave_get_dimi_info *************************************************************/ -static SaErrorT -slave_get_dimi_info( +oh_get_dimi_info( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, - SaHpiDimiInfoT * info -) __attribute__((used)); - -static -SaErrorT -slave_get_dimi_info( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, SaHpiDimiInfoT * info ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1795,23 +1327,12 @@ /************************************************************** * slave_get_dimi_test *************************************************************/ -static SaErrorT -slave_get_dimi_test( +oh_get_dimi_test( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, SaHpiDimiTestNumT testnum, - SaHpiDimiTestT * test -) __attribute__((used)); - -static -SaErrorT -slave_get_dimi_test( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, - SaHpiDimiTestNumT testnum, SaHpiDimiTestT * test ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1838,23 +1359,12 @@ /************************************************************** * slave_get_dimi_test_ready *************************************************************/ -static SaErrorT -slave_get_dimi_test_ready( +oh_get_dimi_test_ready( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, SaHpiDimiTestNumT testnum, - SaHpiDimiReadyT * ready -) __attribute__((used)); - -static -SaErrorT -slave_get_dimi_test_ready( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, - SaHpiDimiTestNumT testnum, SaHpiDimiReadyT * ready ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1877,25 +1387,13 @@ /************************************************************** * slave_start_dimi_test *************************************************************/ -static SaErrorT -slave_start_dimi_test( +oh_start_dimi_test( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, SaHpiDimiTestNumT testnum, SaHpiUint8T numparams, - SaHpiDimiTestVariableParamsT * paramslist -) __attribute__((used)); - -static -SaErrorT -slave_start_dimi_test( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, - SaHpiDimiTestNumT testnum, - SaHpiUint8T numparams, SaHpiDimiTestVariableParamsT * paramslist ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1919,21 +1417,11 @@ /************************************************************** * slave_cancel_dimi_test *************************************************************/ -static SaErrorT -slave_cancel_dimi_test( +oh_cancel_dimi_test( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, - SaHpiDimiTestNumT testnum -) __attribute__((used)); - -static -SaErrorT -slave_cancel_dimi_test( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, SaHpiDimiTestNumT testnum ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1955,25 +1443,13 @@ /************************************************************** * slave_get_dimi_test_status *************************************************************/ -static SaErrorT -slave_get_dimi_test_status( +oh_get_dimi_test_status( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, SaHpiDimiTestNumT testnum, SaHpiDimiTestPercentCompletedT * percentcompleted, - SaHpiDimiTestRunStatusT * runstatus -) __attribute__((used)); - -static -SaErrorT -slave_get_dimi_test_status( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, - SaHpiDimiTestNumT testnum, - SaHpiDimiTestPercentCompletedT * percentcompleted, SaHpiDimiTestRunStatusT * runstatus ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -1997,23 +1473,12 @@ /************************************************************** * slave_get_dimi_test_results *************************************************************/ -static SaErrorT -slave_get_dimi_test_results( +oh_get_dimi_test_results( void * hnd, SaHpiResourceIdT id, SaHpiDimiNumT num, SaHpiDimiTestNumT testnum, - SaHpiDimiTestResultsT * testresults -) __attribute__((used)); - -static -SaErrorT -slave_get_dimi_test_results( - void * hnd, - SaHpiResourceIdT id, - SaHpiDimiNumT num, - SaHpiDimiTestNumT testnum, SaHpiDimiTestResultsT * testresults ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -2036,21 +1501,11 @@ /************************************************************** * slave_get_fumi_spec *************************************************************/ -static SaErrorT -slave_get_fumi_spec( +oh_get_fumi_spec( void * hnd, SaHpiResourceIdT id, SaHpiFumiNumT num, - SaHpiFumiSpecInfoT * specinfo -) __attribute__((used)); - -static -SaErrorT -slave_get_fumi_spec( - void * hnd, - SaHpiResourceIdT id, - SaHpiFumiNumT num, SaHpiFumiSpecInfoT * specinfo ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -2072,21 +1527,11 @@ /************************************************************** * slave_get_fumi_service_impact *************************************************************/ -static SaErrorT -slave_get_fumi_service_impact( +oh_get_fumi_service_impact( void * hnd, SaHpiResourceIdT id, SaHpiFumiNumT num, - SaHpiFumiServiceImpactDataT * serviceimpact -) __attribute__((used)); - -static -SaErrorT -slave_get_fumi_service_impact( - void * hnd, - SaHpiResourceIdT id, - SaHpiFumiNumT num, SaHpiFumiServiceImpactDataT * serviceimpact ) { cHandler * handler = reinterpret_cast<cHandler *>(hnd); @@ -2115,23 +1560,12 @@ /************************************************************** * slave_set_fumi_source *************************************************************/ -static SaErrorT -slave_set_fumi_source( +oh_set_fumi_source( void * hnd, ... [truncated message content] |
From: <av...@us...> - 2010-12-20 21:43:37
|
Revision: 7216 http://openhpi.svn.sourceforge.net/openhpi/?rev=7216&view=rev Author: avpak Date: 2010-12-20 21:43:29 +0000 (Mon, 20 Dec 2010) Log Message: ----------- More on Feature Request #3129960 Got rid of include/openhpi.h Moved include/oh_lock.h to openhpid/lock.h Modified Paths: -------------- openhpi/trunk/openhpid/Makefile.am openhpi/trunk/openhpid/conf.c openhpi/trunk/openhpid/init.c openhpi/trunk/openhpid/lock.c openhpi/trunk/openhpid/ohpi.c openhpi/trunk/openhpid/plugin.c openhpi/trunk/openhpid/safhpi.c openhpi/trunk/openhpid/session.c openhpi/trunk/plugins/dynamic_simulator/new_sim.cpp openhpi/trunk/plugins/dynamic_simulator/new_sim_control_text.cpp openhpi/trunk/plugins/dynamic_simulator/new_sim_domain.h openhpi/trunk/plugins/dynamic_simulator/new_sim_file.cpp openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.cpp openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h openhpi/trunk/plugins/dynamic_simulator/new_sim_sensor.cpp openhpi/trunk/plugins/dynamic_simulator/new_sim_watchdog.cpp openhpi/trunk/plugins/ipmidirect/ipmi_domain.h openhpi/trunk/plugins/snmp_bc/sim_init.c openhpi/trunk/plugins/snmp_bc/snmp_bc.c openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h openhpi/trunk/plugins/snmp_bc/t/snmp_utils.c openhpi/trunk/utils/t/ann/ann_test_001.c openhpi/trunk/utils/t/ann/ann_test_002.c openhpi/trunk/utils/t/ann/ann_test_003.c openhpi/trunk/utils/t/ann/ann_test_004.c openhpi/trunk/utils/t/ann/ann_test_005.c openhpi/trunk/utils/t/ann/ann_test_006.c openhpi/trunk/utils/t/ann/ann_test_007.c openhpi/trunk/utils/t/ann/ann_test_008.c openhpi/trunk/utils/t/el/el_test.h openhpi/trunk/utils/t/el/el_test_001.c openhpi/trunk/utils/t/el/el_test_002.c openhpi/trunk/utils/t/el/el_test_003.c openhpi/trunk/utils/t/el/el_test_004.c openhpi/trunk/utils/t/el/el_test_005.c openhpi/trunk/utils/t/el/el_test_006.c openhpi/trunk/utils/t/el/el_test_007.c openhpi/trunk/utils/t/el/el_test_008.c openhpi/trunk/utils/t/el/el_test_009.c openhpi/trunk/utils/t/el/el_test_010.c openhpi/trunk/utils/t/el/el_test_011.c openhpi/trunk/utils/t/el/el_test_012.c openhpi/trunk/utils/t/el/el_test_013.c openhpi/trunk/utils/t/el/el_test_014.c openhpi/trunk/utils/t/el/el_test_015.c openhpi/trunk/utils/t/el/el_test_016.c openhpi/trunk/utils/t/el/el_test_017.c openhpi/trunk/utils/t/el/el_test_018.c openhpi/trunk/utils/t/el/el_test_019.c openhpi/trunk/utils/t/el/el_test_020.c openhpi/trunk/utils/t/el/el_test_021.c openhpi/trunk/utils/t/el/el_test_022.c openhpi/trunk/utils/t/el/el_test_023.c openhpi/trunk/utils/t/el/el_test_024.c openhpi/trunk/utils/t/el/el_test_025.c openhpi/trunk/utils/t/el/el_test_026.c openhpi/trunk/utils/t/el/el_test_027.c openhpi/trunk/utils/t/el/el_test_028.c openhpi/trunk/utils/t/el/el_test_029.c openhpi/trunk/utils/t/el/el_test_030.c openhpi/trunk/utils/t/el/el_test_031.c openhpi/trunk/utils/t/el/el_test_032.c openhpi/trunk/utils/t/el/el_test_033.c openhpi/trunk/utils/t/el/el_test_034.c openhpi/trunk/utils/t/el/el_test_035.c openhpi/trunk/utils/t/el/el_test_036.c openhpi/trunk/utils/t/el/el_test_037.c openhpi/trunk/utils/t/el/el_test_038.c openhpi/trunk/utils/t/el/el_test_039.c openhpi/trunk/utils/t/el/el_test_040.c openhpi/trunk/utils/t/el/el_test_041.c openhpi/trunk/utils/t/el/el_test_042.c openhpi/trunk/utils/t/el/el_test_043.c openhpi/trunk/utils/t/el/el_test_044.c openhpi/trunk/utils/t/el/el_test_045.c Added Paths: ----------- openhpi/trunk/openhpid/lock.h Removed Paths: ------------- openhpi/trunk/include/oh_lock.h openhpi/trunk/include/openhpi.h Deleted: openhpi/trunk/include/oh_lock.h =================================================================== --- openhpi/trunk/include/oh_lock.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/include/oh_lock.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -1,88 +0,0 @@ -/* -*- linux-c -*- - * - * Copyright (c) 2003 by Intel Corp. - * (C) Copyright IBM Corp. 2003, 2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Authors: - * Louis Zhuang <lou...@li...> - * Renier Morales <re...@op...> - */ - -#ifndef __OH_LOCK_H -#define __OH_LOCK_H - -#include <config.h> - -#ifdef __cplusplus -extern "C" { -#endif - -extern int oh_will_block; - -int data_access_block_times(void); - -#ifdef OH_DBG_MSGS -/* -#define dbg_lock(format, ...) \ - do { \ - if (oh_get_global_bool(OPENHPI_DEBUG_LOCK)) { \ - fprintf(stderr, " LOCK: %s:%d:%s: ", __FILE__, __LINE__, __func__); \ - fprintf(stderr, format "\n", ## __VA_ARGS__); \ - } \ - } while(0) -*/ -#define dbg_lock(format, ...) \ - do { \ - if (getenv("OPENHPI_DEBUG_LOCK") && !strcmp("YES",getenv("OPENHPI_DEBUG_LOCK"))) { \ - fprintf(stderr, " LOCK: %s:%d:%s: ", __FILE__, __LINE__, __func__); \ - fprintf(stderr, format "\n", ## __VA_ARGS__); \ - } \ - } while(0) -#else -#define dbg_lock(format, ...) -#endif - -/* multi-threading support, use Posix mutex for data access */ -/* initialize mutex used for data locking */ -#include <glib.h> -extern GStaticRecMutex oh_main_lock; -extern int lockcount; - -#define data_access_lock_init() - -#define data_access_lock() \ - do { \ - dbg_lock("%p - Attempting lock", g_thread_self()); \ - if (!g_static_rec_mutex_trylock(&oh_main_lock)) { \ - dbg_lock("%p - Lockcount: %d", g_thread_self(), lockcount); \ - dbg_lock("%p - Going to block for a lock now", g_thread_self()); \ - oh_will_block++; \ - g_static_rec_mutex_lock(&oh_main_lock); \ - dbg_lock("%p - Got the lock after blocking", g_thread_self()); \ - lockcount++; \ - } else { \ - dbg_lock("%p - Got the lock because no one had it", g_thread_self()); \ - lockcount++; \ - dbg_lock("%p - Lockcount: %d", g_thread_self(), lockcount); \ - } \ - } while(0) - -#define data_access_unlock() \ - do { \ - lockcount--; \ - g_static_rec_mutex_unlock(&oh_main_lock); \ - dbg_lock("%p - released the lock", g_thread_self()); \ - } while(0) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __OH_LOCK_H */ Deleted: openhpi/trunk/include/openhpi.h =================================================================== --- openhpi/trunk/include/openhpi.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/include/openhpi.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -1,36 +0,0 @@ -/* -*- linux-c -*- - * - * Copyright (c) 2003 by Intel Corp. - * (C) Copyright IBM Corp. 2003, 2005 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Authors: - * Louis Zhuang <lou...@li...> - * Sean Dague <http://dague.net/sean> - * Rusty Lynch - * Renier Morales <re...@op...> - */ - -#ifndef __OPENHPI_H -#define __OPENHPI_H - -#include <SaHpi.h> -#include <glib.h> -#include <oh_config.h> -#include <oh_plugin.h> -#include <oh_init.h> -#include <oh_lock.h> -#include <oh_error.h> -#include <oh_domain.h> -#include <oh_session.h> -#include <oh_alarm.h> -#include <oh_hotswap.h> -#include <oh_utils.h> - -#endif /* __OPENHPI_H */ Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-20 21:43:29 UTC (rev 7216) @@ -24,7 +24,7 @@ DIST_SUBDIRS = t EXTRA_DIST = \ - Makefile.mingw32 openhpid.sh.in server.h + Makefile.mingw32 openhpid.sh.in lock.h server.h # daemon library noinst_LTLIBRARIES = libopenhpidaemon.la Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/conf.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -27,8 +27,9 @@ #include <oh_config.h> #include <oh_plugin.h> #include <oh_error.h> -#include <oh_lock.h> +#include "lock.h" + /* * Global Parameters */ Modified: openhpi/trunk/openhpid/init.c =================================================================== --- openhpi/trunk/openhpid/init.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/init.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -24,7 +24,6 @@ #include <oh_domain.h> #include <oh_error.h> #include <oh_init.h> -#include <oh_lock.h> #ifndef _WIN32 #include <oh_ssl.h> #endif /* _WIN32 */ @@ -33,6 +32,7 @@ #include <oh_threaded.h> #include <oh_utils.h> +#include "lock.h" /** * oh_init Modified: openhpi/trunk/openhpid/lock.c =================================================================== --- openhpi/trunk/openhpid/lock.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/lock.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -16,7 +16,7 @@ #include <glib.h> -#include <oh_lock.h> +#include "lock.h" int oh_will_block = 0; int lockcount = 0; Copied: openhpi/trunk/openhpid/lock.h (from rev 7215, openhpi/trunk/include/oh_lock.h) =================================================================== --- openhpi/trunk/openhpid/lock.h (rev 0) +++ openhpi/trunk/openhpid/lock.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -0,0 +1,88 @@ +/* -*- linux-c -*- + * + * Copyright (c) 2003 by Intel Corp. + * (C) Copyright IBM Corp. 2003, 2006 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Authors: + * Louis Zhuang <lou...@li...> + * Renier Morales <re...@op...> + */ + +#ifndef __OH_LOCK_H +#define __OH_LOCK_H + +#include <config.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern int oh_will_block; + +int data_access_block_times(void); + +#ifdef OH_DBG_MSGS +/* +#define dbg_lock(format, ...) \ + do { \ + if (oh_get_global_bool(OPENHPI_DEBUG_LOCK)) { \ + fprintf(stderr, " LOCK: %s:%d:%s: ", __FILE__, __LINE__, __func__); \ + fprintf(stderr, format "\n", ## __VA_ARGS__); \ + } \ + } while(0) +*/ +#define dbg_lock(format, ...) \ + do { \ + if (getenv("OPENHPI_DEBUG_LOCK") && !strcmp("YES",getenv("OPENHPI_DEBUG_LOCK"))) { \ + fprintf(stderr, " LOCK: %s:%d:%s: ", __FILE__, __LINE__, __func__); \ + fprintf(stderr, format "\n", ## __VA_ARGS__); \ + } \ + } while(0) +#else +#define dbg_lock(format, ...) +#endif + +/* multi-threading support, use Posix mutex for data access */ +/* initialize mutex used for data locking */ +#include <glib.h> +extern GStaticRecMutex oh_main_lock; +extern int lockcount; + +#define data_access_lock_init() + +#define data_access_lock() \ + do { \ + dbg_lock("%p - Attempting lock", g_thread_self()); \ + if (!g_static_rec_mutex_trylock(&oh_main_lock)) { \ + dbg_lock("%p - Lockcount: %d", g_thread_self(), lockcount); \ + dbg_lock("%p - Going to block for a lock now", g_thread_self()); \ + oh_will_block++; \ + g_static_rec_mutex_lock(&oh_main_lock); \ + dbg_lock("%p - Got the lock after blocking", g_thread_self()); \ + lockcount++; \ + } else { \ + dbg_lock("%p - Got the lock because no one had it", g_thread_self()); \ + lockcount++; \ + dbg_lock("%p - Lockcount: %d", g_thread_self(), lockcount); \ + } \ + } while(0) + +#define data_access_unlock() \ + do { \ + lockcount--; \ + g_static_rec_mutex_unlock(&oh_main_lock); \ + dbg_lock("%p - released the lock", g_thread_self()); \ + } while(0) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __OH_LOCK_H */ Modified: openhpi/trunk/openhpid/ohpi.c =================================================================== --- openhpi/trunk/openhpid/ohpi.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/ohpi.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -28,10 +28,10 @@ #include <oh_session.h> #include <oh_utils.h> #include <oh_error.h> -#include <oh_lock.h> #include <sahpimacros.h> #include <config.h> +#include "lock.h" /** * oHpiVersionGet Modified: openhpi/trunk/openhpid/plugin.c =================================================================== --- openhpi/trunk/openhpid/plugin.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/plugin.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -29,9 +29,9 @@ #include <oh_config.h> #include <oh_domain.h> #include <oh_error.h> -#include <oh_lock.h> #include <oh_plugin.h> +#include "lock.h" /* * Structure containing global list of plugins (oh_plugin). Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/safhpi.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -24,12 +24,23 @@ */ #include <string.h> + #include <SaHpi.h> -#include <openhpi.h> + +#include <oh_error.h> #include <oh_threaded.h> #include <oh_utils.h> #include <sahpimacros.h> +#include <oh_alarm.h> +#include <oh_config.h> +#include <oh_domain.h> +#include <oh_handler.h> +#include <oh_hotswap.h> +#include <oh_init.h> +#include <oh_plugin.h> +#include <oh_session.h> + /********************************************************************* * * Begin SAHPI B.03.01 Functions. For full documentation please see Modified: openhpi/trunk/openhpid/session.c =================================================================== --- openhpi/trunk/openhpid/session.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/openhpid/session.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,10 +21,11 @@ #include <oh_config.h> #include <oh_domain.h> #include <oh_error.h> -#include <oh_lock.h> #include <oh_session.h> #include <oh_utils.h> +#include "lock.h" + struct oh_session_table oh_sessions = { .table = NULL, .lock = G_STATIC_REC_MUTEX_INIT Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim.cpp =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim.cpp 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim.cpp 2010-12-20 21:43:29 UTC (rev 7216) @@ -27,6 +27,8 @@ #include <netdb.h> #include <errno.h> +#include <oh_error.h> + #include "new_sim.h" #include "new_sim_utils.h" Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_control_text.cpp =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_control_text.cpp 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_control_text.cpp 2010-12-20 21:43:29 UTC (rev 7216) @@ -16,6 +16,8 @@ * full licensing terms. * */ + +#include <oh_error.h> #include "new_sim_control.h" #include "new_sim_control_text.h" Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_domain.h =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_domain.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_domain.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -34,7 +34,6 @@ #include "SaHpi.h" } -#include <openhpi.h> #include <oh_utils.h> #ifndef __NEW_SIM_FILE_H__ Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_file.cpp =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_file.cpp 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_file.cpp 2010-12-20 21:43:29 UTC (rev 7216) @@ -23,6 +23,7 @@ #include <unistd.h> #include <glib.h> #include <SaHpi.h> +#include <oh_error.h> #include "new_sim_file.h" #include "new_sim_file_util.h" #include "new_sim_file_rdr.h" @@ -37,9 +38,6 @@ #include "new_sim_entity.h" #include "new_sim_utils.h" #include "new_sim_log.h" -#include <oh_plugin.h> -#include <oh_error.h> -#include <oh_lock.h> #define GEN_SIM_DATA_VERSION 0.901 Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.cpp =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.cpp 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.cpp 2010-12-20 21:43:29 UTC (rev 7216) @@ -16,6 +16,8 @@ * full licensing terms. * */ + +#include <oh_error.h> #include "new_sim_hotswap.h" #include "new_sim_utils.h" Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,7 @@ #ifndef __NEW_SIM_HOTSWAP_H__ #define __NEW_SIM_HOTSWAP_H__ -#include <openhpi.h> +#include <oh_event.h> #include <oh_utils.h> #ifndef __NEW_SIM_UTILS_H__ Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_sensor.cpp =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_sensor.cpp 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_sensor.cpp 2010-12-20 21:43:29 UTC (rev 7216) @@ -30,6 +30,8 @@ #include <glib.h> #include <math.h> +#include <oh_error.h> + #include "new_sim_domain.h" #include "new_sim_sensor.h" #include "new_sim_entity.h" Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_watchdog.cpp =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_watchdog.cpp 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_watchdog.cpp 2010-12-20 21:43:29 UTC (rev 7216) @@ -18,6 +18,8 @@ * full licensing terms. * */ + +#include <oh_error.h> #include "new_sim_watchdog.h" #include "new_sim_utils.h" Modified: openhpi/trunk/plugins/ipmidirect/ipmi_domain.h =================================================================== --- openhpi/trunk/plugins/ipmidirect/ipmi_domain.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/ipmidirect/ipmi_domain.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -33,7 +33,9 @@ #include "SaHpi.h" } -#include <openhpi.h> +#include <oh_error.h> +#include <oh_event.h> +#include <oh_handler.h> #include <oh_utils.h> #ifndef dIpmiCon_h Modified: openhpi/trunk/plugins/snmp_bc/sim_init.c =================================================================== --- openhpi/trunk/plugins/snmp_bc/sim_init.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/snmp_bc/sim_init.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -13,7 +13,6 @@ * Steve Sherman <st...@us...> */ -#include <openhpi.h> #include <snmp_utils.h> #include <snmp_bc_plugin.h> #include <sim_init.h> Modified: openhpi/trunk/plugins/snmp_bc/snmp_bc.c =================================================================== --- openhpi/trunk/plugins/snmp_bc/snmp_bc.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/snmp_bc/snmp_bc.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -14,6 +14,8 @@ * Steve Sherman <st...@us...> */ +#include <oh_error.h> + #include <snmp_bc_plugin.h> /** Modified: openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h =================================================================== --- openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -17,8 +17,17 @@ #define __SNMP_BC_PLUGIN_H /* Order is important */ -#include <openhpi.h> +#include <glib.h> + +#include <SaHpi.h> #include <SaHpiBladeCenter.h> + +#include <oh_domain.h> +#include <oh_error.h> +#include <oh_handler.h> +#include <oh_plugin.h> +#include <oh_session.h> + #include <snmp_utils.h> #include <snmp_bc.h> Modified: openhpi/trunk/plugins/snmp_bc/t/snmp_utils.c =================================================================== --- openhpi/trunk/plugins/snmp_bc/t/snmp_utils.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/plugins/snmp_bc/t/snmp_utils.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -13,8 +13,12 @@ * Steve Sherman <st...@us...> */ +#include <glib.h> + #include <SaHpi.h> -#include <openhpi.h> + +#include <oh_error.h> + #include <snmp_utils.h> #include <sim_resources.h> Modified: openhpi/trunk/utils/t/ann/ann_test_001.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_001.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_001.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_002.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_002.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_002.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_003.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_003.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_003.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_004.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_004.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_004.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_005.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_005.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_005.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -22,7 +22,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_006.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_006.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_006.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_007.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_007.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_007.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/ann/ann_test_008.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_008.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/ann/ann_test_008.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -21,7 +21,7 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> +#include <oh_error.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/el/el_test.h =================================================================== --- openhpi/trunk/utils/t/el/el_test.h 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test.h 2010-12-20 21:43:29 UTC (rev 7216) @@ -14,5 +14,7 @@ * David Ashley<da...@us...> */ +#include <oh_error.h> + int el_compare(oh_el *el1, oh_el *el2); Modified: openhpi/trunk/utils/t/el/el_test_001.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_001.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_001.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -22,7 +22,6 @@ #include <unistd.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_002.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_002.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_002.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_003.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_003.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_003.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include "el_test.h" Modified: openhpi/trunk/utils/t/el/el_test_004.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_004.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_004.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_005.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_005.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_005.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_006.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_006.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_006.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_007.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_007.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_007.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_008.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_008.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_008.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_009.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_009.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_009.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -19,7 +19,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_010.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_010.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_010.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_011.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_011.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_011.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_012.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_012.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_012.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_013.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_013.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_013.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_014.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_014.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_014.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_015.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_015.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_015.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_016.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_016.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_016.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_017.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_017.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_017.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_018.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_018.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_018.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_019.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_019.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_019.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_020.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_020.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_020.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_021.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_021.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_021.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_022.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_022.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_022.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_023.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_023.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_023.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_024.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_024.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_024.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_025.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_025.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_025.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_026.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_026.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_026.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_027.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_027.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_027.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_028.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_028.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_028.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_029.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_029.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_029.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_030.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_030.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_030.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_031.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_031.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_031.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_032.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_032.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_032.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_033.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_033.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_033.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_034.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_034.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_034.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_035.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_035.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_035.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_036.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_036.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_036.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_037.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_037.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_037.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_038.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_038.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_038.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_039.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_039.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_039.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_040.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_040.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_040.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_041.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_041.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_041.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_042.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_042.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_042.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_043.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_043.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_043.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_044.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_044.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_044.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> Modified: openhpi/trunk/utils/t/el/el_test_045.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_045.c 2010-12-19 17:35:51 UTC (rev 7215) +++ openhpi/trunk/utils/t/el/el_test_045.c 2010-12-20 21:43:29 UTC (rev 7216) @@ -20,7 +20,6 @@ #include <string.h> #include <SaHpi.h> -#include <openhpi.h> #include <oh_utils.h> #include <el_utils.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-20 22:44:28
|
Revision: 7217 http://openhpi.svn.sourceforge.net/openhpi/?rev=7217&view=rev Author: avpak Date: 2010-12-20 22:44:21 +0000 (Mon, 20 Dec 2010) Log Message: ----------- More on Feature Request #3129960 Moved some header files from include/ to openhpid/ Modified Paths: -------------- openhpi/trunk/hpi_shell/commands.c openhpi/trunk/openhpid/Makefile.am openhpi/trunk/openhpid/alarm.c openhpi/trunk/openhpid/conf.c openhpi/trunk/openhpid/domain.c openhpi/trunk/openhpid/event.c openhpi/trunk/openhpid/hotswap.c openhpi/trunk/openhpid/init.c openhpi/trunk/openhpid/ohpi.c openhpi/trunk/openhpid/openhpid-posix.cpp openhpi/trunk/openhpid/openhpid-win32.cpp openhpi/trunk/openhpid/plugin.c openhpi/trunk/openhpid/safhpi.c openhpi/trunk/openhpid/session.c openhpi/trunk/openhpid/threaded.c Added Paths: ----------- openhpi/trunk/openhpid/alarm.h openhpi/trunk/openhpid/conf.h openhpi/trunk/openhpid/hotswap.h openhpi/trunk/openhpid/init.h openhpi/trunk/openhpid/threaded.h Removed Paths: ------------- openhpi/trunk/include/oh_alarm.h openhpi/trunk/include/oh_config.h openhpi/trunk/include/oh_hotswap.h openhpi/trunk/include/oh_init.h openhpi/trunk/include/oh_threaded.h Modified: openhpi/trunk/hpi_shell/commands.c =================================================================== --- openhpi/trunk/hpi_shell/commands.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/hpi_shell/commands.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -27,7 +27,6 @@ #include <ctype.h> #include <unistd.h> #include <config.h> -#include <oh_config.h> #include <oHpi.h> #include <hpi_ui.h> #include "hpi_cmd.h" Deleted: openhpi/trunk/include/oh_alarm.h =================================================================== --- openhpi/trunk/include/oh_alarm.h 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/include/oh_alarm.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -1,82 +0,0 @@ -/* -*- linux-c -*- - * - * (C) Copyright IBM Corp. 2004-2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Author(s): - * Renier Morales <re...@op...> - * - */ - -#ifndef __OH_ALARM_H -#define __OH_ALARM_H - -#include <SaHpi.h> -#include <oh_domain.h> -#include <oh_event.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define OH_MAX_DAT_SIZE_LIMIT 0 -#define OH_MAX_DAT_USER_LIMIT 0 - -/* Alarm Handling */ -SaHpiAlarmT *oh_add_alarm(struct oh_domain *d, - SaHpiAlarmT *alarm, - int fromfile); -SaHpiAlarmT *oh_get_alarm(struct oh_domain *d, - SaHpiAlarmIdT *aid, - SaHpiSeverityT *severity, - SaHpiStatusCondTypeT *type, - SaHpiResourceIdT *rid, - SaHpiManufacturerIdT *mid, - SaHpiSensorNumT *num, - SaHpiEventStateT *state, - SaHpiBoolT unacknowledged, - int get_next); -SaErrorT oh_remove_alarm(struct oh_domain *d, - SaHpiSeverityT *severity, - SaHpiStatusCondTypeT *type, - SaHpiResourceIdT *rid, - SaHpiManufacturerIdT *mid, - SaHpiSensorNumT *num, - SaHpiEventStateT *state, - SaHpiEventStateT *deassert_mask, - int multi); -SaErrorT oh_close_alarmtable(struct oh_domain *d); -SaHpiUint32T oh_count_alarms(struct oh_domain *d, SaHpiSeverityT sev); - -/* Alarm Triggers */ -SaErrorT oh_detect_event_alarm(struct oh_domain *d, - struct oh_event *e); -SaErrorT oh_detect_res_sev_alarm(SaHpiDomainIdT did, - SaHpiResourceIdT rid, - SaHpiSeverityT new_sev); -SaErrorT oh_detect_sensor_enable_alarm(SaHpiDomainIdT did, - SaHpiResourceIdT rid, - SaHpiSensorNumT num, - SaHpiBoolT enable); -SaErrorT oh_detect_sensor_mask_alarm(SaHpiDomainIdT did, - SaHpiResourceIdT rid, - SaHpiSensorNumT num, - SaHpiSensorEventMaskActionT action, - SaHpiEventStateT deassert_mask); - -/* Persistency */ -SaErrorT oh_alarms_to_file(struct oh_dat *at, char *filename); -SaErrorT oh_alarms_from_file(struct oh_domain *d, char *filename); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __OH_ALARM_H */ - Deleted: openhpi/trunk/include/oh_config.h =================================================================== --- openhpi/trunk/include/oh_config.h 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/include/oh_config.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -1,84 +0,0 @@ -/* -*- linux-c -*- - * - * (C) Copyright IBM Corp. 2003-2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Authors: - * Sean Dague <http://dague.net/sean> - * Renier Morales <re...@op...> - * Bryan Sutula <su...@us...> - */ - -#ifndef __OH_CONFIG_H -#define __OH_CONFIG_H - -#include <glib.h> -#include <SaHpi.h> -#include <oh_utils.h> - -#ifdef __cplusplus -extern "C" { -#endif - -struct oh_parsed_config { - GSList *handler_configs; - guint handlers_defined; - guint handlers_loaded; -}; - -typedef enum { - OPENHPI_ON_EP = 1, - OPENHPI_LOG_ON_SEV, - OPENHPI_EVT_QUEUE_LIMIT, - OPENHPI_DEL_SIZE_LIMIT, - OPENHPI_DEL_SAVE, - OPENHPI_DAT_SIZE_LIMIT, - OPENHPI_DAT_USER_LIMIT, - OPENHPI_DAT_SAVE, - OPENHPI_PATH, - OPENHPI_VARPATH, - OPENHPI_CONF, - OPENHPICLIENT_CONF, - OPENHPI_UNCONFIGURED -} oh_global_param_type; - -typedef union { - SaHpiEntityPathT on_ep; - SaHpiSeverityT log_on_sev; - SaHpiUint32T evt_queue_limit; - SaHpiUint32T del_size_limit; - SaHpiBoolT del_save; - SaHpiUint32T dat_size_limit; - SaHpiUint32T dat_user_limit; - SaHpiBoolT dat_save; - char path[OH_MAX_TEXT_BUFFER_LENGTH]; - char varpath[OH_MAX_TEXT_BUFFER_LENGTH]; - char conf[OH_MAX_TEXT_BUFFER_LENGTH]; - SaHpiBoolT unconfigured; -} oh_global_param_union; - -struct oh_global_param { - oh_global_param_type type; - oh_global_param_union u; -}; - -/* Plugin configuration information prototypes */ -int oh_load_config(char *filename, struct oh_parsed_config *config); -SaErrorT oh_process_config(struct oh_parsed_config *config); -void oh_clean_config(struct oh_parsed_config *config); - -/* For handling global parameters */ -int oh_get_global_param(struct oh_global_param *param); -int oh_set_global_param(struct oh_global_param *param); - -#ifdef __cplusplus -} -#endif - -#endif/*__OH_CONFIG_H*/ Deleted: openhpi/trunk/include/oh_hotswap.h =================================================================== --- openhpi/trunk/include/oh_hotswap.h 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/include/oh_hotswap.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -1,37 +0,0 @@ -/* -*- linux-c -*- - * - * Copyright (c) 2004 by Intel Corp. - * (C) Copyright IBM Corp. 2005-2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Authors: - * Racing Guo <rac...@in...> - * Renier Morales <re...@op...> - */ - -#ifndef __OH_HOTSWAP_H -#define __OH_HOTSWAP_H - -#include <SaHpi.h> -#include <oh_domain.h> - -#ifdef __cplusplus -extern "C" { -#endif - -SaHpiTimeoutT get_hotswap_auto_insert_timeout(struct oh_domain *d); -void set_hotswap_auto_insert_timeout(struct oh_domain *d, SaHpiTimeoutT t); -SaHpiBoolT oh_allowed_hotswap_transition(SaHpiHsStateT from, SaHpiHsStateT to); - - -#ifdef __cplusplus -} -#endif - -#endif /* __OH_HOTSWAP_H */ Deleted: openhpi/trunk/include/oh_init.h =================================================================== --- openhpi/trunk/include/oh_init.h 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/include/oh_init.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -1,34 +0,0 @@ -/* -*- linux-c -*- - * - * (C) Copyright IBM Corp. 2004-2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Author(s): - * Renier Morales <re...@op...> - * David M Jukdkovics <dmj...@us...> - * - */ - -#ifndef __OH_INIT_H -#define __OH_INIT_H - -#include <SaHpi.h> - -#ifdef __cplusplus -extern "C" { -#endif - -int oh_init(void); -int oh_finit(void); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __OH_INIT_H */ Deleted: openhpi/trunk/include/oh_threaded.h =================================================================== --- openhpi/trunk/include/oh_threaded.h 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/include/oh_threaded.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -1,37 +0,0 @@ -/* -*- linux-c -*- - * - * (C) Copyright IBM Corp. 2005-2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Author(s): - * Renier Morales <re...@op...> - * - */ - -#ifndef __OH_THREADED_H -#define __OH_THREADED_H - -#include <SaHpi.h> -#include <glib.h> - -#ifdef __cplusplus -extern "C" { -#endif - -int oh_threaded_init(void); -int oh_threaded_start(void); -int oh_threaded_final(void); - -void oh_wake_discovery_thread(SaHpiBoolT wait); - -#ifdef __cplusplus -} -#endif - -#endif /* __OH_THREADED_H */ Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-20 22:44:21 UTC (rev 7217) @@ -24,7 +24,15 @@ DIST_SUBDIRS = t EXTRA_DIST = \ - Makefile.mingw32 openhpid.sh.in lock.h server.h + Makefile.mingw32 \ + openhpid.sh.in \ + alarm.h \ + conf.h \ + hotswap.h \ + init.h \ + lock.h \ + server.h \ + threaded.h # daemon library noinst_LTLIBRARIES = libopenhpidaemon.la Modified: openhpi/trunk/openhpid/alarm.c =================================================================== --- openhpi/trunk/openhpid/alarm.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/alarm.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -17,11 +17,12 @@ #include <stdio.h> #include <string.h> -#include <oh_alarm.h> -#include <oh_config.h> #include <oh_error.h> #include <oh_utils.h> +#include "alarm.h" +#include "conf.h" + static void __update_dat(struct oh_domain *d) { if (!d) return; Copied: openhpi/trunk/openhpid/alarm.h (from rev 7215, openhpi/trunk/include/oh_alarm.h) =================================================================== --- openhpi/trunk/openhpid/alarm.h (rev 0) +++ openhpi/trunk/openhpid/alarm.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -0,0 +1,82 @@ +/* -*- linux-c -*- + * + * (C) Copyright IBM Corp. 2004-2006 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Renier Morales <re...@op...> + * + */ + +#ifndef __OH_ALARM_H +#define __OH_ALARM_H + +#include <SaHpi.h> +#include <oh_domain.h> +#include <oh_event.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define OH_MAX_DAT_SIZE_LIMIT 0 +#define OH_MAX_DAT_USER_LIMIT 0 + +/* Alarm Handling */ +SaHpiAlarmT *oh_add_alarm(struct oh_domain *d, + SaHpiAlarmT *alarm, + int fromfile); +SaHpiAlarmT *oh_get_alarm(struct oh_domain *d, + SaHpiAlarmIdT *aid, + SaHpiSeverityT *severity, + SaHpiStatusCondTypeT *type, + SaHpiResourceIdT *rid, + SaHpiManufacturerIdT *mid, + SaHpiSensorNumT *num, + SaHpiEventStateT *state, + SaHpiBoolT unacknowledged, + int get_next); +SaErrorT oh_remove_alarm(struct oh_domain *d, + SaHpiSeverityT *severity, + SaHpiStatusCondTypeT *type, + SaHpiResourceIdT *rid, + SaHpiManufacturerIdT *mid, + SaHpiSensorNumT *num, + SaHpiEventStateT *state, + SaHpiEventStateT *deassert_mask, + int multi); +SaErrorT oh_close_alarmtable(struct oh_domain *d); +SaHpiUint32T oh_count_alarms(struct oh_domain *d, SaHpiSeverityT sev); + +/* Alarm Triggers */ +SaErrorT oh_detect_event_alarm(struct oh_domain *d, + struct oh_event *e); +SaErrorT oh_detect_res_sev_alarm(SaHpiDomainIdT did, + SaHpiResourceIdT rid, + SaHpiSeverityT new_sev); +SaErrorT oh_detect_sensor_enable_alarm(SaHpiDomainIdT did, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT enable); +SaErrorT oh_detect_sensor_mask_alarm(SaHpiDomainIdT did, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorEventMaskActionT action, + SaHpiEventStateT deassert_mask); + +/* Persistency */ +SaErrorT oh_alarms_to_file(struct oh_dat *at, char *filename); +SaErrorT oh_alarms_from_file(struct oh_domain *d, char *filename); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __OH_ALARM_H */ + Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/conf.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -24,10 +24,10 @@ #include <string.h> #include <config.h> -#include <oh_config.h> #include <oh_plugin.h> #include <oh_error.h> +#include "conf.h" #include "lock.h" /* Copied: openhpi/trunk/openhpid/conf.h (from rev 7215, openhpi/trunk/include/oh_config.h) =================================================================== --- openhpi/trunk/openhpid/conf.h (rev 0) +++ openhpi/trunk/openhpid/conf.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -0,0 +1,84 @@ +/* -*- linux-c -*- + * + * (C) Copyright IBM Corp. 2003-2006 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Authors: + * Sean Dague <http://dague.net/sean> + * Renier Morales <re...@op...> + * Bryan Sutula <su...@us...> + */ + +#ifndef __OH_CONFIG_H +#define __OH_CONFIG_H + +#include <glib.h> +#include <SaHpi.h> +#include <oh_utils.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct oh_parsed_config { + GSList *handler_configs; + guint handlers_defined; + guint handlers_loaded; +}; + +typedef enum { + OPENHPI_ON_EP = 1, + OPENHPI_LOG_ON_SEV, + OPENHPI_EVT_QUEUE_LIMIT, + OPENHPI_DEL_SIZE_LIMIT, + OPENHPI_DEL_SAVE, + OPENHPI_DAT_SIZE_LIMIT, + OPENHPI_DAT_USER_LIMIT, + OPENHPI_DAT_SAVE, + OPENHPI_PATH, + OPENHPI_VARPATH, + OPENHPI_CONF, + OPENHPICLIENT_CONF, + OPENHPI_UNCONFIGURED +} oh_global_param_type; + +typedef union { + SaHpiEntityPathT on_ep; + SaHpiSeverityT log_on_sev; + SaHpiUint32T evt_queue_limit; + SaHpiUint32T del_size_limit; + SaHpiBoolT del_save; + SaHpiUint32T dat_size_limit; + SaHpiUint32T dat_user_limit; + SaHpiBoolT dat_save; + char path[OH_MAX_TEXT_BUFFER_LENGTH]; + char varpath[OH_MAX_TEXT_BUFFER_LENGTH]; + char conf[OH_MAX_TEXT_BUFFER_LENGTH]; + SaHpiBoolT unconfigured; +} oh_global_param_union; + +struct oh_global_param { + oh_global_param_type type; + oh_global_param_union u; +}; + +/* Plugin configuration information prototypes */ +int oh_load_config(char *filename, struct oh_parsed_config *config); +SaErrorT oh_process_config(struct oh_parsed_config *config); +void oh_clean_config(struct oh_parsed_config *config); + +/* For handling global parameters */ +int oh_get_global_param(struct oh_global_param *param); +int oh_set_global_param(struct oh_global_param *param); + +#ifdef __cplusplus +} +#endif + +#endif/*__OH_CONFIG_H*/ Modified: openhpi/trunk/openhpid/domain.c =================================================================== --- openhpi/trunk/openhpid/domain.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/domain.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -19,14 +19,15 @@ #include <oHpi.h> -#include <oh_alarm.h> -#include <oh_config.h> #include <oh_domain.h> #include <oh_error.h> #include <oh_event.h> #include <oh_plugin.h> #include <oh_utils.h> +#include "alarm.h" +#include "conf.h" + #define domains_lock() g_static_rec_mutex_lock(&oh_domains.lock) #define domains_unlock() g_static_rec_mutex_unlock(&oh_domains.lock) Modified: openhpi/trunk/openhpid/event.c =================================================================== --- openhpi/trunk/openhpid/event.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/event.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -24,16 +24,18 @@ #include <oHpi.h> +#include <oh_domain.h> +#include <oh_error.h> #include <oh_event.h> -#include <oh_config.h> #include <oh_handler.h> #include <oh_plugin.h> -#include <oh_domain.h> #include <oh_session.h> -#include <oh_alarm.h> #include <oh_utils.h> -#include <oh_error.h> +#include "alarm.h" +#include "conf.h" + + struct _oh_evt_queue { GAsyncQueue *q; }; Modified: openhpi/trunk/openhpid/hotswap.c =================================================================== --- openhpi/trunk/openhpid/hotswap.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/hotswap.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -19,8 +19,9 @@ * Renier Morales <re...@op...> */ -#include <oh_hotswap.h> +#include "hotswap.h" + SaHpiTimeoutT get_hotswap_auto_insert_timeout(struct oh_domain *d) { return d->ai_timeout; Copied: openhpi/trunk/openhpid/hotswap.h (from rev 7215, openhpi/trunk/include/oh_hotswap.h) =================================================================== --- openhpi/trunk/openhpid/hotswap.h (rev 0) +++ openhpi/trunk/openhpid/hotswap.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -0,0 +1,37 @@ +/* -*- linux-c -*- + * + * Copyright (c) 2004 by Intel Corp. + * (C) Copyright IBM Corp. 2005-2006 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Authors: + * Racing Guo <rac...@in...> + * Renier Morales <re...@op...> + */ + +#ifndef __OH_HOTSWAP_H +#define __OH_HOTSWAP_H + +#include <SaHpi.h> +#include <oh_domain.h> + +#ifdef __cplusplus +extern "C" { +#endif + +SaHpiTimeoutT get_hotswap_auto_insert_timeout(struct oh_domain *d); +void set_hotswap_auto_insert_timeout(struct oh_domain *d, SaHpiTimeoutT t); +SaHpiBoolT oh_allowed_hotswap_transition(SaHpiHsStateT from, SaHpiHsStateT to); + + +#ifdef __cplusplus +} +#endif + +#endif /* __OH_HOTSWAP_H */ Modified: openhpi/trunk/openhpid/init.c =================================================================== --- openhpi/trunk/openhpid/init.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/init.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -20,19 +20,19 @@ #include <oHpi.h> #include <config.h> -#include <oh_config.h> #include <oh_domain.h> #include <oh_error.h> -#include <oh_init.h> #ifndef _WIN32 #include <oh_ssl.h> #endif /* _WIN32 */ #include <oh_plugin.h> #include <oh_session.h> -#include <oh_threaded.h> #include <oh_utils.h> +#include "conf.h" +#include "init.h" #include "lock.h" +#include "threaded.h" /** * oh_init Copied: openhpi/trunk/openhpid/init.h (from rev 7215, openhpi/trunk/include/oh_init.h) =================================================================== --- openhpi/trunk/openhpid/init.h (rev 0) +++ openhpi/trunk/openhpid/init.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -0,0 +1,34 @@ +/* -*- linux-c -*- + * + * (C) Copyright IBM Corp. 2004-2006 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Renier Morales <re...@op...> + * David M Jukdkovics <dmj...@us...> + * + */ + +#ifndef __OH_INIT_H +#define __OH_INIT_H + +#include <SaHpi.h> + +#ifdef __cplusplus +extern "C" { +#endif + +int oh_init(void); +int oh_finit(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __OH_INIT_H */ Modified: openhpi/trunk/openhpid/ohpi.c =================================================================== --- openhpi/trunk/openhpid/ohpi.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/ohpi.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -20,8 +20,6 @@ #include <string.h> #include <oHpi.h> -#include <oh_config.h> -#include <oh_init.h> #include <oh_plugin.h> #include <oh_event.h> #include <oh_domain.h> @@ -31,8 +29,11 @@ #include <sahpimacros.h> #include <config.h> +#include "conf.h" +#include "init.h" #include "lock.h" + /** * oHpiVersionGet * Modified: openhpi/trunk/openhpid/openhpid-posix.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-posix.cpp 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/openhpid-posix.cpp 2010-12-20 22:44:21 UTC (rev 7217) @@ -35,8 +35,8 @@ #include <oHpi.h> #include <oh_error.h> -#include <oh_init.h> +#include "init.h" #include "server.h" Modified: openhpi/trunk/openhpid/openhpid-win32.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-win32.cpp 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/openhpid-win32.cpp 2010-12-20 22:44:21 UTC (rev 7217) @@ -20,8 +20,7 @@ #include <oHpi.h> -#include <oh_init.h> - +#include "init.h" #include "server.h" Modified: openhpi/trunk/openhpid/plugin.c =================================================================== --- openhpi/trunk/openhpid/plugin.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/plugin.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -26,11 +26,11 @@ #include <config.h> -#include <oh_config.h> #include <oh_domain.h> #include <oh_error.h> #include <oh_plugin.h> +#include "conf.h" #include "lock.h" /* Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/safhpi.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -27,20 +27,21 @@ #include <SaHpi.h> +#include <oh_domain.h> #include <oh_error.h> -#include <oh_threaded.h> -#include <oh_utils.h> -#include <sahpimacros.h> - -#include <oh_alarm.h> -#include <oh_config.h> -#include <oh_domain.h> #include <oh_handler.h> -#include <oh_hotswap.h> -#include <oh_init.h> #include <oh_plugin.h> #include <oh_session.h> +#include <oh_utils.h> +#include <sahpimacros.h> +#include "alarm.h" +#include "conf.h" +#include "hotswap.h" +#include "init.h" +#include "threaded.h" + + /********************************************************************* * * Begin SAHPI B.03.01 Functions. For full documentation please see Modified: openhpi/trunk/openhpid/session.c =================================================================== --- openhpi/trunk/openhpid/session.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/session.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -18,12 +18,12 @@ #include <oHpi.h> -#include <oh_config.h> #include <oh_domain.h> #include <oh_error.h> #include <oh_session.h> #include <oh_utils.h> +#include "conf.h" #include "lock.h" struct oh_session_table oh_sessions = { Modified: openhpi/trunk/openhpid/threaded.c =================================================================== --- openhpi/trunk/openhpid/threaded.c 2010-12-20 21:43:29 UTC (rev 7216) +++ openhpi/trunk/openhpid/threaded.c 2010-12-20 22:44:21 UTC (rev 7217) @@ -14,13 +14,14 @@ * */ -#include <oh_config.h> #include <oh_error.h> -#include <oh_hotswap.h> #include <oh_plugin.h> -#include <oh_threaded.h> +#include "conf.h" +#include "hotswap.h" +#include "threaded.h" + #define OH_DISCOVERY_THREAD_SLEEP_TIME 180 * G_USEC_PER_SEC #define OH_EVTGET_THREAD_SLEEP_TIME 3 * G_USEC_PER_SEC Copied: openhpi/trunk/openhpid/threaded.h (from rev 7215, openhpi/trunk/include/oh_threaded.h) =================================================================== --- openhpi/trunk/openhpid/threaded.h (rev 0) +++ openhpi/trunk/openhpid/threaded.h 2010-12-20 22:44:21 UTC (rev 7217) @@ -0,0 +1,37 @@ +/* -*- linux-c -*- + * + * (C) Copyright IBM Corp. 2005-2006 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Renier Morales <re...@op...> + * + */ + +#ifndef __OH_THREADED_H +#define __OH_THREADED_H + +#include <SaHpi.h> +#include <glib.h> + +#ifdef __cplusplus +extern "C" { +#endif + +int oh_threaded_init(void); +int oh_threaded_start(void); +int oh_threaded_final(void); + +void oh_wake_discovery_thread(SaHpiBoolT wait); + +#ifdef __cplusplus +} +#endif + +#endif /* __OH_THREADED_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-21 19:50:36
|
Revision: 7219 http://openhpi.svn.sourceforge.net/openhpi/?rev=7219&view=rev Author: avpak Date: 2010-12-21 19:50:29 +0000 (Tue, 21 Dec 2010) Log Message: ----------- More on Feature Request #3138629 Modified Paths: -------------- openhpi/trunk/openhpid/alarm.c openhpi/trunk/openhpid/conf.c openhpi/trunk/utils/el_utils.c openhpi/trunk/utils/epath_utils.c openhpi/trunk/utils/rpt_utils.c openhpi/trunk/utils/sahpi_event_utils.c openhpi/trunk/utils/sahpi_struct_utils.c openhpi/trunk/utils/uid_utils.c Modified: openhpi/trunk/openhpid/alarm.c =================================================================== --- openhpi/trunk/openhpid/alarm.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/openhpid/alarm.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -120,7 +120,6 @@ struct oh_global_param param = { .type = OPENHPI_DAT_SIZE_LIMIT }; if (!d) { - err("NULL domain pointer passed."); return NULL; } @@ -685,7 +684,6 @@ FILE * fp; if (!at || !filename) { - err("Invalid Parameters"); return SA_ERR_HPI_INVALID_PARAMS; } @@ -703,10 +701,7 @@ } } - if (fclose(fp) != 0) { - err("Couldn't close file '%s'.", filename); - return SA_ERR_HPI_ERROR; - } + fclose(fp); return SA_OK; } @@ -726,7 +721,6 @@ SaHpiAlarmT alarm; if (!d || !filename) { - err("Invalid Parameters"); return SA_ERR_HPI_ERROR; } @@ -745,10 +739,7 @@ } } - if (fclose(fp) != 0) { - err("Couldn't close file '%s'.", filename); - return SA_ERR_HPI_ERROR; - } + fclose(fp); return SA_OK; } Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/openhpid/conf.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -542,11 +542,7 @@ read_globals_from_env(1); - if (fclose(fp) != 0) { - err("Couldn't close file '%s'.", filename); - g_scanner_destroy(oh_scanner); - return -5; - } + fclose(fp); done = oh_scanner->parse_errors; Modified: openhpi/trunk/utils/el_utils.c =================================================================== --- openhpi/trunk/utils/el_utils.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/utils/el_utils.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -340,10 +340,7 @@ } } - if (fclose(fp) != 0) { - err("Couldn't close file '%s'.", filename); - return SA_ERR_HPI_ERROR; - } + fclose(fp); return SA_OK; } @@ -377,10 +374,7 @@ el->list = g_list_append(el->list, elentry); } - if (fclose(fp) != 0) { - err("Couldn't close file '%s'.", filename); - return SA_ERR_HPI_ERROR; - } + fclose(fp); return SA_OK; } Modified: openhpi/trunk/utils/epath_utils.c =================================================================== --- openhpi/trunk/utils/epath_utils.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/utils/epath_utils.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -59,24 +59,27 @@ SaHpiTextBufferT tmpbuffer; SaHpiEntityTypeT eptype; - if (!epstr || epstr[0] == '\0' || !ep) { - err("Invalid parameter."); + if (!epstr || !ep) { return(SA_ERR_HPI_INVALID_PARAMS); } /* Check for runaway string */ if (strlen(epstr) > OH_MAX_TEXT_BUFFER_LENGTH) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_DATA); } /* Split out {xxx,yyy} definition pairs */ gstr = g_strstrip(g_strdup(epstr)); - if (gstr == NULL || gstr[0] == '\0') { + if (gstr == NULL) { err("Stripped entity path string is NULL"); err = SA_ERR_HPI_INVALID_DATA; goto CLEANUP; } + if (gstr[0] == '\0') { + oh_init_ep(ep); + err = SA_OK; + goto CLEANUP; + } epathdefs = g_strsplit(gstr, EPATHSTRING_END_DELIMITER, -1); if (epathdefs == NULL) { @@ -131,7 +134,6 @@ if (num_entities < SAHPI_MAX_ENTITY_PATH) { entityptr = g_new0(SaHpiEntityT, 1); if (entityptr == NULL) { - err("No memory."); err = SA_ERR_HPI_OUT_OF_SPACE; goto CLEANUP; } @@ -215,7 +217,6 @@ SaErrorT err = SA_OK; if (!bigbuf || !ep) { - err("Invalid parameter"); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -224,7 +225,6 @@ locstr = g_new0(gchar, OH_MAX_LOCATION_DIGITS + 1); if (locstr == NULL) { - err("No memory."); err = SA_ERR_HPI_OUT_OF_SPACE; goto CLEANUP; } @@ -301,7 +301,6 @@ int i; if (!ep) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -331,7 +330,6 @@ int i, j; if (!dest) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -402,12 +400,10 @@ int i; if (!ep) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } if (!oh_valid_ep(ep)) { - err("Invalid entity path"); return(SA_ERR_HPI_INVALID_DATA); } @@ -442,7 +438,6 @@ unsigned int i, j; if (!ep1 || !ep2) { - err("Invalid parameter."); return(SAHPI_FALSE); } @@ -494,7 +489,6 @@ SaErrorT err; if (!ep) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -586,7 +580,6 @@ guint total_num_digits, i, work_location_num, num_digits; if (!ep || !str) { - err("NULL parameter."); return(NULL); } @@ -699,7 +692,6 @@ oh_entitypath_pattern pattern; if (!epp_str || !epp) { - err("Got null parameters."); return SA_ERR_HPI_INVALID_PARAMS; } memset(&pattern, 0, sizeof(oh_entitypath_pattern)); Modified: openhpi/trunk/utils/rpt_utils.c =================================================================== --- openhpi/trunk/utils/rpt_utils.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/utils/rpt_utils.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -40,7 +40,6 @@ RPTEntry *rptentry = NULL; if (!table) { - err("ERROR: Cannot work on a null table pointer."); return NULL; } @@ -64,7 +63,6 @@ GSList *rptnode = NULL; if (!table) { - err("ERROR: Cannot work on a null table pointer."); return NULL; } @@ -88,7 +86,6 @@ RDRecord *rdrecord = NULL; if (!rptentry) { - err("ERROR: Cannot lookup rdr inside null resource."); return NULL; } @@ -112,7 +109,6 @@ GSList *rdrnode = NULL; if (!rptentry) { - err("ERROR: Cannot lookup rdr inside null resource."); return NULL; } @@ -160,7 +156,6 @@ static void update_rptable(RPTable *table) { if (!table) { - err("ERROR: Cannot work on a null table pointer."); return; } oh_gettimeofday(&table->update_timestamp); @@ -246,7 +241,6 @@ SaErrorT oh_init_rpt(RPTable *table) { if (!table) { - err("ERROR: Cannot work on a null table pointer."); return SA_ERR_HPI_INVALID_PARAMS; } @@ -372,7 +366,6 @@ SaHpiTimeT *update_timestamp) { if (!table || !update_count || !update_timestamp) { - err("ERROR: Invalid parameters."); return SA_ERR_HPI_INVALID_PARAMS; } @@ -414,19 +407,14 @@ int update_info = 0; if (!table) { - err("ERROR: Cannot work on a null table pointer."); return SA_ERR_HPI_INVALID_PARAMS; } else if (!entry) { - err("Failed to add. RPT entry is NULL."); return SA_ERR_HPI_INVALID_PARAMS; } else if (entry->ResourceId == SAHPI_FIRST_ENTRY) { - err("Failed to add. RPT entry needs a resource id before being added"); return SA_ERR_HPI_INVALID_PARAMS; } else if (entry->ResourceId == SAHPI_UNSPECIFIED_RESOURCE_ID) { - err("Failed to add. RPT entry has an invalid/reserved id assigned. (SAHPI_UNSPECIFIED_RESOURCE_ID)"); return SA_ERR_HPI_INVALID_PARAMS; } else if (!oh_valid_ep(&(entry->ResourceEntity))) { - err("Failed to add RPT entry. Entity path does not contain root element."); return SA_ERR_HPI_INVALID_PARAMS; } @@ -437,7 +425,6 @@ if (!rptentry) { rptentry = g_new0(RPTEntry, 1); if (!rptentry) { - err("Not enough memory to add RPT entry."); return SA_ERR_HPI_OUT_OF_MEMORY; } update_info = 1; /* Have a new changed entry */ @@ -487,7 +474,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Failed to remove RPT entry. No Resource found by that id"); return SA_ERR_HPI_NOT_PRESENT; } else { SaHpiRdrT *tmp_rdr; @@ -579,7 +565,6 @@ SaHpiResourceIdT rid = 0; if (!table) { - err("ERROR: Cannot work on a null table pointer."); return NULL; } /* Check the uid database first */ @@ -657,11 +642,9 @@ { RPTEntry *rptentry = get_rptentry_by_rid(table, rid); if ( !rptentry ) { - err("Failed to get RPT entry. No Resource found by that id."); return SA_ERR_HPI_NOT_PRESENT; } if ( !update_count ) { - err("Failed to get rdr update counter. Output data pointer is NULL."); return SA_ERR_HPI_INVALID_PARAMS; } *update_count = rptentry->update_count; @@ -702,13 +685,11 @@ SaHpiInstrumentIdT instr_id; if (!rdr) { - err("Failed to add. RDR is NULL."); return SA_ERR_HPI_INVALID_PARAMS; } rptentry = get_rptentry_by_rid(table, rid); if (!rptentry){ - err("Failed to add RDR. Parent RPT entry was not found in table."); return SA_ERR_HPI_NOT_PRESENT; } @@ -727,7 +708,6 @@ if (!rdrecord) { rdrecord = g_new0(RDRecord, 1); if (!rdrecord) { - err("Not enough memory to add RDR."); return SA_ERR_HPI_OUT_OF_MEMORY; } /* Put new rdrecord in rdr repository */ @@ -778,13 +758,11 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Failed to remove RDR. Parent RPT entry was not found."); return SA_ERR_HPI_NOT_PRESENT; } rdrecord = get_rdrecord_by_id(rptentry, rdrid); if (!rdrecord) { - err("Failed to remove RDR. Could not be found."); return SA_ERR_HPI_NOT_PRESENT; } else { rptentry->rdrlist = g_slist_remove(rptentry->rdrlist, (gpointer)rdrecord); @@ -824,7 +802,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Warning: RPT entry not found. Cannot find RDR."); return NULL; /* No resource found by that id */ } @@ -859,7 +836,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Warning: RPT entry not found. Cannot find RDR."); return NULL; /* No resource found by that id */ } @@ -896,7 +872,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Warning: RPT entry not found. Cannot find RDR."); return NULL; /* No resource found by that id */ } @@ -937,7 +912,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Warning: RPT entry not found. Cannot find RDR."); return NULL; /* No resource found by that id */ } @@ -962,7 +936,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Warning: RPT entry not found. Cannot find RDR."); return NULL; /* No resource found by that id */ } @@ -988,7 +961,6 @@ rptentry = get_rptentry_by_rid(table, rid); if (!rptentry) { - err("Warning: RPT entry not found. Cannot find RDR."); return NULL; /* No resource found by that id */ } Modified: openhpi/trunk/utils/sahpi_event_utils.c =================================================================== --- openhpi/trunk/utils/sahpi_event_utils.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/utils/sahpi_event_utils.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -54,7 +54,6 @@ /* Don't check for mutual exclusive events, since we want to see them all */ if (!buffer || !oh_valid_eventstate(event_state, event_cat, SAHPI_FALSE)) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -145,11 +144,9 @@ SaHpiEventCategoryT working_cat=0; if (!buffer || !event_state || !event_cat) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } if (buffer->Data == NULL || buffer->Data[0] == '\0') { - err("Invalid Data buffer parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -170,7 +167,6 @@ eventdefs = g_strsplit(gstr, OH_ENCODE_DELIMITER_CHAR, -1); if (eventdefs == NULL) { - err("No event definitions"); rtncode = SA_ERR_HPI_INVALID_PARAMS; goto CLEANUP; } @@ -571,7 +567,6 @@ SaErrorT oh_valid_addevent(SaHpiEventT *event) { if (!event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -580,7 +575,6 @@ NULL == oh_lookup_severity(event->Severity) || event->Severity == SAHPI_ALL_SEVERITIES || !oh_valid_textbuffer(&(event->EventDataUnion.UserEvent.UserEventData))) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } Modified: openhpi/trunk/utils/sahpi_struct_utils.c =================================================================== --- openhpi/trunk/utils/sahpi_struct_utils.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/utils/sahpi_struct_utils.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -92,7 +92,6 @@ SaHpiTextBufferT working; if (!buffer) { - err("Invalid parameters."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -389,15 +388,12 @@ char str[SAHPI_SENSOR_BUFFER_LENGTH + 1]; if (!buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } if (!reading.IsSupported || !format.IsSupported) { - err("Invalid Command."); return(SA_ERR_HPI_INVALID_CMD); } if (reading.Type != format.ReadingType) { - err("Invalid Data."); return(SA_ERR_HPI_INVALID_DATA); } @@ -530,7 +526,6 @@ if (!buffer || !reading || buffer->Data == NULL || buffer->Data[0] == '\0' || !oh_lookup_sensorreadingtype(type)) { - err("Invalid parameter"); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -703,12 +698,10 @@ if (buffer->DataType == SAHPI_TL_TYPE_TEXT) { err = fwrite( buffer->Data, buffer->DataLength, 1, stream); if (err < 0) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } } else { - err("Invalid Data."); return(SA_ERR_HPI_INVALID_DATA); } @@ -740,7 +733,6 @@ } } else { - err("Invalid Data."); return(SA_ERR_HPI_INVALID_DATA); } @@ -760,7 +752,6 @@ SaErrorT oh_init_textbuffer(SaHpiTextBufferT *buffer) { if (!buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -774,7 +765,6 @@ SaErrorT oh_init_bigtext(oh_big_textbuffer *big_buffer) { if (!big_buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -799,7 +789,6 @@ SaErrorT oh_copy_textbuffer(SaHpiTextBufferT *dest, const SaHpiTextBufferT *from) { if (!dest || !from) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -813,7 +802,6 @@ SaErrorT oh_copy_bigtext(oh_big_textbuffer *dest, const oh_big_textbuffer *from) { if (!dest || !from) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -842,7 +830,6 @@ size_t size; if (!buffer || !from) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } size = strlen(from); @@ -867,7 +854,6 @@ size_t size; if (!big_buffer || !from) { - err("Invalid parameters"); return(SA_ERR_HPI_INVALID_PARAMS); } size = strlen(from); @@ -891,7 +877,6 @@ SaHpiUint8T i; if (!big_buffer || !from || len == 0) { - err("Invalid parameters"); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -969,7 +954,6 @@ oh_big_textbuffer buffer; if (!stream || !control) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1002,7 +986,6 @@ oh_big_textbuffer buffer; if (!stream || !watchdog) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1035,7 +1018,6 @@ oh_big_textbuffer buffer; if (!stream || !sensor) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1058,7 +1040,6 @@ SaErrorT err; if (!buffer || !ResourceInfo) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1575,7 +1556,6 @@ oh_big_textbuffer mybuf; if (!stream || !idrinfo) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1607,7 +1587,6 @@ oh_big_textbuffer buffer; if (!stream || !textbuffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1686,7 +1665,6 @@ SaHpiTextBufferT working; if (!buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1811,7 +1789,6 @@ SaHpiTextBufferT working; if (!buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1868,7 +1845,6 @@ char* str = (char *)tmpbuffer.Data; if (!stream || !rptentry) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -1952,7 +1928,6 @@ oh_big_textbuffer mybuf, mybuf1; if (!stream || !thisrdr) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2054,7 +2029,6 @@ SaHpiTextBufferT smallbuf; if (!textbuf || !ctrlrec) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2219,7 +2193,6 @@ oh_big_textbuffer mybuf; if (!textbuff || !invrec) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2262,7 +2235,6 @@ oh_big_textbuffer mybuf; if (!textbuff || !wdogrec) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2299,7 +2271,6 @@ oh_big_textbuffer mybuf; if (!textbuff || !annrec) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2692,7 +2663,6 @@ SaHpiTextBufferT minibuf; if (!stream || !thiselinfo) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2773,7 +2743,6 @@ SaHpiTextBufferT minibuf; if (!stream || !thiseventlog) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2821,7 +2790,6 @@ oh_big_textbuffer buffer; if (!stream || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -2975,7 +2943,6 @@ char str[SAHPI_MAX_TEXT_BUFFER_LENGTH]; if (!buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3004,7 +2971,6 @@ char str[SAHPI_MAX_TEXT_BUFFER_LENGTH]; if (!buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3063,7 +3029,6 @@ SaHpiTextBufferT working; if (!buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3130,7 +3095,6 @@ SaHpiTextBufferT working; if (!buffer) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3184,7 +3148,6 @@ SaHpiTextBufferT tmpbuffer; if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3333,7 +3296,6 @@ SaHpiTextBufferT tmpbuffer; if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3433,7 +3395,6 @@ char str[SAHPI_MAX_TEXT_BUFFER_LENGTH]; if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3480,7 +3441,6 @@ if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3542,7 +3502,6 @@ SaErrorT err; if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3584,7 +3543,6 @@ SaHpiTextBufferT tmpbuffer; if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3624,7 +3582,6 @@ char str[SAHPI_MAX_TEXT_BUFFER_LENGTH]; if ( !buffer || !event) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -3788,7 +3745,6 @@ char str[SAHPI_MAX_TEXT_BUFFER_LENGTH]; if (!stream || !thisctrlstate) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -4094,11 +4050,9 @@ * lower minor >= lower major >= lower critical */ if (!thds || !rdr) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } if (rdr->RdrType != SAHPI_SENSOR_RDR) { - err("Invalid parameter"); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -4147,11 +4101,9 @@ SaHpiSensorDataFormatT format; if (!thds || !rdr) { - err("Invalid parameter."); return(SA_ERR_HPI_INVALID_PARAMS); } if (rdr->RdrType != SAHPI_SENSOR_RDR) { - err("Invalid parameter"); return(SA_ERR_HPI_INVALID_PARAMS); } @@ -4204,7 +4156,6 @@ oh_big_textbuffer bigbuf; if (!stream || !thresholds || !format) { - err("Invalid parameter."); return SA_ERR_HPI_INVALID_PARAMS; } Modified: openhpi/trunk/utils/uid_utils.c =================================================================== --- openhpi/trunk/utils/uid_utils.c 2010-12-21 19:04:58 UTC (rev 7218) +++ openhpi/trunk/utils/uid_utils.c 2010-12-21 19:50:29 UTC (rev 7219) @@ -275,18 +275,16 @@ uid_lock(&oh_uid_lock); ep_xref = (EP_XREF *)g_hash_table_lookup (oh_resource_id_table, key); if(!ep_xref) { - err("error freeing oh_resource_id_table"); uid_unlock(&oh_uid_lock); - return SA_ERR_HPI_ERROR; + return SA_ERR_HPI_NOT_PRESENT; } /* check netry exist in oh_resource_id_table */ key = (gpointer)&ep_xref->entity_path; ep_xref = (EP_XREF *)g_hash_table_lookup (oh_ep_table, key); if(!ep_xref) { - err("error freeing oh_resource_id_table"); uid_unlock(&oh_uid_lock); - return SA_ERR_HPI_ERROR; + return SA_ERR_HPI_NOT_PRESENT; } g_hash_table_remove(oh_resource_id_table, &ep_xref->resource_id); @@ -356,9 +354,8 @@ uid_lock(&oh_uid_lock); ep_xref = (EP_XREF *)g_hash_table_lookup (oh_resource_id_table, key); if(!ep_xref) { - err("error looking up EP to get uid"); uid_unlock(&oh_uid_lock); - return SA_ERR_HPI_ERROR ; + return SA_ERR_HPI_NOT_PRESENT; } memcpy(ep, &ep_xref->entity_path, sizeof(SaHpiEntityPathT)); @@ -406,11 +403,7 @@ /* write all EP_XREF data records */ g_hash_table_foreach(oh_resource_id_table, write_ep_xref, fp); - if(fclose(fp) != 0) { - err("Couldn't close file '%s'.", uid_map_file); - uid_unlock(&oh_uid_lock); - return SA_ERR_HPI_ERROR; - } + fclose(fp); uid_unlock(&oh_uid_lock); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-22 15:00:48
|
Revision: 7222 http://openhpi.svn.sourceforge.net/openhpi/?rev=7222&view=rev Author: avpak Date: 2010-12-22 15:00:41 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Feature request #3141721 Fix for #3141723 Modified Paths: -------------- openhpi/trunk/clients/ohparam.c openhpi/trunk/include/oHpi.h openhpi/trunk/marshal/marshal_hpi_types.c openhpi/trunk/openhpid/conf.c Modified: openhpi/trunk/clients/ohparam.c =================================================================== --- openhpi/trunk/clients/ohparam.c 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/clients/ohparam.c 2010-12-22 15:00:41 UTC (rev 7222) @@ -58,7 +58,7 @@ SaErrorT rv = SA_OK; oHpiGlobalParamTypeT paramtype = OHPI_CONF; - char setparam[OH_MAX_TEXT_BUFFER_LENGTH]; + char setparam[OH_PATH_PARAM_MAX_LENGTH]; SaHpiBoolT printusage = FALSE; int i=1; Modified: openhpi/trunk/include/oHpi.h =================================================================== --- openhpi/trunk/include/oHpi.h 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/include/oHpi.h 2010-12-22 15:00:41 UTC (rev 7222) @@ -24,7 +24,6 @@ #include <SaHpi.h> #include <glib.h> -#include <oh_utils.h> #define OH_DEFAULT_DOMAIN_ID 0 @@ -34,6 +33,8 @@ #define OH_SAHPI_INTERFACE_VERSION_MIN_SUPPORTED (SaHpiVersionT)0x020101 /* B.01.01 */ #define OH_SAHPI_INTERFACE_VERSION_MAX_SUPPORTED SAHPI_INTERFACE_VERSION +#define OH_PATH_PARAM_MAX_LENGTH 2048 + #ifdef __cplusplus extern "C" { #endif @@ -85,9 +86,9 @@ //unsigned char Debug; /* 1 = YES, 0 = NO */ //unsigned char DebugTrace; /* !0 = YES, 0 = NO */ //unsigned char DebugLock; /* !0 = YES, 0 = NO */ - char Path[OH_MAX_TEXT_BUFFER_LENGTH]; /* Dir path to openhpi plugins */ - char VarPath[OH_MAX_TEXT_BUFFER_LENGTH]; /* Dir path for openhpi data */ - char Conf[OH_MAX_TEXT_BUFFER_LENGTH]; /* File path of openhpi configuration */ + char Path[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path to openhpi plugins */ + char VarPath[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path for openhpi data */ + char Conf[OH_PATH_PARAM_MAX_LENGTH]; /* File path of openhpi configuration */ } oHpiGlobalParamUnionT; typedef struct { Modified: openhpi/trunk/marshal/marshal_hpi_types.c =================================================================== --- openhpi/trunk/marshal/marshal_hpi_types.c 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/marshal/marshal_hpi_types.c 2010-12-22 15:00:41 UTC (rev 7222) @@ -1114,9 +1114,9 @@ // global param -static cMarshalType GlobalParamPathArray = dArray( OH_MAX_TEXT_BUFFER_LENGTH, SaHpiUint8T, SaHpiUint8Type ); -static cMarshalType GlobalParamVarPathArray = dArray( OH_MAX_TEXT_BUFFER_LENGTH, SaHpiUint8T, SaHpiUint8Type ); -static cMarshalType GlobalParamConfArray = dArray( SAHPI_MAX_TEXT_BUFFER_LENGTH, SaHpiUint8T, SaHpiUint8Type ); +static cMarshalType GlobalParamPathArray = dArray( OH_PATH_PARAM_MAX_LENGTH, SaHpiUint8T, SaHpiUint8Type ); +static cMarshalType GlobalParamVarPathArray = dArray( OH_PATH_PARAM_MAX_LENGTH, SaHpiUint8T, SaHpiUint8Type ); +static cMarshalType GlobalParamConfArray = dArray( OH_PATH_PARAM_MAX_LENGTH, SaHpiUint8T, SaHpiUint8Type ); static cMarshalType oHpiGlobalParamUnionTypeElements[] = { Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/openhpid/conf.c 2010-12-22 15:00:41 UTC (rev 7222) @@ -59,10 +59,10 @@ SaHpiUint32T dat_size_limit; SaHpiUint32T dat_user_limit; SaHpiBoolT dat_save; - char path[OH_MAX_TEXT_BUFFER_LENGTH]; - char varpath[OH_MAX_TEXT_BUFFER_LENGTH]; - char conf[OH_MAX_TEXT_BUFFER_LENGTH]; - char client_conf[OH_MAX_TEXT_BUFFER_LENGTH]; + char path[OH_PATH_PARAM_MAX_LENGTH]; + char varpath[OH_PATH_PARAM_MAX_LENGTH]; + char conf[OH_PATH_PARAM_MAX_LENGTH]; + char client_conf[OH_PATH_PARAM_MAX_LENGTH]; SaHpiBoolT unconfigured; unsigned char read_env; GStaticRecMutex lock; @@ -197,23 +197,23 @@ } } else if (!strcmp("OPENHPI_PATH", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.path, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.path, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.path, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.path, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPI_VARPATH", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.varpath, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.varpath, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.varpath, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.varpath, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPI_CONF", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.conf, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.conf, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.conf, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPICLIENT_CONF", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.client_conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.client_conf, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.client_conf, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.client_conf, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPI_UNCONFIGURED", name)) { if (!strcmp("YES", value)) { @@ -655,28 +655,28 @@ g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.path, global_params.path, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_VARPATH: g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.varpath, global_params.varpath, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_CONF: g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.conf, global_params.conf, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPICLIENT_CONF: g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.conf, global_params.client_conf, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_UNCONFIGURED: @@ -734,34 +734,34 @@ break; case OPENHPI_PATH: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.path, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.path, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.path, param->u.path, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_VARPATH: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.varpath, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.varpath, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.varpath, param->u.varpath, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_CONF: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.conf, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.conf, param->u.conf, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPICLIENT_CONF: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.conf, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.client_conf, param->u.conf, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_UNCONFIGURED: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-22 15:14:32
|
Revision: 7223 http://openhpi.svn.sourceforge.net/openhpi/?rev=7223&view=rev Author: avpak Date: 2010-12-22 15:14:26 +0000 (Wed, 22 Dec 2010) Log Message: ----------- More on Feature Request #3031797 Updated Makefile. Included oHpi.h in produced output dir. Added Known Issues section. Modified Paths: -------------- openhpi/trunk/Makefile.mingw32 openhpi/trunk/README.windows Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2010-12-22 15:00:41 UTC (rev 7222) +++ openhpi/trunk/Makefile.mingw32 2010-12-22 15:14:26 UTC (rev 7223) @@ -22,10 +22,12 @@ done rm -rf ${out} -out: +out: all + rm -rf ${out} mkdir -p ${out} cp README.windows ${out} cat include/SaHpi.h | sed -e 's/ __attribute__.*/;/' -e 's/#define SAHPI_API/#define SAHPI_API __declspec(dllimport)/' > ${out}/SaHpi.h + cp include/oHpi.h ${out} cp utils/libopenhpiutils-${VERSION}.dll ${out}/ cp utils/libopenhpiutils-${VERSION}.dll.a ${out}/ cp utils/libopenhpiutils-${VERSION}.dll.def ${out}/ Modified: openhpi/trunk/README.windows =================================================================== --- openhpi/trunk/README.windows 2010-12-22 15:00:41 UTC (rev 7222) +++ openhpi/trunk/README.windows 2010-12-22 15:14:26 UTC (rev 7223) @@ -32,7 +32,7 @@ Windows version can be obtained at http://www.gtk.org/download-windows.html ======================================================================== -Current windows build system supports only Mingw compiler. +Current windows build system supports only mingw compiler. http://www.mingw.org/ However the built libraries can be use as ordinary windows DLL in projects with any compiler. @@ -56,7 +56,7 @@ -- GLIB_DIR: in order that GLIB_INCLUDES and GLIB_LIBS point to valid directories with glib headers and libraries. - run "make -f Makefile.mingw32". -- run "make -f Makefile.mingw32 bin". +- run "make -f Makefile.mingw32 out". - the bin subdirectory will contain all produced stuff. ======================================================================== @@ -77,17 +77,30 @@ Define "SAHPI_API" macro as "__declspec(dllimport)". -For Mingw compiler it can be just linked. +For mingw compiler it can be just linked. For MSVC: - There is def file libopenhpi-${VERSION}.dll.def - With lib tool you can create import library - Command example "lib /machine:i386 /def:libopenhpi-${VERSION}.dll.def" +- Point produced import library in Project settings And see Client Usage instrustions about configuring OpenHPI daemon address to connect. ======================================================================== +Library Known Issues: + +Seems mingw has its own copy of environment variables. +So the code: + + _putenv("OPENHPI_DAEMON_HOST=..."); + rv = saHpiSessionOpen(...) + +does not work in MSVC as expected. +But setting any variable before running executable works! + +======================================================================== Troubleshouting: Mailing list: ope...@li... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-22 15:58:49
|
Revision: 7224 http://openhpi.svn.sourceforge.net/openhpi/?rev=7224&view=rev Author: avpak Date: 2010-12-22 15:58:43 +0000 (Wed, 22 Dec 2010) Log Message: ----------- More on Feature Request #3031797 libxxx.dll.a -> libxxx.a libxxx.dll.def -> libxxx.def Modified Paths: -------------- openhpi/trunk/Makefile.mingw32 openhpi/trunk/baselib/Makefile.mingw32 openhpi/trunk/utils/Makefile.mingw32 Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2010-12-22 15:14:26 UTC (rev 7223) +++ openhpi/trunk/Makefile.mingw32 2010-12-22 15:58:43 UTC (rev 7224) @@ -29,12 +29,12 @@ cat include/SaHpi.h | sed -e 's/ __attribute__.*/;/' -e 's/#define SAHPI_API/#define SAHPI_API __declspec(dllimport)/' > ${out}/SaHpi.h cp include/oHpi.h ${out} cp utils/libopenhpiutils-${VERSION}.dll ${out}/ - cp utils/libopenhpiutils-${VERSION}.dll.a ${out}/ - cp utils/libopenhpiutils-${VERSION}.dll.def ${out}/ + cp utils/libopenhpiutils-${VERSION}.a ${out}/ + cp utils/libopenhpiutils-${VERSION}.def ${out}/ cp transport/libopenhpitransport-${VERSION}.dll ${out}/ cp marshal/libopenhpimarshal-${VERSION}.dll ${out}/ cp baselib/libopenhpi-${VERSION}.dll ${out}/ - cp baselib/libopenhpi-${VERSION}.dll.a ${out}/ - cp baselib/libopenhpi-${VERSION}.dll.def ${out}/ + cp baselib/libopenhpi-${VERSION}.a ${out}/ + cp baselib/libopenhpi-${VERSION}.def ${out}/ cp clients/*.exe ${out}/ Modified: openhpi/trunk/baselib/Makefile.mingw32 =================================================================== --- openhpi/trunk/baselib/Makefile.mingw32 2010-12-22 15:14:26 UTC (rev 7223) +++ openhpi/trunk/baselib/Makefile.mingw32 2010-12-22 15:58:43 UTC (rev 7224) @@ -26,9 +26,9 @@ ${TARGET} : ${OBJ} ${CXX} -shared -o $@ $^ ${LIBS} \ - -Wl,--out-implib,$@.a \ - -Wl,--output-def,$@.def + -Wl,--out-implib,${@:.dll=.a} \ + -Wl,--output-def,${@:.dll=.def} clean: - rm -f ${OBJ} ${TARGET} + rm -f ${OBJ} ${TARGET} ${TARGET:.dll=.a} ${TARGET:.dll=.def} Modified: openhpi/trunk/utils/Makefile.mingw32 =================================================================== --- openhpi/trunk/utils/Makefile.mingw32 2010-12-22 15:14:26 UTC (rev 7223) +++ openhpi/trunk/utils/Makefile.mingw32 2010-12-22 15:58:43 UTC (rev 7224) @@ -24,9 +24,9 @@ ${TARGET} : ${OBJ} ${CC} -shared -o $@ $^ ${GLIB_LIBS} \ - -Wl,--out-implib,$@.a \ - -Wl,--output-def,$@.def + -Wl,--out-implib,${@:.dll=.a} \ + -Wl,--output-def,${@:.dll=.def} clean: - rm -f ${OBJ} ${TARGET} + rm -f ${OBJ} ${TARGET} ${TARGET:.dll=.a} ${TARGET:.dll=.def} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-24 16:00:33
|
Revision: 7225 http://openhpi.svn.sourceforge.net/openhpi/?rev=7225&view=rev Author: avpak Date: 2010-12-24 16:00:24 +0000 (Fri, 24 Dec 2010) Log Message: ----------- Feature request #1531430 Modified Paths: -------------- openhpi/trunk/baselib/Makefile.am openhpi/trunk/baselib/conf.c openhpi/trunk/baselib/session.cpp openhpi/trunk/clients/Makefile.am openhpi/trunk/clients/clients.c openhpi/trunk/cpp/Makefile.am openhpi/trunk/cpp/t/Makefile.am openhpi/trunk/hpi_shell/Makefile.am openhpi/trunk/include/oh_error.h openhpi/trunk/include/sahpimacros.h openhpi/trunk/marshal/Makefile.am openhpi/trunk/marshal/t/Makefile.am openhpi/trunk/openhpid/Makefile.am openhpi/trunk/openhpid/alarm.c openhpi/trunk/openhpid/conf.c openhpi/trunk/openhpid/domain.c openhpi/trunk/openhpid/event.c openhpi/trunk/openhpid/init.c openhpi/trunk/openhpid/openhpid-posix.cpp openhpi/trunk/openhpid/plugin.c openhpi/trunk/openhpid/safhpi.c openhpi/trunk/openhpid/server.cpp openhpi/trunk/openhpid/session.c openhpi/trunk/openhpid/t/ohpi/Makefile.am openhpi/trunk/openhpid/threaded.c openhpi/trunk/plugins/dynamic_simulator/Makefile.am openhpi/trunk/plugins/ilo2_ribcl/Makefile.am openhpi/trunk/plugins/ipmi/Makefile.am openhpi/trunk/plugins/ipmi/t/Makefile.am openhpi/trunk/plugins/ipmidirect/Makefile.am openhpi/trunk/plugins/ipmidirect/t/Makefile.am openhpi/trunk/plugins/oa_soap/Makefile.am openhpi/trunk/plugins/rtas/Makefile.am openhpi/trunk/plugins/simulator/Makefile.am openhpi/trunk/plugins/simulator/t/Makefile.am openhpi/trunk/plugins/slave/Makefile.am openhpi/trunk/plugins/slave/baselib.cpp openhpi/trunk/plugins/slave/handler.cpp openhpi/trunk/plugins/slave/slave.cpp openhpi/trunk/plugins/snmp_bc/Makefile.am openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h openhpi/trunk/plugins/snmp_bc/t/Makefile.am openhpi/trunk/plugins/sysfs/Makefile.am openhpi/trunk/plugins/watchdog/Makefile.am openhpi/trunk/snmp/Makefile.am openhpi/trunk/snmp/snmp_utils.c openhpi/trunk/ssl/Makefile.am openhpi/trunk/ssl/oh_ssl.c openhpi/trunk/transport/Makefile.am openhpi/trunk/transport/strmsock.cpp openhpi/trunk/utils/Makefile.am openhpi/trunk/utils/announcement_utils.c openhpi/trunk/utils/el_utils.c openhpi/trunk/utils/epath_utils.c openhpi/trunk/utils/rpt_utils.c openhpi/trunk/utils/sahpi_event_utils.c openhpi/trunk/utils/sahpi_struct_utils.c openhpi/trunk/utils/t/ann/Makefile.am openhpi/trunk/utils/t/el/Makefile.am openhpi/trunk/utils/t/epath/Makefile.am openhpi/trunk/utils/t/epath/epath_utils_test.c openhpi/trunk/utils/t/rpt/Makefile.am openhpi/trunk/utils/t/sahpi/Makefile.am openhpi/trunk/utils/t/uid/Makefile.am openhpi/trunk/utils/uid_utils.c Modified: openhpi/trunk/baselib/Makefile.am =================================================================== --- openhpi/trunk/baselib/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/baselib/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -17,6 +17,8 @@ MAINTAINERCLEANFILES = Makefile.in *~ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"baselib\" + INCLUDES = \ @OPENHPI_INCLUDES@ -I$(top_srcdir)/transport -I$(top_srcdir)/marshal @OH_SSL_INCLUDES@ Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/baselib/conf.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -349,7 +349,7 @@ port = OPENHPI_DEFAULT_DAEMON_PORT; if (g_scanner_get_next_token(oh_scanner) != HPI_CLIENT_CONF_TOKEN_DOMAIN) { - err("Processing domain: Expected a domain token"); + CRIT("Processing domain: Expected a domain token"); return -1; } @@ -359,18 +359,18 @@ did = OH_DEFAULT_DOMAIN_ID; } else if (next_token == G_TOKEN_INT) { if (oh_scanner->value.v_int == 0) { // Domain Id of 0 is invalid - err("Processing domain: A domain id of 0 is invalid"); + CRIT("Processing domain: A domain id of 0 is invalid"); return -2; } did = (SaHpiDomainIdT)oh_scanner->value.v_int; } else { - err("Processing domain: Expected int or string ('default') token"); + CRIT("Processing domain: Expected int or string ('default') token"); return -3; } /* Check for Left Brace token type. If we have it, then continue parsing. */ if (g_scanner_get_next_token(oh_scanner) != G_TOKEN_LEFT_CURLY) { - err("Processing domain: Expected left curly token."); + CRIT("Processing domain: Expected left curly token."); return -10; } @@ -379,12 +379,12 @@ if (next_token == HPI_CLIENT_CONF_TOKEN_HOST) { next_token = g_scanner_get_next_token(oh_scanner); if (next_token != G_TOKEN_EQUAL_SIGN) { - err("Processing domain: Expected equal sign"); + CRIT("Processing domain: Expected equal sign"); return -10; } next_token = g_scanner_get_next_token(oh_scanner); if (next_token != G_TOKEN_STRING) { - err("Processing domain: Expected a string"); + CRIT("Processing domain: Expected a string"); return -10; } if (host[0] == '\0') { @@ -393,27 +393,27 @@ } else if (next_token == HPI_CLIENT_CONF_TOKEN_PORT) { next_token = g_scanner_get_next_token(oh_scanner); if (next_token != G_TOKEN_EQUAL_SIGN) { - err("Processing domain: Expected equal sign"); + CRIT("Processing domain: Expected equal sign"); return -10; } next_token = g_scanner_get_next_token(oh_scanner); if (next_token != G_TOKEN_INT) { - err("Processing domain: Expected an integer"); + CRIT("Processing domain: Expected an integer"); return -10; } port = oh_scanner->value.v_int; } else { - err("Processing domain: Should not get here!"); + CRIT("Processing domain: Should not get here!"); return -10; } next_token = g_scanner_get_next_token(oh_scanner); } if (next_token == G_TOKEN_EOF) { - err("Processing domain: Expected a right curly"); + CRIT("Processing domain: Expected a right curly"); return -10; } else if (host[0] == '\0') { - err("Processing domain: Did not find the host parameter"); + CRIT("Processing domain: Did not find the host parameter"); return -10; } @@ -426,7 +426,7 @@ { g_return_if_fail (scanner != NULL); - err("%s:%d: %s%s\n", + CRIT("%s:%d: %s%s\n", scanner->input_name ? scanner->input_name : "<memory>", scanner->line, is_error ? "error: " : "", message ); } @@ -438,13 +438,13 @@ int num_tokens = sizeof(ohc_conf_tokens) / sizeof(ohc_conf_tokens[0]); if (!filename) { - err("Error. Invalid parameters"); + CRIT("Error. Invalid parameters"); return -1; } oh_scanner = g_scanner_new(&oh_scanner_conf); if (!oh_scanner) { - err("Couldn't allocate g_scanner for file parsing"); + CRIT("Couldn't allocate g_scanner for file parsing"); return -2; } @@ -453,7 +453,7 @@ FILE * fp = fopen(filename, "r"); if (!fp) { - err("Client configuration file '%s' could not be opened", filename); + CRIT("Client configuration file '%s' could not be opened", filename); g_scanner_destroy(oh_scanner); return -3; } Modified: openhpi/trunk/baselib/session.cpp =================================================================== --- openhpi/trunk/baselib/session.cpp 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/baselib/session.cpp 2010-12-24 16:00:24 UTC (rev 7225) @@ -171,7 +171,7 @@ bool rc = sock->Create( dc->host, dc->port ); if ( !rc ) { delete sock; - err("Session: cannot open connection to domain %u.\n", m_did ); + CRIT("Session: cannot open connection to domain %u.", m_did ); return SA_ERR_HPI_NO_RESPONSE; } Modified: openhpi/trunk/clients/Makefile.am =================================================================== --- openhpi/trunk/clients/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/clients/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -1,6 +1,8 @@ MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = @TEST_CLEAN@ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"client\" + INCLUDES = @OPENHPI_INCLUDES@ EXTRA_DIST = Makefile.mingw32 oh_clients.h Modified: openhpi/trunk/clients/clients.c =================================================================== --- openhpi/trunk/clients/clients.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/clients/clients.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -15,6 +15,7 @@ * Renier Morales <re...@op...> */ +#include <stdio.h> #include <string.h> #include <SaHpi.h> Modified: openhpi/trunk/cpp/Makefile.am =================================================================== --- openhpi/trunk/cpp/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/cpp/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -18,6 +18,8 @@ MAINTAINERCLEANFILES = Makefile.in +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"cpp\" + INCLUDES = @OPENHPI_INCLUDES@ includedir=$(base_includedir)/openhpi Modified: openhpi/trunk/cpp/t/Makefile.am =================================================================== --- openhpi/trunk/cpp/t/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/cpp/t/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -10,6 +10,8 @@ MOSTLYCLEANFILES = @TEST_CLEAN@ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"t\" + INCLUDES = @OPENHPI_INCLUDES@ -I$(top_builddir)/cpp MAINTAINERCLEANFILES = Makefile.in Modified: openhpi/trunk/hpi_shell/Makefile.am =================================================================== --- openhpi/trunk/hpi_shell/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/hpi_shell/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -6,6 +6,8 @@ EXTRA_DIST = hpi_ui.h +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"hpi_shell\" + INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/utils INCLUDES += -I$(top_srcdir)/openhpid \ Modified: openhpi/trunk/include/oh_error.h =================================================================== --- openhpi/trunk/include/oh_error.h 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/include/oh_error.h 2010-12-24 16:00:24 UTC (rev 7225) @@ -17,67 +17,54 @@ #ifndef __OH_ERROR_H #define __OH_ERROR_H +#include <config.h> #ifdef OH_DBG_MSGS +#include <glib.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <syslog.h> +#define CRIT( fmt, ... ) \ + g_critical( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) -#include <config.h> +#define WARN( fmt, ... ) \ + g_warning( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) -/* this is put here intentionally as there are too many instances - * of unqualified sprintf calls in plugin code. Use snprintf instead - * to ensure there are no buffer overruns - */ -/* Unfortunately, sprintf is used in the system headers of some versions - * of Solaris, so we can't poison sprintf there. - */ -#if !defined(__sun) || !defined(__SVR4) -#undef sprintf -#pragma GCC poison sprintf -#endif +#define MSG( fmt, ... ) \ + g_message( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) -#define OH_ERROR "OPENHPI_ERROR" -#define OH_DEBUG "OPENHPI_DEBUG" +#define INFO( fmt, ... ) \ + g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \ + "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) -#define err(format, ...) \ - do { \ - syslog(3, "ERROR: (%s, %d, "format")", __FILE__, __LINE__,## __VA_ARGS__); \ - if (getenv(OH_ERROR) && !strcmp("YES", getenv(OH_ERROR))) { \ - fprintf(stderr, "%s:%d ("format")\n", __FILE__, __LINE__, ## __VA_ARGS__); \ - } \ - } while(0) +#define DBG( fmt, ... ) \ + g_debug( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) -#define warn(format, ...) \ - do { \ - syslog(3, "WARNING: (%s, %d, "format")", __FILE__, __LINE__,## __VA_ARGS__); \ - if (getenv(OH_ERROR) && !strcmp("YES", getenv(OH_ERROR))) { \ - fprintf(stderr, "%s:%d ("format")\n", __FILE__, __LINE__, ## __VA_ARGS__); \ - } \ - } while(0) -#define dbg(format, ...) \ - do { \ - if (getenv(OH_DEBUG) && !strcmp("YES", getenv(OH_DEBUG))) { \ - fprintf(stderr, " %s:%d:%s: ", __FILE__, __LINE__, __func__); \ - fprintf(stderr, format "\n", ## __VA_ARGS__); \ - } \ - } while(0) +/****************************************************************** + * Use CRIT, WARN, DBG macros intead of legacy err, warn, dbg + ******************************************************************/ +#define err( fmt, ... ) \ + g_critical( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) +#define warn( fmt, ... ) \ + g_warning( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) +#define dbg( fmt, ... ) \ + g_debug( "%s:%d: " fmt, __FILE__, __LINE__,## __VA_ARGS__ ) + #else /* OH_DBG_MSGS */ +#define CRIT( fmt, ... ) +#define WARN( fmt, ... ) +#define MSG( fmt, ... ) +#define INFO( fmt, ... ) +#define DBG( fmt, ... ) -#define err(format, ...) -#define warn(format, ...) -#define dbg(format, ...) +#define err( fmt, ... ) +#define warn( fmt, ... ) +#define dbg( fmt, ... ) - #endif /* OH_DBG_MSGS */ - #endif /* __OH_ERROR_H */ Modified: openhpi/trunk/include/sahpimacros.h =================================================================== --- openhpi/trunk/include/sahpimacros.h 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/include/sahpimacros.h 2010-12-24 16:00:24 UTC (rev 7225) @@ -34,7 +34,6 @@ SaHpiBoolT state; \ SaErrorT init_error; \ if ((init_error = oh_get_session_subscription(sid,&state)) != SA_OK) { \ - err("Init state check failed! (%s, %d)", oh_lookup_error(init_error), sid); \ return init_error; \ } \ } @@ -48,7 +47,6 @@ { \ did = oh_get_session_domain(sid); \ if (did == SAHPI_UNSPECIFIED_DOMAIN_ID) { \ - err("No domain for session id %d",sid); \ return SA_ERR_HPI_INVALID_SESSION; \ } \ } @@ -60,7 +58,6 @@ #define OH_GET_DOMAIN(did, d) \ { \ if (!(d = oh_get_domain(did))) { \ - err("Domain %d doesn't exist", did); \ return SA_ERR_HPI_INVALID_DOMAIN; \ } \ } @@ -74,7 +71,6 @@ unsigned int *hid = NULL; \ hid = oh_get_resource_data(&(d->rpt), rid); \ if (!hid) { \ - err("Can't find handler for Resource %d in Domain %d", rid, d->id); \ oh_release_domain(d); \ return SA_ERR_HPI_INVALID_RESOURCE; \ } \ @@ -94,7 +90,6 @@ { \ r = oh_get_resource_by_id(&(d->rpt), rid); \ if (!r) { \ - err("Resource %d in Domain %d doesn't exist", rid, d->id); \ oh_release_domain(d); \ return SA_ERR_HPI_INVALID_RESOURCE; \ } \ @@ -109,11 +104,9 @@ { \ r = oh_get_resource_by_id(&(d->rpt), rid); \ if (!r) { \ - err("Resource %d in Domain %d doesn't exist", rid, d->id); \ oh_release_domain(d); \ return SA_ERR_HPI_INVALID_RESOURCE; \ } else if (r->ResourceFailed != SAHPI_FALSE) { \ - err("Resource %d in Domain %d is Failed", rid, d->id); \ oh_release_domain(d); \ return SA_ERR_HPI_NO_RESPONSE; \ } \ Modified: openhpi/trunk/marshal/Makefile.am =================================================================== --- openhpi/trunk/marshal/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/marshal/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -19,6 +19,8 @@ MAINTAINERCLEANFILES = Makefile.in *~ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"marshal\" + EXTRA_DIST = Makefile.mingw32 INCLUDES = @OPENHPI_INCLUDES@ Modified: openhpi/trunk/marshal/t/Makefile.am =================================================================== --- openhpi/trunk/marshal/t/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/marshal/t/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -21,6 +21,8 @@ MAINTAINERCLEANFILES = Makefile.in *~ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"t\" + INCLUDES = -I $(MARSHAL_SRCDIR) @OPENHPI_INCLUDES@ noinst_PROGRAMS = float_format Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-24 16:00:24 UTC (rev 7225) @@ -17,6 +17,8 @@ MAINTAINERCLEANFILES = Makefile.in *~ +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"openhpid\" + INCLUDES = \ @OPENHPI_INCLUDES@ -I$(top_srcdir)/transport -I$(top_srcdir)/marshal @OH_SSL_INCLUDES@ Modified: openhpi/trunk/openhpid/alarm.c =================================================================== --- openhpi/trunk/openhpid/alarm.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/alarm.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -128,7 +128,7 @@ if (param.u.dat_size_limit != OH_MAX_DAT_SIZE_LIMIT && g_slist_length(d->dat.list) >= param.u.dat_size_limit) { - err("DAT for domain %d is overflowed", d->id); + CRIT("DAT for domain %d is overflowed", d->id); d->dat.overflow = SAHPI_TRUE; return NULL; } else if (alarm && alarm->AlarmCond.Type == SAHPI_STATUS_COND_TYPE_USER) { @@ -140,7 +140,7 @@ __count_alarms(d, &alarm->AlarmCond.Type, SAHPI_ALL_SEVERITIES) >= param.u.dat_user_limit) { - err("DAT for domain %d has reached its user alarms limit", d->id); + CRIT("DAT for domain %d has reached its user alarms limit", d->id); return NULL; } } @@ -689,13 +689,13 @@ fp = fopen(filename, "wb"); if (!fp) { - err("File '%s' could not be opened", filename); + CRIT("File '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } for (alarms = at->list; alarms; alarms = alarms->next) { if (fwrite(alarms->data, sizeof(SaHpiAlarmT), 1, fp) != 1) { - err("Couldn't write to file '%s'.", filename); + CRIT("Couldn't write to file '%s'.", filename); fclose(fp); return SA_ERR_HPI_ERROR; } @@ -726,7 +726,7 @@ fp = fopen(filename, "rb"); if (!fp) { - err("File '%s' could not be opened", filename); + CRIT("File '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } @@ -734,7 +734,7 @@ SaHpiAlarmT *a = oh_add_alarm(d, &alarm, 1); if (!a) { fclose(fp); - err("Error adding alarm read from file."); + CRIT("Error adding alarm read from file."); return SA_ERR_HPI_ERROR; } } Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/conf.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -222,7 +222,7 @@ global_params.unconfigured = SAHPI_FALSE; } } else { - err("ERROR. Invalid global parameter %s in config file", name); + CRIT("ERROR. Invalid global parameter %s in config file", name); } return; @@ -265,14 +265,14 @@ data_access_lock(); if (g_scanner_get_next_token(oh_scanner) != HPI_CONF_TOKEN_HANDLER) { - err("Processing handler: Unexpected token."); + CRIT("Processing handler: Unexpected token."); data_access_unlock(); return -1; } /* Get the plugin type and store in Hash Table */ if (g_scanner_get_next_token(oh_scanner) != G_TOKEN_STRING) { - err("Processing handler: Expected string token."); + CRIT("Processing handler: Expected string token."); data_access_unlock(); return -1; } else { @@ -288,14 +288,14 @@ /* Check for Left Brace token type. If we have it, then continue parsing. */ if (g_scanner_get_next_token(oh_scanner) != G_TOKEN_LEFT_CURLY) { - err("Processing handler: Expected left curly token."); + CRIT("Processing handler: Expected left curly token."); goto free_table; } while (!found_right_curly) { /* get key token in key\value pair set (e.g. key = value) */ if (g_scanner_get_next_token(oh_scanner) != G_TOKEN_STRING) { - err("Processing handler: Expected string token."); + CRIT("Processing handler: Expected string token."); goto free_table; } else { tablekey = g_strdup(oh_scanner->value.v_string); @@ -303,7 +303,7 @@ /* Check for the equal sign next. If we have it, continue parsing */ if (g_scanner_get_next_token(oh_scanner) != G_TOKEN_EQUAL_SIGN) { - err("Processing handler: Expected equal sign token."); + CRIT("Processing handler: Expected equal sign token."); goto free_table_and_key; } @@ -314,7 +314,7 @@ if (g_scanner_peek_next_token(oh_scanner) != G_TOKEN_INT && g_scanner_peek_next_token(oh_scanner) != G_TOKEN_FLOAT && g_scanner_peek_next_token(oh_scanner) != G_TOKEN_STRING) { - err("Processing handler: Expected string, integer, or float token."); + CRIT("Processing handler: Expected string, integer, or float token."); goto free_table_and_key; } else { /* The type of token tells us how to fetch the value from oh_scanner */ gpointer value = NULL; @@ -335,7 +335,7 @@ } if (value == NULL) { - err("Processing handler:" + CRIT("Processing handler:" " Unable to allocate memory for value." " Token Type: %d", current_token); @@ -388,26 +388,26 @@ /* Get the global parameter name */ current_token = g_scanner_get_next_token(scanner); if (current_token != G_TOKEN_STRING) { - err("Processing global: Expected string token. Got %d", + CRIT("Processing global: Expected string token. Got %d", current_token); goto quit; } name = g_strdup(scanner->value.v_string); if (!name) { - err("Unable to allocate for global param name."); + CRIT("Unable to allocate for global param name."); goto quit; } current_token = g_scanner_get_next_token(scanner); if (current_token != G_TOKEN_EQUAL_SIGN) { - err("Did not get expected '=' token. Got %d", current_token); + CRIT("Did not get expected '=' token. Got %d", current_token); goto free_and_quit; } current_token = g_scanner_get_next_token(scanner); if (current_token != G_TOKEN_STRING && current_token != G_TOKEN_INT) { - err("Did not get expected string value for global parameter." + CRIT("Did not get expected string value for global parameter." " Got %d", current_token); goto free_and_quit; } @@ -427,7 +427,7 @@ } if (!value) { - err("Unable to allocate for global param value."); + CRIT("Unable to allocate for global param value."); goto free_and_quit; } @@ -458,7 +458,7 @@ { g_return_if_fail (scanner != NULL); - err("%s:%d: %s%s\n", + CRIT("%s:%d: %s%s\n", scanner->input_name ? scanner->input_name : "<memory>", scanner->line, is_error ? "error: " : "", message ); } @@ -482,14 +482,14 @@ int num_tokens = sizeof(oh_conf_tokens) / sizeof(oh_conf_tokens[0]); if (!filename || !config) { - err("Error. Invalid parameters"); + CRIT("Error. Invalid parameters"); return -1; } handler_configs = NULL; oh_scanner = g_scanner_new(&oh_scanner_config); if (!oh_scanner) { - err("Couldn't allocate g_scanner for file parsing"); + CRIT("Couldn't allocate g_scanner for file parsing"); return -2; } @@ -498,7 +498,7 @@ fp = fopen(filename, "r"); if (!fp) { - err("Configuration file '%s' could not be opened", filename); + CRIT("Configuration file '%s' could not be opened", filename); g_scanner_destroy(oh_scanner); return -4; } @@ -519,7 +519,7 @@ while (!done) { guint my_token; my_token = g_scanner_peek_next_token (oh_scanner); - /*dbg("token: %d", my_token);*/ + /*DBG("token: %d", my_token);*/ switch (my_token) { case G_TOKEN_EOF: @@ -548,7 +548,7 @@ g_scanner_destroy(oh_scanner); - dbg("Done processing conf file.\nNumber of parse errors:%d", done); + DBG("Done processing conf file.\nNumber of parse errors:%d", done); config->handler_configs = handler_configs; @@ -580,11 +580,11 @@ error = oh_create_handler(handler_config, &hid); if (error == SA_OK) { - dbg("Loaded handler for plugin %s", + DBG("Loaded handler for plugin %s", (char *)g_hash_table_lookup(handler_config, "plugin")); config->handlers_loaded++; } else { - err("Couldn't load handler for plugin %s", + CRIT("Couldn't load handler for plugin %s", (char *)g_hash_table_lookup(handler_config, "plugin")); if (hid == 0) g_hash_table_destroy(handler_config); } @@ -612,11 +612,11 @@ if (!param || !(param->type)) { if (!param) { - err("ERROR. Invalid parameters param NULL"); + CRIT("ERROR. Invalid parameters param NULL"); } if (!param->type) { - err("ERROR. Invalid parameters param->type NULL"); + CRIT("ERROR. Invalid parameters param->type NULL"); } return -1; @@ -683,7 +683,7 @@ param->u.unconfigured = global_params.unconfigured; break; default: - err("ERROR. Invalid global parameter %d!", param->type); + CRIT("ERROR. Invalid global parameter %d!", param->type); return -2; } @@ -699,7 +699,7 @@ int oh_set_global_param(struct oh_global_param *param) { if (!param || !(param->type)) { - err("ERROR. Invalid parameters"); + CRIT("ERROR. Invalid parameters"); return -1; } @@ -768,7 +768,7 @@ global_params.unconfigured = param->u.unconfigured; break; default: - err("ERROR. Invalid global parameter %d!", param->type); + CRIT("ERROR. Invalid global parameter %d!", param->type); return -2; } Modified: openhpi/trunk/openhpid/domain.c =================================================================== --- openhpi/trunk/openhpid/domain.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/domain.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -137,7 +137,7 @@ e->event.EventDataUnion.DomainEvent.Type = type; e->event.EventDataUnion.DomainEvent.DomainId = subject_id; oh_gettimeofday(&e->event.Timestamp); - dbg("domain %d %s domain %d", subject_id, + DBG("domain %d %s domain %d", subject_id, type == SAHPI_DOMAIN_REF_ADDED ? "added to" : "removed from", target_id); oh_evt_queue_push(&oh_process_q, e); @@ -154,7 +154,7 @@ domain = oh_get_domain(target_id); if (!domain) { - err("Warning. Could not update DRT. Domain %u not found.", + CRIT("Warning. Could not update DRT. Domain %u not found.", target_id); return; } @@ -214,7 +214,7 @@ parent = oh_get_domain(parent_id); if (!parent) { - err("Couldn't get domain %d", parent_id); + CRIT("Couldn't get domain %d", parent_id); return -3; } @@ -251,7 +251,7 @@ peer = oh_get_domain(peer_id); if (!peer) { - err("Couldn't get domain %d", peer_id); + CRIT("Couldn't get domain %d", peer_id); return -3; } @@ -367,7 +367,7 @@ if (g_hash_table_lookup(oh_domains.table, &id)) { domains_unlock(); g_free(domain); - err("Domain %u already exists; not creating twice.", id); + CRIT("Domain %u already exists; not creating twice.", id); return SA_ERR_HPI_INVALID_DOMAIN; } @@ -433,14 +433,14 @@ /* Establish child-parent relationship */ if (child_of != SAHPI_UNSPECIFIED_DOMAIN_ID && connect2parent(domain, child_of)) { - err("Error connecting domain %u to parent %u", + CRIT("Error connecting domain %u to parent %u", domain->id, child_of); } /* Establish peer relationships */ if (peer_of != SAHPI_UNSPECIFIED_DOMAIN_ID && connect2peer(domain, peer_of)) { - err("Error connection domain %u to peer %u", + CRIT("Error connection domain %u to peer %u", domain->id, peer_of); } @@ -471,7 +471,7 @@ ai_readonly = (unsigned int *)g_hash_table_lookup(table, "ai_readonly"); if (!id) { - err("Error creating a domain from configuration." + CRIT("Error creating a domain from configuration." " No domain id was given."); return SA_ERR_HPI_INVALID_PARAMS; } @@ -483,12 +483,12 @@ } if (peer_of && entity_pattern) { - warn("Warning creating domain %u. Entity pattern will be" + WARN("Warning creating domain %u. Entity pattern will be" " disregarded since a peer was specified.", *id); } else if (!peer_of && oh_compile_entitypath_pattern(entity_pattern, &epp)) { - err("Error creating domain %u. " + CRIT("Error creating domain %u. " "Invalid entity pattern given.", *id); return SA_ERR_HPI_INVALID_PARAMS; } @@ -640,13 +640,13 @@ GSList *node = NULL; if (did < 0 || !nextentryid || !drtentry) { - err("Error - Invalid parameters passed."); + CRIT("Error - Invalid parameters passed."); return SA_ERR_HPI_INVALID_PARAMS; } domain = oh_get_domain(did); if (domain == NULL) { - err("no domain for id %d", did); + CRIT("no domain for id %d", did); return SA_ERR_HPI_INTERNAL_ERROR; } Modified: openhpi/trunk/openhpid/event.c =================================================================== --- openhpi/trunk/openhpid/event.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/event.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -50,13 +50,13 @@ */ int oh_event_init() { - dbg("Setting up event processing queue"); + DBG("Setting up event processing queue"); if (!oh_process_q.q) oh_process_q.q = g_async_queue_new(); if (oh_process_q.q) { - dbg("Set up processing queue"); + DBG("Set up processing queue"); return 1; } else { - err("Failed to allocate processing queue"); + CRIT("Failed to allocate processing queue"); return 0; } } @@ -128,7 +128,7 @@ do { error = h->abi->get_event(h->hnd); if (error < 1) { - dbg("Handler is out of Events"); + DBG("Handler is out of Events"); } } while (error > 0); @@ -143,12 +143,12 @@ oh_getnext_handler_id(hid, &next_hid); while (next_hid) { - dbg("harvesting for %d", next_hid); + DBG("harvesting for %d", next_hid); hid = next_hid; h = oh_get_handler(hid); if (!h) { - err("No such handler %d", hid); + CRIT("No such handler %d", hid); break; } /* @@ -227,23 +227,23 @@ } oh_add_event_to_del(d, e); - dbg("Added event to EL"); + DBG("Added event to EL"); /* * Here is the SESSION MULTIPLEXING code */ sessions = oh_list_sessions(d->id); if (!sessions) { - err("Error: Got an empty session list on domain id %u", d->id); + CRIT("Error: Got an empty session list on domain id %u", d->id); return -2; } - dbg("Got session list for domain %u", d->id); + DBG("Got session list for domain %u", d->id); /* Drop events if there are no sessions open to receive them. */ if (sessions->len < 1) { g_array_free(sessions, TRUE); - dbg("No sessions open for event's domain %u. " + DBG("No sessions open for event's domain %u. " "Dropping hpi_event", d->id); return 0; } @@ -262,7 +262,7 @@ } } g_array_free(sessions, TRUE); - dbg("done multiplexing event into sessions"); + DBG("done multiplexing event into sessions"); return 0; } @@ -310,7 +310,7 @@ default: // unknown resource event // do nothing - err("Got unknown resource event."); + CRIT("Got unknown resource event."); return -1; } @@ -322,7 +322,7 @@ error = oh_add_resource(rpt, &e->resource, hidp, FREE_RPT_DATA); if (error != SA_OK) { g_free( hidp ); - err("Cannot update resource."); + CRIT("Cannot update resource."); return -1; } if ( update ) { @@ -391,7 +391,7 @@ RPTable *rpt = NULL; if (!e) { - err("Got NULL event"); + CRIT("Got NULL event"); return -1; } @@ -399,12 +399,12 @@ if (!d) return -2; rpt = &(d->rpt); - dbg("Processing event for domain %u", d->id); + DBG("Processing event for domain %u", d->id); switch (e->event.EventType) { case SAHPI_ET_RESOURCE: if (!e->hid) { - err("Resource event with invalid handler id! Dropping."); + CRIT("Resource event with invalid handler id! Dropping."); break; } if ( e->resource.ResourceCapabilities == 0 ) { @@ -415,11 +415,11 @@ } } if (!(e->resource.ResourceCapabilities & SAHPI_CAPABILITY_RESOURCE)) { - err("Resource event with invalid capabilities. Dropping."); + CRIT("Resource event with invalid capabilities. Dropping."); break; } else if ((e->resource.ResourceCapabilities & SAHPI_CAPABILITY_FRU) && (e->event.EventDataUnion.ResourceEvent.ResourceEventType == SAHPI_RESE_RESOURCE_ADDED)) { - err("Invalid event. Resource in resource added event " + CRIT("Invalid event. Resource in resource added event " "has FRU capability. Dropping."); } else { process_resource_event(d, e); @@ -427,7 +427,7 @@ break; case SAHPI_ET_HOTSWAP: if (!e->hid) { - err("Hotswap event with invalid handler id! Dropping."); + CRIT("Hotswap event with invalid handler id! Dropping."); break; } if ( e->resource.ResourceCapabilities == 0 ) { @@ -438,11 +438,11 @@ } } if (!(e->resource.ResourceCapabilities & SAHPI_CAPABILITY_RESOURCE)) { - err("Hotswap event with invalid capabilities. Dropping."); + CRIT("Hotswap event with invalid capabilities. Dropping."); break; } else if (!(e->resource.ResourceCapabilities & SAHPI_CAPABILITY_FRU)) { - err("Invalid event. Resource in hotswap event " + CRIT("Invalid event. Resource in hotswap event " "has no FRU capability. Dropping."); } else { process_hs_event(d, e); @@ -461,7 +461,7 @@ process_hpi_event(d, e); break; default: - err("Don't know what to do for event type %d", e->event.EventType); + CRIT("Don't know what to do for event type %d", e->event.EventType); } oh_detect_event_alarm(d, e); oh_release_domain(d); @@ -480,7 +480,7 @@ while ((e = g_async_queue_pop(oh_process_q.q)) != NULL) { et = oh_lookup_eventtype(e->event.EventType); - dbg("Event Type = %s", (et) ? et : "<Unknown>"); + DBG("Event Type = %s", (et) ? et : "<Unknown>"); /* 1. Take care of special cases: user and domain type events */ if (e->event.EventType == SAHPI_ET_DOMAIN) { Modified: openhpi/trunk/openhpid/init.c =================================================================== --- openhpi/trunk/openhpid/init.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/init.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -62,7 +62,7 @@ #ifdef HAVE_OPENSSL /* Initialize SSL library */ if (oh_ssl_init()) { - err("SSL library intialization failed."); + CRIT("SSL library intialization failed."); data_access_unlock(); return SA_ERR_HPI_OUT_OF_MEMORY; /* Most likely */ } @@ -73,7 +73,7 @@ rval = oh_load_config(config_param.u.conf, &config); /* Don't error out if there is no conf file */ if (rval < 0 && rval != -4) { - err("Can not load config."); + CRIT("Can not load config."); data_access_unlock(); return SA_ERR_HPI_NOT_PRESENT; } @@ -83,7 +83,7 @@ */ oh_get_global_param(&unconf_param); if (unconf_param.u.unconfigured) { - err("OpenHPI is not configured. See openhpi.conf file."); + CRIT("OpenHPI is not configured. See openhpi.conf file."); data_access_unlock(); return SA_ERR_HPI_ERROR; } @@ -91,23 +91,23 @@ /* Initialize uid_utils */ rval = oh_uid_initialize(); if( (rval != SA_OK) && (rval != SA_ERR_HPI_ERROR) ) { - err("Unique ID intialization failed."); + CRIT("Unique ID intialization failed."); data_access_unlock(); return rval; } - dbg("Initialized UID."); + DBG("Initialized UID."); /* Initialize handler table */ oh_handlers.table = g_hash_table_new(g_int_hash, g_int_equal); - dbg("Initialized handler table"); + DBG("Initialized handler table"); /* Initialize domain table */ oh_domains.table = g_hash_table_new(g_int_hash, g_int_equal); - dbg("Initialized domain table"); + DBG("Initialized domain table"); /* Initialize session table */ oh_sessions.table = g_hash_table_new(g_int_hash, g_int_equal); - dbg("Initialized session table"); + DBG("Initialized session table"); /* Load plugins, create handlers and domains */ oh_process_config(&config); @@ -120,7 +120,7 @@ SAHPI_DOMAIN_CAP_AUTOINSERT_READ_ONLY, SAHPI_TIMEOUT_IMMEDIATE)) { data_access_unlock(); - err("Could not create first domain!"); + CRIT("Could not create first domain!"); return SA_ERR_HPI_ERROR; } @@ -135,10 +135,10 @@ * all of them failed to load, Then return with an error. */ if (config.handlers_defined > 0 && config.handlers_loaded == 0) { - warn("Warning: Handlers were defined, but none loaded."); + WARN("Warning: Handlers were defined, but none loaded."); } else if (config.handlers_defined > 0 && config.handlers_loaded < config.handlers_defined) { - warn("*Warning*: Not all handlers defined loaded." + WARN("*Warning*: Not all handlers defined loaded." " Check previous messages."); } @@ -147,13 +147,13 @@ initialized = 1; data_access_unlock(); - dbg("OpenHPI has been initialized"); + DBG("OpenHPI has been initialized"); /* infrastructure initialization has completed at this point */ /* Check if there are any handlers loaded */ if (config.handlers_defined == 0) { - warn("*Warning*: No handler definitions found in config file." + WARN("*Warning*: No handler definitions found in config file." " Check configuration file %s and previous messages", config_param.u.conf); } Modified: openhpi/trunk/openhpid/openhpid-posix.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-posix.cpp 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/openhpid-posix.cpp 2010-12-24 16:00:24 UTC (rev 7225) @@ -28,6 +28,7 @@ #include <string.h> #include <sys/stat.h> #include <sys/types.h> +#include <syslog.h> #include <unistd.h> #include <glib.h> @@ -40,7 +41,8 @@ #include "server.h" -static int verbose_flag = 0; +static bool daemonized = false; +static bool verbose_flag = false; /*--------------------------------------------------------------------*/ @@ -74,6 +76,67 @@ } /*--------------------------------------------------------------------*/ +/* Logging Utility Functions */ +/*--------------------------------------------------------------------*/ +static const char * get_log_level_name(GLogLevelFlags log_level) +{ + if (log_level & G_LOG_LEVEL_ERROR) { + return "ERR"; + } else if (log_level & G_LOG_LEVEL_CRITICAL) { + return "CRIT"; + } else if (log_level & G_LOG_LEVEL_WARNING) { + return "WARN"; + } else if (log_level & G_LOG_LEVEL_MESSAGE) { + return "MSG"; + } else if (log_level & G_LOG_LEVEL_INFO) { + return "INFO"; + } else if (log_level & G_LOG_LEVEL_DEBUG) { + return "DBG"; + } + return "???"; +} + +static int get_syslog_level(GLogLevelFlags log_level) +{ + if (log_level & G_LOG_LEVEL_ERROR) { + return LOG_ERR; + } else if (log_level & G_LOG_LEVEL_CRITICAL) { + return LOG_CRIT; + } else if (log_level & G_LOG_LEVEL_WARNING) { + return LOG_WARNING; + } else if (log_level & G_LOG_LEVEL_MESSAGE) { + return LOG_NOTICE; + } else if (log_level & G_LOG_LEVEL_INFO) { + return LOG_INFO; + } else if (log_level & G_LOG_LEVEL_DEBUG) { + return LOG_DEBUG; + } + return LOG_INFO; +} + +void log_handler(const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer /*user_data */) +{ + if ((!verbose_flag) && ((log_level & G_LOG_LEVEL_CRITICAL) == 0) ) { + return; + } + if (!daemonized) { + printf("%s: %s: %s\n", + log_domain, + get_log_level_name(log_level), + message); + } else { + syslog(LOG_DAEMON | get_syslog_level(log_level), + "%s: %s\n", + log_domain, + message); + } +} + + +/*--------------------------------------------------------------------*/ /* PID File Unility Functions */ /*--------------------------------------------------------------------*/ bool check_pidfile(const char *pidfile) @@ -89,7 +152,7 @@ memset(buf, 0, sizeof(buf)); ssize_t len = read(fd, buf, sizeof(buf) - 1); if (len < 0) { - err("Error: Cannot read from PID file.\n"); + CRIT("Cannot read from PID file."); return false; } close(fd); @@ -97,7 +160,7 @@ if ((pid > 0) && (pid == getpid() || (kill(pid, 0) < 0))) { unlink(pidfile); } else { - err("Error: There is another active OpenHPI daemon.\n"); + CRIT("There is another active OpenHPI daemon."); return false; } } @@ -114,7 +177,7 @@ int fd = open(pidfile, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP); if (fd < 0) { - err("Error: Cannot open PID file.\n"); + CRIT("Cannot open PID file."); return false; } char buf[32]; @@ -153,6 +216,8 @@ exit(0); } + daemonized = true; + update_pidfile(pidfile); //chdir("/"); @@ -177,6 +242,8 @@ int main(int argc, char *argv[]) { + g_log_set_default_handler(log_handler, 0); + struct option options[] = { {"verbose", no_argument, 0, 'v'}, {"nondaemon", no_argument, 0, 'n'}, @@ -216,7 +283,7 @@ port = atoi(optarg); break; case 'v': - verbose_flag = 1; + verbose_flag = true; break; case 'f': pidfile = g_strdup(optarg); @@ -241,26 +308,26 @@ } } if (optind < argc) { - fprintf(stderr, "Error: Unknown command line option specified. Exiting.\n"); + CRIT("Unknown command line option specified. Exiting."); display_help(); exit(-1); } // see if we have a valid configuration file if ((!cfgfile) || (!g_file_test(cfgfile, G_FILE_TEST_EXISTS))) { - fprintf(stderr, "Error: Cannot find configuration file. Exiting.\n"); + CRIT("Cannot find configuration file. Exiting."); display_help(); exit(-1); } // see if we are already running if (!check_pidfile(pidfile)) { - fprintf(stderr, "Error: PID file check failed. Exiting.\n"); + CRIT("PID file check failed. Exiting."); display_help(); exit(1); } if (!update_pidfile(pidfile)) { - fprintf(stderr, "Error: Cannot update PID file. Exiting.\n"); + CRIT("Cannot update PID file. Exiting."); display_help(); exit(1); } @@ -272,14 +339,14 @@ } if (oh_init()) { // Initialize OpenHPI - err("There was an error initializing OpenHPI. Exiting.\n"); + CRIT("There was an error initializing OpenHPI. Exiting."); return 8; } // announce ourselves - dbg("%s started.\n", argv[0]); - dbg("OPENHPI_CONF = %s.\n", cfgfile); - dbg("OPENHPI_DAEMON_PORT = %u.\n\n", port); + INFO("%s version %s started.", argv[0], VERSION); + INFO("OPENHPI_CONF = %s.", cfgfile); + INFO("OPENHPI_DAEMON_PORT = %u", port); bool rc = oh_server_run(port, sock_timeout, max_threads); if (!rc) { Modified: openhpi/trunk/openhpid/plugin.c =================================================================== --- openhpi/trunk/openhpid/plugin.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/plugin.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -124,7 +124,7 @@ struct oh_plugin *plugin = NULL; if (!plugin_name) { - err("ERROR getting plugin. Invalid parameter."); + CRIT("ERROR getting plugin. Invalid parameter."); return NULL; } @@ -155,7 +155,7 @@ void oh_release_plugin(struct oh_plugin *plugin) { if (!plugin) { - err("WARNING - NULL plugin parameter passed."); + CRIT("WARNING - NULL plugin parameter passed."); return; } @@ -181,7 +181,7 @@ GSList *node = NULL; if (!next_plugin_name) { - err("ERROR. Invalid parameter."); + CRIT("ERROR. Invalid parameter."); return -1; } memset(next_plugin_name, '\0', size); @@ -195,7 +195,7 @@ return 0; } else { g_static_rec_mutex_unlock(&oh_plugins.lock); - dbg("No plugins have been loaded yet."); + DBG("No plugins have been loaded yet."); return -1; } } else { @@ -241,26 +241,26 @@ int err; if (!plugin_name) { - err("ERROR. NULL plugin name passed."); + CRIT("ERROR. NULL plugin name passed."); return -1; } if (g_module_supported() == FALSE) { - err("ERROR. GModule is not supported. Cannot load plugins."); + CRIT("ERROR. GModule is not supported. Cannot load plugins."); return -1; } plugin = oh_get_plugin(plugin_name); if (plugin) { oh_release_plugin(plugin); - dbg("Plugin %s already loaded. Not loading twice.", + DBG("Plugin %s already loaded. Not loading twice.", plugin_name); return 0; } plugin = g_new0(struct oh_plugin, 1); if (!plugin) { - err("Out of memory."); + CRIT("Out of memory."); return -1; } plugin->name = g_strdup(plugin_name); @@ -276,11 +276,11 @@ err = (*p->get_interface)((void **)&plugin->abi, UUID_OH_ABI_V2); if (err < 0 || !plugin->abi || !plugin->abi->open) { - err("Can not get ABI V2"); + CRIT("Can not get ABI V2"); goto cleanup_and_quit; } - dbg("found static plugin %s", p->name); + DBG("found static plugin %s", p->name); g_static_rec_mutex_lock(&oh_plugins.lock); oh_plugins.list = g_slist_append(oh_plugins.list, plugin); @@ -303,14 +303,14 @@ } g_strfreev(plugin_search_dirs); if (plugin->dl_handle == NULL) { - err("Can not open %s plugin: %s", plugin->name, g_module_error()); + CRIT("Can not open %s plugin: %s", plugin->name, g_module_error()); goto cleanup_and_quit; } err = oh_load_plugin_functions(plugin, &plugin->abi); if (err < 0 || !plugin->abi || !plugin->abi->open) { - err("Can not get ABI"); + CRIT("Can not get ABI"); goto cleanup_and_quit; } g_static_rec_mutex_lock(&oh_plugins.lock); @@ -334,19 +334,19 @@ struct oh_plugin *plugin = NULL; if (!plugin_name) { - err("ERROR unloading plugin. NULL parameter passed."); + CRIT("ERROR unloading plugin. NULL parameter passed."); return -1; } plugin = oh_get_plugin(plugin_name); if (!plugin) { - err("ERROR unloading plugin. Plugin not found."); + CRIT("ERROR unloading plugin. Plugin not found."); return -2; } if (plugin->handler_count > 0) { oh_release_plugin(plugin); - err("ERROR unloading plugin. Handlers are still referencing it."); + CRIT("ERROR unloading plugin. Handlers are still referencing it."); return -3; } @@ -386,7 +386,7 @@ /* Subtract one from the number of handlers using this plugin */ plugin = oh_get_plugin(h->plugin_name); if (!plugin) { - err("BAD ERROR - Handler loaded, but plugin does not exist!"); + CRIT("BAD ERROR - Handler loaded, but plugin does not exist!"); } else { plugin->handler_count--; oh_release_plugin(plugin); @@ -416,7 +416,7 @@ handler = node ? node->data : NULL; if (!handler) { g_static_rec_mutex_unlock(&oh_handlers.lock); - err("Error - Handler %d was not found", hid); + CRIT("Error - Handler %d was not found", hid); return NULL; } __inc_handler_refcount(handler); @@ -436,7 +436,7 @@ void oh_release_handler(struct oh_handler *handler) { if (!handler) { - err("Warning - NULL parameter passed."); + CRIT("Warning - NULL parameter passed."); return; } @@ -462,7 +462,7 @@ struct oh_handler *h = NULL; if (!next_hid) { - err("ERROR. Invalid parameter."); + CRIT("ERROR. Invalid parameter."); return -1; } *next_hid = 0; @@ -476,7 +476,7 @@ return 0; } else { g_static_rec_mutex_unlock(&oh_handlers.lock); - err("Warning - no handlers"); + CRIT("Warning - no handlers"); return -1; } } else { /* Return handler id coming after hid in the list */ @@ -507,13 +507,13 @@ GHashTable *newconfig; if (!handler_config) { - err("ERROR creating new handler. Invalid parameter."); + CRIT("ERROR creating new handler. Invalid parameter."); return NULL; } plugin_name = (char *)g_hash_table_lookup(handler_config, "plugin"); if (!plugin_name) { - err("ERROR creating new handler. No plugin name received."); + CRIT("ERROR creating new handler. No plugin name received."); return NULL; } @@ -523,14 +523,14 @@ if(!plugin) { /* Attempt to load plugin here once */ int rc = oh_load_plugin(plugin_name); if (rc) { - err("Could not create handler. Plugin %s not loaded", + CRIT("Could not create handler. Plugin %s not loaded", plugin_name); goto cleanexit; } plugin = oh_get_plugin(plugin_name); if (!plugin) { - err("Tried but could not get a plugin to " + CRIT("Tried but could not get a plugin to " "create this handler."); goto cleanexit; } @@ -574,7 +574,7 @@ struct oh_handler *handler = NULL; if (!handler_config || !hid) { - err("ERROR creating handler. Invalid parameters."); + CRIT("ERROR creating handler. Invalid parameters."); return SA_ERR_HPI_INVALID_PARAMS; } @@ -594,7 +594,7 @@ handler->id, &oh_process_q); if (!handler->hnd) { - err("A handler #%d on the %s plugin could not be opened.", + CRIT("A handler #%d on the %s plugin could not be opened.", handler->id, handler->plugin_name); g_static_rec_mutex_unlock(&oh_handlers.lock); return SA_ERR_HPI_INTERNAL_ERROR; @@ -615,13 +615,13 @@ struct oh_handler *handler = NULL; if (hid < 1) { - err("ERROR - Invalid handler 0 id passed."); + CRIT("ERROR - Invalid handler 0 id passed."); return -1; } handler = oh_get_handler(hid); if (!handler) { - err("ERROR - Handler %d not found.", hid); + CRIT("ERROR - Handler %d not found.", hid); return -1; } @@ -661,7 +661,7 @@ h = oh_get_handler(hid); if (!h) { - err("No such handler %d", hid); + CRIT("No such handler %d", hid); break; } @@ -695,7 +695,7 @@ if (!(*abi)) { - err("Out of Memory!"); + CRIT("Out of Memory!"); return -1; } Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2010-12-22 15:58:43 UTC (rev 7224) +++ openhpi/trunk/openhpid/safhpi.c 2010-12-24 16:00:24 UTC (rev 7225) @@ -5720,7 +5720,7 @@ } oh_release_domain(domain); /* Unlock domain */ - if (!hids->len) err("Did not find any handlers for domain resources?!"); + if (!hids->len) CRIT("Did n... [truncated message content] |
From: <av...@us...> - 2010-12-24 17:29:51
|
Revision: 7227 http://openhpi.svn.sourceforge.net/openhpi/?rev=7227&view=rev Author: avpak Date: 2010-12-24 17:29:43 +0000 (Fri, 24 Dec 2010) Log Message: ----------- More on Feature Request #1531430 Modified Paths: -------------- openhpi/trunk/openhpid/t/ohpi/ohpi_035.c openhpi/trunk/utils/t/ann/ann_test_001.c openhpi/trunk/utils/t/ann/ann_test_002.c openhpi/trunk/utils/t/ann/ann_test_003.c openhpi/trunk/utils/t/ann/ann_test_004.c openhpi/trunk/utils/t/ann/ann_test_005.c openhpi/trunk/utils/t/ann/ann_test_006.c openhpi/trunk/utils/t/ann/ann_test_007.c openhpi/trunk/utils/t/ann/ann_test_008.c openhpi/trunk/utils/t/el/el_compare.c openhpi/trunk/utils/t/el/el_test_001.c openhpi/trunk/utils/t/el/el_test_002.c openhpi/trunk/utils/t/el/el_test_003.c openhpi/trunk/utils/t/el/el_test_004.c openhpi/trunk/utils/t/el/el_test_005.c openhpi/trunk/utils/t/el/el_test_006.c openhpi/trunk/utils/t/el/el_test_007.c openhpi/trunk/utils/t/el/el_test_008.c openhpi/trunk/utils/t/el/el_test_009.c openhpi/trunk/utils/t/el/el_test_010.c openhpi/trunk/utils/t/el/el_test_011.c openhpi/trunk/utils/t/el/el_test_012.c openhpi/trunk/utils/t/el/el_test_013.c openhpi/trunk/utils/t/el/el_test_014.c openhpi/trunk/utils/t/el/el_test_015.c openhpi/trunk/utils/t/el/el_test_016.c openhpi/trunk/utils/t/el/el_test_017.c openhpi/trunk/utils/t/el/el_test_018.c openhpi/trunk/utils/t/el/el_test_019.c openhpi/trunk/utils/t/el/el_test_020.c openhpi/trunk/utils/t/el/el_test_021.c openhpi/trunk/utils/t/el/el_test_022.c openhpi/trunk/utils/t/el/el_test_023.c openhpi/trunk/utils/t/el/el_test_024.c openhpi/trunk/utils/t/el/el_test_025.c openhpi/trunk/utils/t/el/el_test_026.c openhpi/trunk/utils/t/el/el_test_027.c openhpi/trunk/utils/t/el/el_test_028.c openhpi/trunk/utils/t/el/el_test_029.c openhpi/trunk/utils/t/el/el_test_030.c openhpi/trunk/utils/t/el/el_test_031.c openhpi/trunk/utils/t/el/el_test_032.c openhpi/trunk/utils/t/el/el_test_033.c openhpi/trunk/utils/t/el/el_test_034.c openhpi/trunk/utils/t/el/el_test_035.c openhpi/trunk/utils/t/el/el_test_036.c openhpi/trunk/utils/t/el/el_test_037.c openhpi/trunk/utils/t/el/el_test_038.c openhpi/trunk/utils/t/el/el_test_039.c openhpi/trunk/utils/t/el/el_test_040.c openhpi/trunk/utils/t/el/el_test_041.c openhpi/trunk/utils/t/el/el_test_042.c openhpi/trunk/utils/t/el/el_test_043.c openhpi/trunk/utils/t/el/el_test_044.c openhpi/trunk/utils/t/el/el_test_045.c openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c Modified: openhpi/trunk/openhpid/t/ohpi/ohpi_035.c =================================================================== --- openhpi/trunk/openhpid/t/ohpi/ohpi_035.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/openhpid/t/ohpi/ohpi_035.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -13,6 +13,7 @@ * Renier Morales <re...@op...> */ +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <SaHpi.h> Modified: openhpi/trunk/utils/t/ann/ann_test_001.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_001.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_001.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -39,18 +39,18 @@ ann = oh_announcement_create(); if(ann == NULL) { - err("ERROR: ann pointer == NULL."); + CRIT("ann pointer == NULL."); return 1; } if(ann->nextId != SAHPI_OLDEST_ENTRY + 1) { - err("ERROR: ann->nextId invalid."); + CRIT("ann->nextId invalid."); return 1; } if(ann->annentries != NULL) { - err("ERROR: ann->annentries invalid."); + CRIT("ann->annentries invalid."); return 1; } Modified: openhpi/trunk/utils/t/ann/ann_test_002.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_002.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_002.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -62,12 +62,12 @@ rc = oh_announcement_append(ann, &announ); if(ann->nextId != SAHPI_OLDEST_ENTRY + 2) { - err("ERROR: ann->nextId invalid."); + CRIT("ann->nextId invalid."); return 1; } if(ann->annentries == NULL) { - err("ERROR: ann->annentries invalid."); + CRIT("ann->annentries invalid."); return 1; } Modified: openhpi/trunk/utils/t/ann/ann_test_003.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_003.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_003.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -68,12 +68,12 @@ rc = oh_announcement_append(ann, &announ); if(ann->nextId != SAHPI_OLDEST_ENTRY + 4) { - err("ERROR: ann->nextId invalid."); + CRIT("ann->nextId invalid."); return 1; } if(ann->annentries == NULL) { - err("ERROR: ann->annentries invalid."); + CRIT("ann->annentries invalid."); return 1; } Modified: openhpi/trunk/utils/t/ann/ann_test_004.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_004.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_004.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -70,12 +70,12 @@ rc = oh_announcement_get(ann, 2, &announ); if(announ.EntryId != 2) { - err("ERROR: announ.EntryId invalid."); + CRIT("announ.EntryId invalid."); return 1; } if(announ.Severity != SAHPI_MAJOR) { - err("ERROR: announ.Severity invalid."); + CRIT("announ.Severity invalid."); return 1; } Modified: openhpi/trunk/utils/t/ann/ann_test_005.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_005.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_005.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -62,28 +62,28 @@ rc = oh_announcement_append(ann, &announ); if (rc != SA_OK) { - err("ERROR: 1 oh_announcement_append failed."); + CRIT("1 oh_announcement_append failed."); return 1; } announ.Severity = SAHPI_MAJOR; rc = oh_announcement_append(ann, &announ); if (rc != SA_OK) { - err("ERROR: 2 oh_announcement_append failed."); + CRIT("2 oh_announcement_append failed."); return 1; } announ.Severity = SAHPI_MINOR; rc = oh_announcement_append(ann, &announ); if (rc != SA_OK) { - err("ERROR: 3 oh_announcement_append failed."); + CRIT("3 oh_announcement_append failed."); return 1; } announ.Severity = SAHPI_CRITICAL; rc = oh_announcement_append(ann, &announ); if (rc != SA_OK) { - err("ERROR: 4 oh_announcement_append failed."); + CRIT("4 oh_announcement_append failed."); return 1; } @@ -91,31 +91,31 @@ announ.Timestamp = 0; rc = oh_announcement_get_next(ann, SAHPI_ALL_SEVERITIES, FALSE, &announ); if(rc != SA_OK) { - err("ERROR: on_announcement_get_next returned %d.", rc); + CRIT("on_announcement_get_next returned %d.", rc); return 1; } - err("EntryId %d returned with Severity %d.", announ.EntryId, announ.Severity); + CRIT("EntryId %d returned with Severity %d.", announ.EntryId, announ.Severity); rc = oh_announcement_get_next(ann, SAHPI_ALL_SEVERITIES, FALSE, &announ); if(rc != SA_OK) { - err("ERROR: on_announcement_get_next returned %d.", rc); + CRIT("on_announcement_get_next returned %d.", rc); return 1; } - err("EntryId %d returned with Severity %d.", announ.EntryId, announ.Severity); + CRIT("EntryId %d returned with Severity %d.", announ.EntryId, announ.Severity); rc = oh_announcement_get(ann, 1, &announ); if (rc != SA_OK) { - err("ERROR: oh_announcement_get did not find anything."); + CRIT("oh_announcement_get did not find anything."); return 1; } rc = oh_announcement_get_next(ann, SAHPI_CRITICAL, FALSE, &announ); if(rc != SA_OK || announ.Severity != SAHPI_CRITICAL) { - err("ERROR: on_announcement_get_next returned %d." + CRIT("on_announcement_get_next returned %d." " Severity returned is %d. EntryId %d.", rc, announ.Severity, announ.EntryId); return 1; } - err("EntryId %d returned.", announ.EntryId); + CRIT("EntryId %d returned.", announ.EntryId); return 0; } Modified: openhpi/trunk/utils/t/ann/ann_test_006.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_006.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_006.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -69,17 +69,17 @@ rc = oh_announcement_ack(ann, 2, SAHPI_MAJOR); if(rc != SA_OK) { - err("ERROR: on_announcement_ack returned %d.", rc); + CRIT("on_announcement_ack returned %d.", rc); return 1; } rc = oh_announcement_get(ann, 2, &announ); if(rc != SA_OK) { - err("ERROR: on_announcement_get returned %d.", rc); + CRIT("on_announcement_get returned %d.", rc); return 1; } if(announ.Acknowledged != TRUE) { - err("ERROR: announ.Acknowledged invalid"); + CRIT("announ.Acknowledged invalid"); return 1; } Modified: openhpi/trunk/utils/t/ann/ann_test_007.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_007.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_007.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -69,11 +69,11 @@ rc = oh_announcement_del(ann, 2, SAHPI_MAJOR); if(rc != SA_OK) { - err("ERROR: on_announcement_del returned %d.", rc); + CRIT("on_announcement_del returned %d.", rc); return 1; } if(g_list_length(ann->annentries) != 2) { - err("ERROR: invalid number of announcements in list."); + CRIT("invalid number of announcements in list."); return 1; } Modified: openhpi/trunk/utils/t/ann/ann_test_008.c =================================================================== --- openhpi/trunk/utils/t/ann/ann_test_008.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/ann/ann_test_008.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -69,7 +69,7 @@ rc = oh_announcement_close(ann); if(rc != SA_OK) { - err("ERROR: on_announcement_close returned %d.", rc); + CRIT("on_announcement_close returned %d.", rc); return 1; } Modified: openhpi/trunk/utils/t/el/el_compare.c =================================================================== --- openhpi/trunk/utils/t/el/el_compare.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_compare.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -16,7 +16,7 @@ SaErrorT retc; if (g_list_length(el1->list) != g_list_length(el2->list)) { - err("ERROR: el1->list != el2->list."); + CRIT("el1->list != el2->list."); return 1; } @@ -34,31 +34,31 @@ /* fetch the event for el1*/ retc = oh_el_get(el1, cur1, &prev1, &next1, &entry1); if (retc != SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } /* fetch the event for el2*/ retc = oh_el_get(el2, cur2, &prev2, &next2, &entry2); if (retc != SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } if (memcmp(&entry1->event.Event, &entry2->event.Event, sizeof(SaHpiEventT))) { - err("ERROR: Data from el1 and el2 do not match"); + CRIT("Data from el1 and el2 do not match"); return 1; } /* Compare resource from el1 and el2 */ if (memcmp(&entry1->res, &entry2->res, sizeof(SaHpiRptEntryT))) { - err("ERROR: Res from el1 and el2 do not match."); + CRIT("Res from el1 and el2 do not match."); return 1; } /* Compare rdr from el1 and el2 */ if (memcmp(&entry1->rdr, &entry2->rdr, sizeof(SaHpiRdrT))) { - err("ERROR: Rdr from el1 and el2 do not match."); + CRIT("Rdr from el1 and el2 do not match."); return 1; } } Modified: openhpi/trunk/utils/t/el/el_test_001.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_001.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_001.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -22,6 +22,7 @@ #include <unistd.h> #include <SaHpi.h> +#include <oh_error.h> #include <oh_utils.h> @@ -39,42 +40,42 @@ el = oh_el_create(5); if(el == NULL) { - err("ERROR: el pointer == NULL."); + CRIT("el pointer == NULL."); return 1; } if(el->info.Enabled != TRUE) { - err("ERROR: el->info.Enabled invalid."); + CRIT("el->info.Enabled invalid."); return 1; } if(el->info.OverflowFlag != FALSE) { - err("ERROR: el->info.OverflowFlag invalid."); + CRIT("el->info.OverflowFlag invalid."); return 1; } if(el->info.UpdateTimestamp != SAHPI_TIME_UNSPECIFIED) { - err("ERROR: el->info.UpdateTimestamp invalid."); + CRIT("el->info.UpdateTimestamp invalid."); return 1; } if(el->basetime != 0) { - err("ERROR: el->basetime invalid."); + CRIT("el->basetime invalid."); return 1; } if(el->nextid != SAHPI_OLDEST_ENTRY + 1) { - err("ERROR: el->nextid invalid."); + CRIT("el->nextid invalid."); return 1; } if(el->info.Size != 5) { - err("ERROR: el->info.Size invalid."); + CRIT("el->info.Size invalid."); return 1; } if(el->list != NULL) { - err("ERROR: el->list invalid."); + CRIT("el->list invalid."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_002.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_002.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_002.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -50,7 +50,7 @@ el = oh_el_create(5); if(el == NULL) { - err("ERROR: el == NULL."); + CRIT("el == NULL."); return 1; } @@ -64,33 +64,33 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } entry = (oh_el_entry *)(g_list_first(el->list)->data); if(g_list_length(el->list) != 1){ - err("ERROR: g_list_length does not return the correct number of entries."); + CRIT("g_list_length does not return the correct number of entries."); return 1; } /* fetch the event for el*/ retc = oh_el_get(el, entry->event.EntryId, &prev, &next, &entry); if (retc != SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } if (strcmp((char *)entry->event.Event.EventDataUnion.UserEvent.UserEventData.Data, data[0])) { - err("ERROR: Data from el and what was entered into el do not match"); + CRIT("Data from el and what was entered into el do not match"); return 1; } /* close the EL */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close failed."); + CRIT("oh_el_close failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_003.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_003.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_003.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -64,13 +64,13 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } if(g_list_length(el->list) != 5){ - err("ERROR: g_list_length does not hold the correct number of entries."); + CRIT("g_list_length does not hold the correct number of entries."); return 1; } @@ -78,12 +78,12 @@ for(x=0; curr != SAHPI_NO_MORE_ENTRIES; x++){ retc = oh_el_get(el, curr, &prev, &next, &entry); if (retc != SA_OK){ - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } if (strcmp((char *)entry->event.Event.EventDataUnion.UserEvent.UserEventData.Data, data[x])){ - err("ERROR: Data from el and original data do not match"); + CRIT("Data from el and original data do not match"); return 1; } curr = next; @@ -92,7 +92,7 @@ /* close the el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close failed."); + CRIT("oh_el_close failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_004.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_004.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_004.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -65,7 +65,7 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -73,20 +73,20 @@ /* save the EL to file */ retc = oh_el_map_to_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_to_file failed."); + CRIT("oh_el_map_to_file failed."); return 1; } /* get EL from file (el2) */ retc = oh_el_map_from_file(el2, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } if(g_list_length(el->list) != g_list_length(el2->list)) { - err("ERROR: el->list != el2->list."); + CRIT("el->list != el2->list."); return 1; } @@ -94,7 +94,7 @@ /* close the el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close failed."); + CRIT("oh_el_close failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_005.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_005.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_005.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -71,42 +71,42 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } /* save the EL to file */ retc = oh_el_map_to_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_to_file failed."); + CRIT("oh_el_map_to_file failed."); return 1; } /* get EL from file (el2) */ retc2 = oh_el_map_from_file(el2, "./elTest.data"); if (retc2 != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } /* compare entry contents of el and el2 */ retc = el_compare(el,el2); if (retc != SA_OK){ - err("ERROR: el and el2 do not have matching entries."); + CRIT("el and el2 do not have matching entries."); return 1; } /* close el */ retc1 = oh_el_close(el); if (retc1 != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } /* close el2 */ retc2 = oh_el_close(el2); if (retc2 != SA_OK) { - err("ERROR: oh_el_close on el2 failed."); + CRIT("oh_el_close on el2 failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_006.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_006.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_006.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -73,7 +73,7 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -82,7 +82,7 @@ /* save the EL to file */ retc1 = oh_el_map_to_file(el, "./elTest.data"); if (retc1 != SA_OK) { - err("ERROR: oh_el_map_to_file failed."); + CRIT("oh_el_map_to_file failed."); return 1; } @@ -90,7 +90,7 @@ /* get EL from file (el2) */ retc2 = oh_el_map_from_file(el2, "./elTest.data"); if (retc2 != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } @@ -104,7 +104,7 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -119,7 +119,7 @@ retc = oh_el_append(el2, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -127,33 +127,33 @@ /* verify number of entries in el and el2 is 10 */ if(g_list_length(el->list) != 10) { - err("ERROR: el->list does not have the correct number of entries"); + CRIT("el->list does not have the correct number of entries"); return 1; } if(g_list_length(el2->list) != 10) { - err("ERROR: el2->list does not have the correct number of entries"); + CRIT("el2->list does not have the correct number of entries"); return 1; } /* compare entry contents of el and el2 */ retc = el_compare(el,el2); if (retc != SA_OK){ - err("ERROR: el and el2 do not have matching entries."); + CRIT("el and el2 do not have matching entries."); return 1; } /* close el */ retc1 = oh_el_close(el); if (retc1 != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } /* close el2 */ retc2 = oh_el_close(el2); if (retc2 != SA_OK) { - err("ERROR: oh_el_close on el2 failed."); + CRIT("oh_el_close on el2 failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_007.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_007.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_007.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -62,33 +62,33 @@ /* modifies the timestamp basetime */ retc = oh_el_timeset(el, timestamp); if (retc != SA_OK){ - err("ERROR: timeset failed"); + CRIT("timeset failed"); return 1; } retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } /* get el info */ retc = oh_el_info(el, &info); if (retc != SA_OK) { - err("ERROR: oh_el_info failed."); + CRIT("oh_el_info failed."); return 1; } /* Verifies timestamp basetime worked */ if (info.UpdateTimestamp < timestamp){ - err("ERROR: Timestamp basetime failed"); + CRIT("Timestamp basetime failed"); return 1; } /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_008.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_008.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_008.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -67,7 +67,7 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -76,20 +76,20 @@ /* clear the el */ retc = oh_el_clear(el); if (retc != SA_OK) { - err("ERROR: el clear failed."); + CRIT("el clear failed."); return 1; } /* verify el list nodes are cleared */ if(el->list != NULL){ - err("ERROR: el clear failed."); + CRIT("el clear failed."); return 1; } /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_009.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_009.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_009.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -46,7 +46,7 @@ /* close el without saving to file*/ retc = oh_el_close(el); if (retc == SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_010.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_010.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_010.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -58,7 +58,7 @@ /* get EL from file (el) */ retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } @@ -73,7 +73,7 @@ retc = oh_el_prepend(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -81,7 +81,7 @@ /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_011.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_011.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_011.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -59,7 +59,7 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_012.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_012.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_012.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -44,14 +44,14 @@ el = oh_el_create(20); retc = oh_el_append(el, NULL, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_013.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_013.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_013.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -65,7 +65,7 @@ strcpy((char *) &event.EventDataUnion.UserEvent.UserEventData.Data, data[x]); retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } } @@ -75,7 +75,7 @@ /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_014.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_014.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_014.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -60,7 +60,7 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } @@ -68,7 +68,7 @@ /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_015.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_015.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_015.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -60,14 +60,14 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_016.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_016.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_016.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -61,14 +61,14 @@ retc = oh_el_append(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_append failed."); + CRIT("oh_el_append failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_017.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_017.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_017.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -59,7 +59,7 @@ retc = oh_el_prepend(el, &event, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_018.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_018.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_018.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -44,14 +44,14 @@ retc = oh_el_prepend(el, NULL, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_019.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_019.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_019.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -51,14 +51,14 @@ retc = oh_el_prepend(el, &event, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_add failed."); + CRIT("oh_el_add failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_020.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_020.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_020.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -55,7 +55,7 @@ strcpy((char *) &event.EventDataUnion.UserEvent.UserEventData.Data, data[0]); retc = oh_el_prepend(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } @@ -63,14 +63,14 @@ retc = oh_el_prepend(el, &event, NULL, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_021.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_021.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_021.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -75,7 +75,7 @@ retc = oh_el_prepend(el, &event, NULL, &res1); if (retc != SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } @@ -85,7 +85,7 @@ /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_022.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_022.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_022.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -73,7 +73,7 @@ strcpy((char *) &event.EventDataUnion.UserEvent.UserEventData.Data, data[x]); retc = oh_el_prepend(el, &event, &rdr, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } } @@ -82,7 +82,7 @@ /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_023.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_023.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_023.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -45,7 +45,7 @@ retc = oh_el_clear(el); if (retc == SA_OK) { - err("ERROR: el clear failed."); + CRIT("el clear failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_024.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_024.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_024.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -46,7 +46,7 @@ retc = oh_el_get(el, SAHPI_NEWEST_ENTRY, &prev, &next, &entry); if (retc == SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_025.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_025.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_025.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -47,14 +47,14 @@ retc = oh_el_setgentimestampflag(el, flag); if (retc != SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_026.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_026.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_026.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -48,7 +48,7 @@ el = oh_el_create(20); retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } @@ -56,14 +56,14 @@ retc = oh_el_get(el, entry->event.EntryId, NULL, &next, &entry); if (retc == SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_027.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_027.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_027.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -48,14 +48,14 @@ /* fetch the event for el*/ retc = oh_el_get(el, SAHPI_FIRST_ENTRY, &prev, &next, &entry); if (retc == SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_028.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_028.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_028.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -45,7 +45,7 @@ el = oh_el_create(20); retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } @@ -53,14 +53,14 @@ retc = oh_el_get(el, SAHPI_NEWEST_ENTRY, &prev, &next, &entry); if (retc != SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_029.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_029.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_029.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -46,7 +46,7 @@ el = oh_el_create(20); retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } @@ -56,14 +56,14 @@ retc = oh_el_get(el, myentry, &prev, &next, &entry); if (retc == SA_OK) { - err("ERROR: oh_el_get failed."); + CRIT("oh_el_get failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_030.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_030.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_030.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -49,7 +49,7 @@ retc = oh_el_info(el, &info); if (retc == SA_OK) { - err("ERROR: oh_el_info failed."); + CRIT("oh_el_info failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_031.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_031.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_031.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -49,14 +49,14 @@ retc = oh_el_info(el, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_info failed."); + CRIT("oh_el_info failed."); return 1; } /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_032.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_032.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_032.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -43,13 +43,13 @@ el = oh_el_create(20); retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } retc = oh_el_overflowreset(el); if (retc != SA_OK) { - err("ERROR: el info.OverflowFlagreset failed."); + CRIT("el info.OverflowFlagreset failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_033.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_033.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_033.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -45,7 +45,7 @@ retc = oh_el_overflowreset(el); if (retc == SA_OK) { - err("ERROR: oh_el_overflowreset failed."); + CRIT("oh_el_overflowreset failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_034.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_034.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_034.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -47,7 +47,7 @@ /* save the EL to file */ retc = oh_el_map_to_file(el, "./elTest.data"); if (retc == SA_OK) { - err("ERROR: oh_el_map_to_file failed."); + CRIT("oh_el_map_to_file failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_035.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_035.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_035.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -48,14 +48,14 @@ retc = oh_el_map_to_file(el, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_map_to_file failed."); + CRIT("oh_el_map_to_file failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_036.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_036.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_036.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -47,7 +47,7 @@ retc = oh_el_map_from_file(el, "./elTest.data"); if (retc == SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_037.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_037.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_037.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -47,14 +47,14 @@ retc = oh_el_map_from_file(el, "./elTest.data"); if (retc == SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_038.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_038.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_038.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -46,14 +46,14 @@ retc = oh_el_map_from_file(el, NULL); if (retc == SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_039.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_039.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_039.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -48,14 +48,14 @@ retc = oh_el_map_from_file(el, "./notthere.data"); if (retc == SA_OK) { - err("ERROR: oh_el_map_from_file failed."); + CRIT("oh_el_map_from_file failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_040.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_040.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_040.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -48,7 +48,7 @@ retc = oh_el_timeset(el, timestamp + 20); if (retc == SA_OK){ - err("ERROR: oh_el_timeset failed"); + CRIT("oh_el_timeset failed"); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_041.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_041.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_041.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -47,14 +47,14 @@ retc = oh_el_timeset(el, SAHPI_TIME_UNSPECIFIED); if (retc == SA_OK){ - err("ERROR: oh_el_timeset on el failed"); + CRIT("oh_el_timeset on el failed"); return 1; } /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_042.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_042.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_042.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -46,7 +46,7 @@ retc = oh_el_timeset(el, timestamp + 20); if (retc != SA_OK){ - err("ERROR: oh_el_timeset failed"); + CRIT("oh_el_timeset failed"); return 1; } @@ -54,7 +54,7 @@ /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_043.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_043.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_043.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -46,7 +46,7 @@ retc = oh_el_timeset(el, SAHPI_TIME_MAX_RELATIVE + 20); if (retc != SA_OK){ - err("ERROR: oh_el_timeset failed"); + CRIT("oh_el_timeset failed"); return 1; } @@ -54,7 +54,7 @@ /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_044.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_044.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_044.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -48,7 +48,7 @@ /* save the EL to file */ retc = oh_el_setgentimestampflag(el, flag); if (retc == SA_OK) { - err("ERROR: oh_el_setgentimestampflag failed."); + CRIT("oh_el_setgentimestampflag failed."); return 1; } Modified: openhpi/trunk/utils/t/el/el_test_045.c =================================================================== --- openhpi/trunk/utils/t/el/el_test_045.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/el/el_test_045.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -61,14 +61,14 @@ retc = oh_el_prepend(el, &event, NULL, NULL); if (retc != SA_OK) { - err("ERROR: oh_el_prepend failed."); + CRIT("oh_el_prepend failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { - err("ERROR: oh_el_close on el failed."); + CRIT("oh_el_close on el failed."); return 1; } Modified: openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c =================================================================== --- openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c 2010-12-24 16:14:39 UTC (rev 7226) +++ openhpi/trunk/utils/t/sahpi/sahpi_text_utils_test.c 2010-12-24 17:29:43 UTC (rev 7227) @@ -37,7 +37,7 @@ #define failed(num) \ do { \ failcount++; \ - err("Failed Test %d", num); \ + CRIT("Failed Test %d", num); \ } while(0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-24 18:59:13
|
Revision: 7228 http://openhpi.svn.sourceforge.net/openhpi/?rev=7228&view=rev Author: avpak Date: 2010-12-24 18:59:05 +0000 (Fri, 24 Dec 2010) Log Message: ----------- More on feature request #3129960 Bring some order in Makefiles Modified Paths: -------------- openhpi/trunk/baselib/Makefile.am openhpi/trunk/clients/Makefile.am openhpi/trunk/hpi_shell/Makefile.am openhpi/trunk/marshal/Makefile.am openhpi/trunk/openhpid/Makefile.am openhpi/trunk/snmp/Makefile.am openhpi/trunk/ssl/Makefile.am openhpi/trunk/transport/Makefile.am openhpi/trunk/utils/Makefile.am Modified: openhpi/trunk/baselib/Makefile.am =================================================================== --- openhpi/trunk/baselib/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/baselib/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -22,23 +22,21 @@ INCLUDES = \ @OPENHPI_INCLUDES@ -I$(top_srcdir)/transport -I$(top_srcdir)/marshal @OH_SSL_INCLUDES@ -EXTRA_DIST = \ - Makefile.mingw32 \ - conf.h \ - init.h \ - lock.h \ - session.h +EXTRA_DIST = Makefile.mingw32 lib_LTLIBRARIES = libopenhpi.la libopenhpi_la_SOURCES = conf.c \ + conf.h \ init.cpp \ + init.h \ lock.c \ + lock.h \ ohpi.cpp \ safhpi.cpp \ - session.cpp + session.cpp \ + session.h - libopenhpi_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ libopenhpi_la_LIBADD = $(top_builddir)/transport/libopenhpitransport.la -lstdc++ \ $(top_builddir)/marshal/libopenhpimarshal.la \ Modified: openhpi/trunk/clients/Makefile.am =================================================================== --- openhpi/trunk/clients/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/clients/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -5,34 +5,32 @@ INCLUDES = @OPENHPI_INCLUDES@ -EXTRA_DIST = Makefile.mingw32 oh_clients.h - COMMONLIBS = @STATIC_PLUGIN_LIBS@ @STATIC_PLUGIN_EXTRA_LIBS@ COMMONLIBS += $(top_builddir)/baselib/libopenhpi.la -CLIENTS_SRC = clients.c +CLIENTS_SRC = clients.c oh_clients.h bin_PROGRAMS = \ - hpidomain \ - hpievents \ - hpifan \ - hpiinv \ - hpiel \ - hpigensimdata \ - hpisensor \ - hpipower \ - hpitree \ - hpialarms \ - hpireset \ - hpiwdt \ - hpithres \ - hpitop \ - hpisettime \ - hpionIBMblade \ - ohdomainlist \ - ohhandler \ - ohparam + hpidomain \ + hpievents \ + hpifan \ + hpiinv \ + hpiel \ + hpigensimdata \ + hpisensor \ + hpipower \ + hpitree \ + hpialarms \ + hpireset \ + hpiwdt \ + hpithres \ + hpitop \ + hpisettime \ + hpionIBMblade \ + ohdomainlist \ + ohhandler \ + ohparam include_HEADERS = Modified: openhpi/trunk/hpi_shell/Makefile.am =================================================================== --- openhpi/trunk/hpi_shell/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/hpi_shell/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -19,21 +19,20 @@ bin_PROGRAMS = hpi_shell -HS_SOURCES = \ - hpi_cmd.h \ - hpi_cmd.c \ - cmdparser.c \ - commands.c \ - ctrl_inv.c \ - inputcmd.c \ - sensor.c \ - session.c \ - show.c \ - service.c \ - dimi.c \ - fumi.c +hpi_shell_SOURCES = \ + cmdparser.c \ + commands.c \ + ctrl_inv.c \ + dimi.c \ + fumi.c \ + hpi_cmd.c \ + hpi_cmd.h \ + inputcmd.c \ + sensor.c \ + service.c \ + session.c \ + show.c -hpi_shell_SOURCES = $(HS_SOURCES) hpi_shell_LDADD = $(COMMONLIBS) Modified: openhpi/trunk/marshal/Makefile.am =================================================================== --- openhpi/trunk/marshal/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/marshal/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -31,12 +31,12 @@ lib_LTLIBRARIES = libopenhpimarshal.la libopenhpimarshal_la_SOURCES = \ - marshal_hpi.h \ - marshal_hpi.c \ - marshal_hpi_types.h \ - marshal_hpi_types.c \ - marshal.h \ - marshal.c + marshal_hpi.c \ + marshal_hpi.h \ + marshal_hpi_types.c \ + marshal_hpi_types.h \ + marshal.c \ + marshal.h # we need glib-2.0 for gmalloc libopenhpimarshal_la_LDFLAGS= -version-info @HPI_LIB_VERSION@ @GLIB_ONLY_LIBS@ Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -27,31 +27,31 @@ EXTRA_DIST = \ Makefile.mingw32 \ - openhpid.sh.in \ + openhpid.sh.in + +# daemon library +noinst_LTLIBRARIES = libopenhpidaemon.la +libopenhpidaemon_la_SOURCES = \ + alarm.c \ alarm.h \ + conf.c \ conf.h \ + domain.c \ + event.c \ + hotswap.c \ hotswap.h \ + init.c \ init.h \ + lock.c \ lock.h \ - server.h \ + ohpi.c \ + plugin.c \ + plugin_static.c \ + safhpi.c \ + session.c \ + threaded.c \ threaded.h -# daemon library -noinst_LTLIBRARIES = libopenhpidaemon.la -libopenhpidaemon_la_SOURCES = conf.c \ - domain.c \ - event.c \ - threaded.c \ - alarm.c \ - hotswap.c \ - lock.c \ - plugin.c \ - plugin_static.c \ - init.c \ - safhpi.c \ - session.c \ - ohpi.c - libopenhpidaemon_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la if HAVE_OPENSSL @@ -62,7 +62,7 @@ # daemon sbin_PROGRAMS = openhpid -openhpid_SOURCES = server.cpp openhpid-posix.cpp +openhpid_SOURCES = server.cpp server.h openhpid-posix.cpp openhpid_LDADD = libopenhpidaemon.la \ $(top_builddir)/marshal/libopenhpimarshal.la \ Modified: openhpi/trunk/snmp/Makefile.am =================================================================== --- openhpi/trunk/snmp/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/snmp/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -18,9 +18,7 @@ lib_LTLIBRARIES = libopenhpi_snmp.la -EXTRA_DIST = snmp_utils.h +libopenhpi_snmp_la_SOURCES = snmp_utils.c snmp_utils.h -libopenhpi_snmp_la_SOURCES = snmp_utils.c - libopenhpi_snmp_la_LIBADD = -luuid @SNMPLIBS@ libopenhpi_snmp_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ Modified: openhpi/trunk/ssl/Makefile.am =================================================================== --- openhpi/trunk/ssl/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/ssl/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -16,8 +16,6 @@ lib_LTLIBRARIES = libopenhpi_ssl.la -EXTRA_DIST = oh_ssl.h +libopenhpi_ssl_la_SOURCES = oh_ssl.c oh_ssl.h -libopenhpi_ssl_la_SOURCES = oh_ssl.c - libopenhpi_ssl_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ @CRYPTO_LIB@ Modified: openhpi/trunk/transport/Makefile.am =================================================================== --- openhpi/trunk/transport/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/transport/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -28,8 +28,8 @@ lib_LTLIBRARIES = libopenhpitransport.la libopenhpitransport_la_SOURCES = \ - strmsock.h \ - strmsock.cpp + strmsock.cpp \ + strmsock.h libopenhpitransport_la_LDFLAGS= -version-info @HPI_LIB_VERSION@ Modified: openhpi/trunk/utils/Makefile.am =================================================================== --- openhpi/trunk/utils/Makefile.am 2010-12-24 17:29:43 UTC (rev 7227) +++ openhpi/trunk/utils/Makefile.am 2010-12-24 18:59:05 UTC (rev 7228) @@ -47,18 +47,7 @@ GENERATED_FILES = $(GENERATED_HEADER_FILES) $(GENERATED_SRC_FILES) -EXTRA_DIST = \ - Makefile.mingw32 \ - $(GENERATED_HEADER_FILES) \ - announcement_utils.h \ - el_utils.h \ - epath_utils.h \ - oh_utils.h \ - rpt_utils.h \ - sahpi_event_utils.h \ - sahpi_struct_utils.h \ - sahpi_time_utils.h \ - uid_utils.h +EXTRA_DIST = Makefile.mingw32 MOSTLYCLEANFILES = @TEST_CLEAN@ # FIXME:: Add when we can auto-generate files for SMP systems @@ -76,15 +65,25 @@ # Generated files (e.g.sahpi_enum_utils.c) must be listed first libopenhpiutils_la_SOURCES = \ - $(GENERATED_SRC_FILES) \ - announcement_utils.c \ - el_utils.c \ - epath_utils.c \ - rpt_utils.c \ - sahpi_event_utils.c \ - sahpi_struct_utils.c \ - sahpi_time_utils.c \ - uid_utils.c + $(GENERATED_SRC_FILES) \ + $(GENERATED_HEADER_FILES) \ + announcement_utils.c \ + announcement_utils.h \ + el_utils.c \ + el_utils.h \ + epath_utils.c \ + epath_utils.h \ + oh_utils.h \ + rpt_utils.c \ + rpt_utils.h \ + sahpi_event_utils.c \ + sahpi_event_utils.h \ + sahpi_struct_utils.c \ + sahpi_struct_utils.h \ + sahpi_time_utils.c \ + sahpi_time_utils.h \ + uid_utils.c \ + uid_utils.h libopenhpiutils_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ libopenhpiutils_la_LIBADD = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-24 20:29:59
|
Revision: 7230 http://openhpi.svn.sourceforge.net/openhpi/?rev=7230&view=rev Author: avpak Date: 2010-12-24 20:29:53 +0000 (Fri, 24 Dec 2010) Log Message: ----------- More on Feature Request #3129960 Refining Makefiles more Modified Paths: -------------- openhpi/trunk/Makefile.am openhpi/trunk/configure.ac openhpi/trunk/marshal/Makefile.am openhpi/trunk/openhpid/Makefile.am openhpi/trunk/plugins/slave/Makefile.am openhpi/trunk/snmp/Makefile.am openhpi/trunk/ssl/Makefile.am Modified: openhpi/trunk/Makefile.am =================================================================== --- openhpi/trunk/Makefile.am 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/Makefile.am 2010-12-24 20:29:53 UTC (rev 7230) @@ -59,7 +59,7 @@ SUBDIRS = utils scripts @SSLDIR@ @SNMPDIR@ transport marshal baselib @ENABLED_DIRS@ plugins docs hpi_shell -DIST_SUBDIRS = utils scripts snmp ssl transport marshal baselib openhpid plugins docs clients cpp hpi_shell +DIST_SUBDIRS = utils scripts ssl snmp transport marshal baselib openhpid plugins docs clients cpp hpi_shell DISTCHECK_CONFIGURE_FLAGS = --with-initdir=prefix Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/configure.ac 2010-12-24 20:29:53 UTC (rev 7230) @@ -630,10 +630,7 @@ CC_WARNINGS="$CC_WARNINGS -Werror" CXX_WARNINGS="$CXX_WARNINGS -Werror" fi], - [ - CC_WARNINGS="$CC_WARNINGS -Werror" - CXX_WARNINGS="$CXX_WARNINGS -Werror" - ]) + []) if test -n "`gcc --version | grep ' 3.2'`" ; then CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'` Modified: openhpi/trunk/marshal/Makefile.am =================================================================== --- openhpi/trunk/marshal/Makefile.am 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/marshal/Makefile.am 2010-12-24 20:29:53 UTC (rev 7230) @@ -39,7 +39,8 @@ marshal.h # we need glib-2.0 for gmalloc -libopenhpimarshal_la_LDFLAGS= -version-info @HPI_LIB_VERSION@ @GLIB_ONLY_LIBS@ +libopenhpimarshal_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ +libopenhpimarshal_la_LIBADD = @GLIB_ONLY_LIBS@ clean-local: rm -f *~ core core.* Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-24 20:29:53 UTC (rev 7230) @@ -52,12 +52,13 @@ threaded.c \ threaded.h -libopenhpidaemon_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la +libopenhpidaemon_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la \ + @GMODULE_ONLY_LIBS@ if HAVE_OPENSSL libopenhpidaemon_la_LIBADD += $(top_builddir)/$(SSLDIR)/libopenhpi_ssl.la endif -libopenhpidaemon_la_LDFLAGS = @HPI_LIB_VERSION@ @GMODULE_ONLY_LIBS@ +libopenhpidaemon_la_LDFLAGS = @HPI_LIB_VERSION@ # daemon sbin_PROGRAMS = openhpid @@ -70,7 +71,7 @@ openhpid_LDFLAGS = -export-dynamic -# this is defined with ./configure --disable-dynamicdaemon +# this is defined with ./configure --disable-dynamic-daemon if OPENHPID_STATIC openhpid_LDFLAGS += -static else Modified: openhpi/trunk/plugins/slave/Makefile.am =================================================================== --- openhpi/trunk/plugins/slave/Makefile.am 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/plugins/slave/Makefile.am 2010-12-24 20:29:53 UTC (rev 7230) @@ -33,5 +33,6 @@ util.cpp \ util.h -libslave_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ @GMODULE_ONLY_LIBS@ +libslave_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ +libslave_la_LIBADD = @GMODULE_ONLY_LIBS@ Modified: openhpi/trunk/snmp/Makefile.am =================================================================== --- openhpi/trunk/snmp/Makefile.am 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/snmp/Makefile.am 2010-12-24 20:29:53 UTC (rev 7230) @@ -20,5 +20,5 @@ libopenhpi_snmp_la_SOURCES = snmp_utils.c snmp_utils.h +libopenhpi_snmp_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ libopenhpi_snmp_la_LIBADD = -luuid @SNMPLIBS@ -libopenhpi_snmp_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ Modified: openhpi/trunk/ssl/Makefile.am =================================================================== --- openhpi/trunk/ssl/Makefile.am 2010-12-24 19:05:52 UTC (rev 7229) +++ openhpi/trunk/ssl/Makefile.am 2010-12-24 20:29:53 UTC (rev 7230) @@ -18,4 +18,6 @@ libopenhpi_ssl_la_SOURCES = oh_ssl.c oh_ssl.h -libopenhpi_ssl_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ @CRYPTO_LIB@ +libopenhpi_ssl_la_LDFLAGS = -version-info @HPI_LIB_VERSION@ +libopenhpi_ssl_la_LIBADD = @CRYPTO_LIB@ + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-24 21:47:46
|
Revision: 7231 http://openhpi.svn.sourceforge.net/openhpi/?rev=7231&view=rev Author: avpak Date: 2010-12-24 21:47:40 +0000 (Fri, 24 Dec 2010) Log Message: ----------- More on Feature Request #3031797 Modified Paths: -------------- openhpi/trunk/Makefile.mingw32 openhpi/trunk/Makefile.mingw32.def openhpi/trunk/baselib/Makefile.mingw32 openhpi/trunk/clients/Makefile.mingw32 openhpi/trunk/marshal/Makefile.mingw32 openhpi/trunk/openhpid/Makefile.mingw32 openhpi/trunk/openhpid/conf.c openhpi/trunk/openhpid/openhpid-win32.cpp openhpi/trunk/plugins/slave/handler.cpp openhpi/trunk/transport/Makefile.mingw32 openhpi/trunk/utils/Makefile.mingw32 Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -6,7 +6,8 @@ marshal \ baselib \ clients -# openhpid + # openhpid \ + # plugins/slave .PHONY: all clean $(openhpi_libs) @@ -25,6 +26,7 @@ out: all rm -rf ${out} mkdir -p ${out} +# mkdir -p ${out}/plugins cp README.windows ${out} cat include/SaHpi.h | sed -e 's/ __attribute__.*/;/' -e 's/#define SAHPI_API/#define SAHPI_API __declspec(dllimport)/' > ${out}/SaHpi.h cp include/oHpi.h ${out} @@ -37,4 +39,6 @@ cp baselib/libopenhpi-${VERSION}.a ${out}/ cp baselib/libopenhpi-${VERSION}.def ${out}/ cp clients/*.exe ${out}/ +# cp openhpid/openhpid.exe ${out}/ +# cp plugins/slave/libslave.dll ${out}/plugins Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/Makefile.mingw32.def 2010-12-24 21:47:40 UTC (rev 7231) @@ -14,9 +14,6 @@ GMODULE_LIBS := -L ${GLIB_DIR}/lib -lgmodule-2.0 ############################################################################ -INCLUDES := -I ../include -I ../mingw32 - -CFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 ${INCLUDES} -CXXFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 ${INCLUDES} +CPPFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 -DOH_DBG_MSGS LDFLAGS := -no-undefined --enable-runtime-pseudo-reloc Modified: openhpi/trunk/baselib/Makefile.mingw32 =================================================================== --- openhpi/trunk/baselib/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/baselib/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -11,14 +11,18 @@ OBJ := $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC})) -INCLUDES := ${GLIB_INCLUDES} -I ../utils -I ../transport -I ../marshal +DEFS := -DG_LOG_DOMAIN=\"baselib\" +DEFS += -DSAHPI_API="__declspec(dllexport)" + +INCLUDES := ${GLIB_INCLUDES} +INCLUDES += -I ../mingw32 -I ../include -I ../utils -I ../transport -I ../marshal + LIBS := ${GLIB_LIBS} ${GTHREAD_LIBS} LIBS += -L ../utils -lopenhpiutils-${VERSION} LIBS += -L ../transport -lopenhpitransport-${VERSION} LIBS += -L ../marshal -lopenhpimarshal-${VERSION} -CXXFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllexport)" -CFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllexport)" +CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean Modified: openhpi/trunk/clients/Makefile.mingw32 =================================================================== --- openhpi/trunk/clients/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/clients/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -22,20 +22,23 @@ OBJS := $(patsubst %.exe, %.o, ${TARGETS}) clients.o -INCLUDES := ${GLIB_INCLUDES} -I ../utils -I ../include -LIB_DIRS := ${GLIB_LIBS} -L ../baselib -L ../utils -LIB_DIRS += -L ../baselib -lopenhpi-${VERSION} -LIB_DIRS += -L ../utils -lopenhpiutils-${VERSION} +DEFS := -DG_LOG_DOMAIN=\"client\" +DEFS += -DSAHPI_API="__declspec(dllimport)" -CXXFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllimport)" -CFLAGS += ${INCLUDES} -DSAHPI_API="__declspec(dllimport)" +INCLUDES := ${GLIB_INCLUDES} -I ../mingw32 -I ../include -I ../utils +LIBS := ${GLIB_LIBS} +LIBS += -L ../baselib -lopenhpi-${VERSION} +LIBS += -L ../utils -lopenhpiutils-${VERSION} + +CPPFLAGS += ${DEFS} ${INCLUDES} + .PHONY: all clean all : ${TARGETS} %.exe : %.o clients.o - ${CXX} -o $@ $^ ${LIB_DIRS} + ${CXX} -o $@ $^ ${LIBS} clean: rm -f ${OBJS} ${TARGETS} Modified: openhpi/trunk/marshal/Makefile.mingw32 =================================================================== --- openhpi/trunk/marshal/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/marshal/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -8,14 +8,20 @@ OBJ := $(patsubst %.c, %.o, ${SRC}) -CFLAGS += ${GLIB_INCLUDES} -I ../utils +DEFS := -DG_LOG_DOMAIN=\"marshal\" +INCLUDES := ${GLIB_INCLUDES} -I ../mingw32 -I ../include -I ../utils + +LIBS := ${GLIB_LIBS} + +CPPFLAGS += ${DEFS} ${INCLUDES} + .PHONY: all clean all : ${TARGET} ${TARGET} : ${OBJ} - ${CC} -shared -o $@ $^ ${GLIB_LIBS} + ${CC} -shared -o $@ $^ ${LIBS} clean: rm -f ${OBJ} ${TARGET} Modified: openhpi/trunk/openhpid/Makefile.mingw32 =================================================================== --- openhpi/trunk/openhpid/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/openhpid/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -20,22 +20,24 @@ OBJ := $(patsubst %.c, %.o,$(patsubst %.cpp, %.o, ${SRC} ) ) -INCLUDES := ${GLIB_INCLUDES} -I ../utils -I ../transport -I ../marshal -LIB_DIRS := ${GLIB_LIBS} -L ../utils -L ../transport -L ../marshal +DEFS := -DG_LOG_DOMAIN=\"openhpid\" -CXXFLAGS += ${INCLUDES} -CFLAGS += ${INCLUDES} +INCLUDES := ${GLIB_INCLUDES} +INCLUDES += -I ../mingw32 -I ../include -I ../utils -I ../transport -I ../marshal +LIBS := ${GLIB_LIBS} ${GTHREAD_LIBS} ${GMODULE_LIBS} +LIBS += -L ../utils -lopenhpiutils-${VERSION} +LIBS += -L ../transport -lopenhpitransport-${VERSION} +LIBS += -L ../marshal -lopenhpimarshal-${VERSION} + +CPPFLAGS += ${DEFS} ${INCLUDES} + .PHONY: all clean all : ${TARGET} ${TARGET} : ${OBJ} - ${CXX} -o $@ $^ ${LIB_DIRS} \ - -lglib-2.0 -lgthread-2.0 -lgmodule-2.0 \ - -lopenhpiutils-${VERSION} \ - -lopenhpitransport-${VERSION} \ - -lopenhpimarshal-${VERSION} + ${CXX} -o $@ $^ ${LIBS} clean: rm -f ${OBJ} ${TARGET} Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/openhpid/conf.c 2010-12-24 21:47:40 UTC (rev 7231) @@ -548,7 +548,7 @@ g_scanner_destroy(oh_scanner); - DBG("Done processing conf file.\nNumber of parse errors:%d", done); + DBG("Done processing conf file. Parse errors: %d", done); config->handler_configs = handler_configs; Modified: openhpi/trunk/openhpid/openhpid-win32.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-win32.cpp 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/openhpid/openhpid-win32.cpp 2010-12-24 21:47:40 UTC (rev 7231) @@ -14,25 +14,203 @@ * */ +#include <getopt.h> +#include <stddef.h> #include <stdio.h> +#include <stdlib.h> #include <glib.h> #include <oHpi.h> +#include <oh_error.h> + #include "init.h" #include "server.h" +static bool daemonized = false; +static bool verbose_flag = false; + + /*--------------------------------------------------------------------*/ +/* Function: display_help */ +/*--------------------------------------------------------------------*/ + +void display_help(void) +{ + printf("Help for openhpid:\n\n"); + printf(" openhpid -c conf_file [-v] [-p port]\n\n"); + printf(" -c conf_file Sets path/name of the configuration file.\n"); + printf(" This option is required unless the environment\n"); + printf(" variable OPENHPI_CONF has been set to a valid\n"); + printf(" configuration file.\n"); + printf(" -v This option causes the daemon to display verbose\n"); + printf(" messages. This option is optional.\n"); + printf(" -p port Overrides the default listening port (%d) of\n", + OPENHPI_DEFAULT_DAEMON_PORT); + printf(" the daemon. The option is optional.\n"); + printf(" -s seconds Overrides the default socket read timeout of 30\n"); + printf(" minutes. The option is optional.\n"); + printf(" -t threads Sets the maximum number of connection threads.\n"); + printf(" The default is umlimited. The option is optional.\n"); + printf(" -n Forces the code to run as a foreground process\n"); + printf(" and NOT as a daemon. The default is to run as\n"); + printf(" a daemon. The option is optional.\n\n"); + printf("A typical invocation might be\n\n"); + printf(" openhpid.exe -c C:\\openhpi.conf\n\n"); +} + + +/*--------------------------------------------------------------------*/ +/* Function: setenv */ +/*--------------------------------------------------------------------*/ + +static int setenv(const char * var, const char * val) +{ + static const size_t BUFSIZE = 1024; + char buf[BUFSIZE]; + snprintf(buf, BUFSIZE, "%s=%s", var, val); + return _putenv(buf); +} + + +/*--------------------------------------------------------------------*/ +/* Logging Utility Functions */ +/*--------------------------------------------------------------------*/ + +static const char * get_log_level_name(GLogLevelFlags log_level) +{ + if (log_level & G_LOG_LEVEL_ERROR) { + return "ERR"; + } else if (log_level & G_LOG_LEVEL_CRITICAL) { + return "CRIT"; + } else if (log_level & G_LOG_LEVEL_WARNING) { + return "WARN"; + } else if (log_level & G_LOG_LEVEL_MESSAGE) { + return "MSG"; + } else if (log_level & G_LOG_LEVEL_INFO) { + return "INFO"; + } else if (log_level & G_LOG_LEVEL_DEBUG) { + return "DBG"; + } + return "???"; +} + +void log_handler(const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer /*user_data */) +{ + if ((!verbose_flag) && ((log_level & G_LOG_LEVEL_CRITICAL) == 0) ) { + return; + } + if (!daemonized) { + printf("%s: %s: %s\n", + log_domain, + get_log_level_name(log_level), + message); + } else { + // TODO implement + } +} + + +/*--------------------------------------------------------------------*/ /* Function: main */ /*--------------------------------------------------------------------*/ int main(int argc, char *argv[]) { - // TODO implement - printf( "Hello World\n" ); +// TODO deamonization + g_log_set_default_handler(log_handler, 0); + struct option options[] = { + {"verbose", no_argument, 0, 'v'}, + {"nondaemon", no_argument, 0, 'n'}, + {"cfg", required_argument, 0, 'c'}, + {"port", required_argument, 0, 'p'}, + {"timeout", required_argument, 0, 's'}, + {"threads", required_argument, 0, 't'}, + {0, 0, 0, 0} + }; + + char *cfgfile = 0; + int port = OPENHPI_DEFAULT_DAEMON_PORT; + unsigned int sock_timeout = 0; // unlimited + int max_threads = -1; // unlimited + bool runasdaemon = true; + + /* get the command line options */ + int c; + while (1) { + c = getopt_long(argc, argv, "nvc:p:f:s:t:", options, 0); + /* detect when done scanning options */ + if (c == -1) { + break; + } + switch (c) { + case 0: + /* no need to do anything here */ + break; + case 'c': + setenv("OPENHPI_CONF", optarg); + cfgfile = g_strdup(optarg); + break; + case 'p': + setenv("OPENHPI_DAEMON_PORT", optarg); + port = atoi(optarg); + break; + case 'v': + verbose_flag = true; + break; + case 's': + sock_timeout = atoi(optarg); + break; + case 't': + max_threads = atoi(optarg); + if (max_threads <= 0) { + max_threads = -1; + } + break; + case 'n': + runasdaemon = false; + break; + case '?': + default: + /* they obviously need it */ + display_help(); + exit(-1); + } + } + if (optind < argc) { + CRIT("Unknown command line option specified. Exiting."); + display_help(); + exit(-1); + } + + // see if we have a valid configuration file + if ((!cfgfile) || (!g_file_test(cfgfile, G_FILE_TEST_EXISTS))) { + CRIT("Cannot find configuration file. Exiting."); + display_help(); + exit(-1); + } + + if (oh_init()) { // Initialize OpenHPI + CRIT("There was an error initializing OpenHPI. Exiting."); + return 8; + } + + // announce ourselves + INFO("%s version %s started.", argv[0], VERSION); + INFO("OPENHPI_CONF = %s.", cfgfile); + INFO("OPENHPI_DAEMON_PORT = %u.", port); + + bool rc = oh_server_run(port, sock_timeout, max_threads); + if (!rc) { + return 9; + } + return 0; } Modified: openhpi/trunk/plugins/slave/handler.cpp =================================================================== --- openhpi/trunk/plugins/slave/handler.cpp 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/plugins/slave/handler.cpp 2010-12-24 21:47:40 UTC (rev 7231) @@ -106,7 +106,7 @@ bool cHandler::WaitForDiscovery() { while ( m_startup_discovery_status == StartupDiscoveryUncompleted ) { - usleep( (useconds_t)( DiscoveryStatusCheckInterval / 1000ULL ) ); + g_usleep( (gulong)( DiscoveryStatusCheckInterval / 1000ULL ) ); } return ( m_startup_discovery_status == StartupDiscoveryDone ); @@ -188,7 +188,7 @@ } } if ( !m_stop ) { - usleep( (useconds_t)( OpenSessionRetryInterval / 1000ULL ) ); + g_usleep( (gulong)( OpenSessionRetryInterval / 1000ULL ) ); } } } Modified: openhpi/trunk/transport/Makefile.mingw32 =================================================================== --- openhpi/trunk/transport/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/transport/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -6,14 +6,20 @@ OBJ := $(patsubst %.cpp, %.o, ${SRC}) -CXXFLAGS += ${GLIB_INCLUDES} +DEFS := -DG_LOG_DOMAIN=\"transport\" +INCLUDES := ${GLIB_INCLUDES} -I ../mingw32 -I ../include + +LIBS := ${GLIB_LIBS} -lws2_32 + +CPPFLAGS += ${DEFS} ${INCLUDES} + .PHONY: all clean all : ${TARGET} ${TARGET} : ${OBJ} - ${CXX} -shared -o $@ $^ -lws2_32 + ${CXX} -shared -o $@ $^ ${LIBS} clean: rm -f ${OBJ} ${TARGET} Modified: openhpi/trunk/utils/Makefile.mingw32 =================================================================== --- openhpi/trunk/utils/Makefile.mingw32 2010-12-24 20:29:53 UTC (rev 7230) +++ openhpi/trunk/utils/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) @@ -16,14 +16,20 @@ uid_utils.c OBJ := $(patsubst %.c, %.o, ${SRC}) -CFLAGS += ${GLIB_INCLUDES} -I . +DEFS := -DG_LOG_DOMAIN=\"utils\" +INCLUDES := ${GLIB_INCLUDES} -I ../mingw32 -I ../include -I . + +LIBS := ${GLIB_LIBS} + +CPPFLAGS += ${DEFS} ${INCLUDES} + .PHONY: all clean all : ${TARGET} ${TARGET} : ${OBJ} - ${CC} -shared -o $@ $^ ${GLIB_LIBS} \ + ${CC} -shared -o $@ $^ ${LIBS} \ -Wl,--out-implib,${@:.dll=.a} \ -Wl,--output-def,${@:.dll=.def} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-25 12:24:55
|
Revision: 7232 http://openhpi.svn.sourceforge.net/openhpi/?rev=7232&view=rev Author: avpak Date: 2010-12-25 12:24:47 +0000 (Sat, 25 Dec 2010) Log Message: ----------- More on Feature Request #3129960 oh_event and oh_event helpers moved to utils include/oh_event.h -> utils/event_utils.h slave: added missed slave.h slave: fixed debug output about created domain Modified Paths: -------------- openhpi/trunk/Makefile.am openhpi/trunk/baselib/conf.c openhpi/trunk/include/oh_handler.h openhpi/trunk/include/oh_session.h openhpi/trunk/openhpid/Makefile.am openhpi/trunk/openhpid/alarm.h openhpi/trunk/openhpid/domain.c openhpi/trunk/openhpid/event.c openhpi/trunk/openhpid/ohpi.c openhpi/trunk/openhpid/plugin.c openhpi/trunk/openhpid/safhpi.c openhpi/trunk/openhpid/session.c openhpi/trunk/openhpid/threaded.c openhpi/trunk/openhpid/threaded.h openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h openhpi/trunk/plugins/ipmi/ipmi.c openhpi/trunk/plugins/ipmi/ipmi_entity_event.c openhpi/trunk/plugins/ipmidirect/ipmi_domain.h openhpi/trunk/plugins/rtas/rtas_discover.h openhpi/trunk/plugins/rtas/rtas_resource.c openhpi/trunk/plugins/simulator/sim_injector.h openhpi/trunk/plugins/simulator/sim_sensors.h openhpi/trunk/plugins/slave/handler.cpp openhpi/trunk/plugins/slave/handler.h openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h openhpi/trunk/plugins/sysfs/sysfs2hpi.c openhpi/trunk/plugins/watchdog/watchdog.c openhpi/trunk/utils/Makefile.am openhpi/trunk/utils/Makefile.mingw32 openhpi/trunk/utils/oh_utils.h Added Paths: ----------- openhpi/trunk/openhpid/event.h openhpi/trunk/plugins/slave/slave.h openhpi/trunk/utils/event_utils.c openhpi/trunk/utils/event_utils.h Removed Paths: ------------- openhpi/trunk/include/oh_event.h Modified: openhpi/trunk/Makefile.am =================================================================== --- openhpi/trunk/Makefile.am 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/Makefile.am 2010-12-25 12:24:47 UTC (rev 7232) @@ -107,7 +107,8 @@ $(top_srcdir)/utils/sahpi_time_utils.h \ $(top_srcdir)/utils/uid_utils.h \ $(top_srcdir)/utils/epath_utils.h \ - $(top_srcdir)/utils/el_utils.h + $(top_srcdir)/utils/el_utils.h \ + $(top_srcdir)/utils/event_utils.h docsdir=$(datadir)/doc/$(PACKAGE_NAME)-$(VERSION) docs_DATA = README README.daemon COPYING Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/baselib/conf.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -24,7 +24,6 @@ #include <oHpi.h> #include <config.h> -#include <oh_domain.h> #include <oh_error.h> #include "conf.h" Deleted: openhpi/trunk/include/oh_event.h =================================================================== --- openhpi/trunk/include/oh_event.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/include/oh_event.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -1,125 +0,0 @@ -/* -*- linux-c -*- - * - * (C) Copyright IBM Corp. 2004-2006 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This - * file and program are licensed under a BSD style license. See - * the Copying file included with the OpenHPI distribution for - * full licensing terms. - * - * Author(s): - * Sean Dague <sd...@us...> - * Renier Morales <re...@op...> - * - */ - -#ifndef __OH_EVENT_H -#define __OH_EVENT_H - -#include <SaHpi.h> -#include <glib.h> - -#define OH_MAX_EVT_QUEUE_LIMIT 0 - -#ifdef __cplusplus -extern "C" { -#endif - -/*** - * Instructions for using oh_event - ********************************* - * oh_event is primarily used by the plugins to report HPI events. - * - * Required Fields: - * .hid, .event - * - * Optional Fields: - * .resource, .rdrs - * - * - * Any Resource oh_events: - * Use RESOURCE_UPDATED event for updating RPT entry. - * - * FRU Resource oh_events: - * If reporting a resource, the plugin sets the appropiate event in .event. - * For example, if reporting a new FRU resource, then the event should be - * a hotswap type showing the correct hotswap state (any except NOT_PRESENT) - * indicating the library that it should add it to the RPT. - * If the plugin needs to report an extracted FRU, then the hotswap - * event has to show the NOT_PRESENT current state, indicating to the library - * that it should remove it from the RPT. - * Hotswap events must have their accompaining resource set its capability bit - * for FRU to 1 or it will be dropped by the infrastructure. - * The .resource.ResourceCapabilities field can be zero. - * If so, the RPT will not be updated, but the SaHpiEventT will be passed - * on to the session queues and domain event log normally. - * - * Non-FRU Resource oh_events: - * For adding or updating Non-FRU resources, the .event should be a resource - * type HPI event and the ResourceEventType should be RESOURCE_ADDED or - * RESOURCE_RESTORED. The resource itself should have its capability bit for - * FRU set to zero or the event will be dropped by the infrastructure. - * Use RESOURCE_REMOVED for removing Non-FRU resource from the RPT. - * If a resource is failed, then the oh_event should - * have a resource event type with the resource state as RESOURCE_FAILED. - * The .resource field should have the RPT entry for resource in question. - * This is used by the infrastructure to update the RPT and mark the resource - * as failed (ResourceFailed == True). - * The .resource.ResourceCapabilities field can be zero. If so, - * the RPT will not be updated, but the SaHpiEventT will be passed on to the - * session queues and domain event log normally. - * - * RDRs: - * If the event is for a resource, be it FRU or Non-FRU, and the resource did - * not previously exist in the RPT for the domain, then the .rdrs field is - * scanned for valid SaHpiRdrTs (RdrType != SAHPI_NO_RECORD) objects and each - * one is added as an rdr for the resource to the RPT. If the resource is - * already in the RPT, then the rdrs field will be ignored for all - * event except RESOURCE_UPDATED. - * In addition to updating RPT entry, the RESOURCE_UPDATED event - * can be used for adding, updating or removing RDRs. - * - * Other event types: - * If the event is of type SENSOR, SENSOR_ENABLE_CHANGE, WATCHDOG, or OEM, then - * The .resource field is scanned for a valid resource to use as reference for - * the domain event log. Also, the .rdrs field is scanned for exactly one - * SaHpiRdrT to be used as reference for the domain event log and session event - * queue. If multiple rdrs are passed for these event types, only the first one - * will be used. - **/ - -struct oh_event { - unsigned int hid; /* handler id for the event */ - SaHpiEventT event; - /* If no resource, ResourceCapabilities must be 0 */ - SaHpiRptEntryT resource; - GSList *rdrs; - GSList *rdrs_to_remove; -}; - -typedef struct _oh_evt_queue oh_evt_queue; -extern oh_evt_queue oh_process_q; - -/* Event utility macros */ -#define oh_new_event() g_new0(struct oh_event, 1) -#define oh_copy_event(dest, src) memcpy(dest, src, sizeof(struct oh_event)) -#define sahpi_new_event() g_new0(SaHpiEventT, 1) -#define sahpi_dup_event(old) g_memdup(old, sizeof(SaHpiEventT)) -#define sahpi_copy_event(dest, src) memcpy(dest, src, sizeof(SaHpiEventT)) - -/* function definitions */ -int oh_event_init(void); -void oh_evt_queue_push(oh_evt_queue *equeue, gpointer data); -SaErrorT oh_harvest_events(void); -SaErrorT oh_process_events(void); -void oh_event_free(struct oh_event *e, int only_rdrs); -struct oh_event *oh_dup_event(struct oh_event *old_event); - -#ifdef __cplusplus -} -#endif - -#endif /* __OH_EVENT_H */ - Modified: openhpi/trunk/include/oh_handler.h =================================================================== --- openhpi/trunk/include/oh_handler.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/include/oh_handler.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -24,18 +24,15 @@ #include <uuid/uuid.h> #include <glib.h> -#include <sys/time.h> #include <SaHpi.h> -#include <oh_event.h> -#include <oh_utils.h> #include <oHpi.h> +#include <oh_utils.h> + #ifdef __cplusplus extern "C" { #endif -void oh_wake_event_thread(SaHpiBoolT); - /* * Common OpenHPI implementation specific definitions * -------------------------------------------------- Modified: openhpi/trunk/include/oh_session.h =================================================================== --- openhpi/trunk/include/oh_session.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/include/oh_session.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -17,10 +17,12 @@ #ifndef __OH_SESSION_H #define __OH_SESSION_H -#include <SaHpi.h> -#include <oh_event.h> #include <glib.h> +#include <SaHpi.h> + +#include <oh_utils.h> + #ifdef __cplusplus extern "C" { #endif Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/Makefile.am 2010-12-25 12:24:47 UTC (rev 7232) @@ -38,6 +38,7 @@ conf.h \ domain.c \ event.c \ + event.h \ hotswap.c \ hotswap.h \ init.c \ Modified: openhpi/trunk/openhpid/alarm.h =================================================================== --- openhpi/trunk/openhpid/alarm.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/alarm.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -19,7 +19,7 @@ #include <SaHpi.h> #include <oh_domain.h> -#include <oh_event.h> +#include <oh_utils.h> #ifdef __cplusplus extern "C" { Modified: openhpi/trunk/openhpid/domain.c =================================================================== --- openhpi/trunk/openhpid/domain.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/domain.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -21,12 +21,12 @@ #include <oh_domain.h> #include <oh_error.h> -#include <oh_event.h> #include <oh_plugin.h> #include <oh_utils.h> #include "alarm.h" #include "conf.h" +#include "event.h" #define domains_lock() g_static_rec_mutex_lock(&oh_domains.lock) #define domains_unlock() g_static_rec_mutex_unlock(&oh_domains.lock) @@ -140,7 +140,7 @@ DBG("domain %d %s domain %d", subject_id, type == SAHPI_DOMAIN_REF_ADDED ? "added to" : "removed from", target_id); - oh_evt_queue_push(&oh_process_q, e); + oh_evt_queue_push(oh_process_q, e); } static void update_drt(SaHpiDomainIdT target_id, Modified: openhpi/trunk/openhpid/event.c =================================================================== --- openhpi/trunk/openhpid/event.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/event.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -26,7 +26,6 @@ #include <oh_domain.h> #include <oh_error.h> -#include <oh_event.h> #include <oh_handler.h> #include <oh_plugin.h> #include <oh_session.h> @@ -34,15 +33,11 @@ #include "alarm.h" #include "conf.h" +#include "event.h" -struct _oh_evt_queue { - GAsyncQueue *q; -}; -oh_evt_queue oh_process_q = { .q = NULL }; +oh_evt_queue * oh_process_q = 0; -extern GMutex *oh_event_thread_mutex; - /* * The following is required to set up the thread state for * the use of event async queues. This is true even if we aren't @@ -51,8 +46,8 @@ int oh_event_init() { DBG("Setting up event processing queue"); - if (!oh_process_q.q) oh_process_q.q = g_async_queue_new(); - if (oh_process_q.q) { + if (!oh_process_q) oh_process_q = g_async_queue_new(); + if (oh_process_q) { DBG("Set up processing queue"); return 1; } else { @@ -61,33 +56,6 @@ } } -void oh_evt_queue_push(oh_evt_queue *equeue, gpointer data) -{ - g_async_queue_push(equeue->q, data); - return; -} - -void oh_event_free(struct oh_event *e, int only_rdrs) -{ - if (e) { - if (e->rdrs) { - GSList *node = NULL; - for (node = e->rdrs; node; node = node->next) { - g_free(node->data); - } - g_slist_free(e->rdrs); - } - if (e->rdrs_to_remove) { - GSList *node = NULL; - for (node = e->rdrs_to_remove; node; node = node->next) { - g_free(node->data); - } - g_slist_free(e->rdrs_to_remove); - } - if (!only_rdrs) g_free(e); - } -} - struct oh_event *oh_dup_event(struct oh_event *old_event) { GSList *node = NULL; @@ -478,7 +446,7 @@ // domain_results = oh_query_domains(); - while ((e = g_async_queue_pop(oh_process_q.q)) != NULL) { + while ((e = g_async_queue_pop(oh_process_q)) != NULL) { et = oh_lookup_eventtype(e->event.EventType); DBG("Event Type = %s", (et) ? et : "<Unknown>"); Added: openhpi/trunk/openhpid/event.h =================================================================== --- openhpi/trunk/openhpid/event.h (rev 0) +++ openhpi/trunk/openhpid/event.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -0,0 +1,41 @@ +/* -*- linux-c -*- + * + * (C) Copyright IBM Corp. 2004-2006 + * (C) Copyright Pigeon Point Systems. 2010 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Sean Dague <sd...@us...> + * Renier Morales <re...@op...> + * Anton Pak <ant...@pi...> + * + */ + +#ifndef __OH_EVENT_H +#define __OH_EVENT_H + +#include <oh_utils.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern oh_evt_queue * oh_process_q; + +/* function definitions */ +int oh_event_init(void); +SaErrorT oh_harvest_events(void); +SaErrorT oh_process_events(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __OH_EVENT_H */ + Modified: openhpi/trunk/openhpid/ohpi.c =================================================================== --- openhpi/trunk/openhpid/ohpi.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/ohpi.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -20,16 +20,18 @@ #include <string.h> #include <oHpi.h> + +#include <config.h> + +#include <oh_domain.h> +#include <oh_error.h> #include <oh_plugin.h> -#include <oh_event.h> -#include <oh_domain.h> #include <oh_session.h> #include <oh_utils.h> -#include <oh_error.h> #include <sahpimacros.h> -#include <config.h> #include "conf.h" +#include "event.h" #include "init.h" #include "lock.h" @@ -334,7 +336,7 @@ return SA_OK; } - h->hnd = h->abi->open(h->config, h->id, &oh_process_q); + h->hnd = h->abi->open(h->config, h->id, oh_process_q); if (h->hnd == NULL) error = SA_ERR_HPI_INTERNAL_ERROR; else error = SA_OK; Modified: openhpi/trunk/openhpid/plugin.c =================================================================== --- openhpi/trunk/openhpid/plugin.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/plugin.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -31,6 +31,7 @@ #include <oh_plugin.h> #include "conf.h" +#include "event.h" #include "lock.h" /* @@ -592,7 +593,7 @@ handler->hnd = handler->abi->open(handler->config, handler->id, - &oh_process_q); + oh_process_q); if (!handler->hnd) { CRIT("A handler #%d on the %s plugin could not be opened.", handler->id, handler->plugin_name); Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/safhpi.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -37,6 +37,7 @@ #include "alarm.h" #include "conf.h" +#include "event.h" #include "hotswap.h" #include "init.h" #include "threaded.h" @@ -701,7 +702,7 @@ SAHPI_HS_STATE_NOT_PRESENT; e->event.EventDataUnion.HotSwapEvent.CauseOfStateChange = SAHPI_HS_CAUSE_USER_UPDATE; - oh_evt_queue_push(&oh_process_q, e); + oh_evt_queue_push(oh_process_q, e); return SA_OK; } @@ -1488,7 +1489,7 @@ /* indicate this is a user-added event */ e.resource.ResourceSeverity = SAHPI_INFORMATIONAL; - oh_evt_queue_push(&oh_process_q, g_memdup(&e, sizeof(struct oh_event))); + oh_evt_queue_push(oh_process_q, g_memdup(&e, sizeof(struct oh_event))); oh_wake_event_thread(SAHPI_TRUE); Modified: openhpi/trunk/openhpid/session.c =================================================================== --- openhpi/trunk/openhpid/session.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/session.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -250,6 +250,7 @@ struct oh_session *session = NULL; struct oh_event *qevent = NULL; struct oh_global_param param = {.type = OPENHPI_EVT_QUEUE_LIMIT }; + SaHpiBoolT nolimit = SAHPI_FALSE; if (sid < 1 || !event) return SA_ERR_HPI_INVALID_PARAMS; @@ -258,8 +259,9 @@ if (!qevent) return SA_ERR_HPI_OUT_OF_MEMORY; - if (oh_get_global_param(¶m)) - param.u.evt_queue_limit = OH_MAX_EVT_QUEUE_LIMIT; + if (oh_get_global_param(¶m)) { + nolimit = SAHPI_TRUE; + } g_static_rec_mutex_lock(&oh_sessions.lock); /* Locked session table */ session = g_hash_table_lookup(oh_sessions.table, &sid); @@ -269,7 +271,7 @@ return SA_ERR_HPI_INVALID_SESSION; } - if (param.u.evt_queue_limit != OH_MAX_EVT_QUEUE_LIMIT) { + if (nolimit == SAHPI_FALSE) { SaHpiSessionIdT tmp_sid; tmp_sid = session->id; gint qlength = g_async_queue_length(session->eventq); Modified: openhpi/trunk/openhpid/threaded.c =================================================================== --- openhpi/trunk/openhpid/threaded.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/threaded.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -18,6 +18,7 @@ #include <oh_plugin.h> #include "conf.h" +#include "event.h" #include "hotswap.h" #include "threaded.h" Modified: openhpi/trunk/openhpid/threaded.h =================================================================== --- openhpi/trunk/openhpid/threaded.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/openhpid/threaded.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -29,6 +29,7 @@ int oh_threaded_final(void); void oh_wake_discovery_thread(SaHpiBoolT wait); +void oh_wake_event_thread(SaHpiBoolT); #ifdef __cplusplus } Modified: openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/dynamic_simulator/new_sim_hotswap.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -20,7 +20,6 @@ #ifndef __NEW_SIM_HOTSWAP_H__ #define __NEW_SIM_HOTSWAP_H__ -#include <oh_event.h> #include <oh_utils.h> #ifndef __NEW_SIM_UTILS_H__ Modified: openhpi/trunk/plugins/ipmi/ipmi.c =================================================================== --- openhpi/trunk/plugins/ipmi/ipmi.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/ipmi/ipmi.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -19,7 +19,7 @@ */ #include "ipmi.h" -#include <oh_event.h> +#include <oh_utils.h> #include <netdb.h> /* Watchdog definitions */ Modified: openhpi/trunk/plugins/ipmi/ipmi_entity_event.c =================================================================== --- openhpi/trunk/plugins/ipmi/ipmi_entity_event.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/ipmi/ipmi_entity_event.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -14,7 +14,6 @@ */ #include "ipmi.h" -#include<oh_event.h> #include <oh_utils.h> #include <string.h> Modified: openhpi/trunk/plugins/ipmidirect/ipmi_domain.h =================================================================== --- openhpi/trunk/plugins/ipmidirect/ipmi_domain.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/ipmidirect/ipmi_domain.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -34,7 +34,6 @@ } #include <oh_error.h> -#include <oh_event.h> #include <oh_handler.h> #include <oh_utils.h> Modified: openhpi/trunk/plugins/rtas/rtas_discover.h =================================================================== --- openhpi/trunk/plugins/rtas/rtas_discover.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/rtas/rtas_discover.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -22,7 +22,6 @@ #include <oh_handler.h> #include <oh_utils.h> #include <oh_error.h> -#include <oh_event.h> #include <rtas_sensor.h> #include <librtas.h> Modified: openhpi/trunk/plugins/rtas/rtas_resource.c =================================================================== --- openhpi/trunk/plugins/rtas/rtas_resource.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/rtas/rtas_resource.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -16,7 +16,6 @@ #include <rtas_resource.h> #include <oh_handler.h> -#include <oh_event.h> #include <oh_utils.h> SaErrorT rtas_set_resource_tag(void *hnd, Modified: openhpi/trunk/plugins/simulator/sim_injector.h =================================================================== --- openhpi/trunk/plugins/simulator/sim_injector.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/simulator/sim_injector.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -20,7 +20,7 @@ #define __SIM_INJECTOR_H #include <sim_resources.h> -#include <oh_event.h> +#include <oh_utils.h> struct oh_handler_state *sim_get_handler_by_name(char *name); SaErrorT sim_inject_resource(struct oh_handler_state *state, Modified: openhpi/trunk/plugins/simulator/sim_sensors.h =================================================================== --- openhpi/trunk/plugins/simulator/sim_sensors.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/simulator/sim_sensors.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -19,8 +19,8 @@ #ifndef __SIM_SENSORS_H #define __SIM_SENSORS_H -#include <oh_event.h> #include <oh_handler.h> +#include <oh_utils.h> #define SIM_MAX_EVENTS_PER_SENSOR 24 #define SIM_MAX_READING_MAPS_PER_SENSOR 3 Modified: openhpi/trunk/plugins/slave/handler.cpp =================================================================== --- openhpi/trunk/plugins/slave/handler.cpp 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/slave/handler.cpp 2010-12-25 12:24:47 UTC (rev 7232) @@ -26,7 +26,6 @@ #include <oHpi.h> #include <oh_error.h> -#include <oh_event.h> #include <oh_utils.h> #include "handler.h" @@ -91,8 +90,8 @@ CRIT( "oHpiDomainAdd failed with rv = %d", rv ); return false; } - DBG( "XXX: Domain %u is created", m_did ); m_did = did; + DBG( "Domain %u is created", m_did ); rc = StartThread(); if ( !rc ) { Modified: openhpi/trunk/plugins/slave/handler.h =================================================================== --- openhpi/trunk/plugins/slave/handler.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/slave/handler.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -23,7 +23,7 @@ #include <SaHpi.h> -#include <oh_event.h> +#include <oh_utils.h> #include "baselib.h" #include "lock.h" Added: openhpi/trunk/plugins/slave/slave.h =================================================================== --- openhpi/trunk/plugins/slave/slave.h (rev 0) +++ openhpi/trunk/plugins/slave/slave.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -0,0 +1,676 @@ +/* -*- linux-c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2010 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <SaHpi.h> + + +extern "C" { + + +/************************************************************** + * Slave plugin interface + *************************************************************/ + +void * oh_open( + GHashTable * handler_config, + unsigned int hid, + oh_evt_queue * eventq +); + +void oh_close( + void * hnd +); + +SaErrorT oh_discover_resources( + void * hnd +); + +SaErrorT oh_set_resource_tag( + void * hnd, + SaHpiResourceIdT id, + SaHpiTextBufferT * tag +); + +SaErrorT oh_set_resource_severity( + void * hnd, + SaHpiResourceIdT id, + SaHpiSeverityT sev +); + +SaErrorT oh_resource_failed_remove( + void * hnd, + SaHpiResourceIdT id +); + +SaErrorT oh_get_el_info( + void * hnd, + SaHpiResourceIdT id, + SaHpiEventLogInfoT * info +); + +SaErrorT oh_get_el_caps( + void * hnd, + SaHpiResourceIdT id, + SaHpiEventLogCapabilitiesT * caps +); + +SaErrorT oh_set_el_time( + void * hnd, + SaHpiResourceIdT id, + SaHpiTimeT time +); + +SaErrorT oh_add_el_entry( + void * hnd, + SaHpiResourceIdT id, + const SaHpiEventT * event +); + +SaErrorT oh_get_el_entry( + void * hnd, + SaHpiResourceIdT id, + SaHpiEventLogEntryIdT current, + SaHpiEventLogEntryIdT * prev, + SaHpiEventLogEntryIdT * next, + SaHpiEventLogEntryT * entry, + SaHpiRdrT * rdr, + SaHpiRptEntryT * rpte +); + +SaErrorT oh_clear_el( + void * hnd, + SaHpiResourceIdT id +); + +SaErrorT oh_set_el_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiBoolT e +); + +SaErrorT oh_reset_el_overflow( + void * hnd, + SaHpiResourceIdT id +); + +SaErrorT oh_get_sensor_reading( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiSensorReadingT * reading, + SaHpiEventStateT * state +); + +SaErrorT oh_get_sensor_thresholds( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiSensorThresholdsT * thres +); + +SaErrorT oh_set_sensor_thresholds( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + const SaHpiSensorThresholdsT * thres +); + +SaErrorT oh_get_sensor_enable( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiBoolT * enable +); + +SaErrorT oh_set_sensor_enable( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiBoolT enable +); + +SaErrorT oh_get_sensor_event_enables( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiBoolT * enables +); + +SaErrorT oh_set_sensor_event_enables( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + const SaHpiBoolT enables +); + +SaErrorT oh_get_sensor_event_masks( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiEventStateT * AssertEventMask, + SaHpiEventStateT * DeassertEventMask +); + +SaErrorT oh_set_sensor_event_masks( + void * hnd, + SaHpiResourceIdT id, + SaHpiSensorNumT num, + SaHpiSensorEventMaskActionT act, + SaHpiEventStateT AssertEventMask, + SaHpiEventStateT DeassertEventMask +); + +SaErrorT oh_get_control_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiCtrlNumT num, + SaHpiCtrlModeT * mode, + SaHpiCtrlStateT * state +); + +SaErrorT oh_set_control_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiCtrlNumT num, + SaHpiCtrlModeT mode, + SaHpiCtrlStateT * state +); + +SaErrorT oh_get_idr_info( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrInfoT * idrinfo +); + +SaErrorT oh_get_idr_area_header( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT areaid, + SaHpiEntryIdT * nextareaid, + SaHpiIdrAreaHeaderT * header +); + +SaErrorT oh_add_idr_area( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT * areaid +); + +SaErrorT oh_add_idr_area_id( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT areaid +); + +SaErrorT oh_del_idr_area( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid +); + +SaErrorT oh_get_idr_field( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid, + SaHpiIdrFieldTypeT fieldtype, + SaHpiEntryIdT fieldid, + SaHpiEntryIdT * nextfieldid, + SaHpiIdrFieldT * field +); + +SaErrorT oh_add_idr_field( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrFieldT * field +); + +SaErrorT oh_add_idr_field_id( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrFieldT * field +); + +SaErrorT oh_set_idr_field( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiIdrFieldT * field +); + +SaErrorT oh_del_idr_field( + void * hnd, + SaHpiResourceIdT id, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid, + SaHpiEntryIdT fieldid +); + +SaErrorT oh_get_watchdog_info( + void * hnd, + SaHpiResourceIdT id, + SaHpiWatchdogNumT num, + SaHpiWatchdogT * wdt +); + +SaErrorT oh_set_watchdog_info( + void * hnd, + SaHpiResourceIdT id, + SaHpiWatchdogNumT num, + SaHpiWatchdogT * wdt +); + +SaErrorT oh_reset_watchdog( + void * hnd, + SaHpiResourceIdT id, + SaHpiWatchdogNumT num +); + +SaErrorT oh_get_next_announce( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiSeverityT sev, + SaHpiBoolT ack, + SaHpiAnnouncementT * ann +); + +SaErrorT oh_get_announce( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiEntryIdT annid, + SaHpiAnnouncementT * ann +); + +SaErrorT oh_ack_announce( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiEntryIdT annid, + SaHpiSeverityT sev +); + +SaErrorT oh_add_announce( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiAnnouncementT * ann +); + +SaErrorT oh_del_announce( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiEntryIdT annid, + SaHpiSeverityT sev +); + +SaErrorT oh_get_annunc_mode( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiAnnunciatorModeT * mode +); + +SaErrorT oh_set_annunc_mode( + void * hnd, + SaHpiResourceIdT id, + SaHpiAnnunciatorNumT num, + SaHpiAnnunciatorModeT mode +); + +SaErrorT oh_get_dimi_info( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiInfoT * info +); + +SaErrorT oh_get_dimi_test( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiTestT * test +); + +SaErrorT oh_get_dimi_test_ready( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiReadyT * ready +); + +SaErrorT oh_start_dimi_test( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiUint8T numparams, + SaHpiDimiTestVariableParamsT * paramslist +); + +SaErrorT oh_cancel_dimi_test( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum +); + +SaErrorT oh_get_dimi_test_status( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiTestPercentCompletedT * percentcompleted, + SaHpiDimiTestRunStatusT * runstatus +); + +SaErrorT oh_get_dimi_test_results( + void * hnd, + SaHpiResourceIdT id, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiTestResultsT * testresults +); + +SaErrorT oh_get_fumi_spec( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiFumiSpecInfoT * specinfo +); + +SaErrorT oh_get_fumi_service_impact( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiFumiServiceImpactDataT * serviceimpact +); + +SaErrorT oh_set_fumi_source( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiTextBufferT * sourceuri +); + +SaErrorT oh_validate_fumi_source( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum +); + +SaErrorT oh_get_fumi_source( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiFumiSourceInfoT * sourceinfo +); + +SaErrorT oh_get_fumi_source_component( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiEntryIdT compid, + SaHpiEntryIdT * nextcompid, + SaHpiFumiComponentInfoT * compinfo +); + +SaErrorT oh_get_fumi_target( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiFumiBankInfoT * bankinfo +); + +SaErrorT oh_get_fumi_target_component( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiEntryIdT compid, + SaHpiEntryIdT * nextcompid, + SaHpiFumiComponentInfoT * compinfo +); + +SaErrorT oh_get_fumi_logical_target( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiFumiLogicalBankInfoT * bankinfo +); + +SaErrorT oh_get_fumi_logical_target_component( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiEntryIdT compid, + SaHpiEntryIdT * nextcompid, + SaHpiFumiLogicalComponentInfoT * compinfo +); + +SaErrorT oh_start_fumi_backup( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num +); + +SaErrorT oh_set_fumi_bank_order( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiUint32T position +); + +SaErrorT oh_start_fumi_bank_copy( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT sourcebanknum, + SaHpiBankNumT targetbanknum +); + +SaErrorT oh_start_fumi_install( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum +); + +SaErrorT oh_get_fumi_status( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiFumiUpgradeStatusT * status +); + +SaErrorT oh_start_fumi_verify( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum +); + +SaErrorT oh_start_fumi_verify_main( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num +); + +SaErrorT oh_cancel_fumi_upgrade( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum +); + +SaErrorT oh_get_fumi_autorollback_disable( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBoolT * disable +); + +SaErrorT oh_set_fumi_autorollback_disable( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBoolT disable +); + +SaErrorT oh_start_fumi_rollback( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num +); + +SaErrorT oh_activate_fumi( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num +); + +SaErrorT oh_start_fumi_activate( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBoolT logical +); + +SaErrorT oh_cleanup_fumi( + void * hnd, + SaHpiResourceIdT id, + SaHpiFumiNumT num, + SaHpiBankNumT banknum +); + +SaErrorT oh_hotswap_policy_cancel( + void * hnd, + SaHpiResourceIdT id, + SaHpiTimeoutT timeout +); + +SaErrorT oh_set_autoinsert_timeout( + void * hnd, + SaHpiTimeoutT timeout +); + +SaErrorT oh_get_autoextract_timeout( + void * hnd, + SaHpiResourceIdT id, + SaHpiTimeoutT * timeout +); + +SaErrorT oh_set_autoextract_timeout( + void * hnd, + SaHpiResourceIdT id, + SaHpiTimeoutT timeout +); + +SaErrorT oh_get_hotswap_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiHsStateT * state +); + +SaErrorT oh_set_hotswap_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiHsStateT state +); + +SaErrorT oh_request_hotswap_action( + void * hnd, + SaHpiResourceIdT id, + SaHpiHsActionT act +); + +SaErrorT oh_get_indicator_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiHsIndicatorStateT * state +); + +SaErrorT oh_set_indicator_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiHsIndicatorStateT state +); + +SaErrorT oh_get_power_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiPowerStateT * state +); + +SaErrorT oh_set_power_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiPowerStateT state +); + +SaErrorT oh_control_parm( + void * hnd, + SaHpiResourceIdT id, + SaHpiParmActionT act +); + +SaErrorT oh_load_id_get( + void * hnd, + SaHpiResourceIdT id, + SaHpiLoadIdT * load_id +); + +SaErrorT oh_load_id_set( + void * hnd, + SaHpiResourceIdT id, + SaHpiLoadIdT * load_id +); + +SaErrorT oh_get_reset_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiResetActionT * act +); + +SaErrorT oh_set_reset_state( + void * hnd, + SaHpiResourceIdT id, + SaHpiResetActionT act +); + + +}; // extern "C" + Modified: openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h =================================================================== --- openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/snmp_bc/snmp_bc_plugin.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -24,10 +24,10 @@ #include <oh_domain.h> #include <oh_error.h> -#include <oh_event.h> #include <oh_handler.h> #include <oh_plugin.h> #include <oh_session.h> +#include <oh_utils.h> #include <snmp_utils.h> Modified: openhpi/trunk/plugins/sysfs/sysfs2hpi.c =================================================================== --- openhpi/trunk/plugins/sysfs/sysfs2hpi.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/sysfs/sysfs2hpi.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -23,7 +23,6 @@ #include <SaHpi.h> #include <oh_utils.h> #include <oh_handler.h> -#include <oh_event.h> #include <oh_error.h> #define SYSFS2HPI_ERROR -700 Modified: openhpi/trunk/plugins/watchdog/watchdog.c =================================================================== --- openhpi/trunk/plugins/watchdog/watchdog.c 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/plugins/watchdog/watchdog.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -49,7 +49,6 @@ #include <SaHpi.h> #include <oh_error.h> -#include <oh_event.h> #include <oh_handler.h> #include <oh_utils.h> Modified: openhpi/trunk/utils/Makefile.am =================================================================== --- openhpi/trunk/utils/Makefile.am 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/utils/Makefile.am 2010-12-25 12:24:47 UTC (rev 7232) @@ -71,6 +71,8 @@ announcement_utils.h \ el_utils.c \ el_utils.h \ + event_utils.c \ + event_utils.h \ epath_utils.c \ epath_utils.h \ oh_utils.h \ Modified: openhpi/trunk/utils/Makefile.mingw32 =================================================================== --- openhpi/trunk/utils/Makefile.mingw32 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/utils/Makefile.mingw32 2010-12-25 12:24:47 UTC (rev 7232) @@ -5,6 +5,7 @@ SRC := announcement_utils.c \ el_utils.c \ epath_utils.c \ + event_utils.c \ rpt_utils.c \ sahpi_enum_utils.c \ sahpi_event_encode.c \ Added: openhpi/trunk/utils/event_utils.c =================================================================== --- openhpi/trunk/utils/event_utils.c (rev 0) +++ openhpi/trunk/utils/event_utils.c 2010-12-25 12:24:47 UTC (rev 7232) @@ -0,0 +1,78 @@ +/* -*- linux-c -*- + * + * Copyright (c) 2003 by Intel Corp. + * (C) Copyright IBM Corp. 2003-2006 + * (C) Copyright Pigeon Point Systems. 2010 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Authors: + * Louis Zhuang <lou...@li...> + * David Judkovics <dju...@us...> + * Sean Dague <http://dague.net/sean> + * Renier Morales <re...@op...> + * Racing Guo <rac...@in...> + * Anton Pak <ant...@pi...> + */ + +#include <glib.h> + +#include <SaHpi.h> + +#include <oh_utils.h> + + +void oh_event_free(struct oh_event *e, int only_rdrs) +{ + if (e) { + if (e->rdrs) { + GSList *node = NULL; + for (node = e->rdrs; node; node = node->next) { + g_free(node->data); + } + g_slist_free(e->rdrs); + } + if (e->rdrs_to_remove) { + GSList *node = NULL; + for (node = e->rdrs_to_remove; node; node = node->next) { + g_free(node->data); + } + g_slist_free(e->rdrs_to_remove); + } + if (!only_rdrs) g_free(e); + } +} + +struct oh_event *oh_dup_event(struct oh_event *old_event) +{ + GSList *node = NULL; + struct oh_event *e = NULL; + + if (!old_event) return NULL; + + e = g_new0(struct oh_event, 1); + *e = *old_event; + e->rdrs = NULL; + for (node = old_event->rdrs; node; node = node->next) { + e->rdrs = g_slist_append(e->rdrs, g_memdup(node->data, + sizeof(SaHpiRdrT))); + } + e->rdrs_to_remove = NULL; + for (node = old_event->rdrs_to_remove; node; node = node->next) { + e->rdrs_to_remove = g_slist_append(e->rdrs_to_remove, g_memdup(node->data, + sizeof(SaHpiRdrT))); + } + + return e; +} + +void oh_evt_queue_push(oh_evt_queue *equeue, gpointer data) +{ + g_async_queue_push(equeue, data); +} + Copied: openhpi/trunk/utils/event_utils.h (from rev 7231, openhpi/trunk/include/oh_event.h) =================================================================== --- openhpi/trunk/utils/event_utils.h (rev 0) +++ openhpi/trunk/utils/event_utils.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -0,0 +1,118 @@ +/* -*- linux-c -*- + * + * (C) Copyright IBM Corp. 2004-2006 + * (C) Copyright Pigeon Point Systems. 2010 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Sean Dague <sd...@us...> + * Renier Morales <re...@op...> + * Anton Pak <ant...@pi...> + * + */ + +#ifndef __EVENT_UTILS_H +#define __EVENT_UTILS_H + +#ifndef __OH_UTILS_H +#warning *** Include oh_utils.h instead of individual utility header files *** +#endif + +#include <SaHpi.h> +#include <glib.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/*** + * Instructions for using oh_event + ********************************* + * oh_event is primarily used by the plugins to report HPI events. + * + * Required Fields: + * .hid, .event + * + * Optional Fields: + * .resource, .rdrs + * + * + * Any Resource oh_events: + * Use RESOURCE_UPDATED event for updating RPT entry. + * + * FRU Resource oh_events: + * If reporting a resource, the plugin sets the appropiate event in .event. + * For example, if reporting a new FRU resource, then the event should be + * a hotswap type showing the correct hotswap state (any except NOT_PRESENT) + * indicating the library that it should add it to the RPT. + * If the plugin needs to report an extracted FRU, then the hotswap + * event has to show the NOT_PRESENT current state, indicating to the library + * that it should remove it from the RPT. + * Hotswap events must have their accompaining resource set its capability bit + * for FRU to 1 or it will be dropped by the infrastructure. + * The .resource.ResourceCapabilities field can be zero. + * If so, the RPT will not be updated, but the SaHpiEventT will be passed + * on to the session queues and domain event log normally. + * + * Non-FRU Resource oh_events: + * For adding or updating Non-FRU resources, the .event should be a resource + * type HPI event and the ResourceEventType should be RESOURCE_ADDED or + * RESOURCE_RESTORED. The resource itself should have its capability bit for + * FRU set to zero or the event will be dropped by the infrastructure. + * Use RESOURCE_REMOVED for removing Non-FRU resource from the RPT. + * If a resource is failed, then the oh_event should + * have a resource event type with the resource state as RESOURCE_FAILED. + * The .resource field should have the RPT entry for resource in question. + * This is used by the infrastructure to update the RPT and mark the resource + * as failed (ResourceFailed == True). + * The .resource.ResourceCapabilities field can be zero. If so, + * the RPT will not be updated, but the SaHpiEventT will be passed on to the + * session queues and domain event log normally. + * + * RDRs: + * If the event is for a resource, be it FRU or Non-FRU, and the resource did + * not previously exist in the RPT for the domain, then the .rdrs field is + * scanned for valid SaHpiRdrTs (RdrType != SAHPI_NO_RECORD) objects and each + * one is added as an rdr for the resource to the RPT. If the resource is + * already in the RPT, then the rdrs field will be ignored for all + * event except RESOURCE_UPDATED. + * In addition to updating RPT entry, the RESOURCE_UPDATED event + * can be used for adding, updating or removing RDRs. + * + * Other event types: + * If the event is of type SENSOR, SENSOR_ENABLE_CHANGE, WATCHDOG, or OEM, then + * The .resource field is scanned for a valid resource to use as reference for + * the domain event log. Also, the .rdrs field is scanned for exactly one + * SaHpiRdrT to be used as reference for the domain event log and session event + * queue. If multiple rdrs are passed for these event types, only the first one + * will be used. + **/ + +struct oh_event { + unsigned int hid; /* handler id for the event */ + SaHpiEventT event; + /* If no resource, ResourceCapabilities must be 0 */ + SaHpiRptEntryT resource; + GSList *rdrs; + GSList *rdrs_to_remove; +}; + +typedef GAsyncQueue oh_evt_queue; + +#define oh_new_event() g_new0(struct oh_event, 1) +void oh_event_free(struct oh_event *e, int only_rdrs); +struct oh_event *oh_dup_event(struct oh_event *old_event); +void oh_evt_queue_push(oh_evt_queue *equeue, gpointer data); + +#ifdef __cplusplus +} +#endif + +#endif /* __EVENT_UTILS_H */ + Modified: openhpi/trunk/utils/oh_utils.h =================================================================== --- openhpi/trunk/utils/oh_utils.h 2010-12-24 21:47:40 UTC (rev 7231) +++ openhpi/trunk/utils/oh_utils.h 2010-12-25 12:24:47 UTC (rev 7232) @@ -22,6 +22,7 @@ #include <SaHpiAtca.h> #include <announcement_utils.h> #include <el_utils.h> +#include <event_utils.h> #include <sahpi_struct_utils.h> #include <epath_utils.h> #include <rpt_utils.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2010-12-25 13:15:00
|
Revision: 7233 http://openhpi.svn.sourceforge.net/openhpi/?rev=7233&view=rev Author: avpak Date: 2010-12-25 13:14:54 +0000 (Sat, 25 Dec 2010) Log Message: ----------- More on Feature Request #3129960 Compilation warning fixes. Some formatting. Modified Paths: -------------- openhpi/trunk/Makefile.mingw32 openhpi/trunk/Makefile.mingw32.def openhpi/trunk/plugins/slave/baselib.cpp openhpi/trunk/utils/sahpi_struct_utils.c Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2010-12-25 12:24:47 UTC (rev 7232) +++ openhpi/trunk/Makefile.mingw32 2010-12-25 13:14:54 UTC (rev 7233) @@ -6,8 +6,8 @@ marshal \ baselib \ clients - # openhpid \ - # plugins/slave +# openhpid \ +# plugins/slave .PHONY: all clean $(openhpi_libs) Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2010-12-25 12:24:47 UTC (rev 7232) +++ openhpi/trunk/Makefile.mingw32.def 2010-12-25 13:14:54 UTC (rev 7233) @@ -14,6 +14,6 @@ GMODULE_LIBS := -L ${GLIB_DIR}/lib -lgmodule-2.0 ############################################################################ -CPPFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 -DOH_DBG_MSGS +CPPFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 -DOH_DBG_MSGS -Wall LDFLAGS := -no-undefined --enable-runtime-pseudo-reloc Modified: openhpi/trunk/plugins/slave/baselib.cpp =================================================================== --- openhpi/trunk/plugins/slave/baselib.cpp 2010-12-25 12:24:47 UTC (rev 7232) +++ openhpi/trunk/plugins/slave/baselib.cpp 2010-12-25 13:14:54 UTC (rev 7233) @@ -45,528 +45,533 @@ } -void GetF( GModule * handle, const char * name, gpointer * pf, std::string& error ) +void GetF( GModule * handle, const char * name, gpointer * pf, size_t& nerrors ) { gboolean rc = g_module_symbol( handle, name, pf ); if ( rc == FALSE ) { *pf = 0; - error += g_module_error(); - error.push_back( '\n' ); + CRIT( "Problem with symbol %s in base library.", name ); + CRIT( "%s", g_module_error() ); + ++nerrors; } } bool cBaseLib::LoadBaseLib() { if ( g_module_supported() == FALSE ) { - CRIT( "ERROR. GModule is not supported. Cannot load base lib." ); + CRIT( "GModule is not supported. Cannot load base library." ); return false; } m_handle = g_module_open( "libopenhpi", G_MODULE_BIND_LOCAL ); if ( !m_handle ) { + CRIT( "Cannot load base library." ); return false; } - std::string error; + size_t nerrors = 0; GetF( m_handle, "saHpiVersionGet", reinterpret_cast<gpointer *>( &m_abi.saHpiVersionGet ), - error ); + nerrors ); GetF( m_handle, "saHpiInitialize", reinterpret_cast<gpointer *>( &m_abi.saHpiInitialize ), - error ); + nerrors ); GetF( m_handle, "saHpiFinalize", reinterpret_cast<gpointer *>( &m_abi.saHpiFinalize ), - error ); + nerrors ); GetF( m_handle, "saHpiSessionOpen", reinterpret_cast<gpointer *>( &m_abi.saHpiSessionOpen ), - error ); + nerrors ); GetF( m_handle, "saHpiSessionClose", reinterpret_cast<gpointer *>( &m_abi.saHpiSessionClose ), - error ); + nerrors ); GetF( m_handle, "saHpiDiscover", reinterpret_cast<gpointer *>( &m_abi.saHpiDiscover ), - error ); + nerrors ); GetF( m_handle, "saHpiDomainInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDomainInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiDrtEntryGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDrtEntryGet ), - error ); + nerrors ); GetF( m_handle, "saHpiDomainTagSet", reinterpret_cast<gpointer *>( &m_abi.saHpiDomainTagSet ), - error ); + nerrors ); GetF( m_handle, "saHpiRptEntryGet", reinterpret_cast<gpointer *>( &m_abi.saHpiRptEntryGet ), - error ); + nerrors ); GetF( m_handle, "saHpiRptEntryGetByResourceId", reinterpret_cast<gpointer *>( &m_abi.saHpiRptEntryGetByResourceId ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceSeveritySet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceSeveritySet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceTagSet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceTagSet ), - error ); + nerrors ); GetF( m_handle, "saHpiMyEntityPathGet", reinterpret_cast<gpointer *>( &m_abi.saHpiMyEntityPathGet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceIdGet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceIdGet ), - error ); + nerrors ); GetF( m_handle, "saHpiGetIdByEntityPath", reinterpret_cast<gpointer *>( &m_abi.saHpiGetIdByEntityPath ), - error ); + nerrors ); GetF( m_handle, "saHpiGetChildEntityPath", reinterpret_cast<gpointer *>( &m_abi.saHpiGetChildEntityPath ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceFailedRemove", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceFailedRemove ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogCapabilitiesGet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogCapabilitiesGet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogEntryGet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogEntryGet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogEntryAdd", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogEntryAdd ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogClear", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogClear ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogTimeGet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogTimeGet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogTimeSet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogTimeSet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogStateGet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogStateGet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogStateSet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogStateSet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventLogOverflowReset", reinterpret_cast<gpointer *>( &m_abi.saHpiEventLogOverflowReset ), - error ); + nerrors ); GetF( m_handle, "saHpiSubscribe", reinterpret_cast<gpointer *>( &m_abi.saHpiSubscribe ), - error ); + nerrors ); GetF( m_handle, "saHpiUnsubscribe", reinterpret_cast<gpointer *>( &m_abi.saHpiUnsubscribe ), - error ); + nerrors ); GetF( m_handle, "saHpiEventGet", reinterpret_cast<gpointer *>( &m_abi.saHpiEventGet ), - error ); + nerrors ); GetF( m_handle, "saHpiEventAdd", reinterpret_cast<gpointer *>( &m_abi.saHpiEventAdd ), - error ); + nerrors ); GetF( m_handle, "saHpiAlarmGetNext", reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmGetNext ), - error ); + nerrors ); GetF( m_handle, "saHpiAlarmGet", reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmGet ), - error ); + nerrors ); GetF( m_handle, "saHpiAlarmAcknowledge", reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmAcknowledge ), - error ); + nerrors ); GetF( m_handle, "saHpiAlarmAdd", reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmAdd ), - error ); + nerrors ); GetF( m_handle, "saHpiAlarmDelete", reinterpret_cast<gpointer *>( &m_abi.saHpiAlarmDelete ), - error ); + nerrors ); GetF( m_handle, "saHpiRdrGet", reinterpret_cast<gpointer *>( &m_abi.saHpiRdrGet ), - error ); + nerrors ); GetF( m_handle, "saHpiRdrGetByInstrumentId", reinterpret_cast<gpointer *>( &m_abi.saHpiRdrGetByInstrumentId ), - error ); + nerrors ); GetF( m_handle, "saHpiRdrUpdateCountGet", reinterpret_cast<gpointer *>( &m_abi.saHpiRdrUpdateCountGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorReadingGet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorReadingGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorThresholdsGet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorThresholdsGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorThresholdsSet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorThresholdsSet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorTypeGet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorTypeGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorEnableGet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEnableGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorEnableSet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEnableSet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorEventEnableGet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventEnableGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorEventEnableSet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventEnableSet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorEventMasksGet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventMasksGet ), - error ); + nerrors ); GetF( m_handle, "saHpiSensorEventMasksSet", reinterpret_cast<gpointer *>( &m_abi.saHpiSensorEventMasksSet ), - error ); + nerrors ); GetF( m_handle, "saHpiControlTypeGet", reinterpret_cast<gpointer *>( &m_abi.saHpiControlTypeGet ), - error ); + nerrors ); GetF( m_handle, "saHpiControlGet", reinterpret_cast<gpointer *>( &m_abi.saHpiControlGet ), - error ); + nerrors ); GetF( m_handle, "saHpiControlSet", reinterpret_cast<gpointer *>( &m_abi.saHpiControlSet ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrAreaHeaderGet", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaHeaderGet ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrAreaAdd", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaAdd ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrAreaAddById", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaAddById ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrAreaDelete", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrAreaDelete ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrFieldGet", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldGet ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrFieldAdd", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldAdd ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrFieldAddById", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldAddById ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrFieldSet", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldSet ), - error ); + nerrors ); GetF( m_handle, "saHpiIdrFieldDelete", reinterpret_cast<gpointer *>( &m_abi.saHpiIdrFieldDelete ), - error ); + nerrors ); GetF( m_handle, "saHpiWatchdogTimerGet", reinterpret_cast<gpointer *>( &m_abi.saHpiWatchdogTimerGet ), - error ); + nerrors ); GetF( m_handle, "saHpiWatchdogTimerSet", reinterpret_cast<gpointer *>( &m_abi.saHpiWatchdogTimerSet ), - error ); + nerrors ); GetF( m_handle, "saHpiWatchdogTimerReset", reinterpret_cast<gpointer *>( &m_abi.saHpiWatchdogTimerReset ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorGetNext", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorGetNext ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorGet", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorGet ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorAcknowledge", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorAcknowledge ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorAdd", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorAdd ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorDelete", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorDelete ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorModeGet", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorModeGet ), - error ); + nerrors ); GetF( m_handle, "saHpiAnnunciatorModeSet", reinterpret_cast<gpointer *>( &m_abi.saHpiAnnunciatorModeSet ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiTestInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiTestReadinessGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestReadinessGet ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiTestStart", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestStart ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiTestCancel", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestCancel ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiTestStatusGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestStatusGet ), - error ); + nerrors ); GetF( m_handle, "saHpiDimiTestResultsGet", reinterpret_cast<gpointer *>( &m_abi.saHpiDimiTestResultsGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiSpecInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSpecInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiServiceImpactGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiServiceImpactGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiSourceSet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceSet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiSourceInfoValidateStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceInfoValidateStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiSourceInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiSourceComponentInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiSourceComponentInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiTargetInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiTargetComponentInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetComponentInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiLogicalTargetInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiLogicalTargetInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiLogicalTargetComponentInfoGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiLogicalTargetComponentInfoGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiBackupStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiBackupStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiBankBootOrderSet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiBankBootOrderSet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiBankCopyStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiBankCopyStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiInstallStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiInstallStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiUpgradeStatusGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiUpgradeStatusGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiTargetVerifyStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetVerifyStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiTargetVerifyMainStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiTargetVerifyMainStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiUpgradeCancel", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiUpgradeCancel ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiAutoRollbackDisableGet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiAutoRollbackDisableGet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiAutoRollbackDisableSet", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiAutoRollbackDisableSet ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiRollbackStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiRollbackStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiActivate", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiActivate ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiActivateStart", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiActivateStart ), - error ); + nerrors ); GetF( m_handle, "saHpiFumiCleanup", reinterpret_cast<gpointer *>( &m_abi.saHpiFumiCleanup ), - error ); + nerrors ); GetF( m_handle, "saHpiHotSwapPolicyCancel", reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapPolicyCancel ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceActiveSet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceActiveSet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceInactiveSet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceInactiveSet ), - error ); + nerrors ); GetF( m_handle, "saHpiAutoInsertTimeoutGet", reinterpret_cast<gpointer *>( &m_abi.saHpiAutoInsertTimeoutGet ), - error ); + nerrors ); GetF( m_handle, "saHpiAutoInsertTimeoutSet", reinterpret_cast<gpointer *>( &m_abi.saHpiAutoInsertTimeoutSet ), - error ); + nerrors ); GetF( m_handle, "saHpiAutoExtractTimeoutGet", reinterpret_cast<gpointer *>( &m_abi.saHpiAutoExtractTimeoutGet ), - error ); + nerrors ); GetF( m_handle, "saHpiAutoExtractTimeoutSet", reinterpret_cast<gpointer *>( &m_abi.saHpiAutoExtractTimeoutSet ), - error ); + nerrors ); GetF( m_handle, "saHpiHotSwapStateGet", reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapStateGet ), - error ); + nerrors ); GetF( m_handle, "saHpiHotSwapActionRequest", reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapActionRequest ), - error ); + nerrors ); GetF( m_handle, "saHpiHotSwapIndicatorStateGet", reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapIndicatorStateGet ), - error ); + nerrors ); GetF( m_handle, "saHpiHotSwapIndicatorStateSet", reinterpret_cast<gpointer *>( &m_abi.saHpiHotSwapIndicatorStateSet ), - error ); + nerrors ); GetF( m_handle, "saHpiParmControl", reinterpret_cast<gpointer *>( &m_abi.saHpiParmControl ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceLoadIdGet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceLoadIdGet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceLoadIdSet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceLoadIdSet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceResetStateGet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceResetStateGet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourceResetStateSet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourceResetStateSet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourcePowerStateGet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourcePowerStateGet ), - error ); + nerrors ); GetF( m_handle, "saHpiResourcePowerStateSet", reinterpret_cast<gpointer *>( &m_abi.saHpiResourcePowerStateSet ), - error ); + nerrors ); GetF( m_handle, "oHpiDomainAdd", reinterpret_cast<gpointer *>( &m_abi.oHpiDomainAdd ), - error ); + nerrors ); + GetF( m_handle, + "xoHpiDomainAdd", + reinterpret_cast<gpointer *>( &m_abi.oHpiDomainAdd ), + nerrors ); - if ( !error.empty() ) { + if ( nerrors != 0 ) { g_module_close( m_handle ); m_handle = 0; - CRIT( "%s", error.c_str() ); return false; } Modified: openhpi/trunk/utils/sahpi_struct_utils.c =================================================================== --- openhpi/trunk/utils/sahpi_struct_utils.c 2010-12-25 12:24:47 UTC (rev 7232) +++ openhpi/trunk/utils/sahpi_struct_utils.c 2010-12-25 13:14:54 UTC (rev 7233) @@ -834,8 +834,8 @@ } size = strlen(from); if ((size + buffer->DataLength) >= SAHPI_MAX_TEXT_BUFFER_LENGTH) { - CRIT("Cannot append to text buffer. Bufsize=%d, size=%u", - buffer->DataLength, size); + CRIT("Cannot append to text buffer. Bufsize=%u, size=%lu", + buffer->DataLength, (unsigned long)size); return(SA_ERR_HPI_OUT_OF_SPACE); } @@ -858,8 +858,8 @@ } size = strlen(from); if ((size + big_buffer->DataLength) >= OH_MAX_TEXT_BUFFER_LENGTH) { - CRIT("Cannot append to buffer. Bufsize=%d, size=%u", - big_buffer->DataLength, size); + CRIT("Cannot append to buffer. Bufsize=%u, size=%lu", + big_buffer->DataLength, (unsigned long)size); return(SA_ERR_HPI_INTERNAL_ERROR); } @@ -891,7 +891,7 @@ slen = strlen(buff); if ((slen + big_buffer->DataLength) >= OH_MAX_TEXT_BUFFER_LENGTH) { - CRIT("Cannot append to buffer. Bufsize=%d, len=%d", + CRIT("Cannot append to buffer. Bufsize=%u, len=%u", big_buffer->DataLength, len); return(SA_ERR_HPI_INTERNAL_ERROR); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |