summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-02-10 13:34:19 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-02-10 13:34:19 +0000
commitfafab64e8f37f145b91f6121d63756991bd47a08 (patch)
treecfc628c435fa0eedf50b97801cf78f1cb67c5d0a /Build/source/texk/kpathsea
parentc277be633776e18bea8e2c1587b7a4d020e972b1 (diff)
minor cleanup of kpathsea headers
git-svn-id: svn://tug.org/texlive/trunk@16956 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog12
-rw-r--r--Build/source/texk/kpathsea/mingw32.c40
-rw-r--r--Build/source/texk/kpathsea/mingw32.h10
-rw-r--r--Build/source/texk/kpathsea/tex-make.c1
4 files changed, 38 insertions, 25 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 28f229ad0a3..0680525d419 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * mingw32.c (get_home_directory, _parse_root,
+ normalize_filename, dostounix_filename, unixtodos_filename,
+ crlf_to_lf, parse_cmdline, build_cmdline, win32_system):
+ Declare as static.
+ (dostounix_filename, crlf_to_lf): Drop unused functions.
+ (win32_system): Drop unused code for look_for_cmd() with 3 args.
+ * mingw32.h: Remove decl of get_home_directory(), add
+ quote_args(), use explicit 'extern'.
+ * tex-make.c (maketex): Drop nested extern decl of quote_args().
+
2010-02-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* mingw32.c (look_for_cmd): remove unused variable new_cmd,
diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c
index 9523383e2ec..da08a469437 100644
--- a/Build/source/texk/kpathsea/mingw32.c
+++ b/Build/source/texk/kpathsea/mingw32.c
@@ -42,7 +42,8 @@ typedef HRESULT (WINAPI * pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL);
extern int __cdecl _set_osfhnd (int fd, long h);
extern int __cdecl _free_osfhnd (int fd);
-int _parse_root (char * name, char ** pPath);
+static char *get_home_directory (void);
+static int _parse_root (char * name, char ** pPath);
void
init_user_info (void)
@@ -80,7 +81,7 @@ set_home_warning (void)
}
/* Returns the home directory, in external format */
-char *
+static char *
get_home_directory (void)
{
char *found_home_directory = NULL;
@@ -163,7 +164,7 @@ get_home_directory (void)
drive specifier or double path separator.
*/
-int
+static int
normalize_filename (char *fp, char path_sep)
{
char *p;
@@ -211,14 +212,16 @@ normalize_filename (char *fp, char path_sep)
/* Destructively turn backslashes into slashes. */
-void
+#if 0 /* unused */
+static void
dostounix_filename (char *p)
{
normalize_filename (p, '/');
}
+#endif
/* Destructively turn slashes into backslashes. */
-void
+static void
unixtodos_filename (char *p)
{
normalize_filename (p, '\\');
@@ -227,7 +230,8 @@ unixtodos_filename (char *p)
/* Remove all CR's that are followed by a LF.
(From msdos.c...probably should figure out a way to share it,
although this code isn't going to ever change.) */
-int
+#if 0 /* unused */
+static int
crlf_to_lf (int n, unsigned char *buf, unsigned *lf_count)
{
unsigned char *np = buf;
@@ -256,10 +260,11 @@ crlf_to_lf (int n, unsigned char *buf, unsigned *lf_count)
}
return np - startp;
}
+#endif
/* Parse the root part of file name, if present. Return length and
optionally store pointer to char after root. */
-int
+static int
_parse_root (char * name, char ** pPath)
{
char * start = name;
@@ -389,8 +394,8 @@ win32_get_long_filename (char * name, char * buf, int size)
This does make sense only under WIN32.
Functions:
- look_for_cmd() : locates an executable file
- - parse_cmd_line() : splits a command with pipes and redirections
- - build_cmd_line() : builds a command with pipes and redirections (useful ?)
+ - parse_cmdline() : splits a command with pipes and redirections
+ - build_cmdline() : builds a command with pipes and redirections (useful ?)
*/
/*
@@ -637,7 +642,8 @@ get_sym (char *s, char **beg, char **end)
What we allow :
[cmd] [arg1] ... [argn] < [redinput] | [cmd2] | ... | [cmdn] > [redoutput]
*/
-void *parse_cmdline(char *line, char **input, char **output)
+static void *
+parse_cmdline(char *line, char **input, char **output)
{
BOOL again, needcmd = TRUE, bSuccess = TRUE, append_out = FALSE;
char *beg = line, *end, *new_end;
@@ -809,7 +815,7 @@ quote_elt(char *elt)
return xstrdup(elt);
}
-/* static (commented out for mingw; SK) */ char *
+char *
quote_args(char **argv)
{
int i;
@@ -831,7 +837,7 @@ quote_args(char **argv)
return line;
}
-char *
+static char *
build_cmdline(char ***cmd, char *input, char *output)
{
int ncmd;
@@ -866,7 +872,8 @@ build_cmdline(char ***cmd, char *input, char *output)
under Win9x. This is a workaround for this bug.
*/
-int win32_system(const char *cmd, int async)
+static int
+win32_system(const char *cmd, int async)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@@ -892,13 +899,7 @@ int win32_system(const char *cmd, int async)
return 1;
}
-#if 0
- if (look_for_cmd(cmd, &app_name, &new_cmd) == FALSE) {
-#else
- new_cmd = xstrdup(cmd);
if (look_for_cmd(cmd, &app_name) == FALSE) {
- if (new_cmd) free(new_cmd);
-#endif
/* Failed to find the command or malformed cmd */
errno = ENOEXEC;
#ifdef _TRACE
@@ -907,6 +908,7 @@ int win32_system(const char *cmd, int async)
return -1;
}
+ new_cmd = xstrdup(cmd);
cmd_pipe = parse_cmdline(new_cmd, &red_input, &red_output);
for (i = 0; cmd_pipe[i]; i++) {
diff --git a/Build/source/texk/kpathsea/mingw32.h b/Build/source/texk/kpathsea/mingw32.h
index dd6913b64de..f4acbc9ce01 100644
--- a/Build/source/texk/kpathsea/mingw32.h
+++ b/Build/source/texk/kpathsea/mingw32.h
@@ -42,10 +42,10 @@
&& IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
#endif
-void init_user_info (void);
-void set_home_warning (void);
-char *get_home_directory (void);
-BOOL look_for_cmd (const char *, char **);
-BOOL win32_get_long_filename (char *, char *, int);
+extern void init_user_info (void);
+extern void set_home_warning (void);
+extern BOOL win32_get_long_filename (char *, char *, int);
+extern BOOL look_for_cmd (const char *, char **);
+extern char *quote_args(char **);
#endif
diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c
index 5a0fbf2814e..c7b7df6f4e6 100644
--- a/Build/source/texk/kpathsea/tex-make.c
+++ b/Build/source/texk/kpathsea/tex-make.c
@@ -199,7 +199,6 @@ maketex (kpathsea kpse, kpse_file_format_type format, string* args)
#else
int num;
#endif
- extern char *quote_args(char **argv);
if (look_for_cmd(args[0], &app_name) == FALSE) {
ret = NULL;