[PHP-CVS] cvs: php4 /ext/standard url_scanner_ex.re

2002-09-25 Thread Sascha Schumann

sas Wed Sep 25 06:35:28 2002 EDT

  Modified files:  
/php4/ext/standard  url_scanner_ex.re 
  Log:
  Allow malformed HTML such as
  
  a onClick=window.open(/hardware/somevar.php?hinfoid=,chgti) ..
  
  where ['] are part of the attribute value.
  
  
Index: php4/ext/standard/url_scanner_ex.re
diff -u php4/ext/standard/url_scanner_ex.re:1.59 
php4/ext/standard/url_scanner_ex.re:1.60
--- php4/ext/standard/url_scanner_ex.re:1.59Tue Aug 20 16:01:14 2002
+++ php4/ext/standard/url_scanner_ex.re Wed Sep 25 06:35:28 2002
 -299,7 +299,7 
 /*!re2c
   [] (any\[])* []  { handle_val(STD_ARGS, 1, ''); goto state_next_arg_begin; }
   ['] (any\['])* [']  { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
-  (any\[ \n'])+  { handle_val(STD_ARGS, 0, ''); goto 
state_next_arg_begin; }
+  (any\[ \n])+{ handle_val(STD_ARGS, 0, '\0'); goto 
+state_next_arg_begin; }
   any  { passthru(STD_ARGS); goto 
state_next_arg_begin; }
 */
 



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




[PHP-CVS] cvs: php4 /ext/standard url_scanner_ex.c

2002-09-25 Thread Sascha Schumann

sas Wed Sep 25 06:36:20 2002 EDT

  Modified files:  
/php4/ext/standard  url_scanner_ex.c 
  Log:
  Sync with .re
  
  
Index: php4/ext/standard/url_scanner_ex.c
diff -u php4/ext/standard/url_scanner_ex.c:1.69 php4/ext/standard/url_scanner_ex.c:1.70
--- php4/ext/standard/url_scanner_ex.c:1.69 Tue Aug 20 16:07:00 2002
+++ php4/ext/standard/url_scanner_ex.c  Wed Sep 25 06:36:19 2002
 -1,5 +1,5 
-/* Generated by re2c 0.5 on Tue Aug 20 21:52:13 2002 */
-#line 1 /usr/src/php4/ext/standard/url_scanner_ex.re
+/* Generated by re2c 0.5 on Wed Sep 25 12:35:38 2002 */
+#line 1 url_scanner_ex.re
 /*
   +--+
   | PHP Version 4|
 -683,50 +683,50 
YYCTYPE yych;
unsigned int yyaccept;
static unsigned char yybm[] = {
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 192, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   192, 224,  64, 224, 224, 224, 224, 128, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224,   0, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
-   224, 224, 224, 224, 224, 224, 224, 224, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 160, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   160, 248,  56, 248, 248, 248, 248, 200, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248,   0, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
+   248, 248, 248, 248, 248, 248, 248, 248, 
};
goto yy58;
 yy59:  ++YYCURSOR;
 yy58:
-   if((YYLIMIT - YYCURSOR)  2) YYFILL(2);
+   if((YYLIMIT - YYCURSOR)  3) YYFILL(3);
yych = *YYCURSOR;
if(yych = '!'){
if(yych = '\n'){
if(yych = '\t')goto yy63;
-   goto yy65;
+   goto yy64;
} else {
-   if(yych == ' ') goto yy65;
+   if(yych == ' ') goto yy64;
goto yy63;
}
} else {
 -735,54 +735,72 
if(yych = '') goto yy63;
goto yy62;
} else {
-   if(yych == '') goto yy65;
+   if(yych == '') goto yy64;
goto yy63;
}
}
 yy60:  yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
-   if(yych != '') goto yy74;
+   goto yy77;
 

[PHP-CVS] cvs: php4 /ext/standard url_scanner_ex.c

2002-09-25 Thread Sascha Schumann

sas Wed Sep 25 08:15:43 2002 EDT

  Modified files:  
/php4/ext/standard  url_scanner_ex.c 
  Log:
  Sync
  
  
Index: php4/ext/standard/url_scanner_ex.c
diff -u php4/ext/standard/url_scanner_ex.c:1.70 php4/ext/standard/url_scanner_ex.c:1.71
--- php4/ext/standard/url_scanner_ex.c:1.70 Wed Sep 25 06:36:19 2002
+++ php4/ext/standard/url_scanner_ex.c  Wed Sep 25 08:15:42 2002
 -1,5 +1,5 
-/* Generated by re2c 0.5 on Wed Sep 25 12:35:38 2002 */
-#line 1 url_scanner_ex.re
+/* Generated by re2c 0.5 on Wed Sep 25 14:14:17 2002 */
+#line 1 /home/sas/src/php4/ext/standard/url_scanner_ex.re
 /*
   +--+
   | PHP Version 4|
 -83,10 +83,10 
 }
 
 PHP_INI_BEGIN()
-   STD_PHP_INI_ENTRY(url_rewriter.tags, 
a=href,area=href,frame=src,form=fakeentry, PHP_INI_ALL, OnUpdateTags, 
url_adapt_state_ex, php_basic_globals, basic_globals)
+   STD_PHP_INI_ENTRY(url_rewriter.tags, 
+a=href,area=href,frame=src,form=,fieldset=, PHP_INI_ALL, OnUpdateTags, 
+url_adapt_state_ex, php_basic_globals, basic_globals)
 PHP_INI_END()
 
-#line 91
+#line 92
 
 
 #define YYFILL(n) goto done
 -151,25 +151,25 
if(yych = ';') goto yy4;
 yy2:   yych = *++YYCURSOR;
 yy3:
-#line 109
+#line 110
{ smart_str_append(dest, url); return; }
 yy4:   yych = *++YYCURSOR;
 yy5:
-#line 110
+#line 111
{ sep = separator; goto scan; }
 yy6:   yych = *++YYCURSOR;
 yy7:
-#line 111
+#line 112
{ bash = p - 1; goto done; }
 yy8:   ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
 yy9:   if(yybm[0+yych]  128)  goto yy8;
 yy10:
-#line 112
+#line 113
{ goto scan; }
 }
-#line 113
+#line 114
 
 done:

 -235,20 +235,48 
 #define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC
 #define STD_ARGS ctx, start, xp TSRMLS_CC
 
+#if SCANNER_DEBUG
+#define scdebug(x) printf x
+#else
+#define scdebug(x)
+#endif
+
 static inline void passthru(STD_PARA) 
 {
+   scdebug((appending %d chars, starting with %c\n, YYCURSOR-start, *start));
smart_str_appendl(ctx-result, start, YYCURSOR - start);
 }
 
-static inline void handle_form(STD_PARA) 
+/*
+ * This function appends a hidden input field after a form or
+ * fieldset.  The latter is important for XHTML.
+ */
+
+static void handle_form(STD_PARA) 
 {
-   if (ctx-form_app.len  0 
-ctx-tag.len == 4 
-strncasecmp(ctx-tag.c, form, 4) == 0) {
-   smart_str_append(ctx-result, ctx-form_app);
+   int doit = 0;
+
+   if (ctx-form_app.len  0) {
+   switch (ctx-tag.len) {
+   
+   case sizeof(form)-1:
+   if (strcasecmp(ctx-tag.c, form) == 0)
+   doit = 1;
+   break;
+
+   case sizeof(fieldset)-1:
+   if (strcasecmp(ctx-tag.c, fieldset) == 0)
+   doit = 1;
+   break;
+   }
+
+   if (doit)
+   smart_str_append(ctx-result, ctx-form_app);
}
 }
 
+
+
 /*
  *  HANDLE_TAG copies the HTML Tag and checks whether we 
  *  have that tag in our table. If we might modify it,
 -282,12 +310,6 
tag_arg(ctx, quotes, type TSRMLS_CC);
 }
 
-#ifdef SCANNER_DEBUG
-#define scdebug(x) printf x
-#else
-#define scdebug(x)
-#endif
-
 static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t 
newlen TSRMLS_DC)
 {
char *end, *q;
 -360,17 +382,17 
if(yybm[0+yych]  128)  goto yy15;
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 259
+#line 282
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
 yy15:  ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
 yy16:  if(yybm[0+yych]  128)  goto yy15;
 yy17:
-#line 260
+#line 283
{ passthru(STD_ARGS); goto state_plain; }
 }
-#line 261
+#line 284
 
 
 state_tag: 
 -424,11 +446,11 
 yy20:  yych = *++YYCURSOR;
goto yy25;
 yy21:
-#line 266
+#line 289
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == 
STATE_PLAIN) goto state_plain; else goto state_next_arg; }
 yy22:  yych = *++YYCURSOR;
 yy23:
-#line 267
+#line 290
{ passthru(STD_ARGS); goto state_plain_begin; }
 yy24:  ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
 -436,7 +458,7 
 yy25:  if(yybm[0+yych]  128)  goto yy24;
goto yy21;
 }
-#line 268
+#line 291
 
 
 state_next_arg_begin:
 -507,20 +529,20 
}
 yy28:  yych = *++YYCURSOR;
 yy29:
-#line 276
+#line 299
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
 yy30:  yych = *++YYCURSOR;
goto yy37;
 yy31:
-#line 277
+#line 300
{ passthru(STD_ARGS); goto state_next_arg; }
 yy32:  yych = 

[PHP-CVS] cvs: php4 /ext/fribidi fribidi.c

2002-09-25 Thread Tal Peer

tal Wed Sep 25 09:49:55 2002 EDT

  Modified files:  
/php4/ext/fribidi   fribidi.c 
  Log:
  - Update proto
  
  
Index: php4/ext/fribidi/fribidi.c
diff -u php4/ext/fribidi/fribidi.c:1.22 php4/ext/fribidi/fribidi.c:1.23
--- php4/ext/fribidi/fribidi.c:1.22 Mon Sep 23 16:24:29 2002
+++ php4/ext/fribidi/fribidi.c  Wed Sep 25 09:49:55 2002
 -17,7 +17,7 
+--+
  */
 
-/* $Id: fribidi.c,v 1.22 2002/09/23 20:24:29 tal Exp $ */
+/* $Id: fribidi.c,v 1.23 2002/09/25 13:49:55 tal Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
 -118,7 +118,7 
 ++
 */   
 
-/* {{{ proto string fribidi_log2vis(string str, long direction, int charset)
+/* {{{ proto string fribidi_log2vis(string v_str, long direction, long charset)
Convert a logical string to a visual one */
 PHP_FUNCTION(fribidi_log2vis)
 {



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




[PHP-CVS] cvs: php4 / EXTENSIONS

2002-09-25 Thread Sterling Hughes

sterlingWed Sep 25 10:07:58 2002 EDT

  Modified files:  
/php4   EXTENSIONS 
  Log:
  if this makes people happier about me not working on these anymore, so be 
  it :)
  
  
Index: php4/EXTENSIONS
diff -u php4/EXTENSIONS:1.41 php4/EXTENSIONS:1.42
--- php4/EXTENSIONS:1.41Thu Sep 19 13:11:59 2002
+++ php4/EXTENSIONS Wed Sep 25 10:07:57 2002
@@ -197,7 +197,7 @@
 ---
 EXTENSION:   bz2
 PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
-MAINTENANCE: Maintained
+MAINTENANCE: Orphaned
 STATUS:  Working
 SINCE:   4.0.3
 ---
@@ -422,7 +422,7 @@
 ---
 EXTENSION:   swf
 PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
-MAINTENANCE: Maintained
+MAINTENANCE: Orphaned
 STATUS:  Depreciated (Use the ming swf extension instead)
 COMMENT: Only for Unix (won't change)
 ---
@@ -451,7 +451,7 @@
 ---
 EXTENSION:   xslt
 PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
-MAINTENANC:  Maintained
+MAINTENANC:  Orphaned
 STATUS:  Working
 ---
 EXTENSION:   yaz
@@ -471,8 +471,8 @@
 ---
 EXTENSION:   zziplib
 PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
-MAINTENANCE: Maintained
-STATUS:  Experimental
+MAINTENANCE: Orphaned
+STATUS:  Working
 SINCE:   4.0.5
 ---
 # iptc?



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




[PHP-CVS] cvs: php4 /ext/standard basic_functions.c file.c file.h fsock.c /main main.c network.c php.h php_network.h php_streams.h streams.c

2002-09-25 Thread Wez Furlong

wez Wed Sep 25 11:25:13 2002 EDT

  Modified files:  
/php4/ext/standard  basic_functions.c file.c file.h fsock.c 
/php4/main  main.c network.c php.h php_network.h php_streams.h 
streams.c 
  Log:
  Implement persistent streams. (for pfsockopen).
  Juggle some includes/definitions.
  Tidy up streams use in ext/standard/file.c
  
  

Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.510 
php4/ext/standard/basic_functions.c:1.511
--- php4/ext/standard/basic_functions.c:1.510   Tue Sep 24 06:55:56 2002
+++ php4/ext/standard/basic_functions.c Wed Sep 25 11:25:11 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.510 2002/09/24 10:55:56 zeev Exp $ */
+/* $Id: basic_functions.c,v 1.511 2002/09/25 15:25:11 wez Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1136,6 +1136,7 @@
PHP_RSHUTDOWN(syslog) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_RSHUTDOWN(assert) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_RSHUTDOWN(url_scanner_ex) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
+   PHP_RSHUTDOWN(streams) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
 
if (BG(user_tick_functions)) {
zend_llist_destroy(BG(user_tick_functions));
@@ -1148,7 +1149,7 @@
efree(BG(aggregation_table));
BG(aggregation_table) = NULL;
}
-
+   
 #ifdef HAVE_MMAP
if (BG(mmap_file)) {
munmap(BG(mmap_file), BG(mmap_len));
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.257 php4/ext/standard/file.c:1.258
--- php4/ext/standard/file.c:1.257  Mon Sep 23 22:46:38 2002
+++ php4/ext/standard/file.cWed Sep 25 11:25:11 2002
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.257 2002/09/24 02:46:38 wez Exp $ */
+/* $Id: file.c,v 1.258 2002/09/25 15:25:11 wez Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -119,7 +119,6 @@
 /* {{{ ZTS-stuff / Globals / Prototypes */
 
 /* sharing globals is *evil* */
-static int le_stream = FAILURE;
 static int le_stream_context = FAILURE;
 
 /* }}} */
@@ -130,29 +129,14 @@
php_stream_context_free((php_stream_context*)rsrc-ptr);
 }
 
-static void _file_stream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
-   php_stream *stream = (php_stream*)rsrc-ptr;
-   /* the stream might be a pipe, so set the return value for pclose */
-   FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | 
PHP_STREAM_FREE_RSRC_DTOR);
-}
-
-PHPAPI int php_file_le_stream(void)
-{
-   return le_stream;
-}
-
 static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
 {
-   zend_hash_init(FG(ht_persistent_socks), 0, NULL, NULL, 1);
FG(pclose_ret) = 0;
FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE;
 }
 
