diff --git a/tools/make_requests b/tools/make_requests index de7c68c806f..59e7f9d1207 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -312,3 +312,19 @@ foreach my $req (@requests) push @trace_lines, "};\n"; REPLACE_IN_FILE( "server/trace.c", @trace_lines ); + +### Output the request handlers list + +my @request_lines = (); + +foreach my $req (@requests) { push @request_lines, "DECL_HANDLER($req);\n"; } +push @request_lines, "\n#ifdef WANT_REQUEST_HANDLERS\n\n"; +push @request_lines, "typedef void (*req_handler)( const void *req, void *reply );\n"; +push @request_lines, "static const req_handler req_handlers[REQ_NB_REQUESTS] =\n{\n"; +foreach my $req (@requests) +{ + push @request_lines, " (req_handler)req_$req,\n"; +} +push @request_lines, "};\n#endif /* WANT_REQUEST_HANDLERS */\n"; + +REPLACE_IN_FILE( "server/request.h", @request_lines );