cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 09:32:53

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  add mpxs_output_flush for checking $|
  
  Revision  ChangesPath
  1.14  +8 -5  modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Apache__RequestIO.h   2001/09/15 17:57:25 1.13
  +++ Apache__RequestIO.h   2001/11/06 17:32:53 1.14
  @@ -12,6 +12,13 @@
   MARK++; \
   }
   
  +#define mpxs_output_flush(r, rcfg) \
  +/* if ($|) */ \
  +if (IoFLUSH(PL_defoutgv)) { \
  +modperl_wbucket_flush(rcfg-wbucket); \
  +ap_rflush(r); \
  +}
  +
   static MP_INLINE apr_size_t mpxs_ap_rvputs(pTHX_ I32 items,
  SV **MARK, SV **SP)
   {
  @@ -57,11 +64,7 @@
   
   mpxs_write_loop(modperl_wbucket_write, rcfg-wbucket);
   
  -/* if ($|) */
  -if (IoFLUSH(PL_defoutgv)){
  -modperl_wbucket_flush(rcfg-wbucket);
  -ap_rflush(r);
  -}
  +mpxs_output_flush(r, rcfg);
   
   return bytes;
   }  
  
  
  



cvs commit: modperl-2.0/xs modperl_xs_util.h

2001-11-06 Thread dougm

