Imported Upstream version 4.14
[platform/upstream/libtasn1.git] / doc / texi / ASN1.c.texi
1 @subheading asn1_parser2tree
2 @anchor{asn1_parser2tree}
3 @deftypefun {int} {asn1_parser2tree} (const char * @var{file}, asn1_node * @var{definitions}, char * @var{error_desc})
4 @var{file}: specify the path and the name of file that contains
5 ASN.1 declarations.
6
7 @var{definitions}: return the pointer to the structure created from
8 "file" ASN.1 declarations.
9
10 @var{error_desc}: return the error description or an empty
11 string if success.
12
13 Function used to start the parse algorithm.  Creates the structures
14 needed to manage the definitions included in  @code{file} file.
15
16 @strong{Returns:} @code{ASN1_SUCCESS}  if the file has a correct syntax and every
17 identifier is known, @code{ASN1_ELEMENT_NOT_EMPTY}  if  @code{definitions} not
18 @code{NULL} , @code{ASN1_FILE_NOT_FOUND}  if an error occurred while
19 opening  @code{file} , @code{ASN1_SYNTAX_ERROR}  if the syntax is not
20 correct, @code{ASN1_IDENTIFIER_NOT_FOUND}  if in the file there is an
21 identifier that is not defined, @code{ASN1_NAME_TOO_LONG}  if in the
22 file there is an identifier whith more than @code{ASN1_MAX_NAME_SIZE} 
23 characters.
24 @end deftypefun
25
26 @subheading asn1_parser2array
27 @anchor{asn1_parser2array}
28 @deftypefun {int} {asn1_parser2array} (const char * @var{inputFileName}, const char * @var{outputFileName}, const char * @var{vectorName}, char * @var{error_desc})
29 @var{inputFileName}: specify the path and the name of file that
30 contains ASN.1 declarations.
31
32 @var{outputFileName}: specify the path and the name of file that will
33 contain the C vector definition.
34
35 @var{vectorName}: specify the name of the C vector.
36
37 @var{error_desc}: return the error description or an empty
38 string if success.
39
40 Function that generates a C structure from an ASN1 file.  Creates a
41 file containing a C vector to use to manage the definitions
42 included in  @code{inputFileName} file. If  @code{inputFileName} is
43 "/aa/bb/xx.yy" and  @code{outputFileName} is @code{NULL} , the file created is
44 "/aa/bb/xx_asn1_tab.c".  If  @code{vectorName} is @code{NULL}  the vector name
45 will be "xx_asn1_tab".
46
47 @strong{Returns:} @code{ASN1_SUCCESS}  if the file has a correct syntax and every
48 identifier is known, @code{ASN1_FILE_NOT_FOUND}  if an error occurred
49 while opening  @code{inputFileName} , @code{ASN1_SYNTAX_ERROR}  if the syntax is
50 not correct, @code{ASN1_IDENTIFIER_NOT_FOUND}  if in the file there is
51 an identifier that is not defined, @code{ASN1_NAME_TOO_LONG}  if in the
52 file there is an identifier whith more than @code{ASN1_MAX_NAME_SIZE} 
53 characters.
54 @end deftypefun
55