diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-02-10 13:34:19 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-02-10 13:34:19 +0000 |
commit | fafab64e8f37f145b91f6121d63756991bd47a08 (patch) | |
tree | cfc628c435fa0eedf50b97801cf78f1cb67c5d0a /Build/source/texk/kpathsea/mingw32.c | |
parent | c277be633776e18bea8e2c1587b7a4d020e972b1 (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/mingw32.c')
-rw-r--r-- | Build/source/texk/kpathsea/mingw32.c | 40 |
1 files changed, 21 insertions, 19 deletions
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++) { |