cmd: Make some functions static.

This commit is contained in:
Francois Gouget 2009-01-05 19:58:16 +01:00 committed by Alexandre Julliard
parent 6b16d0229d
commit e46d25a661
3 changed files with 9 additions and 12 deletions

View File

@ -74,7 +74,7 @@ static const WCHAR spaceW[] = {' ','\0'};
* *
* Reverse a WCHARacter string in-place (strrev() is not available under unixen :-( ). * Reverse a WCHARacter string in-place (strrev() is not available under unixen :-( ).
*/ */
WCHAR * WCMD_strrev (WCHAR *buff) { static WCHAR * WCMD_strrev (WCHAR *buff) {
int r, i; int r, i;
WCHAR b; WCHAR b;
@ -95,7 +95,7 @@ WCHAR * WCMD_strrev (WCHAR *buff) {
* Result is returned in a static string overwritten with each call. * Result is returned in a static string overwritten with each call.
* FIXME: There must be a better algorithm! * FIXME: There must be a better algorithm!
*/ */
WCHAR * WCMD_filesize64 (ULONGLONG n) { static WCHAR * WCMD_filesize64 (ULONGLONG n) {
ULONGLONG q; ULONGLONG q;
unsigned int r, i; unsigned int r, i;
@ -121,7 +121,7 @@ WCHAR * WCMD_filesize64 (ULONGLONG n) {
* *
* Sort based on the /O options supplied on the command line * Sort based on the /O options supplied on the command line
*/ */
int WCMD_dir_sort (const void *a, const void *b) static int WCMD_dir_sort (const void *a, const void *b)
{ {
WIN32_FIND_DATA *filea = (WIN32_FIND_DATA *)a; WIN32_FIND_DATA *filea = (WIN32_FIND_DATA *)a;
WIN32_FIND_DATA *fileb = (WIN32_FIND_DATA *)b; WIN32_FIND_DATA *fileb = (WIN32_FIND_DATA *)b;
@ -200,7 +200,7 @@ int WCMD_dir_sort (const void *a, const void *b)
* *
* Reverse a WCHARacter string in-place (strrev() is not available under unixen :-( ). * Reverse a WCHARacter string in-place (strrev() is not available under unixen :-( ).
*/ */
void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) { static void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) {
ULONG sizeNeeded = 0; ULONG sizeNeeded = 0;
DWORD rc; DWORD rc;

View File

@ -70,7 +70,6 @@ void WCMD_more (WCHAR *);
void WCMD_move (void); void WCMD_move (void);
void WCMD_output (const WCHAR *format, ...); void WCMD_output (const WCHAR *format, ...);
void WCMD_output_asis (const WCHAR *message); void WCMD_output_asis (const WCHAR *message);
void WCMD_parse (WCHAR *s, WCHAR *q, WCHAR *p1, WCHAR *p2);
void WCMD_pause (void); void WCMD_pause (void);
void WCMD_popd (void); void WCMD_popd (void);
void WCMD_print_error (void); void WCMD_print_error (void);
@ -88,7 +87,6 @@ void WCMD_setshow_path (WCHAR *command);
void WCMD_setshow_prompt (void); void WCMD_setshow_prompt (void);
void WCMD_setshow_time (void); void WCMD_setshow_time (void);
void WCMD_shift (WCHAR *command); void WCMD_shift (WCHAR *command);
void WCMD_show_prompt (void);
void WCMD_title (WCHAR *); void WCMD_title (WCHAR *);
void WCMD_type (WCHAR *); void WCMD_type (WCHAR *);
void WCMD_verify (WCHAR *command); void WCMD_verify (WCHAR *command);
@ -98,7 +96,6 @@ int WCMD_volume (int mode, WCHAR *command);
WCHAR *WCMD_fgets (WCHAR *s, int n, HANDLE stream); WCHAR *WCMD_fgets (WCHAR *s, int n, HANDLE stream);
WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where); WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where);
WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string); WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string);
void WCMD_opt_s_strip_quotes(WCHAR *cmd);
void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValue, BOOL justFors); void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValue, BOOL justFors);
void WCMD_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); void WCMD_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);

View File

@ -309,7 +309,7 @@ void WCMD_print_error (void) {
* *
*/ */
void WCMD_show_prompt (void) { static void WCMD_show_prompt (void) {
int status; int status;
WCHAR out_string[MAX_PATH], curdir[MAX_PATH], prompt_string[MAX_PATH]; WCHAR out_string[MAX_PATH], curdir[MAX_PATH], prompt_string[MAX_PATH];
@ -442,7 +442,7 @@ WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string) {
* *
* Remove first and last quote WCHARacters, preserving all other text * Remove first and last quote WCHARacters, preserving all other text
*/ */
void WCMD_opt_s_strip_quotes(WCHAR *cmd) { static void WCMD_opt_s_strip_quotes(WCHAR *cmd) {
WCHAR *src = cmd + 1, *dest = cmd, *lastq = NULL; WCHAR *src = cmd + 1, *dest = cmd, *lastq = NULL;
while((*dest=*src) != '\0') { while((*dest=*src) != '\0') {
if (*src=='\"') if (*src=='\"')
@ -761,7 +761,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
* read in and not again, except for 'for' variable substitution. * read in and not again, except for 'for' variable substitution.
* eg. As evidence, "echo %1 && shift && echo %1" or "echo %%path%%" * eg. As evidence, "echo %1 && shift && echo %1" or "echo %%path%%"
*/ */
void handleExpansion(WCHAR *cmd, BOOL justFors, WCHAR *forVariable, WCHAR *forValue) { static void handleExpansion(WCHAR *cmd, BOOL justFors, WCHAR *forVariable, WCHAR *forValue) {
/* For commands in a context (batch program): */ /* For commands in a context (batch program): */
/* Expand environment variables in a batch file %{0-9} first */ /* Expand environment variables in a batch file %{0-9} first */
@ -846,7 +846,7 @@ void handleExpansion(WCHAR *cmd, BOOL justFors, WCHAR *forVariable, WCHAR *forVa
* second in p2. Any subsequent non-qualifier strings are lost. * second in p2. Any subsequent non-qualifier strings are lost.
* Parameters in quotes are handled. * Parameters in quotes are handled.
*/ */
void WCMD_parse (WCHAR *s, WCHAR *q, WCHAR *p1, WCHAR *p2) static void WCMD_parse (WCHAR *s, WCHAR *q, WCHAR *p1, WCHAR *p2)
{ {
int p = 0; int p = 0;
@ -1612,7 +1612,7 @@ static void WCMD_DumpCommands(CMD_LIST *commands) {
* *
* Adds a command to the current command list * Adds a command to the current command list
*/ */
void WCMD_addCommand(WCHAR *command, int *commandLen, static void WCMD_addCommand(WCHAR *command, int *commandLen,
WCHAR *redirs, int *redirLen, WCHAR *redirs, int *redirLen,
WCHAR **copyTo, int **copyToLen, WCHAR **copyTo, int **copyToLen,
CMD_DELIMITERS prevDelim, int curDepth, CMD_DELIMITERS prevDelim, int curDepth,