Home | History | Annotate | Download | only in generator

Lines Matching full:out_file

203   def OutputMarshal(self, out_file, typemap):
207 out_file: The output file.
215 out_file.write(
220 typemap[self.field_type].OutputMarshalCall(out_file, self)
222 def OutputUnmarshal(self, out_file, typemap):
226 out_file: The output file.
234 out_file.write(
239 typemap[self.field_type].OutputUnmarshalCall(out_file, self)
306 def _GetBaseType(self, out_file, marshalled_types, typemap):
317 out_file: The output file.
332 out_file, marshalled_types, typemap)
339 def OutputMarshalCall(self, out_file, field):
340 """Write a call to Marshal function for TPMType to |out_file|.
346 out_file: The output file.
349 out_file.write(self._MARSHAL_CALL % {'type': field.field_type,
352 def OutputUnmarshalCall(self, out_file, field):
353 """Write a call to Unmarshal function for TPMType to |out_file|.
359 out_file: The output file.
365 out_file.write(self._UNMARSHAL_CALL % {'type': obj_type,
368 def _OutputTypedefMarshalDecl(self, out_file, declared_types, typemap):
369 """Write marshal declarations for TPM typedefs to |out_file|.
375 out_file: The output file.
384 out_file, declared_types, typemap)
385 out_file.write(self._MARSHAL_DECLARATION % {'type': self.new_type})
388 def _OutputStructOrUnionMarshalDecl(self, out_file, declared_types):
394 out_file: The output file.
404 out_file.write(self._MARSHAL_DECLARATION % {'type': self.name})
436 def OutputMarshalImpl(self, out_file, marshalled_types, typemap):
437 """Writes marshal implementations for Typedef to |out_file|.
440 out_file: The output file.
447 base_type = self._GetBaseType(out_file, marshalled_types, typemap)
448 out_file.write(self._TYPEDEF_MARSHAL_FUNCTION % {'old_type': base_type,
450 out_file.write(
455 def OutputMarshalDecl(self, out_file, declared_types, typemap):
456 """Writes marshal declarations for Typedef to |out_file|.
459 out_file: The output file.
464 self._OutputTypedefMarshalDecl(out_file, declared_types, typemap)
512 def OutputMarshalImpl(self, out_file, marshalled_types, typemap):
513 """Writes marshal implementations for ConstantType to |out_file|.
516 out_file: The output file.
523 base_type = self._GetBaseType(out_file, marshalled_types, typemap)
524 out_file.write(self._TYPEDEF_MARSHAL_FUNCTION % {'old_type': base_type,
526 out_file.write(self._TYPEDEF_UNMARSHAL_START % {'old_type': base_type,
530 out_file.write(self._CHECK_VALUE_IFDEF % {'value': value})
532 out_file.write(self._CHECK_VALUE % {'value': value})
533 out_file.write(self._UNMARSHAL_END % {'error_code': self.error_code})
536 def OutputMarshalDecl(self, out_file, declared_types, typemap):
537 """Writes marshal declarations for ConstantType to |out_file|.
540 out_file: The output file.
545 self._OutputTypedefMarshalDecl(out_file, declared_types, typemap)
594 def OutputMarshalImpl(self, out_file, marshalled_types, typemap):
595 """Writes marshal implementations for AttributStructure to |out_file|.
598 out_file: The output file.
605 base_type = self._GetBaseType(out_file, marshalled_types, typemap)
606 out_file.write(self._ATTRIBUTE_MARSHAL_FUNCTION %
609 out_file.write(self._ATTRIBUTE_UNMARSHAL_START %
613 out_file.write(self._CHECK_RESERVED % {'bits': bits})
614 out_file.write(self._UNMARSHAL_END)
617 def OutputMarshalDecl(self, out_file, declared_types, typemap):
618 """Writes marshal declarations for AttributeStructure to |out_file|.
621 out_file: The output file.
626 self._OutputTypedefMarshalDecl(out_file, declared_types, typemap)
749 def OutputMarshalImpl(self, out_file, marshalled_types, typemap):
750 """Writes marshal implementation for Interface to |out_file|.
753 out_file: The output file.
760 base_type = self._GetBaseType(out_file, marshalled_types, typemap)
761 out_file.write(self._TYPEDEF_MARSHAL_FUNCTION % {'old_type': base_type,
764 out_file.write(self._INTERFACE_CONDITIONAL_UNMARSHAL_START %
768 out_file.write(
773 out_file.write(self._SETUP_CHECK_SUPPORTED_VALUES %
776 out_file.write(self._SETUP_CHECK_VALUES)
777 out_file.write(self._UNMARSHAL_VALUE_ALLOW_RC_VALUE %
780 out_file.write(self._UNMARSHAL_VALUE % {'old_type': base_type})
783 out_file.write(self._CHECK_SUPPORTED_VALUES %
787 out_file.write(
793 out_file.write(self._VALUE_START_SWITCH % {'name': '*target'})
796 out_file.write(self._VALUE_CASE_IFDEF % {'value': value})
798 out_file.write(self._VALUE_CASE % {'value': value})
799 out_file.write(self._VALUE_END_SWITCH)
801 out_file.write(
803 out_file.write(self._CHECK_VALUES_END % {'error_code': self.error_code})
805 out_file.write(self._UNMARSHAL_END)
808 def OutputMarshalDecl(self, out_file, declared_types, typemap):
809 """Writes marshal declarations for Interface to |out_file|.
815 out_file: The output file.
824 out_file, declared_types, typemap)
826 out_file.write(
829 out_file.write(self._MARSHAL_DECLARATION % {'type': self.new_type})
833 self, out_file, field):
834 """Write a call to Unmarshal function for Interface type to |out_file|.
841 out_file: The output file.
845 out_file.write(
850 out_file.write(self._UNMARSHAL_CALL % {'type': field.field_type,
970 def OutputMarshalImpl(self, out_file, marshalled_types, typemap):
971 """Writes marshal implementations for Structure to |out_file|.
974 out_file: The output file.
986 out_file, marshalled_types, typemap)
989 out_file.write(self._STRUCTURE_MARSHAL_START % {'name': self.name})
993 out_file.write(self._SETUP_ARRAY_FIELD)
1005 field.OutputMarshal(out_file, typemap)
1007 out_file.write(self._FIX_SIZE_FIELD % {'size_field_type': self.fields[0].field_type})
1008 out_file.write(self._MARSHAL_END)
1010 out_file.write(self._STRUCTURE_UNMARSHAL_START % {'name': self.name})
1012 out_file.write(self._CHECK_SIZE_START)
1016 out_file.write(self._SETUP_ARRAY_FIELD)
1019 field.OutputUnmarshal(out_file, typemap)
1022 out_file.write(self._TPM2B_ZERO_SIZE % {'return_value': 'TPM_RC_SIZE'})
1024 out_file.write(
1031 out_file.write(self._CHECK_BOUND %
1041 out_file.write(self._CHECK_BOUND %
1047 out_file.write(self._VALUE_START_SWITCH % {'name': 'target->tag'})
1049 out_file.write(self._VALUE_CASE % {'value': value})
1050 out_file.write(self._VALUE_END_SWITCH % {'error_code': 'TPM_RC_TAG'})
1052 out_file.write(self._CHECK_SIZE_END)
1057 out_file.write(' (void)result;\n')
1058 out_file.write(self._UNMARSHAL_END)
1062 def OutputMarshalDecl(self, out_file, declared_types, _):
1063 """Writes marshal declarations for Structure to |out_file|.
1066 out_file: The output file.
1070 self._OutputStructOrUnionMarshalDecl(out_file, declared_types)
1189 self, out_file, field_type, field_name, array_length):
1193 out_file: The output file.
1200 out_file.write(self._MARSHAL_FIELD_ARRAY % {'type': field_type,
1204 out_file.write(self._MARSHAL_FIELD % {'type': field_type,
1208 self, out_file, field_type, field_name, array_length, typemap):
1212 out_file: The output file object.
1220 out_file.write(
1225 out_file.write(
1229 out_file.write(self._UNMARSHAL_FIELD % {'type': field_type,
1232 def OutputMarshalImpl(self, out_file, marshalled_types, typemap):
1233 """Writes marshal implementations for Union to |out_file|.
1236 out_file: The output file.
1259 out_file, marshalled_types, typemap)
1265 out_file.write(self._UNION_MARSHAL_START % {'name': self.name,
1274 out_file.write(self._IFDEF % {'type': selector})
1275 out_file.write(self._CASE_SELECTOR % {'selector': selector})
1278 out_file.write(self._MARSHAL_EMPTY)
1280 out_file.write(self._ENDIF)
1284 self._OutputMarshalField(out_file, field_type, field_name, array_length)
1286 out_file.write(self._ENDIF)
1287 out_file.write(self._MARSHAL_END)
1288 out_file.write(self._UNION_UNMARSHAL_START % {'name': self.name})
1291 out_file.write(self._SETUP_UNMARSHAL_FIELD_ARRAY)
1298 out_file.write(self._IFDEF % {'type': selector})
1299 out_file.write(self._CASE_SELECTOR % {'selector': selector})
1302 out_file.write(self._UNMARSHAL_EMPTY)
1304 out_file.write(self._ENDIF)
1309 out_file, field_type, field_name, array_length, typemap)
1311 out_file.write(self._ENDIF)
1312 out_file.write(self._UNMARSHAL_END)
1315 def OutputMarshalDecl(self, out_file, declared_types, _):
1316 """Writes marshal declarations for Union to |out_file|.
1319 out_file: The output file.
1323 self._OutputStructOrUnionMarshalDecl(out_file, declared_types)
1325 def OutputMarshalCall(self, out_file, field):
1326 """Write a call to marshal function for Union type to |out_file|.
1331 out_file: The output file.
1334 out_file.write(self._UNION_MARSHAL_CALL %
1339 def OutputUnmarshalCall(self, out_file, field):
1340 """Write a call to unmarshal function for Union type to |out_file|.
1345 out_file: The output file.
1348 out_file.write(self._UNION_UNMARSHAL_CALL %
1360 out_file = open(_OUTPUT_FILE_H, 'w')
1361 out_file.write(COPYRIGHT_HEADER)
1363 out_file.write(HEADER_FILE_GUARD_HEADER % {'name': guard_name})
1364 out_file.write(_HEADER_FILE_INCLUDES)
1370 out_file.write(_STANDARD_MARSHAL_DECLARATION % {'type': basic_type})
1372 tpm_type.OutputMarshalDecl(out_file, declared_types, typemap)
1373 out_file.write(HEADER_FILE_GUARD_FOOTER % {'name': guard_name})
1374 out_file.close()
1384 out_file = open(_OUTPUT_FILE_CC, 'w')
1385 out_file.write(COPYRIGHT_HEADER)
1386 out_file.write(_IMPLEMENTATION_FILE_INCLUDES)
1389 out_file.write(_MARSHAL_BASIC_TYPE % {'type': basic_type})
1391 tpm_type.OutputMarshalImpl(out_file, marshalled_types, typemap)
1392 out_file.close()