+ (* Check only certain types allowed in optargs. *)
+ List.iter (
+ fun (name, (_, _, optargs), _, _, _, _, _) ->
+ if List.length optargs > 64 then
+ failwithf "maximum of 64 optional args allowed for %s" name;
+
+ List.iter (
+ function
+ | Bool _ | Int _ | Int64 _ | String _ -> ()
+ | _ ->
+ failwithf "optional args of %s can only have type Bool|Int|Int64|String" name
+ ) optargs
+ ) all_functions;
+
+ (* Some parameter types not supported for daemon functions. *)
+ List.iter (
+ fun (name, (_, args, optargs), _, _, _, _, _) ->
+ let check_arg_type = function
+ | Pointer _ ->
+ failwithf "Pointer is not supported for daemon function %s."
+ name
+ | _ -> ()
+ in
+ List.iter check_arg_type args;
+ List.iter check_arg_type optargs;
+ ) daemon_functions;
+