perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h
Date Tue, 18 Dec 2001 03:54:49 GMT
dougm       01/12/17 19:54:49

  Modified:    xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  cut down some duplication with PUSH_FILE_GLOB_* macros
  
  Revision  Changes    Path
  1.6       +15 -9     modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Apache__SubProcess.h	2001/12/18 03:44:33	1.5
  +++ Apache__SubProcess.h	2001/12/18 03:54:49	1.6
  @@ -99,6 +99,15 @@
       return rc;
   }
   
  +#define PUSH_FILE_GLOB(fp, type) \
  +    PUSHs(apr_file_to_glob(aTHX_ fp, r->pool, type))
  +
  +#define PUSH_FILE_GLOB_READ(fp) \
  +    PUSH_FILE_GLOB(fp, APR_PERLIO_HOOK_READ)
  +
  +#define PUSH_FILE_GLOB_WRITE(fp) \
  +    PUSH_FILE_GLOB(fp, APR_PERLIO_HOOK_WRITE)
  +
   static XS(MPXS_modperl_spawn_proc_prog)
   {
       dXSARGS;
  @@ -161,9 +170,8 @@
                   /* XXX: need to do lots of error checking before
                    * putting the object on the stack
                    */
  -                SV *out = apr_file_to_glob(aTHX_ script_out, r->pool,
  -                                           APR_PERLIO_HOOK_READ);
  -                XPUSHs(out);
  +                EXTEND(SP, 1);
  +                PUSH_FILE_GLOB_READ(script_out);
   
                   rc = apr_file_close(script_in);
                   if (rc != APR_SUCCESS) {
  @@ -176,12 +184,10 @@
                   }
               }
               else {
  -                XPUSHs(apr_file_to_glob(aTHX_ script_in,
  -                                        r->pool, APR_PERLIO_HOOK_WRITE));
  -                XPUSHs(apr_file_to_glob(aTHX_ script_out,
  -                                        r->pool, APR_PERLIO_HOOK_READ));
  -                XPUSHs(apr_file_to_glob(aTHX_ script_err,
  -                                        r->pool, APR_PERLIO_HOOK_READ));
  +                EXTEND(SP, 3);
  +                PUSH_FILE_GLOB_WRITE(script_in);
  +                PUSH_FILE_GLOB_READ(script_out);
  +                PUSH_FILE_GLOB_READ(script_err);
               }
           }
           else {
  
  
  

Mime
View raw message