-
 static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC)
 {
-   zend_hash_destroy(FG(ht_persistent_socks));
 }
 
 
@@ -164,7 +148,6 @@
 
 PHP_MINIT_FUNCTION(file)
 {
-   le_stream = zend_register_list_destructors_ex(_file_stream_dtor, NULL, 
stream, module_number);
le_stream_context = zend_register_list_destructors_ex(file_context_dtor, NULL, 
stream-context, module_number);
 
 #ifdef ZTS
@@ -219,17 +202,16 @@
 PHP_FUNCTION(flock)
 {
 zval **arg1, **arg2, **arg3;
-int type, fd, act, ret, arg_count = ZEND_NUM_ARGS();
-   void *what;
+int fd, act, ret, arg_count = ZEND_NUM_ARGS();
+   php_stream *stream;
 
 if (arg_count  3 || zend_get_parameters_ex(arg_count, arg1, arg2, arg3) == 
FAILURE) {
 WRONG_PARAM_COUNT;
 }
 
-   what = zend_fetch_resource(arg1 TSRMLS_CC, -1, File-Handle, type, 1, 
le_stream);
-   ZEND_VERIFY_RESOURCE(what);
+   php_stream_from_zval(stream, arg1);
 
-   if (php_stream_cast((php_stream*)what, PHP_STREAM_AS_FD, (void*)fd, 1) == 
FAILURE) {
+   if (php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)fd, 1) == FAILURE)   
+ {
RETURN_FALSE;
}
 
@@ -600,8 +582,7 @@
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg1) == FAILURE) {
WRONG_PARAM_COUNT;
}
-   stream = (php_stream*)zend_fetch_resource(arg1 TSRMLS_CC, -1, File-Handle, 
NULL, 1, le_stream);
-   ZEND_VERIFY_RESOURCE(stream);
+   php_stream_from_zval(stream, arg1);
 
