Pointwise Plugin SDK
apiPWPUtils.cxx
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Pointwise Plugin utility functions
4  *
5  * Proprietary software product of Pointwise, Inc.
6  * Copyright (c) 1995-2018 Pointwise, Inc.
7  * All rights reserved.
8  *
9  ***************************************************************************/
10 
11 #include <map>
12 #include <sstream>
13 #include <string>
14 #include <utility>
15 
16 #include <string.h>
17 #include "apiPWP.h"
18 #include "apiPWPUtils.h"
19 
20 typedef std::string PwuString;
21 
22 
23 /*------------------------------------*/
24 static PWU_RTITEM*
25 PwuFindAPI(const char api[], PWP_UINT32 cnt)
26 {
27  PWU_RTITEM *ret = 0;
28  if (api && api[0]) {
29  PWP_UINT32 ii;
30  for (ii=0; ii < cnt; ++ii) {
31  if (0 == strcmp(pwpRtItem[ii].apiInfo.name, api)) {
32  ret = &(pwpRtItem[ii]);
33  break;
34  }
35  }
36  }
37  return ret;
38 }
39 
40 /**************************************/
42 PwuFindTotalAPI(const char api[])
43 {
44  return PwuFindAPI(api, totalApiCnt);
45 }
46 
47 /**************************************/
49 PwuFindPublishedAPI(const char api[])
50 {
51  return PwuFindAPI(api, publishedApiCnt);
52 }
53 
54 /**************************************/
56 PwuFindApiMsgCB(const char api[])
57 {
58  PWU_RTITEM *pApiInfo = PwuFindTotalAPI(api);
59  return (pApiInfo? pApiInfo->msgCB : 0);
60 }
61 
62 
63 //***********************************************************************
64 //***********************************************************************
65 // send a generic message back to framework
66 //***********************************************************************
67 //***********************************************************************
68 
69 /**************************************/
71 PwuSendMsg(const char api[], PWP_ENUM_MSGID id, void *pMsg)
72 {
73  PWP_UINT32 ret = 0;
74  PWP_MESSAGECB msgCB = PwuFindApiMsgCB(api);
75  if (!msgCB) {
76  // api does NOT have a CB, use default CB
78  }
79 
80  // invoke CB if defined
81  if (msgCB) {
82  ret = msgCB(api, id, pMsg);
83  }
84 
85  // always invoke spy CB if defined. ignore ret.
87  if (msgCB) {
88  msgCB(api, id, pMsg);
89  }
90  return ret;
91 }
92 
93 //***********************************************************************
94 //***********************************************************************
95 // bundle and send a text message back to framework
96 //***********************************************************************
97 //***********************************************************************
98 
99 /*------------------------------------*/
100 static void
101 PwuSendTextMsg(const char api[], PWP_ENUM_MSGID id, const char txt[], PWP_UINT32 code)
102 {
103  PWP_MSG_TEXT msg;
104  msg.code = code;
105  msg.text = (txt ? txt : "");
106  PwuSendMsg(api, id, (void*)&msg);
107 }
108 
109 /**************************************/
110 void
111 PwuSendDebugMsg(const char api[], const char txt[], PWP_UINT32 code)
112 {
113  PwuSendTextMsg(api, PWP_MSGID_DEBUG, txt, code);
114 }
115 
116 /**************************************/
117 void
118 PwuSendInfoMsg(const char api[], const char txt[], PWP_UINT32 code)
119 {
120  PwuSendTextMsg(api, PWP_MSGID_INFO, txt, code);
121 }
122 
123 /**************************************/
124 void
125 PwuSendWarningMsg(const char api[], const char txt[], PWP_UINT32 code)
126 {
127  PwuSendTextMsg(api, PWP_MSGID_WARNING, txt, code);
128 }
129 
130 /**************************************/
131 void
132 PwuSendErrorMsg(const char api[], const char txt[], PWP_UINT32 code)
133 {
134  PwuSendTextMsg(api, PWP_MSGID_ERROR, txt, code);
135 }
136 
137 //***********************************************************************
138 //***********************************************************************
139 // bundle and send a progress message back to framework
140 //***********************************************************************
141 //***********************************************************************
142 
143 /*------------------------------------*/
144 static PWP_UINT32
145 PwuSendProgressMsg (const char api[], PWP_ENUM_MSGID id, PWP_UINT32 value)
146 {
147  PWP_MSG_PROGRESS msg;
148  msg.value = value;
149  return PwuSendMsg(api, id, (void*)&msg);
150 }
151 
152 /**************************************/
153 PWP_BOOL
154 PwuProgressBegin (const char api[], PWP_UINT32 totalSteps)
155 {
156  //For Message id msg.value = return
157  //-------------------- ---------------- ---------------------
158  //PWP_MSGID_PROGBEGIN total steps >0 if op can continue
159  return PwuSendProgressMsg (api, PWP_MSGID_PROGBEGIN, totalSteps)
160  ? PWP_TRUE : PWP_FALSE;
161 }
162 
163 /**************************************/
164 void
165 PwuProgressEnd (const char api[], PWP_BOOL ok)
166 {
167  //For Message id msg.value = return
168  //-------------------- ---------------- ---------------------
169  //PWP_MSGID_PROGEND 0=fail/>0=ok nothing
170  PwuSendProgressMsg (api, PWP_MSGID_PROGEND, (ok ? 1 : 0));
171 }
172 
173 /**************************************/
174 PWP_BOOL
175 PwuProgressStatus (const char api[], PWP_UINT32 complete, PWP_UINT32 total)
176 {
177  //For Message id msg.value = return
178  //-------------------- ---------------- ---------------------
179  //PWP_MSGID_PROGSTATUS 0-100 >0 if op can continue
180  PWP_UINT32 percent = 100;
181  if ((0 != total) && (complete < total)) {
182  percent = (PWP_UINT32)((PWP_FLOAT)100 * (PWP_FLOAT)complete
183  / (PWP_FLOAT)total);
184  }
185  return PwuSendProgressMsg (api, PWP_MSGID_PROGSTATUS, percent)
186  ? PWP_TRUE : PWP_FALSE;
187 }
188 
189 /**************************************/
190 PWP_BOOL
191 PwuProgressNextStep (const char api[])
192 {
193  //For Message id msg.value = return
194  //-------------------- ---------------- ---------------------
195  //PWP_MSGID_PROGSTATUS -1 >0 if op can continue
197  ? PWP_TRUE : PWP_FALSE;
198 }
199 
200 /**************************************/
201 PWP_BOOL
202 PwuProgressQuit (const char api[])
203 {
204  //For Message id msg.value = return
205  //-------------------- ---------------- ---------------------
206  //PWP_MSGID_PROGQUIT not used >0 if op canceled
207  return PwuSendProgressMsg (api, PWP_MSGID_PROGQUIT, 0)
208  ? PWP_TRUE : PWP_FALSE;
209 }
210 
211 
212 //***********************************************************************
213 //***********************************************************************
214 // Endian Data I/O helper functions
215 //***********************************************************************
216 //***********************************************************************
217 
218 /**************************************/
221 {
222  union endian_test_t {
223  PWP_UINT32 uint;
224  unsigned char ch[sizeof(PWP_UINT32)];
225  }
226  const etest = { 0xAABBCCDD };
227  return (0xAA == etest.ch[0]) ? PWP_ENDIAN_BIG : PWP_ENDIAN_LITTLE;
228 }
229 
230 
231 const void*
232 PwuApplyEndianness(PWP_ENDIANNESS endianness, const void *buf, size_t size)
233 {
234 # define ENDIAN_MAXSIZE 32
235  const void *ret = 0;
236  // buf size must be 1 or even
237  if (0 == buf) {
238  // bad
239  }
240  else if (1 == size) {
241  ret = buf; // just write the byte
242  }
243  else if (!(size & 0x1) && (ENDIAN_MAXSIZE >= size)) {
244  PWP_ENDIANNESS osEndianness = PwuGetOsEndianness();
245  switch (endianness) {
246  case PWP_ENDIAN_LITTLE:
247  case PWP_ENDIAN_BIG:
248  if (osEndianness == endianness) {
249  // no need to do swap
250  ret = buf;
251  break;
252  }
253  // drop through
254 
255  case PWP_ENDIAN_FOREIGN: {
256  // must swap data order
257  static unsigned char tmpBuf[ENDIAN_MAXSIZE];
258  const char *cbuf = (const char *)buf;
259  size_t hNdx = 0;
260  size_t tNdx = size-1;
261  while (hNdx < tNdx) {
262  tmpBuf[hNdx] = cbuf[tNdx];
263  tmpBuf[tNdx--] = cbuf[hNdx++];
264  }
265  // ret only valid until next call to PwuApplyEndianness()
266  ret = tmpBuf;
267  break; }
268 
269  case PWP_ENDIAN_NATIVE:
270  // no need to do swap
271  ret = buf;
272  break;
273 
274  case PWP_ENDIAN_ERROR:
275  default:
276  // huh?
277  break;
278  }
279  }
280  return ret;
281 # undef ENDIAN_MAXSIZE
282 }
283 
284 
285 //***********************************************************************
286 //***********************************************************************
287 // unformatted file I/O helper functions
288 //***********************************************************************
289 //***********************************************************************
290 
291 #define STAT_MASK ((PWP_UINT32)(0xFFFFFFF0))
292 #define STAT_BASE ((PWP_UINT32)(0x9ABCDEF0))
293 #define STAT_OPEN ((PWP_UINT32)(STAT_BASE | 0x1))
294 #define STAT_CLOSED ((PWP_UINT32)(STAT_BASE | 0x0))
295 
296 #define UDATA_ISINIT(pUD) (STAT_BASE == (STAT_MASK & (pUD)->status))
297 #define UDATA_ISOPEN(pUD) ((pUD) && (STAT_OPEN == (pUD)->status) && (pUD)->fp && !(pUD)->hadError)
298 #define UDATA_INREC(pUD) (UDATA_ISOPEN(pUD) && (pUD)->inRec)
299 #define UDATA_ISCLOSED(pUD) ((pUD) && (STAT_CLOSED == (pUD)->status))
300 
301 
302 /*------------------------------------*/
303 static PWP_BOOL
305 {
306  if (pUData) {
307  memset(pUData, 0, sizeof(PWU_UNFDATA));
308  pUData->status = STAT_OPEN;
309  pUData->endianness = PWP_ENDIAN_NATIVE;
310  }
311  return pUData ? PWP_TRUE : PWP_FALSE;
312 }
313 
314 /*------------------------------------*/
315 static PWP_BOOL
317 {
318  PWP_BOOL ret = PWP_FALSE;
319  if (UDATA_INREC(pUData)) {
320  const void *p = PwuApplyEndianness(pUData->endianness,
321  &(pUData->recBytes), sizeof(pUData->recBytes));
322  size_t cnt = pwpFileWrite(p, sizeof(pUData->recBytes), 1, pUData->fp);
323  if (1 == cnt) {
324  ret = PWP_TRUE;
325  }
326  if (!ret) {
327  pUData->hadError = PWP_TRUE;
328  }
329  }
330  return ret;
331 }
332 
333 
334 /***************************************************************************/
335 /***************************************************************************/
336 /* UNFORMATTED FORTRAN FILE UTILS */
337 /***************************************************************************/
338 /***************************************************************************/
339 
340 /**************************************/
343 {
345  if (UDATA_ISOPEN(pUData) && (PWP_ENDIAN_ERROR != endianness)) {
346  ret = pUData->endianness;
347  pUData->endianness = endianness;
348  }
349  return ret;
350 }
351 
352 /**************************************/
355 {
356  return pUData ? pUData->endianness : PWP_ENDIAN_ERROR;
357 }
358 
359 /**************************************/
360 PWP_BOOL
361 PwuUnfFileBegin(FILE *fp, PWU_UNFDATA *pUData)
362 {
363  PWP_BOOL ret = PWP_FALSE;
364  if (unfUDataInit(pUData) && fp) {
365  pUData->fp = fp;
366  ret = PWP_TRUE;
367  }
368  return ret;
369 }
370 
371 /**************************************/
372 PWP_BOOL
374 {
375  PWP_BOOL ret = PWP_FALSE;
376  if (0 == pUData) {
377  // fail
378  }
379  else if (!UDATA_INREC(pUData)) {
380  // silently ignore
381  ret = PWP_TRUE;
382  }
383  else {
384  if (!unfHdrLenWrite(pUData)) {
385  // could not write rec len value to footer
386  }
387  else if (0 == pUData->fixedBytes) {
388  // Not a fixed length record
389  sysFILEPOS fPosSave;
390  if (pwpFileGetpos(pUData->fp, &fPosSave)) {
391  // could not save current file pos
392  }
393  else if (pwpFileSetpos(pUData->fp, &(pUData->fPos))) {
394  // could not move pos to saved rec header location
395  }
396  else if (!unfHdrLenWrite(pUData)) {
397  // could not write rec len value to header
398  }
399  else if (0 == pwpFileSetpos(pUData->fp, &fPosSave)) {
400  // file pos restored to saved location
401  ret = PWP_TRUE;
402  }
403  }
404  else if (pUData->fixedBytes == pUData->recBytes) {
405  // The fixed length record bytes match the actual bytes written!
406  ret = PWP_TRUE;
407  }
408 
409  if (ret) {
410  // update running totals
411  pUData->totRecBytes += pUData->recBytes;
412  ++pUData->recCnt;
413  }
414  else {
415  pUData->hadError = PWP_TRUE;
416  }
417 
418  // clear for next rec
419  pUData->inRec = PWP_FALSE;
420  }
421 
422  // Do NOT reset pUData->recBytes here so that PwuUnfRecBytes() has access to
423  // this record's byte count.
424 
425  return ret;
426 }
427 
428 /**************************************/
429 PWP_BOOL
431 {
432  PWP_BOOL ret = PWP_FALSE;
433  if (UDATA_ISOPEN(pUData)) {
434  // auto-close rec (if any)
435  PwuUnfRecEnd(pUData);
436  // PwuUnfRecEnd() does NOT reset recBytes.
437  // We do not know the fixed record size.
438  pUData->recBytes = pUData->fixedBytes = 0;
439  // save current file pos. will write the final rec length later
440  if (0 == pwpFileGetpos (pUData->fp, &(pUData->fPos))) {
441  // must be true for call to unfHdrLenWrite()
442  pUData->inRec = PWP_TRUE;
443  // write dummy value... will set final value in PwuUnfRecEnd()
444  ret = pUData->inRec = unfHdrLenWrite(pUData);
445  }
446  if (!ret) {
447  pUData->hadError = PWP_TRUE;
448  }
449  }
450  return ret;
451 }
452 
453 /**************************************/
454 PWP_BOOL
456 {
457  PWP_BOOL ret = PWP_FALSE;
458  if (UDATA_ISOPEN(pUData)) {
459  // auto-close rec (if any)
460  PwuUnfRecEnd(pUData);
461  // set recBytes for unfHdrLenWrite()
462  // Caller provided the known (fixed) record size!
463  pUData->recBytes = pUData->fixedBytes = bytes * count;
464  // must be true for call to unfHdrLenWrite()
465  pUData->inRec = PWP_TRUE;
466  // write known recBytes value...
467  ret = pUData->inRec = unfHdrLenWrite(pUData);
468  // set recBytes back to zero to track actual bytes written
469  pUData->recBytes = 0;
470  if (!ret) {
471  pUData->hadError = PWP_TRUE;
472  }
473  }
474  return ret;
475 }
476 
477 /**************************************/
478 PWP_BOOL
479 PwuUnfRecWriteArr(PWU_UNFDATA *pUData, const void *arr, size_t itemSize,
480  size_t itemCnt)
481 {
482  PWP_BOOL ret = PWP_FALSE;
483  if (UDATA_INREC(pUData)) {
484  if (itemCnt == pwpFileWrite(arr, itemSize, itemCnt, pUData->fp)) {
485  pUData->recBytes += (PWP_UINT32)(itemCnt * itemSize);
486  ret = PWP_TRUE;
487  }
488  }
489  if (!ret) {
490  pUData->hadError = PWP_TRUE;
491  }
492  return ret;
493 }
494 
495 /**************************************/
496 PWP_BOOL
497 PwuUnfRecWriteBuf(PWU_UNFDATA *pUData, const void *buf, size_t size)
498 {
499  return PwuUnfRecWriteArr(pUData, buf, size, 1);
500 }
501 
502 /**************************************/
503 PWP_BOOL
504 PwuUnfRecWriteEndianBuf(PWU_UNFDATA *pUData, const void *buf, size_t size)
505 {
506  const void *p = PwuApplyEndianness(pUData->endianness, buf, size);
507  return PwuUnfRecWriteArr(pUData, p, size, 1);
508 }
509 
510 /**************************************/
511 PWP_BOOL
513 {
514  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
515 }
516 
517 /**************************************/
518 PWP_BOOL
520 {
521  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
522 }
523 
524 /**************************************/
525 PWP_BOOL
527 {
528  return PwuUnfRecWriteBuf(pUData, &val, sizeof(val));
529 }
530 
531 /**************************************/
532 PWP_BOOL
534 {
535  return PwuUnfRecWriteBuf(pUData, &val, sizeof(val));
536 }
537 
538 /**************************************/
539 PWP_BOOL
541 {
542  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
543 }
544 
545 /**************************************/
546 PWP_BOOL
548 {
549  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
550 }
551 
552 /**************************************/
553 PWP_BOOL
555 {
556  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
557 }
558 
559 /**************************************/
560 PWP_BOOL
562 {
563  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
564 }
565 
566 /**************************************/
567 PWP_BOOL
569 {
570  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
571 }
572 
573 /**************************************/
574 PWP_BOOL
576 {
577  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
578 }
579 
580 /**************************************/
581 PWP_BOOL
583 {
584  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
585 }
586 
587 /**************************************/
588 PWP_BOOL
590 {
591  return PwuUnfRecWriteEndianBuf(pUData, &val, sizeof(val));
592 }
593 
594 /**************************************/
595 PWP_BOOL
597 {
598  PWP_BOOL ret = PWP_FALSE;
599  if (pUData) {
600  // make sure rec is closed
601  PwuUnfRecEnd(pUData);
602  pUData->fp = 0;
603  pUData->status = STAT_CLOSED;
604  ret = !pUData->hadError;
605  }
606  return ret;
607 }
608 
609 /**************************************/
610 PWP_BOOL
612 {
613  return UDATA_ISINIT(pUData) && pUData->hadError;
614 }
615 
616 /**************************************/
619 {
620  return UDATA_ISINIT(pUData) ? pUData->recBytes : 0;
621 }
622 
623 /**************************************/
626 {
627  return UDATA_ISINIT(pUData) ? pUData->totRecBytes : 0;
628 }
629 
630 /**************************************/
633 {
634  return UDATA_ISINIT(pUData) ? pUData->recCnt : 0;
635 }
636 
637 
638 /***************************************************************************/
639 /***************************************************************************/
640 /***************************************************************************/
641 /***************************************************************************/
642 /***************************************************************************/
643 
644 
645 /***************************************************************************/
646 static const char *
648 {
649  const char *ret = "Unknown";
650  switch(type) {
651  case PWP_VALTYPE_STRING: ret = "String"; break;
652  case PWP_VALTYPE_INT: ret = "Int"; break;
653  case PWP_VALTYPE_UINT: ret = "UInt"; break;
654  case PWP_VALTYPE_REAL: ret = "Real"; break;
655  case PWP_VALTYPE_ENUM: ret = "Enum"; break;
656  case PWP_VALTYPE_BOOL: ret = "Bool"; break;
657  case PWP_VALTYPE_SIZE: break; // silence compiler warning
658  }
659  return ret;
660 }
661 
662 
663 /***************************************************************************/
665 
666  typedef std::map<PwuString, PwuString> NameStrMap;
667  typedef std::pair<NameStrMap::iterator, bool> NameStrMapInsertRet;
668 
669 public:
671  data_()
672  {
673  }
675  {
676  }
677 
678  void set(const PwuString &name, const PwuString &value) {
679  NameStrMap::iterator it = data_.find(name);
680  if (data_.end() != it) {
681  // set existing value
682  it->second = value;
683  }
684  else {
685  // set new value
686  data_.insert(NameStrMap::value_type(name, value));
687  }
688  }
689 
690  PwuString &
691  get(const PwuString &name, PwuString &value, const PwuString &defVal,
692  bool &isDefVal) {
693  NameStrMap::const_iterator it = data_.find(name);
694  if (data_.end() != it) {
695  value = it->second; // return existing value
696  isDefVal = false;
697  }
698  else {
699  value = defVal; // return default value
700  isDefVal = true;
701  }
702  return value;
703  }
704 
705  PwuString &
706  operator[](const PwuString &name) {
707  return data_[name];
708  }
709 
710  void erase(const PwuString &name) {
711  NameStrMap::iterator it = data_.find(name);
712  if (data_.end() != it) {
713  // found it - erase it
714  data_.erase(it);
715  }
716  // else not found - silently ignore
717  }
718 
719  bool exists(const PwuString &name) {
720  return (data_.end() != data_.find(name));
721  }
722 
723 protected:
725 };
726 
728 
729 
730 /**************************************/
731 PwuString
732 PwuJoin(const PwuString &j1, const PwuString &j2, char sepChar = '.')
733 {
734  PwuString res;
735  if (j1.empty()) {
736  res = j2;
737  }
738  else if (j2.empty()) {
739  res = j1;
740  }
741  else { // both j1 and j2 are NOT empty
742  bool j1EndsWithDot = (sepChar == j1[j1.size() - 1]);
743  bool j2StartsWithDot = (sepChar == j2[0]);
744  res = j1;
745  if (j1EndsWithDot && j2StartsWithDot) {
746  // j1. += [.]j2
747  res.append(j2.begin() + 1, j2.end());
748  }
749  else if (j1EndsWithDot) {
750  res.append(j2); // j1. += j2
751  }
752  else if (j2StartsWithDot) {
753  res.append(j2); // j1 += .j2
754  }
755  else {
756  res.append(1, sepChar); // j1 += .
757  res.append(j2); // j1 += j2
758  }
759  }
760  return res;
761 }
762 
763 /**************************************/
764 PwuString
765 PwuJoin(const PwuString &j1, const PwuString &j2, const PwuString &j3,
766  char sepChar = '.')
767 {
768  return PwuJoin(PwuJoin(j1, j2), j3, sepChar);
769 }
770 
771 /**************************************/
772 PwuString
773 PwuJoin(const PwuString &j1, const PwuString &j2, const PwuString &j3,
774  const PwuString &j4, char sepChar = '.')
775 {
776  return PwuJoin(PwuJoin(j1, j2), PwuJoin(j3, j4), sepChar);
777 }
778 
779 /**************************************/
780 static PwuString
781 PwuValueNamesGroup(const PwuString &rootGroup)
782 {
783  // <rootGroup>.ValNames
784  return PwuJoin(rootGroup, PWU_PUBLISH_NAMES_STR, '.');
785 }
786 
787 /**************************************/
788 static PwuString
789 PwuValueDefnsGroup(const PwuString &rootGroup)
790 {
791  // <rootGroup>.ValDefs
792  return PwuJoin(rootGroup, PWU_PUBLISH_DEFNS_STR, '.');
793 }
794 
795 /**************************************/
796 static PwuString
797 PwuValueDefnAttrGroup(const PwuString &rootGroup, const PwuString &valName)
798 {
799  // <rootGroup>.ValDefs.<valName>
800  return PwuJoin(PwuValueDefnsGroup(rootGroup), valName, '.');
801 }
802 
803 /**************************************/
804 static PwuString
805 PwuValueDefnNameKey(const PwuString &rootGroup, const PwuString &valName)
806 {
807  // <rootGroup>.ValDefs.<valName>.<PWU_VALUE_DEFN_TYPE_STR>
808  return PwuJoin(PwuValueDefnAttrGroup(rootGroup, valName),
810 }
811 
812 /**************************************/
813 static PwuString
814 PwuValueDefnTypeKey(const PwuString &rootGroup, const PwuString &valName)
815 {
816  // <rootGroup>.ValDefs.<valName>.<PWU_VALUE_DEFN_TYPE_STR>
817  return PwuJoin(PwuValueDefnAttrGroup(rootGroup, valName),
819 }
820 
821 /**************************************/
822 static PwuString
823 PwuValueDefnAccessKey(const PwuString &rootGroup, const PwuString &valName)
824 {
825  // <rootGroup>.ValDefs.<valName>.<PWU_VALUE_DEFN_ACCESS_STR>
826  return PwuJoin(PwuValueDefnAttrGroup(rootGroup, valName),
828 }
829 
830 /**************************************/
831 static PwuString
832 PwuValueDefnDescKey(const PwuString &rootGroup, const PwuString &valName)
833 {
834  // <rootGroup>.ValDefs.<valName>.<PWU_VALUE_DEFN_DESC_STR>
835  return PwuJoin(PwuValueDefnAttrGroup(rootGroup, valName),
837 }
838 
839 /**************************************/
840 static PwuString
841 PwuValueDefnDefaultKey(const PwuString &rootGroup, const PwuString &valName)
842 {
843  // <rootGroup>.ValDefs.<valName>.<PWU_VALUE_DEFN_DEFAULT_STR>
844  return PwuJoin(PwuValueDefnAttrGroup(rootGroup, valName),
846 }
847 
848 /**************************************/
849 static PwuString
850 PwuValueDefnRangeKey(const PwuString &rootGroup, const PwuString &valName)
851 {
852  // <rootGroup>.ValDefs.<valName>.<PWU_VALUE_DEFN_RANGE_STR>
853  return PwuJoin(PwuValueDefnAttrGroup(rootGroup, valName),
855 }
856 
857 /**************************************/
858 PWP_BOOL PwuAssignValue(const char group[], const char name[],
859  const char value[], bool createIfNotExists)
860 {
861  PWP_BOOL ret = PWP_FALSE;
862  if (group && group[0] && name && name[0]) {
863  PwuString key = PwuJoin(group, name);
864  if (0 == value) {
865  namedStrings.erase(key); // delete name/value pair!
866  ret = PWP_TRUE;
867  }
868  else if (createIfNotExists || namedStrings.exists(key)) {
869  namedStrings[key] = value;
870  ret = PWP_TRUE;
871  }
872  }
873  return ret;
874 }
875 
876 /**************************************/
877 PWP_BOOL PwuAssignValueInt(const char group[], const char name[],
878  PWP_INT value, bool createIfNotExists)
879 {
880  std::ostringstream buf;
881  buf << value << std::ends;
882  return PwuAssignValue(group, name, buf.str().c_str(), createIfNotExists);
883 }
884 
885 /**************************************/
886 PWP_BOOL PwuAssignValueUInt(const char group[], const char name[],
887  PWP_UINT value, bool createIfNotExists)
888 {
889  std::ostringstream buf;
890  buf << value << std::ends;
891  return PwuAssignValue(group, name, buf.str().c_str(), createIfNotExists);
892 }
893 
894 /**************************************/
895 PWP_BOOL PwuAssignValueReal(const char group[], const char name[],
896  PWP_REAL value, bool createIfNotExists)
897 {
898  std::ostringstream buf;
899  buf << value << std::ends;
900  return PwuAssignValue(group, name, buf.str().c_str(), createIfNotExists);
901 }
902 
903 /**************************************/
904 PWP_BOOL PwuAssignValueEnum(const char group[], const char name[],
905  const char value[], bool createIfNotExists)
906 {
907  return PwuAssignValue(group, name, value, createIfNotExists);
908 }
909 
910 /**************************************/
911 PWP_BOOL PwuPublishValueDefinition(const char group[], const char name[],
912  PWP_ENUM_VALTYPE type, const char value[], const char access[],
913  const char desc[], const char range[])
914 {
915  // value definition attributes value
916  // ---------------------------------- ---------
917  // <group>.ValNames += |<name>
918  // <group>.ValDefs.<name>.type <type>
919  // <group>.ValDefs.<name>.access <access>
920  // <group>.ValDefs.<name>.description <desc>
921  // <group>.ValDefs.<name>.default <value>
922  // <group>.ValDefs.<name>.range <range>
923  //
924  PWP_BOOL ret = PWP_FALSE;
925  if (group && group[0] && name && name[0]) {
926  PwuString varDefKeyName = PwuValueDefnNameKey(group, name);
927 
928  // Check if "<group>.ValDefs.<name>.type" exists
929  if (!namedStrings.exists(varDefKeyName)) {
930  // name is a new name
931  PwuString &varNames = namedStrings[PwuValueNamesGroup(group)];
932  // Append name to the string ref'ed by varNames
933  varNames = PwuJoin(varNames, name, '|');
934  }
935 
936  PwuString varDefKeyType = PwuValueDefnTypeKey(group, name);
937  PwuString varDefKeyAccess = PwuValueDefnAccessKey(group, name);
938  PwuString varDefKeyDesc = PwuValueDefnDescKey(group, name);
939  PwuString varDefKeyDefault = PwuValueDefnDefaultKey(group, name);
940  PwuString varDefKeyRange = PwuValueDefnRangeKey(group, name);
941 
942  namedStrings[varDefKeyName] = name;
943  namedStrings[varDefKeyType] = typeToString(type);
944  namedStrings[varDefKeyAccess] = access;
945  namedStrings[varDefKeyDesc] = desc;
946  namedStrings[varDefKeyDefault] = value;
947  namedStrings[varDefKeyRange] = range;
948  ret = PWP_TRUE;
949  }
950  return ret;
951 }
952 
953 /**************************************/
954 PWP_BOOL
955 PwuGetValue(const char group[], const char name[], PWP_HVALUE hVal)
956 {
957  bool isDefault;
958  PwuString str;
959  namedStrings.get(PwuJoin(group, name), str, "", isDefault);
960  if (!isDefault) {
961  PwuValueSetString(hVal, str.c_str());
962  }
963  return PWP_CAST_BOOL(!isDefault);
964 }
965 
966 /**************************************/
967 template<typename T, PWP_ENUM_VALTYPE TId>
968 static PWP_BOOL
969 PwuValueSetter(PWP_HVALUE hVal, T * val)
970 {
971  PWP_BOOL ret = PWP_FALSE;
972  PWP_HVALUE_IMPL *impl = PWP_HVALUE_GET_IMPL(hVal);
973  if (val && impl && impl->PwpValueCB_(impl->dest_, TId, val, 0)) {
974  ret = PWP_TRUE;
975  }
976  return ret;
977 }
978 
979 /**************************************/
980 PWP_BOOL
981 PwuValueSetString(PWP_HVALUE hVal, const char *val)
982 {
983  return PwuValueSetter<const char, PWP_VALTYPE_STRING>(hVal, val);
984 }
985 
986 /**************************************/
987 PWP_BOOL
988 PwuValueSetInt(PWP_HVALUE hVal, PWP_INT val)
989 {
990  return PwuValueSetter<PWP_INT, PWP_VALTYPE_INT>(hVal, &val);
991 }
992 
993 /**************************************/
994 PWP_BOOL
995 PwuValueSetUInt(PWP_HVALUE hVal, PWP_UINT val)
996 {
997  return PwuValueSetter<PWP_UINT, PWP_VALTYPE_UINT>(hVal, &val);
998 }
999 
1000 /**************************************/
1001 PWP_BOOL
1002 PwuValueSetReal(PWP_HVALUE hVal, PWP_REAL val)
1003 {
1004  return PwuValueSetter<PWP_REAL, PWP_VALTYPE_REAL>(hVal, &val);
1005 }
1006 
1007 /**************************************/
1008 PWP_BOOL
1009 PwuValueSetEnum(PWP_HVALUE hVal, const char *val)
1010 {
1011  return PwuValueSetter<const char, PWP_VALTYPE_ENUM>(hVal, val);
1012 }
1013 
1014 /**************************************/
1015 PWP_BOOL
1016 PwuValueSetBool(PWP_HVALUE hVal, PWP_BOOL val)
1017 {
1018  return PwuValueSetter<PWP_BOOL, PWP_VALTYPE_BOOL>(hVal, &val);
1019 }
#define PWP_MESSAGECB_DEFAULT
Special API name used to register the default message handler.
Definition: apiPWP.h:484
#define UDATA_ISOPEN(pUD)
The data sent by plugins for progress messages.
Definition: apiPWP.h:528
static NamedStrings namedStrings
unsigned char PWP_UINT8
8-bit unsigned integer
Definition: apiPWP.h:170
PWP_BOOL PwuUnfRecBeginFixed(PWU_UNFDATA *pUData, PWP_UINT32 bytes, PWP_UINT32 count)
Prepares a PWU_UNFDATA block for writing a new unformatted data record when the amount of data being ...
PWP_MESSAGECB msgCB
The API&#39;s assigned message callback.
Definition: apiPWPUtils.h:57
PWP_BOOL PwuValueSetReal(PWP_HVALUE hVal, PWP_REAL val)
PWP_UINT32 code
API defined message code.
Definition: apiPWP.h:557
PWP_UINT32 recCnt
of records written
Definition: apiPWPUtils.h:354
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:612
PWP_BOOL PwuUnfRecWriteUINT16(PWU_UNFDATA *pUData, PWP_UINT16 val)
Write a PWP_UINT16 value to the current record with endian order applied.
std::map< PwuString, PwuString > NameStrMap
static PwuString PwuValueNamesGroup(const PwuString &rootGroup)
transfer value is a PWP_REAL
Definition: apiPWP.h:616
unsigned long long PWP_UINT64
64-bit unsigned integer
Definition: apiPWP.h:206
static PWP_BOOL unfHdrLenWrite(PWU_UNFDATA *pUData)
static PwuString PwuValueDefnRangeKey(const PwuString &rootGroup, const PwuString &valName)
static PwuString PwuValueDefnDescKey(const PwuString &rootGroup, const PwuString &valName)
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:194
PWP_BOOL PwuValueSetUInt(PWP_HVALUE hVal, PWP_UINT val)
transfer value is a PWP_INT
Definition: apiPWP.h:614
#define UDATA_ISINIT(pUD)
Pointwise Plugin API (PWP-API)
PwpValue_t * PwpValueCB_
Callback function used to marshall a plugin value into dest_.
Definition: apiPWP.h:652
PWP_BOOL PwuPublishValueDefinition(const char group[], const char name[], PWP_ENUM_VALTYPE type, const char value[], const char access[], const char desc[], const char range[])
Create a value.
Information text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:427
PWP_BOOL PwuValueSetEnum(PWP_HVALUE hVal, const char *val)
PWP_UINT32(* PWP_MESSAGECB)(const char api[], PWP_ENUM_MSGID id, void *pMsg)
Message handler callback function signature.
Definition: apiPWP.h:471
unsigned long PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:158
void PwuSendInfoMsg(const char api[], const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
PWP_BOOL PwuValueSetInt(PWP_HVALUE hVal, PWP_INT val)
const char * text
API defined message string.
Definition: apiPWP.h:560
PWP_BOOL PwuAssignValueInt(const char group[], const char name[], PWP_INT value, bool createIfNotExists)
PWP_BOOL PwuUnfRecWriteBuf(PWU_UNFDATA *pUData, const void *buf, size_t size)
Write a data buffer to the current record.
PWP_BOOL inRec
"in record" flag
Definition: apiPWPUtils.h:351
PWP_BOOL PwuProgressBegin(const char api[], PWP_UINT32 totalSteps)
Send a progress begin message (PWP_MSGID_PROGBEGIN) to the framework.
#define STAT_OPEN
static PWP_BOOL PwuValueSetter(PWP_HVALUE hVal, T *val)
PWP_UINT32 PwuUnfRecBytes(PWU_UNFDATA *pUData)
Get the running total number of bytes written to the current record during an unformatted file I/O se...
PWP_ENDIANNESS PwuUnfFileSetEndianness(PWU_UNFDATA *pUData, PWP_ENDIANNESS endianness)
Set the output endianness.
PWP_BOOL hadError
error flag
Definition: apiPWPUtils.h:350
int pwpFileSetpos(FILE *fp, const sysFILEPOS *pos)
Set the current file position.
transfer value is a const char*
Definition: apiPWP.h:613
PWP_ENUM_MSGID
Supported PWP-API message ids.
Definition: apiPWP.h:420
Query progress quit message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:452
PWP_UINT32 PwuSendMsg(const char api[], PWP_ENUM_MSGID id, void *pMsg)
Send a message from an api.
Definition: apiPWPUtils.cxx:71
static const char * typeToString(PWP_ENUM_VALTYPE type)
Begin progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:440
static void PwuSendTextMsg(const char api[], PWP_ENUM_MSGID id, const char txt[], PWP_UINT32 code)
PWP_BOOL PwuUnfFileBegin(FILE *fp, PWU_UNFDATA *pUData)
Prepares a PWU_UNFDATA block for a new unformatted file I/O session.
PWP_BOOL PwuValueSetString(PWP_HVALUE hVal, const char *val)
Set the value of a variable handle.
PWP_UINT32 PwuUnfRecCount(PWU_UNFDATA *pUData)
Get the running total number of finalized records written during an unformatted file I/O session...
#define PWP_CAST_BOOL(v)
Cast a value to a PWP_BOOL value (PWP_TRUE or PWP_FALSE)
Definition: apiPWP.h:230
#define PWP_TRUE
PWP_BOOL logical "true" value.
Definition: apiPWP.h:227
PWP_BOOL PwuUnfRecWriteINT(PWU_UNFDATA *pUData, PWP_INT val)
Write a PWP_INT value to the current record with endian order applied.
static PWU_RTITEM * PwuFindAPI(const char api[], PWP_UINT32 cnt)
Definition: apiPWPUtils.cxx:25
#define UDATA_INREC(pUD)
PwuString & get(const PwuString &name, PwuString &value, const PwuString &defVal, bool &isDefVal)
PWP_BOOL PwuUnfFileEnd(PWU_UNFDATA *pUData)
Finalize an unformatted file I/O session.
static PWP_BOOL unfUDataInit(PWU_UNFDATA *pUData)
PWP_BOOL PwuProgressQuit(const char api[])
Send a progress query-quit message (PWP_MSGID_PROGQUIT) to the framework.
PWP_UINT32 totalApiCnt
The total # of published and unpublished entries in pwpRtItem[].
Definition: apiPWP.cxx:44
PWP_UINT32 value
The progress value.
Definition: apiPWP.h:546
fpos_t sysFILEPOS
File position data type.
Definition: pwpPlatform.h:53
PWP_BOOL PwuUnfRecWriteEndianBuf(PWU_UNFDATA *pUData, const void *buf, size_t size)
Write a data buffer to the current record with endian order applied.
PWP_BOOL PwuGetValue(const char group[], const char name[], PWP_HVALUE hVal)
Implementation of the PwpGetValue() API function.
PWU_RTITEM pwpRtItem[]
The runtime array of PWU_RTITEM items.
Definition: apiPWP.cxx:26
#define STAT_CLOSED
FILE * fp
file pointer
Definition: apiPWPUtils.h:348
float PWP_FLOAT
32-bit real
Definition: apiPWP.h:215
PWP_BOOL PwuAssignValue(const char group[], const char name[], const char value[], bool createIfNotExists)
PWP_BOOL PwuUnfRecWriteUINT(PWU_UNFDATA *pUData, PWP_UINT val)
Write a PWP_UINT value to the current record with endian order applied.
const void * PwuApplyEndianness(PWP_ENDIANNESS endianness, const void *buf, size_t size)
Apply specified byte order to buf containing size bytes.
static PwuString PwuValueDefnsGroup(const PwuString &rootGroup)
PWP_BOOL PwuValueSetBool(PWP_HVALUE hVal, PWP_BOOL val)
Debug text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:423
#define PWU_VALUE_DEFN_ACCESS_STR
Definition: apiPWP.h:994
unsigned short PWP_UINT16
16-bit unsigned integer
Definition: apiPWP.h:182
PWP_MESSAGECB PwuFindApiMsgCB(const char api[])
Search pwpRtItem[] for an API&#39;s messageCB.
Definition: apiPWPUtils.cxx:56
static PwuString PwuValueDefnAccessKey(const PwuString &rootGroup, const PwuString &valName)
Unformatted file data block.
Definition: apiPWPUtils.h:346
End progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:444
PWP_BOOL PwuUnfRecWriteArr(PWU_UNFDATA *pUData, const void *arr, size_t itemSize, size_t itemCnt)
Write an array of data to the current record.
PWP_UINT32 PwuUnfTotRecBytes(PWU_UNFDATA *pUData)
Get the running total number of bytes written to all records during an unformatted file I/O session...
PWP_UINT32 fixedBytes
user provided # record bytes
Definition: apiPWPUtils.h:356
PWP_BOOL PwuUnfRecWriteREAL(PWU_UNFDATA *pUData, PWP_REAL val)
Write a PWP_REAL value to the current record with endian order applied.
PWP_BOOL PwuUnfHadError(PWU_UNFDATA *pUData)
Check if an unformatted file I/O session has detected any errors.
transfer value is a PWP_BOOL
Definition: apiPWP.h:618
PWP_BOOL PwuUnfRecWriteINT32(PWU_UNFDATA *pUData, PWP_INT32 val)
Write a PWP_INT32 value to the current record with endian order applied.
Status progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:448
PWP_UINT32 recBytes
bytes written to current record
Definition: apiPWPUtils.h:352
PWP_BOOL PwuAssignValueEnum(const char group[], const char name[], const char value[], bool createIfNotExists)
sysFILEPOS fPos
file position value
Definition: apiPWPUtils.h:349
void PwuSendWarningMsg(const char api[], const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
static PWP_UINT32 PwuSendProgressMsg(const char api[], PWP_ENUM_MSGID id, PWP_UINT32 value)
PWP_BOOL PwuUnfRecWriteUINT32(PWU_UNFDATA *pUData, PWP_UINT32 val)
Write a PWP_UINT32 value to the current record with endian order applied.
short PWP_INT16
16-bit integer
Definition: apiPWP.h:179
PwuString PwuJoin(const PwuString &j1, const PwuString &j2, char sepChar='.')
PWP_BOOL PwuUnfRecEnd(PWU_UNFDATA *pUData)
Finalize the current record write.
signed char PWP_INT8
8-bit integer
Definition: apiPWP.h:167
Non-fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:431
void * dest_
Pointer to the opaque value destination.
Definition: apiPWP.h:649
int PWP_BOOL
logical value
Definition: apiPWP.h:221
long long PWP_INT64
64-bit integer
Definition: apiPWP.h:203
int pwpFileGetpos(FILE *fp, sysFILEPOS *pos)
Query the current file position.
PWP_UINT32 publishedApiCnt
The total # of published entries in pwpRtItem[].
Definition: apiPWP.cxx:45
PWP_BOOL PwuUnfRecWriteINT16(PWU_UNFDATA *pUData, PWP_INT16 val)
Write a PWP_INT16 value to the current record with endian order applied.
transfer value is a PWP_UINT
Definition: apiPWP.h:615
NameStrMap data_
void PwuSendDebugMsg(const char api[], const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
transfer value is a const char*
Definition: apiPWP.h:617
#define PWU_PUBLISH_DEFNS_STR
Definition: apiPWP.h:990
PWP_UINT32 totRecBytes
total # bytes written to all records
Definition: apiPWPUtils.h:353
The runtime data representing a PWP-API suported by a plugin.
Definition: apiPWPUtils.h:44
void erase(const PwuString &name)
void PwuSendErrorMsg(const char api[], const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
long PWP_INT
integer same size as void*
Definition: apiPWP.h:155
#define PWP_HVALUE_GET_IMPL(h)
obtains the underlying PWP_HVALUE_IMPL ptr from the handle
Definition: apiPWP.h:378
size_t pwpFileWrite(const void *buf, size_t size, size_t count, FILE *fp)
Write an collection of data items to a file.
Fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:435
#define ENDIAN_MAXSIZE
#define PWU_VALUE_DEFN_RANGE_STR
Definition: apiPWP.h:997
#define PWU_VALUE_DEFN_NAME_STR
Definition: apiPWP.h:992
std::pair< NameStrMap::iterator, bool > NameStrMapInsertRet
PWP_ENDIANNESS endianness
write data using this endianness
Definition: apiPWPUtils.h:355
#define PWU_VALUE_DEFN_DESC_STR
Definition: apiPWP.h:995
std::string PwuString
Definition: apiPWPUtils.cxx:20
PWP_BOOL PwuAssignValueReal(const char group[], const char name[], PWP_REAL value, bool createIfNotExists)
#define PWU_VALUE_DEFN_TYPE_STR
Definition: apiPWP.h:993
#define PWP_MESSAGECB_SPY
Special API name used to register the spy message handler.
Definition: apiPWP.h:497
PWP_BOOL PwuAssignValueUInt(const char group[], const char name[], PWP_UINT value, bool createIfNotExists)
PWU_RTITEM * PwuFindPublishedAPI(const char api[])
Find a published api in pwpRtItem[].
Definition: apiPWPUtils.cxx:49
void PwuProgressEnd(const char api[], PWP_BOOL ok)
Send a progress end message (PWP_MSGID_PROGEND) to the framework.
PWP_BOOL PwuUnfRecBegin(PWU_UNFDATA *pUData)
Prepares a PWU_UNFDATA block for writing a new unformatted data record.
PWP_BOOL PwuUnfRecWriteUINT64(PWU_UNFDATA *pUData, PWP_UINT64 val)
Write a PWP_UINT64 value to the current record with endian order applied.
PWP_ENDIANNESS PwuUnfFileGetEndianness(PWU_UNFDATA *pUData)
Get the output endianness setting for this PWU_UNFDATA block.
PWP_BOOL PwuUnfRecWriteFLOAT(PWU_UNFDATA *pUData, PWP_FLOAT val)
Write a PWP_FLOAT value to the current record with endian order applied.
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:738
bool exists(const PwuString &name)
static PwuString PwuValueDefnNameKey(const PwuString &rootGroup, const PwuString &valName)
PWP_UINT32 status
current file status
Definition: apiPWPUtils.h:347
static PwuString PwuValueDefnTypeKey(const PwuString &rootGroup, const PwuString &valName)
static PwuString PwuValueDefnAttrGroup(const PwuString &rootGroup, const PwuString &valName)
static PwuString PwuValueDefnDefaultKey(const PwuString &rootGroup, const PwuString &valName)
The data sent by plugins for text messages.
Definition: apiPWP.h:554
PWP_BOOL PwuProgressStatus(const char api[], PWP_UINT32 complete, PWP_UINT32 total)
Send a progress status message (PWP_MSGID_PROGSTATUS, value >= 0) to the framework.
PWP_ENDIANNESS PwuGetOsEndianness(void)
Query the OS&#39;s native endianness.
PWP_BOOL PwuUnfRecWriteUINT8(PWU_UNFDATA *pUData, PWP_UINT8 val)
Write a PWP_UINT8 value to the current record with endian order applied.
PWP_BOOL PwuProgressNextStep(const char api[])
Send a progress "next step" message (PWP_MSGID_PROGSTATUS, value = -1) to the framework.
#define PWU_VALUE_DEFN_DEFAULT_STR
Definition: apiPWP.h:996
PWP_BOOL PwuUnfRecWriteINT8(PWU_UNFDATA *pUData, PWP_INT8 val)
Write a PWP_INT8 value to the current record with endian order applied.
#define PWU_PUBLISH_NAMES_STR
Definition: apiPWP.h:989
double PWP_REAL
64-bit real
Definition: apiPWP.h:218
PwuString & operator[](const PwuString &name)
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:224
PWP_BOOL PwuUnfRecWriteINT64(PWU_UNFDATA *pUData, PWP_INT64 val)
Write a PWP_INT64 value to the current record with endian order applied.
int PWP_INT32
32-bit integer
Definition: apiPWP.h:191
PWU_RTITEM * PwuFindTotalAPI(const char api[])
Find any api in pwpRtItem[].
Definition: apiPWPUtils.cxx:42
Data and functions useful to PWP-API compliant plugins.