Lines Matching defs:type

58  * Marshal type definitions.
62 typeset_emit_type(XDR *xdrs, adr_typeset_t *typeset, adr_type_t *type)
66 switch (type->t_type) {
68 if (!xdr_int(xdrs, (int *)&type->t_type) ||
69 !xdr_typeref_t(xdrs, typeset, type->t_aux.t_array))
73 if (!xdr_int(xdrs, (int *)&type->t_type) ||
74 !xdr_string(xdrs, (char **)&type->adr_t_name, -1) ||
75 !xdr_u_int(xdrs, &type->t_size))
77 for (int i = 0; i < type->t_size; i++) {
78 adr_structfield_t *field = &type->t_aux.t_fields[i];
87 adr_unionarm_t *dfltarm = &type->t_aux.t_union.arms[0];
90 if (!xdr_int(xdrs, (int *)&type->t_type) ||
91 !xdr_string(xdrs, (char **)&type->adr_t_name, -1) ||
92 !xdr_typeref_t(xdrs, typeset, type->t_aux.t_union.type) ||
97 !xdr_u_int(xdrs, &type->t_size))
100 for (int i = 0; i < type->t_size; i++) {
101 adr_unionarm_t *ua = &type->t_aux.t_union.arms[i + 1];
110 const char *fbname = type->t_aux.t_enum[0].ev_name;
113 if (!xdr_int(xdrs, (int *)&type->t_type) ||
114 !xdr_string(xdrs, (char **)&type->adr_t_name, -1) ||
117 !xdr_u_int(xdrs, &type->t_size))
120 for (int i = 1; i < type->t_size + 1; i++) {
121 adr_enumval_t *ev = &type->t_aux.t_enum[i];
193 result->t_aux.t_union.type = utype;
267 xdr_typeref_t(XDR *xdrs, adr_typeset_t *typeset, adr_type_t *type)
269 if (!xdr_int(xdrs, (int *)&type->t_type))
272 if (!ADR_DT_DERIVED(type->t_type))
275 int tnum = adr_typeset_find(typeset, type);
296 adr_type_t *type;
298 (type = adr_typeset_id(typeset, tnum)) == NULL)
301 *typep = type;
311 adr_type_t *type = typeset->TS_TYPES[i].TR_TYPE;
312 if (!typeset_emit_type(xdrs, typeset, type))
341 * Normally the absence of a type is represented by void. Attribute/
345 * We effectively treat an error payload type as "optional data".
351 xdr_errortype_t(XDR *xdrs, adr_typeset_t *typeset, adr_type_t *type)
355 bool_t b = type != NULL;
359 return (xdr_typeref_t(xdrs, typeset, type));
364 xdr_r_errortype_t(XDR *xdrs, adr_typeset_t *typeset, adr_type_t **type)
372 return (xdr_r_typeref_t(xdrs, typeset, type));
373 *type = NULL;
770 * Unmarshal data of the specified type
773 xdr_r_data_t(XDR *xdrs, adr_data_t **data, adr_type_t *type, char *buf)
777 switch (type->t_type) {
878 if ((*data = adr_data_new_array(type, count)) == NULL)
882 type->t_aux.t_array, buf))
898 if ((*data = adr_data_new_struct(type)) == NULL)
900 for (i = 0; i < type->t_size; i++) {
901 adr_structfield_t *sf = &type->t_aux.t_fields[i];
912 if (i < type->t_size) {
947 if (!xdr_int(xdrs, &index) || index > type->t_size || index < 0)
950 if (type->t_aux.t_enum[index].ev_name == NULL) {
955 *data = adr_data_ref(type->t_aux.t_enum[index].ev_data);
963 if (!xdr_u_int(xdrs, &index) || index > type->t_size)
965 adr_unionarm_t *ua = &type->t_aux.t_union.arms[index];
971 if (!xdr_r_data_t(xdrs, &arm, type->t_aux.t_union.type,
976 if (ua != adr_union_arm_type(type, arm)) {
994 adr_data_new_union_indexed(type, index, arm, value))
1002 "Invalid deserialized data type (%d)",
1003 type->t_type);
1031 xdr_r_optdata_t(XDR *xdrs, adr_data_t **data, adr_type_t *type)
1039 return (xdr_r_data_t(xdrs, data, type, NULL));