dougm   01/11/06 09:37:25

  Modified:xs   modperl_xs_util.h
  Log:
  s/croak/Perl_croak/g
  
  Revision  ChangesPath
  1.11  +5 -3  modperl-2.0/xs/modperl_xs_util.h
  
  Index: modperl_xs_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/modperl_xs_util.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- modperl_xs_util.h 2001/10/27 17:14:17 1.10
  +++ modperl_xs_util.h 2001/11/06 17:37:25 1.11
  @@ -67,8 +67,9 @@
   }
   
   #define mpxs_usage_va(i, obj, msg) \
  -if ((items  i) || !(mpxs_sv2_obj(obj, *MARK))) \
  -croak(usage: %s, msg); \
  +if ((items  i) || !(mpxs_sv2_obj(obj, *MARK))) { \
  +Perl_croak(aTHX_ usage: %s, msg); \
  +} \
   MARK++
   
   #define mpxs_usage_va_1(obj, msg) mpxs_usage_va(1, obj, msg)
  @@ -77,13 +78,14 @@
   mpxs_usage_va(2, obj, msg); \
   arg = *MARK++
   
  +/* XXX: we probably shouldn't croak here */
   #define mpxs_write_loop(func,obj) \
   while (MARK = SP) { \
   apr_ssize_t wlen; \
   char *buf = SvPV(*MARK, wlen); \
   apr_status_t rv = func(obj, buf, wlen); \
   if (rv != APR_SUCCESS) { \
  -croak(modperl_apr_strerror(rv)); \
  +Perl_croak(aTHX_ modperl_apr_strerror(rv)); \
   } \
   bytes += wlen; \
   MARK++; \
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 09:38:15

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  remove dead mpxs_rwrite_loop macro
  
  Revision  ChangesPath
  1.15  +0 -9  modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Apache__RequestIO.h   2001/11/06 17:32:53 1.14
  +++ Apache__RequestIO.h   2001/11/06 17:38:15 1.15
  @@ -3,15 +3,6 @@
   
   #define mpxs_Apache__RequestRec_PRINT mpxs_Apache__RequestRec_print
   
  -#define mpxs_rwrite_loop(func,obj) \
  -while (MARK = SP) { \
  -STRLEN len; \
  -char *buf = SvPV(*MARK, len); \
  -int wlen = func(obj, buf, len); \
  -bytes += wlen; \
  -MARK++; \
  -}
  -
   #define mpxs_output_flush(r, rcfg) \
   /* if ($|) */ \
   if (IoFLUSH(PL_defoutgv)) { \
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 09:40:22

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  fix $| comment for $r-puts
  
  Revision  ChangesPath
  1.16  +3 -1  modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Apache__RequestIO.h   2001/11/06 17:38:15 1.15
  +++ Apache__RequestIO.h   2001/11/06 17:40:22 1.16
  @@ -31,7 +31,9 @@
   MP_END_TIMES();
   MP_PRINT_TIMES(r-puts);
   
  -/* XXX: flush if $| */
  +/* we do not check $| for this method,
  + * only in the functions called by the tied interface
  + */
   
   return bytes;
   }
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 09:50:56

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  remove unused scfg variable
  
  Revision  ChangesPath
  1.17  +0 -4  modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Apache__RequestIO.h   2001/11/06 17:40:22 1.16
  +++ Apache__RequestIO.h   2001/11/06 17:50:56 1.17
  @@ -13,7 +13,6 @@
   static MP_INLINE apr_size_t mpxs_ap_rvputs(pTHX_ I32 items,
  SV **MARK, SV **SP)
   {
  -modperl_config_srv_t *scfg;
   modperl_config_req_t *rcfg;
   apr_size_t bytes = 0;
   request_rec *r;
  @@ -22,7 +21,6 @@
   mpxs_usage_va_1(r, $r-puts(...));
   
   rcfg = modperl_config_req_get(r);
  -scfg = modperl_config_srv_get(r-server);
   
   MP_START_TIMES();
   
  @@ -42,7 +40,6 @@
   apr_size_t mpxs_Apache__RequestRec_print(pTHX_ I32 items,
SV **MARK, SV **SP)
   {
  -modperl_config_srv_t *scfg;
   modperl_config_req_t *rcfg;
   request_rec *r;
   
  @@ -53,7 +50,6 @@
   mpxs_usage_va_1(r, $r-print(...));
   
   rcfg = modperl_config_req_get(r);
  -scfg = modperl_config_srv_get(r-server);
   
   mpxs_write_loop(modperl_wbucket_write, rcfg-wbucket);
   
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_util.c modperl_util.h

2001-11-06 Thread dougm

dougm   01/11/06 10:39:41

  Modified:src/modules/perl modperl_util.c modperl_util.h
  Log:
  add modperl_perl_do_sprintf function
  
  Revision  ChangesPath
  1.30  +16 -0 modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- modperl_util.c2001/11/05 05:12:33 1.29
  +++ modperl_util.c2001/11/06 18:39:41 1.30
  @@ -443,6 +443,22 @@
   return 0;
   }
   
  +/* XXX: same as Perl_do_sprintf(); 
  + * but Perl_do_sprintf() is not part of the public api
  + */
  +void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg)
  +{
  +STRLEN patlen;
  +char *pat = SvPV(*sarg, patlen);
  +bool do_taint = FALSE;
  +
  +sv_vsetpvfn(sv, pat, patlen, Null(va_list*), sarg + 1, len - 1, do_taint);
  +SvSETMAGIC(sv);
  +if (do_taint) {
  +SvTAINTED_on(sv);
  +}
  +}
  +
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name)
   {
   I32 i, oldscope = PL_scopestack_ix;
  
  
  
  1.30  +2 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- modperl_util.h2001/10/27 17:14:17 1.29
  +++ modperl_util.h2001/11/06 18:39:41 1.30
  @@ -98,6 +98,8 @@
   #define hv_fetch_he(hv,k,l,h) \
   modperl_perl_hv_fetch_he(aTHX_ hv, k, l, h)
   
  +void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg);
  +
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name);
   
   void modperl_perl_exit(pTHX_ int status);
  
  
  



cvs commit: modperl-2.0/xs/maps apache_functions.map modperl_functions.map

2001-11-06 Thread dougm

