sas             Wed Apr 25 06:50:35 2001 EDT

  Modified files:              
    /php4/ext/ircg      ircg.c ircg_scanner.c ircg_scanner.re 
  Log:
  Use the system malloc in the scanner 
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.62 php4/ext/ircg/ircg.c:1.63
--- php4/ext/ircg/ircg.c:1.62   Wed Apr 25 06:14:40 2001
+++ php4/ext/ircg/ircg.c        Wed Apr 25 06:50:35 2001
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ircg.c,v 1.62 2001/04/25 13:14:40 sas Exp $ */
+/* $Id: ircg.c,v 1.63 2001/04/25 13:50:35 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -439,7 +439,7 @@
        }
 
        if (encoded)
-               smart_str_free(&encoded_msg);
+               smart_str_free_ex(&encoded_msg, 1);
        if (js_encoded)
                smart_str_free_ex(&js_encoded_msg, 1);
 
Index: php4/ext/ircg/ircg_scanner.c
diff -u php4/ext/ircg/ircg_scanner.c:1.9 php4/ext/ircg/ircg_scanner.c:1.10
--- php4/ext/ircg/ircg_scanner.c:1.9    Tue Apr 24 02:40:05 2001
+++ php4/ext/ircg/ircg_scanner.c        Wed Apr 25 06:50:35 2001
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.5 on Fri Apr 20 10:19:53 2001 */
+/* Generated by re2c 0.5 on Wed Apr 25 15:49:43 2001 */
 #line 1 "/home/sas/src/php4/ext/ircg/ircg_scanner.re"
 /*
    +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ircg_scanner.c,v 1.9 2001/04/24 09:40:05 sas Exp $ */
+/* $Id: ircg_scanner.c,v 1.10 2001/04/25 13:50:35 sas Exp $ */
 
 #include <ext/standard/php_smart_str.h>
 #include <stdio.h>
@@ -79,19 +79,19 @@
 static void handle_scheme(STD_PARA)
 {
        ctx->scheme.len = 0;
-       smart_str_appendl(&ctx->scheme, start, YYCURSOR - start);
+       smart_str_appendl_ex(&ctx->scheme, start, YYCURSOR - start, 1);
        smart_str_0(&ctx->scheme);
 }
 
 static void handle_url(STD_PARA)
 {
-       smart_str_appends(ctx->result, "<a target=blank href=\"");
-       smart_str_append(ctx->result, &ctx->scheme);
-       smart_str_appendl(ctx->result, start, YYCURSOR - start);
-       smart_str_appends(ctx->result, "\">");
-       smart_str_append(ctx->result, &ctx->scheme);
-       smart_str_appendl(ctx->result, start, YYCURSOR - start);
-       smart_str_appends(ctx->result, "</a>");
+       smart_str_appends_ex(ctx->result, "<a target=blank href=\"", 1);
+       smart_str_append_ex(ctx->result, &ctx->scheme, 1);
+       smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
+       smart_str_appends_ex(ctx->result, "\">", 1);
+       smart_str_append_ex(ctx->result, &ctx->scheme, 1);
+       smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
+       smart_str_appends_ex(ctx->result, "</a>", 1);
 }
 
 static void handle_color_digit(STD_PARA, int mode)
@@ -120,7 +120,7 @@
 static void finish_color_stuff(STD_PARA)
 {
        if (ctx->font_tag_open) {
-               smart_str_appends(ctx->result, "</font>");
+               smart_str_appends_ex(ctx->result, "</font>", 1);
                ctx->font_tag_open = 0;
        }
 }
@@ -129,10 +129,10 @@
 {
        switch (ctx->bold_tag_open) {
        case 0:
-               if (!final) smart_str_appends(ctx->result, "<b>");
+               if (!final) smart_str_appends_ex(ctx->result, "<b>", 1);
                break;
        case 1:
-               smart_str_appends(ctx->result, "</b>");
+               smart_str_appends_ex(ctx->result, "</b>", 1);
                break;
        }
 
@@ -143,10 +143,10 @@
 {
        switch (ctx->underline_tag_open) {
        case 0:
-               if (!final) smart_str_appends(ctx->result, "<u>");
+               if (!final) smart_str_appends_ex(ctx->result, "<u>", 1);
                break;
        case 1:
-               smart_str_appends(ctx->result, "</u>");
+               smart_str_appends_ex(ctx->result, "</u>", 1);
                break;
        }
 
@@ -158,21 +158,21 @@
        finish_color_stuff(STD_ARGS);
 
        if (IS_VALID_CODE(ctx->fg_code)) {
-               smart_str_appends(ctx->result, "<font color=\"");
-               smart_str_appends(ctx->result, color_list[ctx->fg_code]);
-               smart_str_appends(ctx->result, "\">");
+               smart_str_appends_ex(ctx->result, "<font color=\"", 1);
+               smart_str_appends_ex(ctx->result, color_list[ctx->fg_code], 1);
+               smart_str_appends_ex(ctx->result, "\">", 1);
                ctx->font_tag_open = 1;
        }
 }
 
 static void passthru(STD_PARA)
 {
-       smart_str_appendl(ctx->result, start, YYCURSOR - start);
+       smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
 }
 
 static void add_entity(STD_PARA, const char *entity)
 {
-       smart_str_appends(ctx->result, entity);
+       smart_str_appends_ex(ctx->result, entity, 1);
 }
 
 void ircg_mirc_color(const char *msg, smart_str *result, size_t msg_len) {
@@ -495,7 +495,7 @@
                }
        }
 stop:
