blob: abe123291e646d27a0017f0a1f380dab0f4a2263 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001#include <stdlib.h>
2#include <string.h>
3
4#include "asn1parser.h"
5
6/*
7 * Construct a new structure that would hold the EXPORTS or IMPORTS
8 * clause data.
9 */
10asn1p_xports_t *
11asn1p_xports_new() {
12 asn1p_xports_t *xp;
13
14 xp = calloc(1, sizeof *xp);
15 if(xp) {
16 TQ_INIT(&(xp->members));
17 }
18
19 return xp;
20}
21
22/*
23 * Destroy the xports structure.
24 */
25void
26asn1p_xports_free(asn1p_xports_t *xp) {
27 if(xp) {
Lev Walkinb36317c2005-08-12 10:09:10 +000028 if(xp->fromModuleName)
29 free(xp->fromModuleName);
30 if(xp->identifier.oid)
31 asn1p_oid_free(xp->identifier.oid);
Lev Walkinf15320b2004-06-03 03:38:44 +000032 free(xp);
33 }
34}