extern C in jlapi.c

and DLLEXPORT on basename, dirname