-       smart_str_free(&ctx->scheme);
+       smart_str_free_ex(&ctx->scheme, 1);
 
        finish_color_stuff(STD_ARGS);
        handle_bold(STD_ARGS, 1);
Index: php4/ext/ircg/ircg_scanner.re
diff -u php4/ext/ircg/ircg_scanner.re:1.9 php4/ext/ircg/ircg_scanner.re:1.10
--- php4/ext/ircg/ircg_scanner.re:1.9   Sat Mar 10 15:21:49 2001
+++ php4/ext/ircg/ircg_scanner.re       Wed Apr 25 06:50:35 2001
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ircg_scanner.re,v 1.9 2001/03/10 23:21:49 sas Exp $ */
+/* $Id: ircg_scanner.re,v 1.10 2001/04/25 13:50:35 sas Exp $ */
 
 #include <ext/standard/php_smart_str.h>
 #include <stdio.h>
@@ -87,19 +87,19 @@
 static void handle_scheme(STD_PARA)
 {
        ctx->scheme.len = 0;
-       smart_str_appendl(&ctx->scheme, start, YYCURSOR - start);
+       smart_str_appendl_ex(&ctx->scheme, start, YYCURSOR - start, 1);
        smart_str_0(&ctx->scheme);
 }
 
 static void handle_url(STD_PARA)
 {
-       smart_str_appends(ctx->result, "<a target=blank href=\"");
-       smart_str_append(ctx->result, &ctx->scheme);
-       smart_str_appendl(ctx->result, start, YYCURSOR - start);
-       smart_str_appends(ctx->result, "\">");
-       smart_str_append(ctx->result, &ctx->scheme);
-       smart_str_appendl(ctx->result, start, YYCURSOR - start);
-       smart_str_appends(ctx->result, "</a>");
+       smart_str_appends_ex(ctx->result, "<a target=blank href=\"", 1);
+       smart_str_append_ex(ctx->result, &ctx->scheme, 1);
+       smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
+       smart_str_appends_ex(ctx->result, "\">", 1);
+       smart_str_append_ex(ctx->result, &ctx->scheme, 1);
+       smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
+       smart_str_appends_ex(ctx->result, "</a>", 1);
 }
 
 static void handle_color_digit(STD_PARA, int mode)
@@ -128,7 +128,7 @@
 static void finish_color_stuff(STD_PARA)
 {
        if (ctx->font_tag_open) {
-               smart_str_appends(ctx->result, "</font>");
+               smart_str_appends_ex(ctx->result, "</font>", 1);
                ctx->font_tag_open = 0;
        }
 }
@@ -137,10 +137,10 @@
 {
        switch (ctx->bold_tag_open) {
        case 0:
-               if (!final) smart_str_appends(ctx->result, "<b>");
+               if (!final) smart_str_appends_ex(ctx->result, "<b>", 1);
                break;
        case 1:
-               smart_str_appends(ctx->result, "</b>");
+               smart_str_appends_ex(ctx->result, "</b>", 1);
                break;
        }
 
@@ -151,10 +151,10 @@
 {
        switch (ctx->underline_tag_open) {
        case 0:
-               if (!final) smart_str_appends(ctx->result, "<u>");
+               if (!final) smart_str_appends_ex(ctx->result, "<u>", 1);
                break;
        case 1:
-               smart_str_appends(ctx->result, "</u>");
+               smart_str_appends_ex(ctx->result, "</u>", 1);
                break;
        }
 
@@ -166,21 +166,21 @@
        finish_color_stuff(STD_ARGS);
 
        if (IS_VALID_CODE(ctx->fg_code)) {
-               smart_str_appends(ctx->result, "<font color=\"");
-               smart_str_appends(ctx->result, color_list[ctx->fg_code]);
-               smart_str_appends(ctx->result, "\">");
+               smart_str_appends_ex(ctx->result, "<font color=\"", 1);
+               smart_str_appends_ex(ctx->result, color_list[ctx->fg_code], 1);
+               smart_str_appends_ex(ctx->result, "\">", 1);
                ctx->font_tag_open = 1;
        }
 }
 
 static void passthru(STD_PARA)
 {
-       smart_str_appendl(ctx->result, start, YYCURSOR - start);
+       smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
 }
 
 static void add_entity(STD_PARA, const char *entity)
 {
-       smart_str_appends(ctx->result, entity);
+       smart_str_appends_ex(ctx->result, entity, 1);
 }
 
 void ircg_mirc_color(const char *msg, smart_str *result, size_t msg_len) {
@@ -255,7 +255,7 @@
                }
        }
 stop:
-       smart_str_free(&ctx->scheme);
+       smart_str_free_ex(&ctx->scheme, 1);
 
        finish_color_stuff(STD_ARGS);
        handle_bold(STD_ARGS, 1);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to