Pointwise Plugin SDK
apiPWP.h
Go to the documentation of this file.
1 #ifndef _APIPWP_H_
2 #define _APIPWP_H_
3 /****************************************************************************
4  *
5  * Pointwise Plugin API (PWP-API) v1.0
6  *
7  * Proprietary software product of Pointwise, Inc.
8  * Copyright (c) 1995-2020 Pointwise, Inc.
9  * All rights reserved.
10  *
11  ***************************************************************************/
12 
25 //*********************************************
26 // platform-dependent export defines
27 //*********************************************
28 #if defined(WINDOWS)
29 # define winmsgSTRING2(ss) #ss
30 # define winmsgSTRING(ss) winmsgSTRING2(ss)
31 # define PW_DLLEXPORT __declspec(dllexport)
32 # define PW_DLLIMPORT __declspec(dllimport)
33 #else
34 # define PW_DLLEXPORT
35 # define PW_DLLIMPORT
36 #endif /* WINDOWS */
37 
38 #undef PWP_PROTOTYPE_DECL
39 
40 #ifdef BUILD_PWPLUGIN_DYNLIB
41 
42 #include "apiUtils.h"
43 
44 // Building a plugin dyn lib module.
45 // Don't need this stuff when building GgPlugin
46 // for Pointwise distro.
47 
48 #if defined(WINDOWS)
49 # if defined(SHOW_PWP_MESSAGES)
50 # pragma message ("PWP_SITE_GROUPNAME='" PWP_SITE_GROUPNAME "'")
51 # pragma message ("PWP_SITE_GROUPID='" winmsgSTRING(PWP_SITE_GROUPID) "'")
52 # endif /* SHOW_PWP_MESSAGES */
53 #endif /* WINDOWS */
54 
55 //*********************************************
58 # define PWP_PROTOTYPE_DECL PW_DLLEXPORT
59 
60 #else // building pointwise distro
61 
65 # define PWP_PROTOTYPE_DECL typedef
66 
67 #endif
68  // sdkINTERNALS
70 
71 
72 #if defined(WINDOWS) && defined(SHOW_PWP_MESSAGES)
73 # pragma message ("PWP_PROTOTYPE_DECL='" winmsgSTRING(PWP_PROTOTYPE_DECL) "'")
74 #endif /* WINDOWS */
75 
76 
88 #undef PW_DLL_IMPEXP
89 #ifdef BUILD_GGPLUGIN
90 # define PW_DLL_IMPEXP PW_DLLEXPORT
91 #else
92 # define PW_DLL_IMPEXP PW_DLLIMPORT
93 #endif
94  // sdkINTERNALS
95 
96 
97 extern "C" {
98 
99 /***********************************************************/
100 /***********************************************************/
113 /***********************************************************/
114 /***********************************************************/
127 #define PWP_API_PLUGIN "Plugin-PWP"
129 
131 #define PWP_API_CAE_EXPORT "Export-CAE"
132 
134 #define PWP_API_GRID_IMPORT "Import-GRID"
135 
137 #define CAEP_API_EXPORT PWP_API_CAE_EXPORT
138  /* DOXGRP_APIPWP_BASENAMES */
140 
141 
142 /***********************************************************/
143 /***********************************************************/
169 typedef signed char PWP_INT8;
170 
172 typedef unsigned char PWP_UINT8;
173 
175 #define PWP_UINT8_MAX ((PWP_UINT8)(~0))
176 
178 #define PWP_UINT8_UNDEF PWP_UINT8_MAX
179 
181 #define PWP_INT8_FORMAT "d"
182 
184 #define PWP_UINT8_FORMAT "u"
185 
186 
187 
189 typedef short PWP_INT16;
190 
192 typedef unsigned short PWP_UINT16;
193 
195 #define PWP_UINT16_MAX ((PWP_UINT16)(~0))
196 
198 #define PWP_UINT16_UNDEF PWP_UINT16_MAX
199 
201 #define PWP_INT16_FORMAT "hd"
202 
204 #define PWP_UINT16_FORMAT "hu"
205 
206 
207 
209 typedef int PWP_INT32;
210 
212 typedef unsigned int PWP_UINT32;
213 
215 #define PWP_UINT32_MAX ((PWP_UINT32)(~0))
216 
218 #define PWP_UINT32_UNDEF PWP_UINT32_MAX
219 
221 #define PWP_INT32_FORMAT "d"
222 
224 #define PWP_UINT32_FORMAT "u"
225 
226 
227 
228 #if defined(darwin) && defined(IS64BIT)
229 
230 typedef long PWP_INT64;
231 
233 typedef unsigned long PWP_UINT64;
234 
236 #define PWP_INT64_FORMAT "ld"
237 
239 #define PWP_UINT64_FORMAT "lu"
240 #else
241 
242 typedef long long PWP_INT64;
243 
245 typedef unsigned long long PWP_UINT64;
246 
248 #define PWP_INT64_FORMAT "lld"
249 
251 #define PWP_UINT64_FORMAT "llu"
252 #endif /* darwin && IS64BIT */
253 
255 #define PWP_UINT64_MAX ((PWP_UINT64)(~0))
256 
258 #define PWP_UINT64_UNDEF PWP_UINT64_MAX
259 
260 
261 
263 typedef float PWP_FLOAT;
264 
266 typedef double PWP_REAL;
267 
268 
269 
270 #ifdef IS64BIT
271 
272 typedef PWP_INT64 PWP_INT;
273 
275 typedef PWP_UINT64 PWP_UINT;
276 
278 #define PWP_INT_FORMAT PWP_INT64_FORMAT
279 
281 #define PWP_UINT_FORMAT PWP_UINT64_FORMAT
282 #else
283 
285 
288 
290 #define PWP_INT_FORMAT PWP_INT32_FORMAT
291 
293 #define PWP_UINT_FORMAT PWP_UINT32_FORMAT
294 #endif /* IS64BIT */
295 
297 #define PWP_UINT_MAX ((PWP_UINT)(~0))
298 
300 #define PWP_UINT_UNDEF PWP_UINT_MAX
301 
302 
303 
305 typedef int PWP_BOOL;
306 
308 #define PWP_FALSE (0)
309 
311 #define PWP_TRUE (!PWP_FALSE)
312 
314 #define PWP_CAST_BOOL(v) ((v) ? PWP_TRUE : PWP_FALSE)
315 
316 
317 
319 typedef void PWP_VOID;
320  /* DOXGRP_APIPWP_XPLATFORMTYPES */
322 
323 
324 /***********************************************************/
325 /***********************************************************/
342 #define PWP_DECLARE_HANDLE(name) \
343  typedef struct name##_t { \
344  \
345  int unused; \
346  \
347  } * name
348 
350 #define PWP_HANDLE_ISVALID(h) (0 != h)
351 
353 #define PWP_HANDLE_INIT 0
354 
356 #define PWP_HANDLE_SET(h, v) h=v
357 
359 #define PWP_HANDLE_SET_IMPL(h, hTyp, impl) (h=reinterpret_cast<hTyp>(&impl))
360 
362 #define PWP_HANDLE_GET_IMPL(h, hTyp) reinterpret_cast<hTyp##_IMPL*>(h)
363 
365 #define PWP_BADID (~((PWP_UINT32)0))
366 
368 #define PWP_BADTYPE ((unsigned char)~0)
369 
370 
371 
377 #define PWP_DECLARE_HELEMGROUP(pname,name) \
378  typedef struct name##_t { \
379  \
380  pname hP; \
381  PWP_UINT32 id; \
382  \
383  } name
384 
385 #define PWP_HEGRP_ISVALID(h) (PWP_HANDLE_ISVALID((h).hP) && \
386  (PWP_BADID != (h).id))
387 
388 #define PWP_HEGRP_INIT {0,PWP_BADID}
389 
391 #define PWP_HEGRP_SET(h, p, v) { (h).hP=(p); (h).id=(v); }
392 
394 #define PWP_HEGRP_H(h) ((h).hP)
395 
397 #define PWP_HEGRP_ID(h) ((h).id)
398 
399 
400 
407 #define PWP_DECLARE_HEGRPITEM(sname,name) \
408  typedef struct name##_t { \
409  \
410  sname parent; \
411  unsigned char ptype; \
412  PWP_UINT32 id; \
413  \
414  } name
415 
416 #define PWP_HEGI_ISVALID(h) (PWP_HANDLE_ISVALID((h).parent.hP) && \
417  (PWP_BADID != (h).parent.id) && \
418  (PWP_BADTYPE != (h).ptype) && \
419  (PWP_BADID != (h).id))
420 
421 #define PWP_HEGI_INIT {{0, PWP_BADID}, PWP_BADTYPE, PWP_BADID}
422 
424 #define PWP_HEGI_SET(h, p, pt, pid, v) { (h).parent.hP=(p); \
425  (h).parent.id=(pid); \
426  (h).ptype=(pt); \
427  (h).id=(v); }
428 
429 #define PWP_HEGI_H(h) ((h).parent.hP)
430 
432 #define PWP_HEGI_PID(h) ((h).parent.id)
433 
435 #define PWP_HEGI_PTYPE(h) ((h).ptype)
436 
438 #define PWP_HEGI_ID(h) ((h).id)
439  /* DOXGRP_APIPWP_DATAHANDLE_HELPERS */
441 
442 
446 PWP_DECLARE_HANDLE(PWP_HVALUE);
447 
449 #define PWP_HVALUE_ISVALID(h) PWP_HANDLE_ISVALID(h)
450 
452 #define PWP_HVALUE_INIT PWP_HANDLE_INIT
453 
455 #define PWP_HVALUE_SET(h, v) PWP_HANDLE_SET(h, v)
456 
458 #define PWP_HVALUE_SET_INVALID(h) PWP_HVALUE_SET(h, PWP_HANDLE_INIT)
459 
461 #define PWP_HVALUE_SET_IMPL(h, hTyp) PWP_HANDLE_SET_IMPL(h, PWP_HVALUE, hTyp)
462 
464 #define PWP_HVALUE_GET_IMPL(h) PWP_HANDLE_GET_IMPL(h, PWP_HVALUE)
465 
466 
472 
473 
478 struct PWP_VERSION {
482 
486 };
487 
488 
497  int dummy; // sdkINTERNALS
499 };
500 
501 
506 typedef enum PWP_ENUM_MSGID_e {
510 
514 
518 
522 
523  // PWP_MSG_PROGRESS ids
527 
531 
535 
539 
540  // add new group enum values before this line
541 
543  PWP_MSGID_SIZE,
546  PWP_MSGID_LAST = PWP_MSGID_SIZE-1 // sdkINTERNALS
548 }
550 
551 
552 
557 typedef PWP_UINT32 (*PWP_MESSAGECB)(const char api[], PWP_ENUM_MSGID id,
558  void *pMsg);
559 
570 #define PWP_MESSAGECB_DEFAULT "@@default"
571 
583 #define PWP_MESSAGECB_SPY "@@spy"
584 
585 
586 /*---------------------------------------------------------*/
633 };
634 
635 
640 struct PWP_MSG_TEXT {
646  const char *text;
647 };
648 
649 
654 struct PWP_APIINFO {
657  const char *name;
661 };
662 
663 
675  const char* author;
678  const char* support;
681  const char* copyright;
691 };
692 
693 
698 typedef enum PWP_ENUM_VALTYPE_e {
705 
706  // add new enum values before this line
707 
709  PWP_VALTYPE_SIZE,
712  PWP_VALTYPE_UNKNOWN = PWP_VALTYPE_SIZE,
714  PWP_VALTYPE_LAST = PWP_VALTYPE_SIZE - 1 // sdkINTERNALS
716 }
718 
719 
720 
725 typedef PWP_BOOL PwpValue_t(const void * dest, PWP_ENUM_VALTYPE srcType,
726  const void * srcValue, PWP_UINT32 srcSize);
727 
728 
732 struct PW_DLL_IMPEXP PWP_HVALUE_IMPL {
735  void * dest_;
739 };
740 
741 
742 
745 typedef enum PWP_ENUM_FILEDEST_e {
749  /* add new group enum values before this line */
750 
754  PWP_FILEDEST_SIZE,
755  PWP_FILEDEST_LAST = PWP_FILEDEST_SIZE - 1
756  /* @} */ // sdkINTERNALS
758 }
760 
761 
762 
765 typedef enum PWP_ENUM_DIMENSION_e {
768  /* add new group enum values before this line */
769 
773  PWP_DIMENSION_SIZE,
774  PWP_DIMENSION_LAST = PWP_DIMENSION_SIZE - 1
775  /* @} */ // sdkINTERNALS
777 }
779 
780 
781 
784 typedef enum PWP_ENUM_ENCODING_e {
788  /* add new group enum values before this line */
789 
793  PWP_ENCODING_SIZE,
794  PWP_ENCODING_LAST = PWP_ENCODING_SIZE - 1
795  /* @} */ // sdkINTERNALS
797 }
799 
800 
801 
804 typedef enum PWP_ENUM_PRECISION_e {
807  /* add new group enum values before this line */
808 
812  PWP_PRECISION_SIZE,
813  PWP_PRECISION_LAST = PWP_PRECISION_SIZE - 1
814  /* @} */ // sdkINTERNALS
816 }
818 
819 
820 //--------------------------------------------
824 typedef enum PWP_ENDIANNESS_t {
830 }
832  /* DOXGRP_APIPWP_TYPES */
834 
835 
836 /***********************************************************/
837 /***********************************************************/
849 PWP_PROTOTYPE_DECL PWP_BOOL
850 PwpInitialize();
851 
852 
853 
863 PWP_PROTOTYPE_DECL PWP_BOOL
864 PwpActivateAPI(const char api[]);
865 
866 
867 
870 PWP_PROTOTYPE_DECL PWP_VOID
871 PwpDestroy();
872 
873 
874 
899 PWP_PROTOTYPE_DECL const char*
900 PwpEnumAPIs(PWP_UINT32 ndx, PWP_APIINFO *pInfo);
901 
902 
903 
908 PWP_PROTOTYPE_DECL PWP_UINT32
910 
911 
912 
921 PWP_PROTOTYPE_DECL PWP_MESSAGECB
922 PwpGetMessageCallback(const char api[]);
923 
924 
925 
935 PWP_PROTOTYPE_DECL PWP_VERSIONVAL
937 
938 
939 
952 PWP_PROTOTYPE_DECL PWP_BOOL
953 PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData);
954 
955 
956 
981 PWP_PROTOTYPE_DECL PWP_MESSAGECB
982 PwpSetMessageCallback(const char api[], PWP_MESSAGECB msgCB);
983 
984 
985 
998 PWP_PROTOTYPE_DECL PWP_VOID
999 PwpSetLanguage(const char language[]);
1000 
1001 
1002 
1050 PWP_PROTOTYPE_DECL PWP_BOOL
1051 PwpGetValue(const char group[], const char key[], PWP_HVALUE value);
1052  // DOXGRP_APIPWP_FUNCTIONS
1054 
1055 
1056 /***********************************************************/
1057 /***********************************************************/
1075 #define PWU_PUBLISH_NAMES_STR "PublishedVar.Names"
1076 #define PWU_PUBLISH_DEFNS_STR "PublishedVar.Definitions"
1077 
1078 #define PWU_VALUE_DEFN_NAME_STR "name"
1079 #define PWU_VALUE_DEFN_TYPE_STR "type"
1080 #define PWU_VALUE_DEFN_ACCESS_STR "access"
1081 #define PWU_VALUE_DEFN_DESC_STR "description"
1082 #define PWU_VALUE_DEFN_DEFAULT_STR "default"
1083 #define PWU_VALUE_DEFN_RANGE_STR "range"
1084 
1085 #define PWU_GROUP_JOIN(j1, j2) j1 "." j2
1086 #define PWU_GROUP_VALUE_NAMES(grp) PWU_GROUP_JOIN(grp, PWU_PUBLISH_NAMES_STR)
1087 #define PWU_GROUP_VALUE_DEFNS(grp) PWU_GROUP_JOIN(grp, PWU_PUBLISH_DEFNS_STR)
1088  // DOXGRP_APIPWP_VALUES
1090 
1091 } // extern "C"
1092 
1093 #endif /* !_APIPWP_H_ */
PWP_PROTOTYPE_DECL PWP_UINT32 PwpGetAPICount()
Get the number of APIs supported by this plugin.
Definition: apiPWP.cxx:82
The data sent by plugins for progress messages.
Definition: apiPWP.h:614
unsigned char PWP_UINT8
8-bit unsigned integer
Definition: apiPWP.h:172
PWP_UINT32 code
API defined message code.
Definition: apiPWP.h:643
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:698
transfer value is a PWP_REAL
Definition: apiPWP.h:702
unsigned long long PWP_UINT64
64-bit unsigned integer
Definition: apiPWP.h:245
PWP_PROTOTYPE_DECL const char * PwpEnumAPIs(PWP_UINT32 ndx, PWP_APIINFO *pInfo)
Enumerates the APIs supported by this plugin.
Definition: apiPWP.cxx:72
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:212
PWP_VERSIONVAL major
the major version value
Definition: apiPWP.h:481
transfer value is a PWP_INT
Definition: apiPWP.h:700
PwpValue_t * PwpValueCB_
Callback function used to marshall a plugin value into dest_.
Definition: apiPWP.h:738
Information text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:513
PWP_UINT32(* PWP_MESSAGECB)(const char api[], PWP_ENUM_MSGID id, void *pMsg)
Message handler callback function signature.
Definition: apiPWP.h:557
void PWP_VOID
no value
Definition: apiPWP.h:319
PWP_PROTOTYPE_DECL PWP_MESSAGECB PwpGetMessageCallback(const char api[])
Gets the current message callback.
Definition: apiPWP.cxx:88
const char * text
API defined message string.
Definition: apiPWP.h:646
PWP_PROTOTYPE_DECL PWP_VOID PwpDestroy()
Called by framework just before plugin library is closed.
Definition: apiPWP.cxx:67
Version data.
Definition: apiPWP.h:478
PWP_VERSION libVer
software library release version
Definition: apiPWP.h:672
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:804
transfer value is a const char*
Definition: apiPWP.h:699
PWP_ENUM_MSGID
Supported PWP-API message ids.
Definition: apiPWP.h:506
Query progress quit message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:538
#define PWP_DECLARE_HANDLE(name)
Declares a root-level, strongly-typed data handle type.
Definition: apiPWP.h:342
Begin progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:526
const char * support
support description (phone, web-link).
Definition: apiPWP.h:678
PWP_UINT32 value
The progress value.
Definition: apiPWP.h:632
PWP_UINT32 apiCount
number of APIs implemented by this plugin
Definition: apiPWP.h:684
PWP_PROTOTYPE_DECL PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
Definition: apiPWP.cxx:132
Installation&#39;s license data. NOT IMPLEMENTED YET.
Definition: apiPWP.h:493
Base plugin utilities.
float PWP_FLOAT
32-bit real
Definition: apiPWP.h:263
PWP_PROTOTYPE_DECL PWP_BOOL PwpInitialize()
Initializes the plugin.
Definition: apiPWP.cxx:54
Debug text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:509
unsigned short PWP_UINT16
16-bit unsigned integer
Definition: apiPWP.h:192
PWP_PROTOTYPE_DECL PWP_BOOL PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData)
Determines if plugin api is licensed for use on this machine.
Definition: apiPWP.cxx:112
End progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:530
The API information returned by plugins for each supported API.
Definition: apiPWP.h:654
transfer value is a PWP_BOOL
Definition: apiPWP.h:704
Status progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:534
short PWP_INT16
16-bit integer
Definition: apiPWP.h:189
signed char PWP_INT8
8-bit integer
Definition: apiPWP.h:169
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:765
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
Definition: apiPWP.h:669
Non-fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:517
void * dest_
Pointer to the opaque value destination.
Definition: apiPWP.h:735
int PWP_BOOL
logical value
Definition: apiPWP.h:305
long long PWP_INT64
64-bit integer
Definition: apiPWP.h:242
PWP_VERSIONVAL minor
the minor version value
Definition: apiPWP.h:485
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:784
PWP_PROTOTYPE_DECL PWP_MESSAGECB PwpSetMessageCallback(const char api[], PWP_MESSAGECB msgCB)
Sets the message callback function for the given api.
Definition: apiPWP.cxx:118
transfer value is a PWP_UINT
Definition: apiPWP.h:701
const char * author
company/author description
Definition: apiPWP.h:675
transfer value is a const char*
Definition: apiPWP.h:703
Fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:521
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
Definition: apiPWP.h:471
const char * copyright
copyright description
Definition: apiPWP.h:681
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:287
PWP_ENUM_FILEDEST
File destination types.
Definition: apiPWP.h:745
PWP_BOOL PwpValue_t(const void *dest, PWP_ENUM_VALTYPE srcType, const void *srcValue, PWP_UINT32 srcSize)
Value transfer callback function signature.
Definition: apiPWP.h:725
const char * name
full API spec name
Definition: apiPWP.h:657
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:824
PWP_MESSAGECB defCB
assigned default message callback
Definition: apiPWP.h:687
PWP_VERSION ver
API spec version.
Definition: apiPWP.h:660
PWP_INT32 PWP_INT
integer same size as void*
Definition: apiPWP.h:284
PWP_PROTOTYPE_DECL PWP_BOOL PwpGetValue(const char group[], const char key[], PWP_HVALUE value)
Get the value for a grouped key.
Definition: apiPWP.cxx:140
The data sent by plugins for text messages.
Definition: apiPWP.h:640
PWP_PROTOTYPE_DECL PWP_BOOL PwpActivateAPI(const char api[])
Activates the plugin for a given API spec.
Definition: apiPWP.cxx:61
PWP_PROTOTYPE_DECL PWP_VERSIONVAL PwpGetPluginInfo(PWP_PLUGININFO *pInfo)
Get information about this plugin.
double PWP_REAL
64-bit real
Definition: apiPWP.h:266
int PWP_INT32
32-bit integer
Definition: apiPWP.h:209
Provides general information about a plugin.
Definition: apiPWP.h:666
PWP_MESSAGECB spyCB
assigned spy message callback
Definition: apiPWP.h:690