if (stream-wrapperdata){
*return_value = *(stream-wrapperdata);
@@ -707,19 +688,23 @@
 /* given a zval which is either a stream or a context, return the underlying
  * stream_context.  If it is a stream that does not have a context assigned, it
  * will create and assign a context and return that.  */
-static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC) {
-   php_stream_context *context = NULL; void *what; int type;
-
-   what = 

[PHP-CVS] cvs: php4 /ext/bz2 bz2.c /ext/ftp php_ftp.c /ext/interbase interbase.c /ext/ming ming.c /ext/pdf pdf.c /ext/posix posix.c /ext/recode recode.c /ext/standard exec.c file.c

2002-09-25 Thread Wez Furlong

wez Wed Sep 25 11:46:46 2002 EDT

  Modified files:  
/php4/ext/bz2   bz2.c 
/php4/ext/ftp   php_ftp.c 
/php4/ext/interbase interbase.c 
/php4/ext/ming  ming.c 
/php4/ext/pdf   pdf.c 
/php4/ext/posix posix.c 
/php4/ext/recoderecode.c 
/php4/ext/standard  exec.c file.c 
  Log:
  Make these all work with persistent streams too.
  
  

Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.58 php4/ext/bz2/bz2.c:1.59
--- php4/ext/bz2/bz2.c:1.58 Sun Sep 22 21:47:02 2002
+++ php4/ext/bz2/bz2.c  Wed Sep 25 11:46:43 2002
 -16,7 +16,7 
+--+
  */
  
-/* $Id: bz2.c,v 1.58 2002/09/23 01:47:02 wez Exp $ */
+/* $Id: bz2.c,v 1.59 2002/09/25 15:46:43 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
 -259,7 +259,7 
RETURN_FALSE;
}

-   ZEND_FETCH_RESOURCE(stream, php_stream *, bz, -1, File-Handle, 
php_file_le_stream());
+   php_stream_from_zval(stream, bz);
 
if (len  0) {
zend_error(E_WARNING, %s(): length may not be negative, 
get_active_function_name(TSRMLS_C));
 -311,17 +311,10 
NULL);
} else {
/* If it is a resource, than its a stream resource */
-   int type;
int fd;
-   
-   stream = (php_stream *) zend_fetch_resource(file 
-  
 TSRMLS_CC, 
-  
 -1, 
-  
 File-Handle, 
-  
 type, 
-  
 1, 
-  
 php_file_le_stream());
-   ZEND_VERIFY_RESOURCE(stream);
+
+   php_stream_from_zval(stream, file);
+
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)fd, 
REPORT_ERRORS))
RETURN_FALSE;

 -507,7 +500,7 
