/[wait]/branches/CPAN/WAIT.xs
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/CPAN/WAIT.xs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by unknown, Fri Apr 28 15:41:10 2000 UTC revision 13 by ulpfr, Fri Apr 28 15:42:44 2000 UTC
# Line 1  Line 1 
1    #define PERL_POLLUTE
2    
3  /*                               -*- Mode: C -*-  /*                               -*- Mode: C -*-
4   * $Basename: WAIT.xs $   * $Basename: WAIT.xs $
5   * $Revision: 1.3 $   * $Revision: 1.6 $
6   * Author          : Ulrich Pfeifer   * Author          : Ulrich Pfeifer
7   * Created On      : Thu Aug 15 18:01:00 1996   * Created On      : Thu Aug 15 18:01:00 1996
8   * Last Modified By: Ulrich Pfeifer   * Last Modified By: Ulrich Pfeifer
# Line 19  extern "C" { Line 21  extern "C" {
21  #include "EXTERN.h"  #include "EXTERN.h"
22  #include "perl.h"  #include "perl.h"
23  #include "XSUB.h"  #include "XSUB.h"
24    #include "ppport.h"
25  #ifdef __cplusplus  #ifdef __cplusplus
26  }  }
27  #endif  #endif
# Line 203  CODE: Line 206  CODE:
206  {  {
207    char *copy;    char *copy;
208    ST(0) = sv_mortalcopy(ST(0));    ST(0) = sv_mortalcopy(ST(0));
209    copy = (char *)SvPV(ST(0),na);    copy = (char *)SvPV(ST(0),PL_na);
210    (void) isolc(copy, (int)na);    (void) isolc(copy, (int)PL_na);
211  }  }
212    
213  char *  char *
# Line 214  CODE: Line 217  CODE:
217  {  {
218    char *copy;    char *copy;
219    ST(0) = sv_mortalcopy(ST(0));    ST(0) = sv_mortalcopy(ST(0));
220    copy = (char *)SvPV(ST(0),na);    copy = (char *)SvPV(ST(0),PL_na);
221    (void) isouc(copy, (int)na);    (void) isouc(copy, (int)PL_na);
222  }  }
223    
224  char *  char *
# Line 225  CODE: Line 228  CODE:
228  {  {
229    char *copy;    char *copy;
230    ST(0) = sv_mortalcopy(ST(0));    ST(0) = sv_mortalcopy(ST(0));
231    copy = (char *)SvPV(ST(0),na);    copy = (char *)SvPV(ST(0),PL_na);
232    (void) isotr(copy, (int)na);    (void) isotr(copy, (int)PL_na);
233  }  }
234    
235  char *  char *
# Line 234  disolc(word) Line 237  disolc(word)
237          char *  word          char *  word
238  CODE:  CODE:
239  {  {
240    (void) isolc(word, (int)na);    (void) isolc(word, (int)PL_na);
241  }  }
242    
243  char *  char *
# Line 242  disouc(word) Line 245  disouc(word)
245          char *  word          char *  word
246  CODE:  CODE:
247  {  {
248    (void) isouc(word, (int)na);    (void) isouc(word, (int)PL_na);
249  }  }
250    
251  char *  char *
# Line 250  disotr(word) Line 253  disotr(word)
253          char *  word          char *  word
254  CODE:  CODE:
255  {  {
256    (void) isotr(word, (int)na);    (void) isotr(word, (int)PL_na);
257  }  }
258    
259  char *  char *
# Line 306  split_pos(ipair) Line 309  split_pos(ipair)
309  PPCODE:  PPCODE:
310  {  {
311    AV *   aipair  = (AV *) SvRV(ipair);    AV *   aipair  = (AV *) SvRV(ipair);
312    char * word    = (char *)SvPV(*av_fetch(aipair, 0, 0),na);    char * word    = (char *)SvPV(*av_fetch(aipair, 0, 0),PL_na);
313    int    offset  = (av_len(aipair)?SvIV(*av_fetch(aipair, 1, 0)):0);    int    offset  = (av_len(aipair)?SvIV(*av_fetch(aipair, 1, 0)):0);
314    char * begin   = word;    char * begin   = word;
315    SV   * pair[2];    SV   * pair[2];
# Line 326  PPCODE: Line 329  PPCODE:
329      sv_setpvn(pair[0], start, (STRLEN)(word-start));      sv_setpvn(pair[0], start, (STRLEN)(word-start));
330      sv_setiv(pair[1],offset + start - begin);      sv_setiv(pair[1],offset + start - begin);
331      apair   = av_make(2, pair);      apair   = av_make(2, pair);
332      ref     = newRV((SV*) apair);      ref     = newRV_inc((SV*) apair);
333      SvREFCNT_dec(apair);      SvREFCNT_dec(apair);
334      PUSHs(sv_2mortal(ref));      PUSHs(sv_2mortal(ref));
335    }    }

Legend:
Removed from v.12  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.26