aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1parser/asn1p_xports.c
blob: 594a60e47a1ccc8cb17d3b54140ca7b352d9c1bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdlib.h>
#include <string.h>

#include "asn1parser.h"

/*
 * Construct a new structure that would hold the EXPORTS or IMPORTS
 * clause data.
 */
asn1p_xports_t *
asn1p_xports_new() {
	asn1p_xports_t *xp;

	xp = calloc(1, sizeof *xp);
	if(xp) {
		TQ_INIT(&(xp->members));
	}

	return xp;
}

/*
 * Destroy the xports structure.
 */
void
asn1p_xports_free(asn1p_xports_t *xp) {
	if(xp) {
		free(xp->fromModuleName);
		if(xp->identifier.oid)
			asn1p_oid_free(xp->identifier.oid);
		free(xp);
	}
}