zend_get_parameters_ex(1, bzp) == FAILURE) {
WRONG_PARAM_COUNT;
}
-   ZEND_FETCH_RESOURCE(stream, php_stream *, bzp, -1, File-Handle, 
php_file_le_stream());
+   php_stream_from_zval(stream, bzp);
 
if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) {
RETURN_FALSE;
Index: php4/ext/ftp/php_ftp.c
diff -u php4/ext/ftp/php_ftp.c:1.71 php4/ext/ftp/php_ftp.c:1.72
--- php4/ext/ftp/php_ftp.c:1.71 Thu Sep  5 06:13:27 2002
+++ php4/ext/ftp/php_ftp.c  Wed Sep 25 11:46:43 2002
 -17,7 +17,7 
+--+
  */
 
-/* $Id: php_ftp.c,v 1.71 2002/09/05 10:13:27 hyanantha Exp $ */
+/* $Id: php_ftp.c,v 1.72 2002/09/25 15:46:43 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
 -476,7 +476,7 
}
 
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
-   ZEND_FETCH_RESOURCE(stream, php_stream*, z_file, -1, File-Handle, 
php_file_le_stream());
+   php_stream_from_zval(stream, z_file);
XTYPE(xtype, mode);
 
/* ignore autoresume if autoseek is switched off */
 -702,7 +702,7 
}
 
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
-   ZEND_FETCH_RESOURCE(stream, php_stream*, z_file, -1, File-Handle, 
php_file_le_stream());
+   php_stream_from_zval(stream, z_file);
XTYPE(xtype, mode);
 
/* ignore autoresume if autoseek is switched off */
 -748,7 +748,7 
}
 
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
-   ZEND_FETCH_RESOURCE(stream, php_stream*, z_file, -1, File-Handle, 
php_file_le_stream());
+   php_stream_from_zval(stream, z_file);
XTYPE(xtype, mode);
 
/* ignore autoresume if autoseek is switched off */
Index: php4/ext/interbase/interbase.c
diff -u php4/ext/interbase/interbase.c:1.89 php4/ext/interbase/interbase.c:1.90
--- php4/ext/interbase/interbase.c:1.89 Thu Sep 12 07:18:47 2002
+++ php4/ext/interbase/interbase.c  Wed Sep 25 11:46:44 2002
 -17,7 +17,7 
+--+
  */
 
