/* column names */
struct colinfo {
- const char *name; /* header */
- double whint; /* width hint (N < 1 is in percent of termwidth) */
- int flags; /* SCOLS_FL_* */
- const char *help;
+ const char * const name; /* header */
+ double whint; /* width hint (N < 1 is in percent of termwidth) */
+ int flags; /* SCOLS_FL_* */
+ const char *help;
};
/* columns descriptions */
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_PARTNO] = { "NR", 0.25, SCOLS_FL_RIGHT, N_("partition number") },
[COL_START] = { "START", 0.30, SCOLS_FL_RIGHT, N_("start of the partition in sectors") },
[COL_END] = { "END", 0.30, SCOLS_FL_RIGHT, N_("end of the partition in sectors") },
return columns[num];
}
-static inline struct colinfo *get_column_info(int num)
+static inline const struct colinfo *get_column_info(int num)
{
return &infos[ get_column_id(num) ];
}
scols_table_enable_noheadings(table, !!(scols_flags & PARTX_NOHEADINGS));
for (i = 0; (size_t)i < ncolumns; i++) {
- struct colinfo *col = get_column_info(i);
+ const struct colinfo *col = get_column_info(i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags)) {
warnx(_("failed to allocate output column"));
static const struct topology_val {
/* /sys/dev/block/<maj>:<min>/<ATTR> */
- const char *attr;
+ const char * const attr;
/* functions to set probing result */
int (*set_ulong)(blkid_probe, unsigned long);
*
*/
-static const char *bsd_dktypenames[] = {
+static const char * const bsd_dktypenames[] = {
"unknown",
"SMD",
"MSCP",
* column description
*/
struct lslogins_coldesc {
- const char *name;
+ const char * const name;
const char *help;
const char *pretty_name;
struct colinfo {
- const char *name;
+ const char * const name;
double whint;
int flags;
const char *help;
COL_RES
};
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_PAGES] = { "PAGES", 1, SCOLS_FL_RIGHT, N_("file data resident in memory in pages")},
[COL_RES] = { "RES", 5, SCOLS_FL_RIGHT, N_("file data resident in memory in bytes")},
[COL_SIZE] = { "SIZE", 5, SCOLS_FL_RIGHT, N_("size of the file")},
/* column names */
struct colinfo {
- const char *name; /* header */
+ const char * const name; /* header */
double whint; /* width hint (N < 1 is in percent of termwidth) */
int flags; /* libsmartcols flags */
const char *help; /* column description */
/* column names */
struct colinfo {
- const char *name; /* header */
+ const char * const name; /* header */
double whint; /* width hint (N < 1 is in percent of termwidth) */
int flags; /* SCOLS_FL_* */
const char *help;
};
/* columns descriptions */
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_ALIOFF] = { "ALIGNMENT", 6, SCOLS_FL_RIGHT, N_("alignment offset"), COLTYPE_NUM },
[COL_ID] = { "ID", 0.1, SCOLS_FL_NOEXTREMES, N_("udev ID (based on ID-LINK)") },
[COL_IDLINK] = { "ID-LINK", 0.1, SCOLS_FL_NOEXTREMES, N_("the shortest udev /dev/disk/by-id link name") },
}
/* Returns column description for the column sequential number */
-static struct colinfo *get_column_info(int num)
+static const struct colinfo *get_column_info(int num)
{
return &infos[ get_column_id(num) ];
}
}
for (i = 0; i < ncolumns; i++) {
- struct colinfo *ci = get_column_info(i);
+ const struct colinfo *ci = get_column_info(i);
struct libscols_column *cl;
int id = get_column_id(i), fl = ci->flags;
/* column names */
struct colinfo {
- const char *name; /* header */
- double whint; /* width hint (N < 1 is in percent of termwidth) */
- int flags; /* SCOLS_FL_* */
- const char *help;
+ const char * const name; /* header */
+ double whint; /* width hint (N < 1 is in percent of termwidth) */
+ int flags; /* SCOLS_FL_* */
+ const char *help;
};
/* columns descriptions */
}
-static inline struct colinfo *get_column_info(unsigned num)
+static inline const struct colinfo *get_column_info(unsigned num)
{
return &infos[ get_column_id(num) ];
}
for (i = 0; i < ncolumns; i++) {
struct libscols_column *cl;
- struct colinfo *col = get_column_info(i);
+ const struct colinfo *col = get_column_info(i);
cl = scols_table_new_column(table, col->name, col->whint, col->flags);
if (!cl)
static int json;
struct colinfo {
- const char *name;
+ const char * const name;
double whint;
int flags;
const char *help;
int json_type; /* default is string */
};
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_AUTOCLR] = { "AUTOCLEAR", 1, SCOLS_FL_RIGHT, N_("autoclear flag set"), SCOLS_JSON_BOOLEAN},
[COL_BACK_FILE] = { "BACK-FILE", 0.3, SCOLS_FL_NOEXTREMES, N_("device backing file")},
[COL_BACK_INO] = { "BACK-INO", 4, SCOLS_FL_RIGHT, N_("backing file inode number"), SCOLS_JSON_NUMBER},
return columns[num];
}
-static struct colinfo *get_column_info(int num)
+static const struct colinfo *get_column_info(int num)
{
return &infos[ get_column_id(num) ];
}
scols_table_set_name(tb, "loopdevices");
for (i = 0; i < ncolumns; i++) {
- struct colinfo *ci = get_column_info(i);
+ const struct colinfo *ci = get_column_info(i);
struct libscols_column *cl;
cl = scols_table_new_column(tb, ci->name, ci->whint, ci->flags);
};
struct lsipc_coldesc {
- const char *name;
+ const char * const name;
const char *help;
const char *pretty_name;
/* column names */
struct colinfo {
- const char *name; /* header */
- double whint; /* width hint (N < 1 is in percent of termwidth) */
- int flags; /* SCOLS_FL_* */
- const char *help;
+ const char * const name; /* header */
+ double whint; /* width hint (N < 1 is in percent of termwidth) */
+ int flags; /* SCOLS_FL_* */
+ const char *help;
};
/* columns descriptions */
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_RES] = { "RESOURCE", 0.25, SCOLS_FL_TRUNC, N_("resource name") },
[COL_HELP] = { "DESCRIPTION", 0.1, SCOLS_FL_TRUNC, N_("resource description")},
[COL_SOFT] = { "SOFT", 0.1, SCOLS_FL_RIGHT, N_("soft limit")},
return columns[num];
}
-static inline struct colinfo *get_column_info(unsigned num)
+static inline const struct colinfo *get_column_info(unsigned num)
{
return &infos[ get_column_id(num) ];
}
scols_table_enable_noheadings(table, no_headings);
for (i = 0; i < ncolumns; i++) {
- struct colinfo *col = get_column_info(i);
+ const struct colinfo *col = get_column_info(i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags))
err(EXIT_FAILURE, _("failed to allocate output column"));
/* column names */
struct colinfo {
- const char *name; /* header */
- double whint; /* width hint (N < 1 is in percent of termwidth) */
- int flags; /* SCOLS_FL_* */
- const char *help;
+ const char * const name; /* header */
+ double whint; /* width hint (N < 1 is in percent of termwidth) */
+ int flags; /* SCOLS_FL_* */
+ const char *help;
};
enum {
COL_UUID,
COL_LABEL
};
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_PATH] = { "NAME", 0.20, 0, N_("device file or partition path") },
[COL_TYPE] = { "TYPE", 0.20, SCOLS_FL_TRUNC, N_("type of the device")},
[COL_SIZE] = { "SIZE", 0.20, SCOLS_FL_RIGHT, N_("size of the swap area")},
return ctl->columns[num];
}
-static inline struct colinfo *get_column_info(const struct swapon_ctl *ctl, unsigned num)
+static inline const struct colinfo *get_column_info(const struct swapon_ctl *ctl, unsigned num)
{
return &infos[get_column_id(ctl, num)];
}
scols_table_enable_noheadings(table, ctl->no_heading);
for (i = 0; i < ctl->ncolumns; i++) {
- struct colinfo *col = get_column_info(ctl, i);
+ const struct colinfo *col = get_column_info(ctl, i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags))
err(EXIT_FAILURE, _("failed to allocate output column"));
/* column names */
struct colinfo {
- const char *name; /* header */
- double whint; /* width hint (N < 1 is in percent of termwidth) */
- int flags; /* SCOLS_FL_* */
- const char *help;
+ const char * const name; /* header */
+ double whint; /* width hint (N < 1 is in percent of termwidth) */
+ int flags; /* SCOLS_FL_* */
+ const char *help;
};
enum { COL_FLAG, COL_DESC, COL_STATUS, COL_BSTATUS, COL_DEVICE };
/* columns descriptions */
-static struct colinfo infos[] = {
+static const struct colinfo infos[] = {
[COL_FLAG] = { "FLAG", 14, 0, N_("flag name") },
[COL_DESC] = { "DESCRIPTION", 0.1, SCOLS_FL_TRUNC, N_("flag description") },
[COL_STATUS] = { "STATUS", 1, SCOLS_FL_RIGHT, N_("flag status") },
return columns[num];
}
-static struct colinfo *get_column_info(unsigned num)
+static const struct colinfo *get_column_info(unsigned num)
{
return &infos[ get_column_id(num) ];
}
/* define columns */
for (i = 0; i < (size_t) ncolumns; i++) {
- struct colinfo *col = get_column_info(i);
+ const struct colinfo *col = get_column_info(i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags)) {
warnx(_("failed to allocate output column"));