Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
8  *
9  ***************************************************************************/
10 
23 //*********************************************
24 // platform-dependent export defines
25 //*********************************************
26 #if defined(WINDOWS)
27 # define winmsgSTRING2(ss) #ss
28 # define winmsgSTRING(ss) winmsgSTRING2(ss)
29 # define PW_DLLEXPORT __declspec(dllexport)
30 # define PW_DLLIMPORT __declspec(dllimport)
31 #else
32 # define PW_DLLEXPORT
33 # define PW_DLLIMPORT
34 #endif /* WINDOWS */
35 
36 #undef PWP_PROTOTYPE_DECL
37 
38 #ifdef BUILD_PWPLUGIN_DYNLIB
39 
40 #include "apiUtils.h"
41 
42 // Building a plugin dyn lib module.
43 // Don't need this stuff when building GgPlugin
44 // for Pointwise distro.
45 
46 #if defined(WINDOWS)
47 # if defined(SHOW_PWP_MESSAGES)
48 # pragma message ("PWP_SITE_GROUPNAME='" PWP_SITE_GROUPNAME "'")
49 # pragma message ("PWP_SITE_GROUPID='" winmsgSTRING(PWP_SITE_GROUPID) "'")
50 # endif /* SHOW_PWP_MESSAGES */
51 #endif /* WINDOWS */
52 
53 //*********************************************
56 # define PWP_PROTOTYPE_DECL PW_DLLEXPORT
57 
58 #else // building pointwise distro
59 
63 # define PWP_PROTOTYPE_DECL typedef
64 
65 #endif
66  // sdkINTERNALS
68 
69 
70 #if defined(WINDOWS) && defined(SHOW_PWP_MESSAGES)
71 # pragma message ("PWP_PROTOTYPE_DECL='" winmsgSTRING(PWP_PROTOTYPE_DECL) "'")
72 #endif /* WINDOWS */
73 
74 
86 #undef PW_DLL_IMPEXP
87 #ifdef BUILD_GGPLUGIN
88 # define PW_DLL_IMPEXP PW_DLLEXPORT
89 #else
90 # define PW_DLL_IMPEXP PW_DLLIMPORT
91 #endif
92  // sdkINTERNALS
93 
94 
95 extern "C" {
96 
97 /***********************************************************/
98 /***********************************************************/
111 /***********************************************************/
112 /***********************************************************/
125 #define PWP_API_PLUGIN "Plugin-PWP"
127 
129 #define PWP_API_CAE_EXPORT "Export-CAE"
130 
132 #define PWP_API_GRID_IMPORT "Import-GRID"
133 
135 #define CAEP_API_EXPORT PWP_API_CAE_EXPORT
136  /* DOXGRP_APIPWP_BASENAMES */
138 
139 
140 /***********************************************************/
141 /***********************************************************/
167 typedef signed char PWP_INT8;
168 
170 typedef unsigned char PWP_UINT8;
171 
173 #define PWP_UINT8_MAX ((PWP_UINT8)(~0))
174 
176 #define PWP_UINT8_UNDEF PWP_UINT8_MAX
177 
179 #define PWP_INT8_FORMAT "d"
180 
182 #define PWP_UINT8_FORMAT "u"
183 
184 
185 
187 typedef short PWP_INT16;
188 
190 typedef unsigned short PWP_UINT16;
191 
193 #define PWP_UINT16_MAX ((PWP_UINT16)(~0))
194 
196 #define PWP_UINT16_UNDEF PWP_UINT16_MAX
197 
199 #define PWP_INT16_FORMAT "hd"
200 
202 #define PWP_UINT16_FORMAT "hu"
203 
204 
205 
207 typedef int PWP_INT32;
208 
210 typedef unsigned int PWP_UINT32;
211 
213 #define PWP_UINT32_MAX ((PWP_UINT32)(~0))
214 
216 #define PWP_UINT32_UNDEF PWP_UINT32_MAX
217 
219 #define PWP_INT32_FORMAT "d"
220 
222 #define PWP_UINT32_FORMAT "u"
223 
224 
225 
226 #if defined(darwin) && defined(IS64BIT)
227 
228 typedef long PWP_INT64;
229 
231 typedef unsigned long PWP_UINT64;
232 
234 #define PWP_INT64_FORMAT "ld"
235 
237 #define PWP_UINT64_FORMAT "lu"
238 #else
239 
240 typedef long long PWP_INT64;
241 
243 typedef unsigned long long PWP_UINT64;
244 
246 #define PWP_INT64_FORMAT "lld"
247 
249 #define PWP_UINT64_FORMAT "llu"
250 #endif /* darwin && IS64BIT */
251 
253 #define PWP_UINT64_MAX ((PWP_UINT64)(~0))
254 
256 #define PWP_UINT64_UNDEF PWP_UINT64_MAX
257 
258 
259 
261 typedef float PWP_FLOAT;
262 
264 typedef double PWP_REAL;
265 
266 
267 
268 #ifdef IS64BIT
269 
270 typedef PWP_INT64 PWP_INT;
271 
273 typedef PWP_UINT64 PWP_UINT;
274 
276 #define PWP_INT_FORMAT PWP_INT64_FORMAT
277 
279 #define PWP_UINT_FORMAT PWP_UINT64_FORMAT
280 #else
281 
282 typedef PWP_INT32 PWP_INT;
283 
285 typedef PWP_UINT32 PWP_UINT;
286 
288 #define PWP_INT_FORMAT PWP_INT32_FORMAT
289 
291 #define PWP_UINT_FORMAT PWP_UINT32_FORMAT
292 #endif /* IS64BIT */
293 
295 #define PWP_UINT_MAX ((PWP_UINT)(~0))
296 
298 #define PWP_UINT_UNDEF PWP_UINT_MAX
299 
300 
301 
303 typedef int PWP_BOOL;
304 
306 #define PWP_FALSE PWP_BOOL(0)
307 
309 #define PWP_TRUE PWP_BOOL(!PWP_FALSE)
310 
312 #define PWP_CAST_BOOL(v) ((v) ? PWP_TRUE : PWP_FALSE)
313 
314 
315 
317 typedef void PWP_VOID;
318  /* DOXGRP_APIPWP_XPLATFORMTYPES */
320 
321 
322 /***********************************************************/
323 /***********************************************************/
340 #define PWP_DECLARE_HANDLE(name) \
341  typedef struct name##_t { \
342  \
343  int unused; \
344  \
345  } * name
346 
348 #define PWP_HANDLE_ISVALID(h) (0 != h)
349 
351 #define PWP_HANDLE_INIT 0
352 
354 #define PWP_HANDLE_SET(h, v) h=v
355 
357 #define PWP_HANDLE_SET_IMPL(h, hTyp, impl) (h=reinterpret_cast<hTyp>(&impl))
358 
360 #define PWP_HANDLE_GET_IMPL(h, hTyp) reinterpret_cast<hTyp##_IMPL*>(h)
361 
363 #define PWP_BADID (~((PWP_UINT32)0))
364 
366 #define PWP_BADTYPE ((unsigned char)~0)
367 
368 
369 
375 #define PWP_DECLARE_HELEMGROUP(pname,name) \
376  typedef struct name##_t { \
377  \
378  pname hP; \
379  PWP_UINT32 id; \
380  \
381  } name
382 
383 #define PWP_HEGRP_ISVALID(h) (PWP_HANDLE_ISVALID((h).hP) && \
384  (PWP_BADID != (h).id))
385 
386 #define PWP_HEGRP_INIT {0,PWP_BADID}
387 
389 #define PWP_HEGRP_SET(h, p, v) { (h).hP=(p); (h).id=(v); }
390 
392 #define PWP_HEGRP_H(h) ((h).hP)
393 
395 #define PWP_HEGRP_ID(h) ((h).id)
396 
397 
398 
405 #define PWP_DECLARE_HEGRPITEM(sname,name) \
406  typedef struct name##_t { \
407  \
408  sname parent; \
409  unsigned char ptype; \
410  PWP_UINT32 id; \
411  \
412  } name
413 
414 #define PWP_HEGI_ISVALID(h) (PWP_HANDLE_ISVALID((h).parent.hP) && \
415  (PWP_BADID != (h).parent.id) && \
416  (PWP_BADTYPE != (h).ptype) && \
417  (PWP_BADID != (h).id))
418 
419 #define PWP_HEGI_INIT {{0, PWP_BADID}, PWP_BADTYPE, PWP_BADID}
420 
422 #define PWP_HEGI_SET(h, p, pt, pid, v) { (h).parent.hP=(p); \
423  (h).parent.id=(pid); \
424  (h).ptype=(pt); \
425  (h).id=(v); }
426 
427 #define PWP_HEGI_H(h) ((h).parent.hP)
428 
430 #define PWP_HEGI_PID(h) ((h).parent.id)
431 
433 #define PWP_HEGI_PTYPE(h) ((h).ptype)
434 
436 #define PWP_HEGI_ID(h) ((h).id)
437  /* DOXGRP_APIPWP_DATAHANDLE_HELPERS */
439 
440 
444 PWP_DECLARE_HANDLE(PWP_HVALUE);
445 
447 #define PWP_HVALUE_ISVALID(h) PWP_HANDLE_ISVALID(h)
448 
450 #define PWP_HVALUE_INIT PWP_HANDLE_INIT
451 
453 #define PWP_HVALUE_SET(h, v) PWP_HANDLE_SET(h, v)
454 
456 #define PWP_HVALUE_SET_INVALID(h) PWP_HVALUE_SET(h, PWP_HANDLE_INIT)
457 
459 #define PWP_HVALUE_SET_IMPL(h, hTyp) PWP_HANDLE_SET_IMPL(h, PWP_HVALUE, hTyp)
460 
462 #define PWP_HVALUE_GET_IMPL(h) PWP_HANDLE_GET_IMPL(h, PWP_HVALUE)
463 
464 
469 typedef PWP_UINT32 PWP_VERSIONVAL;
470 
471 
476 struct PWP_VERSION {
479  PWP_VERSIONVAL major;
480 
483  PWP_VERSIONVAL minor;
484 };
485 
486 
495  int dummy; // sdkINTERNALS
497 };
498 
499 
504 typedef enum PWP_ENUM_MSGID_e {
508 
512 
516 
520 
521  // PWP_MSG_PROGRESS ids
525 
529 
533 
537 
538  // add new group enum values before this line
539 
541  PWP_MSGID_SIZE,
544  PWP_MSGID_LAST = PWP_MSGID_SIZE-1 // sdkINTERNALS
546 }
548 
549 
550 
555 typedef PWP_UINT32 (*PWP_MESSAGECB)(const char api[], PWP_ENUM_MSGID id,
556  void *pMsg);
557 
568 #define PWP_MESSAGECB_DEFAULT "@@default"
569 
581 #define PWP_MESSAGECB_SPY "@@spy"
582 
583 
584 /*---------------------------------------------------------*/
630  PWP_UINT32 value;
631 };
632 
633 
638 struct PWP_MSG_TEXT {
641  PWP_UINT32 code;
644  const char *text;
645 };
646 
647 
652 struct PWP_APIINFO {
655  const char *name;
659 };
660 
661 
673  const char* author;
676  const char* support;
679  const char* copyright;
682  PWP_UINT32 apiCount;
689 };
690 
691 
696 typedef enum PWP_ENUM_VALTYPE_e {
703 
704  // add new enum values before this line
705 
707  PWP_VALTYPE_SIZE,
710  PWP_VALTYPE_UNKNOWN = PWP_VALTYPE_SIZE,
712  PWP_VALTYPE_LAST = PWP_VALTYPE_SIZE - 1 // sdkINTERNALS
714 }
716 
717 
718 
723 typedef PWP_BOOL PwpValue_t(const void * dest, PWP_ENUM_VALTYPE srcType,
724  const void * srcValue, PWP_UINT32 srcSize);
725 
726 
730 struct PW_DLL_IMPEXP PWP_HVALUE_IMPL {
733  void * dest_;
737 };
738 
739 
740 
743 typedef enum PWP_ENUM_FILEDEST_e {
747  /* add new group enum values before this line */
748 
751  PWP_FILEDEST_SIZE,
753  PWP_FILEDEST_LAST = PWP_FILEDEST_SIZE - 1
755  // sdkINTERNALS
756 }
758 
759 
760 
763 typedef enum PWP_ENUM_DIMENSION_e {
766  /* add new group enum values before this line */
767 
770  PWP_DIMENSION_SIZE,
772  PWP_DIMENSION_LAST = PWP_DIMENSION_SIZE - 1
774  // sdkINTERNALS
775 }
777 
778 
779 
782 typedef enum PWP_ENUM_ENCODING_e {
786  /* add new group enum values before this line */
787 
790  PWP_ENCODING_SIZE,
792  PWP_ENCODING_LAST = PWP_ENCODING_SIZE - 1
794  // sdkINTERNALS
795 }
797 
798 
799 
802 typedef enum PWP_ENUM_PRECISION_e {
805  /* add new group enum values before this line */
806 
809  PWP_PRECISION_SIZE,
811  PWP_PRECISION_LAST = PWP_PRECISION_SIZE - 1
813  // sdkINTERNALS
814 }
816 
817 
818 //--------------------------------------------
822 typedef enum PWP_ENDIANNESS_t {
828 }
830  /* DOXGRP_APIPWP_TYPES */
832 
833 
834 /***********************************************************/
835 /***********************************************************/
847 PWP_PROTOTYPE_DECL PWP_BOOL
848 PwpInitialize();
849 
850 
851 
861 PWP_PROTOTYPE_DECL PWP_BOOL
862 PwpActivateAPI(const char api[]);
863 
864 
865 
868 PWP_PROTOTYPE_DECL PWP_VOID
869 PwpDestroy();
870 
871 
872 
897 PWP_PROTOTYPE_DECL const char*
898 PwpEnumAPIs(PWP_UINT32 ndx, PWP_APIINFO *pInfo);
899 
900 
901 
906 PWP_PROTOTYPE_DECL PWP_UINT32
908 
909 
910 
919 PWP_PROTOTYPE_DECL PWP_MESSAGECB
920 PwpGetMessageCallback(const char api[]);
921 
922 
923 
933 PWP_PROTOTYPE_DECL PWP_VERSIONVAL
935 
936 
937 
950 PWP_PROTOTYPE_DECL PWP_BOOL
951 PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData);
952 
953 
954 
979 PWP_PROTOTYPE_DECL PWP_MESSAGECB
980 PwpSetMessageCallback(const char api[], PWP_MESSAGECB msgCB);
981 
982 
983 
996 PWP_PROTOTYPE_DECL PWP_VOID
997 PwpSetLanguage(const char language[]);
998 
999 
1000 
1048 PWP_PROTOTYPE_DECL PWP_BOOL
1049 PwpGetValue(const char group[], const char key[], PWP_HVALUE value);
1050  // DOXGRP_APIPWP_FUNCTIONS
1052 
1053 
1054 /***********************************************************/
1055 /***********************************************************/
1073 #define PWU_PUBLISH_NAMES_STR "PublishedVar.Names"
1074 #define PWU_PUBLISH_DEFNS_STR "PublishedVar.Definitions"
1075 
1076 #define PWU_VALUE_DEFN_NAME_STR "name"
1077 #define PWU_VALUE_DEFN_TYPE_STR "type"
1078 #define PWU_VALUE_DEFN_ACCESS_STR "access"
1079 #define PWU_VALUE_DEFN_DESC_STR "description"
1080 #define PWU_VALUE_DEFN_DEFAULT_STR "default"
1081 #define PWU_VALUE_DEFN_RANGE_STR "range"
1082 
1083 #define PWU_GROUP_JOIN(j1, j2) j1 "." j2
1084 #define PWU_GROUP_VALUE_NAMES(grp) PWU_GROUP_JOIN(grp, PWU_PUBLISH_NAMES_STR)
1085 #define PWU_GROUP_VALUE_DEFNS(grp) PWU_GROUP_JOIN(grp, PWU_PUBLISH_DEFNS_STR)
1086  // DOXGRP_APIPWP_VALUES
1088 
1089 } // extern "C"
1090 
1091 #endif /* !_APIPWP_H_ */
PWP_UINT32 PwpGetAPICount()
Get the number of APIs supported by this plugin.
Definition: apiPWP.cxx:80
The data sent by plugins for progress messages.
Definition: apiPWP.h:612
unsigned char PWP_UINT8
8-bit unsigned integer
Definition: apiPWP.h:170
PWP_UINT32 code
API defined message code.
Definition: apiPWP.h:641
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:696
transfer value is a PWP_REAL
Definition: apiPWP.h:700
unsigned long long PWP_UINT64
64-bit unsigned integer
Definition: apiPWP.h:243
const char * PwpEnumAPIs(PWP_UINT32 ndx, PWP_APIINFO *pInfo)
Enumerates the APIs supported by this plugin.
Definition: apiPWP.cxx:70
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
PWP_VERSIONVAL major
the major version value
Definition: apiPWP.h:479
transfer value is a PWP_INT
Definition: apiPWP.h:698
PwpValue_t * PwpValueCB_
Callback function used to marshall a plugin value into dest_.
Definition: apiPWP.h:736
Information text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:511
void PWP_VOID
no value
Definition: apiPWP.h:317
PWP_MESSAGECB PwpGetMessageCallback(const char api[])
Gets the current message callback.
Definition: apiPWP.cxx:86
const char * text
API defined message string.
Definition: apiPWP.h:644
PWP_VOID PwpDestroy()
Called by framework just before plugin library is closed.
Definition: apiPWP.cxx:65
Version data.
Definition: apiPWP.h:476
PWP_VERSION libVer
software library release version
Definition: apiPWP.h:670
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:802
transfer value is a const char*
Definition: apiPWP.h:697
PWP_ENUM_MSGID
Supported PWP-API message ids.
Definition: apiPWP.h:504
Query progress quit message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:536
#define PWP_DECLARE_HANDLE(name)
Declares a root-level, strongly-typed data handle type.
Definition: apiPWP.h:340
Begin progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:524
const char * support
support description (phone, web-link).
Definition: apiPWP.h:676
PWP_UINT32 value
The progress value.
Definition: apiPWP.h:630
PWP_UINT32 apiCount
number of APIs implemented by this plugin
Definition: apiPWP.h:682
PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
Definition: apiPWP.cxx:130
Installation&#39;s license data. NOT IMPLEMENTED YET.
Definition: apiPWP.h:491
Base plugin utilities.
float PWP_FLOAT
32-bit real
Definition: apiPWP.h:261
PWP_BOOL PwpInitialize()
Initializes the plugin.
Definition: apiPWP.cxx:52
Debug text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:507
unsigned short PWP_UINT16
16-bit unsigned integer
Definition: apiPWP.h:190
PWP_BOOL PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData)
Determines if plugin api is licensed for use on this machine.
Definition: apiPWP.cxx:110
End progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:528
The API information returned by plugins for each supported API.
Definition: apiPWP.h:652
transfer value is a PWP_BOOL
Definition: apiPWP.h:702
PWP_UINT32(* PWP_MESSAGECB)(const char api[], PWP_ENUM_MSGID id, void *pMsg)
Message handler callback function signature.
Definition: apiPWP.h:555
Status progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:532
short PWP_INT16
16-bit integer
Definition: apiPWP.h:187
signed char PWP_INT8
8-bit integer
Definition: apiPWP.h:167
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:763
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
Definition: apiPWP.h:667
Non-fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:515
void * dest_
Pointer to the opaque value destination.
Definition: apiPWP.h:733
int PWP_BOOL
logical value
Definition: apiPWP.h:303
long long PWP_INT64
64-bit integer
Definition: apiPWP.h:240
PWP_VERSIONVAL minor
the minor version value
Definition: apiPWP.h:483
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:782
PWP_MESSAGECB PwpSetMessageCallback(const char api[], PWP_MESSAGECB msgCallback)
Sets the message callback function for the given api.
Definition: apiPWP.cxx:116
transfer value is a PWP_UINT
Definition: apiPWP.h:699
const char * author
company/author description
Definition: apiPWP.h:673
transfer value is a const char*
Definition: apiPWP.h:701
Fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:519
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
Definition: apiPWP.h:469
const char * copyright
copyright description
Definition: apiPWP.h:679
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:285
PWP_ENUM_FILEDEST
File destination types.
Definition: apiPWP.h:743
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:723
const char * name
full API spec name
Definition: apiPWP.h:655
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:822
PWP_MESSAGECB defCB
assigned default message callback
Definition: apiPWP.h:685
PWP_VERSION ver
API spec version.
Definition: apiPWP.h:658
PWP_INT32 PWP_INT
integer same size as void*
Definition: apiPWP.h:282
PWP_BOOL PwpGetValue(const char group[], const char key[], PWP_HVALUE hVal)
Get the value for a grouped key.
Definition: apiPWP.cxx:138
The data sent by plugins for text messages.
Definition: apiPWP.h:638
PWP_BOOL PwpActivateAPI(const char api[])
Activates the plugin for a given API spec.
Definition: apiPWP.cxx:59
PWP_PROTOTYPE_DECL PWP_VERSIONVAL PwpGetPluginInfo(PWP_PLUGININFO *pInfo)
Get information about this plugin.
double PWP_REAL
64-bit real
Definition: apiPWP.h:264
int PWP_INT32
32-bit integer
Definition: apiPWP.h:207
Provides general information about a plugin.
Definition: apiPWP.h:664
PWP_MESSAGECB spyCB
assigned spy message callback
Definition: apiPWP.h:688