Configuring Partial Decoding

Refer to the section on configuration files for general information about configuration files.

Here is an example of configuring a target for an individual element. This is taken from the c/sample_per/employee_partialdec sample:

<asn1config>
   <module name="Employee">
      <production name="PersonnelRecord">
         <element name="children">
            <element name="name">
               <element name="givenName">
                  <partial-decode name="Given"/>
               </element>
            </element>
         </element>
      </production>
   </module>
</asn1config>

Note that in the above, children refers to an element defined like so: children SEQUENCE OF ChildInformation. Observe the following rules:

The above configuration results in generating the following partial decode function:

int asn1PPD_PersonnelRecord_Given (
             OSCTXT* pctxt, 
             OSRTDList* pvalue /* list of const char* */);

This function will decode a PersonnelRecord and return a list of givenName values.

Now here is an example of configuring a target for a group of elements. This is taken from the c/sample_per/employee_partialdec_grp sample:

<asn1config>
   <module name="Employee">
      <production name="PersonnelRecord">
         <element name="children">
            <element name="name">
               <partial-decode-group name="ChildName">
                  <element name="givenName"/>
                  <element name="familyName"/>
               </partial-decode-group>
            </element>
         </element>
      </production>
   </module>
</asn1config>

In addition to the rules described above for the individual case, observe this additional rule:

The above configuration results in generating the following partial decode function:

int asn1PPD_PersonnelRecord_ChildName (
             OSCTXT* pctxt,
             OSRTDList* pvalue /* list of Name* */);

This function will decode a PersonnelRecord and return a list of Name values, with just the givenName and familyName values populated.