RenderManAPI  24.0
prmanapi.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 2020 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 #ifndef PRMANAPI_H
38 #define PRMANAPI_H
39 
40 /* Pixar's PhotoRealistic RenderMan API header file */
41 
42 /* This header file is used to create decoration for function
43  * definitions that will be used by external consumers of the
44  * interface. The interface has to change "gender" based on the
45  * construction of the interface or the consumption of the interface.
46  * This can then be used by all public header files
47  */
48 
49 /**********************************/
50 /* API VERSION MACROS */
51 /**********************************/
52 #define _PRMANAPI_VERSION_ 24
53 #define _PRMANAPI_RELEASE_ 0
54 
55 /* Generally RenderMan plugin APIs are guaranteed to be stable
56  * for a given MAJOR version. Usually they are much more stable
57  * than that as our RixInterface layer offers certain forward
58  * compatibility guarantees. In the course of the development
59  * of a new API, this guarantee is relaxed and it may be
60  * useful to conditionally compile based on the BUILD.
61  */
62 #define _PRMANAPI_VERSION_MAJOR_ 24
63 #define _PRMANAPI_VERSION_MINOR_ 0
64 #define _PRMANAPI_VERSION_BUILD_ 0
65 
66 /* Macros for symbol concatenation */
67 #define PRMAN_CAT(a, b) a ## b
68 #define PRMAN_XCAT(a, b) PRMAN_CAT(a, b)
69 
70 /* Define versioned C++ rman namespace */
71 #ifdef __cplusplus
72 #define RMAN_NAMESPACE rman::v24_0
73 #define RMAN_NAMESPACE_OPEN_SCOPE namespace rman { inline namespace v24_0 {
74 #define RMAN_NAMESPACE_CLOSE_SCOPE } }
75 
76 /* Define the public name for the namespace as the versioned one. */
77 namespace rman { inline namespace v24_0 { } }
78 #endif
79 
80 /* First define IMPORT and EXPORT */
81 #ifdef _MSC_VER
82 # define PRMANIMPORT __declspec(dllimport)
83 # define PRMANEXPORT __declspec(dllexport)
84 # define RSLEXPORT __declspec(dllexport) /* for backwards compatability */
85 # ifdef NDEBUG
86 # define PRMAN_INLINE __forceinline
87 # else
88 # define PRMAN_INLINE inline
89 # endif
90 # define PRMAN_NOINLINE __declspec(noinline)
91 # define PRMAN_ALIGNED(...) __declspec(align(__VA_ARGS__))
92 #else
93 # define PRMANIMPORT
94 # define PRMANEXPORT __attribute__ ((visibility("default")))
95 # define RSLEXPORT __attribute__ ((visibility("default")))
96 # ifdef NDEBUG
97 # define PRMAN_INLINE inline __attribute__((always_inline))
98 # else
99 # define PRMAN_INLINE inline
100 # endif
101 # define PRMAN_NOINLINE __attribute__((noinline))
102 # define PRMAN_ALIGNED(...) __attribute__((aligned(__VA_ARGS__)))
103 #endif
104 
105 /* The use of PRMAN_ALIGNED(...) in the definition of structs */
106 /* confuses some IDEs, impairing symbols search. The following */
107 /* wrapper macros are to avoid the problem for commonly used */
108 /* alignment sizes. */
109 #define PRMAN_ALIGNED_16 PRMAN_ALIGNED(16)
110 #define PRMAN_ALIGNED_64 PRMAN_ALIGNED(64)
111 #define PRMAN_ALIGNED_4096 PRMAN_ALIGNED(4096)
112 
113 #ifndef NDEBUG
114 #define PRMAN_INLINE_NONDEBUG PRMAN_NOINLINE
115 #else
116 #define PRMAN_INLINE_NONDEBUG PRMAN_INLINE
117 #endif
118 
119 /* Now switch if we are BUILDING the API or CONSUMING the API */
120 /* By default consumers of the API need not #define anything */
121 #ifdef PRMANBUILDINGAPI
122 # define PRMANAPI PRMANEXPORT
123 #else
124 # define PRMANAPI PRMANIMPORT
125 #endif
126 
127 /* A 64-bit signed/unsigned integer on all platforms */
128 #include <stdint.h>
129 typedef int64_t RtInt64;
130 typedef uint64_t RtUInt64;
131 
132 /* Here is an interface for c callers..., might be used by
133  * clients of libprman.so. These need to be public API
134  * entry points, since they are called from clients
135  * of the dynamic runtime.
136  */
137 #ifndef __cplusplus
138  // argv: contains arguments that are utilized by prman.
141  // e.g.: -t:2 -progress -capture
153  PRMANAPI int PRManBegin(int argc, char *argv[]);
154 
158  PRMANAPI int PRManGo();
159 
161  PRMANAPI int PRManEnd();
162 #else
163  extern "C" PRMANAPI int PRManBegin(int argc, char *argv[]);
164  extern "C" PRMANAPI int PRManGo();
165  extern "C" PRMANAPI int PRManEnd();
166 #endif
167 
168 /* A macro for silencing compiler warnings about unused parameters */
169 #ifndef PIXAR_ARGUSED
170 # define PIXAR_ARGUSED(x) (void) x
171 #endif
172 
173 #endif /* PRMANAPI */
#define PRMANAPI
Definition: prmanapi.h:124
Definition: prmanapi.h:77
PRMANAPI int PRManBegin(int argc, char *argv[])
int64_t RtInt64
Definition: prmanapi.h:129
uint64_t RtUInt64
Definition: prmanapi.h:130
PRMANAPI int PRManGo()
PRMANAPI int PRManEnd()