@@ -40,11 +40,11 @@ \section{Data Buffer Type}
4040\section {Support Macros }
4141\label {chap:datamgt:macros }
4242
43- \ac {PMIx} provides a set of convenience macros for creating, initiating, and releasing data buffers.
43+ \ac {PMIx} provides a convenience macro for statically initiating data buffers.
4444
4545% %%%
4646\littleheader {Static initializer for the data buffer structure}
47- \declaremacroProvisional {PMIX_DATA_BUFFER_STATIC_INIT}
47+ \declaremacro {PMIX_DATA_BUFFER_STATIC_INIT}
4848
4949Provide a static initializer for the \refstruct {pmix_data_buffer_t} fields.
5050
@@ -56,30 +56,38 @@ \section{Support Macros}
5656\cspecificend
5757
5858
59+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61+ \section {Support Functions }
62+ \label {chap:datamgt:functions }
63+
64+ \ac {PMIx} provides a set of convenience functions for creating, initiating, and releasing data buffers.
65+
5966% %%%%%%%%%%
60- \littleheader {\code {PMIX_DATA_BUFFER_CREATE }}
61- \declaremacro {PMIX_DATA_BUFFER_CREATE }
67+ \littleheader {\code {PMIx_Data_buffer_create }}
68+ \declareapiProvisional {PMIx_Data_buffer_create }
6269
6370Allocate memory for a \refstruct {pmix_data_buffer_t} object and initialize it.
64- This macro uses \textit {calloc } to allocate memory for the buffer and initialize all fields in it
71+ This function uses \textit {calloc } to allocate memory for the buffer and initialize all fields in it
6572
66- \copySignature {PMIX_DATA_BUFFER_CREATE}{2.0}{
67- PMIX_DATA_BUFFER_CREATE(buffer);
73+ \copySignature {PMIx_Data_buffer_create}{6.0}{
74+ pmix_data_buffer_t* \\
75+ PMIx_Data_buffer_create(\code {void});
6876}
6977
70- \begin {arglist }
71- \argout {buffer}{Variable to be assigned the pointer to the allocated \refstruct {pmix_data_buffer_t} (handle)}
72- \end {arglist }
78+ Returns a pointer to the allocated \refstruct {pmix_data_buffer_t} (handle)
79+
7380
7481% %%%%%%%%%%
75- \littleheader {\code {PMIX_DATA_BUFFER_RELEASE }}
76- \declaremacro {PMIX_DATA_BUFFER_RELEASE }
82+ \littleheader {\code {PMIx_Data_buffer_release }}
83+ \declareapiProvisional {PMIx_Data_buffer_release }
7784
7885Free a \refstruct {pmix_data_buffer_t} object and the data it contains.
7986Free's the data contained in the buffer, and then free's the buffer itself
8087
81- \copySignature {PMIX_DATA_BUFFER_RELEASE}{2.0}{
82- PMIX_DATA_BUFFER_RELEASE(buffer);
88+ \copySignature {PMIx_Data_buffer_release}{6.0}{
89+ void \\
90+ PMIx_Data_buffer_release(pmix_data_buffer_t *buffer);
8391}
8492
8593\begin {arglist }
@@ -88,27 +96,29 @@ \section{Support Macros}
8896
8997
9098% %%%%%%%%%%
91- \littleheader {\code {PMIX_DATA_BUFFER_CONSTRUCT }}
92- \declaremacro {PMIX_DATA_BUFFER_CONSTRUCT }
99+ \littleheader {\code {PMIx_Data_buffer_construct }}
100+ \declareapiProvisional {PMIx_Data_buffer_construct }
93101
94102Initialize the fields of a previously allocated \refstruct {pmix_data_buffer_t} object.
95103
96- \copySignature {PMIX_DATA_BUFFER_CONSTRUCT}{2.0}{
97- PMIX_DATA_BUFFER_CONSTRUCT(buffer);
104+ \copySignature {PMIx_Data_buffer_construct}{6.0}{
105+ void \\
106+ PMIx_Data_buffer_construct(pmix_data_buffer_t *buffer);
98107}
99108
100109\begin {arglist }
101110\argin {buffer}{Pointer to the allocated \refstruct {pmix_data_buffer_t} that is to be initialized (handle)}
102111\end {arglist }
103112
104113% %%%%%%%%%%
105- \littleheader {\code {PMIX_DATA_BUFFER_DESTRUCT }}
106- \declaremacro {PMIX_DATA_BUFFER_DESTRUCT }
114+ \littleheader {\code {PMIx_Data_buffer_destruct }}
115+ \declareapiProvisional {PMIx_Data_buffer_destruct }
107116
108117Release the data contained in a \refstruct {pmix_data_buffer_t} object.
109118
110- \copySignature {PMIX_DATA_BUFFER_DESTRUCT}{2.0}{
111- PMIX_DATA_BUFFER_DESTRUCT(buffer);
119+ \copySignature {PMIx_Data_buffer_destruct}{6.0}{
120+ void \\
121+ PMIx_Data_buffer_destruct(pmix_data_buffer_t *buffer);
112122}
113123
114124\begin {arglist }
@@ -117,14 +127,17 @@ \section{Support Macros}
117127
118128
119129% %%%%%%%%%%
120- \littleheader {\code {PMIX_DATA_BUFFER_LOAD }}
121- \declaremacro {PMIX_DATA_BUFFER_LOAD }
130+ \littleheader {\code {PMIx_Data_buffer_load }}
131+ \declareapiProvisional {PMIx_Data_buffer_load }
122132
123133Load a blob into a \refstruct {pmix_data_buffer_t} object.
124134Load the given data into the provided \refstruct {pmix_data_buffer_t} object, usually done in preparation for unpacking the provided data. Note that the data is \textit {not } copied into the buffer - thus, the blob must not be released until after operations on the buffer have completed.
125135
126- \copySignature {PMIX_DATA_BUFFER_LOAD}{2.0}{
127- PMIX_DATA_BUFFER_LOAD(buffer, data, size);
136+ \copySignature {PMIx_Data_buffer_load}{6.0}{
137+ void \\
138+ PMIx_Data_buffer_load(pmix_data_buffer_t *buffer,
139+ \hspace *{24\sigspace }char *data,
140+ \hspace *{24\sigspace }size_t size);
128141}
129142
130143\begin {arglist }
@@ -134,20 +147,23 @@ \section{Support Macros}
134147\end {arglist }
135148
136149% %%%%%%%%%%
137- \littleheader {\code {PMIX_DATA_BUFFER_UNLOAD }}
138- \declaremacro {PMIX_DATA_BUFFER_UNLOAD }
150+ \littleheader {\code {PMIx_Data_buffer_unload }}
151+ \declareapiProvisional {PMIx_Data_buffer_unload }
139152
140153Unload the data from a \refstruct {pmix_data_buffer_t} object.
141154Extract the data in a buffer, assigning the pointer to the data (and the number of bytes in the blob) to the provided variables, usually done to transmit the blob to a remote process for unpacking. The buffer's internal pointer will be set to NULL to protect the data upon buffer destruct or release - thus, the user is responsible for releasing the blob when done with it.
142155
143- \copySignature {PMIX_DATA_BUFFER_UNLOAD}{2.0}{
144- PMIX_DATA_BUFFER_UNLOAD(buffer, data, size);
156+ \copySignature {PMIx_Data_buffer_unload}{6.0}{
157+ void \\
158+ PMIx_Data_buffer_unload(pmix_data_buffer_t *buffer,
159+ \hspace *{24\sigspace }char **data,
160+ \hspace *{24\sigspace }size_t *size);
145161}
146162
147163\begin {arglist }
148164\argin {buffer}{Pointer to the \refstruct {pmix_data_buffer_t} whose data is to be extracted (handle)}
149- \argout {data}{Variable to be assigned the pointer to the extracted blob (\code {void *})}
150- \argout {size}{Variable to be assigned the number of bytes in the blob {\code {size_t}}}
165+ \argout {data}{Pointer to variable to be assigned the pointer to the extracted blob (\code {char* *})}
166+ \argout {size}{Pointer to variable to be assigned the number of bytes in the blob {\code {size_t* }}}
151167\end {arglist }
152168
153169
@@ -198,12 +214,12 @@ \subsection{\code{PMIx_Data_pack}}
198214\descr
199215
200216The pack function packs one or more values of a specified type into the specified buffer. The buffer must have already been
201- initialized via the \refmacro {PMIX_DATA_BUFFER_CREATE } or \refmacro {PMIX_DATA_BUFFER_CONSTRUCT }
202- macros .
217+ initialized via the \refapi {PMIx_Data_buffer_create } or \refapi {PMIx_Data_buffer_construct }
218+ functions .
203219The buffer may already contain packed data, in which case the new data is appended to the buffer.
204220Providing an unsupported type flag will likewise be reported as an error.
205221
206- Note that packing data using a type that
222+ Note that packing data using a type that
207223does not explicitly specifiy its size
208224may lose precision when unpacked
209225by a non-homogeneous recipient. The \refapi {PMIx_Data_pack} function will do its best to deal
@@ -245,7 +261,7 @@ \subsection{\code{PMIx_Data_unpack}}
245261
246262
247263\begin {arglist }
248- \argin {source}{Pointer to a \refstruct {pmix_proc_t} structure of the process that packed the provided buffer. A NULL value may be used to indicate that the source is based on the same \ac {PMIx} version as the caller.
264+ \argin {source}{Pointer to a \refstruct {pmix_proc_t} structure of the process that packed the provided buffer. A NULL value may be used to indicate that the source is based on the same \ac {PMIx} version as the caller.
249265Only the namespace is used to determine the packing version as all processes in a namespace are required to use the same \ac {PMIx} version. (handle)}
250266\argin {buffer}{A pointer to the buffer from which the value will be extracted. (handle)}
251267\arginout {dest}{A pointer to the memory location into which the data is to be stored. Note that these values will be stored contiguously in memory. For strings, this pointer must be to (char**) to provide a means of supporting multiple string operations. The unpack function will allocate memory for each string in the array, but the caller must provide adequate memory for the array of pointers. (\code {void*})}
@@ -264,7 +280,7 @@ \subsection{\code{PMIx_Data_unpack}}
264280% %%%
265281\descr
266282
267- The unpack function unpacks the next value (or values) from the given buffer.
283+ The unpack function unpacks the next value (or values) from the given buffer.
268284An attempt to read an uninitialized buffer or read beyond the end of the stored data held in the buffer will return an error.
269285
270286Unpacking values is a "nondestructive" process --- i.e., the values are not removed from the buffer. It is therefore possible for the caller to re-unpack a value from the same buffer by resetting the unpack_ptr.
@@ -404,14 +420,11 @@ \subsection{\code{PMIx_Data_unload}}
404420% %%%
405421\format
406422
407- \versionMarkerProvisional {4.1}
408- \cspecificstart
409- \begin {codepar }
410- pmix_status_t
411- PMIx_Data_unload(pmix_data_buffer_t *src,
412- pmix_byte_object_t *dest);
413- \end {codepar }
414- \cspecificend
423+ \copySignature {PMIx_Data_unload}{4.1}{
424+ pmix_status_t \\
425+ PMIx_Data_unload(pmix_data_buffer_t *src, \\
426+ \hspace *{24\sigspace }pmix_byte_object_t *dest);
427+ }
415428
416429\begin {arglist }
417430\argin {src}{Pointer to the source \refstruct {pmix_data_buffer_t} (handle)}
@@ -455,14 +468,11 @@ \subsection{\code{PMIx_Data_load}}
455468% %%%
456469\format
457470
458- \versionMarkerProvisional {4.1}
459- \cspecificstart
460- \begin {codepar }
461- pmix_status_t
462- PMIx_Data_load(pmix_data_buffer_t *dest,
463- pmix_byte_object_t *src);
464- \end {codepar }
465- \cspecificend
471+ \copySignature {PMIx_Data_load}{4.1}{
472+ pmix_status_t \\
473+ PMIx_Data_load(pmix_data_buffer_t *dest, \\
474+ \hspace *{24\sigspace }pmix_byte_object_t *src);
475+ }
466476
467477\begin {arglist }
468478\argin {dest}{Pointer to the destination \refstruct {pmix_data_buffer_t} (handle)}
@@ -507,14 +517,11 @@ \subsection{\code{PMIx_Data_compress}}
507517% %%%
508518\format
509519
510- \versionMarkerProvisional {4.1}
511- \cspecificstart
512- \begin {codepar }
513- bool
520+ \copySignature {PMIx_Data_compress}{4.1}{
521+ bool \\
514522PMIx_Data_compress(const uint8_t *inbytes, size_t size,
515- uint8_t **outbytes, size_t *nbytes);
516- \end {codepar }
517- \cspecificend
523+ \hspace *{24\sigspace }uint8_t **outbytes, size_t *nbytes);
524+ }
518525
519526\begin {arglist }
520527\argin {inbytes}{Pointer to the source data (handle)}
@@ -535,8 +542,8 @@ \subsection{\code{PMIx_Data_compress}}
535542Compress the provided data block. Destination memory
536543will be allocated if operation is successfully concluded. Caller
537544is responsible for release of the allocated region. The input
538- data block will remain unaltered.
539- The method of compressing and uncompressing data is implementation dependent.
545+ data block will remain unaltered.
546+ The method of compressing and uncompressing data is implementation dependent.
540547
541548Note: the compress function will return \code {False} if the operation
542549would not result in a smaller data block.
@@ -555,14 +562,11 @@ \subsection{\code{PMIx_Data_decompress}}
555562% %%%
556563\format
557564
558- \versionMarkerProvisional {4.1}
559- \cspecificstart
560- \begin {codepar }
561- bool
562- PMIx_Data_decompress(const uint8_t *inbytes, size_t size,
563- uint8_t **outbytes, size_t *nbytes);
564- \end {codepar }
565- \cspecificend
565+ \copySignature {PMIx_Data_decompress}{4.1}{
566+ bool \\
567+ PMIx_Data_decompress(const uint8_t *inbytes, size_t size, \\
568+ \hspace *{24\sigspace }uint8_t **outbytes, size_t *nbytes);
569+ }
566570
567571\begin {arglist }
568572\argin {inbytes}{Pointer to the source data (handle)}
@@ -584,7 +588,7 @@ \subsection{\code{PMIx_Data_decompress}}
584588will be allocated if operation is successfully concluded. Caller
585589is responsible for release of the allocated region. The input
586590data block will remain unaltered.
587- The method of compressing and uncompressing data is implementation dependent.
591+ The method of compressing and uncompressing data is implementation dependent.
588592
589593Only data compressed by the \refapi {PMIx_Data_compress} \ac {API}
590594can be decompressed by this function. Passing data that has not
@@ -594,7 +598,7 @@ \subsection{\code{PMIx_Data_decompress}}
594598% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
595599
596600\subsection {\code {PMIx_Data_embed} }
597- \declareapiProvisional {PMIx_Data_embed}
601+ \declareapi {PMIx_Data_embed}
598602
599603% %%%
600604\summary
@@ -604,14 +608,11 @@ \subsection{\code{PMIx_Data_embed}}
604608% %%%
605609\format
606610
607- \versionMarker {5.0}
608- \cspecificstart
609- \begin {codepar }
610- pmix_status_t
611- PMIx_Data_embed(pmix_data_buffer_t *buffer,
612- const pmix_byte_object_t *payload);
613- \end {codepar }
614- \cspecificend
611+ \copySignature {PMIx_Data_embed}{5.0}{
612+ pmix_status_t \\
613+ PMIx_Data_embed(pmix_data_buffer_t *buffer, \\
614+ \hspace *{24\sigspace }const pmix_byte_object_t *payload);
615+ }
615616
616617\begin {arglist }
617618\argout {buffer}{Address of the buffer where the payload is to be embedded (handle)}
@@ -629,6 +630,6 @@ \subsection{\code{PMIx_Data_embed}}
629630\descr
630631
631632The embed function is identical in operation to \refapi {PMIx_Data_load}
632- except that it does \emph {not } clear the payload object upon completion. The data is copied from the payload to the buffer and remains in the payload.
633+ except that it does \emph {not } clear the payload object upon completion. The data is copied from the payload to the buffer and remains in the payload.
633634
634635% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0 commit comments