Lines Matching defs:field
33 "[+?Duplicate structure and field names are disambiguated by appending"
42 "[d:delimiter?Set the \b--text\b field delimiter character. XML"
47 "[e:escape?Set the \b--text\b field escape character. XML"
55 "[q:quote?Set the \b--text\b field quote begin character. If"
59 "[Q:end-quote?Set the \b--text\b field quote end character. If"
66 "[t:text?Generate a field-delimited newline-terminated text schema"
71 " on then the size field \b--sized\b structures is omitted from"
567 compwidth(Cpyfield_t* field, int width)
569 switch (field->comp)
572 if (field->fixedpoint)
574 if (field->flags & CPY_signed)
596 typename(Cpyfield_t* field)
600 if (field->flags & CPY_pointer)
602 else if (field->flags & CPY_binary)
605 switch (field->comp)
632 Cpyfield_t* field;
654 if (field = cpyfield(cpy))
656 parent = field;
658 offset = field->width;
674 error(1, "accumulated field sizes %lu exceeds fixed record size %lu", offset, state.fixed);
679 error(1, "%s: maximum variable field size shortened from %d to %ld to comply with fixed record size %u", member->name, member->width, n, state.fixed);
693 sfprintf(op, "%s<NAME>%s</>\n", INDENT(lev + 1), field->name);
701 sfprintf(op, "%s<IDENT>@(#)$Id: %s (AT&T Research) %s $</>\n", INDENT(lev + 1), field->name, fmttime("%Y-%m-%d", stamp));
732 if (next = field->next)
734 while (field = next)
736 delimiter = (next = field->next) ? state.delimiter : state.terminator;
737 if (field->level == 88)
743 for (i = lev; i > 0 && field->level != levels[i]; i--);
771 field->parent = parent;
772 if (structure = field->structure)
777 (*disc->errorf)(cpy, disc, 2, "%s: empty struct", field->name);
781 parent = field;
785 (*disc->errorf)(cpy, disc, 2, "%s: nesting too deep", field->name);
793 if (state.sized && state.text && state.variable && field->parent && (field->flags & CPY_number))
795 i = strlen(field->parent->name);
796 if (!memcmp(field->parent->name, field->name, i) && strmatch(field->name + i, "?(_)(siz|SIZ|LEN|len)*"))
803 sfprintf(op, "%s<NAME>%s</>\n", INDENT(lev + 1), field->name);
804 if (field->redefines)
806 sfprintf(op, "%s<UNION>%s</>\n", INDENT(lev + 1), field->redefines->name);
809 if (field->dimension || field->maxdimension)
812 if (field->dimension)
813 sfprintf(op, "%s<SIZE>%s</>\n", INDENT(lev + 2), field->dimension);
814 if (field->maxdimension)
815 sfprintf(op, "%s<SIZE>%d</>\n", INDENT(lev + 2), field->maxdimension);
818 if (field->flags & CPY_string)
824 else if (field->flags & (CPY_number|CPY_pointer))
827 if (!(field->flags & CPY_signed))
833 else if (field->flags & CPY_binary)
837 field->width = compwidth(field, field->width);
838 if (type = typename(field))
846 if (field->fixedpoint)
847 sfprintf(op, "%s<FIXEDPOINT>%d</>\n", INDENT(lev + 2), field->fixedpoint);
848 if (field->flags & CPY_sync)
849 sfprintf(op, "%s<ALIGN>%d</>\n", INDENT(lev + 2), CPY_ALIGN(field->width));
851 if (field->flags & (CPY_string|CPY_number|CPY_pointer))
854 sfprintf(op, "%s<WIDTH>%d</>\n", INDENT(lev + 2), field->width);
855 if (state.sized && field->parent)
857 if (field->flags & CPY_number)
859 i = strlen(field->parent->name);
860 if (!memcmp(field->parent->name, field->name, i) && strmatch(field->name + i, "?(_)(siz|SIZ|LEN|len)*"))
861 field->parent->sized = field;
863 else if (field->parent->sized)
865 sfprintf(op, "%s<WIDTH>%s</>\n", INDENT(lev + 2), field->parent->sized->name);
866 field->parent->sized = 0;
876 if (field->redefines)
877 offset = field->redefines->offset;
879 if (field->flags & CPY_number)
881 c += field->comp;
882 field->width = compwidth(field, field->width);
884 width = field->width;
885 if (field->flags & CPY_sync)
891 if (field->maxdimension)
892 width *= field->maxdimension;
898 field->offset = offset;
900 if (field->structure)
903 for (member = field->next; member && member->level > field->level; member = member->next)
905 if (field->maxdimension)
906 width *= field->maxdimension;
908 else if (field->flags & CPY_pointer)
910 else if (field->flags & CPY_string)
912 else if (field->flags & CPY_number)
914 if (state.text || !(type = typename(field)))
915 type = (field->flags & CPY_signed) ? "number" : "unsigned";
917 sfprintf(sfstdout, "%s\t%lu\t%u", field->name, field->offset, width);
918 if (field->dimension)
919 sfprintf(sfstdout, "\t%s", field->dimension);
921 sfprintf(sfstdout, "\t%d", field->maxdimension);