blob: c5749652a21315f023f88d76058adf3e695f8700 [file] [log] [blame]
Lev Walkin9ce64c12017-11-07 06:22:14 -08001
2Upon unsuccessful termination, the \code{*struct_ptr_ptr}
3may contain partially decoded data. This data may be useful for debugging
4(such as by using \code{asn_fprint()}).
5Don't forget to discard the unused partially decoded data by calling
6\code{ASN_STRUCT_FREE()} or \code{ASN_STRUCT_RESET()}.
7
Lev Walkin07f8c3e2017-11-15 00:21:51 -08008The function returns a compound structure:
Lev Walkincf573ec2017-11-07 04:20:52 -08009\begin{codesample}
10typedef struct {
11 enum {
12 RC_OK, /* Decoded successfully */
13 RC_WMORE, /* More data expected, call again */
14 RC_FAIL /* Failure to decode data */
15 } code; /* Result code */
16 size_t consumed; /* Number of bytes consumed */
17} asn_dec_rval_t;
18\end{codesample}
19
Lev Walkin07f8c3e2017-11-15 00:21:51 -080020\noindent{}The \code{.code} member specifies the decoding outcome.
Lev Walkincf573ec2017-11-07 04:20:52 -080021
Lev Walkin9ce64c12017-11-07 06:22:14 -080022\begin{tabular}[h!]{ll}
23\texttt{RC\_OK} & Decoded successfully and completely \\
24\texttt{RC\_WMORE} & More data expected, call again \\
25\texttt{RC\_FAIL} & Failed for good
26\end{tabular}
Lev Walkincf573ec2017-11-07 04:20:52 -080027
Lev Walkin07f8c3e2017-11-15 00:21:51 -080028\noindent{}The \code{.consumed} member specifies the amount of \code{buffer} data
Lev Walkincf573ec2017-11-07 04:20:52 -080029that was used during parsing, irrespectively of the \code{.code}.
30