@@ -44,15 +44,6 @@ TCHAR g_volume_name[MAX_PATH + 1] = { 0 };
4444char * g_root_path = "x:\\" ;
4545
4646
47- int build_initial_search_string (char * search_path , char * search_string )
48- {
49- GetCurrentDirectory (MAX_PATH , search_string );
50- strcpy (search_path , search_string );
51- strcat (search_path , "\\*.*" );
52- return 0 ;
53- }
54-
55-
5647int
5748append_horizontal_line (char string [], unsigned int console_width )
5849{
@@ -73,23 +64,13 @@ append_horizontal_line(char string[], unsigned int console_width)
7364}
7465
7566
76- char *
77- create_horizontal_line (char * result , CONSOLE_SCREEN_BUFFER_INFO csbi )
67+ int
68+ build_initial_search_string (char * search_path , char * search_string )
7869{
79- SHORT i ;
80- SHORT console_width = csbi .srWindow .Right + 1 ;
81- const char horizontal_line_character [] = { (char )196 , '\0' };
82-
83- /** Draw line in result string */
84- for (i = 0 ; i < console_width ; ++ i ) {
85- /* //if (i == console_width / 2) {
86- // strcat(string, "%c", );
87- //} else {
88- */ strncat (result , horizontal_line_character , 2 );
89- /* //}*/
90- }
91-
92- return result ;
70+ GetCurrentDirectory (MAX_PATH , search_string );
71+ strcpy (search_path , search_string );
72+ strcat (search_path , "\\*.*" );
73+ return 0 ;
9374}
9475
9576
@@ -110,6 +91,40 @@ compact_size_with_suffix(double size_bytes, char * suffixed_size)
11091}
11192
11293
94+ int
95+ create_footer (char * footer_string , int console_width , char * root_path , char search_drive )
96+ {
97+ (void ) footer_string ;
98+ (void ) console_width ;
99+ (void ) root_path ;
100+ (void ) search_drive ;
101+
102+
103+
104+ return 0 ;
105+ }
106+
107+
108+ char *
109+ create_horizontal_line (char * result , CONSOLE_SCREEN_BUFFER_INFO csbi )
110+ {
111+ SHORT i ;
112+ SHORT console_width = csbi .srWindow .Right + 1 ;
113+ const char horizontal_line_character [] = { (char )196 , '\0' };
114+
115+ /** Draw line in result string */
116+ for (i = 0 ; i < console_width ; ++ i ) {
117+ /* //if (i == console_width / 2) {
118+ // strcat(string, "%c", );
119+ //} else {
120+ */ strncat (result , horizontal_line_character , 2 );
121+ /* //}*/
122+ }
123+
124+ return result ;
125+ }
126+
127+
113128int
114129display_footer (void )
115130{
@@ -153,20 +168,7 @@ display_footer(void)
153168
154169
155170int
156- create_footer (char * footer_string , int console_width , char * root_path , char search_drive )
157- {
158- (void ) footer_string ;
159- (void ) console_width ;
160- (void ) root_path ;
161- (void ) search_drive ;
162-
163-
164-
165- return 0 ;
166- }
167-
168-
169- int display_header (char * search_path )
171+ display_header (char * search_path )
170172{
171173 char line [8192 ] = { 0 };
172174
@@ -183,7 +185,8 @@ int display_header(char * search_path)
183185}
184186
185187
186- int display_help (void )
188+ int
189+ display_help (void )
187190{
188191 int i ;
189192
@@ -216,7 +219,8 @@ int display_help(void)
216219}
217220
218221
219- int fixup_path (char * search_path )
222+ int
223+ fixup_path (char * search_path )
220224{
221225 /** Contents of directory (w/o trailing backslash) */
222226 g_dwAttrib = GetFileAttributes ((LPCTSTR ) search_path );
@@ -264,11 +268,13 @@ get_console_width(void)
264268}
265269
266270
267- int process_cmdline_args (int argc ,
268- char * argv [],
269- char search_drive ,
270- char * search_path ,
271- char * search_string )
271+ int
272+ process_cmdline_args (
273+ int argc ,
274+ char * argv [],
275+ char search_drive ,
276+ char * search_path ,
277+ char * search_string )
272278{
273279 /** Process command line arguments */
274280 while (argc -- > 1 ) {
@@ -355,7 +361,8 @@ int process_cmdline_args(int argc,
355361}
356362
357363
358- int process_files (HANDLE search_handle , char * search_path )
364+ int
365+ process_files (HANDLE search_handle , char * search_path )
359366{
360367 int i ;
361368
@@ -548,7 +555,8 @@ int process_files(HANDLE search_handle, char * search_path)
548555}
549556
550557
551- int restore_console (void )
558+ int
559+ restore_console (void )
552560{
553561 SetConsoleTextAttribute (g_hConsole , g_original_attributes );
554562 return 0 ;
0 commit comments