-/* $Id: interbase.c,v 1.89 2002/09/12 11:18:47 derick Exp $ */
+/* $Id: interbase.c,v 1.90 2002/09/25 15:46:44 wez Exp $ */
 
 
 /* TODO: Arrays, roles?
 -609,7 +609,7 
 
php_info_print_table_start();
php_info_print_table_row(2, Interbase Support, enabled);
-   php_info_print_table_row(2, Revision, 

[PHP-CVS] cvs: php4 / EXTENSIONS NEWS

2002-09-25 Thread Sascha Schumann

sas Wed Sep 25 12:06:41 2002 EDT

  Modified files:  
/php4   NEWS EXTENSIONS 
  Log:
  style police
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1133 php4/NEWS:1.1134
--- php4/NEWS:1.1133Mon Sep 23 20:35:14 2002
+++ php4/NEWS   Wed Sep 25 12:06:40 2002
@@ -1,7 +1,7 @@
 PHP 4  NEWS
 |||
 ? ? ??? 2002, Version 4.3.0
-- Implement platform independant socket error constants, which benefits error handling
+- Added platform independent socket error constants for better error handling.
 - Fixed include() and require() to work with remote files under win32. (Wez)
 - Added php.ini option auto_detect_line_endings which enables PHP to detect
   Macintosh, Unix and Dos end-of-line characters in fgets() and file().
Index: php4/EXTENSIONS
diff -u php4/EXTENSIONS:1.42 php4/EXTENSIONS:1.43
--- php4/EXTENSIONS:1.42Wed Sep 25 10:07:57 2002
+++ php4/EXTENSIONS Wed Sep 25 12:06:40 2002
@@ -423,7 +423,7 @@
 EXTENSION:   swf
 PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
 MAINTENANCE: Orphaned
-STATUS:  Depreciated (Use the ming swf extension instead)
+STATUS:  Deprecated (Use the ming swf extension instead)
 COMMENT: Only for Unix (won't change)
 ---
 EXTENSION:   sysvsem



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




[PHP-CVS] cvs: php4 / NEWS php.ini-dist /main main.c

2002-09-25 Thread Sascha Schumann

sas Wed Sep 25 12:11:31 2002 EDT

  Modified files:  
/php4   NEWS php.ini-dist 
/php4/main  main.c 
  Log:
  We are about to enter 2003, sending two-digit years does not make too
  much sense anymore.  According to an article from '98, only Netscape 3.x was 
  affected anyway.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1134 php4/NEWS:1.1135
--- php4/NEWS:1.1134Wed Sep 25 12:06:40 2002
+++ php4/NEWS   Wed Sep 25 12:11:31 2002
 -1,6 +1,7 
 PHP 4  NEWS
 |||
 ? ? ??? 2002, Version 4.3.0
+- Changed y2k_compliance to default to 1 now. (Sascha)
 - Added platform independent socket error constants for better error handling.
 - Fixed include() and require() to work with remote files under win32. (Wez)
 - Added php.ini option auto_detect_line_endings which enables PHP to detect
Index: php4/php.ini-dist
diff -u php4/php.ini-dist:1.156 php4/php.ini-dist:1.157
--- php4/php.ini-dist:1.156 Wed Sep 25 07:06:24 2002
+++ php4/php.ini-dist   Wed Sep 25 12:11:31 2002
 -77,7 +77,7 
 precision=  12
 
 ; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
-y2k_compliance = Off
+y2k_compliance = on
 
 ; Output buffering allows you to send header lines (including cookies) even
 ; after you send body content, at the price of slowing PHP's output layer a
 -819,7 +819,8 
 
 ;session.entropy_file = /dev/urandom
 
-; Set to {nocache,private,public} to determine HTTP caching aspects.
+; Set to {nocache,private,public,} to determine HTTP caching aspects
+; or leave this empty to avoid sending anti-caching headers.
 session.cache_limiter = nocache
 
 ; Document expires after n minutes.
Index: php4/main/main.c
diff -u php4/main/main.c:1.490 php4/main/main.c:1.491
--- php4/main/main.c:1.490  Wed Sep 25 11:25:12 2002
+++ php4/main/main.cWed Sep 25 12:11:31 2002
 -18,7 +18,7 
+--+
 */
 
-/* $Id: main.c,v 1.490 2002/09/25 15:25:12 wez Exp $ */
+/* $Id: main.c,v 1.491 2002/09/25 16:11:31 sas Exp $ */
 
 /* {{{ includes
  */
 -275,7 +275,7 
STD_PHP_INI_BOOLEAN(short_open_tag,DEFAULT_SHORT_OPEN_TAG,
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnUpdateBool,   short_tags,
 zend_compiler_globals,  compiler_globals)
