Zeitwerk needs to be able to check if a given class or module has an autoload defined for a certain constant name, that would be autoload?(cname, false), similar to const_defined?(cname, false).
Changing the signature of rb_autoload_p could break API compatibility.
I think we'll need another function for it.
Maybe rb_autoload_at_p like as rb_const_defined_at?
Is it necessary to export rb_autoload_at_p?
Do you have the plan to use it in extension libraries?
No I have no such plan. I did so because it's defined in variable.c but called from load.c so without that declaration it won't compile:
load.c:1180:12: error: implicit declaration of function 'rb_autoload_at_p' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return rb_autoload_at_p(mod, id, recur);
I'm quite a MRI & C beginner though, so if there is a better way to do it I'll gladly change it.
@Eregon (Benoit Daloze) told me which place to declare internal functions. It's now in internal.h