From 61421900a9a844e876ebbbc683353f32d300c303 Mon Sep 17 00:00:00 2001 From: Paul Marquess Date: Sun, 11 Nov 2001 22:33:33 +0000 Subject: [PATCH] Update to Filter::Util::Call Message-ID: Use the new CXT* macros. p4raw-id: //depot/perl@12972 --- ext/Filter/Util/Call/Call.pm | 2 +- ext/Filter/Util/Call/Call.xs | 48 ++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ext/Filter/Util/Call/Call.pm b/ext/Filter/Util/Call/Call.pm index 6f301c3..a560626 100644 --- a/ext/Filter/Util/Call/Call.pm +++ b/ext/Filter/Util/Call/Call.pm @@ -18,7 +18,7 @@ use vars qw($VERSION @ISA @EXPORT) ; @ISA = qw(Exporter DynaLoader); @EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ; -$VERSION = "1.05" ; +$VERSION = "1.06" ; sub filter_read_exact($) { diff --git a/ext/Filter/Util/Call/Call.xs b/ext/Filter/Util/Call/Call.xs index 54b213b..0215fa6 100644 --- a/ext/Filter/Util/Call/Call.xs +++ b/ext/Filter/Util/Call/Call.xs @@ -2,8 +2,8 @@ * 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 @@ -15,28 +15,10 @@ #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) @@ -48,13 +30,25 @@ 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; @@ -204,6 +198,7 @@ filter_read(size=0) int size CODE: { + dMY_CXT; SV * buffer = DEFSV ; RETVAL = FILTER_READ(IDX + 1, buffer, size) ; @@ -239,6 +234,7 @@ real_import(object, perlmodule, coderef) void filter_del() CODE: + dMY_CXT; FILTER_ACTIVE(FILTER_DATA(IDX)) = FALSE ; @@ -251,8 +247,12 @@ unimport(package="$Package", ...) BOOT: + { + MY_CXT_INIT; + fdebug = 0; /* temporary hack to control debugging in toke.c */ if (fdebug) filter_add(NULL, (fdebug) ? (SV*)"1" : (SV*)"0"); + } -- 2.7.4