@@ -48,46 +48,46 @@ ORC_RT_C_EXTERN_C_BEGIN
4848typedef union {
4949 char * ValuePtr ;
5050 char Value [sizeof (char * )];
51- } orc_rt_CWrapperFunctionResultDataUnion ;
51+ } orc_rt_WrapperFunctionResultDataUnion ;
5252
5353/**
54- * orc_rt_CWrapperFunctionResult is a kind of C-SmallVector with an
54+ * orc_rt_WrapperFunctionResult is a kind of C-SmallVector with an
5555 * out-of-band error state.
5656 *
5757 * If Size == 0 and Data.ValuePtr is non-zero then the value is in the
5858 * 'out-of-band error' state, and Data.ValuePtr points at a malloc-allocated,
5959 * null-terminated string error message.
6060 *
61- * If Size <= sizeof(orc_rt_CWrapperFunctionResultData ) then the value is in
61+ * If Size <= sizeof(orc_rt_WrapperFunctionResultData ) then the value is in
6262 * the 'small' state and the content is held in the first Size bytes of
6363 * Data.Value.
6464 *
65- * If Size > sizeof(orc_rt_CWrapperFunctionResultData ) then the value is in the
65+ * If Size > sizeof(orc_rt_WrapperFunctionResultData ) then the value is in the
6666 * 'large' state and the content is held in the first Size bytes of the
6767 * memory pointed to by Data.ValuePtr. This memory must have been allocated by
6868 * malloc, and will be freed with free when this value is destroyed.
6969 */
7070typedef struct {
71- orc_rt_CWrapperFunctionResultDataUnion Data ;
71+ orc_rt_WrapperFunctionResultDataUnion Data ;
7272 size_t Size ;
73- } orc_rt_CWrapperFunctionResult ;
73+ } orc_rt_WrapperFunctionResult ;
7474
7575/**
76- * Zero-initialize an orc_rt_CWrapperFunctionResult .
76+ * Zero-initialize an orc_rt_WrapperFunctionResult .
7777 */
7878static inline void
79- orc_rt_CWrapperFunctionResultInit ( orc_rt_CWrapperFunctionResult * R ) {
79+ orc_rt_WrapperFunctionResultInit ( orc_rt_WrapperFunctionResult * R ) {
8080 R -> Size = 0 ;
8181 R -> Data .ValuePtr = 0 ;
8282}
8383
8484/**
85- * Create an orc_rt_CWrapperFunctionResult with an uninitialized buffer of
85+ * Create an orc_rt_WrapperFunctionResult with an uninitialized buffer of
8686 * size Size. The buffer is returned via the DataPtr argument.
8787 */
88- static inline orc_rt_CWrapperFunctionResult
89- orc_rt_CWrapperFunctionResultAllocate (size_t Size ) {
90- orc_rt_CWrapperFunctionResult R ;
88+ static inline orc_rt_WrapperFunctionResult
89+ orc_rt_WrapperFunctionResultAllocate (size_t Size ) {
90+ orc_rt_WrapperFunctionResult R ;
9191 R .Size = Size ;
9292 // If Size is 0 ValuePtr must be 0 or it is considered an out-of-band error.
9393 R .Data .ValuePtr = 0 ;
@@ -99,9 +99,9 @@ orc_rt_CWrapperFunctionResultAllocate(size_t Size) {
9999/**
100100 * Create an orc_rt_WrapperFunctionResult from the given data range.
101101 */
102- static inline orc_rt_CWrapperFunctionResult
103- orc_rt_CreateCWrapperFunctionResultFromRange (const char * Data , size_t Size ) {
104- orc_rt_CWrapperFunctionResult R ;
102+ static inline orc_rt_WrapperFunctionResult
103+ orc_rt_CreateWrapperFunctionResultFromRange (const char * Data , size_t Size ) {
104+ orc_rt_WrapperFunctionResult R ;
105105 R .Size = Size ;
106106 if (R .Size > sizeof (R .Data .Value )) {
107107 char * Tmp = (char * )malloc (Size );
@@ -113,28 +113,28 @@ orc_rt_CreateCWrapperFunctionResultFromRange(const char *Data, size_t Size) {
113113}
114114
115115/**
116- * Create an orc_rt_CWrapperFunctionResult by copying the given string,
116+ * Create an orc_rt_WrapperFunctionResult by copying the given string,
117117 * including the null-terminator.
118118 *
119119 * This function copies the input string. The client is responsible for freeing
120120 * the ErrMsg arg.
121121 */
122- static inline orc_rt_CWrapperFunctionResult
123- orc_rt_CreateCWrapperFunctionResultFromString (const char * Source ) {
124- return orc_rt_CreateCWrapperFunctionResultFromRange (Source ,
125- strlen (Source ) + 1 );
122+ static inline orc_rt_WrapperFunctionResult
123+ orc_rt_CreateWrapperFunctionResultFromString (const char * Source ) {
124+ return orc_rt_CreateWrapperFunctionResultFromRange (Source ,
125+ strlen (Source ) + 1 );
126126}
127127
128128/**
129- * Create an orc_rt_CWrapperFunctionResult representing an out-of-band
129+ * Create an orc_rt_WrapperFunctionResult representing an out-of-band
130130 * error.
131131 *
132132 * This function copies the input string. The client is responsible for freeing
133133 * the ErrMsg arg.
134134 */
135- static inline orc_rt_CWrapperFunctionResult
136- orc_rt_CreateCWrapperFunctionResultFromOutOfBandError (const char * ErrMsg ) {
137- orc_rt_CWrapperFunctionResult R ;
135+ static inline orc_rt_WrapperFunctionResult
136+ orc_rt_CreateWrapperFunctionResultFromOutOfBandError (const char * ErrMsg ) {
137+ orc_rt_WrapperFunctionResult R ;
138138 R .Size = 0 ;
139139 char * Tmp = (char * )malloc (strlen (ErrMsg ) + 1 );
140140 strcpy (Tmp , ErrMsg );
@@ -143,57 +143,57 @@ orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(const char *ErrMsg) {
143143}
144144
145145/**
146- * This should be called to destroy orc_rt_CWrapperFunctionResult values
146+ * This should be called to destroy orc_rt_WrapperFunctionResult values
147147 * regardless of their state.
148148 */
149149static inline void
150- orc_rt_DisposeCWrapperFunctionResult ( orc_rt_CWrapperFunctionResult * R ) {
150+ orc_rt_DisposeWrapperFunctionResult ( orc_rt_WrapperFunctionResult * R ) {
151151 if (R -> Size > sizeof (R -> Data .Value ) ||
152152 (R -> Size == 0 && R -> Data .ValuePtr ))
153153 free (R -> Data .ValuePtr );
154154}
155155
156156/**
157157 * Get a pointer to the data contained in the given
158- * orc_rt_CWrapperFunctionResult .
158+ * orc_rt_WrapperFunctionResult .
159159 */
160160static inline char *
161- orc_rt_CWrapperFunctionResultData ( orc_rt_CWrapperFunctionResult * R ) {
161+ orc_rt_WrapperFunctionResultData ( orc_rt_WrapperFunctionResult * R ) {
162162 assert ((R -> Size != 0 || R -> Data .ValuePtr == NULL ) &&
163163 "Cannot get data for out-of-band error value" );
164164 return R -> Size > sizeof (R -> Data .Value ) ? R -> Data .ValuePtr : R -> Data .Value ;
165165}
166166
167167/**
168- * Safely get the size of the given orc_rt_CWrapperFunctionResult .
168+ * Safely get the size of the given orc_rt_WrapperFunctionResult .
169169 *
170170 * Asserts that we're not trying to access the size of an error value.
171171 */
172172static inline size_t
173- orc_rt_CWrapperFunctionResultSize (const orc_rt_CWrapperFunctionResult * R ) {
173+ orc_rt_WrapperFunctionResultSize (const orc_rt_WrapperFunctionResult * R ) {
174174 assert ((R -> Size != 0 || R -> Data .ValuePtr == NULL ) &&
175175 "Cannot get size for out-of-band error value" );
176176 return R -> Size ;
177177}
178178
179179/**
180180 * Returns 1 if this value is equivalent to a value just initialized by
181- * orc_rt_CWrapperFunctionResultInit , 0 otherwise.
181+ * orc_rt_WrapperFunctionResultInit , 0 otherwise.
182182 */
183183static inline size_t
184- orc_rt_CWrapperFunctionResultEmpty (const orc_rt_CWrapperFunctionResult * R ) {
184+ orc_rt_WrapperFunctionResultEmpty (const orc_rt_WrapperFunctionResult * R ) {
185185 return R -> Size == 0 && R -> Data .ValuePtr == 0 ;
186186}
187187
188188/**
189189 * Returns a pointer to the out-of-band error string for this
190- * orc_rt_CWrapperFunctionResult , or null if there is no error.
190+ * orc_rt_WrapperFunctionResult , or null if there is no error.
191191 *
192- * The orc_rt_CWrapperFunctionResult retains ownership of the error
192+ * The orc_rt_WrapperFunctionResult retains ownership of the error
193193 * string, so it should be copied if the caller wishes to preserve it.
194194 */
195- static inline const char * orc_rt_CWrapperFunctionResultGetOutOfBandError (
196- const orc_rt_CWrapperFunctionResult * R ) {
195+ static inline const char * orc_rt_WrapperFunctionResultGetOutOfBandError (
196+ const orc_rt_WrapperFunctionResult * R ) {
197197 return R -> Size == 0 ? R -> Data .ValuePtr : 0 ;
198198}
199199
0 commit comments