#else /* USE_GNUREGEX */
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
/* Definitions for data structures and routines for the regular
/* POSIX compatibility. */
extern int regcomp _RE_ARGS((regex_t * preg, const char *pattern, int cflags));
- extern int regexec
- _RE_ARGS((const regex_t * preg, const char *string, size_t nmatch,
- regmatch_t pmatch[], int eflags));
- extern size_t regerror
- _RE_ARGS((int errcode, const regex_t * preg, char *errbuf,
- size_t errbuf_size));
+ extern int regexec _RE_ARGS((const regex_t * preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags));
+ extern size_t regerror _RE_ARGS((int errcode, const regex_t * preg, char *errbuf, size_t errbuf_size));
extern void regfree _RE_ARGS((regex_t * preg));
#ifdef __cplusplus
#else
extern void
#endif
- xassert(const char *, const char *, int);
+xassert(const char *, const char *, int);
#endif /* SQUID_ASSERT_H */
#undef WSASocket
inline
-int WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f) {
+int WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f)
+{
SOCKET result;
#ifdef UNICODE
if ((result = ::WSASocketW(a, t, p, i, g, f)) == INVALID_SOCKET) {
#
# NP: The Squid code requires astyle version 1.22 or later
#
-#$ASTYLE_BIN="/usr/local/bin/astyle";
-$ASTYLE_BIN="/usr/bin/astyle";
-
+$ASTYLE_BIN="/usr/local/bin/astyle";
+#$ASTYLE_BIN="/usr/bin/astyle";
#$ASTYLE_BIN="/usr/local/src/astyle-1.22/bin/astyle";
-$ASTYLE_ARGS ="--mode=c -s4 -O -l";
+$ASTYLE_ARGS ="--mode=c -s4 -O -l";
#$ASTYLE_ARGS="--mode=c -s4 -O --break-blocks -l";
-#$ASTYLE_BIN="/usr/local/src/astyle-1.22/bin/astyle";
if(! -e $ASTYLE_BIN){
print "An error while open2\n";
exit -1;
}
-
-
+
if($pid=fork()){
#do parrent staf
close(FROM_ASTYLE);
else{
# child staf
close(TO_ASTYLE);
-
+
if(!open(OUT,">$out")){
print "Can't open output file: $out\n";
exit -1;
if($$line =~/\s+int\s+.*/s || $$line=~ /\s+unsigned\s+.*/s ||
$$line =~/^int\s+.*/s || $$line=~ /^unsigned\s+.*/s
- ){
+ ){
if( $$line =~ /(\(|,|\)|\#|typedef)/s ){
#excluding int/unsigned appeared inside function prototypes,typedefs etc....
return 1;
$prx =~ s/\s*$//g;
$$line= $prx." int ".$name."__FORASTYLE__".$val.";".$extra;
# print "----->".$$line."\n";
- }
+ }
elsif($$line =~ /\s*unsigned\s+([^:]*):\s*(\w+)\s*\;(.*)/s){
local($name,$val,$extra)=($1,$2,$3);
$prx =~ s/\s*$//g;
$$line= "unsigned ".$name."__FORASTYLE__".$val.";".$extra;
- }
+ }
return 1;
}
md52=`cat $FILENAME.astylebak| tr -d "\n \t\r" | $MD5`;
if test "$md51" != "$md52" ; then
- echo "File $PWD/$FILENAME not converted well";
+ echo "ERROR: File $PWD/$FILENAME not formating well";
mv $FILENAME $FILENAME.astylebad
mv $FILENAME.astylebak $FILENAME
- exit 1;
+ else
+ rm $FILENAME.astylebak
fi
- rm $FILENAME.astylebak
continue;
fi
esac