[PHP-CVS] cvs: php-src(PHP_4_4) /ext/ircg ircg.c php_ircg.h

2007-02-22 Thread Derick Rethans
derick  Thu Feb 22 14:44:32 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/ircg   ircg.c php_ircg.h 
  Log:
  - Revert newly added functions.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ircg/ircg.c?r1=1.137.2.18.4.3r2=1.137.2.18.4.4diff_format=u
Index: php-src/ext/ircg/ircg.c
diff -u php-src/ext/ircg/ircg.c:1.137.2.18.4.3 
php-src/ext/ircg/ircg.c:1.137.2.18.4.4
--- php-src/ext/ircg/ircg.c:1.137.2.18.4.3  Tue Feb 20 19:04:28 2007
+++ php-src/ext/ircg/ircg.c Thu Feb 22 14:44:32 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.137.2.18.4.3 2007/02/20 19:04:28 sas Exp $ */
+/* $Id: ircg.c,v 1.137.2.18.4.4 2007/02/22 14:44:32 derick Exp $ */
 
 /* {{{ includes */
 
@@ -124,7 +124,6 @@
 /* {{{ ircg_functions[] */
 function_entry ircg_functions[] = {
PHP_FE(ircg_set_on_die, NULL)
-   PHP_FE(ircg_create_file_on_die, NULL)
PHP_FE(ircg_pconnect, NULL)
PHP_FE(ircg_set_current, NULL)
PHP_FE(ircg_set_file, NULL)
@@ -205,8 +204,6 @@
struct in_addr od_ip;
short od_port;
 #endif
-
-   char *od_file;

int file_fd;

@@ -234,7 +231,6 @@
P_NICKNAME_JS = 3,
P_HTML= 4,
P_HTML_JS = 5,
-   P_XML = 6,
P_NOAUTO_LINKS = 8, /* Don't automatically convert links */
P_CONV_BR  = 16,/* Convert a special character to br */
P_COND_STOP= 32,/* If argument != username, stop */
@@ -397,7 +393,6 @@
 static void quit_handler(irconn_t *c, void *dummy)
 {
php_irconn_t *conn = dummy;
-   int fd;
 
irc_quit_handlers++;
if (conn-fd  -1) {
@@ -430,14 +425,6 @@
free(conn-od_data);
}
 #endif
-
-   if (conn-od_file) {
-   fd = open(conn-od_file, O_CREAT | O_WRONLY, 0666);
-   if (fd != -1) {
-   close(fd);
-   }
-   free(conn-od_file);
-   }

free(conn);
 }
@@ -464,47 +451,6 @@
}
 }
 
