Lines Matching defs:ti

44 	ndr_typeinfo_t		*ti;
76 ndr_typeinfo_t *ti;
83 for (ti = typeinfo_list; ti; ti = ti->next) {
84 switch (ti->type_op) {
101 type_extern_suffix(ti, fname_type, NDLBUFSZ);
102 if (ti->is_extern) {
105 } else if (!ti->is_referenced) {
112 ti->type_op);
117 show_advice(&ti->advice, 0);
118 (void) printf("%s %s {\n", p, ti->type_name->n_sym->name);
120 for (i = 0; i < ti->n_member; i++) {
121 mem = &ti->member[i];
136 ti->size_fixed_part,
137 ti->size_variable_part,
138 ti->alignment,
139 ti->complete,
140 ti->has_pointers);
147 ndr_typeinfo_t *ti;
152 for (ti = tsti; ti; ti = ti->type_down) {
153 switch (ti->type_op) {
159 ti->type_name->n_sym->name);
167 if (ti->type_dim) {
169 ti->type_dim->n_int);
180 (void) snprintf(p_fb, buflen, "?<%d>", ti->type_op);
191 ndr_typeinfo_t *ti;
199 ti = tup->ti;
201 switch (ti->type_op) {
206 "", ti->type_name->n_sym->name, *fb ? " " : "", fb);
212 "struct ", ti->type_name->n_sym->name, *fb ? " " : "", fb);
218 "union ", ti->type_name->n_sym->name, *fb ? " " : "", fb);
234 if (ti->type_dim) {
236 p, ti->type_dim->n_int);
255 compile_error("unknown type or keyword <%d>", ti->type_op);
263 ndr_typeinfo_t *ti;
269 for (ti = tsti; ti; ti = ti->type_down, n_tt++) {
272 tup->ti = ti;
318 ndr_typeinfo_t *ti;
320 for (ti = typeinfo_list; ti; ti = ti->next) {
321 switch (ti->type_op) {
323 analyze_typeinfo_struct(ti);
327 analyze_typeinfo_union(ti);
331 analyze_typeinfo_typedef(ti);
338 analyze_typeinfo_typedef(ndr_typeinfo_t *ti)
346 assert(ti->type_op == TYPEDEF_KW);
351 determine_advice(&ti->advice, ti->definition->n_c_advice);
357 mem_np = ti->definition->n_c_members;
360 assert(i < ti->n_member);
361 mem = &ti->member[i];
369 assert(1 == ti->n_member);
371 analyze_typeinfo_aggregate_finish(ti);
374 while (offset & ti->alignment)
377 ti->size_fixed_part = offset;
381 analyze_typeinfo_struct(ndr_typeinfo_t *ti)
389 assert(ti->type_op == STRUCT_KW);
395 determine_advice(&ti->advice, ti->definition->n_c_advice);
401 mem_np = ti->definition->n_c_members;
405 assert(i < ti->n_member);
406 mem = &ti->member[i];
408 if (!ti->advice.a_operation /* no var-size in op param */ &&
409 i == ti->n_member-1) /* only last mem may be var-size */
416 assert(i == ti->n_member);
418 analyze_typeinfo_aggregate_finish(ti); /* align,complete,ptrs,etc */
421 while (offset & ti->alignment)
424 ti->size_fixed_part = offset;
427 mem = &ti->member[ti->n_member-1];
428 ti->size_variable_part = mem->type->size_variable_part;
430 if (ti->size_variable_part)
431 ti->is_conformant = 1;
435 analyze_typeinfo_union(ndr_typeinfo_t *ti)
443 assert(ti->type_op == UNION_KW);
449 determine_advice(&ti->advice, ti->definition->n_c_advice);
455 mem_np = ti->definition->n_c_members;
459 assert(i < ti->n_member);
460 mem = &ti->member[i];
470 assert(i == ti->n_member);
472 analyze_typeinfo_aggregate_finish(ti); /* align,complete,ptrs,etc */
475 while (size & ti->alignment)
478 ti->size_fixed_part = size;
482 analyze_typeinfo_aggregate_finish(ndr_typeinfo_t *ti)
489 for (i = 0; i < ti->n_member; i++) {
490 mem = &ti->member[i];
494 ti->alignment |= mem->type->alignment;
497 ti->complete = complete;
498 ti->has_pointers = has_pointers;
758 ndr_typeinfo_t *ti;
768 ti = ndr_alloc(1, sizeof (ndr_typeinfo_t));
770 ti->type_op = BASIC_TYPE;
771 ti->definition = &sym->s_node;
772 ti->type_name = &sym->s_node;
773 ti->size_fixed_part = sym->kw->value;
774 ti->alignment = ti->size_fixed_part - 1;
775 ti->complete = 1;
776 ti->is_extern = 1;
778 append_typeinfo(ti);
782 proto_ti.type_down = ti;
784 ti = bind_typeinfo(&proto_ti);
785 ti->is_extern = 1;
795 ndr_typeinfo_t *ti;
799 ti = ndr_alloc(1, sizeof (ndr_typeinfo_t));
801 ti->type_op = construct->label;
802 ti->definition = construct;
804 switch (ti->type_op) {
808 ti->type_name = construct->n_c_typename;
815 ti->n_member = n_member;
817 ti->member = ndr_alloc(n_member,
822 fatal_error("seed_construct unknown %d\n", ti->type_op);
826 determine_advice(&ti->advice, construct->n_c_advice);
828 ti->is_referenced = 1; /* always generate */
830 append_typeinfo(ti);
835 append_typeinfo(ndr_typeinfo_t *ti)
842 *pp = ti;
843 ti->next = 0;
849 ndr_typeinfo_t *ti;
852 for (ti = typeinfo_list; ti; ti = ti->next) {
853 if (ti->type_op != proto_ti->type_op)
856 switch (ti->type_op) {
858 if (ti->type_down != proto_ti->type_down)
863 if (ti->type_down != proto_ti->type_down)
868 if (ti->type_down != proto_ti->type_down)
870 if (ti->type_dim != proto_ti->type_dim)
878 if (ti->type_name != proto_ti->type_name)
883 fatal_error("bind_typeinfo unknown %d\n", ti->type_op);
887 return (ti);
890 ti = ndr_alloc(1, sizeof (ndr_typeinfo_t));
892 *ti = *proto_ti;
893 append_typeinfo(ti);
895 switch (ti->type_op) {
897 ti->size_fixed_part = 4;
898 ti->alignment = 3;
899 ti->complete = 1;
900 ti->has_pointers = 1;
906 ti->alignment = tdti->alignment;
909 } else if (ti->type_dim) {
910 ti->size_fixed_part = tdti->size_fixed_part *
911 ti->type_dim->n_int;
913 ti->size_variable_part = tdti->size_fixed_part;
914 ti->is_conformant = 1;
920 ti->has_pointers = tdti->has_pointers;
921 ti->complete = 1;
925 compile_error("bind_type internal error op=%d", ti->type_op);
934 if (ti->type_op == STAR && ti->type_down->type_op == UNION_KW) {
943 if (ti->type_op == LB && ti->type_down->type_op == UNION_KW) {
947 return (ti);
953 ndr_typeinfo_t *ti;
955 for (ti = typeinfo_list; ti; ti = ti->next) {
956 if (ti->type_name == typename)
957 return (ti);
963 ti = ndr_alloc(1, sizeof (ndr_typeinfo_t));
964 ti->type_op = BASIC_TYPE;
965 ti->definition = typename;
966 ti->type_name = typename;
967 ti->size_fixed_part = 0;
968 ti->alignment = 0;
970 append_typeinfo(ti);
971 return (ti);