dougm   01/11/06 10:41:46

  Modified:todo api.txt
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/maps  apache_functions.map modperl_functions.map
  Log:
  add Apache::RequestIO::{printf,PRINTF} methods
  
  Revision  ChangesPath
  1.13  +1 -1  modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- api.txt   2001/10/29 01:19:16 1.12
  +++ api.txt   2001/11/06 18:41:46 1.13
  @@ -3,7 +3,7 @@
   --
   
   tied filehandle interface:
  - -CLOSE, GETC, PRINTF, READLINE
  + -CLOSE, GETC, READLINE
   
   $r-finfo:
   need apr_finfo_t - struct stat conversion (might already be there,
  
  
  
  1.18  +30 -1 modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Apache__RequestIO.h   2001/11/06 17:50:56 1.17
  +++ Apache__RequestIO.h   2001/11/06 18:41:46 1.18
  @@ -1,7 +1,8 @@
   #define mpxs_Apache__RequestRec_TIEHANDLE(stashsv, sv) \
   modperl_newSVsv_obj(aTHX_ stashsv, sv)
   
  -#define mpxs_Apache__RequestRec_PRINT mpxs_Apache__RequestRec_print
  +#define mpxs_Apache__RequestRec_PRINT  mpxs_Apache__RequestRec_print
  +#define mpxs_Apache__RequestRec_PRINTF mpxs_ap_rprintf
   
   #define mpxs_output_flush(r, rcfg) \
   /* if ($|) */ \
  @@ -55,6 +56,34 @@
   
   mpxs_output_flush(r, rcfg);
   
  +return bytes;
  +}  
  +
  +static MP_INLINE
  +apr_size_t mpxs_ap_rprintf(pTHX_ I32 items, SV **MARK, SV **SP)
  +{
  +modperl_config_req_t *rcfg;
  +request_rec *r;
  +apr_size_t bytes = 0;
  +SV *sv;
  +
  +mpxs_usage_va(2, r, $r-printf($fmt, ...));
  +
  +rcfg = modperl_config_req_get(r);
  +
  +/* XXX: we could have an rcfg-sprintf_buffer to reuse this SV
  + * across requests
  + */
  +sv = newSV(0);
  +modperl_perl_do_sprintf(aTHX_ sv, items, MARK);
  +bytes = SvCUR(sv);
  +
  +modperl_wbucket_write(rcfg-wbucket, SvPVX(sv), bytes);
  +
  +mpxs_output_flush(r, rcfg);
  +
  +SvREFCNT_dec(sv);
  +
   return bytes;
   }  
   
  
  
  
  1.35  +1 -1  modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- apache_functions.map  2001/10/22 02:46:55 1.34
  +++ apache_functions.map  2001/11/06 18:41:46 1.35
  @@ -92,7 +92,7 @@
ap_rflush
   PREFIX=ap_r
   ~ap_rwrite
  -~ap_rprintf
  + ap_rprintf | mpxs_ | ...
   !ap_rputc
   ~ap_rputs
ap_rvputs | mpxs_ | ... | puts
  
  
  
  1.26  +3 -2  modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- modperl_functions.map 2001/10/29 01:19:16 1.25
  +++ modperl_functions.map 2001/11/06 18:41:46 1.26
  @@ -25,8 +25,9 @@
mpxs_Apache_request | | classname, svr=Nullsv
   
   MODULE=Apache::RequestIO   PACKAGE=Apache::RequestRec
  - SV *:DEFINE_TIEHANDLE   | | SV *:stashsv, SV *:sv=Nullsv
  - apr_size_t:DEFINE_PRINT | | ...
  + SV *:DEFINE_TIEHANDLE| | SV *:stashsv, SV *:sv=Nullsv
  + apr_size_t:DEFINE_PRINT  | | ...
  + apr_size_t:DEFINE_PRINTF | | ...
mpxs_Apache__RequestRec_sendfile | | r, filename=r-filename, offset=0, len=0
mpxs_Apache__RequestRec_read | | r, buffer, bufsiz, offset=0
long:DEFINE_READ | | request_rec *:r, SV *:buffer, int:bufsiz, int:offset=0
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-06 Thread dougm