STD_PHP_INI_BOOLEAN(sql.safe_mode,0,
PHP_INI_SYSTEM, OnUpdateBool,   sql_safe_mode, 
 php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN(track_errors, 0,
PHP_INI_ALL,OnUpdateBool,   track_errors,  
 php_core_globals,   core_globals)
-   STD_PHP_INI_BOOLEAN(y2k_compliance,   0,PHP_INI_ALL,   
 OnUpdateBool,   y2k_compliance, 
php_core_globals,   core_globals)
+   STD_PHP_INI_BOOLEAN(y2k_compliance,   1,PHP_INI_ALL,   
+ OnUpdateBool,   y2k_compliance, 
+php_core_globals,   core_globals)
 
STD_PHP_INI_ENTRY(unserialize_callback_func,  NULL,   PHP_INI_ALL,   
 OnUpdateString, unserialize_callback_func,  php_core_globals,   
core_globals)
STD_PHP_INI_ENTRY(arg_separator.output,   ,PHP_INI_ALL,   
 OnUpdateStringUnempty,  arg_separator.output,   php_core_globals,   
core_globals)



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




[PHP-CVS] cvs: php4 / EXTENSIONS

2002-09-25 Thread Sterling Hughes

sterlingWed Sep 25 13:07:12 2002 EDT

  Modified files:  
/php4   EXTENSIONS 
  Log:
  add two extensions - and orphan them.
  
  
Index: php4/EXTENSIONS
diff -u php4/EXTENSIONS:1.43 php4/EXTENSIONS:1.44
--- php4/EXTENSIONS:1.43Wed Sep 25 12:06:40 2002
+++ php4/EXTENSIONS Wed Sep 25 13:07:12 2002
@@ -201,6 +201,18 @@
 STATUS:  Working
 SINCE:   4.0.3
 ---
+EXTENSION:   dio
+PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
+MAINTENANCE: Orphaned
+STATUS:  Working
+SINCE:   4.0.6
+---
+EXTENSION:   cyrus
+PRIMARY MAINTAINER:  Sterling Hughes [EMAIL PROTECTED]
+MAINTENANCE: Orphaned
+STATUS:  Working
+SINCE:   4.0.6
+---
 EXTENSION:   calendar
 PRIMARY MAINTAINER:  Hartmut Holzgraefe [EMAIL PROTECTED]
 MAINTENANCE: Odd Fixes



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




[PHP-CVS] cvs: php4 /ext/standard reg.h

2002-09-25 Thread Andrei Zmievski

andrei  Wed Sep 25 13:48:10 2002 EDT

  Modified files:  
/php4/ext/standard  reg.h 
  Log:
  
  
  
Index: php4/ext/standard/reg.h
diff -u php4/ext/standard/reg.h:1.16 php4/ext/standard/reg.h:1.17
--- php4/ext/standard/reg.h:1.16Wed Sep 25 10:02:34 2002
+++ php4/ext/standard/reg.h Wed Sep 25 13:48:10 2002
 -17,7 +17,7 
 */
 
 
-/* $Id: reg.h,v 1.16 2002/09/25 14:02:34 andrei Exp $ */
+/* $Id: reg.h,v 1.17 2002/09/25 17:48:10 andrei Exp $ */
 
 #ifndef REG_H
 #define REG_H
 -42,7 +42,7 
 
 
 #ifdef ZTS
-#define REG(v) TSRMG(reg_globals_id, php_reg_globals *, v)
+#define REG(v) TSRMG(reg_globals_id, zend_reg_globals *, v)
 #else
 #define REG(v) (reg_globals.v)
 #endif



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




[PHP-CVS] cvs: php4 /ext/standard basic_functions.c php_string.h string.c

2002-09-25 Thread Andrey Hristov

andrey  Wed Sep 25 14:06:06 2002 EDT

  Modified files:  
/php4/ext/standard  basic_functions.c php_string.h string.c 
  Log:
  str_shuffle() function added. Like shuffle() for arrays - however the
  algorithm for creating the permutation is quite simple. More like 
  the implementation of shuffle() for 4.2.1 .
  
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.511 
php4/ext/standard/basic_functions.c:1.512
--- php4/ext/standard/basic_functions.c:1.511   Wed Sep 25 11:25:11 2002
+++ php4/ext/standard/basic_functions.c Wed Sep 25 14:06:05 2002
 -17,7 +17,7 
+--+
  */
 
-/* $Id: basic_functions.c,v 1.511 2002/09/25 15:25:11 wez Exp $ */
+/* $Id: basic_functions.c,v 1.512 2002/09/25 18:06:05 andrey Exp $ */
 
 #include php.h
 #include php_streams.h
 -329,6 +329,7 
PHP_FE(strstr, 
 NULL)
PHP_FE(stristr,
 NULL)
PHP_FE(strrchr,
 NULL)
+   PHP_FE(str_shuffle,
+ NULL)
 
 #ifdef HAVE_STRCOLL
PHP_FE(strcoll,
 NULL)
Index: php4/ext/standard/php_string.h
diff -u php4/ext/standard/php_string.h:1.60 php4/ext/standard/php_string.h:1.61
--- php4/ext/standard/php_string.h:1.60 Tue Aug 20 16:47:47 2002
+++ php4/ext/standard/php_string.h  Wed Sep 25 14:06:05 2002
 -17,7 +17,7 
+--+
 */
 
-/* $Id: php_string.h,v 1.60 2002/08/20 20:47:47 wez Exp $ */
+/* $Id: php_string.h,v 1.61 2002/09/25 18:06:05 andrey Exp $ */
 
 /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
 
 -82,6 +82,7 
 PHP_FUNCTION(substr_count);
 PHP_FUNCTION(str_pad);
 PHP_FUNCTION(sscanf);
+PHP_FUNCTION(str_shuffle);
 #ifdef HAVE_STRCOLL
 PHP_FUNCTION(strcoll);
 #endif
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.297 php4/ext/standard/string.c:1.298
--- php4/ext/standard/string.c:1.297Mon Sep 23 10:20:02 2002
+++ php4/ext/standard/string.c  Wed Sep 25 14:06:05 2002
 -18,7 +18,7 
+--+
  */
 
-/* $Id: string.c,v 1.297 2002/09/23 14:20:02 sebastian Exp $ */
+/* $Id: string.c,v 1.298 2002/09/25 18:06:05 andrey Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
 -3929,6 +3929,39 
zval_copy_ctor(return_value);
 
php_strtr(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), rot13_from, 
rot13_to, 52);
+}
+/* }}} */
+
+
+static int php_string_shuffle(const void *a, const void *b TSRMLS_DC)
+{
+   long rnd;
+   rnd = php_rand(TSRMLS_C);
+   if (rnd % 3)
+   return 1;
+   else if (rnd % 5)
+   return 0;
+   else 
+   return -1;
+}
+
+/* {{{ proto string str_shuffle(string str)
+   Shuffles string. One permutation of all possible is created */
+PHP_FUNCTION(str_shuffle)
+{
+   /* Note : by using current php_string_shuffle for string  */
+   /* with 6 chars (6! permutations) about 2/3 of them are   */
+   /* computed for 6! calls for the function. So it isn't so */
+   /* unique. The ratio is the same for other lengths.   */
+   char *str;
+   int i, str_len;
+   
+   i = 0;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, str, str_len) == 
+FAILURE) {
+   RETURN_FALSE;
+   }
+   zend_qsort((void *)str, str_len, sizeof(char), php_string_shuffle TSRMLS_CC);
+   RETURN_STRINGL(str, str_len, 1);
 }
 /* }}} */
 



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




