cvs commit: mod_parrot mod_parrot.c

[email protected]
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
cvsuser     02/05/16 20:15:41

  Modified:    .        mod_parrot.c
  Log:
  Add function to provide access to GET arguments
  probably leaks like a seive, should change to use palloc
  
  Revision  Changes    Path
  1.5       +14 -5     mod_parrot/mod_parrot.c
  
  Index: mod_parrot.c
  ===================================================================
  RCS file: /cvs/public/mod_parrot/mod_parrot.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- mod_parrot.c	11 Apr 2002 03:39:19 -0000	1.4
  +++ mod_parrot.c	17 May 2002 03:15:41 -0000	1.5
  @@ -19,13 +19,9 @@
    */
   module MODULE_VAR_EXPORT mod_parrot_module;
   
  -Parrot interpreter;
  +Parrot_Interp interpreter;
   request_rec *sharedr;
   
  -/*
  - * This isn't used yet.  It will be hooked into a custom op once I can
  - * make it build
  - */
   int modparrot_printf(const char *format, ...) {
     va_list ap;
     char buf[2048];
  @@ -38,6 +34,19 @@
     nbytes = ap_rputs(buf,sharedr);
   
     return nbytes; /* return the same as printf */
  +}
  +
  +char* modparrot_getargs(void) {
  +    char* s;
  +
  +    if (!sharedr->args)
  +	return NULL;
  +
  +    s = (char*)malloc(sizeof(char)*1024);
  +
  +    strncpy(s,sharedr->args,1024);
  +    s[1023] = '\0';
  +    return s;
   }
   
   static int parrot_handler(request_rec *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.