Skip to content

Commit

Permalink
make kpse_* companions for the new (and older) kpathsea_* fns
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@69473 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
kberry committed Jan 17, 2024
1 parent d085cb7 commit 545e941
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 26 deletions.
9 changes: 9 additions & 0 deletions texk/kpathsea/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2024-01-17 Karl Berry <[email protected]>

* tex-file.c (kpse_{in,out}_name_ok{,_silent}_extended):
declare the kpse_* abbreviations of the new (and old) kpathsea_*
functions. LuaTeX provides both kpse.* and kpathsea.* bindings,
so it's good to always have both.
* tex-file.h: declare them.
* doc/kpathsea.texi (Safe filenames): mention them.

2024-01-14 Karl Berry <[email protected]>

* version.ac: bump to 6.4.0/dev.
Expand Down
31 changes: 18 additions & 13 deletions texk/kpathsea/doc/kpathsea.info
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,11 @@ Thus:
kpathsea_in_name_ok_silent
kpathsea_in_name_ok_silent_extended

Furthermore, there are ‘kpse_...’ versions of all the above functions
(as usual), with the default library instance implicitly passed as the
first argument. LuaTeX provides both ‘kpse.*’ and ‘kpathsea.*’
bindings, so it's good to always have both.

Sorry for the combinatorial explosion, but we hope no further options
will ever be needed. If so, we'll likely provide a more generic
interface as well as the above.
Expand Down Expand Up @@ -4166,19 +4171,19 @@ Node: Programming overview100844
Node: Calling sequence103755
Node: Safe filenames109092
Ref: openout_any109251
Node: Program-specific files112839
Node: Programming with config files113892
Node: Reporting bugs115539
Node: Bug checklist116217
Node: Mailing lists119774
Node: Debugging120451
Node: Logging125708
Node: Common problems127615
Node: Unable to find files128092
Node: Slow path searching130548
Node: Unable to generate fonts131943
Node: TeX or Metafont failing134479
Node: Index135681
Node: Program-specific files113104
Node: Programming with config files114157
Node: Reporting bugs115804
Node: Bug checklist116482
Node: Mailing lists120039
Node: Debugging120716
Node: Logging125973
Node: Common problems127880
Node: Unable to find files128357
Node: Slow path searching130813
Node: Unable to generate fonts132208
Node: TeX or Metafont failing134744
Node: Index135946

End Tag Table

Expand Down
5 changes: 5 additions & 0 deletions texk/kpathsea/doc/kpathsea.texi
Original file line number Diff line number Diff line change
Expand Up @@ -3475,6 +3475,11 @@ kpathsea_in_name_ok_silent
kpathsea_in_name_ok_silent_extended
@end example

Furthermore, there are @code{kpse_...} versions of all the above
functions (as usual), with the default library instance implicitly
passed as the first argument. Lua@TeX{} provides both @code{kpse.*}
and @code{kpathsea.*} bindings, so it's good to always have both.

Sorry for the combinatorial explosion, but we hope no further options
will ever be needed. If so, we'll likely provide a more generic
interface as well as the above.
Expand Down
38 changes: 25 additions & 13 deletions texk/kpathsea/tex-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ kpathsea_name_ok (kpathsea kpse, const_string fname, const_string check_var,
boolean
kpathsea_in_name_ok_silent (kpathsea kpse, const_string fname)
{
/* For input default to all. */
return
kpathsea_name_ok (kpse, fname, "openin_any", "a", ok_reading, true, false);
}
Expand Down Expand Up @@ -1470,20 +1471,31 @@ kpathsea_out_name_ok_extended (kpathsea kpse, const_string fname)
}

#if defined (KPSE_COMPAT_API)
boolean
kpse_in_name_ok (const_string fname)
{
/* For input default to all. */
return kpathsea_in_name_ok (kpse_def, fname);
}
boolean kpse_in_name_ok (const_string fname)
{ return kpathsea_in_name_ok (kpse_def, fname); }

boolean
kpse_out_name_ok (const_string fname)
{
/* For output, default to paranoid. */
return kpathsea_out_name_ok (kpse_def, fname);
}
#endif
boolean kpse_out_name_ok (const_string fname)
{ return kpathsea_out_name_ok (kpse_def, fname); }

boolean kpse_in_name_ok_silent (const_string fname)
{ return kpathsea_in_name_ok_silent (kpse_def, fname); }

boolean kpse_out_name_ok_silent (const_string fname)
{ return kpathsea_out_name_ok_silent (kpse_def, fname); }

boolean kpse_in_name_ok_extended (const_string fname)
{ return kpathsea_in_name_ok_extended (kpse_def, fname); }

boolean kpse_out_name_ok_extended (const_string fname)
{ return kpathsea_out_name_ok_extended (kpse_def, fname); }

boolean kpse_in_name_ok_silent_extended (const_string fname)
{ return kpathsea_in_name_ok_silent_extended (kpse_def, fname); }

boolean kpse_out_name_ok_silent_extended (const_string fname)
{ return kpathsea_out_name_ok_silent_extended (kpse_def, fname); }

#endif /* KPSE_COMPAT_API */



Expand Down
10 changes: 10 additions & 0 deletions texk/kpathsea/tex-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ extern KPSEDLL void kpathsea_reset_program_name (kpathsea kpse,

#if defined (KPSE_COMPAT_API)

/* Abbreviations without the initial kpathsea argument. */
extern void kpse_init_fallback_resolutions (string envvar);

extern KPSEDLL void kpse_set_program_enabled (kpse_file_format_type fmt,
Expand All @@ -134,6 +135,15 @@ extern KPSEDLL string *kpse_find_file_generic
extern KPSEDLL boolean kpse_in_name_ok (const_string fname);
extern KPSEDLL boolean kpse_out_name_ok (const_string fname);

extern KPSEDLL boolean kpse_in_name_ok_silent (const_string fname);
extern KPSEDLL boolean kpse_out_name_ok_silent (const_string fname);

extern KPSEDLL boolean kpse_in_name_ok_extended (const_string fname);
extern KPSEDLL boolean kpse_out_name_ok_extended (const_string fname);

extern KPSEDLL boolean kpse_in_name_ok_silent_extended (const_string fname);
extern KPSEDLL boolean kpse_out_name_ok_silent_extended (const_string fname);

/* Here are some abbreviations. */
#define kpse_find_mf(name) kpse_find_file (name, kpse_mf_format, true)
#define kpse_find_mft(name) kpse_find_file (name, kpse_mft_format, true)
Expand Down

0 comments on commit 545e941

Please sign in to comment.