This file is indexed.

/usr/include/openhpi/sahpi_struct_utils.h is in libopenhpi-dev 2.14.1-1.3ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*      -*- 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):
 *      Steve Sherman <stevees@us.ibm.com>
 *	Renier Morales <renier@openhpi.org>
 */

#ifndef __SAHPI_STRUCT_UTILS_H
#define __SAHPI_STRUCT_UTILS_H

#ifndef __OH_UTILS_H
#warning *** Include oh_utils.h instead of individual utility header files ***
#endif

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

/***********************
 * Text buffer utilities
 ***********************/
SaErrorT oh_init_textbuffer(SaHpiTextBufferT *buffer);
SaErrorT oh_append_textbuffer(SaHpiTextBufferT *buffer, const char *from);
SaErrorT oh_copy_textbuffer(SaHpiTextBufferT *dest, const SaHpiTextBufferT *from);

/* Print just the Data portions of the text structures */
#define oh_print_text(buf_ptr)  oh_fprint_text(stdout, buf_ptr)
SaErrorT oh_fprint_text(FILE *stream, const SaHpiTextBufferT *buffer);

/* Same as SaHpiTextBufferT, only more Data */
#define OH_MAX_TEXT_BUFFER_LENGTH 2048
typedef struct {
        SaHpiTextTypeT  DataType;
        SaHpiLanguageT  Language;
        SaHpiUint16T    DataLength;
        SaHpiUint8T     Data[OH_MAX_TEXT_BUFFER_LENGTH];
} oh_big_textbuffer;

SaErrorT oh_init_bigtext(oh_big_textbuffer *big_buffer);
SaErrorT oh_append_bigtext(oh_big_textbuffer *big_buffer, const char *from);
SaErrorT oh_copy_bigtext(oh_big_textbuffer *dest, const oh_big_textbuffer *from);

/* Print just the Data portions of the text structures */
#define oh_print_bigtext(bigbuf_ptr) oh_fprint_bigtext(stdout, bigbuf_ptr)
SaErrorT oh_fprint_bigtext(FILE *stream, const oh_big_textbuffer *big_buffer);

/************************************
 * HPI structure to string conversion
 ************************************/
SaErrorT oh_decode_manufacturerid(SaHpiManufacturerIdT value,
                                  SaHpiTextBufferT *buffer);

SaErrorT oh_decode_sensorreading(SaHpiSensorReadingT reading,
                                 SaHpiSensorDataFormatT format,
                                 SaHpiTextBufferT *buffer);

SaErrorT oh_encode_sensorreading(SaHpiTextBufferT *buffer,
                                 SaHpiSensorReadingTypeT type,
                                 SaHpiSensorReadingT *reading);

SaErrorT oh_decode_capabilities(SaHpiCapabilitiesT ResourceCapabilities,
                                SaHpiTextBufferT *buffer);

SaErrorT oh_decode_hscapabilities(SaHpiHsCapabilitiesT HsCapabilities,
                                  SaHpiTextBufferT *buffer);

SaErrorT oh_decode_sensoroptionaldata(SaHpiSensorOptionalDataT sensor_opt_data,
                                      SaHpiTextBufferT *buffer);

SaErrorT oh_decode_sensorenableoptdata(SaHpiSensorEnableOptDataT sensor_enable_opt_data,
                                       SaHpiTextBufferT *buffer);
SaErrorT oh_decode_dimitestcapabilities(SaHpiDimiTestCapabilityT capabilities,
                                        SaHpiTextBufferT *buffer);

SaErrorT oh_decode_fumiprotocols(SaHpiFumiProtocolT protocols,
                                 SaHpiTextBufferT *buffer);

SaErrorT oh_decode_fumicapabilities(SaHpiFumiCapabilityT capabilities,
                                  SaHpiTextBufferT *buffer);

/*************************
 * Validate HPI structures
 *************************/
SaHpiBoolT oh_valid_textbuffer(SaHpiTextBufferT *buffer);

SaErrorT oh_valid_thresholds(SaHpiSensorThresholdsT *thds,
                             SaHpiRdrT *rdr);

SaErrorT oh_valid_ctrl_state_mode(SaHpiCtrlRecT *ctrl_rdr,
                                  SaHpiCtrlModeT mode,
                                  SaHpiCtrlStateT *state);

/************************
 * Compare HPI structures
 ************************/
int oh_compare_sensorreading(SaHpiSensorReadingTypeT type,
                             SaHpiSensorReadingT *reading1,
                             SaHpiSensorReadingT *reading2);