-static void ircg_xml_escape(smart_str *input, smart_str *output)
-{
-   unsigned char *p;
-   unsigned char *end;
-   unsigned char c;
-
-   end = input-c + input-len;
-
-   for(p = input-c; p  end; p++) {
-   c = *p;
-
-   if (c = 0  c  32) {
-   smart_str_appendl_ex(output, #, 2, 1);
-   smart_str_append_long_ex(output, c, 1);
-   smart_str_appendc_ex(output, ';', 1);
-   continue;
-   }
-   
-   switch (c) {
-   case '':
-   smart_str_appendl_ex(output, quot;, 6, 1);
-   break;
-   case '\'':
-   smart_str_appendl_ex(output, #039;, 6, 1);
-   break;
-
-   case '':
-   smart_str_appendl_ex(output, lt;, 4, 1);
-   break;
-
-   case '':
-   smart_str_appendl_ex(output, gt;, 4, 1);
-   break;
-
-   default:
-   smart_str_appendc_ex(output, c, 1);
-   break;
-   }
-   }
-}
-
 static const char hextab[] = 0123456789abcdef;
 
 #define NICKNAME_ESC_CHAR '|'
@@ -675,7 +621,6 @@
case '4': mode |= P_CONV_BR; goto next;
case '5': mode |= P_COND_STOP; goto next;
case '6': mode |= P_HTML; goto next;
-   case '7': mode |= P_XML; goto next;
 
/* associate mode bits with each command where applicable */
case 'c': NEW_TOKEN(C_CHANNEL, v) = mode; break;
@@ -756,10 +701,6 @@
ircg_js_escape(tmp, result);   \
smart_str_free_ex(tmp, 1); 
\
break;  
\
-   case P_XML: 
\
-   if (!what) break;   
\
-   ircg_xml_escape(what, result);  \
-   break;  
\
case P_HTML:
\
if (!what) break;   
\
if (use_cache) {
\
@@ -1501,33 +1442,6 @@
 #endif
 /* }}} */
 
-/* {{{ proto bool ircg_create_file_on_die(int connection, string path) 
-   Sets hostaction to be executed when connection dies */
-PHP_FUNCTION(ircg_create_file_on_die)
-{
-   zval **p1, **p2;
-   php_irconn_t *conn;
-   
-   

[PHP-CVS] cvs: php-src(PHP_4_4) /ext/ircg ircg.c php_ircg.h

2007-02-20 Thread Sascha Schumann
sas Tue Feb 20 19:04:28 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/ircg   ircg.c php_ircg.h 
  Log:
  - sync with current dev
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ircg/ircg.c?r1=1.137.2.18.4.2r2=1.137.2.18.4.3diff_format=u
Index: php-src/ext/ircg/ircg.c
diff -u php-src/ext/ircg/ircg.c:1.137.2.18.4.2 
php-src/ext/ircg/ircg.c:1.137.2.18.4.3
--- php-src/ext/ircg/ircg.c:1.137.2.18.4.2  Mon Jan  1 09:46:43 2007
+++ php-src/ext/ircg/ircg.c Tue Feb 20 19:04:28 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.137.2.18.4.2 2007/01/01 09:46:43 sebastian Exp $ */
+/* $Id: ircg.c,v 1.137.2.18.4.3 2007/02/20 19:04:28 sas Exp $ */
 
 /* {{{ includes */
 
@@ -124,6 +124,7 @@
 /* {{{ ircg_functions[] */
 function_entry ircg_functions[] = {
PHP_FE(ircg_set_on_die, NULL)
+   PHP_FE(ircg_create_file_on_die, NULL)
PHP_FE(ircg_pconnect, NULL)
PHP_FE(ircg_set_current, NULL)
PHP_FE(ircg_set_file, NULL)
@@ -204,6 +205,8 @@
struct in_addr od_ip;
short od_port;
 #endif
+
+   char *od_file;

int file_fd;

@@ -231,6 +234,7 @@
P_NICKNAME_JS = 3,
P_HTML= 4,
P_HTML_JS = 5,
+   P_XML = 6,
P_NOAUTO_LINKS = 8, /* Don't automatically convert links */
P_CONV_BR  = 16,/* Convert a special character to br */
P_COND_STOP= 32,/* If argument != username, stop */
@@ -393,6 +397,7 @@
 static void quit_handler(irconn_t *c, void *dummy)
 {
php_irconn_t *conn = dummy;
+   int fd;
 
irc_quit_handlers++;
if (conn-fd  -1) {
@@ -425,6 +430,14 @@
free(conn-od_data);
}
 #endif
+
+   if (conn-od_file) {
+   fd = open(conn-od_file, O_CREAT | O_WRONLY, 0666);
+   if (fd != -1) {
+   close(fd);
+   }
+   free(conn-od_file);
+   }

free(conn);
 }
@@ -451,6 +464,47 @@
}
 }
 
+static void ircg_xml_escape(smart_str *input, smart_str *output)
+{
+   unsigned char *p;
+   unsigned char *end;
+   unsigned char c;
+
+   end = input-c + input-len;
+
+   for(p = input-c; p  end; p++) {
+   c = *p;
+
+   if (c = 0  c  32) {
+   smart_str_appendl_ex(output, #, 2, 1);
+   smart_str_append_long_ex(output, c, 1);
+   smart_str_appendc_ex(output, ';', 1);
+   continue;
+   }
+   
+   switch (c) {
+   case '':
+   smart_str_appendl_ex(output, quot;, 6, 1);
+   break;
+   case '\'':
+   smart_str_appendl_ex(output, #039;, 6, 1);
+   break;
+
+   case '':
+   smart_str_appendl_ex(output, lt;, 4, 1);
+   break;
+
+   case '':
+   smart_str_appendl_ex(output, gt;, 4, 1);
+   break;
+
+   default:
+   smart_str_appendc_ex(output, c, 1);
+   break;
+   }
+   }
+}
+
 static const char hextab[] = 0123456789abcdef;
 
 #define NICKNAME_ESC_CHAR '|'
@@ -621,6 +675,7 @@
case '4': mode |= P_CONV_BR; goto next;
case '5': mode |= P_COND_STOP; goto next;
case '6': mode |= P_HTML; goto next;
+   case '7': mode |= P_XML; goto next;
 
/* associate mode bits with each command where applicable */
case 'c': NEW_TOKEN(C_CHANNEL, v) = mode; break;
@@ -701,6 +756,10 @@
ircg_js_escape(tmp, result);   \
smart_str_free_ex(tmp, 1); 
\
break;  
\
+   case P_XML: 
\
+   if (!what) break;   
\
+   ircg_xml_escape(what, result);  \
+   break;  
\
case P_HTML:
\
if (!what) break;   
\
if (use_cache) {
\
@@ -1442,6 +1501,33 @@
 #endif
 /* }}} */
 
+/* {{{ proto bool ircg_create_file_on_die(int connection, string path) 
+   Sets hostaction to be executed when connection dies */
+PHP_FUNCTION(ircg_create_file_on_die)
+{
+   zval **p1, **p2;
+   php_irconn_t *conn;
+   
+   if 

Re: [PHP-CVS] cvs: php-src(PHP_4_4) /ext/ircg ircg.c php_ircg.h

2007-02-20 Thread Derick Rethans
On Tue, 20 Feb 2007, Sascha Schumann wrote:

 sas   Tue Feb 20 19:04:28 2007 UTC
 
   Modified files:  (Branch: PHP_4_4)
 /php-src/ext/ircg ircg.c php_ircg.h 
   Log:
   - sync with current dev

Please revert that, PHP 4 is a bug-fix only branch AND the idea is to do 
a quick PHP 4.4.6 soon because of the mentioned problem. If you want new 
features - PECL.

regards,
Derick

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



Re: [PHP-CVS] cvs: php-src(PHP_4_4) /ext/ircg ircg.c php_ircg.h

2007-02-20 Thread Marcus Boerger
Hello Sascha,

  can we all please stick to our rules and not add new code to mini
releases. We even did not apply the patch we need for gcov testing.
If that is a problem I suggest to move this to extension pecl or
create a copy in pecl and do the changes there.

best regards
marcus

Tuesday, February 20, 2007, 8:04:28 PM, you wrote:

 sas Tue Feb 20 19:04:28 2007 UTC

   Modified files:  (Branch: PHP_4_4)
 /php-src/ext/ircg   ircg.c php_ircg.h 
   Log:
   - sync with current dev
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/ircg/ircg.c?r1=1.137.2.18.4.2r2=1.137.2.18.4.3diff_format=u
 Index: php-src/ext/ircg/ircg.c
 diff -u php-src/ext/ircg/ircg.c:1.137.2.18.4.2
 php-src/ext/ircg/ircg.c:1.137.2.18.4.3
 --- php-src/ext/ircg/ircg.c:1.137.2.18.4.2  Mon Jan  1 09:46:43 2007
 +++ php-src/ext/ircg/ircg.c Tue Feb 20 19:04:28 2007
 @@ -16,7 +16,7 @@
 +--+
   */
  
 -/* $Id: ircg.c,v 1.137.2.18.4.2 2007/01/01 09:46:43 sebastian Exp $ */
 +/* $Id: ircg.c,v 1.137.2.18.4.3 2007/02/20 19:04:28 sas Exp $ */
  
  /* {{{ includes */
  
 @@ -124,6 +124,7 @@
  /* {{{ ircg_functions[] */
  function_entry ircg_functions[] = {
 PHP_FE(ircg_set_on_die, NULL)
 +   PHP_FE(ircg_create_file_on_die, NULL)
 PHP_FE(ircg_pconnect, NULL)
 PHP_FE(ircg_set_current, NULL)
 PHP_FE(ircg_set_file, NULL)
 @@ -204,6 +205,8 @@
 struct in_addr od_ip;
 short od_port;
  #endif
 +
 +   char *od_file;
 
 int file_fd;
 
 @@ -231,6 +234,7 @@
 P_NICKNAME_JS = 3,
 P_HTML= 4,
 P_HTML_JS = 5,
 +   P_XML = 6,
 P_NOAUTO_LINKS = 8, /* Don't automatically convert links */
 P_CONV_BR  = 16,/* Convert a special character to br */
 P_COND_STOP= 32,/* If argument != username, stop */
 @@ -393,6 +397,7 @@
  static void quit_handler(irconn_t *c, void *dummy)
  {
 php_irconn_t *conn = dummy;
 +   int fd;
  
 irc_quit_handlers++;
 if (conn-fd  -1) {
 @@ -425,6 +430,14 @@
 free(conn-od_data);
 }
  #endif
 +
 +   if (conn-od_file) {
 +   fd = open(conn-od_file, O_CREAT | O_WRONLY, 0666);
 +   if (fd != -1) {
 +   close(fd);
 +   }
 +   free(conn-od_file);
 +   }
 
 free(conn);
  }
 @@ -451,6 +464,47 @@
 }
  }
  
 +static void ircg_xml_escape(smart_str *input, smart_str *output)
 +{
 +   unsigned char *p;
 +   unsigned char *end;
 +   unsigned char c;
 +
 +   end = input-c + input-len;
 +
 +   for(p = input-c; p  end; p++) {
 +   c = *p;
 +
 +   if (c = 0  c  32) {
 +   smart_str_appendl_ex(output, #, 2, 1);
 +   smart_str_append_long_ex(output, c, 1);
 +   smart_str_appendc_ex(output, ';', 1);
 +   continue;
 +   }
 +   
 +   switch (c) {
 +   case '':
 +   smart_str_appendl_ex(output, quot;, 6, 1);
 +   break;
 +   case '\'':
 +   smart_str_appendl_ex(output, #039;, 6, 1);
 +   break;
 +
 +   case '':
 +   smart_str_appendl_ex(output, lt;, 4, 1);
 +   break;
 +
 +   case '':
 +   smart_str_appendl_ex(output, gt;, 4, 1);
 +   break;
 +
 +   default:
 +   smart_str_appendc_ex(output, c, 1);
 +   break;
 +   }
 +   }
 +}
 +
  static const char hextab[] = 0123456789abcdef;
  
  #define NICKNAME_ESC_CHAR '|'
 @@ -621,6 +675,7 @@
 case '4': mode |= P_CONV_BR; goto next;
 case '5': mode |= P_COND_STOP; goto next;
 case '6': mode |= P_HTML; goto next;
 +   case '7': mode |= P_XML; goto next;
  
 /* associate mode bits with each command where applicable */
 case 'c': NEW_TOKEN(C_CHANNEL, v) = mode; break;
 @@ -701,6 +756,10 @@
 ircg_js_escape(tmp, result);   \
 smart_str_free_ex(tmp, 1);  
 break;   
 +   case P_XML:  
 +   if (!what) break;
 +   ircg_xml_escape(what, result);  \
 +   break;   
 case P_HTML: 
 if (!what) break;
 if (use_cache) {