#include "process-util.h"
#include "signal-util.h"
#include "sort-util.h"
+#include "stat-util.h"
#include "string-util.h"
#include "strxcpyx.h"
#include "terminal-util.h"
return sizeof(pid_t);
case TABLE_MODE:
+ case TABLE_MODE_INODE_TYPE:
return sizeof(mode_t);
default:
break;
case TABLE_MODE:
+ case TABLE_MODE_INODE_TYPE:
buffer.mode = va_arg(ap, mode_t);
data = &buffer.mode;
break;
return CMP(a->pid, b->pid);
case TABLE_MODE:
+ case TABLE_MODE_INODE_TYPE:
return CMP(a->mode, b->mode);
default:
break;
}
+ case TABLE_MODE_INODE_TYPE:
+
+ if (d->mode == MODE_INVALID)
+ return table_ersatz_string(t);
+
+ return inode_type_to_string(d->mode);
+
default:
assert_not_reached();
}
return json_variant_new_integer(ret, d->int_val);
case TABLE_MODE:
+ case TABLE_MODE_INODE_TYPE:
if (d->mode == MODE_INVALID)
return json_variant_new_null(ret);
TABLE_GID,
TABLE_PID,
TABLE_SIGNAL,
- TABLE_MODE, /* as in UNIX file mode (mode_t), in typical octal output */
+ TABLE_MODE, /* as in UNIX file mode (mode_t), in typical octal output */
+ TABLE_MODE_INODE_TYPE, /* also mode_t, but displays only the inode type as string */
_TABLE_DATA_TYPE_MAX,
/* The following are not really data types, but commands for table_add_cell_many() to make changes to