/***************************
 * Print HPI data structures
 ***************************/
#define OH_PRINT_OFFSET "  "  /* Offset string */

SaErrorT oh_append_offset(oh_big_textbuffer *buffer, int offsets);

#define oh_print_event(event_ptr, ep, offsets) oh_fprint_event(stdout, event_ptr, ep, offsets)
SaErrorT oh_fprint_event(FILE *stream,
                         const SaHpiEventT *event,
                         const SaHpiEntityPathT *entitypath,
                         int offsets);

#define oh_print_idrfield(thisfield, offsets) oh_fprint_idrfield(stdout, thisfield, offsets)
SaErrorT oh_fprint_idrfield(FILE *stream, const SaHpiIdrFieldT *thisfield, int offsets);

#define oh_print_idrinfo(idrInfo, offsets) oh_fprint_idrinfo(stdout, idrInfo, offsets)
SaErrorT oh_fprint_idrinfo(FILE *stream, const SaHpiIdrInfoT *idrInfo, int offsets);

#define oh_print_idrareaheader(areaHeader, offsets) oh_fprint_idrareaheader(stdout, areaHeader, offsets)
SaErrorT oh_fprint_idrareaheader(FILE *stream, const SaHpiIdrAreaHeaderT *areaHeader, int offsets);

#define oh_print_rptentry(rptEntry, offsets) oh_fprint_rptentry(stdout, rptEntry, offsets)
SaErrorT oh_fprint_rptentry(FILE *stream, const SaHpiRptEntryT *rptEntry, int offsets);

#define oh_print_sensorrec(sensor_ptr, offsets) oh_fprint_sensorrec(stdout, sensor_ptr, offsets)
SaErrorT oh_fprint_sensorrec(FILE *stream, const SaHpiSensorRecT *sensor, int offsets);

#define oh_print_rdr(rdr, offsets) oh_fprint_rdr(stdout, rdr, offsets)
SaErrorT oh_fprint_rdr(FILE *stream, const SaHpiRdrT *rdrEntry, int offsets);

#define oh_print_textbuffer(buf_ptr, offsets)  oh_fprint_textbuffer(stdout, buf_ptr, offsets)
SaErrorT oh_fprint_textbuffer(FILE *stream, const SaHpiTextBufferT *textbuffer, int offsets);

#define oh_print_ctrlrec(ctrl_ptr, offsets) oh_fprint_ctrlrec(stdout, ctrl_ptr, offsets)
SaErrorT oh_fprint_ctrlrec(FILE *stream, const SaHpiCtrlRecT *control, int offsets);

#define oh_print_watchdogrec(watchdog_ptr, offsets) oh_fprint_watchdogrec(stdout, watchdog_ptr, offsets)
SaErrorT oh_fprint_watchdogrec(FILE *stream, const SaHpiWatchdogRecT *watchdog, int offsets);

#define oh_print_eventloginfo(elinfo_ptr, offsets) oh_fprint_eventloginfo(stdout, elinfo_ptr, offsets)
SaErrorT oh_fprint_eventloginfo(FILE *stream, const SaHpiEventLogInfoT *thiselinfo, int offsets);

#define oh_print_eventlogentry(eventlog_ptr, ep, offsets) oh_fprint_eventlogentry(stdout, eventlog_ptr, ep, offsets)
SaErrorT oh_fprint_eventlogentry(FILE *stream,
                                 const SaHpiEventLogEntryT *thiseventlog,
                                 const SaHpiEntityPathT *entitypath,
                                 int offsets);

#define oh_print_ctrlstate(ctrlstate_ptr, offsets) oh_fprint_ctrlstate(stdout, ctrlstate_ptr, offsets)
SaErrorT oh_fprint_ctrlstate(FILE *stream, const SaHpiCtrlStateT *thisctrlstate, int offsets);

#define oh_print_thresholds(thresholds, format, offsets) oh_fprint_thresholds(stdout, thresholds, format, offsets)
SaErrorT oh_fprint_thresholds(FILE *stream,
			      const SaHpiSensorThresholdsT *thresholds,
			      const SaHpiSensorDataFormatT *format,
			      int offsets);

SaErrorT oh_build_event(oh_big_textbuffer *buffer, const SaHpiEventT *event, const SaHpiEntityPathT *entitypath, int offsets);
SaErrorT oh_build_threshold_mask(oh_big_textbuffer *buffer, const SaHpiSensorThdMaskT tmask, int offsets);


#ifdef __cplusplus
}
#endif

#endif