RenderMan API  23.0
prmanapi.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 1986-2019 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 
38 #ifndef PRMANAPI_H
39 #define PRMANAPI_H
40 
41 /* Pixar's PhotoRealistic RenderMan API header file */
42 
43 /* This header file is used to create decoration for function
44  * definitions that will be used by external consumers of the
45  * interface. The interface has to change "gender" based on the
46  * construction of the interface or the consumption of the interface.
47  * This can then be used by all public header files
48  */
49 
50 /**********************************/
51 /* API VERSION MACROS */
52 /**********************************/
53 #define _PRMANAPI_VERSION_ 23
54 #define _PRMANAPI_RELEASE_ 0
55 
56 /* Generally RenderMan plugin APIs are guaranteed to be stable
57  * for a given MAJOR version. Usually they are much more stable
58  * than that as our RixInterface layer offers certain forward
59  * compatibility guarantees. In the course of the development
60  * of a new API, this guarantee is relaxed and it may be
61  * useful to conditionally compile based on the BUILD.
62  */
63 #define _PRMANAPI_VERSION_MAJOR_ 23
64 #define _PRMANAPI_VERSION_MINOR_ 0
65 #define _PRMANAPI_VERSION_BUILD_ 0
66 
67 /* First define IMPORT and EXPORT */
68 #ifdef _MSC_VER
69 # define PRMANIMPORT __declspec(dllimport)
70 # define PRMANEXPORT __declspec(dllexport)
71 # define RSLEXPORT __declspec(dllexport) /* for backwards compatability */
72 # ifdef NDEBUG
73 # define PRMAN_INLINE __forceinline
74 # else
75 # define PRMAN_INLINE inline
76 # endif
77 # define PRMAN_NOINLINE __declspec(noinline)
78 # define PRMAN_ALIGNED(...) __declspec(align(__VA_ARGS__))
79 #else
80 # define PRMANIMPORT
81 # define PRMANEXPORT __attribute__ ((visibility("default")))
82 # define RSLEXPORT __attribute__ ((visibility("default")))
83 # ifdef NDEBUG
84 # define PRMAN_INLINE inline __attribute__((always_inline))
85 # else
86 # define PRMAN_INLINE inline
87 # endif
88 # define PRMAN_NOINLINE __attribute__((noinline))
89 # define PRMAN_ALIGNED(...) __attribute__((aligned(__VA_ARGS__)))
90 #endif
91 
92 /* The use of PRMAN_ALIGNED(...) in the definition of structs */
93 /* confuses some IDEs, impairing symbols search. The following */
94 /* wrapper macros are to avoid the problem for commonly used */
95 /* alignment sizes. */
96 #define PRMAN_ALIGNED_16 PRMAN_ALIGNED(16)
97 #define PRMAN_ALIGNED_64 PRMAN_ALIGNED(64)
98 #define PRMAN_ALIGNED_4096 PRMAN_ALIGNED(4096)
99 
100 #ifndef NDEBUG
101 #define PRMAN_INLINE_NONDEBUG PRMAN_NOINLINE
102 #else
103 #define PRMAN_INLINE_NONDEBUG PRMAN_INLINE
104 #endif
105 
106 /* Now switch if we are BUILDING the API or CONSUMING the API */
107 /* By default consumers of the API need not #define anything */
108 #ifdef PRMANBUILDINGAPI
109 # define PRMANAPI PRMANEXPORT
110 #else
111 # define PRMANAPI PRMANIMPORT
112 #endif
113 
114 /* A couple of entrypoints can be used either from the renderer shared
115  * libray and a small static loader. When using the static loader
116  * configuration use -DPRMANLOADER to get the proper linkage.
117  */
118 #ifdef PRMANLOADER
119 # ifdef _MSC_VER
120 # define PRMANSDKAPI
121 # else
122 # define PRMANSDKAPI PRMANEXPORT
123 # endif
124 #else
125 # define PRMANSDKAPI PRMANAPI
126 #endif
127 
128 /* A 64-bit signed/unsigned integer on all platforms */
129 #include <stdint.h>
130 typedef int64_t RtInt64;
131 typedef uint64_t RtUInt64;
132 
133 /* Here is an interface for c callers..., might be used by
134  * clients of libprman.so. These need to be public API
135  * entry points, since they are called from clients
136  * of the dynamic runtime.
137  */
138 #ifndef __cplusplus
139  // argv: contains arguments that are utilized by prman.
142  // e.g.: -t:2 -progress -capture
154  PRMANAPI int PRManBegin(int argc, char *argv[]);
155 
159  PRMANAPI int PRManGo();
160 
162  PRMANAPI int PRManEnd();
163 #else
164  extern "C" PRMANAPI int PRManBegin(int argc, char *argv[]);
165  extern "C" PRMANAPI int PRManGo();
166  extern "C" PRMANAPI int PRManEnd();
167 #endif
168 
169 /* A macro for silencing compiler warnings about unused parameters */
170 #ifndef PIXAR_ARGUSED
171 # define PIXAR_ARGUSED(x) (void) x
172 #endif
173 
174 #endif /* PRMANAPI */
#define PRMANAPI
Definition: prmanapi.h:111
PRMANAPI int PRManBegin(int argc, char *argv[])
int64_t RtInt64
Definition: prmanapi.h:130
uint64_t RtUInt64
Definition: prmanapi.h:131
PRMANAPI int PRManGo()
PRMANAPI int PRManEnd()
PRManEnd Shuts down and cleans up and unloads the RenderMan library.