SOURCES: openhpi-c++.patch (NEW) - location fix, ugly typo + files...

qboosh qboosh at pld-linux.org
Sun Nov 4 01:33:17 CET 2007


Author: qboosh                       Date: Sun Nov  4 00:33:17 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- location fix, ugly typo + files missing because of this

---- Files affected:
SOURCES:
   openhpi-c++.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/openhpi-c++.patch
diff -u /dev/null SOURCES/openhpi-c++.patch:1.1
--- /dev/null	Sun Nov  4 01:33:17 2007
+++ SOURCES/openhpi-c++.patch	Sun Nov  4 01:33:12 2007
@@ -0,0 +1,4923 @@
+--- openhpi-2.10.1/cpp/Makefile.am.orig	2007-11-03 23:02:21.142967000 +0100
++++ openhpi-2.10.1/cpp/Makefile.am	2007-11-04 00:08:36.009482630 +0100
+@@ -75,7 +75,7 @@
+                   	  oSaHpiWatchdogRec.hpp \
+                   	  oSaHpi.hpp
+ 
+-pkglib_LTLIBRARIES	= libosahpi.la
++lib_LTLIBRARIES	= libosahpi.la
+ 
+ libosahpi_la_LIBADD	= -luuid
+ libosahpi_la_SOURCES	= oSaHpiAlarm.cpp oSaHpiAlarm.hpp \
+@@ -115,7 +115,7 @@
+                           oSaHpiResourceInfo.cpp oSaHpiResourceInfo.hpp \
+                           oSaHpiRptEntry.cpp oSaHpiRptEntry.hpp \
+                           oSaHpiSensorDataFormat.cpp oSaHpiSensorDataFormat.hpp \
+-                          oSaHpiSensorEnableChangeEvent.cpp
++                          oSaHpiSensorEnableChangeEvent.cpp \
+ 			  oSaHpiSensorEnableChangeEvent.hpp \
+                           oSaHpiSensorEvent.cpp oSaHpiSensorEvent.hpp \
+                           oSaHpiSensorRange.cpp oSaHpiSensorRange.hpp \
+--- openhpi-2.10.1/cpp/oSaHpiSensorEvent.cpp.orig	1970-01-01 01:00:00.000000000 +0100
++++ openhpi-2.10.1/cpp/oSaHpiSensorEvent.cpp	2007-11-04 00:10:30.376000007 +0100
+@@ -0,0 +1,268 @@
++/*      -*- linux-c -*-
++ *
++ * (C) Copyright IBM Corp. 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.
++ *
++ * Author(s):
++ *    W. David Ashley <dashley at us.ibm.com>
++ */
++
++
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++extern "C"
++{
++#include <SaHpi.h>
++}
++#include "oSaHpiTypesEnums.hpp"
++#include "oSaHpiSensorReading.hpp"
++#include "oSaHpiSensorEvent.hpp"
++
++
++/**
++ * Default constructor.
++ */
++oSaHpiSensorEvent::oSaHpiSensorEvent() {
++    oSaHpiSensorReading *sr;
++
++    SensorNum = 1;
++    SensorType = SAHPI_TEMPERATURE;
++    EventCategory = SAHPI_EC_UNSPECIFIED;
++    Assertion = false;
++    EventState = SAHPI_ES_UNSPECIFIED;
++    OptionalDataPresent = (SaHpiSensorOptionalDataT)0;
++    sr = (oSaHpiSensorReading *)&TriggerReading;
++    sr->initSensorReading(sr);
++    sr = (oSaHpiSensorReading *)&TriggerThreshold;
++    sr->initSensorReading(sr);
++    PreviousState = SAHPI_ES_UNSPECIFIED;
++    CurrentState = SAHPI_ES_UNSPECIFIED;
++    Oem = 0;
++    SensorSpecific = 0;
++};
++
++
++/**
++ * Constructor.
++ *
++ * @param buf    The reference to the class to be copied.
++ */
++oSaHpiSensorEvent::oSaHpiSensorEvent(const oSaHpiSensorEvent& range) {
++    memcpy(this, &range, sizeof(SaHpiSensorEventT));
++}
++
++
++/**
++ * Assign a field in the SaHpiSensorEventT struct a value.
++ *
++ * @param field  The pointer to the struct (class).
++ * @param field  The field name as a text string (case sensitive).
++ * @param value  The character string value to be assigned to the field. This
++ *               value will be converted as necessary.
++ *
++ * @return True if there was an error, otherwise false.
++ */
++bool oSaHpiSensorEvent::assignField(SaHpiSensorEventT *ptr,
++                                    const char *field,
++                                    const char *value) {
++    if (ptr == NULL || field == NULL || value == NULL) {
++        return true;
++    }
++    if (strcmp(field, "SensorNum") == 0) {
++        ptr->SensorNum = strtoul(value, NULL, 10);
++        return false;
++    }
++    else if (strcmp(field, "SensorType") == 0) {
++        ptr->SensorType = oSaHpiTypesEnums::str2sensortype(value);
++        return false;
++    }
++    else if (strcmp(field, "EventCategory") == 0) {
++        ptr->EventCategory |= oSaHpiTypesEnums::str2eventcategory(value);
++        return false;
++    }
++    else if (strcmp(field, "Assertion") == 0) {
++        ptr->Assertion = oSaHpiTypesEnums::str2torf(value);
++        return false;
++    }
++    else if (strcmp(field, "EventState") == 0) {
++        ptr->EventState |= oSaHpiTypesEnums::str2eventstate(value);
++        return false;
++    }
++    else if (strcmp(field, "OptionalDataPresent") == 0) {
++        ptr->OptionalDataPresent |= oSaHpiTypesEnums::str2sensoroptionaldata(value);
++        return false;
++    }
++    // TriggerReading
++    // TriggerThreshold
++    else if (strcmp(field, "PreviousState") == 0) {
++        ptr->PreviousState |= oSaHpiTypesEnums::str2eventstate(value);
++        return false;
++    }
++    else if (strcmp(field, "CurrentState") == 0) {
++        ptr->CurrentState |= oSaHpiTypesEnums::str2eventstate(value);
++        return false;
++    }
++    else if (strcmp(field, "Oem") == 0) {
++        ptr->Oem = strtoul(value, NULL, 10);
++        return false;
++    }
++    else if (strcmp(field, "SensorSpecific") == 0) {
++        ptr->SensorSpecific = strtoul(value, NULL, 10);
++        return false;
++    }
++    return true;
++};
++
++
++/**
++ * Print the contents of the entity.
++ *
++ * @param stream Target stream.
++ * @param buffer Address of the SaHpiSensorEventT struct.
++ *
++ * @return True if there was an error, otherwise false.
++ */
++bool oSaHpiSensorEvent::fprint(FILE *stream,
++                               const int indent,
++                               const SaHpiSensorEventT *se) {
++	int i, err = 0;
++    char indent_buf[indent + 1];
++    const SaHpiSensorReadingT *sr;
++
++    if (stream == NULL || se == NULL) {
++        return true;
++    }
++    for (i = 0; i < indent; i++) {
++        indent_buf[i] = ' ';
++    }
++    indent_buf[indent] = '\0';
++
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "SensorNum = %u\n", se->SensorNum);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "SensorType = %s\n", oSaHpiTypesEnums::sensortype2str(se->SensorType));
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "EventCategory = %X\n", se->EventCategory);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "Assertion = %s\n", oSaHpiTypesEnums::torf2str(se->Assertion));
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "EventState = %X\n", se->EventState);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "OptionalDataPresent = %X\n", se->OptionalDataPresent);
++    if (err < 0) {
++        return true;
++    }
++    if (se->OptionalDataPresent && SAHPI_SOD_TRIGGER_READING) {
++        err = fprintf(stream, "%s", indent_buf);
++        if (err < 0) {
++            return true;
++        }
++        err = fprintf(stream, "TriggerReading\n");
++        if (err < 0) {
++            return true;
++        }
++        sr = (const SaHpiSensorReadingT *)&se->TriggerReading;
++        err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++        if (err < 0) {
++            return true;
++        }
++    }
++    if (se->OptionalDataPresent && SAHPI_SOD_TRIGGER_THRESHOLD) {
++        err = fprintf(stream, "%s", indent_buf);
++        if (err < 0) {
++            return true;
++        }
++        err = fprintf(stream, "TriggerThreshold\n");
++        if (err < 0) {
++            return true;
++        }
++        sr = (const SaHpiSensorReadingT *)&se->TriggerThreshold;
++        err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++        if (err < 0) {
++            return true;
++        }
++    }
++    if (se->OptionalDataPresent && SAHPI_SOD_PREVIOUS_STATE) {
++        err = fprintf(stream, "%s", indent_buf);
++        if (err < 0) {
++            return true;
++        }
++        err = fprintf(stream, "PreviousState = %X\n", se->PreviousState);
++        if (err < 0) {
++            return true;
++        }
++    }
++    if (se->OptionalDataPresent && SAHPI_SOD_CURRENT_STATE) {
++        err = fprintf(stream, "%s", indent_buf);
++        if (err < 0) {
++            return true;
++        }
++        err = fprintf(stream, "CurrentState = %X\n", se->CurrentState);
++        if (err < 0) {
++            return true;
++        }
++    }
++    if (se->OptionalDataPresent && SAHPI_SOD_OEM) {
++        err = fprintf(stream, "%s", indent_buf);
++        if (err < 0) {
++            return true;
++        }
++        err = fprintf(stream, "Oem = %u\n", se->Oem);
++        if (err < 0) {
++            return true;
++        }
++    }
++    if (se->OptionalDataPresent && SAHPI_SOD_SENSOR_SPECIFIC) {
++        err = fprintf(stream, "%s", indent_buf);
++        if (err < 0) {
++            return true;
++        }
++        err = fprintf(stream, "SensorSpecific = %u\n", se->SensorSpecific);
++        if (err < 0) {
++            return true;
++        }
++    }
++
++	return false;
++}
++
+--- openhpi-2.10.1/cpp/oSaHpiSensorRange.cpp.orig	1970-01-01 01:00:00.000000000 +0100
++++ openhpi-2.10.1/cpp/oSaHpiSensorRange.cpp	2007-11-04 00:10:30.376000007 +0100
+@@ -0,0 +1,181 @@
++/*      -*- linux-c -*-
++ *
++ * (C) Copyright IBM Corp. 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.
++ *
++ * Author(s):
++ *    W. David Ashley <dashley at us.ibm.com>
++ */
++
++
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++extern "C"
++{
++#include <SaHpi.h>
++}
++#include "oSaHpiSensorReading.hpp"
++#include "oSaHpiSensorRange.hpp"
++
++
++/**
++ * Default constructor.
++ */
++oSaHpiSensorRange::oSaHpiSensorRange() {
++    oSaHpiSensorReading *sr;
++
++    Flags = 0;
++    sr = (oSaHpiSensorReading *)&Max;
++    sr->initSensorReading(sr);
++    sr = (oSaHpiSensorReading *)&Min;
++    sr->initSensorReading(sr);
++    sr = (oSaHpiSensorReading *)&Nominal;
++    sr->initSensorReading(sr);
++    sr = (oSaHpiSensorReading *)&NormalMax;
++    sr->initSensorReading(sr);
++    sr = (oSaHpiSensorReading *)&NormalMin;
++    sr->initSensorReading(sr);
++};
++
++
++/**
++ * Constructor.
++ *
++ * @param buf    The reference to the class to be copied.
++ */
++oSaHpiSensorRange::oSaHpiSensorRange(const oSaHpiSensorRange& range) {
++    memcpy(this, &range, sizeof(SaHpiSensorRangeT));
++}
++
++
++/**
++ * Assign a field in the SaHpiSensorRangeT struct a value.
++ *
++ * @param field  The pointer to the struct (class).
++ * @param field  The field name as a text string (case sensitive).
++ * @param value  The character string value to be assigned to the field. This
++ *               value will be converted as necessary.
++ *
++ * @return True if there was an error, otherwise false.
++ */
++bool oSaHpiSensorRange::assignField(SaHpiSensorRangeT *ptr,
++                                    const char *field,
++                                    const char *value) {
++    if (ptr == NULL || field == NULL || value == NULL) {
++        return true;
++    }
++    if (strcmp(field, "Flags") == 0) {
++        ptr->Flags |= (SaHpiSensorRangeFlagsT)atoi(value);
++        return false;
++    }
++    return true;
++};
++
++
++/**
++ * Print the contents of the entity.
++ *
++ * @param stream Target stream.
++ * @param buffer Address of the SaHpiSensorReadingT struct.
++ *
++ * @return True if there was an error, otherwise false.
++ */
++bool oSaHpiSensorRange::fprint(FILE *stream,
++                               const int indent,
++                               const SaHpiSensorRangeT *rg) {
++	int i, err = 0;
++    char indent_buf[indent + 1];
++    const SaHpiSensorReadingT *sr;
++
++    if (stream == NULL || rg == NULL) {
++        return true;
++    }
++    for (i = 0; i < indent; i++) {
++        indent_buf[i] = ' ';
++    }
++    indent_buf[indent] = '\0';
++
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "Flags = %X\n", rg->Flags);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "Max\n");
++    if (err < 0) {
++        return true;
++    }
++    sr = (const SaHpiSensorReadingT *)&rg->Max;
++    err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "Min\n");
++    if (err < 0) {
++        return true;
++    }
++    sr = (const SaHpiSensorReadingT *)&rg->Min;
++    err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "Nominal\n");
++    if (err < 0) {
++        return true;
++    }
++    sr = (const SaHpiSensorReadingT *)&rg->Nominal;
++    err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "NormalMax\n");
++    if (err < 0) {
++        return true;
++    }
++    sr = (const SaHpiSensorReadingT *)&rg->NormalMax;
++    err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "%s", indent_buf);
++    if (err < 0) {
++        return true;
++    }
++    err = fprintf(stream, "NormalMin\n");
++    if (err < 0) {
++        return true;
++    }
++    sr = (const SaHpiSensorReadingT *)&rg->NormalMin;
++    err = oSaHpiSensorReading::fprint(stream, indent + 3, sr);
++    if (err < 0) {
++        return true;
++    }
++
++	return false;
++}
++
+--- openhpi-2.10.1/cpp/oSaHpiSensorReading.cpp.orig	1970-01-01 01:00:00.000000000 +0100
++++ openhpi-2.10.1/cpp/oSaHpiSensorReading.cpp	2007-11-04 00:10:30.380000235 +0100
+@@ -0,0 +1,181 @@
++/*      -*- linux-c -*-
++ *
++ * (C) Copyright IBM Corp. 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.
++ *
++ * Author(s):
++ *    W. David Ashley <dashley at us.ibm.com>
++ */
++
++
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++extern "C"
++{
++#include <SaHpi.h>
++}
++#include "oSaHpiTypesEnums.hpp"
++#include "oSaHpiSensorReading.hpp"
++
++
++/**
++ * Default constructor.
++ */
++oSaHpiSensorReading::oSaHpiSensorReading() {
++    initSensorReading(this);
++};
++
++
++/**
++ * Constructor.
++ *
++ * @param buf    The reference to the class to be copied.
++ */
++oSaHpiSensorReading::oSaHpiSensorReading(const oSaHpiSensorReading& ent) {
++    memcpy(this, &ent, sizeof(SaHpiSensorReadingT));
++}
++
++
++/**
++ * Assign a field in the SaHpiSensorReadingT struct a value.
++ *
++ * @param field  The pointer to the struct (class).
++ * @param field  The field name as a text string (case sensitive).
++ * @param value  The character string value to be assigned to the field. This
++ *               value will be converted as necessary.
++ *
++ * @return True if there was an error, otherwise false.
++ */
++bool oSaHpiSensorReading::assignField(SaHpiSensorReadingT *ptr,
++                                      const char *field,
++                                      const char *value) {
++    if (ptr == NULL || field == NULL || value == NULL) {
++        return true;
++    }
++    if (strcmp(field, "IsSupported") == 0) {
++        ptr->IsSupported = oSaHpiTypesEnums::str2torf(value);
++        return false;
++    }
++    else if (strcmp(field, "Type") == 0) {
++        ptr->Type = oSaHpiTypesEnums::str2sensorreadingtype(value);
++        return false;
++    }
++    else if (strcmp(field, "SensorInt64") == 0) {
++        ptr->Value.SensorInt64 = (SaHpiInt64T)strtoll(value, NULL, 10);
++        return false;
++    }
++    else if (strcmp(field, "SensorUint64") == 0) {
++        ptr->Value.SensorUint64 = (SaHpiUint64T)strtoull(value, NULL, 10);
++        return false;
++    }
++    else if (strcmp(field, "SensorFloat64") == 0) {
++        ptr->Value.SensorFloat64 = (SaHpiFloat64T)strtod(value, NULL);
++        return false;
++    }
++    else if (strcmp(field, "SensorBuffer") == 0) {
++        memset(ptr->Value.SensorBuffer, 0, SAHPI_SENSOR_BUFFER_LENGTH);
++        memcpy(ptr->Value.SensorBuffer, value, strlen(value));
++        return false;
++    }
++    return true;
++};
++
++
++/**
++ * Print the contents of the entity.
++ *
++ * @param stream Target stream.
++ * @param buffer Address of the SaHpiSensorReadingT struct.
++ *
++ * @return True if there was an error, otherwise false.
++ */
++bool oSaHpiSensorReading::fprint(FILE *stream,
++                                 const int indent,
++                                 const SaHpiSensorReadingT *sr) {
++	int i, err = 0;
++    char indent_buf[indent + 1];
++
++    if (stream == NULL || sr == NULL) {
++        return true;
++    }
++    for (i = 0; i < indent; i++) {
++        indent_buf[i] = ' ';
++    }
++    indent_buf[indent] = '\0';
++
++    err = fprintf(stream, "%s", indent_buf);
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list