Zbigniew Jędrzejewski-Szmek
31ddd87da0
tree-wide: extend verbs functions with extra per-verb data parameter
...
We often have a pattern where the same verb function is used for
multiple actions. This leads to an antipattern where we figure out what
action needs to be taken from argv[0] multiple times: often once in
parse_argv() to figure out what options are allowed, then once again
implicitly in dispatch_verb(), and then again in the action verb itself.
Let's allow passing a parameter into the verb to simplify this.
This matches a pattern we have in conf-parser.h, where we have both
void *userdata (more global) and void *data (per-config item). Here,
I opted for uintptr_t userdata. It seems that most of the time we'll
want to just pass an enum value. This works OK with no casts. I also
tried a void* and union. In both cases, much more boilerplate is needed:
either a cast or a macro to help avoid compiler warnings. uintptr_t
seems generic enough to cover foreseeable usecases with no fuss.
This is a noop refactoring. See next commit for an example.
2026-03-18 10:28:47 +00:00
..
2026-02-06 16:20:18 +01:00
2026-02-06 16:20:18 +01:00
2026-03-04 14:32:15 +01:00
2025-10-16 17:00:29 +02:00
2026-02-16 09:44:53 +01:00
2025-11-20 14:21:56 +01:00
2025-12-20 15:50:47 +01:00
2025-10-16 17:00:29 +02:00
2026-02-11 02:39:26 +01:00
2025-10-16 17:00:29 +02:00
2026-01-02 20:08:41 +01:00
2025-10-16 17:00:29 +02:00
2025-11-26 19:02:31 +09:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-11-22 10:19:41 +01:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-11-01 22:01:35 +01:00
2026-02-09 09:07:15 +01:00
2026-01-23 13:26:08 +08:00
2026-01-02 04:05:45 +09:00
2026-02-06 23:16:50 +01:00
2026-02-06 23:15:49 +01:00
2025-10-16 17:00:29 +02:00
2026-03-18 10:25:59 +00:00
2026-02-18 03:28:12 +09:00
2025-11-09 18:13:44 +09:00
2026-03-04 14:32:17 +01:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-11-26 19:02:31 +09:00
2025-12-15 08:50:13 +09:00
2026-01-02 04:05:45 +09:00
2026-01-02 04:05:45 +09:00
2026-02-12 09:45:13 +01:00
2025-11-26 19:02:31 +09:00
2026-01-19 13:33:28 +01:00
2026-01-19 13:33:28 +01:00
2025-10-16 17:00:29 +02:00
2025-11-26 19:02:31 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-03-04 14:32:15 +01:00
2025-10-16 17:00:29 +02:00
2025-11-06 07:45:06 +09:00
2025-11-06 07:45:06 +09:00
2025-10-16 17:00:29 +02:00
2026-02-19 15:05:15 +01:00
2026-01-02 04:05:45 +09:00
2026-02-03 15:00:32 +01:00
2026-01-02 04:05:45 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-01-04 20:05:43 +09:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-02-04 02:45:17 +09:00
2025-11-17 21:30:29 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-02-23 13:08:49 +01:00
2026-02-23 13:08:49 +01:00
2026-01-25 20:51:50 +01:00
2026-01-25 20:51:50 +01:00
2026-02-12 09:45:13 +01:00
2026-02-12 09:45:13 +01:00
2025-11-22 10:19:41 +01:00
2026-01-02 04:05:45 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-03-18 10:25:59 +00:00
2025-11-10 22:38:21 +01:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-01-19 17:49:39 +01:00
2026-01-19 17:49:39 +01:00
2026-02-07 00:15:33 +01:00
2026-02-07 00:15:33 +01:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-03-05 10:27:58 +01:00
2026-02-19 15:05:15 +01:00
2026-03-11 17:08:06 +01:00
2026-02-19 15:08:19 +01:00
2025-10-20 10:35:23 +02:00
2025-12-15 08:50:13 +09:00
2026-01-02 04:04:19 +09:00
2026-02-03 15:07:41 -05:00
2026-02-03 15:07:41 -05:00
2026-01-05 21:29:52 +09:00
2026-01-05 21:29:52 +09:00
2025-11-26 16:22:00 +09:00
2026-01-02 04:05:45 +09:00
2025-11-15 07:44:24 +01:00
2026-01-02 04:04:19 +09:00
2025-11-26 16:35:35 +09:00
2026-01-02 04:05:45 +09:00
2025-10-20 10:35:23 +02:00
2026-01-02 04:05:45 +09:00
2026-02-27 08:50:37 +01:00
2025-11-26 19:02:31 +09:00
2026-01-05 22:22:11 +09:00
2025-10-16 17:00:29 +02:00
2025-11-22 10:19:41 +01:00
2025-11-26 19:02:31 +09:00
2025-10-16 17:00:29 +02:00
2026-01-03 20:08:12 +01:00
2025-10-30 08:41:43 +01:00
2025-09-26 19:45:58 +09:00
2026-01-02 04:05:45 +09:00
2026-01-16 23:05:33 +09:00
2026-01-02 04:05:45 +09:00
2026-01-06 03:26:14 -08:00
2026-01-06 03:26:14 -08:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2025-10-16 17:00:29 +02:00
2026-01-21 15:55:06 +01:00
2026-01-21 15:49:58 +01:00
2025-10-16 17:00:29 +02:00
2026-03-18 10:25:59 +00:00
2026-03-18 10:25:59 +00:00
2026-01-19 12:51:56 +01:00
2026-01-02 04:05:45 +09:00
2025-12-20 15:50:47 +01:00
2025-11-26 19:02:31 +09:00
2026-03-06 17:46:59 +01:00
2026-03-06 17:46:59 +01:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-10-20 10:35:23 +02:00
2025-10-20 10:35:23 +02:00
2026-02-09 09:07:15 +01:00
2025-11-26 19:02:31 +09:00
2026-01-02 04:05:45 +09:00
2026-02-13 16:50:45 +09:00
2026-01-02 04:05:45 +09:00
2026-01-02 04:04:19 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-03-05 10:27:58 +01:00
2026-01-02 04:05:45 +09:00
2026-01-16 23:05:33 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-01-05 21:29:52 +09:00
2026-01-05 21:29:52 +09:00
2025-10-16 17:00:29 +02:00
2026-01-19 15:47:15 +01:00
2026-01-19 15:47:15 +01:00
2026-02-19 15:05:15 +01:00
2026-02-19 15:05:15 +01:00
2025-10-16 17:00:29 +02:00
2026-01-20 15:54:55 +01:00
2026-01-20 15:54:55 +01:00
2025-10-16 17:00:29 +02:00
2026-03-02 23:10:22 +09:00
2026-02-03 15:03:51 +01:00
2026-01-02 04:05:45 +09:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-01-20 00:22:15 +09:00
2026-02-09 13:51:59 +01:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-01-25 20:51:50 +01:00
2026-01-25 20:51:50 +01:00
2026-01-17 12:37:39 +01:00
2026-01-02 04:05:45 +09:00
2026-01-19 13:33:28 +01:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-11-22 10:19:41 +01:00
2025-11-09 18:09:31 +09:00
2025-09-22 20:08:45 +02:00
2025-10-16 17:00:29 +02:00
2026-03-06 04:04:29 +09:00
2026-01-02 13:06:14 +09:00
2026-03-05 10:27:58 +01:00
2025-10-16 17:00:29 +02:00
2025-11-26 02:40:28 +01:00
2025-11-26 02:40:28 +01:00
2025-12-15 08:50:13 +09:00
2025-11-26 19:02:31 +09:00
2025-10-16 17:00:29 +02:00
2025-10-22 10:10:24 +02:00
2025-10-22 10:10:24 +02:00
2026-03-04 14:32:15 +01:00
2026-02-23 10:43:00 +01:00
2026-01-24 20:51:45 +01:00
2026-01-02 04:04:19 +09:00
2025-11-21 17:34:43 +01:00
2025-10-31 08:57:38 +01:00
2025-09-19 17:08:03 +02:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2025-11-22 10:19:41 +01:00
2026-02-24 23:56:20 +09:00
2026-03-05 10:27:58 +01:00
2026-02-16 09:44:58 +01:00
2025-11-22 10:19:41 +01:00
2025-10-16 17:00:29 +02:00
2026-02-23 15:04:41 +00:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-10-25 11:12:16 +09:00
2026-01-16 23:05:33 +09:00
2025-10-16 17:00:29 +02:00
2026-03-09 16:25:05 +01:00
2026-01-19 13:33:26 +01:00
2026-02-20 16:22:00 +09:00
2026-02-20 16:22:00 +09:00
2025-10-16 17:00:29 +02:00
2025-12-18 10:54:51 +01:00
2026-01-02 04:05:45 +09:00
2026-01-02 04:05:45 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-10-16 03:26:39 -07:00
2025-10-16 19:06:46 +02:00
2026-02-25 11:31:06 +01:00
2026-02-25 11:31:06 +01:00
2026-01-21 12:03:07 +01:00
2026-01-04 18:01:36 +01:00
2026-01-02 04:05:45 +09:00
2026-01-02 04:05:45 +09:00
2026-02-19 10:21:01 +01:00
2026-01-02 11:09:52 +09:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2026-02-28 12:00:52 +01:00
2025-11-26 19:02:31 +09:00
2026-01-02 09:21:43 +01:00
2026-01-02 09:21:43 +01:00
2026-02-20 21:20:45 +01:00
2026-02-20 21:20:45 +01:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-03-04 14:32:16 +01:00
2025-11-22 10:19:41 +01:00
2026-03-04 14:32:16 +01:00
2025-11-22 10:19:41 +01:00
2025-10-25 11:43:00 +09:00
2025-10-25 11:43:00 +09:00
2026-03-04 15:28:06 +00:00
2026-02-17 22:00:14 +01:00
2026-02-19 07:34:44 +09:00
2025-11-02 16:07:46 +09:00
2026-02-17 22:00:14 +01:00
2026-02-17 22:00:14 +01:00
2026-01-02 11:09:52 +09:00
2025-11-26 19:02:31 +09:00
2026-02-03 13:21:03 +01:00
2026-02-03 13:21:03 +01:00
2026-02-16 14:32:38 +01:00
2025-10-16 17:00:29 +02:00
2026-02-05 14:14:38 +01:00
2026-01-21 15:09:46 +01:00
2026-01-16 23:05:33 +09:00
2025-10-16 17:00:29 +02:00
2025-09-26 09:39:00 +02:00
2025-09-26 09:39:00 +02:00
2026-01-21 00:10:08 +01:00
2026-01-21 00:09:49 +01:00
2025-12-24 08:07:59 +01:00
2025-11-26 19:02:31 +09:00
2025-10-25 11:45:20 +09:00
2025-10-16 17:00:29 +02:00
2025-11-25 17:34:48 +01:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-01-28 10:56:22 +09:00
2026-01-21 02:15:09 +01:00
2025-11-26 19:02:31 +09:00
2025-11-15 07:44:24 +01:00
2025-11-15 07:44:24 +01:00
2026-01-02 04:05:45 +09:00
2025-11-15 07:44:24 +01:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-02-25 11:35:54 +01:00
2026-01-02 12:54:18 +09:00
2025-11-22 10:19:41 +01:00
2026-01-02 04:05:45 +09:00
2025-09-26 11:12:04 +02:00
2025-11-26 19:02:31 +09:00
2025-12-15 08:50:13 +09:00
2025-11-26 19:02:31 +09:00
2025-09-25 22:43:59 +02:00
2025-10-16 17:00:29 +02:00
2026-02-23 10:43:00 +01:00
2026-02-12 09:46:37 +01:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2026-01-02 04:05:45 +09:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2025-12-15 08:50:13 +09:00
2025-10-16 17:00:29 +02:00
2026-02-09 09:05:44 +01:00
2026-02-09 09:05:44 +01:00
2025-11-26 19:02:31 +09:00
2026-01-02 04:05:45 +09:00
2025-11-20 09:59:37 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-03-03 08:48:01 +01:00
2025-10-16 17:00:29 +02:00
2026-03-13 18:13:19 +00:00
2026-02-19 15:05:15 +01:00
2025-10-16 17:00:29 +02:00
2025-12-20 15:50:47 +01:00
2026-02-23 12:28:10 +01:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2026-03-04 08:28:46 +01:00
2026-03-04 08:28:46 +01:00
2025-12-15 08:50:13 +09:00
2025-11-26 19:02:31 +09:00
2026-02-09 09:07:15 +01:00
2025-11-26 19:02:31 +09:00
2025-11-21 17:34:43 +01:00
2025-10-16 17:00:29 +02:00
2025-11-02 04:47:21 +09:00
2025-10-16 17:00:29 +02:00
2026-03-11 10:22:27 +09:00
2026-01-02 04:05:45 +09:00
2025-10-16 17:00:29 +02:00
2025-11-26 16:35:35 +09:00
2025-10-16 17:00:29 +02:00
2025-10-16 17:00:29 +02:00
2026-02-27 08:49:21 +01:00
2026-02-11 14:25:36 +01:00
2025-11-04 11:46:17 +00:00
2025-10-08 09:18:28 +02:00
2026-03-04 14:32:16 +01:00
2026-02-27 04:09:15 +01:00
2026-02-27 08:48:25 +01:00
2026-02-23 10:43:00 +01:00
2026-02-21 13:02:38 +01:00
2026-03-02 10:08:57 +00:00
2026-03-04 14:32:16 +01:00
2026-03-04 14:32:16 +01:00
2026-01-24 00:48:03 +01:00
2026-03-04 14:32:16 +01:00
2026-02-02 08:03:48 -08:00
2026-01-21 23:12:47 +01:00
2025-11-04 11:46:17 +00:00
2026-03-04 14:32:16 +01:00
2025-09-26 09:42:13 +02:00
2026-02-24 18:29:37 +01:00
2026-03-03 00:04:50 +01:00
2025-11-08 00:08:00 +09:00
2026-02-24 23:56:20 +09:00
2026-02-24 23:56:20 +09:00
2026-02-09 02:05:57 +01:00
2026-02-09 02:05:57 +01:00
2026-02-17 22:00:14 +01:00
2026-03-04 14:32:16 +01:00
2025-09-23 09:22:04 +02:00
2026-03-02 13:22:14 +09:00
2025-11-10 11:02:33 +09:00
2025-11-16 11:13:56 +09:00
2025-11-15 07:44:24 +01:00
2025-11-10 11:02:33 +09:00
2026-02-24 23:59:08 +09:00
2026-02-27 08:49:54 +01:00
2026-02-27 08:49:54 +01:00
2026-02-27 08:49:21 +01:00
2026-03-04 14:32:16 +01:00
2026-02-16 09:44:58 +01:00
2026-02-16 09:44:58 +01:00
2025-11-26 19:02:31 +09:00
2025-10-16 17:00:29 +02:00
2026-03-18 10:28:47 +00:00
2026-03-18 10:28:47 +00:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2026-02-19 15:05:15 +01:00
2026-02-19 15:05:15 +01:00
2025-10-16 17:00:29 +02:00
2025-11-26 19:02:31 +09:00
2025-10-16 17:00:29 +02:00
2026-01-02 04:05:45 +09:00
2025-10-16 17:00:29 +02:00