[PHP-CVS] cvs: php4 /ext/standard string.c

2002-09-25 Thread Andrey Hristov

andrey  Wed Sep 25 15:06:30 2002 EDT

  Modified files:  
/php4/ext/standard  string.c 
  Log:
  Added common handler for strspn() and strcspn(). Almost of the code is 
  identical. Modified to accept up to 4 params. Last 2 optional start  len.
  They are analogic to start  len of substr(). So the behavior when start 
  len are used is like
  strspn(substr($s,$start,$len),$good_chars) and
  strcspn(substr($s,$start,$len), $bad_chars)
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.298 php4/ext/standard/string.c:1.299
--- php4/ext/standard/string.c:1.298Wed Sep 25 14:06:05 2002
+++ php4/ext/standard/string.c  Wed Sep 25 15:06:29 2002
 -18,7 +18,7 
+--+
  */
 
-/* $Id: string.c,v 1.298 2002/09/25 18:06:05 andrey Exp $ */
+/* $Id: string.c,v 1.299 2002/09/25 19:06:29 andrey Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
 -54,6 +54,9 
 #define PHP_PATHINFO_EXTENSION 4
 #define PHP_PATHINFO_ALL   (PHP_PATHINFO_DIRNAME | PHP_PATHINFO_BASENAME | 
PHP_PATHINFO_EXTENSION)
 
+#define STR_STRSPN 0
+#define STR_STRCSPN1
+
 /* {{{ register_string_constants
  */
 void register_string_constants(INIT_FUNC_ARGS)
 -195,39 +198,71 
 }
 /* }}} */
 
-/* {{{ proto int strspn(string str, string mask)
-   Finds length of initial segment consisting entirely of characters found in mask */
-PHP_FUNCTION(strspn)
+static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
 {
-   zval **s1, **s2;
+   char *s11, *s22;
+   long len1, len2, start, len;

-   if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, s1, s2) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   start = 0;
+   len = 0;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|ll, s11, len1,
+   s22, len2, start, len) == FAILURE) {
+   return;
+   }
+   
+   if (ZEND_NUM_ARGS()  4) {
+   len = len1;
+   }
+   
+   /* look at substr() function for more information */
+   
+   if (start  0) {
+   start += len1;
+   if (start  0) {
+   start = 0;
+   }
+   } else if (start  len1) {
+   RETURN_FALSE;
+   }
+   
+   if (len  0) {
+   len += (len1 - start);
+   if (len  0) {
+   len = 0;
+   }
+   }
+   
+   if ((start + len)  len1) {
+   len = len1 - start;
}
-   convert_to_string_ex(s1);
-   convert_to_string_ex(s2);
 
-   RETURN_LONG(php_strspn(Z_STRVAL_PP(s1), Z_STRVAL_PP(s2),
-  Z_STRVAL_PP(s1) + Z_STRLEN_PP(s1),
-  Z_STRVAL_PP(s2) + Z_STRLEN_PP(s2)));
+   if (behavior == STR_STRSPN) {
+   RETURN_LONG(php_strspn(s11 + start /*str1_start*/,
+   s22 /*str2_start*/,
+   s11 + start + len /*str1_end*/,
+   s22 + len2 /*str2_end*/));
+   } else if (behavior == STR_STRCSPN) {
+   RETURN_LONG(php_strcspn(s11 + start /*str1_start*/,
+   s22 /*str2_start*/,
+   s11 + start + len /*str1_end*/,
+   s22 + len2 /*str2_end*/));
+   }
+   
+}
+
+/* {{{ proto int strspn(string str, string mask [, start [, len]])
+   Finds length of initial segment consisting entirely of characters found in mask. 
+If start or/and length is provided works like 
+strspn(substr($s,$start,$len),$good_chars) */
+PHP_FUNCTION(strspn)
+{
+   php_spn_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, STR_STRSPN);
 }
 /* }}} */
 
-/* {{{ proto int strcspn(string str, string mask)
-   Finds length of initial segment consisting entirely of characters not found in 
mask */
+/* {{{ proto int strcspn(string str, string mask [, start [, len]])
+   Finds length of initial segment consisting entirely of characters not found in 
+mask. If start or/and length is provide works like 
+strcspn(substr($s,$start,$len),$bad_chars) */
 PHP_FUNCTION(strcspn)
 {
-   zval **s1, **s2;
-   
-   if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, s1, s2) == FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   convert_to_string_ex(s1);
-   convert_to_string_ex(s2);
-
-   RETURN_LONG(php_strcspn(Z_STRVAL_PP(s1), Z_STRVAL_PP(s2),
-   Z_STRVAL_PP(s1) + Z_STRLEN_PP(s1),
-   Z_STRVAL_PP(s2) + Z_STRLEN_PP(s2)));
+   php_spn_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, STR_STRCSPN);
 }
 /* }}} */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To 

[PHP-CVS] cvs: php4 /ext/standard/tests/strings 001.phpt

2002-09-25 Thread Andrey Hristov

andrey  Wed Sep 25 15:08:39 2002 EDT

  Added files: 
/php4/ext/standard/tests/strings001.phpt 
  Log:
  Test case for strspn()/strcspn().
  
  

Index: php4/ext/standard/tests/strings/001.phpt
+++ php4/ext/standard/tests/strings/001.phpt
--TEST--
Test strspn() and strcspn() behavior
--POST--
--GET--
--FILE--
?php
$a =  bbb ;
$b = 1234;
var_dump($a);
var_dump($b);
var_dump(strspn($a,$b));
var_dump(strcspn($a,$b));
var_dump(strspn($a,$b,2));
var_dump(strcspn($a,$b,9));
var_dump(strspn($a,$b,2,3));
var_dump(strcspn($a,$b,9,6));
?
--EXPECT--
string(25)  bbb 
string(4) 1234
int(8)
int(0)
int(6)
int(7)
int(3)
int(6)



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




[PHP-CVS] cvs: php4 /ext/ircg ircg.c

2002-09-25 Thread Sascha Schumann

sas Wed Sep 25 15:20:23 2002 EDT

  Modified files:  
/php4/ext/ircg  ircg.c 
  Log:
  Add support for LIST
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.135 php4/ext/ircg/ircg.c:1.136
--- php4/ext/ircg/ircg.c:1.135  Sat Sep 21 16:14:18 2002
+++ php4/ext/ircg/ircg.cWed Sep 25 15:20:23 2002
 -16,7 +16,7 
+--+
  */
 
-/* $Id: ircg.c,v 1.135 2002/09/21 20:14:18 sas Exp $ */
+/* $Id: ircg.c,v 1.136 2002/09/25 19:20:23 sas Exp $ */
 
 /* {{{ includes */
 
 -99,6 +99,8 
FMT_MSG_BANLIST,
FMT_MSG_BANLIST_END,
FMT_MSG_DISCONNECTED,
+   FMT_MSG_LIST,
+   FMT_MSG_LISTEND,
NO_FMTS
 };
 /* }}} */
 -252,7 +254,9 
%f sets channel operator flag of %t to %m on %cbr /,
banned from %c: %mbr /,
end of ban list for %cbr /,
-   You have been disconnectedbr /
+   You have been disconnectedbr /,
+   Channel %c has %t users and the topic is '%m'br /,
+   End of LISTbr /
 };
 
 /* }}} */
 -948,6 +952,27 
msg_send(conn, m);
 }
 
+static void list_handler(irconn_t *c, smart_str *channel, smart_str *visible,
+   smart_str *topic, void *dummy)
+{
+   php_irconn_t *conn = dummy;
+   smart_str m = {0};
+
+   FORMAT_MSG(conn, FMT_MSG_LIST, channel, visible, NULL, topic, m, 
+   conn-conn.username, conn-conn.username_len);
+   msg_send(conn, m);
+}
+
+static void listend_handler(irconn_t *c, void *dummy)
+{
+   php_irconn_t *conn = dummy;
+   smart_str m = {0};
+
+   FORMAT_MSG(conn, FMT_MSG_LISTEND, NULL, NULL, NULL, NULL, m,
+   conn-conn.username, conn-conn.username_len);
+   msg_send(conn, m);
+}
+
 /* }}} */
 
 /* {{{ Post-connection error-storage */
 -956,8 +981,8 
  * This is an internal API which serves the purpose to store the reason
  * for terminating a connection.  The termination will cause the
  * connection id to become invalid.  A script can then use a
- * function to retrieve the last error message which was received
- * from the IRC server, and will usually present a nicely formatted
+ * function to retrieve the last error message associated with that id
+ * and will usually present a nicely formatted
  * error message to the end-user.
  *
  * We automatically garbage-collect every GC_INTVL seconds, so there is
 -1811,6 +1836,13 
irc_register_hook(conn, IRCG_BANLIST, banlist_handler);
irc_register_hook(conn, IRCG_ENDOFBANLIST, end_of_banlist_handler);
 #endif
+
+#if IRCG_API_VERSION = 20020922
+   /* RPL_LIST/RPL_LISTEND */
+   irc_register_hook(conn, IRCG_LIST, list_handler);
+   irc_register_hook(conn, IRCG_LISTEND, listend_handler);
+#endif
+   
 }
 /* }}} */
 



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




Re: [PHP-CVS] cvs: php4 / php.ini-recommended

2002-09-25 Thread Yasuo Ohgaki

I saw Sascha's commit for php.ini-dist. Nobody objects it so I merged it
to php.ini-recommended as it supposed to.

I'm 0 for both On and Off.

--
Yasuo Ohgaki

Rasmus Lerdorf wrote:
 ; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
-y2k_compliance = Off
+y2k_compliance = On
 
 
 Why do you want to break old browsers?  There is no Y2K issue here, it is
 only a perceived Y2K issue.  The 2-digit year in the cookie is interpreted
 correctly by all browsers.
 
 -Rasmus
 
 
 



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