hyanantha               Fri Jan  3 10:17:44 2003 EDT

  Modified files:              
    /php4/win32 sendmail.c sendmail.h 
  Log:
  NetWare related changes/modifications.
  
  
Index: php4/win32/sendmail.c
diff -u php4/win32/sendmail.c:1.51 php4/win32/sendmail.c:1.52
--- php4/win32/sendmail.c:1.51  Sat Dec 28 14:40:03 2002
+++ php4/win32/sendmail.c       Fri Jan  3 10:17:43 2003
@@ -17,17 +17,23 @@
  *
  */
 
-/* $Id: sendmail.c,v 1.51 2002/12/28 19:40:03 pollita Exp $ */
+/* $Id: sendmail.c,v 1.52 2003/01/03 15:17:43 hyanantha Exp $ */
 
 #include "php.h"                               /*php specific */
 #include <stdio.h>
 #include <stdlib.h>
+#ifndef NETWARE
 #include <winsock.h>
+#else  /* NETWARE */
+#include <netware\sendmail_nw.h>
+#endif /* NETWARE */
 #include "time.h"
 #include <string.h>
+#ifndef NETWARE
 #include <malloc.h>
 #include <memory.h>
 #include <winbase.h>
+#endif /* NETWARE */
 #include "sendmail.h"
 #include "php_ini.h"
 
@@ -69,17 +75,25 @@
 
 /* socket related data */
 SOCKET sc;
+#ifndef NETWARE
 WSADATA Data;
 struct hostent *adr;
+#endif /* NETWARE */
 SOCKADDR_IN sock_in;
+#ifndef NETWARE
 int WinsockStarted;
 /* values set by the constructor */
 char *AppName;
+#endif /* NETWARE */
 char MailHost[HOST_NAME_LEN];
 char LocalHost[HOST_NAME_LEN];
 #endif
 char seps[] = " ,\t\n";
+#ifndef NETWARE
 char *php_mailer = "PHP 4 WIN32";
+#else
+char *php_mailer = "PHP 4 NetWare";
+#endif /* NETWARE */
 
 char *get_header(char *h, char *headers);
 
@@ -201,7 +215,9 @@
        char *headers_lc = NULL; /* headers_lc is only created if we've a header at 
all */
        TSRMLS_FETCH();
 
+#ifndef NETWARE
        WinsockStarted = FALSE;
+#endif
 
        if (host == NULL) {
                *error = BAD_MAIL_HOST;
@@ -305,7 +321,14 @@
        */
 
        shutdown(sc, 0); 
+#ifndef NETWARE
        closesocket(sc);
+#else
+       /* closesocket commented out since it was giving undefined symbol linker error
+        * close added in its place
+        */
+       close(sc);
+#endif /* NETWARE */
 }
 
 
@@ -775,7 +798,11 @@
 // Author/Date:  jcar 20/9/96
 // History:
 //********************************************************************/
+#ifndef NETWARE
 int Post(LPCSTR msg)
+#else
+int Post(char *msg)
+#endif
 {
        int len = strlen(msg);
        int slen;
@@ -862,7 +889,11 @@
 // Author/Date:  jcar 20/9/96
 // History:
 //********************************************************************/
+#ifndef NETWARE
 unsigned long GetAddr(LPSTR szHost)
+#else
+unsigned long GetAddr(char * szHost)
+#endif
 {
        LPHOSTENT lpstHost;
        u_long lAddr = INADDR_ANY;
@@ -878,7 +909,11 @@
 
                        lpstHost = gethostbyname(szHost);
                        if (lpstHost) {         /* success */
+#ifndef NETWARE
                                lAddr = *((u_long FAR *) (lpstHost->h_addr));
+#else
+                               lAddr = *((u_long *) (lpstHost->h_addr));
+#endif /* NETWARE */
                        } else {
                                lAddr = INADDR_ANY;             /* failure */
                        }
Index: php4/win32/sendmail.h
diff -u php4/win32/sendmail.h:1.11 php4/win32/sendmail.h:1.12
--- php4/win32/sendmail.h:1.11  Fri Dec  6 17:56:57 2002
+++ php4/win32/sendmail.h       Fri Jan  3 10:17:43 2003
@@ -1,6 +1,8 @@
 #if !defined(sendmail_h)               /* Sentry, use file only if it's not already 
included. */
 #define sendmail_h
+#ifndef NETWARE
 #include <windows.h>
+#endif
 
 #define HOST_NAME_LEN  256
 #define MAX_APPNAME_LENGHT 100
@@ -42,9 +44,17 @@
 
 int MailConnect();
 int PostHeader(char *, char *, char *, char *);
-int Post(LPCSTR);
+#ifndef NETWARE
+int Post(LPCSTR msg);
+#else
+int Post(char *msg);
+#endif
 int Ack(char **server_response);
+#ifndef NETWARE
 unsigned long GetAddr(LPSTR szHost);
+#else
+unsigned long GetAddr(char * szHost);
+#endif
 
 
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to