ProviewR Programmer's Reference Manual  V7.0.0
pwr.h
Go to the documentation of this file.
1 /*
2  * ProviewR Open Source Process Control.
3  * Copyright (C) 2005-2026 SSAB EMEA AB.
4  *
5  * This file is part of ProviewR.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation, either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with ProviewR. If not, see <http://www.gnu.org/licenses/>
19  *
20  * Linking ProviewR statically or dynamically with other modules is
21  * making a combined work based on ProviewR. Thus, the terms and
22  * conditions of the GNU General Public License cover the whole
23  * combination.
24  *
25  * In addition, as a special exception, the copyright holders of
26  * ProviewR give you permission to, from the build function in the
27  * ProviewR Configurator, combine ProviewR with modules generated by the
28  * ProviewR PLC Editor to a PLC program, regardless of the license
29  * terms of these modules. You may copy and distribute the resulting
30  * combined work under the terms of your choice, provided that every
31  * copy of the combined work is accompanied by a complete copy of
32  * the source code of ProviewR (the version used to produce the
33  * combined work), being distributed under the terms of the GNU
34  * General Public License plus this exception.
35  */
36 
37 #ifndef pwr_h
38 #define pwr_h
39 #ifndef PWR_LOADED
40 #define PWR_LOADED 1
41 #endif
42 
43 /* pwr.h -- basic definitions for PROVIEW/R
44  */
45 
46 #include <stdlib.h> /* EXIT_FAILURE */
47 #include <limits.h>
48 
56 
57 #if defined __cplusplus
58 extern "C" {
59 #endif
60 
61 #define pwr_dExport
62 #define pwr_dImport extern
63 
64 /* Environment variable which MUST be defined.
65  * eg. export PWR_BUS_ID="300"
66  */
67 #define pwr_dEnvBusId "PWR_BUS_ID"
68 
69 #ifndef pwr_dPacked
70 #if defined(__GNUC__) || defined(__GNUG__)
71 #define pwr_dPacked __attribute__((packed))
72 #else
73 #define pwr_dPacked
74 #endif
75 #endif
76 
77 #define pwr_dLittleEndian 1
78 #define pwr_dBigEndian 2
79 
80 #if defined(__powerpc__)
81 #define pwr_dHost_byteOrder pwr_dBigEndian
82 #if 0
83 #define pwr_Bit(b) (1 << (31 - b))
84 #define pwr_SetByte(byte, val) (val << ((3 - byte) << 3))
85 #endif
86 #else
87 #define pwr_dHost_byteOrder pwr_dLittleEndian
88 #endif
89 
90 #define pwr_Bit(b) (1 << b)
91 #define pwr_SetByte(byte, val) (val << (byte << 3))
92 
93 #if defined(HW_X86_64) || defined(HW_ARM64)
94 #define pwr_cAlignW 4
95 #define pwr_cAlignLW 8
96 #else
97 #define pwr_cAlignW 4
98 #define pwr_cAlignLW 8
99 #endif
100 #define pwr_dAlignW __attribute__((aligned(4)))
101 #define pwr_dAlignLW __attribute__((aligned(8)))
102 #define pwr_AlignW(offs) (((offs) + (pwr_cAlignW - 1)) & ~(pwr_cAlignW - 1))
103 #define pwr_AlignLW(offs) (((offs) + (pwr_cAlignLW - 1)) & ~(pwr_cAlignLW - 1))
104 #define pwr_Align(offs, align) ((offs + (align - 1)) & ~(align - 1))
105 
106 /* PROVIEW/R types */
107 
108 #define pwr_cSizObjName 31
109 #define pwr_cSizPgmName 31
110 #define pwr_cSizStructName 31
111 #define pwr_cSizGraphName 15
112 #define pwr_cSizXRef 31
113 #define pwr_cSizAttrName 31
114 #define pwr_cSizPathName 63
115 #define pwr_cSizFullName 199
116 #define pwr_cSizOName 199
117 #define pwr_cSizAName 399
118 #define pwr_cSizFileName 255
119 #define pwr_cSizCmd 399
120 
121 typedef void* pwr_tAddress;
122 typedef unsigned int pwr_tBit;
123 typedef unsigned int pwr_tBitMask;
124 /*_*
125  @aref boolean Boolean
126 */
127 typedef unsigned int pwr_tBoolean;
128 /*_*
129  @aref float32 Float32
130 */
131 typedef float pwr_tFloat32;
132 /*_*
133  @aref float64 Float64
134 */
135 typedef double pwr_tFloat64;
136 /*_*
137  @aref char Char
138 */
139 typedef char pwr_tChar;
140 /*_*
141  @aref string String
142 */
143 typedef char pwr_tString[];
144 /*_*
145  @aref text Text
146 */
147 typedef char pwr_tText[];
148 /*_*
149  @aref int8 Int8
150 */
151 typedef char pwr_tInt8;
152 /*_*
153  @aref int16 Int16
154 */
155 typedef short pwr_tInt16;
156 /*_*
157  @aref int32 Int32
158 */
159 typedef int pwr_tInt32;
160 
162 /*_*
163  @aref int64 Int64
164 */
165 typedef struct {
166  unsigned int low;
167  int high;
168 } __pwr_tInt64;
169 #if defined(HW_X86_64) || defined(HW_ARM64)
170 typedef long int pwr_tInt64;
171 #define PWR_INT64MAX LONG_MAX
172 #define PWR_INT64MIN LONG_MIN
173 #else
174 typedef long long int pwr_tInt64;
175 #define PWR_INT64MAX LLONG_MAX
176 #define PWR_INT64MIN LLONG_MIN
177 #endif
178 
180 /*_*
181  @aref uint64 UInt64
182 */
183 typedef struct {
184  unsigned int low;
185  unsigned int high;
186 } __pwr_tUInt64;
187 
188 #if defined(HW_X86_64) || defined(HW_ARM64)
189 typedef unsigned long int pwr_tUInt64;
190 #define PWR_UINT64MAX ULONG_MAX
191 #else
192 typedef unsigned long long int pwr_tUInt64;
193 #define PWR_UINT64MAX ULLONG_MAX
194 #endif
195 
196 #define PWR_INT8_MAX SCHAR_MAX
197 #define PWR_INT8_MIN SCHAR_MIN
198 #define PWR_UINT8_MAX UCHAR_MAX
199 #define PWR_INT16_MAX SHRT_MAX
200 #define PWR_INT16_MIN SHRT_MIN
201 #define PWR_UINT16_MAX USHRT_MAX
202 #define PWR_INT32_MAX INT_MAX
203 #define PWR_INT32_MIN INT_MIN
204 #define PWR_UINT32_MAX UINT_MAX
205 #define PWR_ATTIME_MAX \
206  { \
207  PWR_INT64MAX, 1000000000 - 1 \
208  }
209 #define PWR_ATTIME_MIN \
210  { \
211  0, 0 \
212  }
213 #define PWR_DTTIME_MAX \
214  { \
215  PWR_INT64MAX, 1000000000 - 1 \
216  }
217 #define PWR_DTTIME_MIN \
218  { \
219  PWR_INT64MIN, -(1000000000 - 1) \
220  }
221 
222 /*_*
223  @aref uint8 UInt8
224 */
225 typedef unsigned char pwr_tUInt8;
226 /*_*
227  @aref uint16 UInt16
228 */
229 typedef unsigned short pwr_tUInt16;
230 /*_*
231  @aref uint32 UInt32
232 */
233 typedef unsigned int pwr_tUInt32;
234 /*_*
235  @aref volumeid VolumeId
236 */
237 typedef unsigned int pwr_tVid;
239 typedef unsigned int pwr_tAix;
240 /*_*
241  @aref objectix ObjectIx
242 */
243 typedef unsigned int pwr_tOix;
245 /*_*
246  @aref mask Mask
247 */
249 /*_*
250  @aref enum Enum
251 */
253 
254 /*_*
255  @aref viod Void
256 */
257 typedef void pwr_tVoid;
258 
260 /*_*
261  @aref objid Objid
262 */
263 typedef struct {
264  pwr_tOix oix;
265  pwr_tVid vid;
266 } pwr_tOid;
267 
269 typedef pwr_tOid pwr_tObjDId;
270 /*_*
271  @aref classid ClassId
272 */
273 typedef unsigned int pwr_tCid;
275 /*_*
276  @aref typeid TypeId
277 */
278 typedef unsigned int pwr_tTid;
280 
281 /*_*
282  @aref status Status
283 */
284 typedef int pwr_tStatus;
285 /*_*
286  @aref netstatus NetStatus
287 */
288 typedef int pwr_tNetStatus;
289 
290 typedef unsigned int pwr_tGeneration;
291 typedef unsigned int pwr_tBid;
292 typedef unsigned int pwr_tVersion;
293 typedef unsigned int pwr_tPwrVersion;
294 typedef unsigned int pwr_tProjVersion;
295 typedef unsigned int pwr_tUserId;
296 typedef unsigned int pwr_tDbId;
300 typedef unsigned int pwr_tSid;
301 
302 /*_*
303  @aref refid RefId
304 */
305 typedef struct {
306  pwr_tUInt32 rix;
307  pwr_tNid nid;
308 } pwr_tRid;
309 
310 typedef pwr_tRid pwr_tRefId;
311 typedef pwr_tRid pwr_tDlid;
312 typedef pwr_tRid pwr_tSubid;
313 
314 /*_*
315  @aref bix Bix
316 */
318 typedef enum {
319  pwr_eBix__ = 0,
320  pwr_eBix_sys = 1,
321  pwr_eBix_rt = 1,
322  pwr_eBix_dev = 2,
323  pwr_eBix_template = 7,
324  pwr_eBix_
325 } pwr_eBix;
326 
328 typedef struct {
329  int low;
330  int high;
331 } pwr_tVaxTime;
332 
334 typedef union {
335  pwr_tPwrVersion i;
337  struct {
338 #if (pwr_dHost_byteOrder == pwr_dLittleEndian)
339 
340  pwr_tChar Char;
341  pwr_tUInt8 Major;
342  pwr_tUInt8 Minor;
343  pwr_tUInt8 Update;
344 
345 #elif (pwr_dHost_byteOrder == pwr_dBigEndian)
346 
347  pwr_tUInt8 Update;
348  pwr_tUInt8 Minor;
349  pwr_tUInt8 Major;
350  pwr_tChar Char;
351 
352 #endif
353  } s;
355 
356 /*_*
357  @aref time Time
358 */
359 // typedef struct timespec pwr_tTime; //!< Abolute time type.
360 typedef struct {
361  pwr_tInt64 tv_sec;
362  pwr_tInt64 tv_nsec;
363 } pwr_tTime;
364 
366 /*_*
367  @aref deltatime DeltaTime
368 */
369 typedef struct {
370  pwr_tInt64 tv_sec;
371  pwr_tInt64 tv_nsec;
373 
374 /*_*
375  @aref objname ObjName
376 */
377 typedef char pwr_tObjName[pwr_cSizObjName + 1];
378 /*_*
379  @aref pgmname PgmName
380 */
381 typedef char pwr_tPgmName[pwr_cSizPgmName + 1];
382 
383 /*_*
384  @aref xref XRef
385 */
386 typedef char pwr_tXRef[pwr_cSizXRef + 1];
387 
388 /*_*
389  @aref graphname GraphName
390 */
391 typedef char pwr_tGraphName[pwr_cSizGraphName + 1];
392 typedef char pwr_tStructName[pwr_cSizStructName + 1];
393 typedef char pwr_tAttrName[pwr_cSizAttrName + 1];
394 typedef char pwr_tPathName[pwr_cSizPathName + 1];
395 typedef char pwr_tFullName[pwr_cSizFullName + 1];
396 typedef char pwr_tOName[pwr_cSizOName + 1];
397 typedef char pwr_tAName[pwr_cSizAName + 1];
398 typedef char pwr_tFileName[pwr_cSizFileName + 1];
399 typedef char pwr_tCmd[pwr_cSizCmd + 1];
400 
401 /*_*
402  @aref string256 String256
403 */
404 typedef char pwr_tString256[256];
405 /*_*
406  @aref string132 String132
407 */
408 typedef char pwr_tString132[132];
409 /*_*
410  @aref string104 String104
411 */
412 typedef char pwr_tString104[104];
413 /*_*
414  @aref string80 String80
415 */
416 typedef char pwr_tString80[80];
417 /*_*
418  @aref string64 String64
419 */
420 typedef char pwr_tString64[64];
421 /*_*
422  @aref string40 String40
423 */
424 typedef char pwr_tString40[40];
425 /*_*
426  @aref string32 String32
427 */
428 typedef char pwr_tString32[32];
429 /*_*
430  @aref string16 String16
431 */
432 typedef char pwr_tString16[16];
433 /*_*
434  @aref string8 String8
435 */
436 typedef char pwr_tString8[8];
437 /*_*
438  @aref string1 String1
439 */
440 typedef char pwr_tString1[1];
441 /*_*
442  @aref prostring40 ProString40
443 */
444 typedef char pwr_tProString40[40];
445 /*_*
446  @aref text256 Text256
447 */
448 typedef char pwr_tText256[256];
449 /*_*
450  @aref text1024 Text1024
451 */
452 typedef char pwr_tText1024[1024];
453 /*_*
454  @aref text8192 Text8192
455 */
456 typedef char pwr_tText8192[8192];
457 /*_*
458  @aref url URL
459 */
460 typedef char pwr_tURL[160];
461 /*_*
462  @aref castid CastId
463 */
465 /*_*
466  @aref disableattr DisableAttr
467 */
468 typedef unsigned int pwr_tDisableAttr;
469 
470 /*_*
471  @aref emergbreakselectenum EmergBreakSelectEnum
472 */
473 typedef enum {
474  pwr_eEmergBreakSelectEnum_NoAction = 0,
475  pwr_eEmergBreakSelectEnum_Reboot = 1,
476  pwr_eEmergBreakSelectEnum_FixedOutputValues = 2,
477  pwr_eEmergBreakSelectEnum_StopIO = 3
478 } pwr_eEmergBreakSelectEnum;
480 
481 /*_*
482  @aref opsysenum OpSysEnum
483 */
485 
486 /*_*
487  @aref opsysenum OpSysMask
488 */
490 
491 /*_*
492  @aref popeidtorenum PopEditorEnum
493 */
495 
496 /*_*
497  @aref reflistlfiltermask RefListFilterMask
498 */
499 typedef enum {
500  pwr_mRefListFilterMask_CurrentVolume = 1,
501  pwr_mRefListFilterMask_AllVolumes = 2,
502  pwr_mRefListFilterMask_RootVolume = 4,
503  pwr_mRefListFilterMask_SharedVolume = 8,
504  pwr_mRefListFilterMask_Siblings = 16,
505  pwr_mRefListFilterMask_AttrObjects = 32,
506  pwr_mRefListFilterMask_PwrsVolume = 64,
507  pwr_mRefListFilterMask_Other = 128,
508  pwr_mRefListFilterMask_Children = 256
509 } pwr_mRefListFilterMask;
511 
512 /*_*
513  @aref attrrefflag AttrRefFlag
514 */
516 typedef union {
517  pwr_tBitMask m;
519  struct {
520 #if (pwr_dHost_byteOrder == pwr_dLittleEndian)
521 
522  pwr_tBit Indirect : 1;
523  pwr_tBit Object : 1;
524  pwr_tBit ObjectAttr : 1;
525  pwr_tBit Array : 1;
526  pwr_tBit Shadowed : 1;
527  pwr_tBit CastAttr : 1;
528  pwr_tBit DisableAttr : 1;
529 
530  pwr_tBit fill : 25;
531 
532 #elif (pwr_dHost_byteOrder == pwr_dBigEndian)
533 
534  pwr_tBit fill : 25;
535 
536  pwr_tBit DisableAttr : 1;
537  pwr_tBit CastAttr : 1;
538  pwr_tBit Shadowed : 1;
539  pwr_tBit Array : 1;
540  pwr_tBit ObjectAttr : 1;
541  pwr_tBit Object : 1;
542  pwr_tBit Indirect : 1;
543 
544 #endif
545  } b;
546 
547 #define pwr_mAttrRef_Indirect pwr_Bit(0)
548 #define pwr_mAttrRef_Object pwr_Bit(1)
549 #define pwr_mAttrRef_ObjectAttr pwr_Bit(2)
550 #define pwr_mAttrRef_Array pwr_Bit(3)
551 #define pwr_mAttrRef_Shadowed pwr_Bit(4)
552 #define pwr_mAttrRef_CastAttr pwr_Bit(5)
553 #define pwr_mAttrRef_DisableAttr pwr_Bit(6)
554 
555 } pwr_mAttrRef;
556 
558 /*_*
559  @aref attrref AttrRef
560 */
561 typedef struct {
567 } pwr_sAttrRef;
568 
569 typedef pwr_sAttrRef pwr_tAttrRef;
570 
571 /*_*
572  @aref dataref DataRef
573 */
574 typedef struct {
575  pwr_tVoid* Ptr pwr_dAlignLW;
576  pwr_tAttrRef Aref pwr_dAlignLW;
577 } pwr_tDataRef;
578 
579 /*_*
580  @aref constants Constants
581 */
583 static const pwr_sAttrRef pwr_cNAttrRef = { { 0, 0 }, 0, 0, 0, { 0 } };
584 static const pwr_tOid pwr_cNOid = { 0, 0 };
585 static const pwr_tObjid pwr_cNObjid
586  = { 0, 0 };
587 static const pwr_tDlid pwr_cNRefId
588  = { 0, 0 };
589 #define pwr_cNSubid pwr_cNRefId
590 #define pwr_cNDlid pwr_cNRefId
591 static const pwr_tOix pwr_cNOix = 0;
592 static const pwr_tObjectIx pwr_cNObjectIx = 0;
593 static const pwr_tClassId pwr_cNClassId = 0;
594 static const pwr_tTypeId pwr_cNTypeId = 0;
595 static const pwr_tCastId pwr_cNCastId = 0;
596 static const pwr_tDisableAttr pwr_cNDisableAttr
597  = 0;
598 static const pwr_tVolumeId pwr_cNVolumeId
599  = 0;
600 static const pwr_tNodeId pwr_cNNodeId = 0;
601 static const pwr_tCid pwr_cNCid = 0;
602 static const pwr_tTid pwr_cNTid = 0;
603 static const pwr_tVid pwr_cNVid = 0;
604 static const pwr_tNid pwr_cNNid = 0;
605 static const pwr_tStatus pwr_cNStatus = 0;
606 static const pwr_tTime pwr_cNTime = { 0, 0 };
607 static const pwr_tDeltaTime pwr_cNDeltaTime
608  = { 0, 0 };
609 static const pwr_tDataRef pwr_cNDataRef = { 0, pwr_cNAttrRef };
610 static const pwr_tTime pwr_cNotATime = { 0, 1000000000 };
611 static const pwr_tDeltaTime pwr_cNotADeltaTime
612  = { 0, 1000000000 };
613 static const pwr_tTime pwr_cAtMax = PWR_ATTIME_MAX;
614 static const pwr_tTime pwr_cAtMin = PWR_ATTIME_MIN;
615 static const pwr_tDeltaTime pwr_cDtMax = PWR_DTTIME_MAX;
616 static const pwr_tDeltaTime pwr_cDtMin = PWR_DTTIME_MIN;
617 
618 /* Gereral macro definitions */
619 
620 #ifndef ODD
622 #define ODD(a) (((int)(a)&1) != 0)
623 #endif
624 
625 #ifndef EVEN
627 #define EVEN(a) (((int)(a)&1) == 0)
628 #endif
629 
630 /* General definitions */
631 
632 #ifndef EQUAL
633 #define EQUAL 0
634 #endif
635 
636 #ifndef ON
637 #define ON 1
638 #endif
639 
640 #ifndef OFF
641 #define OFF 0
642 #endif
643 
644 #ifndef TRUE
645 #define TRUE 1
646 #endif
647 
648 #ifndef FALSE
649 #define FALSE 0
650 #endif
651 
652 #ifndef YES
653 #define YES 1
654 #endif
655 
656 #ifndef NO
657 #define NO 0
658 #endif
659 
660 #ifndef pwr_Offset
661 #define pwr_Offset(base, field) \
662  ((unsigned long)&((base)->field) - (unsigned long)(base))
663 #endif
664 
665 #define pwr_Field(a, n) a n;
666 #define pwr_Bits(a, n) pwr_tBit a : n;
667 
668 #if pwr_dHost_byteOrder == pwr_dLittleEndian
669 #define pwr_32Bits(a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, a11, \
670  a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, \
671  a24, a25, a26, a27, a28, a29, a30, a31) \
672  struct { \
673  a00 a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 \
674  a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 \
675  }
676 
677 #define pwr_Endian_32(a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, \
678  a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, \
679  a22, a23, a24, a25, a26, a27, a28, a29, a30, a31) \
680  \
681  a00 a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 a18 \
682  a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31
683 
684 #define pwr_Endian_16(a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, \
685  a11, a12, a13, a14, a15) \
686  \
687  a00 a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15
688 
689 #define pwr_Endian_8(a00, a01, a02, a03, a04, a05, a06, a07) \
690  a00 a01 a02 a03 a04 a05 a06 a07
691 
692 #define pwr_Endian_4(a00, a01, a02, a03) a00 a01 a02 a03
693 
694 #elif pwr_dHost_byteOrder == pwr_dBigEndian
695 #define pwr_32Bits(a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, a11, \
696  a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, \
697  a24, a25, a26, a27, a28, a29, a30, a31) \
698  struct { \
699  a31 a30 a29 a28 a27 a26 a25 a24 a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 \
700  a13 a12 a11 a10 a09 a08 a07 a06 a05 a04 a03 a02 a01 a00 \
701  }
702 
703 #define pwr_Endian_32(a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, \
704  a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, \
705  a22, a23, a24, a25, a26, a27, a28, a29, a30, a31) \
706  \
707  a31 a30 a29 a28 a27 a26 a25 a24 a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 \
708  a12 a11 a10 a09 a08 a07 a06 a05 a04 a03 a02 a01 a00
709 
710 #define pwr_Endian_16(a00, a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, \
711  a11, a12, a13, a14, a15) \
712  \
713  a15 a14 a13 a12 a11 a10 a09 a08 a07 a06 a05 a04 a03 a02 a01 a00
714 
715 #define pwr_Endian_8(a00, a01, a02, a03, a04, a05, a06, a07) \
716  a07 a06 a05 a04 a03 a02 a01 a00
717 
718 #define pwr_Endian_4(a00, a01, a02, a03) a03 a02 a01 a00
719 
720 #endif
721 
722 #ifndef pwr_dStatus
723 #define pwr_dStatus(sts, status, ists) \
724  pwr_tStatus pwr__sts_; \
725  pwr_tStatus* sts = (status == NULL) ? &pwr__sts_ : status; \
726  *sts = ists
727 #endif
728 
729 #ifndef pwr_Status
730 #define pwr_Status(sts, lsts) ((void*)(sts) ? ((*sts) = (lsts)) : (lsts))
731 #endif
732 
733 #ifndef pwr_StatusBreak
734 #define pwr_StatusBreak(a, b) \
735  { \
736  a = b; \
737  break; \
738  }
739 #endif
740 
741 #ifndef pwr_Return
742 #define pwr_Return(a, sts, lsts) \
743  return (((void*)(sts) ? (*sts) = (lsts) : lsts), a)
744 #endif
745 
746 #ifndef pwr_ReturnVoid
747 #define pwr_ReturnVoid(sts, lsts) \
748  { \
749  ((void*)(sts) ? (*sts) = (lsts) : lsts); \
750  return; \
751  }
752 #endif
753 
754 #ifdef PWR_NDEBUG
755 #define pwr_Assert(a) ((void)0)
756 #else
757 #define pwr_Assert(a) \
758  ((a) ? (void)0 : (void)(printf("pwr assertion (%s) failed,\n in file " \
759  "%s, at line %d\n", \
760  #a, __FILE__, __LINE__), \
761  exit(EXIT_FAILURE)))
762 #endif
763 
764 #if defined(HW_X86_64) || defined(HW_ARM64)
765 #define pwr_dFormatUInt64 "%lu"
766 #define pwr_dFormatInt64 "%ld"
767 #define pwr_dFormatHexInt64 "%lx"
768 #define pwr_dFormatOctInt64 "%lo"
769 #else
770 #define pwr_dFormatUInt64 "%llu"
771 #define pwr_dFormatInt64 "%lld"
772 #define pwr_dFormatHexInt64 "%llx"
773 #define pwr_dFormatOctInt64 "%llo"
774 #endif
777 #if defined __cplusplus
778 }
779 #endif
780 #endif
void pwr_tVoid
Void type.
Definition: pwr.h:257
char pwr_tText[]
Text type.
Definition: pwr.h:147
unsigned int pwr_tUInt32
32-bit unsigned integer type.
Definition: pwr.h:233
char pwr_tAName[399+1]
Full Aref Name type.
Definition: pwr.h:397
double pwr_tFloat64
64-bit float.
Definition: pwr.h:135
char pwr_tChar
Character type.
Definition: pwr.h:139
pwr_tNid pwr_tNodeId
Node identity type.
Definition: pwr.h:298
unsigned int pwr_tVid
Volume identity type.
Definition: pwr.h:237
char pwr_tXRef[31+1]
XRef type.
Definition: pwr.h:386
char pwr_tString[]
String type.
Definition: pwr.h:143
pwr_tOix pwr_tObjectIx
Object index type.
Definition: pwr.h:244
char pwr_tPgmName[31+1]
PgmName type.
Definition: pwr.h:381
pwr_tTypeId pwr_tCastId
CastId type.
Definition: pwr.h:464
unsigned int pwr_tBitMask
Bitmask type.
Definition: pwr.h:123
unsigned int pwr_tOix
Object index type.
Definition: pwr.h:243
char pwr_tProString40[40]
40 byte protected string type.
Definition: pwr.h:444
char pwr_tString64[64]
64 byte string type.
Definition: pwr.h:420
pwr_tTid pwr_tTypeId
Type identity type.
Definition: pwr.h:279
char pwr_tText8192[8192]
8192 byte text type.
Definition: pwr.h:456
unsigned int pwr_tBoolean
Boolean type.
Definition: pwr.h:127
pwr_tMask pwr_tOpSysMask
Operating system Mask.
Definition: pwr.h:489
char pwr_tPathName[63+1]
PathName type.
Definition: pwr.h:394
pwr_tCid pwr_tClassId
Class identity type.
Definition: pwr.h:274
pwr_tNid pwr_tNodeIndex
Node index type.
Definition: pwr.h:299
unsigned int pwr_tSid
Server identity type.
Definition: pwr.h:300
char pwr_tInt8
8-bit integer type.
Definition: pwr.h:151
pwr_tRid pwr_tSubid
Subscription identity type.
Definition: pwr.h:312
char pwr_tGraphName[15+1]
GraphName type.
Definition: pwr.h:391
char pwr_tFileName[255+1]
FileName type.
Definition: pwr.h:398
unsigned int pwr_tCid
Class identity type.
Definition: pwr.h:273
pwr_tEnum pwr_tEmergBreakSelectEnum
Node attribute enum.
Definition: pwr.h:479
char pwr_tURL[160]
URL type.
Definition: pwr.h:460
char pwr_tAttrName[31+1]
AttrName type.
Definition: pwr.h:393
pwr_tOid pwr_tObjid
Object identity type.
Definition: pwr.h:268
char pwr_tString104[104]
104 byte string type.
Definition: pwr.h:412
char pwr_tString40[40]
40 byte string type.
Definition: pwr.h:424
pwr_tMask pwr_tRefListFilterMask
Reference list filter Mask.
Definition: pwr.h:510
char pwr_tStructName[31+1]
StructName type.
Definition: pwr.h:392
short pwr_tInt16
16-bit integer type.
Definition: pwr.h:155
char pwr_tText256[256]
256 byte text type.
Definition: pwr.h:448
char pwr_tFullName[199+1]
FullName type.
Definition: pwr.h:395
char pwr_tCmd[399+1]
Command string type.
Definition: pwr.h:399
char pwr_tText1024[1024]
1024 byte text type.
Definition: pwr.h:452
char pwr_tString80[80]
80 byte string type.
Definition: pwr.h:416
pwr_tEnum pwr_tOpSysEnum
Operating system enum.
Definition: pwr.h:484
char pwr_tString1[1]
1 byte string type.
Definition: pwr.h:440
char pwr_tString8[8]
8 byte string type.
Definition: pwr.h:436
pwr_eBix
Body index enumeration.
Definition: pwr.h:318
int pwr_tInt32
32-bit integer type.
Definition: pwr.h:159
unsigned int pwr_tBit
Bit type.
Definition: pwr.h:122
unsigned char pwr_tUInt8
8-bit unsigned integer type.
Definition: pwr.h:225
int pwr_tStatus
Status type.
Definition: pwr.h:284
pwr_tInt32 pwr_tEnum
Enumeration type.
Definition: pwr.h:252
char pwr_tString132[132]
132 byte string type.
Definition: pwr.h:408
unsigned int pwr_tAix
Attribute index type.
Definition: pwr.h:239
void * pwr_tAddress
Generic pointer type.
Definition: pwr.h:121
pwr_tVid pwr_tVolumeId
Volume identity type.
Definition: pwr.h:238
pwr_tRid pwr_tDlid
Direct link identity type.
Definition: pwr.h:311
char pwr_tOName[199+1]
Full Object Name type.
Definition: pwr.h:396
char pwr_tString16[16]
16 byte string type.
Definition: pwr.h:432
char pwr_tString32[32]
32 byte string type.
Definition: pwr.h:428
pwr_tRid pwr_tRefId
Reference identity type.
Definition: pwr.h:310
unsigned int pwr_tTid
Type identity type.
Definition: pwr.h:278
pwr_tEnum pwr_tPopEditorEnum
Pop editor enum.
Definition: pwr.h:494
unsigned int pwr_tDisableAttr
DisableAttr type.
Definition: pwr.h:468
pwr_tVolumeId pwr_tNid
Node identity type.
Definition: pwr.h:297
unsigned short pwr_tUInt16
16-bit unsigned integer type.
Definition: pwr.h:229
char pwr_tObjName[31+1]
Object name type.
Definition: pwr.h:377
int pwr_tNetStatus
Network status type.
Definition: pwr.h:288
pwr_tUInt32 pwr_tMask
Mask type.
Definition: pwr.h:248
float pwr_tFloat32
32-bit float.
Definition: pwr.h:131
char pwr_tString256[256]
256 byte string type.
Definition: pwr.h:404
64-bit integer type.
Definition: pwr.h:165
64-bit unsigned integer type.
Definition: pwr.h:183
Attribute reference.
Definition: pwr.h:561
pwr_tUInt32 Size
Attribute size.
Definition: pwr.h:565
pwr_tCid Body
Typeid of attribute, body or class.
Definition: pwr.h:563
pwr_tOid Objid
Object identity.
Definition: pwr.h:562
pwr_mAttrRef Flags
Attribute flags.
Definition: pwr.h:566
pwr_tUInt32 Offset
Offset in body.
Definition: pwr.h:564
Delta time type.
Definition: pwr.h:369
Object identity type.
Definition: pwr.h:263
Vax time.
Definition: pwr.h:328
Attribute reference flags type.
Definition: pwr.h:516
Proview version type.
Definition: pwr.h:334