X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Ftable.h;h=e35fefaf4b061d5ae23fc7caaa756c69a02ea4b8;hb=42bb6c72b58ba99e59e740f8cca4e201d7efaa02;hp=c24bca2a7aafe4fc0f18c39a369f86486620fbfe;hpb=3a3eb9daef012e58d6604a6fc726a5115b25945f;p=openvswitch diff --git a/lib/table.h b/lib/table.h index c24bca2a..e35fefaf 100644 --- a/lib/table.h +++ b/lib/table.h @@ -59,6 +59,7 @@ struct cell *table_add_cell(struct table *); enum table_format { TF_TABLE, /* 2-d table. */ + TF_LIST, /* One cell per line, one row per paragraph. */ TF_HTML, /* HTML table. */ TF_CSV, /* Comma-separated lines. */ TF_JSON /* JSON. */ @@ -66,6 +67,7 @@ enum table_format { enum cell_format { CF_STRING, /* String format. */ + CF_BARE, /* String format without most punctuation. */ CF_JSON /* JSON. */ }; @@ -80,13 +82,15 @@ struct table_style { #define TABLE_OPTION_ENUMS \ OPT_NO_HEADINGS, \ - OPT_PRETTY + OPT_PRETTY, \ + OPT_BARE #define TABLE_LONG_OPTIONS \ {"format", required_argument, 0, 'f'}, \ {"data", required_argument, 0, 'd'}, \ {"no-headings", no_argument, 0, OPT_NO_HEADINGS}, \ - {"pretty", no_argument, 0, OPT_PRETTY}, + {"pretty", no_argument, 0, OPT_PRETTY}, \ + {"bare", no_argument, 0, OPT_BARE} #define TABLE_OPTION_HANDLERS(STYLE) \ case 'f': \ @@ -103,6 +107,12 @@ struct table_style { \ case OPT_PRETTY: \ (STYLE)->json_flags |= JSSF_PRETTY; \ + break; \ + \ + case OPT_BARE: \ + (STYLE)->format = TF_LIST; \ + (STYLE)->cell_format = CF_BARE; \ + (STYLE)->headings = false; \ break; void table_parse_format(struct table_style *, const char *format);