ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/String-Similarity/Similarity.xs
(Generate patch)

Comparing String-Similarity/Similarity.xs (file contents):
Revision 1.1 by root, Sat Jun 25 09:55:53 2005 UTC vs.
Revision 1.2 by root, Tue Nov 4 15:31:38 2008 UTC

3#include "XSUB.h" 3#include "XSUB.h"
4 4
5#include "fstrcmp.h" 5#include "fstrcmp.h"
6#include "fstrcmp.c" 6#include "fstrcmp.c"
7 7
8CHAR * 8UV *
9text2CHAR (SV *sv, STRLEN *lenp) 9text2UV (SV *sv, STRLEN *lenp)
10{ 10{
11 STRLEN len; 11 STRLEN len;
12 char *s = SvPV (sv, len); 12 char *s = SvPV (sv, len);
13 UV *r = (UV *)SvPVX (sv_2mortal (NEWSV (0, (len + 1) * sizeof (UV)))); 13 UV *r = (UV *)SvPVX (sv_2mortal (NEWSV (0, (len + 1) * sizeof (UV))));
14 UV *p = r; 14 UV *p = r;
44 double minimum_similarity 44 double minimum_similarity
45 PROTOTYPE: @ 45 PROTOTYPE: @
46 CODE: 46 CODE:
47{ 47{
48 STRLEN l1, l2; 48 STRLEN l1, l2;
49 CHAR *c1 = text2CHAR (s1, &l1); 49 UV *c1 = text2UV (s1, &l1);
50 CHAR *c2 = text2CHAR (s2, &l2); 50 UV *c2 = text2UV (s2, &l2);
51 RETVAL = fstrcmp (c1, l1, c2, l2, minimum_similarity); 51 RETVAL = fstrcmp (c1, l1, c2, l2, minimum_similarity);
52} 52}
53 OUTPUT: 53 OUTPUT:
54 RETVAL 54 RETVAL
55 55

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines