@@ -157,11 +157,7 @@ static int match(Char *, Char *, Char *);
157
157
static void qprintf (const char * , Char * );
158
158
#endif
159
159
160
- PHPAPI int
161
- glob (pattern , flags , errfunc , pglob )
162
- const char * pattern ;
163
- int flags , (* errfunc )(const char * , int );
164
- glob_t * pglob ;
160
+ PHPAPI int glob (const char * pattern , int flags , (* errfunc )(const char * , int ), glob_t * pglob )
165
161
{
166
162
const u_char * patnext ;
167
163
int c ;
@@ -215,10 +211,7 @@ glob(pattern, flags, errfunc, pglob)
215
211
* invoke the standard globbing routine to glob the rest of the magic
216
212
* characters
217
213
*/
218
- static int
219
- globexp1 (pattern , pglob )
220
- const Char * pattern ;
221
- glob_t * pglob ;
214
+ static int globexp1 (const Char * pattern ,glob_t * pglob )
222
215
{
223
216
const Char * ptr = pattern ;
224
217
int rv ;
@@ -240,11 +233,7 @@ globexp1(pattern, pglob)
240
233
* If it succeeds then it invokes globexp1 with the new pattern.
241
234
* If it fails then it tries to glob the rest of the pattern and returns.
242
235
*/
243
- static int
244
- globexp2 (ptr , pattern , pglob , rv )
245
- const Char * ptr , * pattern ;
246
- glob_t * pglob ;
247
- int * rv ;
236
+ static int globexp2 (const Char * ptr , const Char * pattern , glob_t * pglob , int * rv )
248
237
{
249
238
int i ;
250
239
Char * lm , * ls ;
@@ -350,12 +339,7 @@ globexp2(ptr, pattern, pglob, rv)
350
339
/*
351
340
* expand tilde from the passwd file.
352
341
*/
353
- static const Char *
354
- globtilde (pattern , patbuf , patbuf_len , pglob )
355
- const Char * pattern ;
356
- Char * patbuf ;
357
- size_t patbuf_len ;
358
- glob_t * pglob ;
342
+ static const Char * globtilde (const Char * pattern , Char * patbuf , size_t patbuf_len , glob_t * pglob )
359
343
{
360
344
#ifndef PHP_WIN32
361
345
struct passwd * pwd ;
@@ -429,10 +413,7 @@ globtilde(pattern, patbuf, patbuf_len, pglob)
429
413
* if things went well, nonzero if errors occurred. It is not an error
430
414
* to find no matches.
431
415
*/
432
- static int
433
- glob0 (pattern , pglob )
434
- const Char * pattern ;
435
- glob_t * pglob ;
416
+ static int glob0 ( const Char * pattern , glob_t * pglob )
436
417
{
437
418
const Char * qpatnext ;
438
419
int c , err , oldpathc ;
@@ -518,8 +499,7 @@ glob0(pattern, pglob)
518
499
return (0 );
519
500
}
520
501
521
- static int
522
- compare (const void * p , const void * q )
502
+ static int compare (const void * p , const void * q )
523
503
{
524
504
return (strcmp (* (char * * )p , * (char * * )q ));
525
505
}
@@ -545,13 +525,8 @@ glob1(pattern, pattern_last, pglob, limitp)
545
525
* of recursion for each segment in the pattern that contains one or more
546
526
* meta characters.
547
527
*/
548
- static int
549
- glob2 (pathbuf , pathbuf_last , pathend , pathend_last , pattern ,
550
- pattern_last , pglob , limitp )
551
- Char * pathbuf , * pathbuf_last , * pathend , * pathend_last ;
552
- Char * pattern , * pattern_last ;
553
- glob_t * pglob ;
554
- size_t * limitp ;
528
+ static int glob2 (Char * pathbuf , Char * pathbuf_last , Char * pathend , Char * pathend_last , pattern ,
529
+ Char * pattern_last , glob_t * pglob , size_t * limitp )
555
530
{
556
531
zend_stat_t sb = {0 };
557
532
Char * p , * q ;
@@ -609,13 +584,8 @@ glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern,
609
584
/* NOTREACHED */
610
585
}
611
586
612
- static int
613
- glob3 (pathbuf , pathbuf_last , pathend , pathend_last , pattern , pattern_last ,
614
- restpattern , restpattern_last , pglob , limitp )
615
- Char * pathbuf , * pathbuf_last , * pathend , * pathend_last ;
616
- Char * pattern , * pattern_last , * restpattern , * restpattern_last ;
617
- glob_t * pglob ;
618
- size_t * limitp ;
587
+ static int glob3 (Char * pathbuf , Char * pathbuf_last , Char * pathend , Char * pathend_last , Char * pattern , Char * pattern_last ,
588
+ Char * restpattern , Char * restpattern_last , glob_t * pglob , size_t * limitp )
619
589
{
620
590
register struct dirent * dp ;
621
591
DIR * dirp ;
@@ -703,11 +673,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last,
703
673
* Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and
704
674
* gl_pathv points to (gl_offs + gl_pathc + 1) items.
705
675
*/
706
- static int
707
- globextend (path , pglob , limitp )
708
- const Char * path ;
709
- glob_t * pglob ;
710
- size_t * limitp ;
676
+ static int globextend (const Char * path , glob_t * pglob , size_t * limitp )
711
677
{
712
678
register char * * pathv ;
713
679
u_int newsize , len ;
@@ -761,9 +727,7 @@ globextend(path, pglob, limitp)
761
727
* pattern matching function for filenames. Each occurrence of the *
762
728
* pattern causes a recursion level.
763
729
*/
764
- static int
765
- match (name , pat , patend )
766
- register Char * name , * pat , * patend ;
730
+ static int match (Char * name , Char * pat , Char * patend )
767
731
{
768
732
int ok , negate_range ;
769
733
Char c , k ;
@@ -810,9 +774,7 @@ match(name, pat, patend)
810
774
}
811
775
812
776
/* Free allocated data belonging to a glob_t structure. */
813
- PHPAPI void
814
- globfree (pglob )
815
- glob_t * pglob ;
777
+ PHPAPI void globfree (glob_t * pglob )
816
778
{
817
779
register int i ;
818
780
register char * * pp ;
@@ -827,10 +789,7 @@ globfree(pglob)
827
789
}
828
790
}
829
791
830
- static DIR *
831
- g_opendir (str , pglob )
832
- register Char * str ;
833
- glob_t * pglob ;
792
+ static DIR * g_opendir (Char * str , glob_t * pglob )
834
793
{
835
794
char buf [MAXPATHLEN ];
836
795
@@ -847,11 +806,7 @@ g_opendir(str, pglob)
847
806
return (opendir (buf ));
848
807
}
849
808
850
- static int
851
- g_lstat (fn , sb , pglob )
852
- register Char * fn ;
853
- zend_stat_t * sb = NULL ;
854
- glob_t * pglob ;
809
+ static int g_lstat (Char * fn , zend_stat_t * sb , glob_t * pglob )
855
810
{
856
811
char buf [MAXPATHLEN ];
857
812
@@ -862,11 +817,7 @@ g_lstat(fn, sb, pglob)
862
817
return (php_sys_lstat (buf , sb ));
863
818
}
864
819
865
- static int
866
- g_stat (fn , sb , pglob )
867
- register Char * fn ;
868
- zend_stat_t * sb = NULL ;
869
- glob_t * pglob ;
820
+ static int g_stat (Char * fn , zend_stat_t * sb , glob_t * pglob )
870
821
{
871
822
char buf [MAXPATHLEN ];
872
823
@@ -877,10 +828,7 @@ g_stat(fn, sb, pglob)
877
828
return (php_sys_stat (buf , sb ));
878
829
}
879
830
880
- static Char *
881
- g_strchr (str , ch )
882
- Char * str ;
883
- int ch ;
831
+ static Char * g_strchr (Char * str , int ch )
884
832
{
885
833
do {
886
834
if (* str == ch )
@@ -889,11 +837,7 @@ g_strchr(str, ch)
889
837
return (NULL );
890
838
}
891
839
892
- static int
893
- g_Ctoc (str , buf , len )
894
- register const Char * str ;
895
- char * buf ;
896
- u_int len ;
840
+ static int g_Ctoc (const Char * str , char * buf , u_int len )
897
841
{
898
842
899
843
while (len -- ) {
@@ -905,9 +849,7 @@ g_Ctoc(str, buf, len)
905
849
906
850
#ifdef DEBUG
907
851
static void
908
- qprintf (str , s )
909
- const char * str ;
910
- register Char * s ;
852
+ qprintf (char * str , Char * s )
911
853
{
912
854
register Char * p ;
913
855
0 commit comments