* Filename : Call.xs
*
* Author : Paul Marquess
- * Date : 26th March 2000
- * Version : 1.05
+ * Date : 11th November 2001
+ * Version : 1.06
*
* Copyright (c) 1995-2001 Paul Marquess. All rights reserved.
* This program is free software; you can redistribute it and/or
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
-
-#ifndef PERL_VERSION
-# include "patchlevel.h"
-# define PERL_REVISION 5
-# define PERL_VERSION PATCHLEVEL
-# define PERL_SUBVERSION SUBVERSION
-#endif
-
-/* defgv must be accessed differently under threaded perl */
-/* DEFSV et al are in 5.004_56 */
-#ifndef DEFSV
-# define DEFSV GvSV(defgv)
+#ifdef _NOT_CORE
+# include "ppport.h"
#endif
-#ifndef pTHX
-# define pTHX
-# define pTHX_
-# define aTHX
-# define aTHX_
-#endif
-
-
/* Internal defines */
#define PERL_MODULE(s) IoBOTTOM_NAME(s)
#define PERL_OBJECT(s) IoTOP_GV(s)
do { SvPVX(sv)[len] = '\0'; SvCUR_set(sv, len); } while (0)
+/* Global Data */
+
+#define MY_CXT_KEY "Filter::Util::Call::_guts" XS_VERSION
+
+typedef struct {
+ int x_fdebug ;
+ int x_current_idx ;
+} my_cxt_t;
+
+START_MY_CXT
+
+#define fdebug (MY_CXT.x_fdebug)
+#define current_idx (MY_CXT.x_current_idx)
-static int fdebug = 0;
-static int current_idx ;
static I32
filter_call(pTHX_ int idx, SV *buf_sv, int maxlen)
{
+ dMY_CXT;
SV *my_sv = FILTER_DATA(idx);
char *nl = "\n";
char *p;
int size
CODE:
{
+ dMY_CXT;
SV * buffer = DEFSV ;
RETVAL = FILTER_READ(IDX + 1, buffer, size) ;
void
filter_del()
CODE:
+ dMY_CXT;
FILTER_ACTIVE(FILTER_DATA(IDX)) = FALSE ;
BOOT:
+ {
+ MY_CXT_INIT;
+ fdebug = 0;
/* temporary hack to control debugging in toke.c */
if (fdebug)
filter_add(NULL, (fdebug) ? (SV*)"1" : (SV*)"0");
+ }