Skip to content
Snippets Groups Projects
Commit bd44869c authored by Luigi Scarso's avatar Luigi Scarso
Browse files

clean up for kpse in luatex

parent 3c1cd91d
Branches
Tags
No related merge requests found
......@@ -374,5 +374,6 @@ extern extinfo *copy_variants(extinfo * o);
extern int program_name_set; /* in lkpselib.c */
extern int kpse_init; /* in luainit.w */
extern int kpse_available(const char * m); /* in texfileio.w */
#endif /* PTEXLIB_H */
......@@ -107,13 +107,21 @@ static char *find_in_output_directory(const char *s)
@ find an \.{\\input} or \.{\\read} file. |n| differentiates between those case.
@c
int kpse_available(const char *m) {
if (!kpse_init) {
fprintf(stdout,"missing kpse replacement callback '%s', quitting\n",m);
exit(1);
}
return 1 ;
}
char *luatex_find_read_file(const char *s, int n, int callback_index)
{
char *ftemp = NULL;
int callback_id = callback_defined(callback_index);
if (callback_id > 0) {
(void) run_callback(callback_id, "dS->R", n, s, &ftemp);
} else {
} else if (kpse_available("find_read_file")) {
/* use kpathsea here */
ftemp = find_in_output_directory(s);
if (!ftemp)
......@@ -136,7 +144,7 @@ char *luatex_find_file(const char *s, int callback_index)
if (callback_id > 0) {
(void) run_callback(callback_id, "S->R", s, &ftemp);
} else {
} else if (kpse_available("find_read_file")) {
/* use kpathsea here */
switch (callback_index) {
case find_enc_file_callback:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment