The header file of this library is @file{libtasn1.h}.
-@cindex Main type ASN1_TYPE
+@cindex Main type asn_node_t
-The main type used in it is @code{ASN1_TYPE}, and it's used to store
+The main type used in it is @code{asn_node_t}, and it's used to store
the ASN.1 definitions and structures (instances).
-The constant @code{ASN1_TYPE_EMPTY} can be used for the variable
+The constant @code{NULL} can be used for the variable
initialization. For example:
@example
- ASN1_TYPE definitions=ASN1_TYPE_EMPTY;
+ asn_node_t definitions=NULL;
@end example
Some functions require a parameter named errorDescription of char*
char *inputFileAsnName = NULL;
char *inputFileAssignmentName = NULL;
int checkSyntaxOnly = 0;
- ASN1_TYPE definitions = ASN1_TYPE_EMPTY;
- ASN1_TYPE structure = ASN1_TYPE_EMPTY;
+ asn_node_t definitions = NULL;
+ asn_node_t structure = NULL;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
int asn1_result = ASN1_SUCCESS;
FILE *outputFile;
while (readAssignment (inputFile, varName, value) == ASSIGNMENT_SUCCESS)
{
printf ("var=%s, value=%s\n", varName, value);
- if (structure == ASN1_TYPE_EMPTY)
+ if (structure == NULL)
{
asn1_result = asn1_create_element (definitions, value, &structure);
}
#include <read-file.h>
#include "benchmark.h"
-static int decode(ASN1_TYPE definitions, const char* typeName, void* der, int der_len, int benchmark);
+static int decode(asn_node_t definitions, const char* typeName, void* der, int der_len, int benchmark);
/* This feature is available in gcc versions 2.5 and later. */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
char *inputFileAsnName = NULL;
char *inputFileDerName = NULL;
char *typeName = NULL;
- ASN1_TYPE definitions = ASN1_TYPE_EMPTY;
+ asn_node_t definitions = NULL;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
int asn1_result = ASN1_SUCCESS;
unsigned char *der;
exit (0);
}
-static int simple_decode(ASN1_TYPE definitions, const char* typeName, void* der, int der_len, int benchmark)
+static int simple_decode(asn_node_t definitions, const char* typeName, void* der, int der_len, int benchmark)
{
int asn1_result;
-ASN1_TYPE structure = ASN1_TYPE_EMPTY;
+asn_node_t structure = NULL;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
asn1_result = asn1_create_element (definitions, typeName, &structure);
return ASN1_SUCCESS;
}
-static int decode(ASN1_TYPE definitions, const char* typeName, void* der, int der_len, int benchmark)
+static int decode(asn_node_t definitions, const char* typeName, void* der, int der_len, int benchmark)
{
struct benchmark_st st;
char *inputFileName = NULL;
char *vectorName = NULL;
int checkSyntaxOnly = 0;
- ASN1_TYPE pointer = ASN1_TYPE_EMPTY;
+ asn_node_t pointer = NULL;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
int parse_result = ASN1_SUCCESS;