X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=libasn1parser%2Fasn1p_xports.c;fp=libasn1parser%2Fasn1p_xports.c;h=8ba511ad60ec4d4e196dcd73d82a916cb13dfa94;hb=70ee6fc793ec8e828067a3569849b6c216054497;hp=0000000000000000000000000000000000000000;hpb=59f84608ec15c016958a6e0e0ddd813f376c0925;p=com%2Fasn1c.git diff --git a/libasn1parser/asn1p_xports.c b/libasn1parser/asn1p_xports.c new file mode 100644 index 0000000..8ba511a --- /dev/null +++ b/libasn1parser/asn1p_xports.c @@ -0,0 +1,38 @@ +#include +#include + +#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->xp_members)); + } + + return xp; +} + +/* + * Destroy the xports structure. + */ +void +asn1p_xports_free(asn1p_xports_t *xp) { + if(xp) { + asn1p_expr_t *expr; + + free(xp->fromModuleName); + asn1p_oid_free(xp->identifier.oid); + + while((expr = TQ_REMOVE(&(xp->xp_members), next))) + asn1p_expr_free(expr); + + free(xp); + } +}