Lines Matching refs:types

45 #include <sys/types.h>
69 /* An expandable array of types. */
71 enum typeid *table; /* table of types */
85 inittypes(struct typetable *types)
89 types->table = types->stattable;
90 types->tablesize = STATIC_ARG_TBL_SIZE;
91 types->tablemax = 0;
92 types->nextarg = 1;
94 types->table[n] = T_UNUSED;
101 freetypes(struct typetable *types)
104 if (types->table != types->stattable)
105 free (types->table);
113 _ensurespace(struct typetable *types)
116 if (types->nextarg >= types->tablesize) {
117 if (__grow_type_table(types))
120 if (types->nextarg > types->tablemax)
121 types->tablemax = types->nextarg;
130 addtype(struct typetable *types, enum typeid type)
133 if (_ensurespace(types))
135 types->table[types->nextarg++] = type;
140 addsarg(struct typetable *types, int flags)
143 if (_ensurespace(types))
146 types->table[types->nextarg++] = T_INTMAXT;
148 types->table[types->nextarg++] = T_SSIZET;
150 types->table[types->nextarg++] = T_PTRDIFFT;
152 types->table[types->nextarg++] = T_LLONG;
154 types->table[types->nextarg++] = T_LONG;
156 types->table[types->nextarg++] = T_INT;
161 adduarg(struct typetable *types, int flags)
164 if (_ensurespace(types))
167 types->table[types->nextarg++] = T_UINTMAXT;
169 types->table[types->nextarg++] = T_SIZET;
171 types->table[types->nextarg++] = T_SIZET;
173 types->table[types->nextarg++] = T_U_LLONG;
175 types->table[types->nextarg++] = T_U_LONG;
177 types->table[types->nextarg++] = T_U_INT;
185 addaster(struct typetable *types, char **fmtp)
197 int hold = types->nextarg;
198 types->nextarg = n2;
199 if (addtype(types, T_INT))
201 types->nextarg = hold;
204 if (addtype(types, T_INT))
211 addwaster(struct typetable *types, wchar_t **fmtp)
223 int hold = types->nextarg;
224 types->nextarg = n2;
225 if (addtype(types, T_INT))
227 types->nextarg = hold;
230 if (addtype(types, T_INT))
251 struct typetable types; /* table of types */
254 inittypes(&types);
275 if ((error = addaster(&types, &fmt)))
284 if ((error = addaster(&types, &fmt)))
302 types.nextarg = n;
341 error = addtype(&types,
351 if ((error = addsarg(&types, flags)))
362 error = addtype(&types,
370 error = addtype(&types, TP_INTMAXT);
372 error = addtype(&types, TP_PTRDIFFT);
374 error = addtype(&types, TP_SSIZET);
376 error = addtype(&types, TP_LLONG);
378 error = addtype(&types, TP_LONG);
380 error = addtype(&types, TP_SHORT);
382 error = addtype(&types, TP_SCHAR);
384 error = addtype(&types, TP_INT);
392 if ((error = adduarg(&types, flags)))
396 if ((error = addtype(&types, TP_VOID)))
403 error = addtype(&types,
414 if ((error = adduarg(&types, flags)))
424 build_arg_table(&types, ap, argtable);
426 freetypes(&types);
439 struct typetable types; /* table of types */
442 inittypes(&types);
463 if ((error = addwaster(&types, &fmt)))
472 if ((error = addwaster(&types, &fmt)))
490 types.nextarg = n;
529 error = addtype(&types,
539 if ((error = addsarg(&types, flags)))
550 error = addtype(&types,
558 error = addtype(&types, TP_INTMAXT);
560 error = addtype(&types, TP_PTRDIFFT);
562 error = addtype(&types, TP_SSIZET);
564 error = addtype(&types, TP_LLONG);
566 error = addtype(&types, TP_LONG);
568 error = addtype(&types, TP_SHORT);
570 error = addtype(&types, TP_SCHAR);
572 error = addtype(&types, TP_INT);
580 if ((error = adduarg(&types, flags)))
584 if ((error = addtype(&types, TP_VOID)))
591 error = addtype(&types,
602 if ((error = adduarg(&types, flags)))
612 build_arg_table(&types, ap, argtable);
614 freetypes(&types);
622 __grow_type_table(struct typetable *types)
624 enum typeid *const oldtable = types->table;
625 const int oldsize = types->tablesize;
629 if (newsize < types->nextarg + 1)
630 newsize = types->nextarg + 1;
643 types->table = newtable;
644 types->tablesize = newsize;
654 build_arg_table(struct typetable *types, va_list ap, union arg **argtable)
658 if (types->tablemax >= STATIC_ARG_TBL_SIZE) {
660 malloc (sizeof (union arg) * (types->tablemax + 1));
666 for (n = 1; n <= types->tablemax; n++) {
667 switch (types->table[n]) {