From 05dea3a36edcb86bb8e9c1eebc83071f4a2ebd43 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 9 Aug 2019 18:04:01 +0000 Subject: doc/formatting git-svn-id: svn://tug.org/texlive/trunk@51849 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 7 +++++++ Build/source/texk/kpathsea/cnf.c | 2 +- Build/source/texk/kpathsea/progname.h | 18 +++++++++--------- Build/source/texk/kpathsea/tex-file.c | 17 ++++++++--------- Build/source/texk/kpathsea/types.h | 7 +++++-- 5 files changed, 30 insertions(+), 21 deletions(-) (limited to 'Build/source/texk/kpathsea') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index baa1b724fef..364bb21abc6 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,10 @@ +2019-08-09 Karl Berry + + * cnf.c, + * progname.h, + * tex-file.c, + * types.h: doc/formatting fixes. + 2019-08-06 Karl Berry * kpsewhich.c (USAGE, read_command_line): new option --cnf-line. diff --git a/Build/source/texk/kpathsea/cnf.c b/Build/source/texk/kpathsea/cnf.c index 9d3baeac84f..def8f97c77e 100644 --- a/Build/source/texk/kpathsea/cnf.c +++ b/Build/source/texk/kpathsea/cnf.c @@ -336,6 +336,6 @@ kpathsea_cnf_get (kpathsea kpse, const_string name) const_string kpse_cnf_get (const_string name) { - return kpathsea_cnf_get(kpse_def, name); + return kpathsea_cnf_get(kpse_def, name); } #endif diff --git a/Build/source/texk/kpathsea/progname.h b/Build/source/texk/kpathsea/progname.h index 596424b466d..b5c1c43afbd 100644 --- a/Build/source/texk/kpathsea/progname.h +++ b/Build/source/texk/kpathsea/progname.h @@ -1,6 +1,6 @@ /* progname.h: Declarations for argv[0] equivalents. - Copyright 1994, 1996, 2008, 2010-2013 Karl Berry. + Copyright 1994, 1996, 2008, 2010-2019 Karl Berry. Copyright 1999, 2005 Olaf Weber. This library is free software; you can redistribute it and/or @@ -33,20 +33,20 @@ extern "C" { extern KPSEDLL string kpathsea_selfdir (kpathsea kpse, const_string argv0); #endif -/* Set the first two variables above (if they're not predefined) to a copy - of ARGV0 and everything in ARGV0 after the last directory separator, - respectively. Set kpse_program_name to a copy of PROGNAME or the - value of kpse_invocation_short_name if PROGNAME is NULL. - This function also determines the AUTO* variables. */ +/* Set the two members `invocation_name' and `invocation_short_name' + in the KPSE instance to a copy of ARGV0 and everything in ARGV0 after + the last directory separator, respectively. Set `program_name' (also in + the KPSE instance) to a copy of PROGNAME or the value of + kpse_invocation_short_name if PROGNAME is NULL. This function also + sets the SELFAUTO* environment variables. */ extern KPSEDLL void kpathsea_set_program_name (kpathsea kpse, const_string argv0, const_string progname); -/* See also `kpathsea_reset_program_name' which is defined in tex-file.c - +/* See also `kpathsea_reset_program_name', which is defined in tex-file.c. That function is to be used to set kpse->program_name to a different value. It clears the path searching information, to ensure that - the search paths are appropriate to the new name. */ + the search paths are appropriate to the new name. */ #if defined (KPSE_COMPAT_API) diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c index 626e240b82d..335f13b45f4 100644 --- a/Build/source/texk/kpathsea/tex-file.c +++ b/Build/source/texk/kpathsea/tex-file.c @@ -1,7 +1,7 @@ /* tex-file.c: high-level file searching by format. Copyright 1993, 1994, 1995, 1996, 1997, 2007, 2008, 2009, 2010, 2011 - 2012, 2014, 2016, 2017 Karl Berry. + 2012, 2014, 2016, 2017, 2019 Karl Berry. Copyright 1998-2005 Olaf Weber. This library is free software; you can redistribute it and/or @@ -1429,7 +1429,7 @@ kpse_open_file (const_string name, kpse_file_format_type type) the paths for kpse_cnf_format and kpse_db_format are not cleared. This function is defined here, and not in progname.c, because it - need format_info, and would cause all of tex-file to be pulled + needs format_info, and would cause all of tex-file to be pulled in by programs that do not need it. */ void @@ -1445,14 +1445,14 @@ kpathsea_reset_program_name (kpathsea kpse, const_string progname) free (kpse->program_name); kpse->program_name = xstrdup (progname); - kpathsea_xputenv(kpse, "progname", kpse->program_name); + kpathsea_xputenv (kpse, "progname", kpse->program_name); - /* Clear paths -- do we want the db path to be cleared? */ + /* Go through all paths ... */ for (i = 0; i != kpse_last_format; ++i) { - /* Do not erase the cnf of db paths. This means that the filename + /* Do not erase the cnf or db paths. This means that the filename database is not rebuilt, nor are different configuration files searched. The alternative is to tolerate a memory leak of up - to 100k if this function is called. */ + to 100k if this function is called. */ if (i == kpse_cnf_format || i == kpse_db_format) continue; /* Wipe the path (it is tested) and the cnf_path because their @@ -1461,14 +1461,13 @@ kpathsea_reset_program_name (kpathsea kpse, const_string progname) free (kpse->format_info[i].path); kpse->format_info[i].path = NULL; } - /* We cannot free the cnf_path: it points into the cnf hash, which - means all hell will break loose if we did. */ + /* We cannot free cnf_path: it points into the cnf hash. */ if (kpse->format_info[i].cnf_path != NULL) { kpse->format_info[i].cnf_path = NULL; } /* We do not wipe the override_path at this point, though arguably we should provide new values. It is not likely to matter for - the programs that call this function. */ + the programs that call this function. */ } } diff --git a/Build/source/texk/kpathsea/types.h b/Build/source/texk/kpathsea/types.h index b2c15a1fdd1..f62906dec0b 100644 --- a/Build/source/texk/kpathsea/types.h +++ b/Build/source/texk/kpathsea/types.h @@ -1,6 +1,6 @@ /* types.h: general types for kpathsea. - Copyright 1993, 1995, 1996, 2005, 2008-2014, 2016 Karl Berry. + Copyright 1993, 1995, 1996, 2005, 2008-2014, 2016, 2019 Karl Berry. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,10 @@ /* Our string, boolean, etc. */ #include -/* Required until all programs use the new API, if ever. */ +/* Required forever for any normal build, since we will never want to + remove the original interface. But to check that a program + only uses the new-style declarations, that is, is thread-safe, + could be useful to undefine. */ #define KPSE_COMPAT_API 1 #include /* for FILE* */ -- cgit v1.2.3