Hi List, it’s my first post here. The regex lib does not load correctly with
j805. If your linux system does not have libpcreposix.so.3 (mine has
libpcreposix.so.0.0.3), you would get some error about 1!:4 :: 0: <f, because t
wouldn’t be defined and f would contain a directory only. The following patch
looks for libpcreposix.so in addition, and correctly falls back to libjpcre.so.
diff --git a/system/main/regex.ijs b/system/main/regex.ijs
index 3b13d68..cf839ca 100644
--- a/system/main/regex.ijs
+++ b/system/main/regex.ijs
@@ -109,6 +109,14 @@ case. 'Linux' do.
jregerror=: ('"',rxdll,'" pcreposix_regerror + x i * *c x')&(15!:0)
jregfree=: ('"',rxdll,'" pcreposix_regfree + n *x')&(15!:0)
'' return.
+ elseif. 2 0-:('libpcreposix.so dummyfunction n')&(15!:0) ::(15!:10) '' do.
+ rxdll=: 'libpcreposix.so'
+ jregcomp=: ('"',rxdll,'" pcreposix_regcomp + i *x *c i')&(15!:0)
+ jregexec=: ('"',rxdll,'" pcreposix_regexec + i *x *c x *i i')&(15!:0)
+ jregerror=: ('"',rxdll,'" pcreposix_regerror + x i * *c x')&(15!:0)
+ jregfree=: ('"',rxdll,'" pcreposix_regfree + n *x')&(15!:0)
+ '' return.
+ elseif. do. t=.'libjpcre.so'
end.
case. do. t=. 'libjpcre.so'
end.
Best,
Xiao-Yong
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm