SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
configuration-parser.c configuration-scanner.c request_info.c \
safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c output.c \
- php_ini.c php_compat.c
+ php_ini.c
OBJS = main.o internal_functions.o snprintf.o php3_sprintf.o \
configuration-parser.o configuration-scanner.o request_info.o \
safe_mode.o fopen-wrappers.o php3_realpath.o alloca.o output.o \
- php_ini.o php_compat.o
+ php_ini.o
FUNCTIONS_SOURCE = functions/apache.c functions/fhttpd.c \
functions/crypt.c functions/db.c functions/dl.c functions/filepro.c \
html.c image.c info.c link.c mail.c math.c md5.c microtime.c \
pack.c pageinfo.c rand.c reg.c soundex.c string.c \
syslog.c type.c uniqid.c url.c iptc.c var.c quot_print.c \
- cyr_convert.c
+ cyr_convert.c flock_compat.c
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
- | |
+ | |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
#endif
#include "php.h"
#include "php_globals.h"
+#include "ext/standard/flock_compat.h"
#include <stdio.h>
#include <stdlib.h>
"PHP_file", php3_file_functions, php3_minit_file, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
};
+
static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
/* {{{ proto bool flock(int fp, int operation)
#include <php.h>
#include <errno.h>
-#include "php_compat.h"
+#include "ext/standard/flock_compat.h"
#if HAVE_STRUCT_FLOCK
#include <unistd.h>
#endif
#if !HAVE_FLOCK
-PHPAPI int flock(int fd, int operation)
+int flock(int fd, int operation)
#if HAVE_STRUCT_FLOCK
{
struct flock flck;
* cannot distinguish between failure and a local broadcast address.
*/
-PHPAPI int
-inet_aton(const char *cp, struct in_addr *ap)
+int inet_aton(const char *cp, struct in_addr *ap)
{
int dots = 0;
register unsigned long acc = 0, addr = 0;
--- /dev/null
+#ifndef _FLOCK_COMPAT_H
+#define _FLOCK_COMPAT_H
+
+#if !HAVE_FLOCK
+# define LOCK_SH 1
+# define LOCK_EX 2
+# define LOCK_NB 4
+# define LOCK_UN 8
+int flock(int fd, int operation);
+#endif
+
+#if WIN32|WINNT
+# define fsync _commit
+# define ftruncate chsize
+#endif /* WIN32|WINNT */
+
+#if !HAVE_INET_ATON
+extern int inet_aton(const char *, struct in_addr *);
+#endif
+
+#endif /* _FLOCK_COMPAT_H */
{
char *p;
- for(p = s; (p - s) < n; p++)
+ for(p = s; ((size_t) (p - s)) < n; p++)
if(memcmp(p, c, m) == 0)
return p;
return NULL;
#define HAVE_TZSET 1
/* Define if you have the flock function. */
-#define HAVE_FLOCK 1
+#define HAVE_FLOCK 0
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
#endif
-#include "php_compat.h"
-
#endif
/*
+++ /dev/null
-#ifndef PHP_COMPAT_H
-#define PHP_COMPAT_H
-
-#if (WIN32|WINNT) & HAVE_BINDLIB
-#ifndef WINNT
-#define WINNT 1
-#endif
-#include "arpa/inet.h"
-#include "netdb.h"
-#include "arpa/nameser.h"
-#include "resolv.h"
-#endif
-
-#if !HAVE_FLOCK
-
-#define LOCK_SH 1
-#define LOCK_EX 2
-#define LOCK_NB 4
-#define LOCK_UN 8
-
-extern PHPAPI int flock(int fd, int operation);
-
-#endif
-
-#if WIN32|WINNT
-
-/* These were in win32/flock.h, dunno if they are really needed
- (or maybe break something) */
-
-#define fsync _commit
-#define ftruncate chsize
-
-#endif /* WIN32|WINNT */
-
-#if !HAVE_INET_ATON
-extern PHPAPI int inet_aton(const char *, struct in_addr *);
-#endif
-
-#endif
# End Source File
# Begin Source File
+SOURCE=.\ext\standard\flock_compat.c
+# End Source File
+# Begin Source File
+
SOURCE=.\ext\standard\formatted_print.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=.\ext\standard\flock_compat.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ext\standard\fsock.h
# End Source File
# Begin Source File