cvs commit: mod_parrot mod_parrot.c

[email protected]
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
cvsuser     01/12/01 21:01:17

  Modified:    .        mod_parrot.c
  Log:
  update for current parrot
  
  Revision  Changes    Path
  1.2       +15 -6     mod_parrot/mod_parrot.c
  
  Index: mod_parrot.c
  ===================================================================
  RCS file: /cvs/public/mod_parrot/mod_parrot.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- mod_parrot.c	2001/09/16 02:26:34	1.1
  +++ mod_parrot.c	2001/12/02 05:01:17	1.2
  @@ -7,7 +7,9 @@
   #include "util_script.h"
   
   #include "parrot/parrot.h"
  +#include "parrot/oplib/core_ops.h"
   
  +
   #include <stdio.h>
   
   /*
  @@ -16,13 +18,15 @@
    */
   module MODULE_VAR_EXPORT mod_parrot_module;
   
  -struct Perl_Interp *interpreter;
  +struct Parrot_Interp *interpreter;
   
   static int parrot_handler(request_rec *r)
   {
  +  struct PackFile * pf;
       void *program_code;
       struct stat file_stat;
       int fd;
  +  
       if (stat(r->filename, &file_stat)) {
         printf("can't stat %s, code %i\n", r->filename, errno);
         return DECLINED;
  @@ -40,7 +44,12 @@
         return 1;
       }
   
  -    program_code = init_bytecode(program_code);
  +    pf = PackFile_new();
  +    if( !PackFile_unpack(interpreter, pf, (char *)program_code,
  +			 file_stat.st_size ) ) {
  +      printf( "Can't unpack.\n" );
  +      return 1;
  +    }
   
       r->content_type = "text/plain";
       ap_soft_timeout("send example call trace", r);
  @@ -52,7 +61,7 @@
       }
   
       // so here 
  -    runops(interpreter, program_code);
  +    runops(interpreter, pf);
   
       ap_kill_timeout(r);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.