asn1c/libasn1parser/asn1p_xports.c

39 lines
587 B
C
Raw Permalink Normal View History

2004-06-03 03:38:44 +00:00
#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) {
2017-11-06 08:07:00 +00:00
TQ_INIT(&(xp->xp_members));
2004-06-03 03:38:44 +00:00
}
return xp;
}
/*
* Destroy the xports structure.
*/
void
asn1p_xports_free(asn1p_xports_t *xp) {
if(xp) {
2017-05-04 13:45:05 +00:00
asn1p_expr_t *expr;
2016-03-14 09:00:27 +00:00
free(xp->fromModuleName);
2016-03-14 09:05:23 +00:00
asn1p_oid_free(xp->identifier.oid);
2017-05-04 13:45:05 +00:00
2017-11-06 08:07:00 +00:00
while((expr = TQ_REMOVE(&(xp->xp_members), next)))
2017-05-04 13:45:05 +00:00
asn1p_expr_free(expr);
2004-06-03 03:38:44 +00:00
free(xp);
}
}