NativeEnumerated.c vars NULL init and check
[com/asn1c.git] / doc / docsrc / asn_dec_rval.inc
1
2 Upon unsuccessful termination, the \code{*struct_ptr_ptr}
3 may contain partially decoded data. This data may be useful for debugging
4 (such as by using \code{asn_fprint()}).
5 Don't forget to discard the unused partially decoded data by calling
6 \code{ASN_STRUCT_FREE()} or \code{ASN_STRUCT_RESET()}.
7
8 The function returns a compound structure:
9 \begin{codesample}
10 typedef 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
20 \noindent{}The \code{.code} member specifies the decoding outcome.
21
22 \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}
27
28 \noindent{}The \code{.consumed} member specifies the amount of \code{buffer} data
29 that was used during parsing, irrespectively of the \code{.code}.
30