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

2002-08-27 Thread stas

stas2002/08/27 19:24:48

  Modified:xs/APR/Bucket APR__Bucket.h
   xs/maps  apr_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  add the APR::Bucket::is_flush glue function
  
  Revision  ChangesPath
  1.5   +5 -0  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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- APR__Bucket.h 30 May 2002 02:33:48 -  1.4
  +++ APR__Bucket.h 28 Aug 2002 02:24:47 -  1.5
   -44,6 +44,11 
   return APR_BUCKET_IS_EOS(bucket);
   }
   
  +static MP_INLINE int mpxs_APR__Bucket_is_flush(apr_bucket *bucket)
  +{
  +return APR_BUCKET_IS_FLUSH(bucket);
  +}
  +
   static MP_INLINE void mpxs_APR__Bucket_insert_before(apr_bucket *a,
apr_bucket *b)
   {
  
  
  
  1.46  +1 -0  modperl-2.0/xs/maps/apr_functions.map
  
  Index: apr_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- apr_functions.map 23 Jun 2002 22:00:03 -  1.45
  +++ apr_functions.map 28 Aug 2002 02:24:47 -  1.46
   -102,6 +102,7 
mpxs_APR__Brigade_empty#APR_BRIGADE_EMPTY
   
   MODULE=APR::Bucket
  + mpxs_APR__Bucket_is_flush   #APR_BUCKET_IS_FLUSH
mpxs_APR__Bucket_is_eos #APR_BUCKET_IS_EOS
mpxs_APR__Bucket_insert_after   #APR_BUCKET_INSERT_AFTER
mpxs_APR__Bucket_insert_before  #APR_BUCKET_INSERT_AFTER
  
  
  
  1.83  +15 -27modperl-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.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- FunctionTable.pm  27 Aug 2002 04:28:48 -  1.82
  +++ FunctionTable.pm  28 Aug 2002 02:24:47 -  1.83
   -2,7 +2,7 
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Mon Aug 26 19:47:54 2002
  +# !  Wed Aug 28 10:12:34 2002
   # !  do NOT edit, any changes will be lost !
   # !!
   
   -4343,6 +4343,20 
   ]
 },
 {
  +'return_type' = 'int',
  +'name' = 'mpxs_APR__Bucket_is_flush',
  +'attr' = [
  +  'static',
  +  '__inline__'
  +],
  +'args' = [
  +  {
  +'type' = 'apr_bucket *',
  +'name' = 'bucket'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'apr_bucket *',
   'name' = 'mpxs_APR__Bucket_new',
   'attr' = [
   -5507,32 +5521,6 
 {
   'type' = 'SV *',
   'name' = 'arg'
  -  }
  -]
  -  },
  -  {
  -'return_type' = 'apr_global_mutex_t *',
  -'name' = 'mpxs_apr_global_mutex_create',
  -'args' = [
  -  {
  -'type' = 'PerlInterpreter *',
  -'name' = 'my_perl'
  -  },
  -  {
  -'type' = 'SV *',
  -'name' = 'classname'
  -  },
  -  {
  -'type' = 'apr_pool_t *',
  -'name' = 'pool'
  -  },
  -  {
  -'type' = 'const char *',
  -'name' = 'fname'
  -  },
  -  {
  -'type' = 'apr_lockmech_e',
  -'name' = 'mech'
 }
   ]
 },
  
  
  



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

2002-08-27 Thread dougm

dougm   2002/08/27 20:12:46

  Modified:src/modules/perl modperl_cmd.c
  Log:
  use ap_strstr_c instead of strstr to avoid a warning
  
  Revision  ChangesPath
  1.27  +1 -1  modperl-2.0/src/modules/perl/modperl_cmd.c
  
  Index: modperl_cmd.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- modperl_cmd.c 27 Aug 2002 04:26:54 -  1.26
  +++ modperl_cmd.c 28 Aug 2002 03:12:46 -  1.27
   -308,7 +308,7 
   server_rec *s = parms-server;
   const char *errmsg;
   
  -if (!strstr(arg, ::)) {
  +if (!ap_strstr_c(arg, ::)) {
   return DECLINE_CMD; /* let mod_so handle it */
   }
   
  
  
  



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

2002-08-27 Thread dougm

dougm   2002/08/27 20:14:56

  Added:   src/modules/perl modperl_svptr_table.c modperl_svptr_table.h
  Log:
  move ptr_table_ api add ons to their own module.
  
  duplicate the Perl ptr_table_ api into modperl_svptr_table_ api
  since the ptr_table_ api does not exist without ithreads and since
  5.8.0+ has functions that 5.6.x does not
  
  Revision  ChangesPath
  1.1  modperl-2.0/src/modules/perl/modperl_svptr_table.c
  
  Index: modperl_svptr_table.c
  ===
  #include mod_perl.h
  
  /*
   * modperl_svptr_table api is an add-on to the Perl ptr_table_ api.
   * we use a PTR_TBL_t to map config structures (e.g. from parsed
   * httpd.conf or .htaccess), where each interpreter needs to have its
   * own copy of the Perl SV object.  we do not use an HV* for this, because
   * the HV keys must be SVs with a string value, too much overhead.
   * we do not use an apr_hash_t because they only have the lifetime of
   * the pool used to create them. which may or may not be the same lifetime
   * of the objects we need to lookup.
   */
  
  #ifdef USE_ITHREADS
  
  #ifdef MP_PERL_5_6_x
  #   define my_sv_dup(s, p) sv_dup(s)
  
  typedef struct {
  AV *stashes;
  UV flags;
  PerlInterpreter *proto_perl;
  } CLONE_PARAMS;
  
  #else
  #   define my_sv_dup(s, p) sv_dup(s, p)
  #endif
  
  /*
   * copy a PTR_TBL_t whos PTR_TBL_ENT_t values are SVs.
   * the SVs are dup-ed so each interpreter has its own copy.
   */
  PTR_TBL_t *modperl_svptr_table_clone(pTHX_ PerlInterpreter *proto_perl,
   PTR_TBL_t *source)
  {
  UV i;
  PTR_TBL_t *tbl;
  PTR_TBL_ENT_t **src_ary, **dst_ary;
  CLONE_PARAMS parms;
  
  Newz(0, tbl, 1, PTR_TBL_t);
  tbl-tbl_max  = source-tbl_max;
  tbl-tbl_items= source-tbl_items;
  Newz(0, tbl-tbl_ary, tbl-tbl_max + 1, PTR_TBL_ENT_t *);
  
  dst_ary = tbl-tbl_ary;
  src_ary = source-tbl_ary;
  
  Zero(parms, 0, CLONE_PARAMS);
  parms.flags = 0;
  parms.stashes = newAV();
  
  for (i=0; i  source-tbl_max; i++, dst_ary++, src_ary++) {
PTR_TBL_ENT_t *src_ent, *dst_ent=NULL;
  
if (!*src_ary) {
continue;
  }
  
for (src_ent = *src_ary;
   src_ent;
   src_ent = src_ent-next)
  {
  if (dst_ent == NULL) {
  Newz(0, dst_ent, 1, PTR_TBL_ENT_t);
  *dst_ary = dst_ent;
  }
  else {
  Newz(0, dst_ent-next, 1, PTR_TBL_ENT_t);
  dst_ent = dst_ent-next;
  }
  
  /* key is just a pointer we do not modify, no need to copy */
  dst_ent-oldval = src_ent-oldval;
  
  dst_ent-newval =
  SvREFCNT_inc(my_sv_dup((SV*)src_ent-newval, parms));
  }
  }
  
  SvREFCNT_dec(parms.stashes);
  
  return tbl;
  }
  
  #endif
  
  /*
   * need to free the SV values in addition to ptr_table_free
   */
  void modperl_svptr_table_destroy(pTHX_ PTR_TBL_t *tbl)
  {
  UV i;
  PTR_TBL_ENT_t **ary = tbl-tbl_ary;
  
  for (i=0; i  tbl-tbl_max; i++, ary++) {
PTR_TBL_ENT_t *ent;
  
if (!*ary) {
continue;
  }
  
for (ent = *ary; ent; ent = ent-next) {
  if (!ent-newval) {
  continue;
  }
  
  SvREFCNT_dec((SV*)ent-newval);
  ent-newval = NULL;
  }
  }
  
  modperl_svptr_table_free(aTHX_ tbl);
  }
  
  /*
   * the Perl ptr_table_ api does not provide a function to remove
   * an entry from the table.  we need to SvREFCNT_dec the SV value
   * anyhow.
   */
  void modperl_svptr_table_delete(pTHX_ PTR_TBL_t *tbl, void *key)
  {
  PTR_TBL_ENT_t *entry, **oentry;
  UV hash = PTR2UV(key);
  
  oentry = tbl-tbl_ary[hash  tbl-tbl_max];
  entry = *oentry;
  
  for (; entry; oentry = entry-next, entry = *oentry) {
if (entry-oldval == key) {
  *oentry = entry-next;
  SvREFCNT_dec((SV*)entry-newval);
  Safefree(entry);
  tbl-tbl_items--;
return;
}
  }
  }
  
  /*
   * XXX: the following are a copy of the Perl 5.8.0 Perl_ptr_table api
   * renamed s/Perl_ptr/modperl_svptr/g;
   * two reasons:
   *   these functions do not exist without -DUSE_ITHREADS
   *   the clear/free functions do not exist in 5.6.x
   */
  
  /* create a new pointer-mapping table */
  
  PTR_TBL_t *
  modperl_svptr_table_new(pTHX)
  {
  PTR_TBL_t *tbl;
  Newz(0, tbl, 1, PTR_TBL_t);
  tbl-tbl_max  = 511;
  tbl-tbl_items= 0;
  Newz(0, tbl-tbl_ary, tbl-tbl_max + 1, PTR_TBL_ENT_t*);
  return tbl;
  }
  
  /* map an existing pointer using a table */
  
  void *
  modperl_svptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv)
  {
  PTR_TBL_ENT_t *tblent;
  UV hash = 

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

2002-08-27 Thread dougm

dougm   2002/08/27 20:16:31

  Modified:xs/tables/current/Apache FunctionTable.pm
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.40  +2 -2  modperl-2.0/xs/tables/current/Apache/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- FunctionTable.pm  24 Aug 2002 17:14:39 -  1.39
  +++ FunctionTable.pm  28 Aug 2002 03:16:30 -  1.40
   -2,7 +2,7 
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Sat Aug 24 09:38:51 2002
  +# !  Tue Aug 27 20:02:27 2002
   # !  do NOT edit, any changes will be lost !
   # !!
   
   -7069,7 +7069,7 
   ]
 },
 {
  -'return_type' = 'void',
  +'return_type' = 'apr_status_t',
   'name' = 'apr_dbm_get_usednames_ex',
   'args' = [
 {
  
  
  
  1.84  +97 -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.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- FunctionTable.pm  28 Aug 2002 02:24:47 -  1.83
  +++ FunctionTable.pm  28 Aug 2002 03:16:31 -  1.84
   -2,7 +2,7 
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Wed Aug 28 10:12:34 2002
  +# !  Tue Aug 27 20:02:39 2002
   # !  do NOT edit, any changes will be lost !
   # !!
   
   -3701,6 +3701,20 
   ]
 },
 {
  +'return_type' = 'void',
  +'name' = 'modperl_svptr_table_clear',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'PTR_TBL_t *',
  +'name' = 'tbl'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'PTR_TBL_t *',
   'name' = 'modperl_svptr_table_clone',
   'args' = [
   -3751,6 +3765,84 
   ]
 },
 {
  +'return_type' = 'void *',
  +'name' = 'modperl_svptr_table_fetch',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'PTR_TBL_t *',
  +'name' = 'tbl'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'sv'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_svptr_table_free',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'PTR_TBL_t *',
  +'name' = 'tbl'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'PTR_TBL_t *',
  +'name' = 'modperl_svptr_table_new',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_svptr_table_split',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'PTR_TBL_t *',
  +'name' = 'tbl'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_svptr_table_store',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'PTR_TBL_t *',
  +'name' = 'tbl'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'oldv'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'newv'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'int',
   'name' = 'modperl_sys_dlclose',
   'args' = [
   -4532,6 +4624,10 
 {
   'return_type' = 'SV *',
   'name' = 'mpxs_Apache__Directive_as_string',
  +'attr' = [
  +  'static',
  +  '__inline__'
  +],
   'args' = [
 {
   'type' = 'PerlInterpreter *',
  
  
  



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

2002-08-27 Thread dougm

dougm   2002/08/27 20:17:03

  Modified:src/modules/perl mod_perl.h
  Log:
  include modperl_svptr_table.h
  
  Revision  ChangesPath
  1.52  +1 -0  modperl-2.0/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- mod_perl.h27 Aug 2002 04:26:54 -  1.51
  +++ mod_perl.h28 Aug 2002 03:17:02 -  1.52
   -66,6 +66,7 
   #include modperl_env.h
   #include modperl_cgi.h
   #include modperl_perl.h
  +#include modperl_svptr_table.h
   #include modperl_module.h
   
   void modperl_init(server_rec *s, apr_pool_t *p);