sniper Fri Jan 6 01:10:21 2006 UTC Modified files: (Branch: PHP_4_4) /php-src/win32 sendmail.c sendmail.h Log: MFH: Small cleanups http://cvs.php.net/viewcvs.cgi/php-src/win32/sendmail.c?r1=1.47.2.10.2.2&r2=1.47.2.10.2.3&diff_format=u Index: php-src/win32/sendmail.c diff -u php-src/win32/sendmail.c:1.47.2.10.2.2 php-src/win32/sendmail.c:1.47.2.10.2.3 --- php-src/win32/sendmail.c:1.47.2.10.2.2 Fri Jan 6 00:35:40 2006 +++ php-src/win32/sendmail.c Fri Jan 6 01:10:21 2006 @@ -17,7 +17,7 @@ * */ -/* $Id: sendmail.c,v 1.47.2.10.2.2 2006/01/06 00:35:40 sniper Exp $ */ +/* $Id: sendmail.c,v 1.47.2.10.2.3 2006/01/06 01:10:21 sniper Exp $ */ #include "php.h" /*php specific */ #include <stdio.h> @@ -42,10 +42,6 @@ #include "ext/standard/php_string.h" -/* - extern int _daylight; - extern long _timezone; - */ /*enum { DO_CONNECT = WM_USER +1 @@ -96,9 +92,6 @@ char *php_mailer = "PHP 4 NetWare"; #endif /* NETWARE */ - -char *get_header(char *h, char *headers); - /* Error messages */ static char *ErrorMessages[] = { @@ -215,7 +208,7 @@ // // See SendText() for additional args! //********************************************************************/ -int TSendMail(char *host, int *error, char **error_message, +PHPAPI int TSendMail(char *host, int *error, char **error_message, char *headers, char *Subject, char *mailTo, char *data, char *mailCc, char *mailBcc, char *mailRPath) { @@ -229,7 +222,6 @@ WinsockStarted = FALSE; #endif - if (host == NULL) { *error = BAD_MAIL_HOST; return FAILURE; @@ -309,7 +301,7 @@ MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port")); return FAILURE; } else { - ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message); + ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message TSRMLS_CC); TSMClose(); if (RPath) { efree(RPath); @@ -334,7 +326,7 @@ // Author/Date: jcar 20/9/96 // History: //********************************************************************/ -void TSMClose() +PHPAPI void TSMClose() { Post("QUIT\r\n"); Ack(NULL); @@ -356,7 +348,7 @@ // Author/Date: jcar 20/9/96 // History: //*******************************************************************/ -char *GetSMErrorText(int index) +PHPAPI char *GetSMErrorText(int index) { if (MIN_ERROR_INDEX <= index && index < MAX_ERROR_INDEX) { return (ErrorMessages[index]); @@ -386,8 +378,8 @@ // Author/Date: jcar 20/9/96 // History: //*******************************************************************/ -int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, - char *headers, char *headers_lc, char **error_message) +static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, + char *headers, char *headers_lc, char **error_message TSRMLS_DC) { int res; char *p; @@ -607,9 +599,9 @@ /* send message header */ if (Subject == NULL) { - res = PostHeader(RPath, "No Subject", mailTo, stripped_header); + res = PostHeader(RPath, "No Subject", mailTo, stripped_header TSRMLS_CC); } else { - res = PostHeader(RPath, Subject, mailTo, stripped_header); + res = PostHeader(RPath, Subject, mailTo, stripped_header TSRMLS_CC); } if (stripped_header) { efree(stripped_header); @@ -663,7 +655,8 @@ return (SUCCESS); } -int addToHeader(char **header_buffer, const char *specifier, char *string) { +static int addToHeader(char **header_buffer, const char *specifier, char *string) +{ if (NULL == (*header_buffer = erealloc(*header_buffer, strlen(*header_buffer) + strlen(specifier) + strlen(string) + 1))) { return 0; } @@ -682,7 +675,7 @@ // Author/Date: jcar 20/9/96 // History: //********************************************************************/ -int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders) +static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC) { /* Print message header according to RFC 822 */ @@ -779,7 +772,7 @@ // Author/Date: jcar 20/9/96 // History: //********************************************************************/ -int MailConnect() +static int MailConnect() { int res; @@ -820,10 +813,6 @@ } - - - - /********************************************************************* // Name: Post // Input: @@ -832,7 +821,7 @@ // Author/Date: jcar 20/9/96 // History: //********************************************************************/ -int Post(LPCSTR msg) +static int Post(LPCSTR msg) { int len = strlen(msg); int slen; @@ -859,7 +848,7 @@ // Author/Date: jcar 20/9/96 // History: //********************************************************************/ -int Ack(char **server_response) +static int Ack(char **server_response) { static char buf[MAIL_BUFFER_SIZE]; int rlen; @@ -919,7 +908,7 @@ // Author/Date: jcar 20/9/96 // History: //********************************************************************/ -unsigned long GetAddr(LPSTR szHost) +static unsigned long GetAddr(LPSTR szHost) { LPHOSTENT lpstHost; u_long lAddr = INADDR_ANY; http://cvs.php.net/viewcvs.cgi/php-src/win32/sendmail.h?r1=1.10.4.1&r2=1.10.4.1.12.1&diff_format=u Index: php-src/win32/sendmail.h diff -u php-src/win32/sendmail.h:1.10.4.1 php-src/win32/sendmail.h:1.10.4.1.12.1 --- php-src/win32/sendmail.h:1.10.4.1 Fri Dec 6 22:57:47 2002 +++ php-src/win32/sendmail.h Fri Jan 6 01:10:21 2006 @@ -32,20 +32,17 @@ #define MAX_ERROR_INDEX 22 /* Always last error message + 1 */ -int TSendMail(char *smtpaddr, int *returnerror, char **error_message, +PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message, char *RPath, char *Subject, char *mailTo, char *data, char *mailCc, char *mailBcc, char *mailRPath); -void TSMClose(void); -int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, - char *headers, char *headers_lc, char **error_message); -char *GetSMErrorText(int index); - -int MailConnect(); -int PostHeader(char *, char *, char *, char *); -int Post(LPCSTR); -int Ack(char **server_response); -unsigned long GetAddr(LPSTR szHost); - - +PHPAPI void TSMClose(void); +static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, + char *headers, char *headers_lc, char **error_message TSRMLS_DC); +PHPAPI char *GetSMErrorText(int index); +static int MailConnect(); +static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC); +static int Post(LPCSTR msg); +static int Ack(char **server_response); +static unsigned long GetAddr(LPSTR szHost); #endif /* sendmail_h */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php