Lines Matching defs:field

45 	/* Array of field definitions */
54 * Internal per-field flags
71 * Report data field
105 struct dm_report_field *field, const char **data)
114 field->report_string = repstr;
115 field->sort_value = (const void *) field->report_string;
121 struct dm_report_field *field, const int *data)
143 field->sort_value = sortval;
144 field->report_string = repstr;
150 struct dm_report_field *field, const uint32_t *data)
172 field->sort_value = sortval;
173 field->report_string = repstr;
179 struct dm_report_field *field, const int32_t *data)
201 field->sort_value = sortval;
202 field->report_string = repstr;
208 struct dm_report_field *field, const uint64_t *data)
230 field->sort_value = sortval;
231 field->report_string = repstr;
239 void dm_report_field_set_value(struct dm_report_field *field, const void *value, const void *sortvalue)
241 field->report_string = (const char *) value;
242 field->sort_value = sortvalue ? : value;
300 log_error("dm_report: field not match: %s",
329 * tell us when we've reached the last visible field.
366 static uint32_t _all_match(struct dm_report *rh, const char *field, size_t flen)
372 if (!strncasecmp(field, "all", 3) && flen == 3) {
389 if (!strncasecmp(t->prefix, field, prefix_len) &&
390 !strncasecmp(field + prefix_len, "all", 3) &&
412 static int _field_match(struct dm_report *rh, const char *field, size_t flen,
421 if (_is_same_field(rh->fields[f].id, field, flen,
430 if ((type = _all_match(rh, field, flen))) {
464 log_error("dm_report: Ignoring duplicate sort field: %s",
497 log_error("dm_report: Missing sort field name");
520 /* start of the field name */
529 log_error("Unrecognised field: %.*s",
552 log_error("dm_report: Unrecognised field: %.*s",
620 * To keep the code needed to add the "all" field to a minimum, we parse
621 * the field lists twice. The first time we only update the report type.
622 * FIXME Use one pass instead and expand the "all" field afterwards.
693 struct dm_report_field *field;
715 /* For each field to be displayed, call its report_fn */
717 if (!(field = dm_pool_zalloc(rh->mem, sizeof(*field)))) {
722 field->props = fp;
729 field, data,
732 "report function failed for field %s",
737 if ((strlen(field->report_string) > field->props->width))
738 field->props->width = strlen(field->report_string);
741 (field->props->flags & FLD_SORT_KEY)) {
742 (*row->sort_fields)[field->props->sort_posn] = field;
744 dm_list_add(&row->fields, &field->list);
889 static int _output_field(struct dm_report *rh, struct dm_report_field *field)
898 if (!(field_id = strdup(rh->fields[field->props->field_num].id))) {
899 log_error("dm_report: Failed to copy field name");
927 repstr = field->report_string;
928 width = field->props->width;
935 if (!(align = field->props->flags & DM_REPORT_FIELD_ALIGN_MASK))
936 align = (field->props->flags & DM_REPORT_FIELD_TYPE_NUMBER) ?
974 struct dm_report_field *field;
985 field = dm_list_item(dm_list_first(&row->fields), struct dm_report_field);
986 dm_list_del(&field->list);
993 log_error("dm_report: Failed to extend row for field name");
1003 if ((field = dm_list_item(dm_list_first(&row->fields), struct dm_report_field))) {
1004 if (!_output_field(rh, field))
1006 dm_list_del(&field->list);
1034 struct dm_report_field *field;
1036 /* If headings not printed yet, calculate field widths and print them */
1048 field = dm_list_item(fh, struct dm_report_field);
1049 if (field->props->flags & FLD_HIDDEN)
1052 if (!_output_field(rh, field))
1061 dm_list_del(&field->list);