Make all the format_foo() functions take the same set of arguments and add a list of prototypes in preparation for getting rid of the big-momma switch statement.
modified libpkg/pkg_printf.c
@@ -27,6 +27,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -241,14 +242,6 @@ typedef enum _fmt_code_t {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
@@ -257,119 +250,175 @@ struct percent_esc {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| + | |
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -865,10 +914,10 @@ set_list_defaults(struct percent_esc *p, const char *item_fmt,
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -883,7 +932,7 @@ iterate_item(struct sbuf *sbuf, struct pkg *pkg, void *data, int count,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -908,8 +957,10 @@ iterate_item(struct sbuf *sbuf, struct pkg *pkg, void *data, int count,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -936,9 +987,10 @@ format_shlibs(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -949,8 +1001,10 @@ format_shlib_name(struct sbuf *sbuf, struct pkg_shlib *shlib,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -978,9 +1032,10 @@ format_categories(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -991,8 +1046,10 @@ format_category_name(struct sbuf *sbuf, struct pkg_category *cat,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1019,9 +1076,11 @@ format_directories(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1029,9 +1088,10 @@ format_directory_group(struct sbuf *sbuf, struct pkg_dir *dir,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
|
|
|
|
|
@@ -1039,9 +1099,10 @@ format_directory_keepflag(struct sbuf *sbuf, struct pkg_dir *dir,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1049,9 +1110,11 @@ format_directory_path(struct sbuf *sbuf, struct pkg_dir *dir,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1059,9 +1122,11 @@ format_directory_perms(struct sbuf *sbuf, struct pkg_dir *dir,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1069,9 +1134,11 @@ format_directory_tryflag(struct sbuf *sbuf, struct pkg_dir *dir,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1082,8 +1149,10 @@ format_directory_user(struct sbuf *sbuf, struct pkg_dir *dir,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1110,9 +1179,10 @@ format_files(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1120,9 +1190,10 @@ format_file_group(struct sbuf *sbuf, struct pkg_file *file,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1130,9 +1201,10 @@ format_file_keepflag(struct sbuf *sbuf, struct pkg_file *file,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1140,9 +1212,10 @@ format_file_path(struct sbuf *sbuf, struct pkg_file *file,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1150,9 +1223,10 @@ format_file_perms(struct sbuf *sbuf, struct pkg_file *file,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1160,9 +1234,10 @@ format_file_sha256(struct sbuf *sbuf, struct pkg_file *file,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1173,8 +1248,10 @@ format_file_user(struct sbuf *sbuf, struct pkg_file *file,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1201,9 +1278,10 @@ format_groups(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1211,9 +1289,10 @@ format_group_gidstr(struct sbuf *sbuf, struct pkg_group *group,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1221,8 +1300,10 @@ format_group_name(struct sbuf *sbuf, struct pkg_group *group,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1232,8 +1313,10 @@ format_row_counter(struct sbuf *sbuf, int *counter, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1264,9 +1347,10 @@ format_licenses(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1274,9 +1358,10 @@ format_license_name(struct sbuf *sbuf, struct pkg_license *license,
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1288,8 +1373,10 @@ format_message(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1316,9 +1403,10 @@ format_options(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1326,9 +1414,10 @@ format_option_name(struct sbuf *sbuf, struct pkg_option *option,
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1339,8 +1428,10 @@ format_option_value(struct sbuf *sbuf, struct pkg_option *option,
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1367,19 +1458,21 @@ format_users(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1389,9 +1482,10 @@ format_user_uidstr(struct sbuf *sbuf, struct pkg_user *user,
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1401,9 +1495,10 @@ format_autoremove(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1415,8 +1510,9 @@ format_comment(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
|
|
|
|
|
@@ -1444,9 +1540,11 @@ format_dependencies(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1454,9 +1552,11 @@ format_dependency_name(struct sbuf *sbuf, struct pkg_dep *dep,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1464,9 +1564,11 @@ format_dependency_origin(struct sbuf *sbuf, struct pkg_dep *dep,
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1474,9 +1576,10 @@ format_dependency_version(struct sbuf *sbuf, struct pkg_dep *dep,
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1488,9 +1591,10 @@ format_add_info(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1502,11 +1606,12 @@ format_lock_status(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1538,9 +1643,10 @@ format_license_logic(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1550,9 +1656,10 @@ format_maintainer(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1562,9 +1669,10 @@ format_name(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1574,9 +1682,10 @@ format_origin(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1588,8 +1697,10 @@ format_prefix(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1620,9 +1731,10 @@ format_requirements(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1635,10 +1747,10 @@ format_flatsize(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1658,9 +1770,10 @@ format_install_tstamp(struct sbuf *sbuf, struct pkg *pkg,
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1670,10 +1783,10 @@ format_version(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1683,7 +1796,7 @@ format_home_url(struct sbuf *sbuf, struct pkg *pkg,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|