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-2018 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 /***********************************************************/
155 typedef long PWP_INT;
156 
158 typedef unsigned long PWP_UINT;
159 
161 #define PWP_UINT_MAX ((PWP_UINT)(~0))
162 
164 #define PWP_UINT_UNDEF PWP_UINT_MAX
165 
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 typedef short PWP_INT16;
180 
182 typedef unsigned short PWP_UINT16;
183 
185 #define PWP_UINT16_MAX ((PWP_UINT16)(~0))
186 
188 #define PWP_UINT16_UNDEF PWP_UINT16_MAX
189 
191 typedef int PWP_INT32;
192 
194 typedef unsigned int PWP_UINT32;
195 
197 #define PWP_UINT32_MAX ((PWP_UINT32)(~0))
198 
200 #define PWP_UINT32_UNDEF PWP_UINT32_MAX
201 
203 typedef long long PWP_INT64;
204 
206 typedef unsigned long long PWP_UINT64;
207 
209 #define PWP_UINT64_MAX ((PWP_UINT64)(~0))
210 
212 #define PWP_UINT64_UNDEF PWP_UINT64_MAX
213 
215 typedef float PWP_FLOAT;
216 
218 typedef double PWP_REAL;
219 
221 typedef int PWP_BOOL;
222 
224 #define PWP_FALSE (0)
225 
227 #define PWP_TRUE (!PWP_FALSE)
228 
230 #define PWP_CAST_BOOL(v) ((v) ? PWP_TRUE : PWP_FALSE)
231 
233 typedef void PWP_VOID;
234  /* DOXGRP_APIPWP_XPLATFORMTYPES */
236 
237 
238 /***********************************************************/
239 /***********************************************************/
256 #define PWP_DECLARE_HANDLE(name) \
257  typedef struct name##_t { \
258  \
259  int unused; \
260  \
261  } * name
262 
264 #define PWP_HANDLE_ISVALID(h) (0 != h)
265 
267 #define PWP_HANDLE_INIT 0
268 
270 #define PWP_HANDLE_SET(h, v) h=v
271 
273 #define PWP_HANDLE_SET_IMPL(h, hTyp, impl) (h=reinterpret_cast<hTyp>(&impl))
274 
276 #define PWP_HANDLE_GET_IMPL(h, hTyp) reinterpret_cast<hTyp##_IMPL*>(h)
277 
279 #define PWP_BADID (~((PWP_UINT32)0))
280 
282 #define PWP_BADTYPE ((unsigned char)~0)
283 
284 
285 
291 #define PWP_DECLARE_HELEMGROUP(pname,name) \
292  typedef struct name##_t { \
293  \
294  pname hP; \
295  PWP_UINT32 id; \
296  \
297  } name
298 
299 #define PWP_HEGRP_ISVALID(h) (PWP_HANDLE_ISVALID((h).hP) && \
300  (PWP_BADID != (h).id))
301 
302 #define PWP_HEGRP_INIT {0,PWP_BADID}
303 
305 #define PWP_HEGRP_SET(h, p, v) { (h).hP=(p); (h).id=(v); }
306 
308 #define PWP_HEGRP_H(h) ((h).hP)
309 
311 #define PWP_HEGRP_ID(h) ((h).id)
312 
313 
314 
321 #define PWP_DECLARE_HEGRPITEM(sname,name) \
322  typedef struct name##_t { \
323  \
324  sname parent; \
325  unsigned char ptype; \
326  PWP_UINT32 id; \
327  \
328  } name
329 
330 #define PWP_HEGI_ISVALID(h) (PWP_HANDLE_ISVALID((h).parent.hP) && \
331  (PWP_BADID != (h).parent.id) && \
332  (PWP_BADTYPE != (h).ptype) && \
333  (PWP_BADID != (h).id))
334 
335 #define PWP_HEGI_INIT {{0, PWP_BADID}, PWP_BADTYPE, PWP_BADID}
336 
338 #define PWP_HEGI_SET(h, p, pt, pid, v) { (h).parent.hP=(p); \
339  (h).parent.id=(pid); \
340  (h).ptype=(pt); \
341  (h).id=(v); }
342 
343 #define PWP_HEGI_H(h) ((h).parent.hP)
344 
346 #define PWP_HEGI_PID(h) ((h).parent.id)
347 
349 #define PWP_HEGI_PTYPE(h) ((h).ptype)
350 
352 #define PWP_HEGI_ID(h) ((h).id)
353  /* DOXGRP_APIPWP_DATAHANDLE_HELPERS */
355 
356 
360 PWP_DECLARE_HANDLE(PWP_HVALUE);
361 
363 #define PWP_HVALUE_ISVALID(h) PWP_HANDLE_ISVALID(h)
364 
366 #define PWP_HVALUE_INIT PWP_HANDLE_INIT
367 
369 #define PWP_HVALUE_SET(h, v) PWP_HANDLE_SET(h, v)
370 
372 #define PWP_HVALUE_SET_INVALID(h) PWP_HVALUE_SET(h, PWP_HANDLE_INIT)
373 
375 #define PWP_HVALUE_SET_IMPL(h, hTyp) PWP_HANDLE_SET_IMPL(h, PWP_HVALUE, hTyp)
376 
378 #define PWP_HVALUE_GET_IMPL(h) PWP_HANDLE_GET_IMPL(h, PWP_HVALUE)
379 
380 
386 
387 
392 struct PWP_VERSION {
396 
400 };
401 
402 
411  int dummy; // sdkINTERNALS
413 };
414 
415 
420 typedef enum PWP_ENUM_MSGID_e {
424 
428 
432 
436 
437  // PWP_MSG_PROGRESS ids
441 
445 
449 
453 
454  // add new group enum values before this line
455 
457  PWP_MSGID_SIZE,
460  PWP_MSGID_LAST = PWP_MSGID_SIZE-1 // sdkINTERNALS
462 }
464 
465 
466 
471 typedef PWP_UINT32 (*PWP_MESSAGECB)(const char api[], PWP_ENUM_MSGID id,
472  void *pMsg);
473 
484 #define PWP_MESSAGECB_DEFAULT "@@default"
485 
497 #define PWP_MESSAGECB_SPY "@@spy"
498 
499 
500 /*---------------------------------------------------------*/
547 };
548 
549 
554 struct PWP_MSG_TEXT {
560  const char *text;
561 };
562 
563 
568 struct PWP_APIINFO {
571  const char *name;
575 };
576 
577 
589  const char* author;
592  const char* support;
595  const char* copyright;
605 };
606 
607 
612 typedef enum PWP_ENUM_VALTYPE_e {
619 
620  // add new enum values before this line
621 
623  PWP_VALTYPE_SIZE,
626  PWP_VALTYPE_UNKNOWN = PWP_VALTYPE_SIZE,
628  PWP_VALTYPE_LAST = PWP_VALTYPE_SIZE - 1 // sdkINTERNALS
630 }
632 
633 
634 
639 typedef PWP_BOOL PwpValue_t(const void * dest, PWP_ENUM_VALTYPE srcType,
640  const void * srcValue, PWP_UINT32 srcSize);
641 
642 
646 struct PW_DLL_IMPEXP PWP_HVALUE_IMPL {
649  void * dest_;
653 };
654 
655 
656 
659 typedef enum PWP_ENUM_FILEDEST_e {
663  /* add new group enum values before this line */
664 
668  PWP_FILEDEST_SIZE,
669  PWP_FILEDEST_LAST = PWP_FILEDEST_SIZE - 1
670  /* @} */ // sdkINTERNALS
672 }
674 
675 
676 
679 typedef enum PWP_ENUM_DIMENSION_e {
682  /* add new group enum values before this line */
683 
687  PWP_DIMENSION_SIZE,
688  PWP_DIMENSION_LAST = PWP_DIMENSION_SIZE - 1
689  /* @} */ // sdkINTERNALS
691 }
693 
694 
695 
698 typedef enum PWP_ENUM_ENCODING_e {
702  /* add new group enum values before this line */
703 
707  PWP_ENCODING_SIZE,
708  PWP_ENCODING_LAST = PWP_ENCODING_SIZE - 1
709  /* @} */ // sdkINTERNALS
711 }
713 
714 
715 
718 typedef enum PWP_ENUM_PRECISION_e {
721  /* add new group enum values before this line */
722 
726  PWP_PRECISION_SIZE,
727  PWP_PRECISION_LAST = PWP_PRECISION_SIZE - 1
728  /* @} */ // sdkINTERNALS
730 }
732 
733 
734 //--------------------------------------------
738 typedef enum PWP_ENDIANNESS_t {
744 }
746  /* DOXGRP_APIPWP_TYPES */
748 
749 
750 /***********************************************************/
751 /***********************************************************/
763 PWP_PROTOTYPE_DECL PWP_BOOL
764 PwpInitialize();
765 
766 
767 
777 PWP_PROTOTYPE_DECL PWP_BOOL
778 PwpActivateAPI(const char api[]);
779 
780 
781 
784 PWP_PROTOTYPE_DECL PWP_VOID
785 PwpDestroy();
786 
787 
788 
813 PWP_PROTOTYPE_DECL const char*
814 PwpEnumAPIs(PWP_UINT32 ndx, PWP_APIINFO *pInfo);
815 
816 
817 
822 PWP_PROTOTYPE_DECL PWP_UINT32
824 
825 
826 
835 PWP_PROTOTYPE_DECL PWP_MESSAGECB
836 PwpGetMessageCallback(const char api[]);
837 
838 
839 
849 PWP_PROTOTYPE_DECL PWP_VERSIONVAL
851 
852 
853 
866 PWP_PROTOTYPE_DECL PWP_BOOL
867 PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData);
868 
869 
870 
895 PWP_PROTOTYPE_DECL PWP_MESSAGECB
896 PwpSetMessageCallback(const char api[], PWP_MESSAGECB msgCB);
897 
898 
899 
912 PWP_PROTOTYPE_DECL PWP_VOID
913 PwpSetLanguage(const char language[]);
914 
915 
916 
964 PWP_PROTOTYPE_DECL PWP_BOOL
965 PwpGetValue(const char group[], const char key[], PWP_HVALUE value);
966  // DOXGRP_APIPWP_FUNCTIONS
968 
969 
970 /***********************************************************/
971 /***********************************************************/
989 #define PWU_PUBLISH_NAMES_STR "PublishedVar.Names"
990 #define PWU_PUBLISH_DEFNS_STR "PublishedVar.Definitions"
991 
992 #define PWU_VALUE_DEFN_NAME_STR "name"
993 #define PWU_VALUE_DEFN_TYPE_STR "type"
994 #define PWU_VALUE_DEFN_ACCESS_STR "access"
995 #define PWU_VALUE_DEFN_DESC_STR "description"
996 #define PWU_VALUE_DEFN_DEFAULT_STR "default"
997 #define PWU_VALUE_DEFN_RANGE_STR "range"
998 
999 #define PWU_GROUP_JOIN(j1, j2) j1 "." j2
1000 #define PWU_GROUP_VALUE_NAMES(grp) PWU_GROUP_JOIN(grp, PWU_PUBLISH_NAMES_STR)
1001 #define PWU_GROUP_VALUE_DEFNS(grp) PWU_GROUP_JOIN(grp, PWU_PUBLISH_DEFNS_STR)
1002  // DOXGRP_APIPWP_VALUES
1004 
1005 } // extern "C"
1006 
1007 #endif /* !_APIPWP_H_ */
PWP_PROTOTYPE_DECL PWP_UINT32 PwpGetAPICount()
Get the number of APIs supported by this plugin.
Definition: apiPWP.cxx:77
The data sent by plugins for progress messages.
Definition: apiPWP.h:528
unsigned char PWP_UINT8
8-bit unsigned integer
Definition: apiPWP.h:170
PWP_UINT32 code
API defined message code.
Definition: apiPWP.h:557
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:612
transfer value is a PWP_REAL
Definition: apiPWP.h:616
unsigned long long PWP_UINT64
64-bit unsigned integer
Definition: apiPWP.h:206
PWP_PROTOTYPE_DECL const char * PwpEnumAPIs(PWP_UINT32 ndx, PWP_APIINFO *pInfo)
Enumerates the APIs supported by this plugin.
Definition: apiPWP.cxx:67
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:194
PWP_VERSIONVAL major
the major version value
Definition: apiPWP.h:395
transfer value is a PWP_INT
Definition: apiPWP.h:614
PwpValue_t * PwpValueCB_
Callback function used to marshall a plugin value into dest_.
Definition: apiPWP.h:652
Information text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:427
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 PWP_VOID
no value
Definition: apiPWP.h:233
PWP_PROTOTYPE_DECL PWP_MESSAGECB PwpGetMessageCallback(const char api[])
Gets the current message callback.
Definition: apiPWP.cxx:83
const char * text
API defined message string.
Definition: apiPWP.h:560
PWP_PROTOTYPE_DECL PWP_VOID PwpDestroy()
Called by framework just before plugin library is closed.
Definition: apiPWP.cxx:62
Version data.
Definition: apiPWP.h:392
PWP_VERSION libVer
software library release version
Definition: apiPWP.h:586
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:718
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
#define PWP_DECLARE_HANDLE(name)
Declares a root-level, strongly-typed data handle type.
Definition: apiPWP.h:256
Begin progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:440
const char * support
support description (phone, web-link).
Definition: apiPWP.h:592
PWP_UINT32 value
The progress value.
Definition: apiPWP.h:546
PWP_UINT32 apiCount
number of APIs implemented by this plugin
Definition: apiPWP.h:598
PWP_PROTOTYPE_DECL PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
Definition: apiPWP.cxx:127
Installation&#39;s license data. NOT IMPLEMENTED YET.
Definition: apiPWP.h:407
Base plugin utilities.
float PWP_FLOAT
32-bit real
Definition: apiPWP.h:215
PWP_PROTOTYPE_DECL PWP_BOOL PwpInitialize()
Initializes the plugin.
Definition: apiPWP.cxx:49
Debug text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:423
unsigned short PWP_UINT16
16-bit unsigned integer
Definition: apiPWP.h:182
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:107
End progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:444
The API information returned by plugins for each supported API.
Definition: apiPWP.h:568
transfer value is a PWP_BOOL
Definition: apiPWP.h:618
Status progress message id (see PWP_MSG_PROGRESS)
Definition: apiPWP.h:448
short PWP_INT16
16-bit integer
Definition: apiPWP.h:179
signed char PWP_INT8
8-bit integer
Definition: apiPWP.h:167
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:679
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
Definition: apiPWP.h:583
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
PWP_VERSIONVAL minor
the minor version value
Definition: apiPWP.h:399
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:698
PWP_PROTOTYPE_DECL PWP_MESSAGECB PwpSetMessageCallback(const char api[], PWP_MESSAGECB msgCB)
Sets the message callback function for the given api.
Definition: apiPWP.cxx:113
transfer value is a PWP_UINT
Definition: apiPWP.h:615
const char * author
company/author description
Definition: apiPWP.h:589
transfer value is a const char*
Definition: apiPWP.h:617
long PWP_INT
integer same size as void*
Definition: apiPWP.h:155
Fatal error text message id (see PWP_MSG_TEXT)
Definition: apiPWP.h:435
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
Definition: apiPWP.h:385
const char * copyright
copyright description
Definition: apiPWP.h:595
PWP_ENUM_FILEDEST
File destination types.
Definition: apiPWP.h:659
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:639
const char * name
full API spec name
Definition: apiPWP.h:571
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:738
PWP_MESSAGECB defCB
assigned default message callback
Definition: apiPWP.h:601
PWP_VERSION ver
API spec version.
Definition: apiPWP.h:574
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:135
The data sent by plugins for text messages.
Definition: apiPWP.h:554
PWP_PROTOTYPE_DECL PWP_BOOL PwpActivateAPI(const char api[])
Activates the plugin for a given API spec.
Definition: apiPWP.cxx:56
PWP_PROTOTYPE_DECL PWP_VERSIONVAL PwpGetPluginInfo(PWP_PLUGININFO *pInfo)
Get information about this plugin.
double PWP_REAL
64-bit real
Definition: apiPWP.h:218
int PWP_INT32
32-bit integer
Definition: apiPWP.h:191
Provides general information about a plugin.
Definition: apiPWP.h:580
PWP_MESSAGECB spyCB
assigned spy message callback
Definition: apiPWP.h:604