dougm   01/11/06 10:41:59

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.43  +55 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- FunctionTable.pm  2001/11/06 18:26:13 1.42
  +++ FunctionTable.pm  2001/11/06 18:41:59 1.43
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Tue Nov  6 10:38:34 2001
  +# !  Tue Nov  6 10:53:09 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -2854,6 +2854,38 @@
 },
 {
   'return_type' = 'void',
  +'name' = 'modperl_perl_destruct',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'perl'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_do_sprintf',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'SV *',
  +'name' = 'sv'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'len'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'sarg'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
   'name' = 'modperl_perl_exit',
   'args' = [
 {
  @@ -4536,6 +4568,28 @@
 {
   'type' = 'request_rec *',
   'name' = 'r'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'apr_size_t',
  +'name' = 'mpxs_ap_rprintf',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'items'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'mark'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'sp'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/t/response/TestModperl print.pm

2001-11-06 Thread dougm

dougm   01/11/06 10:50:25

  Modified:t/modperl .cvsignore
  Added:   t/response/TestModperl print.pm
  Log:
  add tests for tied print/printf
  
  Revision  ChangesPath
  1.4   +1 -0  modperl-2.0/t/modperl/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/modperl/.cvsignore,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- .cvsignore2001/11/06 18:43:57 1.3
  +++ .cvsignore2001/11/06 18:50:25 1.4
  @@ -1,3 +1,4 @@
   endav.t
   exit.t
   printf.t
  +print.t
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/print.pm
  
  Index: print.pm
  ===
  package TestModperl::print;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 3;
  
  ok 1;
  
  ok 2;
  
  printf ok %d, 3;
  
  Apache::OK;
  }
  
  1;
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 11:09:14

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  move ap_{setup,should}_client_block wrappers into
  modperl_{setup,should}_client_block so they can be called elsewhere
  
  Revision  ChangesPath
  1.19  +24 -9 modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Apache__RequestIO.h   2001/11/06 18:41:46 1.18
  +++ Apache__RequestIO.h   2001/11/06 19:09:14 1.19
  @@ -135,6 +135,27 @@
   return nrd;
   }
   
  +static MP_INLINE
  +apr_status_t modperl_setup_client_block(request_rec *r)
  +{
  +if (!r-read_length) {
  +apr_status_t rc;
  +
  +/* only do this once per-request */
  +if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
  +ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0,
  + r-server,
  + mod_perl: ap_setup_client_block failed: %d, rc);
  +return rc;
  +}
  +}
  +
  +return APR_SUCCESS;
  +}
  +
  +#define modperl_should_client_block(r) \
  +(r-read_length || ap_should_client_block(r))
  +
   /* alias */
   #define mpxs_Apache__RequestRec_READ mpxs_Apache__RequestRec_read
   
  @@ -146,17 +167,11 @@
   long nrd = 0;
   int rc;
   
  -if (!r-read_length) {
  -/* only do this once per-request */
  -if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
  -ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0,
  - r-server,
  - mod_perl: ap_setup_client_block failed: %d, rc);
  -return 0;
  -}
  +if ((rc = modperl_setup_client_block(r)) != APR_SUCCESS) {
  +return 0;
   }
   
  -if (r-read_length || ap_should_client_block(r)) {
  +if (modperl_should_client_block(r)) {
   /* ap_should_client_block() will return 0 if r-read_length */
   mpxs_sv_grow(buffer, bufsiz+offset);
   nrd = ap_get_client_block(r, SvPVX(buffer)+offset, bufsiz);
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 19:12:51

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  s/modperl_/mpxs_/ for {setup,should}_client_block wrappers
  
  Revision  ChangesPath
  1.20  +4 -4  modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Apache__RequestIO.h   2001/11/06 19:09:14 1.19
  +++ Apache__RequestIO.h   2001/11/07 03:12:50 1.20
  @@ -136,7 +136,7 @@
   }
   
   static MP_INLINE
  -apr_status_t modperl_setup_client_block(request_rec *r)
  +apr_status_t mpxs_setup_client_block(request_rec *r)
   {
   if (!r-read_length) {
   apr_status_t rc;
  @@ -153,7 +153,7 @@
   return APR_SUCCESS;
   }
   
  -#define modperl_should_client_block(r) \
  +#define mpxs_should_client_block(r) \
   (r-read_length || ap_should_client_block(r))
   
   /* alias */
  @@ -167,11 +167,11 @@
   long nrd = 0;
   int rc;
   
  -if ((rc = modperl_setup_client_block(r)) != APR_SUCCESS) {
  +if ((rc = mpxs_setup_client_block(r)) != APR_SUCCESS) {
   return 0;
   }
   
  -if (modperl_should_client_block(r)) {
  +if (mpxs_should_client_block(r)) {
   /* ap_should_client_block() will return 0 if r-read_length */
   mpxs_sv_grow(buffer, bufsiz+offset);
   nrd = ap_get_client_block(r, SvPVX(buffer)+offset, bufsiz);
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-06 Thread dougm

dougm   01/11/06 19:13:21

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.44  +11 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- FunctionTable.pm  2001/11/06 18:41:59 1.43
  +++ FunctionTable.pm  2001/11/07 03:13:21 1.44
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Tue Nov  6 10:53:09 2001
  +# !  Tue Nov  6 19:24:25 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -5058,6 +5058,16 @@
 {
   'type' = 'apr_read_type_e',
   'name' = 'block'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'apr_status_t',
  +'name' = 'mpxs_setup_client_block',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h

2001-11-06 Thread dougm

dougm   01/11/06 19:14:54

  Modified:lib/Apache ParseSource.pm
   lib/ModPerl TypeMap.pm WrapXS.pm
   src/modules/perl modperl_perl_includes.h
  Log:
  add logic so we can avoid dTHX; usage in modperl-only functions that have a pTHX_
  
  Revision  ChangesPath
  1.32  +7 -2  modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- ParseSource.pm2001/10/21 05:04:27 1.31
  +++ ParseSource.pm2001/11/07 03:14:54 1.32
  @@ -2,7 +2,7 @@
   
   use strict;
   use Apache::Build ();
  -use Config ();
  +use Config;
   
   our $VERSION = '0.02';
   
  @@ -60,7 +60,12 @@
   my $c = C::Scan-new(filename = $self-{scan_filename});
   
   $c-set(includeDirs = $self-includes);
  -$c-set(Defines = '-DCORE_PRIVATE -DMP_SOURCE_SCAN');
  +
  +my $defines = '-DCORE_PRIVATE -DMP_SOURCE_SCAN';
  +unless ($Config{useithreads} and $Config{useithreads} eq 'define') {
  +$defines .= ' -DMP_SOURCE_SCAN_NEED_ITHREADS';
  +}
  +$c-set(Defines = $defines);
   
   bless $c, 'Apache::ParseSource::Scan';
   }
  
  
  
  1.12  +18 -0 modperl-2.0/lib/ModPerl/TypeMap.pm
  
  Index: TypeMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TypeMap.pm2001/10/07 19:22:49 1.11
  +++ TypeMap.pm2001/11/07 03:14:54 1.12
  @@ -194,12 +194,29 @@
   return [ map $self-map_arg($_), @$args ]
   }
   
  +#this is needed for modperl-only functions
  +#unlike apache/apr functions which are remapped to a mpxs_ function
  +sub thx_fixup {
  +my($self, $func) = @_;
  +
  +my $first = $func-{args}-[0];
  +
  +return unless $first;
  +
  +if ($first-{type} =~ /^PerlInterpreter/) {
  +shift @{ $func-{args} };
  +$func-{thx} = 1;
  +}
  +}
  +
   sub map_function {
   my($self, $func) = @_;
   
   my $map = $self-function_map-{ $func-{name} };
   return unless $map;
   
  +$self-thx_fixup($func);
  +
   return unless $self-can_map($map, $func-{return_type},
map $_-{type}, @{ $func-{args} });
   my $mf = {
  @@ -208,6 +225,7 @@
 $func-{return_type} || 'void'),
  args= $self-map_args($func),
  perl_name   = $map-{name},
  +   thx = $func-{thx},
   };
   
   for (qw(dispatch argspec orig_args prefix)) {
  
  
  
  1.34  +2 -2  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- WrapXS.pm 2001/10/22 17:20:11 1.33
  +++ WrapXS.pm 2001/11/07 03:14:54 1.34
  @@ -113,8 +113,8 @@
   $attrs
   EOF
   
  -if ($dispatch || $orig_args) {
  -my $thx = ;
  +if ($dispatch || $orig_args || $func-{thx}) {
  +my $thx = $func-{thx} ? 'aTHX_ ' : ;
   
   if ($dispatch) {
   $thx = 'aTHX_ ' if $dispatch =~ /^mpxs_/i;
  
  
  
  1.8   +5 -0  modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_perl_includes.h   2001/10/21 22:11:34 1.7
  +++ modperl_perl_includes.h   2001/11/07 03:14:54 1.8
  @@ -24,6 +24,11 @@
*/
   #   undef __attribute__
   #   define __attribute__(arg)
  +
  +#   ifdef MP_SOURCE_SCAN_NEED_ITHREADS
  +/* just need to have pTHX_ defined for proper prototypes */
  +#  define USE_ITHREADS
  +#   endif
   #endif
   
   #include EXTERN.h
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-06 Thread dougm

dougm   01/11/06 19:39:09

  Modified:xs/APR/Bucket APR__Bucket.h
   xs/APR/Table APR__Table.h
   xs/APR/URI APR__URI.h
   xs/Apache/Module Apache__Module.h
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/Apache/RequestUtil Apache__RequestUtil.h
   xs/Apache/ServerUtil Apache__ServerUtil.h
   xs/ModPerl/Global ModPerl__Global.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  rid dTHX; usage
  
  Revision  ChangesPath
  1.3   +1 -3  modperl-2.0/xs/APR/Bucket/APR__Bucket.h
  
  Index: APR__Bucket.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- APR__Bucket.h 2001/04/19 17:38:12 1.2
  +++ APR__Bucket.h 2001/11/07 03:39:08 1.3
  @@ -1,10 +1,8 @@
   #include modperl_bucket.h
   
  -static apr_bucket *mpxs_APR__Bucket_new(SV *classname, SV *sv,
  +static apr_bucket *mpxs_APR__Bucket_new(pTHX_ SV *classname, SV *sv,
   int offset, int len)
   {
  -dTHX; /*XXX*/
  -
   if (!len) {
   (void)SvPV(sv, len);
   }
  
  
  
  1.6   +3 -4  modperl-2.0/xs/APR/Table/APR__Table.h
  
  Index: APR__Table.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/Table/APR__Table.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- APR__Table.h  2001/09/28 17:20:32 1.5
  +++ APR__Table.h  2001/11/07 03:39:08 1.6
  @@ -104,9 +104,8 @@
  ((apr_table_entry_t *) \
apr_table_elts(t)-elts)[mpxs_apr_table_iterix(sv)++].key
   
  -static MP_INLINE const char *mpxs_APR__Table_NEXTKEY(SV *tsv, SV *key)
  +static MP_INLINE const char *mpxs_APR__Table_NEXTKEY(pTHX_ SV *tsv, SV *key)
   {
  -dTHX;
   apr_table_t *t = mp_xs_sv2_APR__Table(tsv); 
   
   if (apr_is_empty_table(t)) {
  @@ -120,11 +119,11 @@
   return NULL;
   }
   
  -static MP_INLINE const char *mpxs_APR__Table_FIRSTKEY(SV *tsv)
  +static MP_INLINE const char *mpxs_APR__Table_FIRSTKEY(pTHX_ SV *tsv)
   {
   mpxs_apr_table_iterix(tsv) = 0; /* reset iterator index */
   
  -return mpxs_APR__Table_NEXTKEY(tsv, Nullsv);
  +return mpxs_APR__Table_NEXTKEY(aTHX_ tsv, Nullsv);
   }
   
   static XS(MPXS_apr_table_get)
  
  
  
  1.3   +1 -2  modperl-2.0/xs/APR/URI/APR__URI.h
  
  Index: APR__URI.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/URI/APR__URI.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- APR__URI.h2001/08/19 17:33:32 1.2
  +++ APR__URI.h2001/11/07 03:39:08 1.3
  @@ -36,9 +36,8 @@
   }
   
   static MP_INLINE
  -char *mpxs_APR__URI_port(apr_uri_t *uri, SV *portsv)
  +char *mpxs_APR__URI_port(pTHX_ apr_uri_t *uri, SV *portsv)
   {
  -dTHX; /*XXX*/
   char *port_str = uri-port_str;
   
   if (portsv) {
  
  
  
  1.4   +1 -2  modperl-2.0/xs/Apache/Module/Apache__Module.h
  
  Index: Apache__Module.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Module/Apache__Module.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Apache__Module.h  2001/10/06 01:03:27 1.3
  +++ Apache__Module.h  2001/11/07 03:39:08 1.4
  @@ -1,7 +1,7 @@
   #define mpxs_Apache__Module_top_module(CLASS) \
   (CLASS ? ap_top_module : ap_top_module)
   
  -static MP_INLINE int mpxs_Apache__Module_loaded(char *name)
  +static MP_INLINE int mpxs_Apache__Module_loaded(pTHX_ char *name)
   {
   char nameptr[256];
   char *base;
  @@ -34,7 +34,6 @@
   return 0;
   }
   else {
  -dTHX; /*XXX*/ 
   return modperl_perl_module_loaded(aTHX_ name);
   }
   }
  
  
  
  1.21  +6 -6  modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Apache__RequestIO.h   2001/11/07 03:12:50 1.20
  +++ Apache__RequestIO.h   2001/11/07 03:39:08 1.21
  @@ -88,14 +88,14 @@
   }  
   
   /* alias */
  -#define mpxs_Apache__RequestRec_WRITE mpxs_Apache__RequestRec_write
  +#define mpxs_Apache__RequestRec_WRITE(r, buffer, bufsiz, offset) \
  +mpxs_Apache__RequestRec_write(aTHX_ r, buffer, bufsiz, offset)
   
   static MP_INLINE
  -apr_ssize_t mpxs_Apache__RequestRec_write(request_rec *r,
  +apr_ssize_t mpxs_Apache__RequestRec_write(pTHX_ request_rec *r,
 SV *buffer, apr_ssize_t bufsiz,
 

Re: [preview 2] new mod_perl site concept

2001-11-06 Thread Craig McLane

I focused mostly on the content - Stas this rocks!  Very easy to
navigate, and the info (especially the Apache::Test documentation is
great.

One 'style' nit, it appears that an absolute width is specified on the tables
used for formatting which bumps the right area of the page so that I
have to scroll horizontally in my browser.  It looks fine in links, so
it might just be the font I am using.

Craig


On Fri, Nov 02, 2001 at 06:53:48PM +0800, Stas Bekman wrote:
 Those that are on the docset-templates list know that I'm moving on with 
 the new docset building code, I'm going to release it very soon now.
 
 Here is a second preview of the site: 
 http://www.apache.org/~stas/newsite/index.html
 
 As usual disregard the content, just say if you see something wrong with 
 navigation widgets, concepts in general.
 
 If everything is cool, I'll start filling it with the real content. Also 
 see another email that I'll send in a sec.
 
 _
 Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
 http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
 mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
 http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]